Skip to content

fix(update): back up state before migrations and restore it on rollback - #144005

Closed
steipete wants to merge 32 commits into
mainfrom
steipete/upd-backup-rollback
Closed

steipete wants to merge 32 commits into
mainfrom
steipete/upd-backup-rollback

Conversation

@steipete

@steipete steipete commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Atomic-update split tracking

Public PR state checked 2026-09-24T18:29:59.776424+00:00. Shared original tracking: #144005 and #145169.

Status: split in progress, not fully published or landed. The 19 rows below are retained behaviors, not 19 completed PRs. The original public containers remain 209 and 411 files. Existing destinations do not imply that all narrow hunks are accepted or that the published PR is already reduced.

This index is the current split-delivery plan; older whole-stack/omnibus delivery wording below is historical. No-loss requirements, attribution, meaningful tests, independent review, required CI, and applicable isolated native acceptance remain binding. Raw baseline restore must not land as a lossy substitute.

Reviewable source handoff — 2026-09-25

Reply to Peter with exact source identities, active work and remaining checks. Receiver patches, full hashes, reconstruction instructions and producer source. These are review-only snapshots, not landed changes or a replacement for the public PR heads.

  • Historical receiver 03acab67204cfc9be90c52d664dbb47fc81d13f9 is exported as a source-only patch against public base e7fbe5389e0bb46bdf2ba85f941ee3ffc818a7f6, reconstructing tree da13b8f4a212078fe171dc6fd9d55a6a758ec7a8. The same handoff contains the current 07:43 UTC working-source snapshot, tree ae8a5b14a1226e3aebcf8051cac4c4037c371f5c; it is not a Git commit or a fully qualified candidate.
  • Historical lower full commit 4caf5778e7ada5b96d67ec3adddd6ad50d65dc80 and current lower full commit 9a168b0a01c3467f66c6360be6303890bc9716da are available on separate review refs linked in the handoff, without changing the feat(update): add sealed package-publication recovery #144318 PR branch.
  • Producer 209438c4 means file SHA-256, not a commit: 209438c4b60d7c04757aa784b032413ec05932509195ca78817647e84d9094a6 for src/cli/update-cli/update-command-recovery-source.ts in the historical receiver. Its exact bytes are included.
  • Peter’s public fix(doctor): finish state migration after legacy install repair #145043 repair at d50e7e798fb6c1d00091bdce45a5f427f652c4b2 remains separate and untouched. Its narrow startup proof does not qualify the private receiver or the full capture/newer-write pair. Older checklist source IDs and test counts retain their historical scope; this correction does not imply a fresh check of unrelated rows.

Published PRs and dependencies

PR Role in the split Public head / files State Dedicated Atomic worker
#149068 Supported review-correction publication prerequisite; not capture/recovery/no-loss delivery Landed c86ef04bf095; merge 78d5bedb34de Merged 2026-09-22; exact-head required CI and independent API-direct review retained. Odin was the only used host; both worktrees and registrations are absent. Exact worker incarnation archived. Listed-owner/org-admin acceptance remains a separate canonical-owned obligation, not an open PR or blanket landing hold; Jason explicitly authorized landing. Publish reviewed PR corrections truthfully · #149068 — archived; same 2f273919 / 5d7da881
#144005 Original capture/restore; producer and durable binding still open Public 4146d06f8a32 / 209 original paths Same d4 continued narrowly owned stopped-C producer, durable attestation and reverse-binding work; ee96 primitive retained. No shared-receiver writes, new passing acceptance or LAND inferred. Existing semantic map retains all original source/goals and meaningful acceptance. Restore migration state on rollback · #144005
#145169 Original preservation; complete recovery and newer-write goals still open Public f6feb6b75d08; unpublished reviewed CLI completion c9413cbb88e6 / d25e6d13; receiver checkpoint add7adbf1f5b CLI command/cleanup completion repaired without import-cycle deadlock: 6/6 focused tests, scoped API-direct review clean through P2; five source postimages and three patch hashes independently verified. Entry and required adapter must compose together; physical-store/native qualification remains open. Existing owners are advancing real maintenance exclusion, original-run admission/fence and joined terminal cleanup for sealed resume, with one receiver writer. Current receiver export gate still fails (4 production / 3 full-tree); broad source checks, complete capture/recovery/newer-write preservation, installed no-loss, public conflicts and exact-head CI/LAND remain open. No original goal is marked complete. Preserve newer data after failed updates · #145169
#145043 Public narrow post-convergence config handoff; private recovery composition remains distinct Public d50e7e798fb6c1d00091bdce45a5f427f652c4b2; separate private-receiver source export Peter’s original-ancestry-preserving repair remains untouched; exact-head CI gate was observed passing. Public startup proof is not full-checkpoint or private R31 acceptance. The existing private composition owner continues source-bound entry/writer/reverse qualification and qualified upper authority/terminal uptake separately. No cumulative receiver was pushed to the public PR branch. The historical aggregate-running description is not current acceptance evidence. Unblock upgrades with stale Codex plugins · #145043
#144318 Sealed package-publication recovery; original-lineage shipping Public draft 73cf3fd44ecd; review-only historical 4caf5778 and current 9a168b0a The old 4caf native build/check passed but its full suite failed; it is no longer running and does not qualify current source. The existing lower owner has advanced initial-store admission/transport and durable publication to 9a168. Qualified Doctor isolation and the three original-budget rollback cases remain required, followed by applicable native acceptance, PR publication, exact-head review/CI and LAND. Review-ref publication changes neither the PR branch nor readiness; original capture/full-recovery/newer-write obligations remain open. Recover interrupted package publication · #144318
#144319 Post-core executor custody and upper recovery Public 44f32040f0f7; owned 07aad1b4 qualified; receiver extraction 989a6188 pending Two-file post-core conflict integration on owned tree 07aad1b4: 56 passing cases (31 post-core, 13 sibling custody, 12 native custody), 11 static/type checks and scoped-clean full-file API-direct review. Accepted receiver 03acab67 / da13b8f4 uptake is bound; extraction preview 989a6188 preserves receiver cleanup but changes the test postimage, so its composed-source tests/review remain pending. Same #144319 owner advances that independent qualification; existing #144318 owner supplies the qualified minimal lower frontier for final integration. Public PR remains draft/DIRTY; required checks, publication and landing are not complete. Receiver export gate still fails 17 production / 11 full-tree findings; original capture-before-mutation, full recovery and newer-write acceptance remain open. Keep executor custody through post-core recovery · #144319
#143917 Guard and sanitize package-recovery caller diagnostics; preserve cancellation and paired-store authority Public draft d62b17124d325d966ad696bb19421d096bb84014; reviewed private sanitizer/test snapshot tree 9d4b2e6f128a8cc65fd58c61182db28a293e5977 Prior receiver test exposed ten sanitizer failures across staged/direct cases. The same owner supplied the narrow fix; API-direct review found and corrected a whitespace-redaction gap. Four helper counterexamples pass, not receiver acceptance. Both original cases and all authority/cancellation/lease assertions are retained and strengthened. The sole receiver writer has accepted integration at its next safe boundary, preserving two newer installer changes; strengthened receiver red/green, affected checks and final source-bound review remain. Preview retains 225 component passes; exports still fail 6 production / 3 full-tree. Public required CI remains unqualified; applicable runtime, capture-before-mutation, complete recovery and newer-write/no-loss remain open. No READY or LAND. Recover interrupted package installation · #143917; same dedicated LAND owner
#147629 Preserve dirty source/index while installing dev separately; required public-stack prerequisite of #147677 Public 51f889297fe6 OPEN with merge conflicts. Current-head preparation must precede CI if source changes. Trusted Security Review selects cancelled CI run 34799031127, not older successful 34799031075; no product test ran in the cancelled attempt. An unchanged intended head can use that exact diagnosed retry, then trusted status publication. Dedicated source/publisher assignment remains pending with the update coordinator; no retry, status bypass or landing claimed. Dedicated #147629 publisher assignment pending; archived worker not reused
#147677 Retain canonical POSIX installer/Node capability and dirty source through update/recovery Public 2f7ec3ae1c34, based on #147629; historical private pair 278d983e → c4223644 Historical native fault/release and package rollback qualified, but full recovery failed previous-version-unverified. Current compensation excludes the observed same-root CLI/service topology; current receiver/lower/upper lack installer entry plumbing, so no new executable pair or current-main runtime regression is claimed. Existing receiver owner is integrating the narrow installer/verified-service-identity cuts without replacing full state recovery. Same #147677 owner retains changed/new native acceptance after exact driver/target sealing, review, CI and LAND. Complete recovery and newer-write/no-loss goals remain open. POSIX installer full-CLI acceptance · #147677 — same dedicated owner retained
#148117 Preserve late update failure details; parent of #148159 Public draft b458db5a27c716c4b7a2e4e1564119de315b4701; private 436b55a16e348c7c0b202ab25c89dad101c782b6 Maintained helper publication-race correction is now source-qualified (22 helper cases; 11 consumer cases and one existing platform skip; scoped API-direct reviews). Same parent owner is checking the exact supported consumption/publication boundary and current-source qualification. This is not helper publication, historical SIGSEGV attribution, complete 132-file qualification or native-gate success. Preserve update failure details · #148117; same dedicated owner
#148159 Retain late handoff failure and cancellation causes through terminal settlement Public f355b8403f34fe8f08fd841e2bfa92e625a967d1 OPEN; same owner retains landing. Qualified parent #148117 and legitimate current-main ancestry remain necessary. Merely publishing its old private parent leaves 1,628 changed paths / 80,065 bytes above the 64-KiB planner cap plus generated-artifact/source-mix refusal. Preserve valid exact-source review and isolated installed evidence; requalify changed composition and resulting-head CI. No missing-required-checks merge waiver or unrelated whole-stack hold. Retain late update handoff failures · #148159; same dedicated owner
#148066 Loaded/throttled LaunchAgent recovery; installed updater to real Gateway readiness and state-preserving failure cleanup Public 86618c2b0a468a0e539f3908bb08e2d69d7203ef; signed unpublished private cf2f29b717e6812f7ae364ba4f79d67a772bc811, tree 0f8570bf9157eb9d786261b260dd882bde63f519 OPEN, not published/landed. 65 source pins verified; 971 scoped source tests pass, 2 inherited platform exclusions, independent API-direct review clean. Full local gate retains 3 unchanged pinned-main lint errors. Public-head CI passes but does not qualify the private successor. Both-route forwarding is cleared at 9156a51f09fc16bbc77cae8730821726fc778cf4. Next: f832 narrow waiter/readiness recovery composition, e384 applicable immutable caller/package/graph pair with private FIRST store opens in every helper, then sole735 installed twelve-probe recovery, operator-state preservation/failure cleanup and applicable Windows proof. A1 remains NEEDS WORK; main refresh, publication and resulting-head CI still required. No unrelated whole-stack hold. Wait for throttled LaunchAgent recovery · #148066; same dedicated fd7 LAND owner, f832 sole receiver writer
#155544 Doctor startup copies; original update prerequisite Public 1c9303cea9e90; private signed fdb6266d40a6 / tree bb44b254 Repaired task-private route qualified with scoped independent API-direct review; exact candidate remains clean. Existing selectors-unset native gate passed build/check and is still running full tests: three completed summaries total 156 files / 2,111 tests, with no failure observed at the checkpoint. No terminal full-gate pass, publication or landing. Same7ab retains the existing process completion wake, then terminal isolation/resource settlement, failure repair if needed, signed publication and exact-head CI/runtime/LAND. Earlier exit-130 failures remain historical evidence; narrowed passes do not establish their causes. Avoid repeated startup database copies · #155544
#156853 Intentional agents.delete size-drop fix; required native-gate prerequisite for #155544 5df3cd354cec / 4 files Merged 2026-09-23 as 376d13b6c778. 442 affected tests plus 3 exact-head native regressions, required CI and API-direct review passed; whole touched-test files audited. Owned worktrees/scratch removed and exact worker incarnation archived. Receiver adoption and #155544 composed native acceptance remain open. Fix intentional agent deletion rejected by config guard · #156853 (archived)
#156211 Published ordinary-backup completeness supplier; not full update recovery capture 1b01b2b9d62d / 6 Merged 2026-09-23; 28d3296aaf2b Detect missing databases in backup archives · #156211
#156265 Published three-file schema-preflight cleanup successor extracted from #144005; prerequisite for #155544 81d1f3424349 / 3 Merged 2026-09-23 as a976c5cb3f71; exact-head CI and required security status passed; native accepted intent reconciled; owned worktrees and residual snapshot/registry entries verified removed; dedicated worker archived Stop updates when schema snapshot cleanup fails · #156265
#156298 Durable-receipt persistence and private/public projection predecessor; one required packaging inventory repair, no capture/generation/restore implementation 748ef9efdf13 / 11 Merged 2026-09-23 as 44b5df106030; required CI and review passed; owned cleanup verified Preserve update recovery receipts · #156298
#156366 Recovery-manifest parser plus registered read-only update-status inspection, including terminal/forward-generation validation 8d21ae0f6248 / 8 published Merged 2026-09-23 as c7ee253e2c4c. Exact-head review, required CI and native landing passed; owned native checkout removed. Prior managed snapshot/registry retirement independently verified; exact dedicated worker archived after all-host owned cleanup, with transcript history preserved. This parser/status leaf is not complete capture/recovery acceptance Validate update recovery manifests · #156366
#156326 Typed legacy-plugin warnings and guarded Doctor rehearsal inventory consuming paths and warnings 8a8f90eb2f28 / 23 files; merge 4c468412dfef Merged 2026-09-23; exact-head required CI and three published-updater cells pass, with package-source equivalence preserved. Both worktrees, eight hosted artifacts and the exact managed snapshot are removed; the exact worker session is archived, with closure independently verified. Full original capture/recovery/newer-write goals remain separate Warn about undeclared plugin recovery resources · #156326

