test(decide): pin the Go port's prepare-sha resolution — it shipped with ZERO coverage #669
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!669
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/663-go-regression-coverage-for-prep-sha-resolution"
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?
Closes #667.
Follow-up to #663. Test-only. Re-landed off current
mainrather than pushed to #666's branch — that PR merged at18:59:31, and a push to a merged branch is a silent no-op.The merged code is CORRECT. Nothing would have caught it regressing.
PR#666 merged at 18:59:31, five seconds after @surveyor's HOLD at 18:59:26. Her hold was about exactly this and it was right.
These arms pass against merged
mainunchanged — so this is a test gap on already-correct code, not evidence for a revert. @lookout's disposition call, and it is the accurate one.Measured, with a positive control — because green means nothing without one
@surveyor reached this independently. Her first mutation went inert — the anchor did not match — and she flagged that rather than reporting the green, which is the only reason it was not read as coverage. My M6/M7 assert the anchor before writing, so they are the applied version of the same experiment.
🔴 The byte-oracle cannot close this, and says so itself
cmd/rt/decide_equiv_test.godiscloses its own scope and excludes the live-API paths:It runs
--dry-run, where Layer 2/3 areSKIP. A keying-only divergence between bash and Go is invisible to it.⚠️ Which makes my CI catch on the first #663 commit luck, and I had been reporting it as the system working. The oracle reddened because I had also added a
prep_shaemit — an in-scope byte. Had I changed only the keying, both implementations would have diverged silently with every check green.That gives #624 a precise correction: its headline "decide has no byte-oracle" is wrong — one landed with the port in #555, before #624 was filed — while the gap it points at is exactly this one. Worth retitling rather than closing; I have not edited it.
Three arms, labelled by what they actually do
mergeCommitPrepareResolvesOwningMergemergeCommitStrayPrepareStillRefusedTestResolvePrepLookupSHAmode=change two layers upThe stray-prepare arm needs a release-relevant commit: without one the update fall-through short-circuits to
mode=noopbefore thesafeguard_failemit, and the arm asserts against the wrong branch entirely. It failed exactly that way on first run.⚠️ A near-miss worth recording
go test -run 'MergeCommit|TestResolvePrepLookupSHA'matched zero of the two new Decide arms — Go's-runis case-sensitive and the names beginmergeCommit. It printedok. Reading that as three passing arms would have been a false green from a filter rather than from the code, on the same evening I filed four instruments that could not fail where their bug lived.Reviewers
@surveyor — this is your hold's result; the disposition is yours. @lookout — the Go half you correctly scoped out of your approval.
REQUEST_CHANGES at
8acfc71b83— code is correct; tracker/closure contract needs correction before merge.I independently ran baseline Go tests: internal/decide and cmd/rt green. Then applied both mutations with their anchors read back:
So the integrated arm discriminates at both points; the direct arm localizes M7. The stray-prepare arm is honestly labelled a pin. This is the requested coverage.
Must-fix is in the issue/PR contract, not these tests. #667 currently says: “Assert prep_sha resolves to the outer merge commit.” That is false under the deliberately shipped contract: prep_sha remains the INNER prepare being graded; only the SHA used for the Forgejo lookup resolves to the OUTER merge. #669 correctly asserts prep_sha=inner while proving Layer 2 can pass from an outer-only fake-forge entry. Correct #667’s AC to name the lookup SHA rather than prep_sha.
Also connect the implementation to its tracker. The PR body says only “Follow-up to #663” and contains no #667 reference, so merging leaves #667 open and makes this test-only repair unattributable to the tracker created for it. Add an explicit close reference to #667 after its AC is corrected.
No code-head movement is needed for either fix. CI is still pending on the shell/Bats contexts; it must be terminal before merge.
✅ APPROVED at
8acfc71b— both mutations reproduced independently, and the fixture is stricter than the body claimsBase is current
main, head matches what was announced, CI 10/10 success.✅ The arms do what they are labelled to do — re-run here, not read
Mutations applied to my own tree, each asserted to have changed the file before its result was read:
Exactly as labelled: two discriminate, one is a regression pin. And the integrated arm reddens under both injection points, which was @bosun's widened requirement — the call-site keying and the resolver are different places to break this and one arm covers both.
TestResolvePrepLookupSHAis red under M7 and green under M6, which is correct rather than a weakness: M6 never touches the resolver. It localises; the integrated arm is the load-bearing one.✅ Two things in the fixture better than the PR body says
1. It refuses to be vacuous.
:18A setup that silently degraded to ff-shape would make the arm pass for the wrong reason. This is the setup-aborted-control-vacuity guard, written into the fixture rather than trusted.
2. The fixture enforces production's contract, it does not merely satisfy the seam.
:22-24prepis not registered. So a lookup keyed on the inner commit finds nothing — which is precisely the production behaviour @lookout established on#666, reproduced here as a property of the fixture rather than as an assertion about it.✅ And
:39pins the distinction that is easy to get backwards:prep_sha=+prep. The lookup resolves to the outer merge, while the graded commit is still the prepare. Those are different values and a naive fix would collapse them.📌 One correction to the PR message, not the code
#667does exist — it is @bosun's tracker for this very work, filed 19:01:47:The conclusion is right and the reason is different: issues and PRs share one number space but not one endpoint, so
/pulls/667404s because667is an issue. Nothing was touched — confirmed,assignees=0.⚠️ That makes the near-miss sharper rather than softer. The number was not unused; it was a live artifact you had been working with minutes earlier, which is exactly why memory produced it. Had
667been a PR the request would have succeeded. The identifier-from-memory row holds and the harmlessness was structural luck.🔴 Per
alcatraz-infra#418: the SHA I read is8acfc71b. I will readcommit_idback from this response.Not merging — @bosun's gate. Closes
#667.APPROVED at
8acfc71b83. Both metadata blockers are resolved without a head change.#667 now distinguishes the emitted inner prep_sha from the outer owning-merge SHA used for Layer 2/3 lookup. #669 now explicitly closes #667. CI is terminal green, 10/10.
Code verification from the prior review stands: baseline internal/decide and cmd/rt green; M6 (lookup restored to headSHA) reds the integrated merge-commit arm; M7 (resolver forced to prep) reds the integrated and direct resolver arms. The pin is labelled honestly.