Skip to content

fix: verify Gateway recovery after update finalization fails - #153178

Merged
steipete merged 14 commits into
mainfrom
upd/95-post-update-phases
Sep 21, 2026
Merged

steipete merged 14 commits into
mainfrom
upd/95-post-update-phases

Conversation

@steipete

@steipete steipete commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: update finalization reports runtime-verification-failed and unavailable health without checking a Gateway that is still serving.

Fixes #152811, fixes #152788, fixes #152742, fixes #153000, fixes #152974.

These closures address the missing recovery observation and health reporting; the underlying finalization refusals are not all resolved. Before=After=2026.9.5 can identify an up-to-date invocation or a retry. An ordinary 9.4 handoff preserves Before=9.4, so the version pair alone does not prove a package mutation.

User Impact

Ordinary post-update and standalone-finalizer failures observe the installed Gateway and report its actual version, build, and readiness. Healthy service is recorded as verified recovery. The original failure and explicit unsafe-restart constraints remain visible. Stale history cannot hide a fresh failure, and a losing terminal publisher cannot rewrite the winning receipt. JSON retains the actual persisted run.

Integrated main owner: #153147. Standalone finalization now uses main’s maintenance custody to park and restore the Gateway. Main also owns admitted-run terminal report publication after executor settlement and the shared failed-step predicate. L853 retains recovery observation, which main does not provide, after restoration/child settlement and before publication. Related #152466 owns Gateway-initiated RPC handoff; #152976 explains maintenance refusals.

Thanks to @0-danielviktorovich-0, @wlassalle724, @neangneatos, @ZSmallX and @hxy8241 for the reports.

Why This Change Was Made

The recovery observer uses the shared progress-aware readiness owner after writers settle. Expected identity comes from the installed package and the endpoint from the inspected lock/service context. The existing ledger writer atomically records observed health, proof and recovery. One projection/formatter serves immediate output, guidance and sanitized public reports; public redaction stays at its existing boundary.

The CI repair rebases the accepted a151c1883f5 source from merge-base 2a541edb0d15a21f47bfe7cf8367c6bd45e518e9 onto fa85b5b237a83db19b33576d50833b1569c0f4e0. The conflict in update-command-repair.ts preserves main #153188’s single retained-canary flow and one-time reuse of completed checks. The existing uncertain-cleanup classification now also protects the retained private copy in the outer cleanup owner. Its child must settle before either fresh or retained rehearsal cleanup; no parallel repair or probe policy was introduced. Main’s wire-limit redaction correction remains intact. The second rebase moves from fa85b5b237a83db19b33576d50833b1569c0f4e0 to 09e3e54280f8e2ffa3145811f6be4b3fe8e84acb, integrating #150898 (244450952c0). Its service-reconciliation warnings, pending outcome, retained service identity and port, and unverified-definition refusal stay canonical. The native failed-state reader moves into its verification owner; the existing recorder shares that reader and retains the service caller’s original live-executor assertion before writing. After a cross-install rollback, observation uses the restored service’s retained root while the requested package result keeps its own root and package identity. The added finalization regression reproduced the merge defect: healthy service A at 0.9.0 was incorrectly re-recorded as package B at 1.0.0 (one failure, two same-install controls passed).

CI failure causes and repairs

Failed check / contract Cause and canonical repair
Runtime topology architecture UpdateRunResult.verification introduced a type cycle through the record module. Derive it directly from the existing schema contract. Both runtime and Madge cycle checks are required.
Post-swap module outcomes The strict VM fixture did not load the new cleanup/recovery/reporting dependencies. It now executes the real owners with finite synthetic I/O; failed status, retained backup bytes, and exactly one restart remain required.
CLI post-core failures A read-only healthy observation must preserve explicit unsafe restart authority. The observer, atomic ledger writer and projection retain that constraint. Uncommitted fresh target finalization now records its unsafe verdict at convergence, preserving handoff exit 79. Unexpected plugin/npm exceptions still fail, and interrupted Git mutation still leaves the stopped Gateway down.
Restored package versus requested Git target The service owner could recover an untouched package while observation checked the failed Git target. Observe the retained service root selected by recovery; preserve the requested result root and original failure.
Live recovery run / noisy process output Fixtures omitted installed identity or the additional recovery receipt. The live-run test supplies observed identity at the shared readiness seam while exercising real verification and ledger publication. Noisy output checks all 40 original steps and the complete added receipt before process exit.
Doctor/phase stall output The fixture reached the normal generous recovery probe budget after its simulated phase settled. It now passes its existing nine-second CLI timeout for recovery while retaining the original one-second blocked-phase override. No production budget or test timeout is widened. Doctor failure reports the observed not-serving result instead of an unobserved recovery label.
Deferred completion Invalid-config finalization reached an unmodeled Gateway observation. The fixture returns stopped/free at the shared readiness boundary, retaining the real verifier and ledger, rejection, and no-config-write assertions.

Additional receipt assertions are intentional contract updates: recovery observation is now recorded, so failed results contain the original failure plus a complete observation receipt. Arrays were not loosened to partial matches. Second-rebase validation caught a missing mapper import in the moved reconciliation-warning writer: the original warning-ledger assertion failed because the writer’s catch converted the resulting ReferenceError into a recording warning. The import is restored at that owner. The native-state executor-replacement regression also failed pre-fix (one unauthorized verification write; 19 internal control cases passed); the recorder now invokes its caller’s original live-authority assertion immediately before the ledger write. Four synthetic CLI cases explicitly model absent build metadata so a local checkout’s generated build ID cannot alter their expected failure facts. Two coherent test blocks and receipt fixtures were extracted without changing case order to keep the large CLI file within its existing line-count ratchet.

Main’s official-plugin drift repair (#153027), unpinned runtime selection (#153386), and delivery-queue shutdown drain (#152379) remain with their existing owners. No duplicate repair, retry, readiness or shutdown policy was introduced. The prior test-only line-cap extraction still preserves all 44 lifecycle cases and their order.

Earlier conflicts in update-command-post-update.ts and update-command-result.ts kept main’s committed-record capture and guidance input, with failed recovery observed before final capture. Main’s readiness/supervisor owners, pending authority, original-service compensation from #145335, no-implicit-finalization-deadline behavior and live handoff authority reuse remain intact.

Main’s original-service compensation remains authoritative: restoring the original installation does not verify activation of the requested installation, even when both have the same version/build. The finalizer consumes that typed outcome and still adopts any cleanup failure. Existing verified-rollback semantics share one predicate with reporting; captured-success and live-running progress behavior remain intact.

The absorbing pass removed duplicate observation envelopes/conversions, lifecycle history/mode/reason reconstruction, private raw/recorded merging, a parallel legacy formatter and a speculative nested cleanup guard. No options, environment variables, SQLite schema or dependency changes or suppressions were introduced. The explicitly approved Control UI startup budget exception is documented in Evidence.

Earlier main-owner fold (8b66b8ad0af)

Rebased accepted 9881e00bfaf694543d9c412f4921e1d3a3648763 from merge-base 09e3e54280f8e2ffa3145811f6be4b3fe8e84acb onto fcc927f58d020ea6c6cac50ae2041ab4b68270ed. The seven conflicts were resolved at the existing owners.

  • Main’s ownsUpdateRun custody decision controls standalone Doctor maintenance; inherited finalizers retain the parent’s custody. The shared recovery observer runs only after restoration and command settlement.
  • Removed the branch’s pre-main eager unexpected-failure terminalization and synchronous report path. Main’s deferred terminal publisher and awaited printResult/report artifact writer are the only publishers; L853 supplies the observed facts and shared projection. The actual persisted row stays intact in JSON.
  • Replaced the old collection of reconciliation IDs with fix(update): report historical repair acknowledgments accurately #153291’s boolean acknowledgment result. Only successful convergence acknowledges history, and JSON lists newly acknowledged IDs. No parallel acknowledgment path remains.
  • Main’s isFailedUpdateStep owns classification, including exit-zero inspections with failure facts. Its bounded Doctor receipts and complete redacted report findings remain intact.
  • The standalone observation was retained: current main still does not perform that probe. A strengthened existing Doctor-failure test proves maintenance restoration/release precedes the real verifier and atomic ledger outcome. Both cases fail against the accepted pre-fold finalizer.

Final source for this fold: 8b66b8ad0afa346de556b867bcd979e5d9714e18. 497 tests passed across 18 complete suites, plus both extracted selector cases. The custody/observation regressions failed twice against accepted 9881e00bfaf and passed after the fold. Full pnpm check:changed --base fcc927f58d020ea6c6cac50ae2041ab4b68270ed and pnpm check:architecture passed; runtime and Madge cycle counts are both zero. Fresh full-PR Codex P1 autoreview is scoped-clean. All 61 source hashes remained unchanged through checks, review and commit hooks. No live rig was rerun for this owner fold; historical proof remains qualified below.

Production versus accepted 9881e00bfaf scoped files is +245/−115 (net+130), entirely inherited main changes. Against new main the PR remains +811/−244 (net+567) production. Tests/support are +2601/−475 (net+2126); docs +11. The previous CI repairs are accepted; this fold adds no authored production growth.

Every production hunk forced by the main owner cutover
File:line Hunk LOC Reason
src/cli/update-cli/progress.ts:4 +1/−0 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:6 +1/−0 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:8 +1/−0 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:19 +1/−0 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:21 +0/−1 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:54 +9/−0 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:89 +1/−1 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:112 +16/−3 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:141 +1/−1 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:143 +1/−1 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:147 +1/−1 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:157 +1/−1 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:179 +1/−12 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:183 +1/−14 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:192 +4/−1 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:221 +8/−14 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:231 +1/−1 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:238 +1/−0 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:240 +1/−1 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:243 +3/−5 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:253 +13/−0 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/progress.ts:271 +3/−0 Main owns bounded history reads, progress disposal, failure classification, and awaited report-artifact publication; L853 only supplies the shared recovery projection.
src/cli/update-cli/update-command-finalize.ts:161 +1/−1 Main supplies standalone maintenance custody through ownsUpdateRun.
src/cli/update-cli/update-command-finalize.ts:275 +1/−1 Main supplies standalone maintenance custody through ownsUpdateRun.
src/cli/update-cli/update-command-finalize.ts:323 +1/−1 Main supplies standalone maintenance custody through ownsUpdateRun.
src/cli/update-cli/update-command-finalize.ts:443 +1/−5 Use main’s boolean acknowledgment result; collect only newly acknowledged historical IDs, after successful convergence.
src/cli/update-cli/update-command-finalize.ts:450 +3/−1 Use main’s boolean acknowledgment result; collect only newly acknowledged historical IDs, after successful convergence.
src/cli/update-cli/update-command-result.ts:36 +1/−1 Keep main’s failure-result factory, async pending/admission reporting, and isFailedUpdateStep predicate; preserve recovery guidance input.
src/cli/update-cli/update-command-result.ts:187 +1/−1 Keep main’s failure-result factory, async pending/admission reporting, and isFailedUpdateStep predicate; preserve recovery guidance input.
src/cli/update-cli/update-command-result.ts:193 +1/−1 Keep main’s failure-result factory, async pending/admission reporting, and isFailedUpdateStep predicate; preserve recovery guidance input.
src/cli/update-cli/update-command-result.ts:316 +1/−1 Keep main’s failure-result factory, async pending/admission reporting, and isFailedUpdateStep predicate; preserve recovery guidance input.
src/cli/update-cli/update-command-result.ts:363 +1/−1 Keep main’s failure-result factory, async pending/admission reporting, and isFailedUpdateStep predicate; preserve recovery guidance input.
src/cli/update-cli/update-command-result.ts:366 +2/−5 Keep main’s failure-result factory, async pending/admission reporting, and isFailedUpdateStep predicate; preserve recovery guidance input.
src/cli/update-cli/update-command-result.ts:435 +1/−1 Keep main’s failure-result factory, async pending/admission reporting, and isFailedUpdateStep predicate; preserve recovery guidance input.
src/cli/update-cli/update-command-run.ts:378 +1/−1 Return unexpected failure facts without eager terminalization; main’s deferred terminal owner closes the run after settlement.
src/cli/update-cli/update-command-run.ts:383 +1/−1 Return unexpected failure facts without eager terminalization; main’s deferred terminal owner closes the run after settlement.
src/cli/update-cli/update-command-run.ts:387 +1/−1 Return unexpected failure facts without eager terminalization; main’s deferred terminal owner closes the run after settlement.
src/cli/update-cli/update-command-run.ts:416 +1/−1 Return unexpected failure facts without eager terminalization; main’s deferred terminal owner closes the run after settlement.
src/cli/update-cli/update-command-terminal.ts:5 +4/−1 Use main’s unexpected-failure publisher and awaited report output after settlement; retain L853’s uncertain-cleanup exclusion.
src/cli/update-cli/update-command-terminal.ts:26 +1/−0 Use main’s unexpected-failure publisher and awaited report output after settlement; retain L853’s uncertain-cleanup exclusion.
src/cli/update-cli/update-command-terminal.ts:34 +1/−1 Use main’s unexpected-failure publisher and awaited report output after settlement; retain L853’s uncertain-cleanup exclusion.
src/cli/update-cli/update-command-terminal.ts:65 +38/−0 Use main’s unexpected-failure publisher and awaited report output after settlement; retain L853’s uncertain-cleanup exclusion.
src/cli/update-cli/update-command-terminal.ts:461 +1/−1 Use main’s unexpected-failure publisher and awaited report output after settlement; retain L853’s uncertain-cleanup exclusion.
src/cli/update-cli/update-command-terminal.ts:466 +1/−1 Use main’s unexpected-failure publisher and awaited report output after settlement; retain L853’s uncertain-cleanup exclusion.
src/cli/update-cli/update-command-terminal.ts:475 +1/−1 Use main’s unexpected-failure publisher and awaited report output after settlement; retain L853’s uncertain-cleanup exclusion.
src/cli/update-cli/update-command-terminal.ts:489 +1/−1 Use main’s unexpected-failure publisher and awaited report output after settlement; retain L853’s uncertain-cleanup exclusion.
src/cli/update-cli/update-command-triage.ts:3 +1/−4 Use main’s single triage/report artifact writer; remove the former command-layer writer import.
src/cli/update-cli/update-command-triage.ts:8 +1/−0 Use main’s single triage/report artifact writer; remove the former command-layer writer import.
src/cli/update-cli/update-finalization-lifecycle.ts:89 +4/−0 Expose main’s existing ownsUpdateRun custody fact; retain the standalone recovery observer.
src/infra/update-failure-report-prepare.ts:19 +1/−0 Keep main’s shared zero-exit failure predicate and normalized Doctor finding diagnostics alongside L853’s recovery formatter/projection.
src/infra/update-failure-report-prepare.ts:42 +1/−0 Keep main’s shared zero-exit failure predicate and normalized Doctor finding diagnostics alongside L853’s recovery formatter/projection.
src/infra/update-failure-report-prepare.ts:150 +0/−3 Keep main’s shared zero-exit failure predicate and normalized Doctor finding diagnostics alongside L853’s recovery formatter/projection.
src/infra/update-failure-report-prepare.ts:153 +3/−1 Keep main’s shared zero-exit failure predicate and normalized Doctor finding diagnostics alongside L853’s recovery formatter/projection.
src/infra/update-failure-report-prepare.ts:159 +1/−1 Keep main’s shared zero-exit failure predicate and normalized Doctor finding diagnostics alongside L853’s recovery formatter/projection.
src/infra/update-failure-report-prepare.ts:262 +14/−0 Keep main’s shared zero-exit failure predicate and normalized Doctor finding diagnostics alongside L853’s recovery formatter/projection.
src/infra/update-run-ledger.ts:269 +3/−2 Keep main’s acknowledgment writer returning whether a new acknowledgment was inserted; no outcome rewrite.
src/infra/update-run-ledger.ts:284 +1/−0 Keep main’s acknowledgment writer returning whether a new acknowledgment was inserted; no outcome rewrite.
src/infra/update-run-ledger.ts:289 +1/−0 Keep main’s acknowledgment writer returning whether a new acknowledgment was inserted; no outcome rewrite.
src/infra/update-run-step.ts:8 +16/−14 Keep main’s canonical failure predicate and bounded Doctor receipt conversion; retain recovery-verification pending detection.
src/infra/update-run-step.ts:38 +1/−0 Keep main’s canonical failure predicate and bounded Doctor receipt conversion; retain recovery-verification pending detection.
src/infra/update-run-step.ts:75 +1/−1 Keep main’s canonical failure predicate and bounded Doctor receipt conversion; retain recovery-verification pending detection.
src/infra/update-run-step.ts:82 +1/−1 Keep main’s canonical failure predicate and bounded Doctor receipt conversion; retain recovery-verification pending detection.
src/infra/update-run-step.ts:86 +9/−0 Keep main’s canonical failure predicate and bounded Doctor receipt conversion; retain recovery-verification pending detection.
src/infra/update-run-step.ts:122 +44/−0 Keep main’s canonical failure predicate and bounded Doctor receipt conversion; retain recovery-verification pending detection.
src/infra/update-runner-types.ts:13 +1/−0 Retain main’s Doctor finding fields and imported contract; keep L853 schema-derived verification typing.
src/infra/update-runner-types.ts:21 +1/−1 Retain main’s Doctor finding fields and imported contract; keep L853 schema-derived verification typing.
src/infra/update-runner-types.ts:35 +1/−0 Retain main’s Doctor finding fields and imported contract; keep L853 schema-derived verification typing.
src/infra/update-runner-types.ts:43 +1/−0 Retain main’s Doctor finding fields and imported contract; keep L853 schema-derived verification typing.
src/infra/update-runner-types.ts:76 +1/−0 Retain main’s Doctor finding fields and imported contract; keep L853 schema-derived verification typing.

Evidence

R6: snapshot-result CI failure ownership

Main-side test-harness leak, already fixed by #154206 (93d69d5a747432362027bbdf71eb06c96aac6eb6). No PR product or test changes were made in this diagnosis; head remains 456dad686f192090b05b98ca71b0cf4e163839fb. The saved red job was checks-node-compact-large-5, job 106176092707, group core-unit-src-security-3. Its log also contains a fifth failure in src/flows/doctor-health.unsupported-state.test.ts, whose captured diagnostic includes the same snapshot error.

CI actually checked out merge 3ec430b8f6220931a996f07897b78169caaf750b (PR head plus main parent 21688de06dae3c44fdff7b3eaa54a6a889eb460b). Its failing snapshot owners, Claws files, shared read pool, test lifecycle, and CI grouping bytes are unchanged from that main parent. The offending predecessor, src/state/openclaw-state-db-readonly.error-mapping.test.ts, was added by main #151175 (76b636db6cb) and does not exist in the bare PR head.

The non-isolated runner retired the state database lifecycle but retained Symbol.for("openclaw.stateReadWorkers"). A later file could create a pool in that old wrapper without attaching its cleanup to the new lifecycle. The error-mapping fixture's pool closes over a mock returning successful fleet.list replies; a later real workspace.snapshot request receives that wrong discriminator and correctly throws at workspace-state-store.ts:81. The canonical fix adds the read-pool singleton to the existing retirement map after drainage. The production reply schema and its guard stay unchanged. #154176 (746f30678f9) addresses stale inode/admission binding; it does not explain this successful wrong-operation reply.

Blacksmith Testbox matrix, Node 24.19.0, automatic no-output retries disabled:

Cell Result Command wall
PR 456dad686f1, both requested files 5 passed / 2 files 22.579 s
Main 5941d999dc72e84e3f27d3a73969e485ed6c889c, both files 5 passed / 2 files 19.233 s
Original CI merge, saved 218-file group and two workers 2,841 passed / 16 skipped 161.793 s
Same CI merge/group with only #154206's retirement entry 2,841 passed / 16 skipped 153.012 s

The original group was replayed first through node --import tsx scripts/ci-run-node-test-shard.mts using its recorded group JSON and worker count. Its completion ordering diverged from CI after the first 37 files, so that passing replay did not reproduce or dismiss the failure. The focused command was node scripts/run-vitest.mjs src/claws/read-only-state-compat.test.ts src/claws/update-plan-readiness.test.ts.

Causality was then proved with #154206's existing native ordered regression, keeping its test and fixture files identical in both cells and changing only the one-line retirement map entry on the CI merge source. node scripts/run-vitest.mjs test/non-isolated-runner.sqlite.test.ts --config test/vitest/vitest.tooling.config.ts failed before the fix with the exact Unexpected workspace state snapshot result error (generation C; 3.657 s command wall) and passed afterward (one outer test validating all five ordered fixtures; 4.113 s command wall, 2.259 s test time). No timeout, assertion, worker policy, or result schema was changed for this proof.

Proof leases: tbx_01m30s6q5gky588mzs9cdw11yn (matrix run 35550962006) and tbx_01m30tcj4qn14b1n9ptpmevpgh (deterministic regression run 35552084847). Both leases stopped; both matrix procedures completed with provider exit 0, while the intentional pre-fix cell's exit 1 is recorded above. The second procedure reported a portal-sync deadline warning after successful execution and lease cleanup. The Testbox CLI result is authoritative; backing Actions steps can show cancellation during owned cleanup.

No GitHub job was rerun and no unchanged source was repushed. The next landing tree must contain the already-landed #154206 owner fix; this diagnosis does not turn the old merge tree's red CI into a green result.

R5: ledger read-kernel rebase

Rebased fleet head ec18c4182bb7b4296886a32b255e930b3c908ebf from merge-base e4c99c838a8783a9e15a8d459d09405e0eb037b3 onto pinned main 1dc0b5d579b2c3a33ed38518e693836e0160f57c. New head: 456dad686f192090b05b98ca71b0cf4e163839fb.

Main #153660 (bafb952c17814df823ce0e4d7aed3eeb6bdcf986) moves asynchronous history queries to the shared read worker and synchronous query/decoding functions to update-run-read.kernel.ts. The sole manual conflict was the import block in src/infra/update-run-write.ts:8: retain main's codec encoder/type import and kernel decoder/reader import, then retain the recovery finalization imports. The complete writer implementation below the imports is byte-identical to the fleet head. Recovery identity, observed-health recording, terminal receipt preservation, and shared reporting therefore keep the same single atomic writer; no second writer or policy was added.

The scoped production interdiff is two files, not one: src/infra/update-run-write.ts +2/−7 (manual import resolution) and src/infra/update-run-ledger.ts +2/−6 (main's automatic matching import migration). Total +4/−13, net −9, entirely the existing read-kernel cutover; no authored behavior or test changes. Other raw branch interdiff files are inherited main changes. Full PR totals remain +889/−313 production (net +576), +2606/−478 tests/support, +11/−0 docs, +4/−4 budget/config/tooling.

Focused proof passed on Blacksmith Testbox tbx_01m30kggf7e012jcwsh9qjj13r, run 35545705994, Node 24.19.0: 199 tests in eight files, four shards, 88.96 seconds for the test phase. The source receiver verified source 456dad686f192090b05b98ca71b0cf4e163839fb, and explicit SHA-256 checks passed for the writer, read kernel, ledger facade, finalizer, and recovery owner. The one-shot lease stopped successfully. Provider exitCode=0 / runStatus=succeeded is the Testbox result; its backing Actions step may show cancelled during owned lease cleanup.

The command used CI=1 OPENCLAW_VITEST_NO_OUTPUT_RETRY=0 node scripts/run-vitest.mjs with complete files src/infra/update-run-ledger.test.ts, src/infra/update-run-diagnostics.test.ts, src/infra/update-run-reader.test.ts, src/cli/update-cli/update-command-lifecycle.test.ts, src/cli/update-cli/update-command-failure-recovery.test.ts, src/cli/update-cli/update-command-verification.test.ts, src/cli/update-cli/update-command-verification-report.test.ts, and src/cli/update-cli/update-command-post-update-recovery.test.ts. No assertion, test timeout, or baseline changed.

Fresh full-PR P1 autoreview is scoped-clean. Full node scripts/check-changed.mjs --base 1dc0b5d579b2c3a33ed38518e693836e0160f57c passed, including zero runtime import cycles; only the four existing unrelated max-lines warnings remain. The first remote-wrapper attempt stopped locally before allocation because installed dependencies predated the rebased lockfile; a frozen install restored the committed dependencies and the single subsequent Testbox invocation passed. No dependency manifests were authored in this rebase.

Current main-owner integration and validation

Publication head: 0c599cec22a73aa6a50a7fcae3feba76503d4ac7. At the owner-fold checkpoint, rebased the prior published bc3ef6e0d62adf21483d3d07758bbf9eda65ff9f onto main 8fa37cb788835d72dbe168f5d41652f216788daf. The round-4 budget commit was completed with the requested message, but main advanced before attachment; #153425 (516ea8325aa) then introduced the three owner conflicts below. #153784's missing-run admission and canonical lease-path reuse are inherited unchanged.

Conflict file Resolution
config/control-ui-startup-budget-baseline.json (round 4) Preserve the measured baseline through replay, then apply the approved measured 365,172 → rounded 365,261 B adjustment; do not add main's separate 32 B allowance again.
src/cli/update-finalization-output.process.test.ts Keep main's public finalize-doctor ID and the complete observed-recovery receipt/health assertions.
src/infra/update-failure-report-prepare.ts Keep main's released-key joins and public-ID owner; retain the shared recovery projection/formatter and remove the obsolete local phase inventory.
src/infra/update-run-write.ts Keep main's released-key normalization and L853's atomic observed-health/first-terminal-receipt behavior; reuse main's retry-diagnostic clearing instead of the former recovery-only special case.

The only additional owner entry is gateway recovery verification in main's existing update-step-identity.ts list. Its persisted key remains unchanged; its public ID is gateway-recovery-verification. The existing report/title/redaction table reproduced the missing registration: one case failed pre-fix, showing [redacted-command] instead of the recovery ID. No test seam, parallel formatter, alias table, or duplicate guard was added.

Budget proof used frozen main dependencies (Node 24.21.0, Vite 8.3.0, Pako 3.0.2, Zod 4.6.4); no manifest or lockfile changes are authored. The round-4 measurement was 365,172 B, rounded upward to 365,261 B (356.7 KiB). On the newer main snapshot the bundle measures 365,344 B, within the unchanged 365,837 B enforcement limit. The 512 B growth + 64 B build-variance allowances remain unchanged, and no second budget bump was made. The stale pre-install Pako 3.0.1 measurement was discarded.

Final PR production versus main is +889/−313 (net +576), five fewer net lines than the preceding +581. Across the prior PR's production files plus main's new identity owner, the raw delta versus the preceding head is +221/−38 (net +183): +188 inherited from main and −5 net authored integration. Tests/support are +2606/−478; docs +11/−0; budget/config/tooling +4/−4. Main's custody, terminal publication, report writing, readiness and ledger owners remain canonical.

At this owner-fold checkpoint, the full changed gate passed after fixing the test-only listUpdateRuns shadow with a fresh module namespace import; no assertions changed. The owner suites passed 461 tests in 12 files, and the deferred-completion file passed 18/18. Full-PR and final-delta P1 reviews were scoped-clean. Final-head validation is recorded in the final budget-conflict section below. Automatic no-output retries are disabled (OPENCLAW_VITEST_NO_OUTPUT_RETRY=0). The resumed round-4 checks were cancelled before any Vitest shard ran when the newer main conflicts were discovered; the final proof uses the new frozen source. No watchdog timeout is widened, no assertion is weakened, and no live recovery rig is claimed for this rebase. Historical proof qualifications remain below.

Final budget-conflict rebase

The full gate above completed before publication, while main advanced again. Final merge-base is f5ee0986606fa0b8f578bff8c2d4ba57be2e6dc3, advancing from 8fa37cb788835d72dbe168f5d41652f216788daf. Main #153416's contextual progress-ledger error and its two regressions are inherited unchanged. Among the 64 reviewed PR files, only that production file and its test differ from the previous reviewed checkpoint; the authored recovery code is byte-identical.

The two conflicts are config/control-ui-startup-budget-baseline.json:2 and scripts/check-control-ui-performance.mts:54: main #153238 raised its startup budget for cold clipboard-image custody. Its feature code stays intact. The superseded 54-byte and 364,954-byte budget commits were dropped during replay, retaining the single final chore(ui): refresh startup JS budget after rebase adjustment. The approved measurement remains 365,172 → baseline 365,261 B. The final combined tree measures 365,292 B and passes the unchanged 365,837 B enforcement limit; no second bump or additional margin was added. The existing 512 B growth + 64 B build-variance allowances are unchanged.

Production delta from the previous reviewed checkpoint is +8/−1 (net +7), entirely main's src/cli/update-cli/update-command-run.ts:417 progress-error context; authored production delta for this last rebase is 0. PR totals remain +889/−313 production (net +576), +2606/−478 tests/support, +11/−0 docs, and +4/−4 budget/config/tooling. Relative to the prior published head across the scoped production owners, the cumulative delta is +229/−39 (net +190): +195 inherited from main, −5 authored integration.

On final source 0c599cec22a73aa6a50a7fcae3feba76503d4ac7: the six complete finalize/budget files passed 232/232 tests (the prior 230 cases plus main #153416's two progress-ledger cases), with automatic no-output retries disabled and no watchdog timeout. Fresh full-PR Codex P1 autoreview is scoped-clean. The full node scripts/check-changed.mjs --base f5ee0986606fa0b8f578bff8c2d4ba57be2e6dc3 gate passed, including zero runtime import cycles; the three preexisting max-lines warnings remain outside the PR. The real Control UI base/candidate comparison passed at 365,292 B. These checks are final-source reruns; the earlier 461-case owner pass and 18-case deferred-completion pass are overlapping checkpoint evidence, not an additive coverage claim. No live recovery rig was rerun for this final rebase.

Earlier measured budget (bc3ef6e0d62)

Publication source: bc3ef6e0d62adf21483d3d07758bbf9eda65ff9f. All 63 reviewed source hashes remained unchanged through tests and commit hooks.

The second failure was caused by main drift, not demonstrated same-tree gzip nondeterminism. The jobs built different merge trees: 8a8c4b4f2f71 on main c739af6e46ba measured 364,828 B, while 19a358f7e75b on main 4292adb68a14 measured 364,922 B (+94 gzip / +357 raw B). Our intervening commit changed only the budget JSON. Main's startup-reachable UI change in that interval is #153359 (7d4725621e9, desktop-sharing defaults/settings). Main's baseline history still ends at #152510 (4b1c45066b1). The exact-main run 35516197859 for inspected ab5db5027365 was pending with no jobs when read; no passing current-main performance result is claimed.

Two consecutive unchanged-tree builds of be9f769da45 using the CI command pnpm ui:check-performance:base ab5db5027365fb6936f219af931445a92d844e47 both measured 364,644 B, with byte-identical manifests. The comparison owner pins build identity and uses Node 24.21.0, Vite 8.3.0 and Pako 3.0.1 for both revisions. Hypothesis (b) was not reproduced, so no gzip-flakiness follow-up is asserted.

Rebased onto main e4fd44c76d06cd70d5ac705b0b68d868fb2e99a0, from merge-base fcc927f58d020ea6c6cac50ae2041ab4b68270ed. The rebased tree measures 364,950 B = 356.396484375 KiB with the same comparison owner. Per Peter's ruling, round up to the displayed 0.1 KiB unit: 364,954 B = 356.4 KiB (four bytes of integer rounding). The recorded baseline rises 364,252 → 364,954 B; its fixed cap must rise 364,544 → 364,954 B to admit that measured baseline. The existing 512 B growth + 64 B build-variance allowances are unchanged. Consequently the effective limit is explicitly 364,828 → 365,530 B (356.3 → 357.0 KiB displayed). No additional margin was added.

The six conflict files keep main's foreground parking/publication, restart-pending receipt and backup retention. The shared recovery observer still runs before final capture; ordinary terminal facts use the single atomic ledger writer. Main's redundant-wrapper removal stays removed. Before line-cap closeout, twenty of the 26 existing production files remained byte-identical to be9f769da45; the other six inherited +129/−62 (net +67) from main. Against rebased main, that recovery patch was +812/−243 (net +569), a two-line accounting increase from main's overlapping wrapper/pending changes.

The full changed gate then found update-command-run.ts and update-command-post-update.ts at 703 counted lines against their 700-line cap. The coherent closeout moves failUpdateCommandRun byte-for-byte into the existing result owner, migrates its terminal caller/test import, and moves the Windows autostart resumption closure into the existing post-update maintenance module. The old implementations are removed; the same stopped-service snapshot, guard, restoration call and ordering are preserved. This mechanical extraction is +82/−70 production (net +12), without a suppression or line-cap baseline change. Final recovery production is +894/−313 (net +581); tests/support +2600/−473; docs +11/−0; explicitly approved budget JSON/checker +4/−4. The 20 unaffected accepted production files are still byte-identical.

Main-forced owner integration Reason
update-command-convergence.ts Park the foreground owner before runtime publication/Doctor, and retain main's runtime-change receipt.
update-command-post-update.ts Use main's parking callback and direct fenced guidance calls; only ok completes restart reconciliation.
update-command-result.ts Foreground completion suppresses native restart and requires successful sentinel publication.
update-command-run.ts Keep foreground admission and one normalization; pending foreground/helper runs stay open, ordinary completion remains atomic.
update-command-terminal.ts Retain the package backup until the foreground replacement verifies readiness.
update-run-write.ts Retain main's failure exit code in the existing diagnostic receipt.

Validation for this rebase and measured budget: full node scripts/check-changed.mjs --base e4fd44c76d06cd70d5ac705b0b68d868fb2e99a0 passed; runtime and Madge cycle checks both report zero; fresh full-PR Codex P1 autoreview is scoped-clean. The final owner-extraction/budget rerun passed 230 tests across six complete files (53 budget, 53 post-update, 55 recovery and 69 run/terminal cases), and the real-module outcome harness passed 20/20. Before the mechanical extraction, 288 tests across ten files passed; these are overlapping runs, not an additive coverage claim. The initial line-cap failure and its extraction are documented above. Three existing nonblocking max-lines warnings were outside the PR; no suppression or warning baseline was changed. The measured-asset performance check passes with the new baseline. No live recovery rig was rerun for this budget/rebase pass; the historical qualifications below remain unchanged.

Historical live-proof limitation retained. At c2c676fe2378, the published-driver handoff passed. The subsequent foreground Gateway did not become ready within the fixture’s 300-second startup bound, so neither recovery cell ran on that head. No live rig was rerun for this CI repair and rebase. No timeout extension, retry or product change was made in that live proof.

Cell Result and scope
Published macOS 9.5 baseline Same-version update returned reason post-update-plugins, empty verification and runtime-verification-failed while /readyz returned 200.
Published unavailable-plugin behavior Verified: published 9.5 exits 0 with a named warning on macOS and Linux. This behavior was already correct.
Published Linux/systemd Run 35454134141: normal update verified; unavailable Lobster target preserved the serving PID. Authenticated operator/read RPC, health RPC and readiness passed using the lease device identity. Published-package proof; not rerun on the final candidate.
Prior c2c676fe2378 published 9.5 → candidate PASS on c2c676fe2378, exit 0 in 3224.80 s. The unmodified published driver ran with a stopped Gateway and --no-restart; status ok, reported build ID and installed build-info bytes match the exact final artifact. The slow run is recorded without a speed assertion.
Previous macOS candidate failures/recovery Both the post-update plugin/Doctor refusal and standalone-finalizer refusal passed on the earlier 70c59c62007 source: the failure remained visible, exact-build healthy recovery was recorded, reports printed Recovery: verified serving, and authenticated RPC/readiness passed. Historical evidence; not substituted for a final-head rerun.
Prior c2c676fe2378 macOS failures/recovery NOT RUN: foreground startup precondition failed. The new foreground Gateway never satisfied the fixture’s 300-second readiness bound. It reached HTTP listening after 115.8 s of logged startup, with long event-loop stalls during model-runtime sidecar startup; the full process interval also included CLI bootstrap. Both recovery commands remained unexecuted.

Historical validation for accepted CI-repair candidate 9881e00bfaf694543d9c412f4921e1d3a3648763:

  • The complete second-rebase run executed 22 files: 1,122 passed, 1 failed. The failure exposed main’s moved warning writer losing its step-mapper import during replay; the existing assertion was retained and the import restored.
  • The final owner rerun passed 98 tests across five complete files, including the warning-ledger case, native recovery’s live-run assertion, and all 20 internal module-outcome cases. The last finalizer/terminal-outcome rerun passed 67 tests across two files after removing a redundant caller assertion. These are overlapping runs, not a claim of one uninterrupted all-green run.
  • All originally reported failing files have passing coverage. phase-hang, doctor-hang, doctor-progress, noisy-output drainage, unexpected post-core npm/plugin failures, stopped Git-mutation recovery, and validated deferred completion retain their observable contracts. Main’s cross-install reconciliation suites and the new restored-service-identity regression also passed.
  • Full pnpm check:changed --base 09e3e54280f8e2ffa3145811f6be4b3fe8e84acb: PASS (exit 0). Full pnpm check:architecture: PASS (exit 0), including 0 runtime cycles and 0 Madge cycles. No extension-lint substitution was needed. Line-cap, suppression, schema and dependency guards passed without baseline growth.
  • Fresh full-PR Codex P1 autoreview: scoped-clean, followed by a scoped-clean P1 closeout review after completing the managed-service mock with main’s required inspected-state fields. Production did not change between those reviews. The final two effective-port cases passed. Final source hashes bind all 61 changed files; no assertions were weakened.

The new ledger and report authority regressions fail on the original a151c1883f5 owner code: 2 failed / 1 passed control, for erased restart refusal and omitted report constraint. The corrected targeted recheck passed 13 cases across four files. Earlier full architecture checks passed with zero runtime and Madge cycles; final rebased checks are recorded above.

Local tests use the already-installed supported Node 24 toolchain, matching CI’s major version. Node 26 rejects the existing VM fixture’s stripTypeScriptTypes transform mode; no dependency or source workaround was added. An overlapping local test attempt was interrupted after checkout artifact-lock contention; owned processes were joined and task artifacts archived with marker/process checks before serialized validation. The final noisy-output correction reports absent installed identity before unrelated native-service discovery; its complete receipt assertion remains exact. No test timeout or production readiness budget was widened.

Earlier validated groups (748/22 files, 262/6, and 110/3 after test extraction) remain historical, overlapping proof; no new execution of those complete groups is claimed here.

No live rig or package acceptance cell was rerun for this CI repair and rebase. The earlier copied-Node fixture repair and live observations remain historical evidence, not proof of a new runtime artifact.

The runtime build and canonical package integrity check passed on c2c676fe2378. The 2026.9.5 artifact records commit c2c676fe2378f3bd09edd3d289918b75608e2977, build ID 2026.9.5-c2c676fe2378-2026-09-20T01-11-24.701Z and SHA-256 e3b5c5fe720ec1c629b48d6d68cbac1389daf75622afa5b41c1e18c010175a76; all 50 reviewed source hashes remained unchanged.

Runtime proof uses isolated state, owned Gateways and two verified APFS backups before package mutations. The fixture’s 300-second startup bound came from the startup-migration TTL; it is not the full shared progress-aware recovery budget. The log records about 103 s of event-loop delay and a later 89 s heartbeat interval, followed by a server shutdown reported complete in 36.733 s. That server log is not itself process-exit proof. Cleanup completed within the existing 330-second allowance: SIGTERM to the owned process, actual launcher exit, no remaining owned processes, no task locks and no listeners on runtime port 61704 (configured port 61440). No force signal was needed. The rows above identify the attempted historical cells; the Linux evidence remains historical.

LOC and accepted ownership

The accepted absorbing closeout was +735/−205 production LOC (net +530), down 85 net from the rebase-only patch. The coordinator accepted the remainder after reviewing every production hunk and requested no further cut or split.

Retained owner Accepted net LOC At a151c1883f5
Shared recovery observer +189 +192
Atomic ledger writer/facade +72 +73
Recovery formatter/projection module +79 +90
Standalone lifecycle hookup +41 +41

Accepted production before this CI repair was +778/−231 (net +547). The additional 17 net lines cover explicit diagnostic returns (+1), withholding newly inferred restart safety when history and recording both fail (+3), the main-compatible compensation adapter (+2), and fresh failure/identity projection with the shared rollback predicate (+11). First-terminal-writer preservation adds no net production lines. The adapter reuses immediate callee authority checks rather than duplicating them at the call sites.

The coordinator subsequently accepted the full net +547, including those 17 lines for reproduced review findings. The final accounting below separates this CI repair from inherited main changes. The required test-only extraction adds 35 net support lines without changing cases or assertions.

Before this CI repair, tests/support after main absorbed the import correction and portable Node fixture: +2024/−380 (net +1644). The earlier extraction added 35 net support lines. Docs: +11. All retained regression cases and assertions remain in the focused suites.

Historical CI-repair accounting (9881e00bfaf)

Against pinned main 09e3e54280f8e2ffa3145811f6be4b3fe8e84acb, final production is +811/−244 (net +567), 20 net lines above the accepted +547: CI owner fixes add two; protecting the retained rehearsal cleanup adds three; sharing the moved native-state reader/recorder while preserving the caller’s live assertion adds eleven; selecting the retained cross-install recovery root adds four; restoring main’s required warning step-mapper import adds one; reusing the terminal-capture owner’s authority assertion removes one redundant caller assertion. The installed-identity precondition moved ahead of native inspection without net growth. No further broad refactor or split was made.

Compared with the accepted a151c1883f5 production file bytes, +672/−378 (net +294) consists of +274 inherited from main and +20 authored repair/integration. Main’s existing owners remain authoritative. Tests/support: +2558/−474 (net +2084); docs: +11. The large CLI file remains smaller than its accepted version, and line-cap/suppression baselines are unchanged.

Landing review dispositions (2026-09-21, revision 18)

ClawSweeper revision 18 reviewed exact head 18dbb0ec06abc6de9f81ee26f2c31c2652f3e52e at 02:19 UTC and found no actionable introduced correctness or security defect. Its remaining data-model compatibility checkbox is skipped as not applicable: the review's own source analysis and maintainer inspection confirm that the existing synchronous writer and verification fields carry the observations, with no schema, schema-version, migration, serialized-field, or retention change. Existing ledger and integration regressions cover first-terminal-writer preservation, atomic observations, and retained unsafe-restart decisions.

The earlier request to state the installed-evidence disposition remains applied: this maintainer-directed landing accepts the documented historical installed recovery observations with the integration regressions for restoration, observation, and terminal publication. No final-head installed recovery run is claimed. The historical foreground-startup precondition failure and unexecuted recovery cells remain qualified above.

The designated round-5 Codex review of record is scoped-clean with no accepted/actionable P0/P1 findings. Its supplied-diff scope and inability to independently verify the earlier import-only rebase provenance remain limitations. The campaign's REST check-runs gate confirms completed green CI on 18dbb0ec06abc6de9f81ee26f2c31c2652f3e52e; native preparation and merge gates remain authoritative. This landing introduces no source changes, test reruns, baseline edits, or new budget allowance.

@clawsweeper

clawsweeper Bot commented Sep 19, 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 cli CLI command changes size: XL maintainer Maintainer-authored PR labels Sep 19, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 19, 2026
@clawsweeper

clawsweeper Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 20, 2026, 10:50 PM ET / September 21, 2026, 02:50 UTC (Revision 19).

ClawSweeper review

What this changes

The updater observes Gateway health after finalization failures, preserves restart restrictions, records recovery consistently, updates regression coverage and documentation, and refreshes the approved startup-size budget.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful fix absent from current main. No actionable introduced defect was found; the previous migration-proof concern does not apply to the unchanged storage contract, and the documented proof disposition resolves the remaining review follow-up.

Priority: P2
Reviewed head: 18dbb0ec06abc6de9f81ee26f2c31c2652f3e52e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A sound owner-level repair with meaningful regression coverage and accepted, explicitly qualified installed proof.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Historical installed macOS runs exercised post-update and standalone-finalizer failures, retained the failure, and reported verified serving with authenticated readiness. The body explicitly accepts those observations plus later restoration/publication regressions; the published-driver handoff is separately recorded, and no final-head installed recovery run is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Historical installed macOS runs exercised post-update and standalone-finalizer failures, retained the failure, and reported verified serving with authenticated readiness. The body explicitly accepts those observations plus later restoration/publication regressions; the published-driver handoff is separately recorded, and no final-head installed recovery run is claimed.
Evidence reviewed 8 items Pinned patch ownership: Reviewed the introduced merge-base-to-head delta. Raw test-merge parents match the pinned base followed by the exact PR head; base-only fixture changes were not attributed to this PR.
Recovery preserves restart constraints: The observer uses installed version/build identity and the existing readiness owner without starting or stopping a service. Explicit unsafe recovery survives successful health observation; cleanup uncertainty propagates instead of publishing completion.
Storage compatibility concern resolved: Observations use existing verification and step fields through the existing synchronous transaction owner. The schema and codec are unchanged. Terminal completion applies diagnostics only while running, and focused regressions cover competing publishers, busy writes, and retained restart refusals.
Findings None None.
Security None None.

How this fits together

The CLI updater coordinates package installation, service recovery, and finalization. Its readiness observations feed the update ledger, terminal output, and sanitized failure reports.

flowchart TD
  A[Update or finalization failure] --> B[Settle children and service restoration]
  B --> C[Observe installed Gateway]
  C --> D[Preserve restart restrictions]
  D --> E[Existing update ledger]
  E --> F[Terminal output and failure reports]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +576, Tests +2128, Docs +11, Other 0. Total +2715 across 64 files.

View PR surface stats
Area Files Added Removed Net
Source 28 889 313 +576
Tests 33 2606 478 +2128
Docs 1 11 0 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 2 4 4 0
Total 64 3510 795 +2715

Review metrics

Metric Value Why it matters
Storage compatibility 0 schema, codec, or migration changes The recovery receipts use existing persisted fields, so this patch does not require a data-format migration.

Stored data model

Persistent data-model change detected: unknown-data-model-change: src/infra/update-run-write.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep recovery observation within the existing readiness, lifecycle, ledger, and reporting owners while preserving the original failure and restart restrictions.

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

Yes, from source: a finalization failure can reach terminal reporting without observing a still-serving Gateway on current main. Historical installed observations support that mechanism; this review did not execute it.

Is this the best way to solve the issue?

Yes. The patch reuses the existing readiness and ledger owners, preserves failure and authority constraints, and removes the need for a separate recovery-reporting policy.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs misleading recovery reporting after update failures while preserving the underlying failure and existing recovery policy.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Historical installed macOS runs exercised post-update and standalone-finalizer failures, retained the failure, and reported verified serving with authenticated readiness. The body explicitly accepts those observations plus later restoration/publication regressions; the published-driver handoff is separately recorded, and no final-head installed recovery run is claimed.
  • proof: sufficient: Contributor real behavior proof is sufficient. Historical installed macOS runs exercised post-update and standalone-finalizer failures, retained the failure, and reported verified serving with authenticated readiness. The body explicitly accepts those observations plus later restoration/publication regressions; the published-driver handoff is separately recorded, and no final-head installed recovery run is claimed.

Evidence

What I checked:

  • Pinned patch ownership: Reviewed the introduced merge-base-to-head delta. Raw test-merge parents match the pinned base followed by the exact PR head; base-only fixture changes were not attributed to this PR. (18dbb0ec06ab)
  • Recovery preserves restart constraints: The observer uses installed version/build identity and the existing readiness owner without starting or stopping a service. Explicit unsafe recovery survives successful health observation; cleanup uncertainty propagates instead of publishing completion. (src/cli/update-cli/update-command-failure-recovery.ts:122, 18dbb0ec06ab)
  • Storage compatibility concern resolved: Observations use existing verification and step fields through the existing synchronous transaction owner. The schema and codec are unchanged. Terminal completion applies diagnostics only while running, and focused regressions cover competing publishers, busy writes, and retained restart refusals. (src/infra/update-run-write.ts:112, 18dbb0ec06ab)
  • Full captured body and accepted proof limits: Read the complete body through GitHub and verified SHA-256 5325119f502334ffc513f0734f473a37d1b4fd07c3989d350c3495e2e59af5f8 against the supplied snapshot. It records installed macOS recovery observations on earlier source, a published 9.5-to-candidate handoff on c2c676f, and explicit maintainer acceptance of those observations plus integration regressions. Later recovery cells did not execute after their startup precondition failed; no final-head installed rerun is claimed. The same disposition rejects the previous migration checkbox as inapplicable and retains the approved budget adjustment. (18dbb0ec06ab)
  • Current main still needs the observation: Current-main finalization completes or fails the lifecycle without the new failure observation. Its post-update path can still assign runtime-verification-failed without probing the serving Gateway. Merged fix(update): retain Doctor advisories and terminal reports #153147 owns maintenance custody and terminal reporting, but does not supersede this observation work. (src/cli/update-cli/update-command-finalize.ts:163, d3cec4b73c99)
  • Latest supplied release remains affected: The v2026.9.5 finalizer directly completes or fails the lifecycle in its catch path without recovery observation. Its blob was read through GitHub after local historical blob access failed. (src/cli/update-cli/update-command-finalize.ts:150, ec9c1a13db89)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (18 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-20T13:34:32.365Z sha 8b66b8a :: blocked before merge. :: none
  • reviewed 2026-09-20T13:49:26.899Z sha be9f769 :: blocked before merge. :: none
  • reviewed 2026-09-20T15:53:25.879Z sha bc3ef6e :: blocked before merge. :: none
  • reviewed 2026-09-20T20:28:53.198Z sha 0c599ce :: blocked before merge. :: none
  • reviewed 2026-09-20T21:39:31.441Z sha ec18c41 :: blocked before merge. :: none
  • reviewed 2026-09-20T22:45:19.317Z sha ec18c41 :: blocked before merge. :: none
  • reviewed 2026-09-21T00:32:30.485Z sha 456dad6 :: blocked before merge. :: none
  • reviewed 2026-09-21T02:19:14.675Z sha 18dbb0e :: blocked before merge. :: none

@steipete
steipete force-pushed the upd/95-post-update-phases branch from 70c59c6 to c8327ae Compare September 19, 2026 22:06
@steipete
steipete force-pushed the upd/95-post-update-phases branch from 522195d to c2c676f Compare September 20, 2026 00:47
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 20, 2026
@steipete
steipete force-pushed the upd/95-post-update-phases branch from c2c676f to 5b16553 Compare September 20, 2026 05:54
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 20, 2026
@steipete
steipete force-pushed the upd/95-post-update-phases branch from 5b16553 to 13c56ee Compare September 20, 2026 07:13
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Sep 20, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 20, 2026
@steipete
steipete force-pushed the upd/95-post-update-phases branch from 13c56ee to a151c18 Compare September 20, 2026 07:46
@steipete
steipete force-pushed the upd/95-post-update-phases branch from 456dad6 to 18dbb0e Compare September 21, 2026 02:08
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 21, 2026
@steipete
steipete merged commit 01430fa into main Sep 21, 2026
234 checks passed
@steipete
steipete deleted the upd/95-post-update-phases branch September 21, 2026 02:51
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
…w#153178)

Observe the installed Gateway after update finalization fails, once child work and service restoration have settled. Reuse the shared readiness owner, preserve the original failure and unsafe-restart constraints, and atomically record observed recovery through the existing update ledger before terminal output and public reporting.

Preserve installed service identity across rollback, first-terminal-writer receipts, and main's maintenance custody and publication owners. Include the previously approved measured startup-budget refresh without increasing its growth or variance allowances.

Validation: exact-head CI passed; the campaign Codex review is scoped-clean. Focused integration and ledger regressions cover restoration, observation, publication, recovery identity, and authority. Installed recovery evidence remains historical; no final-head live recovery run is claimed.

Thanks to @0-danielviktorovich-0, @wlassalle724, @neangneatos, @ZSmallX, and @hxy8241 for the reports.

Fixes openclaw#152811, fixes openclaw#152788, fixes openclaw#152742, fixes openclaw#153000, fixes openclaw#152974.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

1 participant