fix(review): salvage frozen correction binding - #2599
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughCorrection-plan status now validates correction requests against the frozen authority target identity. Regression coverage checks applied uncommitted fixes, workspace identity divergence, reason codes, and read-only authority preservation. ChangesCorrection status authority binding
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes a negotiated review.status contract validation bug where a correction plan request’s TargetIdentity was incorrectly validated against the live workspace identity instead of the frozen (authority) target identity, which can diverge after an uncommitted bounded correction. It also adds a focused regression test reproducing the unforecasted diverged-workspace scenario under the current v2 contract/status behavior.
Changes:
- Update
ReviewTargetStatusResult.Validate()to validateCorrectionRequest.TargetIdentityagainstreviewAuthorityTargetIdentity(result)(frozen authority identity when present). - Add a regression test covering the diverged-workspace (unforecast) path and a forecasted stop-path variant, asserting the correction request binds to the frozen identity and that status remains read-only.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/cli/review_status_contract.go | Fixes correction request binding validation to use the frozen authority target identity instead of the live workspace identity. |
| internal/cli/review_status_contract_test.go | Adds regression coverage ensuring negotiated status accepts frozen binding after an applied, uncommitted fix and preserves read-only semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Linked Issue
Fixes #2132
PR Type
type:bug- Bug fixSummary
main.-xcherry-picks of onlyffff87dfcb834435c719925a8af7f920e7a32a79and7dbd6da54831340a0028805b97bfea1ba5787e00.Changes
internal/cli/review_status_contract.goCorrectionRequest.TargetIdentitytoreviewAuthorityTargetIdentity(result), not the live workspace identity.internal/cli/review_status_contract_test.goTest Plan
operation_failedin the unforecast, live-diverged branch.TestCorrectionNextTransitionAgreesBetweenFinalizeAndRestartStatusandTestNegotiatedStatusUnderUnavailableProcessTempContinuesCompactCorrection.go test ./... -count=1go test -race ./internal/cli ... -count=1go run ./internal/gofmtcheck,go vet ./..., andgo build ./..../scripts/deadcode-ratchet.shGOOS=windows GOARCH=amd64 go build ./...andGOOS=darwin GOARCH=arm64 go build ./...j51-negotiated-status-correction-continuation: 1 completed, 0 failed.Contributor Checklist
+89/-1).type:buglabel is applied.Co-Authored-Bytrailers.Notes for Reviewers
This is a maintainer salvage of #2240, not a merge or closure of #2240. The two contributor commits above retain Jalmar Villarreal as author and record their original SHA through
-x; the third, conventional maintainer commit only updates the test fixture and invocation for current v2 requirements.The regression proves producer/validator consistency only for the unforecast branch where the live workspace diverges after an uncommitted correction. It does not claim to prove the correctly ordered forecasted bounded-correction flow. That flow already routes to
correction_repository_verification_requiredwith targeted validation and is exercised byTestCorrectionNextTransitionAgreesBetweenFinalizeAndRestartStatusand driven bench journeyj51.No qualifying security, integrity, admission, repair, or governance guard was added or changed;
.guard-population-baseline.txtis unchanged.Summary by CodeRabbit