diff --git a/tools/doc_census_check.py b/tools/doc_census_check.py index 5b42a60..4480eda 100644 --- a/tools/doc_census_check.py +++ b/tools/doc_census_check.py @@ -220,7 +220,7 @@ FAILING ON THE CLASS IT CATCHES (`--fail`) USAGE python3 doc_census_check.py [--repo DIR] [--rev HEAD] [--tools NAME...] [--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 ast @@ -266,8 +266,27 @@ DEFAULT_REPO = "/root/troupe-standup" # (`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 # 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 `. 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( - r"(?[0-9]+(?:,[0-9]{3})*)(?P\s{1,2}|[)\]}\"'`*]\s)" + r"(?[0-9]+(?:,[0-9]{3})*)(?P\s{1,2}|[)\]}\"'`*]\s)" r"(?P[A-Za-z_][A-Za-z0-9_]*|[A-Z][A-Z_]{2,})\b(?!-)") CLAIM_EQ = re.compile( r"(?P[A-Za-z_][A-Za-z0-9_]*)\s*[:=]\s*\**\s*(?P[0-9]+(?:,[0-9]{3})*)") @@ -648,6 +667,13 @@ def _fixture_checks(): check("claims: the tightening keeps a count and its unit", claims_of("471 UNRESOLVED and 1,612 citations"), [("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) # 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