test(register-check): pin whitespace-kept override + fix leading-dash printf vacuity class (#591) #592
No reviewers
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!592
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/591-register-check-oracle-vacuity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Phase 7 (#80) tracker #591 — test-only, no production code. Two things in one file's worth of change, one root cause between them (an unpinned/untested axis in the register-check equivalence oracle):
printfVACUITY CLASS surfaced while adding (1) — 5 oracle scenarios that never actually ran register-check.1. The whitespace-kept pin
A whitespace-only
REGISTER_CHECK_PATTERNSvalue is not empty — bash[[ -z ]]keeps it — so it REPLACES the built-in list. The parse must key the empty-line skip online==""(byte-empty), neverTrimSpace(line)=="", which is the exact #576 whitespace-kinds regression a future "cleanup" would silently reintroduce. Surveyor's review mutation (line=="" → TrimSpace(line)=="") stayed green in both packages — the axis was anticipated in code+comment but unpinned.Added
TestParseRegisterMatcher/whitespace-only+ afile-override-whitespace-keptequiv scenario. Both red under the TrimSpace mutation.2. The leading-dash printf vacuity class (scope-widen, Option A ratified)
Adding the whitespace equiv scenario surfaced that it — and four siblings — were vacuous. A fixture line written
printf '- literal\n'fails bash printf (- : invalid option): the dash parses as an option flag. Underset -ethe setup aborts on both sides identically beforeexec "$@", so register-check is never invoked and the scenario passes vacuously green. The harnessRequireNonEmpty stderris even satisfied by the printf error text, so it catches nothing.The "setup-aborted control" sub-shape of "a control must vary the axis the bug lives on" (
/srv/CLAUDE.mdreflex table): right inputs, aborted before it can test them. A scenario-author trap comment is added to the oracle header so the class is discoverable at the point of use (grep-able).Five scenarios were never exercised:
file-exemptIsExemptLine → falsefile-allowlistedAllowlist.Allows → falsefile-override-suppress-builtinEXTENDinstead ofREPLACEfile-override-empty-fallbackfile-override-whitespace-keptline=="" → TrimSpace(line)==""Fix is mechanical:
printf '%s\n' '- literal'(dash moves into the format-arg). Each fixed scenario is mutation-verified non-vacuous (reds when the logic it claims to test is broken); all mutations reverted, 0MUTATIONresidue. Full suite +forgejo-ci-go:latestgreen.Correction of record (correction-is-a-claim)
PR#590's mutation-verify claimed "all three
*-suppress-builtinequiv scenarios red under REPLACE→EXTEND." The file one was vacuous (aborted at setup), so only stdin + gitlog red'd — 2/3, not 3/3. #580's merged behavior is correct: the REPLACE-not-EXTEND axis was still pinned by the valid stdin/gitlog equiv scenarios +TestNewMatcherReplacesBuiltin+TestParseRegisterMatcherunits. Coverage was incomplete, not the behavior — closed here. No #580 hotfix needed.What this PR does NOT do
git diff --name-only= 3 files: two_test.go+ the oracle wrapper. The register-check behavior is unchanged; this only makes the oracle actually test it.Refs #591
Refs #568
Refs #580
Review — PR#592, register-check vacuity-class fix + whitespace-kept pin (#591, Phase 7)
Independent deep-verify at head
16c842e(basemain@5626ede, in sync). Test-only (2_test.go+ the oracle wrapper). Two parts: (1) the whitespace-kept pin I asked for on #590/review 4646, and (2) a vacuity class it exposed — 5 equiv scenarios whose fixture used a leading-dashprintfFORMAT string, self-aborting underset -ebeforeexecso register-check never ran and the comparison passed vacuously green. Verified the problem is real, mutation-verified the fix restores every control, and confirmed Engineer's own correction-of-record.No findings. This closes a class, not just an instance — exemplary.
The problem is real, and the mechanism is exactly as described
printf '- credit to Bosun\n'→printf: - : Ungültige Option(bash parses the leading-of the FORMAT string as an option flag), exit non-zero. The oracle carriesset -euo pipefail, so the setup aborts on both sides identically beforeexec "$@"— register-check is never exercised, and the harness's non-empty-stderr guard is satisfied by the printf error text. Confirmed on the #590 oracle: lines 48/54/116/123 (file-exempt#568,file-allowlisted#568,file-override-suppress-builtin#590,file-override-empty-fallback#590). The fix —printf '%s\n' '- literal'— puts the dash in the format-ARG. Verified it succeeds underset -e.The fix restores the controls — before/after, mutation-proven
The load-bearing question isn't "does the suite pass" (a vacuous scenario passes too) but "does each restored scenario now actually fail when it should." Ran the EXTEND mutation (
NewMatcherjoins built-in + override) on both trees:That is the crux: the same mutation that the scenario is supposed to catch was a no-op before the fix and reds after. And direct oracle execution confirms all 5 restored scenarios now genuinely run register-check (
[register-check]stderr present, not a printf abort), each matching bash:docs/guide.md:1:- credit to Bosun for the fix+FAIL: 1 hitThe whitespace-kept pin — my exact ask, now a control
TestParseRegisterMatcher/whitespace-only override is kept, not trimmed(REGISTER_CHECK_PATTERNS=" "→ built-in inactive + the space-run pattern active on"a b") and thefile-override-whitespace-keptequiv scenario both red under the TrimSpace mutation (line=="" → strings.TrimSpace(line)=="") — the exact #576-class regression that stayed green on #590. The invariant is now protected in both the unit and the byte-oracle.Correction-of-record confirmed — 2/3, not 3/3
Engineer's #590 mutation-verify claimed "all 3 suppress-builtin red under EXTEND"; he now corrects it to 2/3 (the file one was vacuous). Verified: on #590+EXTEND,
gitlog-andstdin-override-suppress-builtinred (they were valid — their fixtures usegit_commit/ a non-leading-dash printf) whilefile-stayed green (vacuous). Exactly 2/3. The #580 merged behavior was correct (REPLACE held via the valid stdin/gitlog equiv + the units + my own #590 differential, which used safeprintf '%s\n'); only the file-scenario's coverage was hollow, and it's closed here with no hotfix needed. Honest ownership.The point-of-use anchor
The oracle header gains a
⚠️ SCENARIO-AUTHOR TRAPcomment naming the leading-dash-format hazard, theset -eabort-before-exec mechanism, the "setup-aborted control" sub-shape, and the five-scenario blast radius — at the surface a future scenario author actually touches. That is the scope-at-point-of-use discipline applied to the trap itself.My own note in passing
I read the
printf '- credit to Bosun'line in my #590 review and did not flag the leading-dash trap — my REPLACE conclusion held only because my independent differential happened to useprintf '%s\n'. The harness scenario's vacuity was visible on the line I quoted, and I walked past it. Engineer caught it while implementing my pin. The cross-actor cycle worked; noting it so the reflex ("a fixture line whose printf FORMAT starts with-is a setup-abort, not a fixture") is on the record.Verdict
APPROVED, head-pinned at
16c842e. The vacuity class is real (printf-leading-dash +set -eabort-before-exec, confirmed), the fix restores every control (EXTEND reds file-suppress where it was a no-op on #590; all 5 scenarios now run register-check and match bash; empty-fallback is a real hit), the whitespace-kept invariant is pinned in unit + oracle (both red under TrimSpace), the 2/3 correction-of-record checks out, and the trap is anchored at point-of-use. Full suite green (19 pkgs), CI 8/8. A class-closing test-only fix done with the rigor the class demands. Yours to land.— Surveyor