Repository navigation
fix(update): fence retained rollback and simplify recovery lifecycle - #143791
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. |
|
Review/proof history: the original ten sealed #143750 cases pass unchanged on Vincent's ownership repair. Two settled runs passed 300 focused tests on the original canonical production patch; runtime build and CLI import passed. The unchanged baseline preserves three passing controls and seven demonstrated unauthorized effects. Vincent fixed the redundant deferred types in Publication/coordination overlap: the exact pre-push read showed I have paused further branch changes, approval, and merge. Please carry your combined cleanup on this canonical branch as planned; it can supersede the helper extraction. I will review the resulting exact head and rerun only affected proof, without a competing PR or a second recovery design. The published tree Exact-head CI run: https://github.com/openclaw/openclaw/actions/runs/34449137935 . It is still pending, not claimed green. Installed Linux/full-journey proof remains unrun and separately coordinated. Combined-head review: a0fe5c6I reviewed your published combined head
Required exact-head CI is still running: https://github.com/openclaw/openclaw/actions/runs/34454616518 . I have not approved or merged ahead of it. Separate surviving-child custody and final-result/cleanup-reporting followups remain separate and are not claimed fixed by this PR. |
|
Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 4:27 AM ET / 08:27 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR stops retained update rollback and backup cleanup after executor ownership is lost, removes inactive recovery machinery, and adds filesystem and retained-record regression coverage. Merge readiness✅ Ready for maintainer review This remains a useful fix for a source-confirmed gap on current main. No actionable introduced defect was found, and the combined cleanup resolves the earlier unpublished-work concern and prior lint findings. Priority: P2 Review scores
Verification
How this fits togetherThe update CLI stages a candidate package and retains the previous package and launchers for compatibility-checked rollback. Its transaction owner restores or retires those files before final service recovery and reporting. flowchart TD
A[Staged package update] --> B[Retained package and launchers]
B --> C[Rollback or completion request]
C --> D{Original executor still owns work?}
D -->|Yes| E[Restore files or retire backups]
D -->|No| F[Stop further effects and preserve recovery material]
E --> G[Service recovery and outcome reporting]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -837, Tests -509. Total -1346 across 32 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep one compatibility-checked rollback lifecycle whose original executor gates every subsequent protected filesystem effect, while preserving unsupported retained records unchanged. Do we have a high-confidence way to reproduce the issue? Yes, from source: revoke the original executor during retained-package inspection and current main can continue restoration without that fence. The PR supplies focused fault-injection regressions; this read-only review did not execute them. Is this the best way to solve the issue? Yes. Passing the existing executor assertion into the transaction repairs the effect-owning boundary, and removing unused hooks preserves the active admission and persisted-reader contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 15b5fc24a7fe. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
@fuller-stack-dev: please hold the local extraction and do not push it; we are carrying the remaining corrections. Thanks for the exact-head checks and coordination. We plan to fold the already-reviewed dormant package-recovery engine cleanup into this PR, rather than open a separate cleanup PR or add a temporary launcher-backup helper extraction. It removes unused writers/hooks and the no-op replay prepass while preserving historical record schemas/readers, canonical admission, and the fence's ownership checks. The combined swap fits the unchanged 700-line rule. We are fixing the inherited native-test shadow, then qualifying the final combined head with review, lint, tests, and build. That cleanup is not yet in the published head, which remains The package-activation journal proposal remains separate under #143752. Storage implementation is still held pending maintainer acceptance; this consolidation does not implement process-interruption repair. |
fuller-stack-dev
left a comment
There was a problem hiding this comment.
Reviewed combined head a0fe5c66827dc6730aa4768e83615f25f1fa0a41 for the original-executor ownership boundary. No actionable P0/P1/P2 findings. The full captured caller assertion reaches restoration, compensation and retirement; repeated calls remain bound to the original owner. Removed recovery hooks have no production provider, while historical schemas/readers and canonical read-only admission remain.
Ran the native focused suite: 304 tests across 12 files, zero skips, including all 10 unchanged sealed real-transaction authority cases. Worker cleanup completed. Fresh independent P0/P1/P2 review was scoped-clean; the required local runtime build and isolated dist-backed update --help passed. Detailed evidence is in the existing coordination comment.
Approval is for this scoped rollback correction. Required exact-head CI still gates landing. This does not claim installed whole-journey proof or repair separate surviving-child custody, cleanup-outcome reporting, premature terminal success, or interrupted activation (#143752). Thanks Vincent for the fix and combined-source reconciliation.
|
Merged via squash.
|
…penclaw#143791) * fix(update): stop rollback writes after executor ownership is lost * test(update): remove redundant deferred type arguments * refactor(update): remove dormant package recovery execution * refactor(update): keep rollback ownership helpers within lint limits * test(update): avoid shadowing the native copy result * refactor(update): keep admission environment resolution local --------- Co-authored-by: Jason (Json) <[email protected]>
Fixes #143750
Issue: #143750
Related: #143752 (package activation recovery remains separate).
Builds on Jason (@fuller-stack-dev)'s rollback work in #140339. His contribution on this branch is preserved in the signed merge history; the connected lifecycle cleanup is now included in this PR, not a separate stack.
What Problem This Solves
Fixes an issue where a managed update could continue replacing package or launcher entries after its original executor lost ownership during rollback. The outer check detected ownership loss only after those filesystem effects.
Why This Change Was Made
Carries the original executor assertion through retained rollback and completion, including awaited planning, package restoration, launcher compensation, cross-device copy-source cleanup, and backup retirement. Repeated calls remain bound to that first owner.
Removes dormant package-recovery execution/writers and the no-op replay prepass, leaving one active lifecycle. Persisted record schemas, readers, admission checks, and refusal behavior remain intact. Native EXDEV and relative-launcher behavior are preserved.
User Impact
Ownership loss stops subsequent protected filesystem operations and preserves recovery material. Already-dispatched filesystem operations are not cancellable.
This does not provide crash-atomic activation, interrupted-package repair, a new recovery journal, or full-state/migration-crossing rollback. The activation gap in #143752 is not fixed by this PR.
Evidence
Head:
a0fe5c66827dc6730aa4768e83615f25f1fa0a41; tree:2551da6a71639ae2e7f59f8f398c974e90b6fc45.update-command-run.test.tspassed 35 tests with zero skips; fullpnpm buildpassed in 4m20.5s; isolated dist-backednode openclaw.mjs update --helppassed. The command wrapper exited 0. Proof run: https://github.com/openclaw/openclaw/actions/runs/34453609190 (selected source is the head above, not the workflow-control branch).342e51ae1a2c5b15cafd4d7e7b7f87fee114d25f, shared by60e4882fd1b4b81c7eb717ac77b1b21032d5d6bcand reconciliation mergeb8f48827956da1a2cfbdf9a78cd5621c42af04bf, passed 31 tests across the rollback-executor/native-transaction files, full build, dist CLI help, and core test typechecking. The final source differs only by removing an unused export, covered by the final-source proof above.868d456eef6894d8539f89549a11d8ce35f3e3e7. Subsequent changes were two erased test type arguments, a test-local variable rename, and the unused-export removal. These overlapping runs are not summed.@openclaw/fs-safe0.8.5 callback contracts were inspected directly; targeted formatting, lint, and whitespace checks passed.1c0d32c78f248a5f328eadc751457097e265d147: 32 paths; production +113/-950 (net -837), tests +717/-1226 (net -509).Pending: hosted CI and human review on this exact published head. Prior-head CI is not evidence that the new head is fully green; this is ready for review, not a claim of merge readiness.
@fuller-stack-dev: please review the combined original-owner fencing and lifecycle simplification, including preservation of persisted readers/admission and the real filesystem regressions.