| #156421 | Private stores before update/Doctor; explicit direct-update leaf | Public 98f4a930459d; unpublished private 21b0653aba70889d9c7f18c84ae3ac5632170ef7 | Historical same6ea bounded diagnosis: adjacent-order 36/36 and exact shared-worker prefix 224/224 selected cases passed under frozen guard; warnings reproduced without timeouts. Original 48-file replay remains exit 1 with three unresolved RPC timeouts; no loader/crash/native clearance or source fix claimed. Reviewed guard restored; consumed private fixtures/helpers removed. Same594 completed static native-source diagnosis: registration returns before coverage, and ADD/REMOVE rebuild with SinceNow does not preserve existing-watch continuity. Distinct owner 0e1e1909 published qualified libuv#5296 at 98ccd0db63ce: 59 native checks, 51 TSAN checks with zero warnings, scoped API-direct review and 49/49 exact-head upstream CI passed. Upstream maintainer review/merge is required because authenticated access is read-only. Same6ea has since corrected the private Node/V8 hash incompatibility: descriptor/Buffer controls and 48 Node cases passed (two existing platform skips), with scoped API-direct review. Corrected receiver 5f6d60a75881 has 93 focused passes (one existing auth skip) and scoped review; its native build and 102-lock preflight passed. The same owner recovered and settled the terminated native gate, resolved five current-main conflicts using Peter’s landed #157980 changes, and obtained scoped API-direct review on reviewed tree 1f5ea06444a477dbf8451217ad43522785307f76. The changed-file gate passed; the 14-file focused runtime gate passed 724 tests with one existing skip. Same6ea verified 61 review input hashes and descendant settlement, removed consumed private fixtures, and committed reviewed tree 1f5ea06444a477dbf8451217ad43522785307f76 as local 21b0653aba70889d9c7f18c84ae3ac5632170ef7, preserving Peter’s attribution. The native gate is in progress; its terminal receipt is pending. The same owner has been continued to collect that gate, publish the qualified correction, verify resulting-head review and required CI, then land and clean up. Public 98f4a930459d still has failed required CI; successful local gates are not publication, full-native acceptance or LAND. No complete receiver/native acceptance or new publication is claimed. No further unchanged replay. Receiver native acceptance, exact-source API-direct review/publication, required CI (currently failed) and LAND remain open; no whole-#147281 or composition blanket hold. | Bind private stores before update and Doctor · #156421 |
| #156459 | Three copied tooling-fixture/workflow repairs required by update qualification; Peter Steinberger attribution retained | bca82d882107 / 3 | Closed as superseded, not merged: all three outcomes are in merged #156136, ceb109668b43. Same owner verified 58/58 on main and whole-file API review; original PR CI was not green. Owned control/native checkout and registrations verified absent; exact dedicated worker incarnation archived with transcript retained | Repair copied CI fixtures · #156459 |
| #147781 | Captured-output closure supplier for independent Doctor/update qualification; Vincent Koc attribution retained | Public b2bbd40cdb98 | Repaired and published; local behavior checks and scoped independent API-direct review passed. Native preparation used github_pending, not a native-test pass. Same63bf reran exact-head CI run 36059277744 after the release-priority variable was verified absent; attempt 2 is queued, and the prior release-deferral failure is not clearance. No accepted auto-merge or landing yet. Preserve main's separate nested Error.errors improvement during any downstream composition. #147281 merged at f53cce01b45a on September 24; same594 is verifying delivered scope, residual private custody and cleanup. All original recovery/receiver goals remain mapped separately. | Keep child ownership until output closes · #147781 — 63bf24ae |
| libuv/libuv#5296 (successor to issue #3866) | Native watcher prerequisite for #156421: admission coverage and existing-watch continuity across stream rebuilds | Published 98ccd0db63ce; tree f73905d9e7fe | Qualified source: 59 native checks, 51 TSAN checks with zero warnings and eight existing skips, scoped independent API-direct review, 49/49 upstream CI checks passed. Public ABI unchanged; libuv #5283 allocation and #5287 failed-init scope preserved. OPEN and mergeable; upstream maintainer review/merge required by read-only access. Same6ea has resumed supported isolated Node 24.20.0 integration; no Node/receiver clearance or live-runtime changes. Same upstream worker retains ownership through landing. | Preserve macOS watcher events · libuv #5296 — 0e1e1909 |

Retained behavior checklist

Unchecked means the complete retained behavior is not yet verified landed; narrow component publication or a merged prerequisite is not full-outcome completion.

  • Capture and verify the complete recovery manifest — #156366 landed the bounded parser and real read-only update-status consumer as c7ee253e2c4c from reviewed 8d21ae0f6248. Original #145169 retains the capture/verification producer, complete recovery and newer-write preservation; those outcomes are not proved by the landed parser/status leaf.
  • Capture real config/Doctor writes before mutation — #145043 retains the sole receiving composition. Private schema transport b9917c2de1cf has verified postimages, 2/2 receiving cases, types and scoped API review; the unchanged lifetime bridge passes 21/21. Guarded caller/lower adoption is next. These source checks do not prove capture-before-mutation, installed no-loss recovery or current-head CI.
  • Admit and settle the installed original updater — #145169 — existing destination; remaining narrow-piece acceptance/qualification open.
  • Typed warnings for supported legacy plugin declarations — #156326 merged as 4c468412dfef from reviewed head 8a8f90eb2f28; all 23 landed file postimages verified. The guarded Doctor rehearsal consumes declared resource paths and persisted/reported warnings before migration, retaining malformed-resource and physical-locality refusals. Required CI is green; three actual published-updater cells pass (2026.9.2 and 2026.9.4 configured-plugin installs, plus 2026.9.4 Workshop Doctor recovery). Hosted qualification used fa349d3c2ccc; all non-test product source is identical to final head, whose only later change is the reviewed producer test. Whole touched-test-file audits and API review are recorded; Peter’s source credit is preserved. Both worktrees and eight hosted artifacts are gone. Exact snapshot retirement and worker archival are independently verified complete, with retained source and native merge outcome preserved; complete live capture/recovery/newer-write acceptance is not claimed by this leaf.
  • Account for retained capture and actual remaining-copy capacity — Successor PR not yet published; current integration owner is the #145043 worker, with package-copy facts from #144318.
  • Prepare recovery generations without losing newer writes — #145169 retains guarded caller 29d830e5f2b0; test-only d040300a6376 still exposes two valid DELETE/WAL failures because preserved SQLite snapshot bytes differ from stopped-C bytes. The original fix(update): back up state before migrations and restore it on rollback #144005 capture owner supplied reviewed source-image primitive tree ee96e21303fc (7 native tests pass), not a complete binding fix. Existing fix: preserve newer data across failed update rollback #145169 producer adaptation 2be66849fca9 now forwards the required original-capture proof through the original generation adapter; its 12 owned files plus five accepted lower files are source-verified, with clean scoped API review and 11 writer/2 binding tests reported passing. The eight dependency preimages are restored. The qualified two-manifest package correction is now adopted, with exact resulting manifest hashes verified and full producer/writer import-closure type checks reported exit 0; subsequent automatic-caller edits still require affected requalification. Actual original-producer execution remains blocked at baseline capture/plugin discovery, and automatic caller integration is not accepted. The feat(update): add sealed package-publication recovery #144318 lower attestation base b61618542e5c remains unchanged; its later scoped-qualified correction c2dc5f3692fb intentionally changes three guards and preserves five, with exact pre/postimage evidence. That correction is not yet accepted as producer/composed integration. Canonical has routed its required binding.sourceAttestation ref and first-admission original-capture proof to the same producer and fix(doctor): finish state migration after legacy install repair #145043 composition owner; real producer/durable-journal integration is not yet accepted. Immutable source attestation preserves the landed manifest payload-digest contract without changing fix(update): inspect retained recovery sets safely #156366. Actual C→T/resource assembly must retain original publication maintenance, exhaustive inventory/sidecars and newer-write refusal. Composed regressions, installed no-loss acceptance and exact-head CI/LAND remain open; caller/lower adoption continues independently. Two source-bound producer findings from the excluded historical implementation remain with the same fix: preserve newer data across failed update rollback #145169 owner for current-source applicability and proof: directory-child B/C/T protected-path metadata divergence and interruption between terminal-receipt hardlink publication and temporary unlink. Neither is declared fixed; strict lower equality and newer-write protections remain binding.
  • Safely publish the selected recovery generation — #145169 — existing destination; remaining narrow-piece acceptance/qualification open.
  • Recover interrupted package publication — #144318 retains guarded eight-file helper/journal/Worker protocol ec8a496f82a9 (92 scoped native cases and independent API review). Private current-main preparation f7de79df07f2 preserves all 40 lower paths/eight guards; overlap review is scoped-clean, not new runtime or CI evidence. The sealed three-file generic snapshot-child transport fe75f7f93cc7 is integrated into the existing fix(update): preserve executor custody across post-core continuation #144319 receiver at 6932c8011df5: transport 3/3 and scoped review pass, with zero shared-store attempts. Receiver native 11/12 followed by diagnostic 12/12 does not resolve the first cancellation-readiness failure or prove full recovery acceptance. The existing fix(doctor): finish state migration after legacy install repair #145043 composition owner must supply the immutable minimal caller/recovery/native/bridge closure against diagnostic-only receiver 1f7a80297c13. Sealed delta 7c82a8d79398 has 14 source-verified paths, but its cumulative 61-path import is rejected because five of eight protected receiver files differ. The original-adapter capture-proof forwarding correction is now adopted in shared 83be4ca33d5f (two exact source/test paths verified; 37 scoped tests, types, lint and formatting pass). The completed composed review confirmed the adapter-forwarding correction but required continuing publication authority and last-await pre-effect proof. The lower owner has now sealed c2dc5f3692fb on unchanged b61618542e5c, tree d5e950948d833: all 27 pre/postimage mappings (14 production, 13 test/private-harness paths) and eight guards are parent-verified. Swap, activation and activation-journal have three intentional reviewed corrections; five other guards remain byte-identical, and retained f7/b616 trees are unchanged. The c2 lower checkpoint retains its 51 scoped cases and clean API-direct review as historical evidence. The subsequent sealed inline native adapter 7ab5c2127080 on c2, tree d8c2b940d4e2, now passes the unchanged selected-pair/provider displacement oracle and 37 affected cases (15 native composition, 14 journal/transaction, 8 source proof). Its exact 28-input TypeScript qualification has zero total diagnostics without filtering; the old 45-diagnostic custom-host result is superseded, not counted as a pass. API-direct review is clean P0–P2; lint and format exit zero, with one unsuppressed existing inline-size warning. Parent verified all 12 delta pre/postimages, eight guards (three intentional changes and five unchanged against b616), both patch hashes and 24 evidence hashes. Lower remains fail-closed. The fix(doctor): finish state migration after legacy install repair #145043 shared supplier has now qualified b3868fb92058, tree adaf6f4f03cd: an exact three-file delta on 83be4ca33d5f, nine passing native controls, two meaningful red-to-green regressions, affected types/lint/format and final API-direct review clean. Parent verified all 19 reviewed source files and all eight unchanged shared guards. The ninth lexical-scope cleanup correction is included; old 836e203a7b72 is superseded. The qualified inline adapter retains original executor displacement and successor selection, exact-once onDisplaced, captured original authority and authenticated durable-journal synchronization; a private one-shot dispatch latch refuses foreign/replaced providers, and legacy rollback refuses before poisoning native reverse state. This is not a donor-module transplant or accepted receiver envelope. The same fix(doctor): finish state migration after legacy install repair #145043 supplier has prepared a provisional 25-path envelope (24 production paths and one regression test), tree da2f31a87c5d, patch SHA256 8f82b1180bf1c84874431d97e5b710d3d0539fc0c70665f77045a5d4387f6dd0. Parent verified all 25 pre/post source mappings, 15 guards and seven native source pins; four receiver corrections and three transport files remain unchanged. It is not qualified for import. The additive parser bridge has 8/8 tests, actual-preimage 7-fail/1-pass evidence, lint/format and scoped API-direct review; the ordinary backup implementation remains byte-identical. All 15 native controls on the common pre-parser closure fail at missing receiver exports, and final 25-path native/type qualification is unrun. The same fix(update): preserve executor custody across post-core continuation #144319 owner has sealed the current authority/currentStores contract on clean 7e9abd880e87 / tree c0fe01f7: captureUpdateCommandRecoveryGenerationAuthority(fence, runId) takes two arguments, shares the original admitted-authority/run registries and currentStores, and re-admits the original generation before commitInvocation/ready. All 22 current source pins and 120 return artifacts are parent-verified; no donor executor registry is imported. Full build and isolated CLI smoke pass; 52 distinct cases pass with scoped static/API-direct evidence reuse, but three inventory maintenance-lease failures and two original B/C/T 120-second deadlines remain open. A heartbeat worker’s shared coordinator SQLite attempt was correctly refused before open; same2221 is continuing owned private resolver/worker binding qualification without weakening that guard. Existing e384 lower-native qualification remains running and is preserved. Latest-main clean merge preview is not runtime evidence. Same e93 retains original-caller adaptation; rollback dispatch, pre-C config receipt settlement, startup admission and state preparation remain with their actual owners. Original-caller recovery publication, actual native cancellation, exact-head CI/native acceptance and LAND are not cleared. The same fix(doctor): finish state migration after legacy install repair #145043 owner retains envelope custody and will qualify the affected composition after the immutable native export handoff. No donor executor transplant, declaration stub, changed refusal or broad import is accepted. The 12-path private harness export and old cumulative 61-path import must not be transplanted wholesale. Same e384 retains lower source/PR custody; same e93 retains stopped-C/C→T/DELETE/WAL/newer-write producer acceptance. Scoped lower-provider positives/refusals do not establish installed-runtime, receiver, full-CLI or no-loss acceptance. Four receiver corrections and three transport files are untouched by this lower delta. The diagnostic-only receiver remains 1f7a80297c13; original native cancellation readiness and composed lifetime/API acceptance remain open. The old cumulative 61-path import remains rejected; only five needed unchanged donor prerequisites are retained, not the whole historical transport. Original-native maintenance admission/ancestor capture, source-proof retention, atomic original journal binding and owner-preserving publication/completion remain required. Publication, actual-candidate CI and applicable recovery acceptance remain open; no unrelated whole-stack landing hold applies.
  • Fence terminal effects and retire completed recovery — #145169 — existing destination; remaining narrow-piece acceptance/qualification open.
  • Protect first-store initialization and every helper writer — #156421 publishes the bounded update/Doctor before-first-access leaf at 98f4a930459d (12 files; not landed); frozen correction 8b457ff2 remains local under the same6ea owner. Historical native 05665e497cc5 passed build/check but failed tests (exit 139; 15/610 shards failed); the later full attempt also failed (143/SIGTERM). The exact original 48-file, one-worker Gateway replay has now settled: exit 1, 667 passes and three custom-provider RPC timeouts, with no SIGSEGV in that replay. Its processes and private fixtures were settled and removed. Task-only compute bootstrap qualification has causal two-case 16 MiB OOM red/green and 73 affected passes; QA source-tsconfig/worker bootstrap has causal red/green, the original lifecycle case passing, and scoped API-direct review. These results do not explain the retained RPC timeouts or clear either historical crash/full-gate failure. Same6ea completed the bounded predecessor-order RPC discriminator against the frozen guard: adjacent-order 36/36 and original shared-worker prefix 224/224 selected cases passed with original assertions and timeouts; both listener warnings reproduced without timeouts. The three historical RPC failures remain unresolved, with no justified source fix or crash/native clearance. Reviewed guard restored and consumed fixtures/helpers removed; no further unchanged replay. The earlier three-file watcher repair from the existing #147281 owner was adopted with exact postimages, receiver 11/11 and changed checks; a later full-native watcher-link failure remains open. Same594 has bounded native close/reacquire event-loss evidence, including without receiver hooks, under the original 3000 ms assertions; historical receiver causality is unproved. Same594’s independently reviewed static diagnosis identifies libuv v1.52.1 registration returning before coverage and shared-stream ADD/REMOVE rebuilds using SinceNow without preserving existing-watch continuity; no owned-JavaScript repair is justified. Distinct libuv owner 0e1e1909 published libuv#5296 for issue #3866, preserving adjacent allocation/failed-init work. Exact head 98ccd0db63ce passed 59 native checks and 51 TSAN checks with zero warnings (eight existing skips), independent API-direct review and 49/49 upstream CI checks. The public ABI is unchanged. Upstream maintainer review/merge remains external because authenticated upstream access is read-only. This source qualification does not establish a repaired Node binary, receiver acceptance or historical RPC causality. Same6ea has resumed supported isolated Node 24.20.0 integration, with exact source/receiver hashes, Vitest 5.0.1 and the unchanged 704/708, symlink-refusal, ordinary-restoration and 3000 ms contracts. Same594 retains residual private-source custody while closing merged #147281, merged at f53cce01b45a on September 24; its merge does not deliver all original recovery obligations. This is not whole-fix(doctor): release isolated state before cleanup #147281 acceptance or a blanket composition hold. Exact-candidate native qualification, independent API-direct review, supported correction publication and resulting-head required CI/landing remain open; public required CI is failed. The three-file fixture prerequisite #156459 is closed as evidence-backed superseded by merged #156136, ceb109668b43 (58/58 on tested main); dependent exact-candidate qualification remains required. #145043 retains broader invocation/lifetime integration; every actual helper/daemon/Worker/terminal private-store binding and composed original recovery acceptance remain separately required. A scoped leaf or source test is not proof of the complete outcome.
  • Avoid repeated startup database copies — #155544 remains OPEN at public 1c9303cea9e9; signed private fdb6266d40a6 / tree bb44b254 remains unpublished and clean. The earlier native attempt passed build/check but stopped with exit 130 after seven failures; two harness incompatibilities were identified, while the other original timeout causes remain unresolved. Same7ab qualified the changed task-private route with compatibility controls and scoped independent API-direct review; four exact running-route postimages and the review receipt were verified. The existing selectors-unset full-native process passed build/check and remains in tests: three completed summaries total 156 files / 2,111 tests, with no failure observed at the checkpoint. This is not terminal full-native or hosted-CI clearance. The prior appended-byte isolation census had zero unsafe admissions; a current terminal census and child/resource settlement remain required. Existing same-owner native completion notification continues into actual-failure diagnosis or supported signed correction publication, exact-head review/required CI/runtime and LAND/cleanup. Preserve physical private handoff-store binding in every helper; no blind unchanged rerun, forged stamp, weakened isolation/assertion, unrelated whole-stack hold or complete-recovery credit. Previously consumed 1.59 GB caches and the old operation lock were removed; current gate resources remain owned. No live deployment.
  • Inventory declared capture resources and boundaries — #145169 — existing destination; remaining narrow-piece acceptance/qualification open.
  • Publish staged plugin inventory under caller authority — #145043, same dedicated owner. Canonical bound the narrow read-only staging/convergence seam and attributed fix(update): back up state before migrations and restore it on rollback #144005 preview source against 15 verified receiving preimages. Implement guarded post-validation publication; prove unchanged canonical state on refusal and preservation of newer writes. Source, behavioral qualification, review, current-head CI/publication and landing remain open, independently of the native lane.
  • Retain inspection/cancellation and snapshot-cleanup failures — #156265 merged 2026-09-23 as a976c5cb3f71 from reviewed head 81d1f3424349; ten focused behavioral cases, independent API review and required CI passed, with required security status successful. Native accepted intent reconciled without redispatch. Peter Steinberger’s original PR and Jason’s cleanup implementation attribution are preserved. Dedicated owner: Stop updates when schema snapshot cleanup fails · fix(update): stop schema admission when snapshot cleanup fails #156265, owned cleanup verified complete and exact worker session archived. Other original capture/recovery outcomes remain separately open.
  • Durably store and read operational capture receipts — #156298 merged as 44b5df106030 from reviewed head 748ef9efdf13: 11 files, +555/−15. Exact-head CI, required aggregate review, native preparation, and independent API review passed. The wrapper regression was reproduced and repaired with one inventory entry; the original ten product/test files remain unchanged. Peter Steinberger’s original capture-design credit is preserved in the landed commit. Dedicated owner: Preserve update recovery receipts · fix(update): preserve recovery receipts across progress updates #156298, owned cleanup verified; dedicated worker archived with transcript history preserved. This is only the receipt predecessor; fix: preserve newer data across failed update rollback #145169 retains generation and all untransferred capture/restore outcomes.
  • Preserve forward/manual recovery and driver lifetime — #145169 — existing destination; remaining narrow-piece acceptance/qualification open.
  • Preserve logical no-loss restore semantics — #145169 — existing destination; remaining narrow-piece acceptance/qualification open.
  • Keep private capture data out of ordinary exports — #145169 — existing destination; remaining narrow-piece acceptance/qualification open.
  • Settle children and finalization before terminal publication — #145043 — existing destination; remaining narrow-piece acceptance/qualification open.

Additional linked components: #144319 supplies post-core executor custody; #156211 supplies ordinary-backup completeness. Neither is counted as complete recovery/no-loss coverage.

Original-goal details retained across the split

The 19 broad outcomes are a baseline, not proof of exhaustive delivery. Their acceptance also includes these explicit original requirements:

Each coherent piece may land independently after its actual dependencies, exact-head behavioral/integration checks, whole-touched-test-file audit, independent API review, required CI and applicable runtime acceptance pass. An unrelated whole-stack/native hold is not a landing dependency. Newer-write preservation and full recovery remain composed acceptance obligations, not ordinary-backup or package-rollback equivalents.

Already merged prerequisites

  • #140339 — feat(update): retain compatible package rollback and safe recovery admission; merged 2026-09-10.
  • #145547 — fix(update): keep the candidate capability probe free of state migration so ownership never refuses it; merged 2026-09-12.
  • #149449 — fix(update): avoid rehearsal failures while databases are active; merged 2026-09-19.
  • #153839 — fix(update): prevent live SQLite inspection from aborting updates; merged 2026-09-21.
  • #154160 — refactor(update): simplify update execution and finalization; merged 2026-09-21.
  • #143799 — fix(backup): exclude private update captures from ordinary exports; merged 2026-09-10.
  • #143899 — fix: keep moved capture directories out of exports; merged 2026-09-10.
  • #147908 — fix(update): check snapshot capacity before staging; merged 2026-09-14.
  • #146571 — fix(state): await private SQLite snapshot cleanup; merged 2026-09-13.
  • #145360 — fix(state): retain read-only snapshots until native cleanup succeeds; merged 2026-09-11.

These merged PRs provide their bounded component behavior only; they do not close the 19 retained outcomes by themselves.

Tracking and closure rule

Maintain this section on both originals whenever a successor is published, reassigned, superseded, or merged. Every distinct open split PR keeps its own named session in Atomic update workers. Link the parent tracking from each successor. Keep unpublished pieces explicit; do not drop them when a worker turn ends. Close the originals only after every retained outcome is verified landed or explicitly superseded with semantic evidence. Verify cleanup before archiving the corresponding completed worker.


Cleanup prerequisite — September 22

Forward update admission now refuses when a schema-inspection snapshot cannot retire. It retains snapshots still owned by readers, waits for cleanup settlement, and preserves the original inspection/cancellation error together with cleanup failures. This three-file successor is the source prerequisite for #149984; it does not replay that Doctor patch or the preservation stack. Peter Steinberger's original contribution and public ancestry are preserved.

Evidence: all nine cleanup controls pass on the public source graph, including the real retained-reader failure, unchanged source bytes, cleanup rejection identity, awaited settlement and aggregate error ordering. Command wall time was 28.72 s (17.54 s repository test-worker preparation; 81 ms test bodies). Formatting, changed-file lint and whitespace pass. The complete changed import graph has no diagnostics in the three changed files, but remains type-blocked at unchanged src/system-agent/chat-turn-router.ts:166 (broad SystemAgentChatReply versus a narrow action: "none" callback). No typecheck waiver is claimed. The exact production/test postimages reuse the scoped-clean independent API-direct review and complete test-file audit; all nine distinct regressions remain. The retained fail-first run fails six cases on the old implementation.

Scope: component proof, not installed/native or full-no-loss acceptance. Existing #145169 preservation composition, recorded CI defects and exact new-head CI remain outstanding; no auto-merge or live-service action is requested. Prior checkpoints below remain historical evidence, not new-head PASS claims.


CI repair continuation — September 21

Fixes stale finalizer/Doctor test contracts and independent static-check failures without changing recovery authority: complete maintenance mocks; preserve the unsettled-process error in the finalizer mock; require the new persistent-effect callback; remove duplicate typecheck roots; extract a leaf CLI test context and the unchanged config write-option helper. Config mutation tests now use a private handoff store rather than the shared temporary store.

New proof: 62 finalizer/convergence controls, 26 plugin-convergence controls and 13 selected config ownership/guard controls pass (101 total). The previously reviewed 28-control patch is included unchanged. Production types, affected CLI-update/config/Doctor test types, strict lint, formatting, import-cycle and original-base line-cap guards pass. Independent API review is clean through P2. No weakened runtime guards or assertions.

Test cost: finalizer command 176.53 s (including compiler preparation), plugin convergence 36.97 s, selected mutation controls 25.81 s. The first mutation attempt failed on an incompatible row in the host-shared temporary handoff store; fixture isolation fixed the cause without modifying that store. An incorrectly selected root tsconfig invocation also failed; the repository-configured production project and affected test projects pass. This is not a full CLI/native acceptance claim.

Still not landable: prior-head run 35624595497 finished with 112 successful jobs, 25 causal failed jobs and a failed aggregate gate (15 skipped). Small-7 added five failures; the two callback assertions are fixed, while same-version installed-versus-registry schema admission, Linux handoff stop count, and unavailable-plugin finalization remain open. Other recorded baseline/combined-source CI failures are not waived. Exact new-head CI is required. #145169 preservation composition and actual-source native/no-loss/installed acceptance remain required; baseline restore must not land alone. No auto-merge requested.


Current integration status (2026-09-21)

Candidate 27477e294a8e46a741da43b629d4535e96f7efb2 preserves this PR's public ancestry and incorporates main d61156bb5cfa22e15d19121d6ab4c073bfeac33e. The missing lower capture prerequisites are restored without importing the preservation stack or private review history.

Real config-finalization tests exposed recovery receipt paths being treated as redacted diagnostics. The ledger now preserves operational receipts exactly inside the existing 16 KiB origin limit, budgets optional diagnostics separately, and refuses oversized writes before replacing the stored row. Tests include exact acceptance at 16,382–16,384 bytes and non-destructive refusal at 16,385 bytes. No database limit or capacity guard was relaxed. Required module extractions preserve existing finalization, rollback, Doctor and lock ownership.

