Skip to content

fix: completed recovery history blocks future updates - #167358

Merged
RomneyDa merged 1 commit into
mainfrom
fix/update-recovery-history
Oct 8, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/update-recovery-history

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes updates being blocked by completed recovery history from an older reader format or by unfinished cleanup of an obsolete package.

User Impact

Completed history no longer prevents the next update. Unfinished restoration, unknown or corrupt records, and active mutations still require recovery; retained evidence is not deleted or rewritten.

This changes the installed updater. It cannot run inside an unchanged older updater that refuses before fetching the candidate.

Why This Change Was Made

Admission needs to determine whether recovery is pending, not execute every historical record. Use the existing validated inspection codec for history and strict execution decoding only for the operation being acted on. Typed terminal package retirement is cleanup; unfinished restore progress remains blocking. Preserve the matching operation’s finalizer and prevent CLI fallback from completing over unrelated unfinished recovery.

This is complementary to Scott’s package-publication repair and package receipt/cleanup repair, not a replacement for either.

Evidence

  • 165 unique focused tests across six recovery/CLI files passed, including regressions that fail with the original reader/predicate and the unfinished-recovery fallback.
  • Both changed-file gate selections passed: types, lint, dead exports and repository guards.
  • Independent P0–P1 autoreview found no actionable findings; maintainer source review also completed.
  • Local single-worker Vitest: recovery plus terminal-record run 78.71 s total; CLI recovery 62.33 s and CLI siblings 51.68 s (Vitest durations). CI seconds not yet measured.

Completed packed-candidate qualification (2026-10-08)

All five maintained Docker cells passed on their first attempt, with no timeout; final scheduler status is passed and cleanup joined. The parent independently reran assertPackageRecoveryEvidence on all five structured receipts.

Released writer / scenario Result Cell time
2026.9.8 / publication interruption Passed 930 s
2026.9.9 / publication interruption Passed 752 s
2026.9.8 / post-publication Doctor failure Passed 827 s
2026.9.9 / post-publication Doctor failure Passed 659 s
2026.9.7 → unchanged 2026.9.8 / stranded first hop Passed negative control 322 s

Positive cells used the exact composed candidate 1aa57206f693d5e2fbce607289d0bbeefbff32d1, tarball SHA-256 20f5375db04391e3155d1a1386843e8aeb80cade377193b71e7221e5b7d490f7. This is a local qualification package labeled 2026.9.9, not a published release. Runtime owners match #167330 at 2c6986b123f8ce44bbeb9c714ab20a3515a73a30 and #167358 at d3932c61a3517bb171d4c1242a2699897bae1ee8.

Each authentic released writer created its own journal and helper and reached publication-complete. Installed-candidate public repair and repeated repair exited 0. Full retained-tree inventory, identity and original helper digest, unchanged candidate bytes, and authored settings were preserved. Every positive cell then installed the distinct expected package/build identity 2026.9.10-first-hop.0 through the updater, with retained evidence and settings still preserved. This supplies the requested shipped-writer compatibility/repair/next-update proof; focused unfinished-restoration refusal regressions remain separate supporting evidence.

The negative control confirms unchanged 9.8 blocks before staging/accessing the deliberately absent candidate: update-recovery-pending, candidateCodeInvoked:false. It does not claim candidate-only rescue of a stranded old updater. Old-reader → external-new-repair → old-reader remains uncovered, and no full release upgrade or release publication is claimed.

Frozen trusted harness: ec0a4e67d8a3ae45e0311cb27a62f4e00b745820. At final harness head 6c05dc5bfebacd61b25333d5b07a3a3913c52f80, recovery-specific modules, policy and Docker planner remain byte-identical; shared main phase-logging/restart-fixture changes are covered by focused conflict tests, not claimed byte-identical. Aggregate cell time is 3,490 s (58m10s), excluding setup. These are local Docker measurements, not CI seconds.

Current-head required CI is green on all three PRs. Exact-head ClawSweeper reviews completed with no code findings; their outstanding qualification requests are addressed by these results. Existing independent source-review dispositions and the harness's inherited local Knip failure remain recorded, not relabeled as clean checks.

Inspect validated historical receipts for admission without granting execution authority. Ignore terminal typed retirement cleanup, but preserve blockers for unfinished restoration and ambiguous package effects.

Keep named execution decoding strict and prevent CLI completion fallback from writing while another recovery remains pending.
@clawsweeper

clawsweeper Bot commented Oct 8, 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.

@RomneyDa
RomneyDa marked this pull request as ready for review October 8, 2026 17:36
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: M labels Oct 8, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 3:59 PM ET / 19:59 UTC (Revision 2).

ClawSweeper review

What this changes

The PR allows completed recovery history to coexist with future updates while preserving refusals for unfinished restoration and ambiguous mutations.

Example: Run another update with a completed legacy recovery record

  • Before: The updater rejects the historical receipt as legacy readiness evidence and blocks the update.
  • After: The updater validates the completed history for admission, preserves its bytes, and allows the new update.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, useful repair with reported installed-updater qualification, meaningful regression coverage, and no actionable code findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The updated qualification reports authentic released-writer interruptions followed by installed-candidate public repair twice and successful distinct-version updates through the changed updater, preserving retained evidence and settings. Focused storage regressions separately cover legacy history and unfinished-restoration refusals. Existing record formats and bytes remain unchanged; the proof does not claim rescue by an unchanged older updater.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A finished recovery can leave users unable to update again.
Reason: Distinguishing historical completion from unfinished recovery restores the repository’s best-effort update contract while preserving recovery safeguards. The change adds no user-facing option or alternate recovery mechanism.

Merge readiness

✅ Ready for maintainer review

This useful maintainer-authored fix remains necessary on current main. No actionable patch defects remain, and the updated qualification addresses the earlier review blocker.

Priority: P1
Reviewed head: d3932c61a3517bb171d4c1242a2699897bae1ee8

Before merge

None.

Findings

None.

Agent review details

How this fits together

OpenClaw’s updater stores recovery evidence and update outcomes in SQLite. Admission checks distinguish unfinished recovery from historical records before allowing another update.

flowchart TD
  A[Next update request] --> B[Saved recovery records]
  B --> C[Validate historical evidence]
  C --> D{Recovery unfinished?}
  D -->|Yes| E[Preserve state and refuse update]
  D -->|No| F[Run update under existing ownership]
  F --> G[Publish matching update outcome]
Loading

Technical review

Best possible solution:

Keep one validated history-inspection owner for admission and retain strict, operation-specific execution and finalization.

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

Yes, source establishes the failure: current main execution-decodes every historical record before admission and treats terminal retirement cleanup as pending. Focused regressions cover those inputs; this review did not run them.

Is this the best way to solve the issue?

