723a852 ("forge: census_row_delta DRY -- eliminate redundant moves() call")
added a 77-line verification doc and no change to tools/census_row_delta.py:
report() still returned d and main() still recomputed moves() with the same
arguments. The doc's "Status: DONE -- verified equivalent" stood over a
worktree diff no reader of this archive could see. This commit lands the
two-line change itself.
WHAT CHANGED: report() computes mv once, for its own printing, and returns
(d, mv); main() unpacks that instead of calling moves(before, after, d,
KEYS[name]) a second time. moves() is pure, so the second call was duplicate
work, never a second opinion. Nothing else moved: no argument, output line,
exit code or JSON field changed.
VERIFIED ON REAL CENSUS PAIRS, NOT A FIXTURE. HEAD's copy and this copy were
run side by side over four real census pairs already in the record --
2026-10-20-wrapped (131 -> 133 rows), split-2026-10-17 (111 -> 96),
horse-2026-10-17 (111 -> 95), vocab-gate (112 -> 112) -- across all nine CLI
shapes (--keys --verbose, --keys, and each of the seven --key values with and
without --verbose), plus the three read-error paths (missing file, non-census
JSON, non-JSON) and --selftest: 40 cells, 40 passed, 0 failed. Compared per
cell: rc, stderr, stdout, and the --json payload's sha256. Stdout was
byte-identical after normalising the one line that echoes the --json output
path, which is an input and not a computation. Read-error paths return rc 2
on both sides ("cannot read census ..."), and the selftest is 33/33 on both.
THE DUPLICATION IS ACTUALLY GONE, MEASURED. Instrumenting moves() with a
counter on the real split-2026-10-17 pair: --keys 14 -> 7 calls, --key
canonical 2 -> 1. Matches the doc's claim on a live path rather than on its
synthetic pair.
ONE CORRECTION TO 723a852's FRAMING, measured. Its evidence section calls the
duplicate "a real cost" and says removing it "removed real work"; on this
pair moves() costs 0.15 ms for the canonical key and 0.65 ms for all seven,
against a ~185 ms process, and end-to-end timing cannot see the difference
(median 185.2 ms unpatched vs 197.3 ms patched over 9 runs, both inside a
154-235 ms spread). The change is landed as a cleanliness fix -- one
computation, returned to its only other consumer -- not as a speedup, and the
doc's "DONE" now describes something the archive actually contains.
Gate: tools/verify.py -- the checkin leg's 2 faults (2026-10-19-zephyrus.md,
2026-10-19-zephyrus-sovereignty.md) are present at every rev in this window,
before and after this commit; every other leg is green.
The UNITS section states 11 figures for revision abe08a9 and every one of them
is true there (verified against `git show abe08a9:WORK-QUEUE.md`). Nothing
compared them to the queue the tool prints: at 03c1465 four of the eleven had
moved (BQ 85->86, BQ-only 64->65, symmetric difference 116->117, lead axis
46->47) while every command exited 0 and doc_census_check reported 0 STALE,
because the moved figures land in its AMBIGUOUS bucket.
--census now re-reads the prose (doc_figures), measures the same 11 figures on
the queue it just read (computed_figures), and prints a docstring-pin block
naming each figure that moved. Exit code unchanged: a queue that grows is not a
fault. Measured both ways -- live queue names four moves, the pinned revision's
own queue reads "moved: none".
Cells 20 -> 24 (4 doc-pin). Mutant returning [] from doc_drift: 22/24, rc 1,
naming doc pin 2 and 4. Landed: 24/24, rc 0. The tool's plain report is
byte-identical before and after (diff rc 0). Gate 5/5, sweep 15/15, doc-census
0 STALE, ruff clean.
- c46d7dd's replies/2026-10-19-to-zephyrus-interview.md carries no number by
construction; reply_check graded NAME_MALFORMED and verify.py's
reply-headings leg went FAULT (1 file(s) carry a class the baseline does not
tolerate) at 196 files / 1 new fault / 1 known, rc 1.
- 2f32c23 adds INTERVIEW_RE (YYYY-MM-DD-to-<recipient>-interview.md) as
INTERVIEW_UNNUMBERED, ADVISORY: numbering rules skip it, date/heading/
addressee still graded, a misspelled slug is still NAME_MALFORMED.
- 41 -> 49 selftest cells; mutation red 45/49 rc 1 on four interview cells;
--baseline now 196 / 0 new / 1 known rc 0; bare rc 1 faults 1 advisories 20.
- verify.py 5/5 rc 0, landing 385/385 rc 0, raw sha256 f1d8b81202c71f7e.
- No item opened or closed; open set unchanged (Q37:5278, Q53:7303).
Timmy's c46d7dd filed replies/2026-10-19-to-zephyrus-interview.md, whose name
carries no number by construction. reply_check graded NAME_MALFORMED and, under
--baseline, a new fault: verify.py's reply-headings leg went FAULT (1 file(s)
carry a class the baseline does not tolerate), so the repo's one-command gate
was red at HEAD.
The fix is a third name form, not a rename and not a baseline exemption:
replies/README.md's numbered contract is about replies, and an interview is not
one. INTERVIEW_RE accepts YYYY-MM-DD-to-<recipient>-interview.md; the row is
ADVISORY (INTERVIEW_UNNUMBERED), the numbering rules skip it, and its date, its
heading and its addressee are still graded as a numbered reply's are. A
misspelled slug stays NAME_MALFORMED.
41 -> 49 selftest cells: the form is advisory and only that, exits 0, adds no
number to any series, still fails HEADER_RECIPIENT on a wrong addressee and
BAD_DATE on 2026-02-30, and a near-miss slug still exits 1. Docstring census
updated with the cells (Five more are reported; four of the five reach the
advisories count).
--repo . --baseline tools/reply_baseline.tsv: 196 file(s), 0 new fault(s), 1
known-faulting, rc 0. Bare run rc 1 with faults: 1, advisories: 20 (194 + 6).
The control plane measured them at 16:52Z: the docstring said 'Five classes
are graded' over a seven-row enumeration and 'Three more are counted and
printed' over four, while FAULTS holds 7 and ADVISORIES holds 4. Prose is not
executed and doc_census_check.py reads only '<digits> <unit>', so a spelled
count has no reader at all.
Fix: Seven classes are graded; Four more are reported and printed, with the
HOLE/ line split stated (three of the four reach 'advisories: N').
Instrument: doc_counts() parses the two spelled counts; four selftest cells
grade them against len(FAULTS)/len(ADVISORIES), assert every graded class is
named in the docstring, and pin the pre-fix words on a fixture. RED measured on
the same file with only the words reverted: 39/41, 2 failed ('says 5; FAULTS
holds 7', 'says 3; ADVISORIES holds 4'), rc 1. GREEN: 41/41 rc 0.
Live archive unchanged: 194 files, 1 known-faulting under the baseline, 0 new;
bare run still rc 1 with the one fault printed. verify.py 5/5 rc 0 (sweep 15
tools, 15 OK). doc_census_check --fail: 0 STALE, rc 0. ruff F,E9 clean.
f59a592 left the exact defect class this repo keeps finding in documents: the
docstring and the run said 50 cells while `--selftest`'s argparse help still
said 42, and nothing failed. Two changes:
- the help string no longer carries a count ("the run prints its cell count"),
so it cannot drift again;
- DOC_CELLS parses the docstring's `fixture corpus, N cells` claim and cell 27
grades it against the count that actually ran. Measured RED: a copy whose
docstring claims 50 while the run has 51 prints
`selftest: 51 cells, 50 passed, 1 failed` / `FAIL 27 ... got: 50 want: 51`,
rc 1.
Selftest 50 -> 51 cells, 51/51, rc 0.
The repo test was `os.path.isdir(<repo>/.git)`, which is wrong in both
directions. A LINKED worktree's `.git` is a 47-byte FILE (`gitdir: ...`), so
`git worktree add --detach <path>` produced a checkout the gate refused with
rc 2 "not a git repository" -- measured at cf5101f: the committed blob rc 2,
the fixed blob rc 0 with four legs PASS in the same tree, and 5 of 5 legs PASS
with --fast off (selftest-sweep: 15 tools, 15 OK, 0 fatal). An empty directory
named `.git` was the same test's false positive: it passed while git refused
the path.
`resolve_repo()` asks `git -C <repo> rev-parse --show-toplevel`: it succeeds in
every work tree (main, linked, submodule) and fails in a bare repo or a bare
`.git` directory. `--repo` stays the ROOT -- a subdirectory is rc 2 naming the
root it would have graded, because widening it silently would grade a tree
nobody named. Legs, rcs and --queue/--index semantics are untouched.
Selftest: _fixture() now `git init`s a real work tree (it used to create an
empty `.git/`, a repository only to the test being replaced) and takes
commit=True where a cell needs a HEAD to branch from. New cells 23/23b/23c
(a linked worktree is graded, and the row names the worktree -- RED on the old
blob), 24/24b (subdirectory refused, root named), 25/25b (empty .git refused),
26 (bare repo refused). 42 -> 50 cells, 50/50, rc 0.
No queue item opened or closed; no another-party file edited.