Actual-source proof: 149 affected config/ledger/rollback/executor/replay/report controls, 36 Doctor preflight controls, and 9 selected CLI controls passed. Core types, strict changed-file lint, formatting and whitespace passed. Independent API-direct review is clean through P2 for the corrected production/extraction delta and the final fixture adjustment. The seven receipt controls took 1.241 s of test-body execution; the affected command took 653.94 s including a 199.2 s source rebuild. Preflight took 76.92 s; the selected CLI command took 261.98 s. These selected checks are not a full CLI or native acceptance claim; current-head CI is still required.

Original failures remain accounted for: the previous boundary compiled zero config tests because prerequisites were missing; actual-source qualification then exposed a typed maintenance fixture gap and redacted receipts. An initial oversized-receipt case hit the existing byte limit; oversized sets remain refused atomically. A completion-cache fixture scanned a concurrently changing repository; it now uses the existing isolated package fixture. Compiler-generation refusals during build/source changes were not counted as test passes. The corrected checks ran on frozen source.

Not ready for main landing alone. #145169 remains required: raw baseline restore can discard newer live update-ledger/data. Its preservation source and exact resulting-source qualification are not included here. Unreceipted changed writes retain the backup and refuse recovery; this is not universal automatic no-loss acceptance. Combined exact-source review/CI, an unmodified published-driver first hop, a separate built Doctor plus second protected update, and isolated native/readiness qualification remain open. No live service deployment or restart was performed.

Older checkpoints below are historical, not current-head PASS claims. Superseded agent-created command budgets and phase-admission restrictions are not landing gates.


Current integration status (2026-09-17)

Draft head 156282f60d28e722bd339eb17f34b7abfcf58a1e incorporates pinned main 9ca2d1dfcd161ed862a30749f40486e95d6459f1. This aligns the base for stacked #145169 so its CI does not treat upstream locale refreshes as task source changes. The eight merge conflicts follow current source owners; normal commit hooks passed. The original unpublished recovery-history contribution is preserved.

Not ready for main landing alone. Independent canonical review confirmed the pre-existing raw-baseline restore can discard live update-ledger history. The reviewed generation/publication correction in #145169 is a required dependency, not waived by this base refresh. Combined exact-source review/CI, full-built unmodified-published-driver first hop, separate built Doctor plus a second protected update, and native qualification remain required.

Older checkpoints below are historical evidence, not current-head PASS claims. Task-generated containment/admission cycles and historical cleanup slot holds no longer apply to ordinary maintainer work; real product ownership, data preservation, review and CI requirements remain.


Integration prerequisite; not ready for main. Current-source composition is being completed with stacked #145169. That stack must merge here before main landing; its forward-recovery and final-effect retirement fixes must not be separated from this capture prerequisite. Separate full-built first-hop and Doctor acceptance remain pending.

Related to #142770; original-driver H1/H2 acceptance remains open.
Refs #144422

Blocked; not land-ready. The remaining-copy capacity handoff still needs its reserved-owner exception. Fresh published-9.3 proof now identifies an additional first-hop gap: the installed 9.3 Matrix migration has no recovery-resource declaration, so candidate rehearsal refuses before live migration. A newer-main bootstrap contract also needs reconciliation: the target Doctor can write authored config before capture/run registration, and main's named test preserves those writes on failure. No weakening, guessed inventory, timeout increase, or silent unprotected exception has been applied.

What Problem This Solves

Fixes an issue where updating from 2026.9.2 could leave the Gateway unusable after rollback: target Doctor migrated persistent state, package rollback restored the old binary, and that binary failed with no such column: workspace_dir. It also fixes no-op updates stopping healthy Gateways, completed legacy captures blocking later updates, and repair capture overhead growing with every inventory entry.

Why This Change Was Made

This implements the accepted lossless-capture contract and transaction-scoped lifecycle decision. Peter's explicit 2026-09-10 approval: “update should always work. It's best effort. If there are minor hiccups we add that in the warning log. We should backup things before, and rollback restores the backup.”

Capture, restore and retirement

Before protected mutation, existing backup machinery captures config/include files, shared and per-agent SQLite, Skill Workshop and inventoried plugin resources. SQLite uses online backup; recovery captures remain unsanitized, without delivery-row or TTL pruning. One immutable manifest binds numbered resources by size and SHA-256; the terminal outcome is separately write-once.

Sets live at <stateDir>.update-captures/<captureId>/ with private ancestors and owner-only permissions. The shared privacy marker excludes them from ordinary backup/support exports, including explicit containing/nested selections. User archives retain their existing behavior. Capacity admission covers capture, package/recovery staging, growth and reserve; insufficient space preserves live data and earlier sets.

Generic JSON/plan adapters and custom bundled migration owners enumerate inputs through existing collectors. The optional read-only requireLocalResources collector argument rejects remote resources when complete local capture is required; it is not configuration. Missing declarations refuse protection.

Rollback restores package files and captured state, then verifies the previous managed Gateway. State-only finalization restores its capture without inventing a package transaction. Database-directory restore removes migration-created files only within the declared boundary; reopened LanceDB verifies captured schema, rows and version. The shared copy helper clears restored state_leases and agent_database_leases: process leases cannot survive copying. Captures remain lossless.

Both finalizer Doctor phases share one verified capture and config-write receipts. Mutating children settle before restoration. Manual recovery retains protection through subsequent Doctor/bootstrap writes, restores again if continuation fails, and closes reopened stores. Standalone repair never starts the Gateway. Data failures are hard errors; reporting failures after verified recovery are advisory.

There is no count, age or capacity-pressure pruning. Existing terminal owners retire captures only after durable, identity-bound success and settled recovery dependencies. Admission reconciles completed prior transactions through Doctor's resolution owner, requiring confirmed matching runtime/version/build and successful Doctor/Gateway verification. Explicit false readiness fails; missing newer fields remain compatible with 9.2. Nonterminal, restored, failed-restoration and unverified sets are not automatically adopted.

No-op and tagged-upgrade contracts

Convergence requests protection only for actual plugin/config mutation, using facts already available inside its existing lease. Unchanged baseline publication and repeated failure of an already-disabled plugin preserve their no-change result. Real enablement, alias and slot changes remain mutations. Exact target identity is always validated; an already-current core uses its installed schema/runtime metadata. Lease ordering, publication fencing and --no-restart semantics are unchanged.

Admission checks capacity and independent writers before shutdown. A late pre-mutation refusal restores the original service, including with --no-restart. Native parent/launcher identity and Gateway-lock checks distinguish a supervised Gateway child from unrelated writers. Capture callbacks now check live executor/maintenance fences; full recovery admission runs before and after capture, avoiding repeated SQLite snapshots per resource.

The named tagged 2026.9.3/2026.9.4 rehearsal contract accepts their disposable copies only with the existing update-in-progress marker, exact private environment/config/data layout, observed live parent chain and matching copied-ledger identity. It verifies local resources, OAuth paths, SQLite companions, ownership and links under existing maintenance authority. Identity-bearing driver/capture calls remain strict. Admission emits a typed legacy-driver-rehearsal fact and warning. Remove this compatibility path when those tags cease being supported upgrade sources.

Inline Git RPC remains explicitly unprotected, recorded in its parent run and reflected in result/status: “This Gateway-initiated update is not protected by a recovery capture. Run openclaw update from a terminal for a protected update.” The external drain/stop/capture continuation is #144422.

