You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tooling): derive the docs-audit scope from the filesystem instead of a hand-kept list (#4851) (#4921)
`.claude/workflows/docs-accuracy-audit.js` carried its default audit scope inline,
as a hand-kept `ALL_HANDWRITTEN` array behind a "keep in sync with
`affected-docs.mjs --all`" comment. Nothing checked that promise, and it had
rotted in BOTH directions:
- 16 listed paths no longer existed — 10 of them the whole
`content/docs/protocol/objectos/**` directory, renamed to `protocol/kernel/`.
An audit agent pointed at a non-existent file reads nothing and reports
`fixCount: 0`, indistinguishable in the run summary from a doc that was
checked and found accurate. That is how #4781 and #4817 sat in
`protocol/kernel/` for ~2 months under green "full" audits.
- 48 existing docs were absent from the list — including all 9 of
`protocol/kernel/**` and the whole `content/docs/capabilities/` directory. A
run logging `FULL audit` was auditing 130 of 178 hand-written docs.
The list stays inline because it must: a workflow script runs in a `node:vm`
context with no require/import/filesystem, so it can neither walk
`content/docs/` nor read a JSON artifact. So it is GENERATED instead —
`scripts/docs-audit/check-audit-scope.mjs --write` derives it from
`affected-docs.mjs --all` (one definition of "hand-written doc"), and
`pnpm check:docs-audit-scope` fails in lint.yml when the block and
`content/docs/` disagree in either direction, naming every entry. Missing
markers or an unparseable block fail too — a gate that cannot find its subject
must go red, not green.
A CI gate only sees the default list, so two more nets cover the rest:
- the workflow preflights its resolved scope (including a caller-supplied
`args.docs`) and refuses to start, naming every path that does not exist; the
preflight's own arithmetic is reconciled against the scope, so a verdict that
cannot account for every path exactly once is a failed preflight, not a pass;
- every audit agent reports `docExists` from the path that actually opens the
file, and the run throws if any comes back false — a self-check that runs
somewhere other than the real read path proves nothing about it (#4868).
Same discipline as #4690 / #4777 / #4804 / #4835 / #4868 / #4890.
Claude-Session: https://claude.ai/code/session_018iARDqtrhQgz6fVHDeDkbQ
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments