Repository navigation
fix: rehearse legacy exec approval conflicts before update activation - #153406
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: blocked before merge. Reviewed September 24, 2026, 4:11 PM ET / 20:11 UTC (Revision 6). ClawSweeper reviewWhat this changesThe branch copies legacy execution-approval files into private update rehearsal state and rebases the matching migration receipt so Doctor can check conflicts before activation. Merge readiness⛔ Blocked before merge - 4 items remain Current main still omits legacy approvals from update rehearsal. The integrated branch addresses that gap for newer snapshot workers, but its scope for operators running published updaters needs an explicit update-owner decision. Priority: P2 Review scores
Verification
How this fits togetherThe updater copies serving state into a private candidate environment, then runs Doctor and other checks before activating the update. Doctor compares legacy approval files with SQLite policy and migration receipts in that environment. flowchart LR
A[Installed updater] --> B[Snapshot worker]
C[Serving SQLite and approval files] --> B
B --> D[Private candidate state]
D --> E[Candidate Doctor]
E --> F{Approval conflict?}
F -->|Yes| G[Stop before activation]
F -->|No| H[Continue update]
Decision needed
Why: Candidate code cannot recover an approval file omitted by the installed driver's snapshot worker; accepting that rollout scope requires update-owner intent. Before merge
Agent review detailsSecurityNone. PR surfaceSource +81, Tests +141. Total +222 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain Doctor's hash-based policy decision in private rehearsal state, establish the supported updater versions, and provide an in-product Doctor recovery path for older installed drivers. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main snapshots SQLite without the legacy approval file, while Doctor checks for that file in its state root. This review did not run an upgrade. Is this the best way to solve the issue? Yes for newer drivers: the projection stays with the snapshot owner and leaves Doctor's policy decision intact. The published 2026.9.4 driver needs a separate recovery decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d5e6383f4802. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
Addressed the accepted receipt-identity finding in cffbe14; 0b930a4 adds the exact interrupted cleanup fixture requested by review. Private snapshots rebase only the matching exec-approvals migration receipt. All four dedicated tests pass, including normalized null usage metadata, failed source cleanup, retained Published-driver × candidate boundary proof used a separate checkout of 2026.9.4
The negative published-driver cell is an explicit compatibility limitation, not a claimed pass: that driver launches its own snapshot worker, so candidate code cannot recover input already omitted by the parent. This patch improves future installed drivers and does not change any live schema or policy. Full core/core-test types, dead-export checks, targeted lint, and the relevant services test type graph passed. Current CI is still running with no failures reported. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
) Project legacy execution approvals into isolated candidate state without removing the original policy during update rehearsal. Reuse the migration owner constants and cover interrupted cleanup. Co-authored-by: Dallin Romney <[email protected]>
Keep legacy exec-approval projection and private receipt rebasing while retaining the canonical isolated-process snapshot acquisition and cleanup. Original policy bytes and the serving database remain unchanged. Co-authored-by: Dallin Romney <[email protected]>
|
Merged via squash.
|
…openclaw#153406) * fix: rehearse legacy exec approval conflicts before update activation * fix: preserve legacy policy receipt authority in update rehearsal * test: cover interrupted legacy policy cleanup during update rehearsal Co-authored-by: Dallin Romney <[email protected]>
Related: #153401
What Problem This Solves
Fixes update rehearsal omitting legacy exec-approval conflicts or misreporting already-imported approval files before activation.
User Impact
Operators can rehearse legacy approval inputs against private candidate state while preserving the serving policy and original files.
Why This Change Was Made
The existing snapshot owner copies bounded legacy approval bytes with exclusive creation and link rejection, then rebases the matching migration receipt only in the private database. Doctor remains the policy and migration owner. The integration preserves main’s isolated-process SQLite acquisition, cleanup lifecycle, and plugin-code snapshot handling.
Evidence
Validation on the candidate integrated with fixed main
5050eb796c4ec58f301cf20fd5269e506a257c8d:--maxWorkers=1, the three-file run took 586.75 seconds wall time (569.24 seconds reported by Vitest), including a 147.06-second cold worker build. The four regression test bodies took 31.16 seconds combined.Maintainer scope decision: accept this repair for an installed updater containing the new projection. It cannot retroactively change the snapshot worker selected by the published 2026.9.4 driver. Older-driver recovery remains tracked in #153401.
A fresh published-driver compatibility cell exercised registry
[email protected](build3a9d69db306cd7f081e06254cb89c4bcc14a7107) against the exact7eb9f1b1929ec97017c556e1c43ecb00d8263a7dcandidate package. In an isolated Linux arm64 container with Node 24.19.0, the real installedopenclaw update --tag file:<candidate.tgz> --yes --no-restart --jsoncompleted candidate migration rehearsal, Doctor lint, config validation, plugin resolution, continuation checks, and Gateway canary successfully, then swapped the candidate into place. Activation Doctor correctly refused the conflicting legacy exec-approval input. The updater exited 1 withstate-migrated-no-rollbackandserviceRestartSafe=false; this is a reproduced older-driver limitation, not a successful upgrade. Immediate read-only verification found the canonicaldenypolicy (including its stored bytes and timestamp) and the 124-byte conflicting legacy file unchanged. The candidate build remained installed, and the disposable container was removed after evidence capture.The canonical package build and tarball checks passed; the artifact SHA-256 is
2e5d112f5654491039e2d37794c2a7e6ca749fc4af809d8687c34ca22b0cfc03. Exact-head CI also passed. The 104 registered-worker/Doctor tests above provide the positive proof for an updater containing this change. An earlier isolated macOS attempt stopped before rehearsal because the old driver rejected unrelated legacy records in the host-wide handoff store; that attempt is retained separately and is not counted as successful coverage.Original contribution by Dallin Romney (@RomneyDa).