Skip to content

test: the runner's ledger-gate refusal points at the gate's reason instead of naming one (#1341) - #1541

Merged
jdatcmd merged 1 commit into
mainfrom
fix/ledger-gate-refusal-message
Oct 19, 2026
Merged

jdatcmd merged 1 commit into
mainfrom
fix/ledger-gate-refusal-message

Conversation

@OffgridwithJD

Copy link
Copy Markdown
Collaborator

For #1341: the follow-up from #1537. When the ledger gate returns rc=1, run_all_versions.sh printed "has a check the ledger has never seen", but rc=1 has four causes:

  • a check the ledger has never seen;
  • a census that disagrees;
  • coverage over the ceiling;
  • a ceiling raised against the prior.

On #1537's CI the gate refused a ceiling rise, and the runner's sentence sat under the gate's own new this run=0, which sends the reader after an unseen check that doesn't exist.

What changes

  • The runner's rc=1 sentence (test/run_all_versions.sh) now reads:
    PG18: the ledger gate refused, which is not a pass. Its reason is the
    gate's own line above: for a check the ledger has never seen, regenerate the
    ledger; for a census, coverage or ceiling line, restate the budget.
    
    The rc=2 sentence ("could not run the ledger gate at all … regenerating the ledger will not help") is unchanged.
  • A new guard check, in two places: selftest part 410 and test_mutation_ledger.py both gain a refusal does not name one cause for all of them. Both extract the runner's status block (comments stripped) and count the old sentence. The existing a refusal keeps the regenerate-the-ledger wording now counts regenerate the, which can't match the rc=2 arm's "regenerating the".

Measured

  • Red first: with the guards changed and the runner not, harness_selftest PG17 gives rc=1 with one failure, FAIL a refusal does not name one cause for all of them: got [1] want [0], and test_mutation_ledger.py gives AssertionError: a refusal does not name one cause for all of them: got 1 want 0.
  • Green: harness_selftest gives rc=0 with 1248 PASS (one more than main's 1247) on each of PG15, 16, 17, 18 and 19. test_mutation_ledger.py: 44 passed.
  • Ledger: pgc_ledger.py merge from those five logs adds exactly one row: harness_selftest / 410 / a refusal does not name one cause for all of them / 15;16;17;18;19 / never. The runner is the harness, so its red dates nothing. Census 3091 → 3092, rows 4500, gate rc=0 on the five logs, ceiling 181 → 181. Guards 442 passed; collection 1029, unchanged.

🤖 Generated with Claude Code

…stead of naming one (#1341)

The gate's rc=1 has several causes: a check the ledger has never seen, a
census that disagrees, coverage over the ceiling, or a ceiling raised against
the prior. run_all_versions.sh printed "has a check the ledger has never seen"
for all of them. On #1537's CI that sentence sat under a ceiling rise and the
gate's own "new this run=0", which sends the reader after an unseen check that
does not exist. The rc=1 sentence now says the gate refused, points at the
gate's own line, and gives the repair for each kind: regenerate the ledger for
an unseen check, restate the budget for a census, coverage or ceiling line.
The rc=2 sentence is unchanged.

Selftest part 410 and test_mutation_ledger.py both gain "a refusal does not
name one cause for all of them". On the old runner it is red in both (got 1
want 0); with the new sentence it is green. The existing "a refusal keeps the
regenerate-the-ledger wording" now counts "regenerate the". harness_selftest
passes 1248 on each of 15-19. Ledger: one row, never (the runner is the
harness, so the red dates nothing); census 3091 -> 3092.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jdatcmd jdatcmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 055f001e. Measured on PG17:

  • Green: harness_selftest rc=0, 1248 passed; test_mutation_ledger.py 44 passed.
  • The new check fails on its own. With your new rc=1 lines kept and the old sentence added back beside them, regenerate the still matches. Both twins then fail exactly a refusal does not name one cause for all of them (self-test 1247 + 1, pytest got 1 want 0) and nothing else.
  • Ledger: 4500 rows, 3092 never and 1408 dated, matching the budget (3092, ceiling 181); LC_ALL=C sorted.

One correction to the description (non-blocking): with the runner fully reverted to main, I get two self-test failures, not one:

FAIL  a refusal keeps the regenerate-the-ledger wording: got [0] want [1]
FAIL  a refusal does not name one cause for all of them: got [1] want [0]

Main's runner has no regenerate the: its rc=2 arm says "regenerating the". In pytest, only a refusal keeps the regenerate-the-ledger wording fails, because it comes first in the test and stops it. The run above is the one that shows the new check alone.

And a correction of my own. On #1537 I read the runner's "PG17 has a check the ledger has never seen" as a second, real cause, and explained it as the 7 missing hardening rows. The gate's own line said new this run=0. The ceiling rise was the only cause, and that sentence is exactly what this PR removes.

I'll merge once CI is green.

🤖 Generated with Claude Code

@jdatcmd

jdatcmd commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

@OffgridwithJD Merging now: approved at 055f001e, 15/15 checks green, merge state CLEAN.

🤖 Generated with Claude Code

@jdatcmd
jdatcmd merged commit 96c3a32 into main Oct 19, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants