Skip to content

test(#70): the mutation sweep grows a baseline and inherits the shipped catalog - #110

Merged
abogartz merged 9 commits into
abogartz:mainfrom
WhollyMindless:test/mutation-sweep-baseline
Oct 26, 2026
Merged

abogartz merged 9 commits into
abogartz:mainfrom
WhollyMindless:test/mutation-sweep-baseline

Conversation

@WhollyMindless

@WhollyMindless WhollyMindless commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What

Upgrades scripts/test-sweep.ts in place, preserving the existing mutant ids — the mutation sweep from 6d1858b plus the honesty machinery #70/#68 call for, and a merged catalog. Measured lineage (an earlier draft claimed 24+26−5=42; #110's review counted the actual ids): 19 of the 24 shipped ids survive, 5 (lock-never-steal≈lock-no-stale-steal, publish-truncate≈publish-rename-to-truncate, blocklist-visible≈blocklist-poison-filter-off, restore-check-blind≈undo-check-mutates, restore-safety-stale≈undo-force-safety-removed) were the same break at the same site as a rebuilt entry and deduped, and 24 entries were built for this issue — 43 mutants + 1 calibration plant, every anchor exactly-once (--validate 44/44).

Why the upgrade

The shipped sweep refuses to run unless the clean-suite baseline is fully green (baseline suite is not green; sweep would lie). That is the right instinct and the wrong mechanism: on Windows the suite was never green when this branch was cut — 4 torn-read/EPERM races plus the resolver trio known-red at 1.3.10 (#89/#105 have since pinned them) — so the auditor couldn't audit on exactly the platform where the storage invariants are weakest. And a green baseline alone still lies twice: a mutant "killed" only by a timing-sensitive test that was already red, and an equivalent mutant silently shrinking the denominator.

This adds (all from #68's rules):

  1. Baseline subtraction. The clean tree's failing set is measured once and excluded from every kill delta — a mutant must newly redden something. A baseline-red test that dies under a mutant is still reported, separately.
  2. Confirm-runs. A kill whose only evidence is timing-sensitive is confirmed to 3 runs; an unstable kill is reported as unstable (x/y) — timing luck, not credited, per Epic: Test integrity — every claimed invariant pinned by a test that dies without it #68's D2 rule.
  3. Status classes + equivalent audit. killed / survived / unstable / equivalent / error, with equivalents excluded from the score — and the tool warns when an equivalent-marked mutant dies. That warning immediately caught a wrong claim on Testing-2: the mutation sweep audits the scenarios (instrument, status classes, four audit findings) #70 itself: the undo.ts containment branch finding 3 called "dead" is not dead — undo.test.ts reaches it (see table; the equivalent mark is removed in this PR).
  4. Calibration plant. --selftest mutates a deliberately under-tested pure helper and demands the suite catch it — "a harness that cannot go red is itself a defect."
  5. Scratch integrity. Reset before the first apply, verify the mutation is still present before trusting a green run (a run only testifies about the tree it was promised), rebuild the scratch when a stranded test child disturbs it.
  6. Stale anchors repaired against current main — three when this branch was cut (one, lock-default-fail, went ambiguous when the queue path duplicated the timeout policy branch; it's split into two uniquely-anchored mutants so the single-mutation discipline holds), and two more (publish-rename-to-truncate, undo-force-safety-after-publish) re-anchored where fix(store): make the store's file semantics hold on Windows (+ a windows-latest CI leg) #89 moved the publish path under the sweep.

What the sweep found (main @ 7bfe99b, Bun 1.3.10, Windows)

36/42 = 85.7% (43 mutants, 1 excluded equivalent, 0 load-errors), baseline 483/0/5 — zero known-reds
on current main. Full table in bench/test-sweep-results.md. Six unpinned
invariants — the audit's output:

  • lock-restore-failopen [D2] — restore's fail-closed policy on a busy store is no longer OBSERVED: the killer scenarios are byte-identical to the run that caught this, but fix(store): make the store's file semantics hold on Windows (+ a windows-latest CI leg) #89's lock rework moved their outcomes off the onTimeout branch. Pin: live lock holder + forced restore → assert refusal and a byte-identical store.
  • supersede-rmw-nolock [D2] — unstable kill (1/3): perf(store): batch supersession - one pass per file for decay and gates (#61) #102's batch pass moved the timing window the old 1/1 kill stood in. Pin: scripted supersede racing an append — supersede-batch.test.ts already has the machinery.
  • snapshot-overwrite [D4] — carried over; the two-colliding-claimSnapshot-calls pin remains the fix.
  • viewer-snapshot-grammar-off [D3] — no deterministic wire exercise exists: 0/3 on a quiet machine here with NEITHER the server file NOR its old killer files changed since the run that "confirmed 3/3" — that confirmation was adjacent-suite timing, and this table owns the correction.
  • lock-default-fail [D1] — unchanged verdict: the unqueued write's lock-loss policy is untested; the queue-path sibling (split from the same anchor) is killed 1/1, so the same two-line pin re-aimed at the unqueued path closes it.
  • restore-escapes-root [D3] — restoreTarget's realpath containment throw is never reached; its undo.ts sibling branch IS killed (and that kill is what removed Testing-2: the mutation sweep audits the scenarios (instrument, status classes, four audit findings) #70 finding 3's wrong equivalence).

The delta against the 7c4a22d table (38/42) runs both directions. Gained: publish-rename-to-truncate survived→killed 1/1 by logfmt.test.ts — the deterministic pin this audit named as missing shipped inside #89 and the sweep credited it; the loop closing exactly as #70 intended. Lost: two kill→survive flips and one kill→unstable, each full flip re-confirmed 0/3 on a quiet machine — no product regression, three test-strength regressions caused by shipped code moving ground under a kill. Which is precisely why a baseline that isn't maintained on every merge is a score that decays into fiction — #72's gate exists for this.

Unpinned entries are the audit's output, not a scandal — each names the test to write; several (the restore-fail-closed and supersede-lock pins above) look like an afternoon's work and are natural follow-ups for whoever claims them first.

How

bun run sweep:test              # full sweep (baseline first, ~20 min)
bun run sweep:test -- --validate   # anchor check only (seconds)
bun run sweep:test -- --mutant=prune-nolock --confirm=3

Assisted by Qwen3-flash-next

…he shipped catalog

The sweep from 6d1858b refuses to run on any machine whose clean suite is
not fully green - which is every Windows machine right now (torn-read and
resolver families are known-red). Baseline subtraction fixes the auditor
for exactly the platforms that need auditing: measure the clean tree's
failing set once, count only DELTA failures as kills, report known-reds
that die under a mutant separately.

Also lands per abogartz#68/abogartz#70: status classes (killed/survived/unstable/
equivalent/error), confirm-runs for timing-sensitive kills (unstable =
timing luck, not credited), a calibration plant (--selftest), an
equivalence audit that WARNS when an equivalent-marked mutant dies (it
already disproved abogartz#70 finding 3: the undo.ts branch it called dead is
killed by undo.test.ts), scratch reset-before-apply + per-run integrity
check + self-heal rebuild, and --bun pinning.

Catalog: the shipped 24 mutants and the 26 built for abogartz#70 merge into 42
under the shipped ids (5 exact-duplicate breaks deduped, listed in the
port comment). Three anchors were stale against main - lock-default-fail
had gone ambiguous when the queue path duplicated the timeout policy, so
it is split into two uniquely-anchored mutants.

\�un run sweep:test\ joins the bench scripts.

@abogartz abogartz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Verdict: CHANGES_REQUESTED

The design is right — baseline subtraction, 3-run confirmation for timing-only kills, equivalents excluded with a warning, and a calibration plant. I verified the mechanism works end-to-end on macOS (scratch worktrees, junction, mutation apply, suite spawn all function). But as submitted, the tool cannot run on current main, and cannot calibrate on macOS. Both trace to the branch being cut before #89.

1. The catalog is stale against current main — the sweep refuses to start after the merge

Repro (GitHub says MERGEABLE; textually it is — semantically it isn't):

git fetch origin pull/110/head:pr-110 && git worktree add /tmp/w pr-110
cd /tmp/w && git merge origin/main && bun scripts/test-sweep.ts --validate
# FAIL publish-rename-to-truncate: pattern applies to 0 sites in src/logfmt.ts
# FAIL undo-force-safety-after-publish: pattern applies to 0 sites in src/undo.ts
# validate: FAILED - exiting nonzero

and every full run gates on validate (test-sweep.ts:1101-1103) — bun run sweep:test exits immediately on the merged tree.

Root causes, both #89 (post-branch):

  • publish-rename-to-truncate pins await Bun.write(tmp, content);\n await rename(tmp, file); — #89's ea03b91/6359e28 moved the rename into handoverRename(tmp, file, since). The mutation as written no longer says what the invariant row claims; it needs re-anchoring on current writeAtomic, and arguably a companion mutant for the new anchored-retry path (since === undefined → no retry) which is the actual publish-safety mechanism now.
  • undo-force-safety-after-publish's find ends with the WRITE_ATOMIC constant (test-sweep.ts:93): await writeAtomic(target, out.length ? out.join("\n") + "\n" : ""); — #89 added , since to that call (undo.ts:257). The 13-line find matches 0 sites.

2. The calibration plant fails on macOS — on both Bun versions you cite

bun scripts/test-sweep.ts --selftest on macOS: exits nonzero, reproducibly (Bun 1.4.3 ×2, bunx [email protected] ×1 — identical verdict). Not the platform being fragile: the tail shows the plant DID kill the suite (137 pass / 57 fail), but quote-grammar breakage also triggers "Unhandled error between tests" (undo.test.ts), the tally truncates to 198 tests / 43 files, and classify()'s total < 0.8 × BASELINE_TOTAL rule (line 872) reclassifies the whole run runtime-error → selftest reports "This measurement CANNOT FAIL".

That is precisely the meta-defect #68 warns about, inverted: a run that died because of the mutation is discarded as an instrument failure, so the one check that certifies the instrument fails on the maintainer's platform. Fix options: pick a plant that cannot crash the runner (the whole point of "pure function" was containment — quote grammar reaches further than advertised), or make the truncation rule delta-aware: runtime-error should require no significant new failures vs baseline; mass-red-plus-crash is a kill.

3. Lineage arithmetic in the PR body and results doc is wrong

Body: "the shipped 24 mutants and the 26 built for this issue become one 42-mutant catalog". Measured from the trees: catalog = 43 entries = 19 surviving shipped ids + 24 new ids; exactly the 5 dedup'd shipped ids (lock-never-steal, publish-truncate, blocklist-visible, restore-check-blind, restore-safety-stale) were dropped, and 24+26−5 = 45 ≠ 42 ≠ 43. "ids preserved" is true for 19 of 24. For a PR whose thesis is that the tool must not print a wrong claim, the header table and bench/test-sweep-results.md line 119 need to state the actual accounting.

What I did verify and credit

  • --validate passes on the unmerged branch tip; tsc clean; the honesty machinery is real — the equivalent-warning self-discovery (finding 3 of #70's "dead branch" is reached and killed) checks out: budget-dangling-header is the catalog's only [equivalent], and the undo-force-safety-* entries carry no equivalent mark, as the doc claims.
  • No CI wiring (correct for #70; #72 owns the gate), and the four survivors are named with the test to write for each — good audit output.
  • The results table pins its provenance (main @ 7c4a22d, Bun 1.3.10, Windows) — keep that discipline; after re-anchoring, the table must be regenerated or explicitly labeled as the 0.13.0-era baseline.

Re-anchor the two mutants (and while there, consider a mutant for the since-gated retry itself), make the plant survive its own containment promise, fix the two arithmetic claims, regenerate on current main — then this is #70's baseline.

… + delta-aware truncation classify (abogartz#110 review)

- publish-rename-to-truncate follows abogartz#89's rename into handoverRename
- undo-force-safety-after-publish's WRITE_ATOMIC anchor takes the since arg
- a truncated tally with >=3 new reds is a KILL that crashed the runner
  between tests, not an instrument failure (the macOS selftest case)
- catalog lineage arithmetic corrected to the measured 19+24 (5 deduped)
@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Rework pushed as 75fd932 (merge of main + the review fixes), so your repro from the review now behaves differently on this head:

git fetch origin pull/110/head:pr-110 && cd pr-110
bun scripts/test-sweep.ts --validate   # 44/44, was: 2 stale-anchor FAILs
bun scripts/test-sweep.ts --selftest   # the plant dies on Windows; your macOS case is addressed below
  • Finding 1 (stale anchors): both re-anchored where fix(store): make the store's file semantics hold on Windows (+ a windows-latest CI leg) #89 moved the code to - publish-rename-to-truncate onto the handoverRename call, undo-force-safety-after-publish onto the since-threaded writeAtomic call. Same break, same meaning, current bytes.
  • Finding 2 (classify): the truncation rule is now delta-aware: a truncated tally is runtime-error only when fewer than 3 tests newly died; mass-red + runner crash is scored as the KILL it is - exactly your macOS selftest shape.
  • Finding 3 (lineage): fixed in the results doc to the measured arithmetic (19 surviving shipped ids + 24 built, 5 deduped = 43 + plant).

A full regeneration sweep against current main is running now; the score table in the doc goes stale against it by design, and the regenerated one lands as the next commit with provenance (main sha, Bun, OS). Companion-mutant analysis for the since gate in my next comment - it analyzes to equivalent-or-honest-survivor, so I want your call rather than a silent extra row.

…, six unpinned invariants

Provenance: src 7bfe99b, Windows, Bun 1.3.10, baseline 483/0/5.
Delta vs the 7c4a22d run: publish-rename-to-truncate survived->killed (the pin abogartz#89
shipped was credited); lock-restore-failopen + viewer-snapshot-grammar-off flipped
kill->survive (both re-confirmed 0/3 quiet); supersede-rmw-nolock became unstable 1/3.
Both flips' killer files unchanged between the trees - abogartz#89/abogartz#102 moved the ground.
@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Re-verification came back with the full regeneration on current main (ed74f57), so here is the complete response to the review.

Finding 1 - stale anchors: merged main (clean), both mutants re-anchored where #89 moved the code: publish-rename-to-truncate onto the handoverRename call (same break - collapse publish+handover into a truncating write onto the destination), undo-force-safety-after-publish onto the since-threaded writeAtomic call. --validate now 44/44 where the review's repro saw 2 FAILs, and your git merge origin/main && bun scripts/test-sweep.ts --validate exits 0.

Finding 2 - classify and the macOS selftest: the truncation rule in classify() is now delta-aware. Previously: tally under 80% of baseline => runtime-error, full stop - so the plant's exact macOS shape (137 pass / 57 fail / runner truncated) got discarded as an instrument failure even though 57 NEW reds were sitting in the tally. Now a truncated tally is runtime-error only when fewer than 3 tests newly died; mass-red-plus-crash is scored as the kill it is and deltaOf counts it. --selftest bites green on Windows against the merged tree (plant killed 1/1, 20+ distinct killers logged); if you re-run it on macOS with this head, the plant should now report killed instead of runtime-error.

Finding 3 - lineage: corrected in the results doc and PR body to the measured accounting: 19 of the 24 shipped ids survive, 5 deduped as same-break-same-site, 24 built for #70 - 43 patterns + 1 plant. The 42 claim is retired with a pointer to your review as the source of the correction.

The regeneration itself (src 7bfe99b, Windows, Bun 1.3.10, baseline 483/0/5): 36/42 = 85.7%, six survivors, table rebuilt from the raw log. The delta versus the 0.13.0 table is the interesting part, and it cuts both ways:

Companion mutant for the since-gated retry (your optional ask) - analysis before a row, because it doesn't survive analysis cleanly. Two shapes, neither is a clean catalog entry today:

  1. Drop the since argument from the handover call (handoverRename(tmp, file) inside writeAtomic): the retry loop in handoverRename RE-IMPOSES the gate from its own identity check, so the mutated tree behaves identically for every scripted scenario - an equivalent, and a false one to carry since its "equivalence" would be unproven by construction.
  2. Drop the destination-identity recheck inside the retry loop: this genuinely weakens the guarantee (a third writer's bytes could be renamed under our success report) but the only suite evidence we have against it is the torn-read race family - exactly the timing luck Epic: Test integrity — every claimed invariant pinned by a test that dies without it #68's D2 rule refuses to credit. It would enter the baseline as a KNOWN survivor, pre-polluting the score Testing-4: pre-release sweep with a published mutation score and unpinned-invariant list #72 will gate on.
    So my take: the honest companion is pin-first - write the deterministic test (stall a publisher inside the retry loop, touch the destination from another process mid-retry, assert our publish reports failure rather than renamed-stranger-bytes), verify it greens on the clean tree AND reddens under shape 2, then add shape 2 as a mutant that dies 1/1. Happy to do that as a small follow-up PR - your call whether it gates test(#70): the mutation sweep grows a baseline and inherits the shipped catalog #110 or rides after it.

Assisted by Qwen3-flash-next

@abogartz abogartz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

CHANGES_REQUESTED — two of three findings verified fixed; the third (classify/macOS) is masked by a harness bug this branch introduces. I found it while verifying your claim, and it invalidates every macOS measurement this tool makes — including the --selftest pass your comment cites. Evidence below, all reproduced locally (macOS, Bun 1.4.3) at ed74f57.

Verified fixed

Finding 1 (stale anchors): branch head already contains main (git merge origin/main → no-op). Both re-pins match current bytes exactly: publish-rename-to-truncate onto src/logfmt.ts:136-137 (Bun.write(tmp) + handoverRename(tmp, file, since)), undo-force-safety-after-publish onto src/undo.ts:260 (the since-threaded writeAtomic). --validate → 44/44, exit 0. Meaning is preserved in both re-anchors.

Finding 3 (lineage): mechanically confirmed, not taken on faith — extracted the 24 ids from 6d1858b and diffed against the current catalog: 19 survive; the 5 dropped are exactly your documented names (lock-never-steal, publish-truncate, blocklist-visible, restore-check-blind, restore-safety-stale); 19+24=43, --validate counts 43 + plant. The table's arithmetic also sums (43 rows, 1 equivalent, 36 killed = 85.7%). Good work owning the viewer-snapshot-grammar-off correction.

New finding: the scratch's node_modules junction is deleted by resetScratch — every post-reset scratch run on macOS executes zod-starved

Your 12:44 comment says my macOS case is addressed and invites a re-run of --selftest. --selftest does report killed (1/1) — but I instrumented runSuite to dump the full crashing output, and the selftest run itself is instrument-broken:

 148 pass / 7 skip / 58 fail / 25 errors — Ran 213 tests across 46 files [9.4s]
error: Cannot find package 'zod' from '…/sweep-scratch-pr-110/w0/src/schema.ts'

25 of 46 test files die with an empty # Unhandled error between tests (zod cannot resolve); the plant's 33 named kills come from the handful of files Bun's resolution cache had already served. The kill verdict happens to be right, but calibration is passing by luck, not by the classify fix. And it is deterministic: --mutant=publish-rename-to-truncate → runtime-error (0/2), score line 0/0 = 0.0%, exit 0, note "suite could not load the mutated tree" — which is false: 181 tests ran. On the Windows table's platform the same mutant is killed 1/1 — the platform divergence is entirely this bug.

The chain, each link reproduced:

  1. makeScratch links node_modules with symlinkSync(..., "junction"). On Windows a junction is a directory; on macOS this is a plain symlink.
  2. .gitignore:1 is node_modules/ — the trailing slash matches directories only. To git, the scratch's symlink is untracked-and-not-ignored (git check-ignore -v node_modules → exit 1).
  3. resetScratch runs git clean -fdq before every mutant run — and its comment "node_modules is gitignored, so clean -fd (no -x) never sees the junction" is true only on Windows. Demo on a fresh scratch: create symlink → git clean -fdq → gone. The git status --porcelain self-heal can't see it (untracked deletions produce no dirt), and makeScratch's view-check only runs at creation, before the first reset.
  4. Downstream, zod deaths land as file-level unhandled errors with no (fail) names, so both classify()'s new ≥3 rule and deltaOf are blind to them: mutants land in runtime-error → informational → dropped from the denominator, or survive on truncated tallies. A macOS run of the full catalog would print a score and exit 0 having measured almost nothing — the "a harness that cannot go red" disease from the other side.

Suggested fix (any one, plus belt-and-braces): git clean -fdq -e node_modules; or re-create the junction after the clean in resetScratch; or add a bare node_modules pattern to .gitignore. And reuse makeScratch's existing zod view-check after every reset, so a dead junction can never run a blind suite. Acceptance test: on macOS, --selftest killed with a non-truncated tally (488 accounted, not 213), and --mutant=publish-rename-to-truncate measures survived here rather than runtime-error (POSIX rename silently replaces, so the D2 kill is genuinely Windows-pinned — a legitimate platform-divergent survived beats an unscored ghost; worth a table header note that the score is the Windows number).

Smaller related note while you're in there: runSuite parses only named (fail) lines, so a run's summary can report 25 fail / 25 errors with r.failed.length === 0. Even with the junction fixed, consider treating a truncated tally whose summary fail count is large (not just the named array) as at least an instrument failure loudly — otherwise this class of silent file-death stays invisible to both verdict paths.

Your since-gate companion question — my call: follow-up PR, does not gate #110

Your analysis of both shapes is correct (shape 1 is equivalent because handoverRename re-imposes the gate from its own identity check; shape 2 would enter the baseline as a pre-polluted known survivor resting on torn-read timing #68's D2 rule refuses to credit). Your pin-first plan is exactly right, and it does not belong in #110 — but it does depend on the fix above: a stall-a-publisher test has to run in a scratch that can resolve zod. Land scratch-fix first, then the pin+mutant as its own PR.

Nit

Run header claims "this branch touches no shipped file" — package.json +1 (sweep:test script). "No src/ file" would be exactly true.

The classify() change itself reads correctly (r.failed semantics, baselineFail subtraction, flaky rerun policy all still hold) — the problem is that it was validated on a run shape the harness itself manufactured. Fix the junction and I expect a fast pass: re-anchor and lineage are done, the table method is sound, this is one small mechanical fix plus the acceptance re-runs on macOS.

…ch on POSIX (abogartz#110 review)

.gitignore's 'node_modules/' has a trailing slash: directories only. A Windows
junction is a directory and survived; the POSIX symlink was untracked-and-unignored
(check-ignore exits 1) and resetScratch's clean -fdq deleted it before EVERY mutant
run - leaving every non-Windows measurement zod-starved: file-level unhandled
errors with no (fail) names, invisible to both classify and deltaOf, ghosts dropped
from the denominator. The instrument could not go red in the only way that mattered.

- belt: git clean -fdq -e node_modules (name excluded on every platform)
- braces: ensureScratchLink - create (junction or symlink), verify the zod view,
  recreate if broken, THROW rather than run a blind suite - after EVERY reset,
  not just at creation
- classify: a truncated tally whose summary counts >=3 new deaths but names none
  is an instrument failure, announced, never a silent survive
- doc nit: 'no src/ file' is the true statement; package.json +1 (sweep:test)
…-match scans

Found while reproducing abogartz#110's review on Linux (Bun 1.4.4), whose piped output
echoes every (pass) title: the test '...1.10.0 passes the 1.3.0 floor' contains
a spurious '0 pass', and num()'s first-match scan returned THAT as the baseline
tally - so the sweep refused to start (exit 3, baseline produced no results).
A third POSIX-only measurement defect, this one loud at least. Anchor to whole
summary lines, last occurrence; (pass)-lines can never match the anchor.
…OSIX legs are now measurable and legitimately diverge
@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Reproduced, fixed, and you were right on every link of the chain — plus the repro turned up a third POSIX-only defect you didn't have to know about. Two commits: 5dc0aef (the scratch link) + 20e77ae (the tally parser), both on the branch.

Your finding, link by link, on Linux (WSL, Bun 1.4.4) at ed74f57:

  • scratch node_modules symlink: git check-ignore -v → exit 1 (not ignored — trailing slash matches directories only, exactly as you said)
  • git clean -fdq → link gone. git clean -fdq -e node_modules → link survives.

Fixed as you specified, belt and braces:- git clean -fdq -e node_modules in resetScratch.

  • ensureScratchLink: create (junction or symlink), verify the zod view, recreate if broken, and throw rather than run a blind suite — now called after every reset and on the dirty-rebuild path, not just at creation (the create-only check was the exact blind spot you named).
  • classify: a truncated tally whose summary counts ≥3 deaths above baseline but whose named-line parse shows none prints an instrument warning and returns runtime-error — never a silent survive. (Your zod-starved 148/58/0-names shape is in the comment as the reference case.)

The third defect, found by my own red leg: on Linux the pre-fix tool didn't even reach the mutant phase — baseline produced no results (exit 3) with "0 pass / 0 fail / 8 skip" while bun test straight shows 480/8/0. Cause: Bun 1.4.4's piped output echoes every (pass) <title> line, and the test "...1.10.0 passes the 1.3.0 floor" contains a literal "0 pass" — num()'s first-match scan returned THAT as the baseline tally. Windows/macOS never trip it because their piped output is summary-only. Fixed: the parser now matches anchored whole summary lines and takes the last occurrence; (pass)-echoed titles can't match the anchor. Same family disease, different limb — worth knowing your macOS numbers were correct for a reason (quiet piped output) rather than by the parser being right.

Verification so far: Windows, post-fix, full reset machinery exercised: publish-rename-to-truncate still killed (1/1) by logfmt.test.ts, junction guard silent, --validate 44/44, tsc clean. Linux (both fixes in): baseline 480 pass / 0 fail / 8 skip - 488 accounted, non-truncated, the extra skips being the Windows-only legs - and --selftest killed 1/1 with named killers across five-plus files: your acceptance shape, on the POSIX class. And on the mutant question you posed: publish-rename-to-truncate now measures survived (0/1) with a genuine one-item denominator - no more 0/0 ghost - consistent with your macOS reading that the D2 kill is Windows-pinned (a truncating direct publish never opens the same window on POSIX). The table header now says outright that the score is the Windows number and POSIX legs may legitimately diverge, and the doc explains why the published table stands on the pre-fix instrument (a Windows junction was always a real directory; post-fix Windows re-runs reproduce verdicts bit-identically).

Your macOS acceptance, still yours to run (I can show the POSIX class on Linux, not your exact platform): --selftest killed with a non-truncated ~488 tally, and --mutant=publish-rename-to-truncate measuring a real verdict instead of the 0/0 ghost. The Linux legs above are my proxy for both.

Nit taken: the run header now says "no src/ file", which is the true statement — package.json +1 is a shipped change.

And thanks for the companion-mutant ruling; pin-first PR comes after the scratch fix rides, exactly as you sequenced it.

Assisted by Qwen3-flash-next

@abogartz abogartz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

APPROVED at b724d77 — acceptance re-ran on macOS (Bun 1.4.3), every claim from your comment verified against observation. The scratch fix is right, and you found a second POSIX limb of the same disease (the num() first-match scan) that I hadn't reached — the anchored-parser fix reads correctly and my independent regex measurement of the run outputs matches the tool's numbers.

Acceptance, measured here

  • --validate 44/44; tsc clean.
  • --selftest → killed (1/1) with a non-truncated tally: 371 pass / 8 skip / 109 fail = 488 accounted, the plant's kills named across keywords.test.ts and friends. Contrast the contaminated pre-fix shape (213/488) from my last review — this is the honest calibration.
  • --mutant=publish-rename-to-truncate → real verdicts, no more 0/0 ghost: four measured runs, each a full 488-test tree with the zod view intact — survived (0/1) ×3 with empty deltas, matching your prediction that the D2 kill is Windows-pinned ("same suite, different syscalls" is now said out loud in the header).
  • The scratch link survives resetScratch — verified mechanically (-e node_modules) and by the absence of any zod death across every run above.

Two non-blocking observations for the follow-up / #72

  1. Rebuild thrash (POSIX-only): because the excluded link is untracked-not-ignored, every resetScratch's git status --porcelain dirt-check sees ?? node_modules and rebuilds the whole worktree on every reset — you can hear it in my selftest run (51.6s where 25s is honest). Correct but wasteful; the cheapest silencing is dropping ?? node_modules lines from the dirt comparison (the rebuild path would then stay what it is: for real disturbance only).
  2. A noise-kill sighting: my first post-fix run of the targeted mutant reported killed (1/1) on a lone red that evaporated on three re-runs (my manual pre-fix samples showed the same 1-red/2-green shape). The rerun policy only forces confirmation when every delta entry is on the known-flaky list — an unlisted single-test red is credited as a kill on one sample. One extra run before crediting a 1-test kill would close this for 25s/mutant; worth deciding before #72 starts gating on the published score.

Both are tuning, not correctness — the instrument's verdicts now rest on trees that actually run the suite. Nit taken ("no src/ file"), and the platform note's claim that the Windows table stands on the pre-fix instrument is exactly right: the junction was a directory there the whole time.

Branch will need one more update-branch after #112/#113 landed — routine, not a review item.

@abogartz
abogartz merged commit 75b0ddf into abogartz:main Oct 26, 2026
4 checks passed
abogartz-opencode-self-improvement Bot pushed a commit that referenced this pull request Oct 26, 2026
## [0.14.4](v0.14.3...v0.14.4) (2026-10-26)

### Bug Fixes

* **#70:** re-anchored mutant pins for the merged publish path + delta-aware truncation classify ([#110](#110) review) ([75fd932](75fd932)), closes [#70](#70)
* **#70:** tally parsed from anchored summary lines, not first-match scans ([20e77ae](20e77ae)), closes [#70](#70)
* **#70:** the scratch's node_modules link survives resetScratch on POSIX ([#110](#110) review) ([5dc0aef](5dc0aef)), closes [#70](#70)
@abogartz-opencode-self-improvement

Copy link
Copy Markdown

🎉 This PR is included in version 0.14.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Picking up the companion you sequenced here: a publish-rename-since-blind-style mutant (stall the publisher in its retry loop, touch the destination mid-retry, assert the failure report) with the pin-first test as its own PR on top of the landed sweep. Starting now.

WhollyMindless added a commit to WhollyMindless/opencode-self-improvement that referenced this pull request Oct 26, 2026
…e POSIX rebuild thrash

abogartz#110 approval note 1, reproduced on Linux: with clean -e node_modules the link
survives the clean but stays untracked-not-ignored, so every resetScratch's
status --porcelain listed '?? node_modules' and the dirt-check rebuilt the
whole worktree on EVERY reset (his macOS selftest: 51.6s where 25s is honest;
our own green legs carry the warnings). Filter the link's status line out of
the comparison - the reset's own plumbing, owned by ensureScratchLink below;
the rebuild path stays reserved for real disturbance. Windows junctions match
the gitignored node_modules/ directory rule and never surface: post-fix
Windows re-run of publish-rename-since-blind is bit-identical (killed 1/1,
same killers, no warnings).
@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Appreciate the acceptance re-run — and both observations landed as real changes, one with a repro that showed the thrash was in OUR logs too:

Note 1 (rebuild thrash): fixed in #120 (2d1f7ea), which this fed mid-flight. The mechanism is exactly as you diagnosed, and your number had a sibling: our own post-fix Linux legs carry the same came back dirty - rebuilding it (?? node_modules) warnings on every reset (2 per run on a single-mutant run — clean -e keeps the link, status lists it, the dirt check rebuilt). Fixed as you specced — the dirt comparison now drops ?? node_modules lines, so the rebuild path stays for real disturbance only. Measured on Linux: 2 rebuild warnings → 0, wall back to the honest shape (23.0s baseline 22.2s, the 2s settle×2 gone), verdicts unchanged. Windows untouched by construction (junctions are gitignored directories; the filter can't match) — re-run bit-identical, killed (1/1), same killers, no warnings.

Note 2 (1-test kills credited on one sample): deliberately leaving that call to you. It's a verdict-policy change, not instrument plumbing, and you framed it for the #72 timeline — "worth deciding before #72 starts gating on the published score" is right, and my sighting from #110's round (supersede-rmw-nolock's 1/3) is the same animal. If you want the shape we'd suggest: extend the rerun policy from "all-delta-flaky" to "delta of exactly one test not on the known list → +1 confirmation run," ~25s/mutant worst case, which is roughly what the thrash fix just gave back.

Since you asked the follow-up to carry it: #120 now ships the deterministic since-gate pin (red at 453ms vs the old pins' 1516ms — 4x inside the deadline instead of 1.33x), the 44th pattern publish-rename-since-blind (killed 1/1), the lock-default-fail re-anchor (its anchor rotted under the #107 branch's now() seam — validate caught it the day it landed), and the thrash silencing above. Your note that nothing runs --validate in CI is the strongest argument yet for the #72 gate job; if it helps, the one-step CI validate is trivially liftable from #120's tooling into whatever shape you want that job to be.

abogartz pushed a commit that referenced this pull request Oct 26, 2026
…(the #110 companion)

The #110 ruling sequenced this: the anchored retry's re-check (handoverRename
aborts while the destination has moved past \since\) had no mutant, and the
two tests that DO kill a blind retry land at ~1500ms racing the window's
internal 2000ms deadline - a 1.33x margin a stalled runner can flip into a
silent survive. That's the timing-luck class #110 made a status.

- new handover test: destination touched at event-loop speed (~60ms), handle
  freed at 400ms - 4x inside the deadline. Shipped aborts on the identity
  check in ms; a blind retry publishes stale bytes by ~450ms (measured: red at
  453ms). Neither verdict waits on the deadline.
- catalog: publish-rename-since-blind (44th pattern, --validate 45/45),
  killed 1/1 (logfmt.test.ts + supersede-batch.test.ts) at f4ba5dc.
- re-anchor lock-default-fail: the #107 branch's now() seam rotted it (that
  was OUR merge; --validate caught it on main the day it landed - proof the
  tool earns keep, and that nothing runs it in CI). Killed 1/1 at the new
  anchor (lock-absent-holder.test.ts).
- doc: 43->44 lineage note + margin math; baseline 491/0/5, suite + tsc clean.
abogartz added a commit that referenced this pull request Oct 26, 2026
…ompanion

test(#70): deterministic since-gate pin + publish-rename-since-blind (the #110 companion)
abogartz-opencode-self-improvement Bot pushed a commit that referenced this pull request Oct 26, 2026
## [0.14.7](v0.14.6...v0.14.7) (2026-10-26)

### Bug Fixes

* **#70:** the kept node_modules link is not dirt - silence the POSIX rebuild thrash ([2d1f7ea](2d1f7ea)), closes [#70](#70) [#110](#110)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants