fix(audit): repair the content auditor after the Astro migration (audit C2) #71

Merged
abiwab merged 2 commits from fix/audit-c2 into main 2026-09-30 20:36:57 +02:00
Owner

Audit C2, broken since the VitePress to Astro migration. bun run --cwd audit audit read its trusted corpus from packages/docs/src/reference/syntax, which no longer exists, so the corpus was empty and 420 of 423 snippets (its own good examples included) were flagged.

Three causes, all in the audit workspace:

  • config.ts pointed at the old docs tree (syntax pages, narrative tutorial/how-to dirs, public examples, the exclude dir). They now name packages/docs/src/content/docs/{,fr/}docs/... and packages/docs/public/examples. A page is resolved as .md or .mdx
  • the scanner only read .md files, while many docs pages are .mdx now (52 more snippets scanned: 434 -> 486)
  • the real reason nobody noticed: every extractor skips a missing path quietly. missingConfiguredPaths() is now checked at startup and the audit exits 1 listing what is missing

Result: 80 of 486 snippets flagged (was 420 of 423), the trusted vocabulary is loaded (51 fences per language), and the tool's own self-test no longer flags its good examples (13 anomalies -> 9 honest coverage gaps).

audit/tests/config.test.ts (5 tests, run by the root bun test) fails on the old configuration: paths exist, both languages yield trusted fences, .mdx is read, the self-test's good examples are not flagged. Checking it already caught one mistake of mine (extensions left in the page names).

Left for a human, as the tool itself says: the doc gained a 21st mistake example (a // comment in the middle of a step, 2026-08-16) that is not transcribed in self-test-cases.ts; and the newly visible findings (modules.mdx @use excerpts, 9 self-test gaps) are triage items, not silenced. No changeset: the workspace is private. ci (1347 tests) passes.

Audit C2, broken since the VitePress to Astro migration. `bun run --cwd audit audit` read its trusted corpus from `packages/docs/src/reference/syntax`, which no longer exists, so the corpus was empty and 420 of 423 snippets (its own good examples included) were flagged. Three causes, all in the audit workspace: - `config.ts` pointed at the old docs tree (syntax pages, narrative tutorial/how-to dirs, public examples, the exclude dir). They now name `packages/docs/src/content/docs/{,fr/}docs/...` and `packages/docs/public/examples`. A page is resolved as `.md` or `.mdx` - the scanner only read `.md` files, while many docs pages are `.mdx` now (52 more snippets scanned: 434 -> 486) - the real reason nobody noticed: every extractor skips a missing path quietly. `missingConfiguredPaths()` is now checked at startup and the audit exits 1 listing what is missing Result: 80 of 486 snippets flagged (was 420 of 423), the trusted vocabulary is loaded (51 fences per language), and the tool's own self-test no longer flags its good examples (13 anomalies -> 9 honest coverage gaps). `audit/tests/config.test.ts` (5 tests, run by the root `bun test`) fails on the old configuration: paths exist, both languages yield trusted fences, `.mdx` is read, the self-test's good examples are not flagged. Checking it already caught one mistake of mine (extensions left in the page names). Left for a human, as the tool itself says: the doc gained a 21st mistake example (a `//` comment in the middle of a step, 2026-08-16) that is not transcribed in `self-test-cases.ts`; and the newly visible findings (modules.mdx `@use` excerpts, 9 self-test gaps) are triage items, not silenced. No changeset: the workspace is private. ci (1347 tests) passes.
abiwab merged commit 93a5cf8c14 into main 2026-09-30 20:36:57 +02:00
abiwab deleted branch fix/audit-c2 2026-09-30 20:36:57 +02:00
Sign in to join this conversation.
No description provided.