fix(review): recover workspaces at pull request heads - #2263
Conversation
49a1e00 to
3660628
Compare
|
Re-review requested at 3660628 — rebased onto current main; corrected initial-versus-retry HEAD provenance, added failed reprovision coverage, updated the tracing spec, and fixed the lint failure. Independent OpenCode review is in progress. |
3660628 to
b28c0d3
Compare
|
Re-review requested at b28c0d3 — updated agent-review item 12(d) to document the one-reprovision policy and workspace_head_mismatch refusal for thrown, unreadable, or mismatched retries. Independent OpenCode review is in progress. |
There was a problem hiding this comment.
Changes requested: Resident review attachment still verifies metadata rather than the checked-out workspace HEAD.
Warning
Changes requested · head b28c0d3 · 1 finding: 1 minor
| Severity | Finding | Where |
|---|---|---|
| minor | F1 Spec contradiction — docs/reference/specs/agent-review.md item 10: resident reviews trust attach metadata instead of checked-out HEAD | src/core/dispatch/authorize.ts:488 |
Full review
F1 — The resident path uses binding.sha as proof before the guard and moveTo()’s returned SHA after reprovision, without executing git rev-parse HEAD. If resident metadata is stale or disagrees with the actual worktree, the model can review the wrong commit while the gate reports it verified. Read the checked-out HEAD through the executor before both comparisons, as item 10 requires.
b28c0d3 to
c7c4173
Compare
There was a problem hiding this comment.
LGTM: The workspace-head verification fix is correct; only one stale comment remains.
Note
Approved · head c7c4173 · 1 finding: 1 nit
| Severity | Finding | Where |
|---|---|---|
| nit | F2 Update the stale resident-binding proof comment | src/core/dispatch/authorize.ts:448 |
Full review
F2: The function comment still says a resident’s attach binding is proof, while the corrected implementation verifies git rev-parse HEAD through the executor. Update the comment to match the new invariant.
The two test-guard title changes are refactors with verification intact: actual workspace observation and successful and failed reprovision paths remain covered.
Co-Authored-By: coreplane-switchboard[bot] <318072483+coreplane-switchboard[bot]@users.noreply.github.com>
c7c4173 to
c426679
Compare
|
Re-review requested at c426679 — retry bindings now publish the executor-observed checkout HEAD instead of moveTo metadata; stale metadata-authority comments are corrected; regression proves wrong moveTo metadata with a correct checkout. OpenCode and Switchboard re-reviews are in progress. |
There was a problem hiding this comment.
LGTM: The retry now verifies and publishes the executor-observed checkout head, and the stale authority comments are corrected.
Note
Approved · head c426679 · no findings
Full review
No findings remain. The test-guard title changes are refactors with verification intact across workspace observation and successful and failed recovery paths.
|
Production inclusion receipt — 1.260.6. |
Review workspaces are now moved to the pull request’s expected head before a review starts, and the checked-out commit is verified directly. If recovery fails, the refusal reports distinct initial and retry observations instead of trusting resident metadata.
Why: Review runs were refused when resident workspaces lagged the requested head, even though Switchboard could recover them automatically. Attach and move metadata could also claim the expected commit while the actual checkout differed. Fixes #2235.
Where to look
moveTo()result cannot hide a still-mismatched checkout.Feedback wanted: Is one bounded reprovision attempt the right recovery policy, and are the executor observation and failure-provenance boundaries correct across backends?
Risk: This is on every PR review’s pre-model attach path. A regression can refuse reviews or verify the wrong checkout; rollback is the single commit.
Verified: 593 targeted tests passed; typecheck, lint, formatting, specs, coverage/test guard, hygiene, and title checks passed. CI is running.
Decisions (3)
moveTo()SHAs remain useful metadata, but onlygit rev-parse HEADproves what the model will read.Validation (8 criteria)
src/core/dispatch/authorize.test.ts::authorizeAttachedHead — every review workspace is at the PR head before the first model turn::a resident binding SHA cannot verify a checkout whose observed HEAD differs— passedmoveTo()metadata cannot hide a mismatched retry checkoutsrc/core/dispatch/authorize.test.ts::authorizeAttachedHead — every review workspace is at the PR head before the first model turn::resident moveTo metadata cannot verify a retry whose observed HEAD is still mismatched— passedmoveTo()metadatasrc/core/dispatch/authorize.test.ts::authorizeAttachedHead — every review workspace is at the PR head before the first model turn::a successful retry publishes the observed checkout HEAD instead of moveTo metadata— passedsrc/core/dispatcher.test.ts::repo/ref resolution + resident prompt selection::a genuine push during workspace preparation is reprovisioned at the reviewed head and the review runs— passedsrc/core/reviewRound.test.ts::guardAttachedHead (before any model call)::*— passedc…instead of observed checkout SHAa…tsc --noEmit -p tsconfig.json; ESLint and Prettier on changed files;npm run hygiene:check; PR-title check — passednpm run specs:check;npm run specs:coverage -- --changed origin/main...HEAD --test-guard --require— passed