Skip to content

v1.23.0 — audit --doc-index and --cites

Choose a tag to compare

@CesarRivasP CesarRivasP released this 06 Nov 17:28
· 49 commits to main since this release
8d85b62

Why

--index maps the registry, but the docs had no map: real sets carry up to 5.8k lines in 16 docs, and a round that touches two entries read them whole.

What

  • audit.py <dir> --doc-index: per doc of docs[], every heading with its line span L<a>-<b>, and under it the registry entries the section cites on its own lines — by qualified key (limits.foo), by id (D24), or by a datum's value. --json gives the same data with own_end, maybe and skipped.
  • --doc-index --cites KEY [KEY ...]: the sections citing each entry, as the span of the lines that cite it and the section's full span. A top-level key with entries aggregates them; a top-level scalar exits 2.
  • A citation must name exactly one entry: a value shared by several entries cites none (real case: a date in 23 fields made every changelog section cite the same 13 decisions); one-letter ids (D1, R2, also Cloudflare product names) are listed as maybe; a numeric value needs 4+ digits and cannot be part of a decimal or a percentage, while a sentence's own period still counts.
  • The heading scanner is line-based: fences (``` / ~~~), HTML comments opening a line, BOM, CRLF and trailing hashes handled; docs it could not read are listed as skipped.

Measured on real sets

20–32 KB of index for 230–450 KB of docs, 0.4–0.7 s. Spans checked by hand against the files; citations spot-checked against the text.

Review

Reviewed by a second model (Claude Opus; the OpenCode and Gemini accounts were out of quota). Its eight bugs and two risks were fixed, each with a test that fails without the fix. One more false negative found on a synthetic set after that fix (timeout 30000.) is fixed and tested too.

Verification

tests/test_audit.py 330/330 across 69 fixtures; ship, facts, triage, render, sync green.

Release: v1.23.0 (README row and clone pin bumped). Merge with a merge commit.