Skip to content

fix: recover completed package updates with changed rollback evidence - #167302

Merged
RomneyDa merged 1 commit into
mainfrom
fix/completed-publication-recovery
Oct 8, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/completed-publication-recovery

Conversation

@shanselman

@shanselman shanselman commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Related: #164074

What Problem This Solves

Fixes: future package updates remain blocked after a completed publication when the retained previous package changes and the original sealed recovery helper refuses retirement.

User Impact

Explicit openclaw update repair can settle an external-helper publication-complete operation after verifying the live candidate, preserving the previous package and original helper as recovery evidence instead of deleting them or restoring obsolete bytes.

Older installed drivers and sealed helpers do not acquire this behavior automatically. In-anchor legacy recovery remains owned by its original helper.

Why This Change Was Made

Admit publication-complete into the existing verified external-publication settlement owner, already used for publishing and interrupted settlement. This reuses candidate inventory, manifest, launcher, sealed-helper, executor, and custody checks without reinterpreting the obsolete tree fingerprint or introducing a force option.

Evidence

  • The new regression failed through the public repair entry point before the production fix and passed afterward.
  • 57 tests passed across the CLI package-repair, released ownership, and remount suites. They cover evidence preservation, subsequent package preparation, and refusals for changed live content, inventory symlinks, unavailable durable launcher synchronization, concurrent execution, changed helpers, and wrong versions.
  • Combined focused test command: approximately 35.20 seconds wall time. Modified CLI suite: approximately 17.81 seconds reported duration for 47 tests. Expanded cases reuse the existing fixture and owner path; no new process/Gateway boot per test.
  • Fresh independent review reported no actionable findings.
  • Repository-required check-changed.mjs --timed passed: formatting, lint, production and test type checks, SQLite/schema guards, dead-export scans, import-cycle checks, and other selected invariants.
  • Live recovery of an affected installed 2026.9.8 candidate passed the settlement verifier: inventoried content matched, no extra dist paths, matching recorded version and sealed helper. The owner settled the operation and retained its previous package and original helper; the helper's original digest still matches.
  • A separately reviewed, local-only compatibility bootstrap archived the already completed control directory intact, under a fresh update executor fence, retaining journal inode and bytes. This is necessary because shipped 2026.9.8/2026.9.9 drivers cannot decode the newer supersession receipt; applying settlement alone would not complete their bootstrap repair.
  • Six isolated bootstrap cases passed, including actual shipped-driver admission, preserved evidence, archive collision, unsupported directory sync, concurrent executor, lease rotation, and a successful rename with lost acknowledgement. These machine-specific operator proofs are not included in the upstream diff.
  • After local recovery, the actual installed CLI completed a normal update preview targeting 2026.9.9 instead of refusing pending publication. Gateway RPC and health remained good with the same process during recovery.
  • The supported shipped-driver 2026.9.8 -> 2026.9.9 update then completed successfully. Final publication is complete, the run ledger reports success, Gateway version matches the new installation, channels are ready, no loaded-plugin errors or service-definition drift were reported, and no active recovery sets remain.
  • All original rollback database snapshot files remain present and match an independently preserved copy by SHA-256. Subsequent ctime-only drift was observed; timestamps are not being used as proof of content integrity.
  • First-hop distribution remains a gap for older installed drivers: this PR does not replace their original sealed helpers or add a standalone bootstrap entry point.

…dence

Reuse verified external-publication settlement for publication-complete recovery and preserve obsolete package evidence.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 48048ed7-2041-4fcc-86bc-6bc442140ddd
@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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S labels Oct 8, 2026
@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. 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, 12:05 PM ET / 16:05 UTC (Revision 2).

ClawSweeper review

What this changes

Allows explicit update repair to settle completed external-helper package publications after verifying the installed candidate while preserving changed rollback evidence.

Example: Run update repair after a completed publication whose retained previous package changed

  • Before: Repair refuses the pending publication, blocking the next package update.
  • After: Repair verifies the live candidate, archives the original recovery evidence, and admits the next update.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A clean, useful repair with real recovery evidence, scoped below a complete solution to the linked incident because older-driver bootstrapping remains separate.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The updated body reports the changed settlement owner recovering a real installed 2026.9.8 candidate while preserving package/helper evidence, followed by installed-CLI admission and a successful published-driver update to 2026.9.9 with rollback snapshots intact. The separate local bootstrap proves only that operator sequence, not a shipped bootstrap capability. Existing journal formats are reused without migration, and legacy recovery remains unchanged.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: A healthy installed update can leave recovery pending indefinitely when its retained previous package changes, preventing future updates.
Reason: The narrow extension restores recovery through the existing verified owner without adding a force option. Related is appropriate because older-driver distribution and legacy recovery remain outside this patch.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main still excludes completed publications from verified settlement, and no actionable patch defect was found. The added live evidence addresses the earlier proof request within the stated scope; recovery bootstrapping for older drivers remains separate.

Priority: P1
Reviewed head: 0e134ca32c4c54a01105da47b7decd5612ea71ce

Before merge

None.

Findings

None.

Agent review details

How this fits together

Native package updates record publication and recovery in a durable journal. Explicit repair uses that journal, current update ownership, and installed-package verification to safely release pending recovery without replacing the running package.

