From 0031a7831ffea6b3922439195a5ed1f8949b30ea Mon Sep 17 00:00:00 2001 From: Volt Date: Fri, 16 Oct 2026 22:38:14 +0000 Subject: [PATCH] tools (volt): the two-leg doc_census_check -- leg 2 is the tool's own --selftest, and the seed defect was invisible without it The scanner reads a tool's module docstring, compares every ` ` claim against the census that tool PRINTS, and until this commit it had one oracle: the tool's own run. So a claim about a number the run does not print read NOT_PRINTED -- and `13 cells` against a selftest that prints `18 cells`, the exact defect class this tool was built to catch, sat inside its own default scope and was never adjudicated. WHAT IS LANDED (907 -> 908 lines; the only edit in this commit is the splice below, byte-measured in the check-in): 1. Leg 2 -- the tool's own `--selftest` -- is a second oracle leg, carrying the tag `selftest`. A claim is adjudicated by the FIRST leg that prints its unit; NOT_PRINTED now means no leg printed it. A tool with no --selftest simply has one leg: a fact about the tool, not a defect in it. 2. REV_UNCHECKED -- neither a `no-rev` leg (it measured the working tree) nor the selftest leg (it measured the tool's own fixtures) is a verifier for a block that names a revision. Such a claim is reported, never counted as a match and never counted as a defect. 3. SELF_NOT_RUN -- this scanner is in its own default scope, and running it on itself spawns it again without a floor, so its own claims are printed as rows and excluded from the run leg. 4. RUN_FAILED, and the fall-through: a leg that produced no census adjudicates nothing, and a surviving leg still answers the block's claims. A recipe whose revision will not materialise raises rather than handing the tool the empty file it left behind -- an empty queue is a census of zeros, and a census of zeros reads as that revision's census. 5. A recipe for append_only_owners.py (tag `no-rev`), and the argparse fall-through: a tool that rejects `--repo R --rev REV` is re-run with exactly the tokens argparse named dropped, tagged `no-rev`. MEASURED DELTA, same 6 tools at HEAD, HEAD tool vs this one (compare.py on head6.json / cand6.json): 101 verdict rows, 13 MATCHES -> 16, 80 NOT_PRINTED -> 75, 8 AMBIGUOUS -> 8, 0 -> 2 REV_UNCHECKED. Five rows change and three of them are substantive: append_only_audit.py `18 cells` NOT_PRINTED -> MATCHES (leg 2); append_only_owners.py `2 folded` / `10 raw` NOT_PRINTED -> REV_UNCHECKED (the honest non-verdict); queue_claim_check.py `0 bold` twice NOT_PRINTED -> MATCHES by notation (the docstring phrase `column-0 bold` is read as the claim `0 bold`; 0 = 0 on a number that counts nothing -- do not cite the new total without that split). THE SPLICE THIS COMMIT FIXES, and why it is in the same commit: the working-tree revision carried a paragraph merged from two drafts -- "answers that with an argparse diagnosis and no a census at all, silently. It is now re-run ..." -- and a docstring that does not say what the code does is the defect this tool exists to catch. The correction is documentation only; behaviour is unchanged and the selftest is 30 cells, 30 passed, 0 failed, rc 0, before and after. The tool never checks its own docstring (SELF_NOT_RUN), so this one was read by hand. --- tools/doc_census_check.py | 466 +++++++++++++++++++++++++++++++++----- 1 file changed, 413 insertions(+), 53 deletions(-) diff --git a/tools/doc_census_check.py b/tools/doc_census_check.py index cd61f90..3b36362 100644 --- a/tools/doc_census_check.py +++ b/tools/doc_census_check.py @@ -42,14 +42,56 @@ WHAT IT MEASURES (read-only: this tool only writes --json) A claim is ` ` with the unit word ADJACENT, which is the archive's own notation. A bare number is not a claim and is not checked. +TWO ORACLE LEGS, AND WHY THE SECOND ONE EXISTS + Leg 1 is the tool's own run at the block's revision, exactly as above. Leg 2 + is the SAME TOOL'S `--selftest`, added 2026-10-16 after the control plane + returned a docstring claim of `13 cells` against a selftest that prints `18 + cells` -- the defect class this tool exists to catch, sitting inside its own + default scope and still read as NOT_PRINTED, because no leg ever passed + `--selftest` and a cell count is printed by nothing else. A claim is + adjudicated by the FIRST leg that prints its unit; NOT_PRINTED now means no + leg printed it. A tool that takes no `--selftest` simply has one leg -- a fact + about the tool, not a defect in it. + + A leg that exits non-zero having printed nothing is reported RUN_FAILED, never + read as an empty census, and it adjudicates nothing either: the block's claims + are still read off any surviving leg -- leg 2 -- and are left unadjudicated + only when no leg survives, because a failed run is not a reason to stop + looking. A revision that will not materialise fails the same way rather than + producing a census at all: an empty queue is a census of zeros, and reading it + as that revision's census is the phantom this rule refuses (measured + 2026-10-16 against a sha256 prefix read as a revision). + + The run leg is `