This builds on @fuller-stack-dev's #143693, #143799 and #143899, and reuses @vincentkoc's cleanup fencing (#143791) and terminal settlement (#143921). Package activation stays with #143750/#143752. Please keep maintainer edits enabled.

Data-model compatibility

No SQLite schema/column, protocol, configuration option or dependency change. One recovery-set kind and existing run metadata hold config receipts, restoration facts and unprotected RPC identity. No ratchet increased; the upstream environment-variable budget passes at 492/492.

Owner flow map

Pre-fix references are pinned to 298493fa54b8d2f9091e504c178f850591a1757c:

Boundary Previous behavior
src/infra/package-update-swap.ts:118; package-update-steps.ts:1215 Package/launcher backups only.
src/cli/update-cli/update-command-package.ts:84,110,278,306; update-command-config-snapshot.ts:25 Root-config rotation followed by target Doctor; no database/include capture.
src/commands/doctor.ts:164; src/flows/doctor-health.ts:121,160,237 Migration maintenance without state restoration on failure.
src/cli/update-cli/update-command-rollback.ts:285,341,436; src/infra/update-managed-service-handoff.ts:1042,1821,1898 Schema refusal or package/root-config rollback, then Gateway health/version/build checks.

Published 9.3's previously healthy rollback preserved schema compatibility; it did not restore SQLite.

Current responsibility Owner
Admission/capture src/cli/update-cli/update-command-backup-lifecycle.ts:48,180,214
Capture inventory/capacity src/infra/update-recovery-backup-create.ts:423,427; update-recovery-capacity.ts:44
Plugin resource collection src/plugins/doctor-migration-resources.ts:12
Tagged rehearsal src/commands/doctor-update-rehearsal.ts:127,489
Doctor recovery/reconciliation src/commands/doctor-update-recovery.ts:186,347,630,654
Restore/lease clearing src/cli/update-cli/update-command-rollback.ts:387,477; src/infra/update-recovery-backup-restore.ts:22,220
Terminal publication/retirement src/cli/update-cli/update-command-terminal.ts:264; update-command-backup-lifecycle.ts:375

User Impact

Protected failures recover state before restarting the previous Gateway. True no-ops keep healthy Gateways serving. Retained sets appear in update status --json with npx openclaw@latest doctor --fix guidance. With 9.2, a failing target Doctor restores state before package rollback; because that updater may leave the Gateway stopped, output also names openclaw gateway start.

Release-note context: persistent-state backup before migration, complete rollback, safe unresolved recovery and healthy no-op behavior.

Evidence

Latest checkpoint (2026-09-11)

Published branch checkpoint: ee09337d115b4a721b46572443f042f7c3ce650e; local rebase: f118e3396f15dfb40a901fcd323efc4a57554dd8 onto 24109cc97c2. The installed-schema/terminal-registration corrective diff remains uncommitted because its fresh P1 review identifies the bootstrap ownership gap. Earlier evidence below retains its original source identity; it is not current-head green proof.

  • Fresh-profile current-package regression failed before with ExitError: exit 1 instead of reaching the installed initialization owner. After sharing the existing bounded manifest reader: fresh-preview plus backup-lifecycle suites 62/62 passed.
  • Native restart argv correction: failing-before expected argv omitted --update-executor run; focused after 1/1 passed, then upstream independently incorporated the same assertion.
  • Root-idle Windows probe: one of two cases timed out at 120.131 s. Instrumentation in the actual nested test worker counted 153,196 installation-tree filesystem operations / 38.669 s, with no SQLite read-only child invocation. This is an owned capacity-walk cost, not an attribution to host load.
  • The metadata six-row table and refresh five-row table passed; those focused probes do not dismiss the previous original-order failures. Full CLI rerun remains blocked on the capacity repair.
  • Fresh P1 review of the corrective diff: one finding (0.99) at update-command-target.ts:306, because allowing already-current initialization exposes config writes before recovery ownership. The full-branch review was interrupted after local typechecking found a duplicate updateRun property; that duplicate is removed. The rerun passed all typechecks, then was intentionally stopped during type-aware core lint after this P1 confirmed the ownership STOP.
Live control Exact candidate Result Captures / bytes Observed downtime Previous Gateway
Published 2026.9.3 driver, populated baseline a3493020bf9c Refused in candidate rehearsal: matrix/matrix-account-sqlite-schema does not declare its migration data resources 0 / 0 B 0 ms, 261 samples Status, RPC and mock chat passed on 2026.9.3

The command took 258.720 s; health was verified at 262.491 s. Packaging passed the canonical tarball and dist import-graph checks: 10,936 files, 209,542,875 unpacked bytes, no task artifacts/captures; SHA-256 0c17ca456bb12d5539d60c5a6138805205316a729e80fc6209736db57edf801b. This was not a fingerprint timeout and is not a successful update control. Official survivor and populated repair reruns are not completed for this checkpoint.

The bootstrap conflict is explicit in main's update-command-fresh-preview.test.ts, “accepts target Doctor config changes that preserve the selected stored channel”: it throws after Doctor writes and expects the migrated config to remain, with no shared database. Capture before that initialization needs an owner design that does not create a newer-schema run ledger first. The pending copy-footprint proposal carries read-only source/destination facts through existing callbacks; it does not alter package activation ordering or fallbacks.

Earlier proof was taken after rebasing onto b7693bf50aa, which contains the required upstream planner fix 87504f7ec9e. Workshop continues to use main's single artifact-preserving source reader and retains main's mutable migration behavior.

Latest focused proof: 317 passing tests across the latest delta's 19 test files, run individually—231 plugin tests in 15 files, 37 Doctor, 29 registry, four SDK and 16 backup-lifecycle tests—plus 24 sibling tests. All 37 changed extension files pass lint. Latest scoped review (review-final-export.log) reports no actionable P0/P1 findings (0.94), including the routing, native handoff, symlink and unused-export fixes. Built-registry census, under synthetic default and enabled-channel configurations, finds 46/46 collectors across 21 plugins without executing migrations.

Regression Failing-before evidence
Stale recovery Newer session disappeared; expected after-update, received undefined.
Logical directory restore LanceDB reopened migrated schema/extra row/version 3 instead of captured version 1.
Retention Unresolved set disappeared after three later backups.
Restored leases Four failures; lease timeout with 297299 ms remaining. After: 160 passing, one existing skip; acquisition 29 ms.
No-op/admission Six failures: two false mutation requests, two premature stops, missing late restart and retained completed set. Additional Git refusal and three false-readiness cases failed.
Metadata/plugin changes Installed schema 17 rejected using registry schema 16; unreadable override accepted; two unchanged disabled-plugin cases reported mutation.
Manual continuation Two second partial migrations survived failure; one reopened database remained open.
Rehearsal paths External OAuth directory and substituted WAL/SHM/journal were accepted. Final companion proof: three intended failures, two controls passed; afterward Doctor 37/37.
Capture overhead Expected four recovery reads, received 28; afterward lifecycle 16/16.
Native recovery run handoff Two cases returned undefined before the fix; both pass afterward.
Config-symlink restore Three regressions failed while two controls passed; the complete restore suite now passes 21 tests. Scoped P1 review is clean (0.96).

Relevant complete suites include node scripts/run-vitest.mjs src/commands/doctor.update-recovery.test.ts (37), src/plugins/doctor-contract-registry.state-migrations.test.ts (29), and src/cli/update-cli/update-command-backup-lifecycle.test.ts (16). Historical full CLI and plugin-update proof passed 482/482 and 219/219 before this rebase/fix round; these are not claims that the current full CLI run passes. The JSON review concern was disproved by the registered read-only lint contract and 127 passing registration/bootstrap cases.

The typecheck-routing guard exposed 721 roots against the unchanged cap of 720. Moving 69 update-CLI roots from the config-CLI shard to the infra shard yields 652 / 704, with every root assigned exactly once. The local routing guard exits 0; the cap is unchanged, and the canonical guard verifies every test remains covered exactly once.

Local gate history: the latest rerun removed a rebase-introduced duplicate updateRun field; all core/plugin production and test typechecks passed. The gate was stopped during type-aware core lint at the ownership STOP (exit 130), so it is not a full pass. Capacity inventory of the whole Git checkout remains an owned blocker for full CLI proof. The proposed remaining-copy handoff awaits the reserved package owner's narrow exception; no guessed ignores or larger budgets are used.

Fresh artifact and installed proof

Earlier published checkpoint: f956f3063467cb2477fb51cb89a5570ef839b67b, rebased onto b7693bf50aa (which contains 87504f7ec9e). Native recovery handoff, config-symlink restoration and exact-once typecheck routing fixes are committed.

Fresh candidate packaging and the installed matrix for this head are not yet complete. Capture sizes, downtime, Gateway outcomes and tagged-driver results below belong only to their explicitly identified historical source. No current-head live success is claimed.

Historical context only: all four cells passed on ecbcdc5e681d; integrated 49b181b20b8c passed 9.2/no-op, healthy update and injected rollback, but repair timed out before capture and published-9.3 rehearsal refused. Those failures led to the fixes above. Earlier fingerprint timeouts were load-induced only where quiet scans (15.121 s candidate; 13.837 s baseline) and unchanged-candidate controls confirmed it. Versioned fixtures regenerate the canonical dist-content seal; executable bytes remain unchanged.

CI attribution

Prior pull-request CI: run 34643012782. Merge commit 536eb4b1cd62eaeccadc14499bdde85593cebd79 contains this head and required upstream 87504f7ec9e00ca080e6c6bf17899a9213f32e67. The bounded watcher exited with owned lint failures in core-1/core-2 (execution, post-update and plugin-install files exceeded max-lines). Existing-owner extractions fixed them and passed 373 focused tests before the next rebase. No green current-head CI result is claimed.

Previous failure Attribution/proof
docker-seed-e2e Owned tagged-driver rehearsal admission, reproduced locally. Latest compatibility fix awaits fresh installed/CI proof.
compact-small-18 Eight owned stale fixtures; corrected Doctor mock and managed unsafe-exit expectations. Both files pass 41 tests without weakening retained-state/no-write assertions.
large-4/large-5 Owned Node-only import reaching browser update reporting; before five failures, after both unchanged browser files pass 129 tests. Helpers moved to the existing driver owner.
compact-small-30 Unrelated main planner: 81 jobs against cap 80. Exact reproduction on main d1c9e4690adb; independently #144941, run 34603439927/job 103283250640. Passed in run 34616163753. No cap change here.

Known limits

9.2 failures after Doctor succeeds remain outside the target's rollback contract. Doctor completion, standalone repair and no-service/no-restart finalization do not prove whole-update runtime health. Remote/uninventoried stores are not covered. Changed-core rollback without a retained package transaction remains refused, including ordinary Git updates after migration; captures remain for explicit recovery. Process exit never proves success. Inline Git RPC remains unprotected pending #144422.

Evidence retention note: the task's finalization-delta directory was deleted by another operation while the gate held its log open. The live-control evidence and all 24 timeout diagnostic files survive; the latter were recovered from the task container and hash-verified. The original full gate/test/review logs from that directory are unavailable; displayed results above were observed before deletion.

Completion-cache installed fixture correction — 2026-09-21

  • Supply the installed Doctor worker path and refresh inventory for the direct-finalizer completion-cache fixture. Explicit real capability inspection succeeds; existing real child PID binding/settlement transport and completion-cache assertions remain intact. No production source changed.
  • Focused completion-cache control and native modern-Doctor delegation control pass (2 controls); affected types, strict lint, format and whitespace pass; corrective API-direct review clean through P2.
  • First added assertion incorrectly required the lower finalizer to take the upper composition's run-context path; it failed after finalization. Corrected to explicitly inspect the fixture capability, retaining the original behavior assertions.
  • Exact standalone patch applies to routed composition tree 1c50591820be1ea998ab47ce06c7dbcdcd6ea41e; upper runtime requalification remains required. No claim that source applicability is runtime proof.
  • Previous 194, 28 and 101-control evidence is retained, not replayed. Required CI, preservation/no-loss and native/installed acceptance remain open. No auto-merge or merge requested.

Narrow static-CI repairs — 2026-09-21

  • Reuse the existing retained-step predicate, remove its duplicate codec implementation, and remove the unused duplicate ledger-schema file. Existing schema owner/callers and predicate behavior are unchanged.
  • Extract the existing include-conflict test helper into its sibling module; keep the private handoff-store fixture and all assertions. Ratchet passes against the CI base 6e85e2bb4dfc7de64c52ee22803a2f1047638b40.
  • Fix the two migration helpers to use the supported plugin-SDK isRecord re-export and add required braces to the two inventory-refusal tests. No migration policy or production refusal was weakened.
  • Six include-conflict, three retained-ledger and ten migration inventory/discovery/refusal controls pass (19 total). Production/affected types, strict lint, format, export-name and plugin-boundary checks pass; scoped API-direct review clean through P2.
  • Initial package type invocation lacked generated SDK declarations after cleanup. The supported package-boundary preparation and corrected type results are recorded separately; the failed attempt is retained.
  • Prior 194/28/101-control proof and the two completion/Doctor controls remain retained, not replayed wholesale. Preservation composition remains unqualified: still require exact composed-source CI plus no-loss/native/installed acceptance. No auto-merge or landing of baseline restore alone.

@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: voice-call Channel integration: voice-call extensions: memory-core Extension: memory-core extensions: memory-lancedb Extension: memory-lancedb cli CLI command changes commands Command implementations size: XL maintainer Maintainer-authored PR labels Sep 10, 2026
@steipete
steipete marked this pull request as ready for review September 10, 2026 11:52
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 10, 2026
@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

The branch captures configuration, databases, and plugin data before update migrations, restores captures during rollback, and records recovery and cleanup receipts.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful source work and historical proof are preserved, but reachable restoration and retirement defects prevent this branch from being quality-ready.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Merge readiness

⛔ Blocked before merge - 15 items remain

Keep open as the maintainer-owned extraction source. Main has landed useful recovery prerequisites, but the retained full-state recovery work remains distinct, and the pinned branch still has blocking restoration and retirement defects.

Priority: P1
Reviewed head: 4146d06f8a3208222189d14af897325d4daa4fb3

Before merge

  • Add real behavior proof - Authority-chain proof required: the introduced retirement owner needs an allowed final-deletion trace after original drivers exit and refusal before I/O while either driver is live or unobservable. Historical installed traces and private component receipts do not establish that result on the pinned path. Existing-record compatibility for the persisted capture/retirement representation also remains unverified. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Preserve writes made after the capture (P1) - Restoring the captured SQLite database replaces committed post-capture rows and can resurrect deleted delivery acknowledgements; directory pruning similarly removes newer plugin records. Current-writer shutdown does not classify already committed changes. The recorded delivery contract requires newer-write preservation, so compose that owner or refuse restoration before modifying live stores.
  • Retain candidate bytes until the full restore succeeds (P1) - Each ordinary resource is renamed over its current destination immediately, without retaining the displaced bytes. If the second resource fails with EIO, the first resource’s candidate state has already been destroyed; retaining the baseline cannot recover it. Seal or retain the complete current generation before the first replacement and keep it through failed publication.
  • Limit capacity inventory to the actual recovery footprint (P1) - This recursively walks every installation entry and reserves twice the entire tree size, including Git objects and unrelated files that the selected update will not copy. It introduces lengthy admission scans and false insufficient-capacity refusals; the body records 153,196 filesystem operations in the affected probe. Carry actual remaining-copy facts from the package owner instead of inventorying the whole checkout.
  • Honor shipped plugins without resource declarations (P1) - Rehearsal passes requireDeclaredResources: true, making this throw for shipped migrations that predate the collector contract. The recorded published-driver cell consequently refuses before update activation. Reuse the accepted typed-warning policy already landed through fix(update): inspect plugin migration data before Doctor rehearsal #156326 while retaining strict validation for declared resources.
  • Recheck original drivers before resumed capture deletion (P1) - When Doctor supplies a retirement receipt, manifest loading is skipped and drivers becomes empty. assertRecoveryDriversExited then always passes, allowing resumed metadata and directory deletion without checking the original updater or Doctor. Persist and revalidate their identities, or require equivalent original-owner settlement evidence immediately before deletion.
  • Resolve security concern: Retirement receipt bypasses original-driver exclusion - The resumed path creates an empty driver list before final filesystem cleanup. Matching persisted identity and outcome do not prove that the original writer has exited or relinquished custody.
  • Resolve merge risk - The conflicted branch needs a reviewed resulting composition with current main’s landed recovery owners; no pinned test merge establishes the final behavior.
  • Resolve merge risk - Fresh-profile initialization, published-driver upgrades, and existing persisted recovery records remain unqualified for the resulting capture-and-restore composition.
  • Resolve merge risk - Final-effect retirement evidence must show deletion after original drivers exit and refusal before filesystem I/O while an original driver remains live or unobservable.
  • Complete next step - Complete the recorded split against current main, resolve the restoration and retirement findings, and qualify the resulting upgrade, persisted-state, and final-effect authority boundaries before merge.
  • Improve patch quality - Publish the owner-preserving composition that retains newer writes and displaced resources through restoration failure.
  • Improve patch quality - Add redacted allowed/forbidden final-deletion traces, including live or unobservable original drivers; update the PR body for automatic re-review or request @clawsweeper re-review.
  • Improve patch quality - Qualify fresh initialization, a published updater driving the candidate, and existing persisted recovery records on the resulting source.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P1] Preserve writes made after the capture — src/infra/update-recovery-backup-restore.ts:165-169
  • [P1] Retain candidate bytes until the full restore succeeds — src/infra/update-recovery-backup-restore.ts:194-197
  • [P1] Limit capacity inventory to the actual recovery footprint — src/infra/update-recovery-capacity.ts:34-39
  • [medium] Retirement receipt bypasses original-driver exclusion — src/commands/doctor-update-recovery-resolution.ts:94
