Repository navigation
feat: refresh managed sandbox bases before publication - #174532
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: needs real behavior proof before merge. What this changesAdds an explicit refresh_base action that integrates the selected repository base into an existing managed sandbox workspace before review and publication. Example: A sandboxed session has saved README changes while main advances to commit 4be1d11.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep this PR open: it adds a useful, maintainer-directed capability absent from current main, and no definite introduced defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway publication broker uses host-held GitHub credentials and workspace ownership to fetch the selected base, reconcile source into canonical and private workspaces, and return a sandbox-local review target. flowchart TD
A[Agent publication tool] --> B[Gateway caller authorization]
B --> C[Selected repository base]
C --> D[Source merge preparation]
D --> E[Workspace reconciliation owner]
E --> F[Canonical and private source]
F --> G[Sandbox review base]
G --> H[Review and draft publication]
Technical reviewBest possible solution: Retain the explicit refresh action and existing reconciliation owner, with refresh-specific authority and saved-state compatibility evidence before merge. Do we have a high-confidence way to reproduce the issue? Current main's tool and protocol lack refresh_base, and the inspected before screenshot shows the private-base task blocked by unavailable sandbox fetching. Is this the best way to solve the issue? An explicit action using Gateway credentials and existing workspace settlement fits the ownership boundary and avoids importing guest Git metadata or silently changing reviewed source during publication. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against aa834b100e28. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. SecurityNeeds attention: No concrete authorization bypass was found, but refresh-specific final-effect authority proof remains incomplete. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +669, Tests +412, Docs +43. Total +1124 across 24 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 16, 2026, 3:41 PM ET / 19:41 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Added: managed sandbox sessions can refresh their selected repository base, resolve conflicts, and update the same draft while preserving saved work. |
Add an explicit base refresh for managed sandbox workspaces, preserving saved edits and conflict resolution while retaining the selected base in draft publication ancestry.
What Problem This Solves
A sandboxed project session can save changes and publish a draft PR, but it cannot update its existing private workspace from a newer selected repository base. That blocks ordinary conflict resolution when the repository is private and network credentials deliberately remain on the Gateway. Publication fetches the base for its own checks, but importing guest commits would violate the workspace boundary and copying files alone would lose the integrated base ancestry.
User Impact
github_publishgains an explicitrefresh_baseaction for the current session's existing local managed sandbox workspace. It preserves accepted guest files, including ignored data and empty directories, brings in current base changes, and reports conflicting paths. Conflicts remain pending across retries until the caller resolves them and acknowledges the exact returned base commit. Existing ready, merge, and close actions retain full operator write permission.Completion stages current source inside the sandbox while preserving its HEAD, branches, and commits, and returns an explicit local/base Auto Review target. Run tests and normal Auto Review with that target before publishing to update the same draft. Publication refuses pending integration rather than modifying reviewed files. Ordinary worktree removal is deferred while the integration still needs resolution.
Why This Change Was Made
The Gateway resolves the repository and base from saved workspace ownership and uses its existing authenticated transport. A source-only Git merge computes the result before changing either workspace. The existing pending-result lease and rollback journal apply that result to canonical and private files before advancing their shared baseline; native host Git state retains the selected base and merge ancestry. Refresh also joins publication's existing workspace exclusion.
The selected review base is transferred as a bounded source-only pack through the prepared sandbox's stdin. Git metadata operations stay inside that sandbox, and the temporary host pack is removed. No repository, arbitrary ref, other session, PR, credentials, or runtime can be selected through model arguments; the acknowledgment commit only checks the existing pending integration.
Evidence
The pre-change protocol rejects
refresh_base; the existing private-workspace workflow has no supported route to obtain and integrate its newer base. The focused regression uses the existing real Git and publication fixtures, with synthetic GitHub transport. It exercises interruptions before transfer reservation and between workspace copies, intervening guest edits, explicit conflict resolution, preserved guest and upstream files, refusal to publish unresolved work, same-draft publication, retained base ancestry, and the guest's exact review diff.Remote validation covered the 308 related test files: 4,972 tests passed and two platform cases were skipped, retaining completed groups across a runner interruption. The four-file recovery and admission batch passed 91 tests in 79.68 seconds after reproducing the pre-reservation failure; unchanged related-file proof was retained. Changed-file formatting/lint, the affected production and test compiler graphs, protocol generation, and package-boundary compilation plus its negative canary passed. These are command wall times; overlapping shard times are not added together.
The actual prior result-ref validator rejects the new refresh purpose before reading or applying it. That refusal protects an interrupted transfer. After both workspaces accept, its staged result is cleaned and native merge state owns remaining conflict resolution; the docs require finishing refresh and resolution before downgrade.
Independent engineering review is clean, and PR CI passed on the current head: 95 selected jobs, with an 813-second execution window. The saved-session live flow also passed: the guest refreshed its newer private base, resolved the conflict, passed 30 project tests, ran normal Auto Review with the returned local/base target, and updated the original draft. The upstream files and guest implementation stayed intact. Guest ready, merge, and auto-merge requests remained blocked after admin participation; the admin then merged the exact reviewed tree through the same conversation.
The live runtime uses this PR’s exact 24 changed files on the retained baseline, alongside the landed skill guards. It is source-equivalent proof rather than a whole-head deployment. Its retained
fs-safe0.26.5 atomic-write implementation and all JavaScript/declaration files are identical to 0.26.6 used by PR validation; the documented native delta concerns Btrfs cloning outside this Darwin flow. Existing requester and projection tests cover authority loss during awaited preparation, acceptance, and recovery; the refresh owner carries those current-authority checks through commands, reconciliation, and sandbox execution.The final automated review found no concrete defect and requested additional authority-combination and tagged-upgrade runs. Independent source and evidence assessment found the existing owner-boundary tests sufficient: the tagged release uses the same workspace-projection schema, and ordinary stored-state interpretation is unchanged. A refresh-specific cross-session/mid-await injection and a literal tagged-runtime upgrade were not executed.
Visual evidence
Actual guest tool-flow excerpt at4x speed; cropped timestamped screenshot stream, with metadata redacted
after-public.mp4
Visual verification
201bc4413ecd7b03308260c61480f0d37aab4cc7