flowchart TD
  A[Explicit update repair] --> B[Read publication journal]
  B --> C[Acquire current update ownership]
  C --> D[Verify installed candidate and sealed helper]
  D -->|Verification fails| E[Keep recovery armed]
  D -->|Verification passes| F[Archive original recovery evidence]
  F --> G[Record settlement and admit next update]
Loading

Technical review

Best possible solution:

Keep this focused settlement extension and track supported first-hop recovery for older installed drivers in the linked issue.

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

Yes, source establishes the narrow failure: a completed publication with the recorded live candidate is excluded from verified settlement and remains pending. The contributor reports a failing base regression and passing head; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes, reusing the existing verification and custody owner is the narrowest repair for supported external-helper operations. It correctly avoids claiming to retrofit older sealed drivers.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point. Added test files: 1.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The production change adds publication-complete to the existing external-publication settlement condition; it introduces no separate recovery owner. (src/infra/package-update-activation.ts:245, 0e134ca32c4c)
  • Still necessary on current main: Fetched main still accepts publishing and interrupted external settlement, but excludes publication-complete. The earlier merged settlement implementation does not cover this additional phase. (src/infra/package-update-activation.ts:244, af1b0641a2e3)
  • Existing settlement intent: fix(update): let repair settle a publication whose live package already serves the candidate #165607 introduced verified settlement that preserves the previous package and sealed helper, checks current executor ownership, and deliberately retains the original helper's behavior. This PR extends that same intent. (src/infra/package-update-activation.ts:244, fb84dd57fd57)
  • Final-effect safeguards: The existing verifier checks candidate content, manifests, launchers, helper identity and digest; archival repeatedly checks current authority and observed objects before journal transitions and filesystem effects. The new condition preserves those checks. (src/infra/package-update-activation-custody.ts:243, 0e134ca32c4c)
  • Meaningful regression coverage: The new repair-boundary regression preserves changed previous-package bytes, helper bytes, live content, and launcher identity, then prepares another update. Six existing refusal scenarios are also exercised for publication-complete. These tests use real publication, journal, and custody owners with mocked discovery and finalization. (src/cli/update-cli/update-repair-package-activation.test.ts:283, 0e134ca32c4c)
  • New real-setup recovery evidence: The fully read PR body, captured with sourceRevision 8a12bd230cfdecedb9d4f3fae4baefe3e994def1869a23a80db10453fd7350a9 and confirmed through REST, reports successful settlement of an affected installed 2026.9.8 candidate, retained helper and previous-package evidence, matching helper digest, subsequent installed-CLI update admission, and a completed published-driver 2026.9.8 to 2026.9.9 update. Original rollback snapshots matched an independently preserved copy by SHA-256. These are contributor-observed results, not reviewer execution.

Likely related people:

  • Peter Steinberger: Raw commit fb84dd5 adds src/infra/package-update-activation.ts:244 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fb84dd57fd57; files: src/infra/package-update-activation.ts)

PR surface

Source +1, Tests +44, Docs +9. Total +54 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 0 +1
Tests 1 71 27 +44
Docs 1 9 0 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 81 27 +54

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #164074
Summary: This PR is a bounded candidate repair for the completed-publication blocker; it does not deliver the older-driver bootstrap.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.

Label justifications:

  • P1: The linked discussion establishes official package installations whose completed publication blocks subsequent native updates.
  • merge-risk: 🚨 compatibility: Settlement uses an existing receipt older shipped drivers cannot decode; the established original-helper boundary is preserved and the body explicitly limits the recovery scope.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; 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-08T15:42:57.212Z sha 0e134ca :: needs changes before merge. :: none

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 8, 2026
@RomneyDa
RomneyDa enabled auto-merge (squash) October 8, 2026 17:31
@RomneyDa
RomneyDa merged commit 3ed1e21 into main Oct 8, 2026
144 of 145 checks passed
@RomneyDa
RomneyDa deleted the fix/completed-publication-recovery branch October 8, 2026 17:32
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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
…dence (openclaw#167302)

Reuse verified external-publication settlement for publication-complete recovery and preserve obsolete package evidence.

Co-authored-by: Scott Hanselman <[email protected]>
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 48048ed7-2041-4fcc-86bc-6bc442140ddd
RomneyDa added a commit that referenced this pull request Oct 26, 2026
…es the candidate (#183479)

A 2026.9.33 to 2026.9.34 update or repair that found a package activation journal at publication-complete, with the live package already serving the recorded candidate and the executor lease intact, refused with "Package publication recovery is pending". settlePendingPackageActivation only settled a prepared operation for an installed candidate, so automatic admission and openclaw update repair both dead-ended.

Extend the existing external-publication settlement to publication-complete: the publication owner verifies the closure and evidence through its retire preflight, the original executor authority is still acquired, and the operation is retired without republishing files. Dry-run admission accepts the same verified state. Publishing and other incomplete phases stay blocked.

Minimal 2026.9.x port of the publication-complete settlement that main carries in 3ed1e21 (#167302), fb84dd5 (#165607), and 0679b18 (#181307); main's separate settlement verifier and custody modules are not ported.
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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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.

2 participants