Yes, reusing the existing validated inspection codec removes the historical-admission failure without creating another recovery owner or weakening named execution decoding.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Current-main necessity: Fetched main retains the strict whole-history execution reader and the predicate that treats pending retirement or superseded packages as recovery blockers. None of the seven changed production files differs between the merge base and fetched main. (src/infra/update-run-recovery.ts:14, 4f33fe7402bf)
  • Validated history remains separate from execution: Historical inspection retains schema validation and exact raw bytes; named execution still uses the readiness-only decoder. The pending predicate excludes only terminal typed retirement cleanup and continues to block unfinished restoration and other mutation intents. (src/infra/update-run-recovery-schema.ts:590, d3932c61a351)
  • Terminal publication preserves recovery ownership: Completed-result capture still refuses a matching recovery operation or any unfinished recovery; CLI fallback likewise leaves unrelated unfinished recovery pending rather than writing successful history. (src/infra/update-run-terminal-record.ts:21, d3932c61a351)
  • Meaningful regression coverage: Added storage-boundary cases exercise completed legacy success and rollback, preserve retained bytes, reject named legacy execution, and distinguish typed cleanup from untyped retirement, disguised restoration, package restoration, checkpoint restoration, and unfinished restore progress. The author reports failing baseline regressions and passing focused tests; this read-only review did not execute tests. (src/infra/update-run-recovery.test.ts:271, d3932c61a351)
  • Updated installed-updater qualification: The fully read live body reports four successful Docker cells using authentic 2026.9.8/2026.9.9 writers, publication interruption or post-publication Doctor failure, public candidate repair twice, and a subsequent update to 2026.9.10-first-hop.0. Retained inventories, helper digest, candidate bytes, and authored settings were preserved. The composed candidate is 1aa57206f693d5e2fbce607289d0bbeefbff32d1, tarball SHA-256 20f5375db04391e3155d1a1386843e8aeb80cade377193b71e7221e5b7d490f7, with this PR’s runtime pinned to d3932c6. Captured context identity: 77145e71e00da86c73e6e08bf9eaa4b84e7bff2c25531571f01f632491e5af1a. The local qualification commit was unavailable for an independent blob comparison; its bridge is reported evidence. (d3932c61a351)
  • Qualification exercises public commands: The inspected harness in fix: release validation misses interrupted package upgrades #167377 invokes the authentic installed updater, injects faults through an external observer, runs public repair twice, and installs a distinct-version tarball. Its oracle checks actual publication state, package/build identity, retained content, helper digest, and authored settings. (scripts/e2e/lib/upgrade-survivor/package-activation-recovery.sh:28, 6c05dc5bfeba)

PR surface

Source +11, Tests +90. Total +101 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 7 66 55 +11
Tests 2 105 15 +90
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 171 70 +101

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P1: Completed recovery history can prevent an existing installation from performing subsequent updates.
  • 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.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-08T17:42:30.757Z sha d3932c6 :: needs changes before merge. :: none

@RomneyDa RomneyDa reopened this Oct 8, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Oct 8, 2026
@RomneyDa
RomneyDa enabled auto-merge (squash) October 8, 2026 20:05
@RomneyDa
RomneyDa merged commit 8879e5e into main Oct 8, 2026
349 checks passed
@RomneyDa
RomneyDa deleted the fix/update-recovery-history branch October 8, 2026 20:07
RomneyDa added a commit that referenced this pull request Oct 8, 2026
Backport all required recovery fixes to 2026.10.1: #167302, #167330,
#167358, and #167377. Include their missing settlement prerequisites
#164997, #165238, and #165607.

Close obsolete recovery custody durably before best-effort evidence archival;
keep unfinished rollback and current mutation authority strict. Completed
history cannot block subsequent updates. Qualify authentic interruptions
from pinned 9.8/9.9 updaters plus the unchanged 9.7-to-9.8 negative control.

Adapt donor APIs to the release-owned publication and lease database owners.
No version, dependency, budget, permission, or publication changes.

Proof:619 focused tests passed, including14 release-profile cases;
fresh complete69-file P0-P2 review clean. Complete changed gate passed.
Exact combined release build and stable/all/soak qualification remain pending.

Sources:
3ed1e21 (#167302)
4821885 (#167330)
8879e5e (#167358)
bc860ad (#167377)
9497527 (#164997)
5ae6497 (#165238)
fb84dd5 (#165607)

Co-authored-by: Scott Hanselman <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
roboclaw-bot added a commit that referenced this pull request Oct 8, 2026
Keep the canonical completed-history repairs from #167330 and #167358 rather than duplicate their owners. Retain the reviewed Git, native, and optional restart-install-history fixes. Integrated focused validation: 429 infrastructure and 61 CLI tests passed; independent review clean through P2.

Co-authored-by: fuller-stack-dev <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
…penclaw#167358)

Inspect validated historical receipts for admission without granting execution authority. Ignore terminal typed retirement cleanup, but preserve blockers for unfinished restoration and ambiguous package effects.

Keep named execution decoding strict and prevent CLI completion fallback from writing while another recovery remains pending.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant