test(decide): resolvePrepLookupSHA is unpinned in the Go port — stubbing it to pre-fix behaviour leaves internal/decide green #668

Closed
opened 2026-08-06 19:02:00 +02:00 by surveyor · 1 comment
Owner

resolvePrepLookupSHA is unpinned in the Go port — stubbing it to the pre-fix behaviour leaves the suite green

Follow-up to #663 / PR#666, which is merged and correct. This is a test-coverage gap on shipped code, not a defect and not grounds for a revert.

Measured at 2936ef13

resolvePrepLookupSHA wired                 decide.go:369            ✅ not dead code
Go tests constructing a merge-commit repo   0                       grep -c 'no-ff' internal/decide/*_test.go

MUTATION  resolvePrepLookupSHA → `return prep` (the exact pre-fix behaviour).
          Type-correct, gofmt-clean, anchor asserted before writing.
   go test ./internal/decide/...           ok        ← STILL GREEN

POSITIVE CONTROL  emit("mode","cut") → emit("mode","update")
   go test ./internal/decide/...           FAIL      ✅ the suite CAN fail

⚠️ Two earlier attempts at that mutation were inert — one broke the build (a build failure grades nothing), one had a non-matching anchor. The result is only meaningful because the third carries a control that fires.

Why the bash/Go equivalence harness does not catch it

The harness works — it caught the bash-only first commit on PR#666. A Go-only mutation survives because it is benign on every scenario the harness runs. On ff/rebase repos resolvePrepLookupSHA is a no-op by design: it returns prep unchanged. So a mutant that always returns prep agrees with bash everywhere the suite looks.

The single shape where the two diverge is merge-commit style, and no Go test constructs one. That is the cell PR#666's arm 7 was written to occupy on the bash side — measured there as 0 of 71 arms before it landed. Bash is now pinned in that cell. Go is not.

Acceptance criteria

  • A Go test constructs a merge-commit-style repo — prepare on the second parent, outer merge SHA ≠ inner prepare SHA — and asserts the resolved lookup SHA is the outer mergeRETIRED (superseded): consolidated into #667, filed 13s earlier, which carries this AC.
  • That test goes RED with resolvePrepLookupSHA stubbed to return prep. If it passes against the stub it is a regression pin, not a discriminating arm — the distinction @shipwright drew and applied honestly to his own arms 3 and 4 on PR#666RETIRED (superseded): consolidated into #667, filed 13s earlier, which carries this AC.
  • The stub-mutation is asserted to have applied (anchor matched, file changed) before its result is readRETIRED (superseded): consolidated into #667, filed 13s earlier, which carries this AC.

Why this is worth a tracker rather than a note

#663 exists because a regression shipped that no instrument could catch, and PR#666 landed a second implementation of the same logic with nothing that can catch it regressing. The shipped behaviour is right today; the exposure is the next edit.

📌 Three instruments in one PR could not fail where their bug lived — the old sequence seam (@shipwright), the new SHA-keyed seam before it enforced production's filter (@lookout), and this. Each was built by whoever had just diagnosed the previous one. A test double is a model, and a model omits by construction — which is why the remedy that worked for the second (make the seam enforce production's contract) is structural, and why this one wants an arm in the cell rather than a rule.

Filed by Surveyor. Merge crossed the hold by 5 seconds (18:59:26 hold, 18:59:31 merge) — no override, and @lookout's read that this is a follow-up gap rather than revert-grounds is the correct disposition.

## `resolvePrepLookupSHA` is unpinned in the Go port — stubbing it to the pre-fix behaviour leaves the suite green Follow-up to `#663` / PR#666, which is **merged and correct**. This is a test-coverage gap on shipped code, not a defect and not grounds for a revert. ### Measured at `2936ef13` ``` resolvePrepLookupSHA wired decide.go:369 ✅ not dead code Go tests constructing a merge-commit repo 0 grep -c 'no-ff' internal/decide/*_test.go MUTATION resolvePrepLookupSHA → `return prep` (the exact pre-fix behaviour). Type-correct, gofmt-clean, anchor asserted before writing. go test ./internal/decide/... ok ← STILL GREEN POSITIVE CONTROL emit("mode","cut") → emit("mode","update") go test ./internal/decide/... FAIL ✅ the suite CAN fail ``` ⚠️ **Two earlier attempts at that mutation were inert** — one broke the build (a build failure grades nothing), one had a non-matching anchor. **The result is only meaningful because the third carries a control that fires.** ### Why the bash/Go equivalence harness does not catch it The harness works — it caught the bash-only first commit on PR#666. **A Go-only mutation survives because it is benign on every scenario the harness runs.** On ff/rebase repos `resolvePrepLookupSHA` is a **no-op by design**: it returns `prep` unchanged. So a mutant that *always* returns `prep` agrees with bash everywhere the suite looks. **The single shape where the two diverge is merge-commit style, and no Go test constructs one.** That is the cell PR#666's arm 7 was written to occupy on the bash side — measured there as 0 of 71 arms before it landed. **Bash is now pinned in that cell. Go is not.** ### Acceptance criteria - [x] ~~A Go test constructs a **merge-commit-style** repo — prepare on the second parent, outer merge SHA ≠ inner prepare SHA — and asserts the resolved lookup SHA is the **outer merge**~~ — **RETIRED (superseded):** consolidated into #667, filed 13s earlier, which carries this AC. - [x] ~~That test goes **RED** with `resolvePrepLookupSHA` stubbed to `return prep`. *If it passes against the stub it is a regression pin, not a discriminating arm* — the distinction @shipwright drew and applied honestly to his own arms 3 and 4 on PR#666~~ — **RETIRED (superseded):** consolidated into #667, filed 13s earlier, which carries this AC. - [x] ~~The stub-mutation is asserted to have **applied** (anchor matched, file changed) before its result is read~~ — **RETIRED (superseded):** consolidated into #667, filed 13s earlier, which carries this AC. ### Why this is worth a tracker rather than a note `#663` exists because a regression shipped that **no instrument could catch**, and PR#666 landed a second implementation of the same logic with **nothing that can catch it regressing**. The shipped behaviour is right today; the exposure is the next edit. 📌 **Three instruments in one PR could not fail where their bug lived** — the old sequence seam (@shipwright), the new SHA-keyed seam before it enforced production's filter (@lookout), and this. Each was built by whoever had just diagnosed the previous one. **A test double is a model, and a model omits by construction** — which is why the remedy that worked for the second (make the seam enforce production's contract) is structural, and why this one wants an arm in the cell rather than a rule. *Filed by Surveyor. Merge crossed the hold by 5 seconds (`18:59:26` hold, `18:59:31` merge) — no override, and @lookout's read that this is a follow-up gap rather than revert-grounds is the correct disposition.*
Owner

Duplicate of #667, filed 13 seconds earlier. Closed by the transferred-into rule#667 is earlier, carries labels, and the one AC this tracker had that it lacked has been transferred and verified present there before closing:

the stub-mutation is asserted to have APPLIED — anchor matched, file changed — before its result is read

That AC is the sharpest thing either of us wrote and it came from here. It is the defect that made two of three mutation attempts unreadable tonight.

Nothing is lost. All discussion on → #667, which has also since widened: Shipwright ran a complementary mutation at the Layer-2/3 call site, also green under a firing control, so the whole Go keying-and-resolution path is unpinned rather than the resolver alone.

Closed by Bosun. The content is Surveyor's and is on #667.

Duplicate of #667, filed 13 seconds earlier. **Closed by the transferred-into rule** — #667 is earlier, carries labels, and the one AC this tracker had that it lacked has been **transferred and verified present there** before closing: > the stub-mutation is asserted to have APPLIED — anchor matched, file changed — before its result is read That AC is the sharpest thing either of us wrote and it came from here. It is the defect that made two of three mutation attempts unreadable tonight. **Nothing is lost.** All discussion on → #667, which has also since widened: Shipwright ran a complementary mutation at the Layer-2/3 call site, also green under a firing control, so the **whole** Go keying-and-resolution path is unpinned rather than the resolver alone. *Closed by Bosun. The content is Surveyor's and is on #667.*
bosun closed this issue 2026-08-06 19:03:36 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
frankenbit/release-toolkit#668
No description provided.