From 055f001e0d6fceca280d8e9282433909b675242c Mon Sep 17 00:00:00 2001 From: "Joshua D. Drake" Date: Mon, 19 Oct 2026 20:20:32 +0000 Subject: [PATCH] test: the runner's ledger-gate refusal points at the gate's reason instead 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 --- test/check_ledger.tsv | 1 + test/check_ledger_budget.txt | 14 +++++++++++++- test/pytest/test_mutation_ledger.py | 7 ++++++- test/run_all_versions.sh | 9 +++++++-- test/selftest/410-a-check-must-have-been-red.sh | 8 +++++++- 5 files changed, 34 insertions(+), 5 deletions(-) diff --git a/test/check_ledger.tsv b/test/check_ledger.tsv index 982ec7f9d..8cc176dff 100644 --- a/test/check_ledger.tsv +++ b/test/check_ledger.tsv @@ -1641,6 +1641,7 @@ harness_selftest 410-a-check-must-have-been-red a real refusal is a different st harness_selftest 410-a-check-must-have-been-red a ref that does not resolve is an integrity failure, not a bootstrap 15;16;17;18;19 never - harness_selftest 410-a-check-must-have-been-red a ref that exists with the budget still compares 15;16;17;18;19 never - harness_selftest 410-a-check-must-have-been-red a ref that exists without the budget is still the bootstrap case 15;16;17;18;19 never - +harness_selftest 410-a-check-must-have-been-red a refusal does not name one cause for all of them 15;16;17;18;19 never - harness_selftest 410-a-check-must-have-been-red a refusal keeps the regenerate-the-ledger wording 15;16;17;18;19 never - harness_selftest 410-a-check-must-have-been-red a rename in one part survives an addition in another 15;16;17;18;19 never - harness_selftest 410-a-check-must-have-been-red a row claiming 15;18 is an orphan on a PG18 run that did not emit it 15;16;17;18;19 never - diff --git a/test/check_ledger_budget.txt b/test/check_ledger_budget.txt index 85fa0b1cc..933f55cb5 100644 --- a/test/check_ledger_budget.txt +++ b/test/check_ledger_budget.txt @@ -3766,4 +3766,16 @@ suites_not_covered 181 # never 3087 + 4 = 3091 # dated 1405 + 3 = 1408 # 3091 + 1408 == 4499 -checks_never_observed_red 3091 +# +# #1341, the runner's ledger-gate sentence (OffgridwithJD): 3091 -> 3092. rc=1 has +# several causes, and the runner named one for all of them: #1537's CI refused a +# ceiling rise and printed "has a check the ledger has never seen" under the gate's +# own "new this run=0". The sentence now points at the gate's line instead. One +# check enters harness_selftest part 410, red on the old runner and green on the new +# (measured; the runner is the harness, so it dates nothing), so it arrives never. +# +# ledger rows 4499 + 1 = 4500 +# never 3091 + 1 = 3092 +# dated 1408 + 0 = 1408 +# 3092 + 1408 == 4500 +checks_never_observed_red 3092 diff --git a/test/pytest/test_mutation_ledger.py b/test/pytest/test_mutation_ledger.py index 07650ec7f..6674c5bea 100644 --- a/test/pytest/test_mutation_ledger.py +++ b/test/pytest/test_mutation_ledger.py @@ -628,8 +628,13 @@ def test_the_runner_invokes_the_gate_before_it_removes_the_logs(expect): block = "\n".join(l for l in block.splitlines() if not l.strip().startswith("#")) expect.num(block.count("verfail=1"), 2, "both failure arms fail the major") - expect.num(block.count("has a check the ledger has never seen"), 1, + expect.num(block.count("regenerate the"), 1, "a refusal keeps the regenerate-the-ledger wording") + # rc=1 is an unseen check, a census mismatch, coverage over the ceiling or a ceiling + # raised against the prior; naming the first for all of them sent #1537's reader + # after an unseen check under the gate's own "new this run=0". + expect.num(block.count("has a check the ledger has never seen"), 0, + "a refusal does not name one cause for all of them") expect.num(block.count("could not run the ledger gate at all"), 1, "and an integrity failure gets its own sentence, since regenerating " "the ledger would not help") diff --git a/test/run_all_versions.sh b/test/run_all_versions.sh index 4466359f9..d19b5f380 100755 --- a/test/run_all_versions.sh +++ b/test/run_all_versions.sh @@ -1750,10 +1750,15 @@ pgc_tally_suite() { # pgc_tally_suite NAME VERDICT LOGFILE # the gate unable to do its job at all, where regenerating helps nothing. # Collapsing them printed "has a check the ledger has never seen" three # lines below the gate's own "new this run=0", which contradicts it and - # sends the reader at the wrong repair. Reported by OffgridwithJD. + # sends the reader at the wrong repair. Reported by OffgridwithJD. rc=1 + # itself has several causes (an unseen check, a census that disagrees, + # coverage over the ceiling, a ceiling raised against the prior), so its + # sentence points at the gate's own line rather than naming one (#1537). case "$_led_rc" in 0) ;; - 1) echo " PG$major has a check the ledger has never seen, which is not a pass" + 1) echo " PG$major: the ledger gate refused, which is not a pass. Its reason is the" + echo " gate's own line above: for a check the ledger has never seen, regenerate the" + echo " ledger; for a census, coverage or ceiling line, restate the budget." verfail=1 ;; *) echo " PG$major could not run the ledger gate at all, which is not a pass:" echo " the input or the prior ceiling was unusable, and regenerating the" diff --git a/test/selftest/410-a-check-must-have-been-red.sh b/test/selftest/410-a-check-must-have-been-red.sh index 80429e2ea..b14a58bb4 100644 --- a/test/selftest/410-a-check-must-have-been-red.sh +++ b/test/selftest/410-a-check-must-have-been-red.sh @@ -1289,7 +1289,13 @@ check "premise: the gate's status block was found in the runner" \ check "the runner captures the gate's status rather than only its success" \ "$(grep -c '_led_rc=\$?' "$_rv")" "1" check "a refusal keeps the regenerate-the-ledger wording" \ - "$(printf '%s' "$_ledcase" | grep -c 'has a check the ledger has never seen')" "1" + "$(printf '%s' "$_ledcase" | grep -c 'regenerate the')" "1" +# A REFUSAL HAS MORE THAN ONE CAUSE. rc=1 is an unseen check, a census that disagrees, +# coverage over the ceiling, or a ceiling raised against the prior. The runner named +# the first for all of them: #1537's CI refused a ceiling rise and printed "has a +# check the ledger has never seen" under the gate's own "new this run=0". +check "a refusal does not name one cause for all of them" \ + "$(printf '%s' "$_ledcase" | grep -c 'has a check the ledger has never seen')" "0" check "an integrity failure says regenerating will not help" \ "$(printf '%s' "$_ledcase" | grep -c 'will not help')" "1" check "and it is a different sentence from the refusal, not the same one twice" \