fix(doc-budgets): address Codex review — exact-freeze ceilings, list missing entries

- The manifest now freezes each budgeted doc at its exact current wc -w
  count, matching the documented policy (a ceiling starts at the doc's
  current size); the headroom that contradicted the freeze claim is
  gone. Post-rewrite ratchets may still land at new-size-plus-headroom,
  per the skill's ratchet rule — that is a different moment than the
  initial freeze.
- --list now renders MISS/BAD rows for missing files and malformed
  ceilings instead of silently dropping them (gate mode already failed
  correctly; the report mode no longer under-reports).
This commit is contained in:
Tianyi Cui
2026-07-04 14:27:49 +08:00
parent aa36b3b36b
commit 65690d8cf1
2 changed files with 8 additions and 6 deletions

View File

@@ -1,8 +1,8 @@
{
"AGENTS.md": 8200,
"docs/AGENTS.md": 1000,
"docs/architecture.md": 3950,
"examples/AGENTS.md": 600,
"packages/AGENTS.md": 600,
"packages/README.md": 1900
"AGENTS.md": 8130,
"docs/AGENTS.md": 982,
"docs/architecture.md": 3897,
"examples/AGENTS.md": 579,
"packages/AGENTS.md": 577,
"packages/README.md": 1856
}

View File

@@ -46,11 +46,13 @@ const rows: string[] = []
for (const [path, ceiling] of Object.entries(manifest)) {
if (!Number.isInteger(ceiling) || ceiling <= 0) {
rows.push(`BAD ${'—'.padStart(6)} / ${String(ceiling).padEnd(6)} ${path}`)
failures.push(`${path}: ceiling must be a positive integer, got ${ceiling}`)
continue
}
const abs = resolve(root, path)
if (!existsSync(abs)) {
rows.push(`MISS ${'—'.padStart(6)} / ${String(ceiling).padEnd(6)} ${path}`)
failures.push(`${path}: budgeted file does not exist (renamed or deleted? update scripts/doc-budgets.manifest.json in the same change)`)
continue
}