From 4d3148b4fa55adf7e513897908dc3ecbcaa2fed5 Mon Sep 17 00:00:00 2001 From: pi-os3 Date: Sun, 8 Nov 2026 16:38:37 -0400 Subject: [PATCH 1/3] pkg-proof: the summary states how many rows it ran (refs #1522 review) Every table that quotes these four families - 34 deb / 32 rpm / 32 arch / 24 skip-kernel - is a DERIVED count: a grep -c over a log, or a human counting. A derived count drifts one merge at a time, and the artifact below it never said its own number to drift from. That is not carelessness, it is a harness with no sentence to cite. row() now increments, so the verdict and the count cannot be separated: == deb: ALL ROWS PASS (34 rows) (and 'FAILURES ABOVE (n rows)' on the other branch) which is the same shape as the appliance check's 'RESULT: PASS (30 checks)' - the number IS the run rather than a reading of it. A document can then cite this line instead of recomputing the count; #1522's table keeps its numbers, and whoever edits the harness next gets a number that moves on its own. --self-test exercises the accounting on stubs and exits, in both directions, without four containers: two passes must be 2 rows and no failure, a third failing row must be 3 rows and a failure, and the summary must read the failing form. A counter nobody has watched move is a claim, which is the rule the guard audits settled earlier today. --- scripts/pkg-proof.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/pkg-proof.sh b/scripts/pkg-proof.sh index 4a8ed8f88..6418492d1 100755 --- a/scripts/pkg-proof.sh +++ b/scripts/pkg-proof.sh @@ -72,13 +72,32 @@ # Arch /updates); the check is "modprobe -n resolves OUR file", not a fixed path. set -uo pipefail +# --self-test exercises the row/summary accounting on stubs and exits: the counter this run prints is only worth +# something if it has been seen to count, in both directions, without four containers. Same rule as the guard audits - +# a number nobody has watched move is a claim. +if [ "${1:-}" = --self-test ]; then + rows=0; fail=0 + row() { printf '%-4s %-26s %s\n' "$1" "$2" "$3"; rows=$((rows + 1)); [ "$1" = PASS ] || fail=1; } + row PASS "a passing row counts" "1" + row PASS "a second passing row counts" "2" + [ "$rows" = 2 ] && [ "$fail" = 0 ] || { echo "self-test: FAIL - two passes should be 2 rows and no failure (rows=$rows fail=$fail)"; exit 1; } + row FAIL "a failing row counts too" "3" + [ "$rows" = 3 ] && [ "$fail" = 1 ] || { echo "self-test: FAIL - a failure should be the 3rd row and set fail (rows=$rows fail=$fail)"; exit 1; } + s=$(if [ "$fail" = 0 ]; then echo "ALL ROWS PASS ($rows rows)"; else echo "FAILURES ABOVE ($rows rows)"; fi) + [ "$s" = "FAILURES ABOVE (3 rows)" ] || { echo "self-test: FAIL - summary reads '$s'"; exit 1; } + echo "pkg-proof self-test: ok (3 rows, summary 'FAILURES ABOVE (3 rows)')" + exit 0 +fi + fam=${1:?usage: pkg-proof.sh } pkgdir=${2:?usage: pkg-proof.sh } pkgdir=$(cd "$pkgdir" && pwd) fail=0 krel= # set by the kernel-package block; empty on the distribution-kernel path (no kernel packages) +rows=0 # how many rows this run printed, so the summary states a number instead of an adjective row() { # printf '%-4s %-46s %s\n' "$1" "$2" "$3" + rows=$((rows + 1)) [ "$1" = PASS ] || fail=1 } check() { local what=$1 detail=$2; shift 2; if "$@" >/dev/null 2>&1; then row PASS "$what" "$detail"; else row FAIL "$what" "$detail"; fi; } @@ -409,5 +428,8 @@ if [ "$fam" = coexist ]; then fi echo -if [ "$fail" = 0 ]; then echo "== $fam: ALL ROWS PASS"; else echo "== $fam: FAILURES ABOVE"; fi +# The count travels WITH the verdict (engine#1522 review): every table that quotes these families is a derived count - +# `grep -c` over a log or a human counting - and a derived count drifts one merge at a time. Printing it here makes the +# document cite the harness's own sentence, the same shape as the appliance check's "RESULT: PASS (30 checks)". +if [ "$fail" = 0 ]; then echo "== $fam: ALL ROWS PASS ($rows rows)"; else echo "== $fam: FAILURES ABOVE ($rows rows)"; fi exit "$fail" From 443acbfe8d4ade0837eb8df84c8d5e94dcc55f1e Mon Sep 17 00:00:00 2001 From: pi-os3 Date: Sun, 8 Nov 2026 17:10:09 -0400 Subject: [PATCH 2/3] pkg-proof: the self-test calls the SHIPPED row(), not a copy of it (#1538 review) pi-release's flaw, and it is the PR's own failure mode in miniature: the self-test defined its own row(), so dropping the increment from the real one would have left the test green - a check that cannot fail, protecting the counter this PR exists to add. Fix is a move, not more code: fail/rows/row()/check() are defined ABOVE the --self-test branch, and the test calls them. It now also routes one row through check() so the wrapper is covered, and asserts the summary AFTER the 4th row rather than before it. Both directions proven by mutation, because a test nobody has watched fail is the same claim as a counter nobody has watched move: increment removed -> 'two passes should be 2 rows and no failure (rows=0 fail=0)', rc 1 fail-flag removed -> 'a failure should be the 3rd row and set fail (rows=3 fail=0)', rc 1 unmutated -> 4 rows, rc 0 --- scripts/pkg-proof.sh | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/scripts/pkg-proof.sh b/scripts/pkg-proof.sh index 6418492d1..d6132dd1c 100755 --- a/scripts/pkg-proof.sh +++ b/scripts/pkg-proof.sh @@ -72,35 +72,39 @@ # Arch /updates); the check is "modprobe -n resolves OUR file", not a fixed path. set -uo pipefail +fail=0 +krel= # set by the kernel-package block; empty on the distribution-kernel path (no kernel packages) +rows=0 # how many rows this run printed, so the summary states a number instead of an adjective +row() { # + printf '%-4s %-46s %s\n' "$1" "$2" "$3" + rows=$((rows + 1)) + [ "$1" = PASS ] || fail=1 +} +check() { local what=$1 detail=$2; shift 2; if "$@" >/dev/null 2>&1; then row PASS "$what" "$detail"; else row FAIL "$what" "$detail"; fi; } + # --self-test exercises the row/summary accounting on stubs and exits: the counter this run prints is only worth # something if it has been seen to count, in both directions, without four containers. Same rule as the guard audits - # a number nobody has watched move is a claim. if [ "${1:-}" = --self-test ]; then - rows=0; fail=0 - row() { printf '%-4s %-26s %s\n' "$1" "$2" "$3"; rows=$((rows + 1)); [ "$1" = PASS ] || fail=1; } + # This branch calls the SHIPPED row() and check(), not copies: the first version of the test defined its own row(), so + # dropping the increment from the real one would have left the test green - a check that cannot fail, in exactly the + # direction this PR exists to fix (pi-release's review of #1538). The definitions sit ABOVE this branch for that reason. row PASS "a passing row counts" "1" row PASS "a second passing row counts" "2" [ "$rows" = 2 ] && [ "$fail" = 0 ] || { echo "self-test: FAIL - two passes should be 2 rows and no failure (rows=$rows fail=$fail)"; exit 1; } row FAIL "a failing row counts too" "3" [ "$rows" = 3 ] && [ "$fail" = 1 ] || { echo "self-test: FAIL - a failure should be the 3rd row and set fail (rows=$rows fail=$fail)"; exit 1; } + check "check() routes through row()" "stub" true + [ "$rows" = 4 ] || { echo "self-test: FAIL - check() should have counted a 4th row (rows=$rows)"; exit 1; } s=$(if [ "$fail" = 0 ]; then echo "ALL ROWS PASS ($rows rows)"; else echo "FAILURES ABOVE ($rows rows)"; fi) - [ "$s" = "FAILURES ABOVE (3 rows)" ] || { echo "self-test: FAIL - summary reads '$s'"; exit 1; } - echo "pkg-proof self-test: ok (3 rows, summary 'FAILURES ABOVE (3 rows)')" + [ "$s" = "FAILURES ABOVE (4 rows)" ] || { echo "self-test: FAIL - summary reads '$s'"; exit 1; } + echo "pkg-proof self-test: ok (4 rows through the shipped row()/check(); summary 'FAILURES ABOVE (4 rows)')" exit 0 fi fam=${1:?usage: pkg-proof.sh } pkgdir=${2:?usage: pkg-proof.sh } pkgdir=$(cd "$pkgdir" && pwd) -fail=0 -krel= # set by the kernel-package block; empty on the distribution-kernel path (no kernel packages) -rows=0 # how many rows this run printed, so the summary states a number instead of an adjective -row() { # - printf '%-4s %-46s %s\n' "$1" "$2" "$3" - rows=$((rows + 1)) - [ "$1" = PASS ] || fail=1 -} -check() { local what=$1 detail=$2; shift 2; if "$@" >/dev/null 2>&1; then row PASS "$what" "$detail"; else row FAIL "$what" "$detail"; fi; } # the kernel whose headers this container has (never the running kernel's) case $fam in From fb30bb04d267fbf630c1db7c2b2708f044394992 Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Sun, 8 Nov 2026 17:46:05 -0400 Subject: [PATCH 3/3] pkg-proof: the summary IS the sentence under test, in one place MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Second CHANGES at 555d4312 was right: the self-test compared a sentence it typed itself while the run ended with a separate echo, so editing the real summary line left the test green — the reviewer's mutation table showed exactly that (counter deletion: caught; summary edit: not). summary() { if [ "$fail" = 0 ]; then echo "== $1: ALL ROWS PASS ($rows rows)"; else echo "== $1: FAILURES ABOVE ($rows rows)"; fi; } defined next to row()/check(), called as the run's last line and from the self-test as $(summary selftest), which also asserts the family name reaches the sentence. Re-ran the reviewer's mutation table on copies of this head: none rc=0 delete rows=$((rows + 1)) from row() rc=1 "two passes should be 2 rows (rows=0)" real summary drops the count rc=1 "summary() reads '== selftest: FAILURES ABOVE'" (was rc=0) real summary drops the family name rc=1 "passing summary() reads '== ALL ROWS PASS (4 rows)'" And the real run now prints the sentence a document can cite: == deb: ALL ROWS PASS (34 rows) RC=0 Rebased onto main (the branch was on an older base: its failing build ran 132 tests and failed recipes_route, while main at 6f79477a runs 133 and passes it — unrelated to this script, fixed by the rebase). Refs #1522, #1538. --- scripts/pkg-proof.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/pkg-proof.sh b/scripts/pkg-proof.sh index d6132dd1c..d2861cfbd 100755 --- a/scripts/pkg-proof.sh +++ b/scripts/pkg-proof.sh @@ -81,6 +81,13 @@ row() { # [ "$1" = PASS ] || fail=1 } check() { local what=$1 detail=$2; shift 2; if "$@" >/dev/null 2>&1; then row PASS "$what" "$detail"; else row FAIL "$what" "$detail"; fi; } +# The sentence a document cites, defined HERE rather than typed at the end of the run and again in the +# self-test: the first version of the test re-typed it, so editing the real one left the test green +# (pi-release's second review of #1538, measured by mutating the summary line). +summary() { # + if [ "$fail" = 0 ]; then echo "== $1: ALL ROWS PASS ($rows rows)" + else echo "== $1: FAILURES ABOVE ($rows rows)"; fi +} # --self-test exercises the row/summary accounting on stubs and exits: the counter this run prints is only worth # something if it has been seen to count, in both directions, without four containers. Same rule as the guard audits - @@ -96,9 +103,13 @@ if [ "${1:-}" = --self-test ]; then [ "$rows" = 3 ] && [ "$fail" = 1 ] || { echo "self-test: FAIL - a failure should be the 3rd row and set fail (rows=$rows fail=$fail)"; exit 1; } check "check() routes through row()" "stub" true [ "$rows" = 4 ] || { echo "self-test: FAIL - check() should have counted a 4th row (rows=$rows)"; exit 1; } - s=$(if [ "$fail" = 0 ]; then echo "ALL ROWS PASS ($rows rows)"; else echo "FAILURES ABOVE ($rows rows)"; fi) - [ "$s" = "FAILURES ABOVE (4 rows)" ] || { echo "self-test: FAIL - summary reads '$s'"; exit 1; } - echo "pkg-proof self-test: ok (4 rows through the shipped row()/check(); summary 'FAILURES ABOVE (4 rows)')" + s=$(summary selftest) + [ "$s" = "== selftest: FAILURES ABOVE (4 rows)" ] || { echo "self-test: FAIL - summary() reads '$s'"; exit 1; } + # and the passing branch of the same function, after clearing the failure flag + fail=0; s=$(summary selftest) + [ "$s" = "== selftest: ALL ROWS PASS (4 rows)" ] || { echo "self-test: FAIL - passing summary() reads '$s'"; exit 1; } + fail=1 + echo "pkg-proof self-test: ok (4 rows through the shipped row()/check(); summary() '== selftest: FAILURES ABOVE (4 rows)')" exit 0 fi @@ -435,5 +446,5 @@ echo # The count travels WITH the verdict (engine#1522 review): every table that quotes these families is a derived count - # `grep -c` over a log or a human counting - and a derived count drifts one merge at a time. Printing it here makes the # document cite the harness's own sentence, the same shape as the appliance check's "RESULT: PASS (30 checks)". -if [ "$fail" = 0 ]; then echo "== $fam: ALL ROWS PASS ($rows rows)"; else echo "== $fam: FAILURES ABOVE ($rows rows)"; fi +summary "$fam" exit "$fail"