Agent review details

How this fits together

OpenClaw’s updater coordinates package replacement, Doctor migrations, and Gateway restart. Recovery captures preserve persistent inputs so a failed update can restore a compatible installation.

flowchart TD
  A[Installed updater] --> B[Recovery admission]
  C[Configuration and databases] --> D[Private recovery capture]
  B --> D
  D --> E[Doctor migrations]
  E --> F{Update verified?}
  F -->|Yes| G[Guarded capture retirement]
  F -->|No| H[State and package recovery]
Loading

Technical review

Best possible solution:

Use one recovery owner that preserves newer writes and displaced generations, refuses unknown changes, and retires captures only after current authority and complete settlement are proven.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes deterministic pinned-head restoration, second-resource failure, legacy-plugin refusal, and resumed-retirement cases. No current-main runtime reproduction was executed in this read-only review.

Is this the best way to solve the issue?

No, the pinned baseline-restore implementation does not satisfy the accepted no-loss contract. The recorded split should reuse landed compatibility owners and compose preservation before automatic restoration is enabled.

Full review comments:

  • [P1] Preserve writes made after the capture — src/infra/update-recovery-backup-restore.ts:165-169
    Restoring the captured SQLite database replaces committed post-capture rows and can resurrect deleted delivery acknowledgements; directory pruning similarly removes newer plugin records. Current-writer shutdown does not classify already committed changes. The recorded delivery contract requires newer-write preservation, so compose that owner or refuse restoration before modifying live stores.
    Confidence: 0.99
  • [P1] Retain candidate bytes until the full restore succeeds — src/infra/update-recovery-backup-restore.ts:194-197
    Each ordinary resource is renamed over its current destination immediately, without retaining the displaced bytes. If the second resource fails with EIO, the first resource’s candidate state has already been destroyed; retaining the baseline cannot recover it. Seal or retain the complete current generation before the first replacement and keep it through failed publication.
    Confidence: 0.99
  • [P1] Limit capacity inventory to the actual recovery footprint — src/infra/update-recovery-capacity.ts:34-39
    This recursively walks every installation entry and reserves twice the entire tree size, including Git objects and unrelated files that the selected update will not copy. It introduces lengthy admission scans and false insufficient-capacity refusals; the body records 153,196 filesystem operations in the affected probe. Carry actual remaining-copy facts from the package owner instead of inventorying the whole checkout.
    Confidence: 0.98
  • [P1] Honor shipped plugins without resource declarations — src/plugins/doctor-migration-resources.ts:22-27
    Rehearsal passes requireDeclaredResources: true, making this throw for shipped migrations that predate the collector contract. The recorded published-driver cell consequently refuses before update activation. Reuse the accepted typed-warning policy already landed through fix(update): inspect plugin migration data before Doctor rehearsal #156326 while retaining strict validation for declared resources.
    Confidence: 0.99
  • [P1] Recheck original drivers before resumed capture deletion — src/commands/doctor-update-recovery-resolution.ts:94
    When Doctor supplies a retirement receipt, manifest loading is skipped and drivers becomes empty. assertRecoveryDriversExited then always passes, allowing resumed metadata and directory deletion without checking the original updater or Doctor. Persist and revalidate their identities, or require equivalent original-owner settlement evidence immediately before deletion.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1fda703fb4d3.

Merge-risk options

Maintainer options:

  1. Complete the recorded owner-preserving split (recommended)
    Integrate the qualified preservation and retirement repairs with current main, then verify the composed upgrade and recovery boundaries.
  2. Keep this branch as an extraction source
    Continue landing qualified narrow pieces while withholding the raw baseline-restore branch from main.

Security

Needs attention: Resumed retirement treats a persisted receipt as sufficient to bypass original-driver exclusion; no unrelated dependency or supply-chain change was identified.

Evidence

Security concerns:

  • [medium] Retirement receipt bypasses original-driver exclusion — src/commands/doctor-update-recovery-resolution.ts:94
    The resumed path creates an empty driver list before final filesystem cleanup. Matching persisted identity and outcome do not prove that the original writer has exited or relinquished custody.
    Confidence: 0.99

