T-TWZD-normalize-baseline-diff-nondeterministic-output
Status: closed/done · Impact: medium · Complexity: small
run_quality_checks.ts --diff-against-baseline exists to gate a commit only
on new drift — findings present in HEAD but absent from a captured baseline.
But its finding unit is the raw stdout line, and several verbs emit lines that
carry ephemeral content: an absolute tmpdir fixture path (e.g.
/private/tmp/xxxxxx/...) or a transient commit SHA that differs every run.
Those lines never match their baseline counterparts, so the per-verb
set-difference reports them as new drift even when nothing real changed. The
fix is a normalization pass that masks those ephemeral tokens before the lines
are line-diffed, so the gate only flags genuine, deterministic drift.
| Location | Role today |
|---|---|
plugin/scripts/quality_baseline.ts | findingsFromStdout splits a verb’s stdout on \n, strips only trailing whitespace per line, drops empty lines, and returns the survivors verbatim — no token masking. diff(current, baseline) then does a plain set-difference of these verbatim lines. |
plugin/scripts/run_quality_checks.ts | --diff-against-baseline <sha> mode loads <baseline-dir>/<sha>.json, recomputes current findings via findingsFromStdout, calls baselineDiff, and emits new-drift: <verb>: <line> to stderr for every line in the difference (the gating set). |
An ephemeral tmpdir path or transient SHA embedded in a verb’s stdout line
makes that whole line unique per run, so it is always in the set-difference and
always surfaces as a false-positive new-drift finding.
Proposed
Section titled “Proposed”Before the per-verb set-difference is computed, every finding line — on both the current side and the baseline side — passes through a normalization pass that replaces ephemeral tokens with stable placeholders:
- absolute tmpdir paths (the OS temp root and its randomized subdirectories,
e.g.
/tmp/...,/private/tmp/...,$TMPDIR/...) → a fixed sentinel such as<TMPDIR>; - bare 7-to-40-char lowercase-hex commit SHAs →
<SHA>.
With both sides normalized identically, two lines that differ only in an ephemeral token collapse to the same string and cancel out of the set-difference, so they no longer surface as new drift. A line whose real content changed still differs after masking and is still reported. Because the baseline JSON on disk stores pre-normalization findings, normalization is applied symmetrically at diff time rather than rewriting the capture format.
Approach
Section titled “Approach”- Add a pure
normalizeFinding(line: string): stringhelper toquality_baseline.ts(alongsidefindingsFromStdout) that applies the tmpdir-path and SHA masks in a fixed order and returns the masked line. Keep the regexes anchored to token boundaries so prose that merely contains a hex word isn’t clobbered. - Apply
normalizeFindingto both operands of the set-difference insidediff(current, baseline)(or to the finding lists immediately before the diff), so the comparison is mask-vs-mask. Decide and document whether the emittednew-drift:line shows the masked or the original text — prefer the masked form so the gate output is itself deterministic and reviewable. - Confirm the symmetric-masking choice against the on-disk baseline format:
baselines are captured verbatim, so normalization must happen on the
baseline side at diff time too (not only on current). Verify no caller reads
findingsexpecting the raw, unmasked line in a way this changes. - Add a
bun:testcase feeding a current finding with an ephemeral tmpdir path / SHA against a baseline finding that differs only in that token, and assert the diff is empty; add a companion case where the non-ephemeral part differs and assert the line is still reported.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
plugin/scripts/quality_baseline.ts | modify | Add normalizeFinding; apply it symmetrically inside diff (or to both finding lists pre-diff) before the set-difference. |
plugin/scripts/run_quality_checks.ts | modify | Ensure the --diff-against-baseline path surfaces masked finding text in the new-drift: output (only if the masking is applied at the emit boundary rather than wholly inside quality_baseline.diff). |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: A
bun:testcase in which the current and baseline findings differ only in a tmpdir path or commit SHA yields an empty per-verb diff (nonew-drift), where today it yields one false-positive line. - AC-2: A
bun:testcase in which the non-ephemeral portion of a finding line genuinely changed still reports that line as new drift after masking (no false negatives introduced). - AC-3:
normalizeFindingis applied to both the current and baseline sides of the comparison, verified by a test that masking only one side would leave the diff non-empty.
Out of scope
Section titled “Out of scope”- The count-summary / audit-summary-line drift dimension — verbs whose summary
lines (corpus counts,
OK N/N, audit totals) shift run-to-run independent of any ephemeral token — is not addressed here. That dimension is already owned by T-BCNP-quality-gate-ignores-summary-and-corpus-lines (planning/backlog); this task deliberately does not duplicate or pre-empt its approach decision. This task is scoped strictly to masking ephemeral tmpdir fixture paths and transient commit SHAs. - Changing the on-disk baseline capture format (findings stay captured verbatim; masking is a diff-time concern).
Dependencies
Section titled “Dependencies”- none
Discovery context
Section titled “Discovery context”Post-mortem follow-up from T-79SM-finish-claude-harness-ts-migration (closed/done). Originally drafted on PR #214, which would have landed a schema-invalid, date-prefixed, id-less task; that draft also folded in the count-summary noise dimension now owned by T-BCNP-quality-gate-ignores-summary-and-corpus-lines. This re-mint narrows the task to the genuinely new dimension — ephemeral tmpdir paths and transient SHAs — and supersedes #214.
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: Gate false-positives: —diff-against-baseline flagged 10 pre-existing findings as new-drift (randomized tmpdir fixture paths, incidental PR: marker lines) — proven identical on the clean tree; the masking fix is already tracked by T-TWZD-normalize-baseline-diff-nondeterministic-output. Keywords searched: t-twzd-normalize-baseline-diff-nondeterministic-output, diff-against-baseline, false-positives, pre-existing, randomized, incidental, new-drift, identical Excluded: T-XD7M-retire-task-sort-stub Top candidates (score / status / headline):
- 46 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 14 / closed/superseded / T-SDB5-audit-entities-baseline-allow — audit_entities.py: distinguish pre-existing drift from PR-introduced drift
- 13 / closed/done / T-5VN7-pr-check-cursor-bootstrap-misses-existing-comments — pr-check cursor: pin bootstrap behavior and filter self-posted orchestrator comments
- 13 / planning/proposed / T-XC32-task-acs-phrase-against-clean-fixtures — Phrase corpus-dependent task ACs against a clean fixture tree
- 12 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate
ignores baseline-shifting summary and corpus-growth lines
Decision: LINKED-EXISTING Rationale: The dedup script returned SPAWNED because this task scored
below threshold against the bullet’s keyword set, but the originating post-mortem bullet explicitly
names T-TWZD-normalize-baseline-diff-nondeterministic-output as its tracker — and this task’s
scope (masking ephemeral tmpdir fixture paths and transient SHAs in
--diff-against-baseline) is an exact match for the bullet’s symptom (randomized tmpdir fixture paths and incidental marker lines flagged as new-drift). Linked to this existing tracker rather than spawning a duplicate. Linked from: T-XD7M-retire-task-sort-stub
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: Step 7’s baseline diff flagged 8 false-positive new-drift findings: pre-existing failing suites embed randomized tempdir paths (/tmp/claude-502/append-pr-url-*/) so the differ can’t match them run-to-run — already tracked by T-TWZD-normalize-baseline-diff-nondeterministic-output; link, don’t respawn Keywords searched: t-twzd-normalize-baseline-diff-nondeterministic-output, false-positive, append-pr-url-, pre-existing, randomized, claude-502, run-to-run, new-drift Excluded: T-VWH3-ts-index-generator-script Top candidates (score / status / headline):
- 40 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 22 / planning/draft / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 14 / closed/superseded / T-SDB5-audit-entities-baseline-allow — audit_entities.py: distinguish pre-existing drift from PR-introduced drift
- 13 / closed/done / T-5VN7-pr-check-cursor-bootstrap-misses-existing-comments — pr-check cursor: pin bootstrap behavior and filter self-posted orchestrator comments
- 11 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate ignores baseline-shifting summary and corpus-growth lines Decision: SPAWNED → overridden to LINKED-EXISTING Rationale: The originating post-mortem bullet (T-VWH3-ts-index-generator-script) explicitly names this task as its tracker (“already tracked by T-TWZD…; link, don’t respawn”) and per-task inputs flagged it LINKED-EXISTING. The script scored T-TWZD at rank #2 (22) but below its spawn threshold; the bullet’s symptom (randomized tmpdir paths in failing suites defeating the run-to-run differ) is exactly this task’s scope. Linked from: T-VWH3-ts-index-generator-script
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: quality_baseline.ts capture, run against a working tree dirty under audited paths, polluted
the baseline so audit_entities surfaced phantom new-drift on - OK enumeration lines and
corpus-count headers; capturing from a clean detached origin/main worktree fixed it. Also:
origin/main advanced three times during the run, forcing repeated re-baseline against a moving SHA.
Keywords searched: quality_baseline, audit_entities, new-drift, baseline, working-tree, origin-main,
dirty, corpus, capture, moving-SHA Decision: LINKED-EXISTING
T-TWZD-normalize-baseline-diff-nondeterministic-output Rationale: The dedup script scored T-TWZD at
111 / 83 across the two baseline-related bullets from this run. Both bullets are the same
false-positive class T-TWZD owns — the --diff-against-baseline line-differ flags benign,
non-deterministic corpus/- OK lines as new-drift whenever the baseline SHA and the worktree corpus
diverge. The corpus-count-header and - OK-enumeration noise specifically overlaps
T-BCNP-quality-gate-ignores-summary-and-corpus-lines (already in T-TWZD’s related). Linked here
rather than spawning a duplicate. (The check_ancestry foreign-verify-commit bullet from the same run
is already owned by the in-flight T-61OI-check-ancestry-flags-stale-base — not edited here
because it carries an open PR #284.) Linked from:
T-7RST-ensure-ready-flags-mid-migration-corpus-assumptions
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: Quality gate cannot mechanically pass against any frozen baseline: bun test findings embed nondeterministic temp-dir paths (/tmp/claude-502/…) — findingsFromStdout should normalize temp paths before diffing Keywords searched: findingsfromstdout, nondeterministic, mechanically, claude-502, normalize, baseline, findings, temp-dir Excluded: T-0010 Top candidates (score / status / headline):
- 67 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 58 / planning/draft / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 50 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 45 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 37 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate
ignores baseline-shifting summary and corpus-growth lines
Decision: SPAWNED → overridden to LINKED-EXISTING Rationale: The bullet’s proposed fix
(“findingsFromStdout should normalize temp paths before diffing”) is verbatim this task’s scope —
its Goal and Proposed describe a
normalizeFindinghelper inquality_baseline.tsthat masks ephemeral tmpdir paths (and transient SHAs) before the set-difference. The script scored T-TWZD at rank #2 (58) below its spawn threshold, but linking to the active draft tracker avoids a duplicate. The H69K top hit is closed/done and only isolates pre-existing drift; it does not normalize temp paths. Linked from: T-0010
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: The quality gate’s baseline diff is raw-line-based; two test files printing randomized temp-dir paths produced perpetual false-positive new-drift findings, forcing an operator decision mid-run — the extractor should normalize volatile path components so the false-positive class is closed structurally, not per-test. Keywords searched: raw-line-based, false-positive, structurally, randomized, components, perpetual, new-drift, extractor Excluded: T-0012 Top candidates (score / status / headline):
- 14 / planning/draft / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 12 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 9 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate ignores baseline-shifting summary and corpus-growth lines
- 5 / closed/done / T-SIHV-task-state-frontmatter-commits-on-main-not-worktree-branch — All task-state frontmatter commits land on main; worktree branch is implementation diff only
- 4 / closed/done / T-174G-archive-records-closing-timestamp-for-post-mortem-detector —
sdlc lease task archiverecords a closing timestamp into the archive ref Decision: LINKED-EXISTING T-TWZD-normalize-baseline-diff-nondeterministic-output Linked from: T-0012
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: run_quality_checks.ts —diff-against-baseline flagged spurious new-drift lines from audit count-headers and new OK audit lines that shift when entity counts change; the baseline diff should normalize count headers and treat new OK lines as non-drift Keywords searched: diff-against-baseline, run_quality_checks, count-headers, new-drift, normalize, non-drift, spurious, baseline Excluded: T-0006 Top candidates (score / status / headline):
- 94 / planning/draft / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 83 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 78 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 71 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 45 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate
ignores baseline-shifting summary and corpus-growth lines
Decision: LINKED-EXISTING T-TWZD-normalize-baseline-diff-nondeterministic-output
Linked from: T-0006
Note: the originating bullet’s symptom (audit count-headers and new
- OKlines flagged as drift when entity counts change) overlaps T-TWZD’s normalization scope; the count-summary dimension is owned by T-BCNP-quality-gate-ignores-summary-and-corpus-lines per T-TWZD’s Out-of-scope.
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: The Step 7 baseline gate flagged new-drift lines that are pre-existing because bun test findings are non-deterministic between runs; quality_baseline and run_quality_checks should sort and dedupe each verb findings before diffing, or treat a verb whose pass/fail status is unchanged vs baseline as non-gating regardless of line churn, so flaky failing verbs do not raise false positives. Keywords searched: run_quality_checks, non-deterministic, quality_baseline, pre-existing, non-gating, regardless, new-drift, unchanged Excluded: T-F8BP-dogfood-baseline-smoke-test Top candidates (score / status / headline):
- 57 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 47 / open/ready / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 32 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 25 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate ignores baseline-shifting summary and corpus-growth lines
- 22 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass
—baseline-dir explicitly to defeat silent fallback in worktree
Decision: SPAWNED → overridden to LINKED-EXISTING Rationale: The script returned SPAWNED because the
top hit (T-H69K, closed/done) only isolates pre-existing drift; but T-TWZD (rank #2, open/ready) is
an exact-scope match — its
findingsFromStdoutnormalization pass is precisely the fix for non-deterministic per-verb findings the F8BP dogfood run hit (bun test: PR: https://github.com/example/repo/pull/{1,7}flagged as new-drift while byte-identical to the baseline). This is the sixth post-mortem to surface the same gap and link here. Linked from: T-F8BP-dogfood-baseline-smoke-test Bullet: Step 7 —diff-against-baseline flagged spurious new-drift lines that were OK audit lines for other tasks, because the baseline was captured at origin/main while the worktree branched from a local main that parallel sessions had advanced. Capturing the baseline at the worktree’s actual branch-point rather than origin/main would avoid the transient false-positive. Keywords searched: diff-against-baseline, false-positive, branch-point, new-drift, capturing, transient, spurious, baseline Excluded: T-SPBO-commit-helper-routes-through-tempfile Top candidates (score / status / headline): - 104 / open/ready / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 79 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 67 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 57 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 38 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate
ignores baseline-shifting summary and corpus-growth lines
Decision: LINKED-EXISTING T-TWZD-normalize-baseline-diff-nondeterministic-output
Linked from: T-SPBO-commit-helper-routes-through-tempfile
Note: the originating bullet’s symptom (a baseline captured at origin/main
while the worktree branched from a locally-advanced main, so other tasks’
- OKaudit lines surfaced as spurious new-drift) is the same false-positive class T-TWZD’s normalization pass targets; linked rather than respawning.
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: run_quality_checks —diff-against-baseline against audit_entities produced false-positive new-drift lines that were benign OK corpus-listing rows and a file-count header, flagged only because the worktree corpus was behind origin/main; the baseline line-diff is sensitive to corpus membership churn, not just schema drift Keywords searched: diff-against-baseline, run_quality_checks, audit_entities, false-positive, corpus-listing, file-count, membership, new-drift Excluded: T-E9C9-project-check-flags-operations-column-drift Top candidates (score / status / headline):
- 64 / open/ready / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 47 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 42 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 21 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 19 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate
ignores baseline-shifting summary and corpus-growth lines
Decision: LINKED-EXISTING T-TWZD-normalize-baseline-diff-nondeterministic-output Linked from:
T-E9C9-project-check-flags-operations-column-drift Note: the originating bullet’s symptom (audit
- OKcorpus-listing rows and a file-count header surfacing as new-drift because the worktree corpus was behind origin/main) is the same baseline-diff false-positive class T-TWZD targets; linked rather than respawning. Bullet: Baseline-diff quality gate reported spurious new-drift lines for audit_entities corpus rows that differ only because the branch was cut from an older main; run_quality_checks.ts —diff-against-baseline should diff on genuine finding lines rather than the whole corpus listing Keywords searched: diff-against-baseline, run_quality_checks, audit_entities, baseline-diff, new-drift, reported, spurious, quality Excluded: T-7PXF-declare-worktree-init-bun-install Top candidates (score / status / headline): - 81 / open/ready / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 64 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 58 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 47 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 37 / closed/done / T-T879-task-work-uses-per-project-quality-checks — Make /sdlc:task-work
quality-check commands per-project configurable
Decision: LINKED-EXISTING T-TWZD-normalize-baseline-diff-nondeterministic-output Linked from:
T-7PXF-declare-worktree-init-bun-install Note: the symptom here (audit_entities
- OKcorpus rows and the count header flagged as new-drift because the branch was cut from an older main) is the count-summary/corpus-growth dimension owned by T-BCNP-quality-gate-ignores-summary-and-corpus-lines rather than T-TWZD’s ephemeral-token masking; linked here as the nearest active tracker per the dedup search, with the cross-reference to T-BCNP noted. Bullet: The baseline-gated quality gate reported new-drift lines that were all benign OK audit-status lines from audit_entities.ts, flagged only because the baseline SHA origin/main predated local-main commits; the per-entity OK lines should be excluded from the baseline diff or the baseline captured against local main tip Keywords searched: baseline-gated, audit_entities, audit-status, local-main, per-entity, new-drift, reported, baseline Excluded: T-WOL2-task-work-preflight-probes-file-mutation-tools Top candidates (score / status / headline): - 92 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 88 / open/ready / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 66 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 50 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 39 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate
ignores baseline-shifting summary and corpus-growth lines
Decision: LINKED-EXISTING T-44OO → overridden to LINKED-EXISTING
T-TWZD-normalize-baseline-diff-nondeterministic-output Rationale: The script’s top pick T-44OO
(score 92) is about plugin scripts self-discovering the project root from cwd — a different concern.
The bullet’s actual symptom (benign
- OKaudit lines surfacing as spurious new-drift because the baseline SHA origin/main predated the local-main commits the worktree branched from) is the exact false-positive class T-TWZD owns (rank #2, score 88), already linked from six prior post-mortems with the identical symptom. Linked to T-TWZD rather than spawning a duplicate. Linked from: T-WOL2-task-work-preflight-probes-file-mutation-tools
Post-mortem
Section titled “Post-mortem”Captured by /sdlc:task-work on 2026-06-05. PR: pending.
Acceptance criteria coverage
Section titled “Acceptance criteria coverage”- AC-1: auto —
bun test plugin/scripts/tests/quality_baseline.test.tscasestmpdir-only difference cancels outandSHA-only difference cancels out: a current/baseline pair differing only in a tmpdir path or SHA yields an emptydiff(). - AC-2: auto — same suite,
genuine change still surfaces after masking: a real non-ephemeral change (expected 3→expected 4) is still reported, in masked form, so no false negative is introduced. - AC-3: auto — same suite,
masking only one side would leave the diff non-empty: the symmetric path returns[], and the asymmetric counterfactual (mask current only, compare against raw baseline) leaves the masked line unmatched — proving both sides must be masked.
What worked
Section titled “What worked”- The fix dogfooded cleanly: re-running the baseline-gated gate on the worktree returned
OK 5/5with 0 new-drift, and the realbun test vX (7c45ed97)banner hash in the captured baseline confirmednormalizeFindingmasks an actual transient SHA, not just synthetic test strings. - Symmetric masking landed in one place (
diff()masks both operands);run_quality_checks’ pre-existing loop reused the same exported helper, so the classification stayed consistent with no duplicated regex.
Friction and automation gaps
Section titled “Friction and automation gaps”- The verify-stamp, start-commit, and (upcoming) prs-record steps assume the main checkout sits on
main; this run’s main checkout was on an unrelated user branch (backlog-capture), soensure_ready_mutate.ts --commit-on mainandstart_task.ts(both resolve the main repo via--git-common-dir, then require branch==main) could not be driven directly — the run used a throwaway main-ref worktree plusstart_task.ts --main-repo <override>and a hand-applied--commitfor the verify-stamp. A--main-repo/--commit-on <worktree>override on the ensure-ready mutator (mirroring the onestart_task.tsalready exposes) would let task-work land main-ref task-state commits on a dedicated worktree without the operator improvising, when the primary checkout is intentionally parked on another branch. → T-31XR-ensure-ready-mutator-main-repo-override
Spawned follow-up tasks
Section titled “Spawned follow-up tasks”- T-31XR-ensure-ready-mutator-main-repo-override (https://github.com/sksizer/dev/pull/297) — ensure-ready mutator main-repo override; spawned (Upstream-plugin/sdlc, degenerate-local).