tools (volt): doc_census_check.py -- a colon before the number is a line cite, not a count

Timmy's reply 31 logged the defect: `--fail` on `tools/queue_claim_check.py` was
red with 2 STALE (22 claims, 0 split, 0 leg failures), because that docstring
records its own past behaviour as "graded `:7303` CLOSED on Mercury's `:9869`"
and "printed `open set: Q37:5278`". The claim reader took 7303 for a count of
CLOSED rows (printed 13) and of open rows (printed 2). Both are queue LINE
NUMBERS in backticks -- the shape CLAIM_EQ already refuses one rule over
("`WORK-QUEUE.md:8586` is a citation") and the value/unit form had no guard for.

Measured over every tracked docstring at HEAD: 123 claims read, 11 of them
carrying a ':' immediately before the number, across four tools --
citation_hash_class.py (:8467 defect), citation_resolve_check.py (four: :8003
cites, :6348 column, :9 reads, :8530 Mercury), queue_claim_check.py (five, the
two false STALEs among them), queue_index.py (:7246 prose). No one of them names
a unit the tool prints. ':' joins the CLAIM lookbehind.

Same four tools, `--fail`, before -> after:
  claims     8/26/22/9 -> 7/22/17/8   (65 -> 54, the 11 cites)
  STALE      2 -> 0 ;  rc 1 -> 0
  MATCHES    19 -> 19 ; AMBIGUOUS 10 -> 10 ; REV_UNCHECKED 3 -> 3
No verified row moved, which is the invariant the hyphen rule shipped under.

Selftest 80 -> 82 cells; sweep's advertised count 80 -> 82 in the USAGE block.
The two new cells are RED->GREEN measured on both builds, one call apart: old
reads [('CLOSED',7303)] and [('while',5278),('rows',13)], new reads [] and
[('rows',13)]. verify.py 3/3 legs rc 0; selftest 82/82.
This commit is contained in:
timmy committed 2026-10-19 04:53:38 +00:00
1 parent ee8baa54f0
commit a2d9bc0654
1 file changed
+28 -2
+28 -2
View File
@@ -220,7 +220,7 @@ FAILING ON THE CLASS IT CATCHES (`--fail`)
USAGE USAGE
python3 doc_census_check.py [--repo DIR] [--rev HEAD] [--tools NAME...] python3 doc_census_check.py [--repo DIR] [--rev HEAD] [--tools NAME...]
[--json OUT] [--fail] [--no-run] [--vocab PATH] [--save-vocab PATH] [--json OUT] [--fail] [--no-run] [--vocab PATH] [--save-vocab PATH]
[--selftest] # selftest: 80 cells, one per claim class [--selftest] # selftest: 82 cells, one per claim class
""" """
import argparse import argparse
import ast import ast
@@ -266,8 +266,27 @@ DEFAULT_REPO = "/root/troupe-standup"
# (`citations-per-block`) is no longer read, and the invariant that licenses # (`citations-per-block`) is no longer read, and the invariant that licenses
# this tightening is that the 26 MATCHES do not move -- measured before and # this tightening is that the 26 MATCHES do not move -- measured before and
# after, same 26 rows. # after, same 26 rows.
#
# A COLON BEFORE THE NUMBER IS A LINE CITE, NOT A COUNT, made 2026-10-19 after
# the --fail gate went red at HEAD on the same tool it went red on for the
# hyphen: `queue_claim_check.py`'s docstring records its own past behaviour as
# "graded `:7303` CLOSED on Mercury's `:9869`" and "printed `open set:
# Q37:5278`", and the reader took `7303` for a count of CLOSED rows (printed
# 13) and of open rows (printed 2). Both are queue LINE NUMBERS in backticks,
# the same shape `CLAIM_EQ` already refuses one rule over ("`WORK-QUEUE.md:8586`
# is a citation"); the value/unit form had no such guard because no docstring
# had yet written `:NNNN <state word>`. Measured on every tracked docstring at
# HEAD: eleven of the hundred and twenty-three claims read carry a ':' immediately
# before the number, and every one is a line cite across four tools --
# `citation_hash_class.py` (:8467 defect),
# `citation_resolve_check.py` (four: :8003 cites, :6348 column, :9 reads, :8530
# Mercury), `queue_claim_check.py` (five, the two false STALEs among them) and
# `queue_index.py` (:7246 prose). Not one names a unit the tool prints. The
# invariant that licenses this tightening is that no MATCHES row moves, the
# same invariant the hyphen rule shipped under; the cost is that a count
# written `:13 claims` is no longer read, and no scanner writes one.
CLAIM = re.compile( CLAIM = re.compile(
r"(?<![0-9A-Za-z_.])(?P<num>[0-9]+(?:,[0-9]{3})*)(?P<sep>\s{1,2}|[)\]}\"'`*]\s)" r"(?<![0-9A-Za-z_.:])(?P<num>[0-9]+(?:,[0-9]{3})*)(?P<sep>\s{1,2}|[)\]}\"'`*]\s)"
r"(?P<unit>[A-Za-z_][A-Za-z0-9_]*|[A-Z][A-Z_]{2,})\b(?!-)") r"(?P<unit>[A-Za-z_][A-Za-z0-9_]*|[A-Z][A-Z_]{2,})\b(?!-)")
CLAIM_EQ = re.compile( CLAIM_EQ = re.compile(
r"(?P<unit>[A-Za-z_][A-Za-z0-9_]*)\s*[:=]\s*\**\s*(?P<num>[0-9]+(?:,[0-9]{3})*)") r"(?P<unit>[A-Za-z_][A-Za-z0-9_]*)\s*[:=]\s*\**\s*(?P<num>[0-9]+(?:,[0-9]{3})*)")
@@ -648,6 +667,13 @@ def _fixture_checks():
check("claims: the tightening keeps a count and its unit", check("claims: the tightening keeps a count and its unit",
claims_of("471 UNRESOLVED and 1,612 citations"), claims_of("471 UNRESOLVED and 1,612 citations"),
[("UNRESOLVED", 471), ("citations", 1612)]) [("UNRESOLVED", 471), ("citations", 1612)])
# the colon rule, 2026-10-19: a queue line number in backticks followed by a
# state word is a CITE; the positive control shows the guard is only the
# character immediately before the number, not a blanket refusal
check("claims: a line cite is not a claim",
claims_of("graded `:7303` CLOSED on Mercury's `:9869`"), [])
check("claims: a count beside a line cite is still a claim",
claims_of("open set: Q37:5278 while 13 rows close"), [("rows", 13)])
check("claims: the block's rev is read", "babdadc" in revs_seen, True) check("claims: the block's rev is read", "babdadc" in revs_seen, True)
# the digest rule, one signal per cell, and the negative control between # the digest rule, one signal per cell, and the negative control between
# them -- the text of each is the text of the defect, measured at HEAD # them -- the text of each is the text of the defect, measured at HEAD