What I checked:

  • Pinned introduction and clean checkout: Inspection used merge-base d61156b to pinned head 4146d06. Raw head parentage matches the supplied original-head record. The checkout remained clean; no tests or target code were executed. (4146d06f8a32)
  • Introduced recovery owners: The restore, capacity, retirement-resolution, and migration-resource collector files are introduced by the pinned delta, rather than inferred from endpoint drift. (src/infra/update-recovery-backup-restore.ts:165, 4146d06f8a32)
  • Restoration discards current generations: The restore owner overwrites SQLite from the captured payload, prunes uncaptured directory children, and replaces ordinary files individually. Verification stages baseline payloads, but does not seal the displaced current generation. The discussion’s WAL/acknowledgement and second-rename fault reproductions match these remaining source paths. (src/infra/update-recovery-backup-restore.ts:165, 4146d06f8a32)
  • Accepted contract and current split disposition: The September 11 discussion initially accepted an honest baseline-restore warning, with newer-write preservation assigned separately. The captured body now explicitly forbids landing baseline restore alone and retains composed no-loss acceptance. Its split plan acknowledges component progress without claiming complete recovery. The live body SHA-256 matched captured identity bcba09176dfec5709acc2b8f9b216072a1258e7bfc21d8c9c6270947f095a5a4. Relevant source-bound status and proof sections were inspected; this is not a claim that every historical paragraph was fully reviewed. (4146d06f8a32)
  • Resumed deletion drops driver custody: Doctor passes recorded retirement receipts into retireDoctorResolvedCapture. That path skips manifest loading and supplies an empty driver list to assertRecoveryDriversExited, before resumeUpdateRecoveryRetirement removes metadata and directories. The receipt validates identity and outcome but does not preserve the original driver exclusion. (src/commands/doctor-update-recovery-resolution.ts:94, 4146d06f8a32)
  • Capacity and legacy-plugin blockers remain: Capacity admission recursively inventories the entire installation root and reserves twice its bytes. Rehearsal requests requireDeclaredResources, whose collector throws for shipped migrations without declarations. Both mechanisms remain on the pinned head. (src/plugins/doctor-migration-resources.ts:22, 4146d06f8a32)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test growth production net +8,131 LOC; tests/support net +5,011 LOC Capture, restoration, and lifecycle responsibilities explain the growth, while the recorded split plan remains necessary for reviewing their composition.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: This work addresses failed-update recovery that can leave an incompatible runtime or lose persistent state.
  • merge-risk: 🚨 compatibility: The pinned branch rejects shipped plugins without resource declarations and leaves fresh and existing-state upgrade qualification incomplete.
  • merge-risk: 🚨 session-state: Baseline restoration can erase newer rows, resurrect acknowledged deliveries, and lose displaced resource bytes.
  • merge-risk: 🚨 security-boundary: Resumed retirement drops original-driver exclusion before protected filesystem deletion.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (87 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-24T23:02:48.822Z sha 4146d06 :: needs real behavior proof before merge. :: [P1] Preserve writes made after capture during rollback | [P1] Retain candidate resources until the whole restore publishes | [P1] Scope capacity admission to the recovery footprint | [P1] Capture fresh-state Doctor writes before initialization | [P1] Honor shipped plugins without resource declarations | [P1] Recheck original drivers before resumed capture deletion
  • reviewed 2026-09-25T06:41:08.567Z sha 4146d06 :: needs real behavior proof before merge. :: [P1] Preserve writes made after capture during rollback | [P1] Retain candidate resources until the whole restore publishes | [P1] Scope capacity admission to the recovery footprint | [P1] Capture fresh-state Doctor writes before initialization | [P1] Honor shipped plugins without resource declarations | [P1] Recheck original drivers before resumed capture deletion
  • reviewed 2026-09-25T07:19:20.592Z sha 4146d06 :: needs real behavior proof before merge. :: [P1] Preserve writes made after capture during rollback | [P1] Retain candidate resources until restore completes | [P1] Scope capacity admission to the recovery footprint | [P1] Capture fresh-state Doctor writes before initialization | [P1] Honor shipped plugins without resource declarations | [P1] Recheck original drivers before resumed capture deletion
  • reviewed 2026-09-25T07:55:18.720Z sha 4146d06 :: needs real behavior proof before merge. :: [P1] Preserve writes made after capture during rollback | [P1] Retain candidate resources until the whole restore publishes | [P1] Scope capacity admission to the recovery footprint | [P1] Capture fresh-state Doctor writes before initialization | [P1] Honor shipped plugins without resource declarations | [P1] Recheck original drivers before resumed capture deletion
  • reviewed 2026-09-25T10:47:23.042Z sha 4146d06 :: needs real behavior proof before merge. :: [P1] Preserve post-capture writes during rollback | [P1] Keep candidate resources until the whole restore publishes | [P1] Scope capacity admission to the recovery footprint | [P1] Capture fresh-profile Doctor writes before initialization | [P1] Honor shipped plugins without resource declarations | [P1] Recheck original drivers before resumed capture deletion
  • reviewed 2026-09-25T11:16:46.170Z sha 4146d06 :: needs real behavior proof before merge. :: [P1] Preserve writes made after the capture | [P1] Retain candidate resources until restore completes | [P1] Scope capacity admission to the recovery footprint | [P1] Capture fresh-profile Doctor writes before initialization | [P1] Honor shipped plugins without resource declarations | [P1] Recheck original drivers before resumed capture deletion
  • reviewed 2026-09-25T11:33:43.309Z sha 4146d06 :: needs real behavior proof before merge. :: [P1] Preserve writes made after the capture | [P1] Retain candidate bytes until the full restore succeeds | [P1] Limit capacity inventory to protected recovery inputs | [P1] Capture fresh-profile Doctor writes before initialization | [P1] Honor shipped plugins without resource declarations | [P1] Recheck original drivers before resumed capture deletion
  • reviewed 2026-09-26T09:58:45.869Z sha 4146d06 :: needs real behavior proof before merge. :: [P1] Preserve writes made after the capture | [P1] Retain candidate bytes until the full restore succeeds | [P1] Limit capacity inventory to protected recovery inputs | [P1] Capture fresh-profile Doctor writes before initialization | [P1] Honor shipped plugins without resource declarations | [P1] Recheck original drivers before resumed capture deletion

Reviewed October 2, 2026, 5:24 PM ET / 21:24 UTC (Revision 88).

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 10, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 10, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer note: this PR is being re-scoped onto the lossless-capture contract accepted on #140339 (#140339 (comment) and #140339 (comment)) so it lands as the first capture-and-restore slice rather than a parallel design.

Concretely: recovery sets move under the private sibling root <stateDir>.update-captures/<captureId>/ with the privacy marker from #143899, so the export/backup exclusion from #143799 covers them; count-based retention goes away in favor of transaction-scoped retirement through the lifecycle owners from #143791 and #143921 (unresolved sets are never pruned, one unresolved set blocks another protected mutation); capacity admission runs before the protected mutation. Package mutation files stay reserved to #143750/#143752.

@fuller-stack-dev @vincentkoc: your prerequisites are reused, not replaced. If either of you has an in-flight capture/restore slice, say so here so we do not race; otherwise this PR is the vehicle and review is welcome once the re-scoped head is pushed.

@Glucksberg

Copy link
Copy Markdown
Contributor

Independent Linux evidence for one pre-Doctor race that may be worth adding to this PR's Git matrix.

On a source checkout driven by 2026.9.1, the updater stopped the managed Gateway at 2026-09-10T01:07:51Z and then mutated/built the checkout. A host-local watchdog restarted openclaw-gateway.service at 01:08:17Z while that build was in progress. The intermediate Gateway eventually started from the target checkout and logged:

2026-09-10T01:09:49Z [state/db] state database schema migration pending; verifying integrity first

A retained SQLite backup confirms schema_meta.primary = schema 17, app 2026.9.3, updated_at=1789002589993 (01:09:49.993Z). The updater's own Doctor had not begun, so its local stateMigrationStarted flag was still false. Its later build failure/rollback restored the 2026.9.1 source/runtime, whose Gateway then repeatedly failed with:

OpenClaw state database ... uses newer schema version 17; this build supports 15.

The important variant is that the persistent migration was performed by an out-of-band Gateway start, not by the updater's Doctor. The Git rollback guard in both the shipped 2026.9.1 code and current main is based on the updater-local stateMigrationStarted boolean, so it cannot observe this race.

PR #144005 creates the recovery set before mutation, which is the right recovery material. However, I could only find that reference passed into the Git Doctor path; the pre-Doctor build-failed path still appears to perform its direct source/runtime rollback without consuming the recovery set.

Suggested regression/fence:

  1. create the verified recovery set;
  2. simulate an external process migrating live state before Git Doctor starts;
  3. fail the Git build or another pre-Doctor step;
  4. require either package/source + state restoration from that set, or a conservative refusal to restore the older code.

This is not a request to support arbitrary watchdog behavior. It is evidence that process-local migration bookkeeping alone is insufficient to prove a code-only rollback safe. We have fixed the local watchdog to suppress restarts while the Nurse or a live update-ledger owner is active.

@steipete
steipete force-pushed the steipete/upd-backup-rollback branch from 2cd888b to 7856fc6 Compare September 10, 2026 20:22
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. label Sep 10, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

Private #144005 preparation. Preserve public PR history and current main
as the only parents; no private union or projection history.

136 attributed paths with three reviewed main-drift adaptations.
Not publication-ready: first-boundary dependency closure remains open.
…eceipts

Preserve existing PR ancestry and reviewed main adaptations. Keep operational recovery receipts exact within the existing origin byte limit; refuse oversized writes atomically. Preserve all upper preservation/native acceptance dependencies.
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review September 21, 2026 16:16
Keep recovery authority unchanged. Break extracted test type cycles, move the unchanged config write-option helper, and repair stale finalizer and Doctor mocks and assertions. Isolate mutation tests from the shared handoff store. Preserve pending no-loss composition and native acceptance.
Keep real capability inspection and child custody transport. Preserve completion-cache assertions; upper composition qualification remains required.
Reuse the canonical retained-step predicate, remove unused duplicate schema, and extract config include-conflict fixture without reducing coverage. Keep migration helpers within plugin SDK boundaries and required refusal-test braces. Preservation and native acceptance remain open.
Preserve retained snapshots and aggregate inspection and cleanup errors before
forward schema admission can complete. Keep the nine audited regressions,
including deferred settlement and real retained-reader refusal.
@steipete

Copy link
Copy Markdown
Contributor Author

Closing the parked combined capture/restore proposal. Its full rollback and newer-write preservation guarantees remain unqualified, and current main has a different manual-capture and backup recovery contract (#178629). Any future automatic no-loss rollback work needs a focused design and implementation against those current owners.

Closed in a sweep of maintainer PRs open longer than a week. Reopen with a current reproduction if this still matters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: line Channel integration: line channel: matrix Channel integration: matrix channel: msteams Channel integration: msteams channel: nostr Channel integration: nostr channel: reef Channel integration: reef channel: voice-call Channel integration: voice-call channel: zalouser Channel integration: zalouser cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: acpx extensions: active-memory extensions: browser extensions: canvas extensions: codex extensions: crabbox extensions: memory-core Extension: memory-core extensions: memory-lancedb Extension: memory-lancedb extensions: memory-wiki gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. plugin: workboard rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants