Files
AgentProbe/scripts/refresh-quality-score.ts
SwiftyandCodex 7dd6e5226d chore(harness): add update-harness skill and CI gate
Summary:
- Add the repo-local update-harness skill and Claude skill symlink.
- Add a Bun-owned ci command and route GitHub CI through it.
- Tighten generated-doc freshness and workspace inventory generation.

Rationale:
- Keeps the harness upgrade workflow available in-repo for future agents.
- Gives local and hosted CI one shared command instead of duplicated YAML.
- Makes generated inventory depend on tracked files and catches real drift.

Tests:
- bun install --frozen-lockfile
- bun run ci

Co-authored-by: Codex <[email protected]>
2026-04-18 22:19:15 +02:00

116 lines
2.8 KiB
TypeScript

#!/usr/bin/env bun
/**
* Regenerates docs/QUALITY_SCORE.md from current repo state.
*/
import { existsSync, writeFileSync } from "node:fs";
import { dirname, join } from "node:path";
const REPO_ROOT = join(dirname(new URL(import.meta.url).pathname), "..");
type Check = {
area: string;
ok: boolean;
notes: string;
};
function has(path: string): boolean {
return existsSync(join(REPO_ROOT, path));
}
function row(area: string, required: string[], notes: string): Check {
const missing = required.filter((path) => !has(path));
return {
area,
ok: missing.length === 0,
notes: missing.length === 0 ? notes : `Missing: ${missing.join(", ")}`,
};
}
const checks: Check[] = [
row(
"Knowledge base",
["AGENTS.md", "docs/README.md", "docs/DESIGN.md", "docs/ARCHITECTURE.md"],
"Agent-first docs entrypoints present",
),
row(
"Product specs",
[
"docs/product-specs/platform.md",
"docs/product-specs/current-state.md",
"docs/product-specs/e2e-checklist.md",
],
"Canonical behavior and coverage snapshots present",
),
row(
"Planning",
[
"docs/PLANS.md",
"docs/exec-plans/README.md",
"docs/exec-plans/tech-debt-tracker.md",
],
"Plans and debt tracking are versioned in-repo",
),
row(
"Toolchain contract",
[
"package.json",
"docs/references/bun-typescript.md",
"docs/references/quality-gates.md",
],
"Bun-first workflow and TypeScript standards documented",
),
row(
"Validation gates",
[
"package.json",
"docs/references/quality-gates.md",
"scripts/fast-feedback.sh",
".github/workflows/ci.yaml",
],
"Fast local and CI-equivalent gates are repo-owned",
),
row(
"Reliability standards",
["docs/RELIABILITY.md", "docs/references/observability.md"],
"Logging, metrics, spans, and latency budgets are documented",
),
row(
"Generated docs",
["docs/generated/INDEX.md", "docs/generated/workspace-inventory.md"],
"Generated inventories available and script-owned",
),
];
const date = new Date().toISOString().split("T")[0];
const rows = checks
.map(
(c) =>
`| ${c.area.padEnd(20)} | ${c.ok ? "\u{1F7E2}" : "\u{1F7E1}"} | ${c.notes} |`,
)
.join("\n");
const content = `# Quality Score
Last updated: ${date}
## Health summary
| Area | Status | Notes |
|----------------------|--------|-------|
${rows}
## Incidents
_No incidents yet._
## Next cleanup targets
1. Land the Bun + TypeScript runtime so the implementation matches the docs contract.
2. Extend Bun-owned coverage to helper commands, observability assertions, and latency-budget checks.
3. Promote reliability budgets from documented standards into executable checks.
`;
writeFileSync(join(REPO_ROOT, "docs", "QUALITY_SCORE.md"), content);
console.log("Refreshed docs/QUALITY_SCORE.md");