Skip to content

fix(update): roll back npm candidate after Doctor failure - #135462

Merged
fuller-stack-dev merged 47 commits into
mainfrom
codex/update-postverify-rollback
Sep 2, 2026
Merged

fuller-stack-dev merged 47 commits into
mainfrom
codex/update-postverify-rollback

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Keep the staged npm package and every affected launcher backup until candidate Doctor accepts the install.
  • When Doctor throws, blocks, or returns no result, restore and verify the prior package version and launchers, retain backup evidence, and report rollback failures.
  • Keep the successful candidate path unchanged.
  • Keep packageRollbackVerified separate from serviceRestartSafe. Package restoration does not make old code safe after Doctor or hooks may have changed state.

Root cause and safety boundary

The staged npm swap previously removed the old package and launcher backups immediately after activation. A later candidate Doctor failure therefore left the rejected candidate active.

This change delays commit until Doctor passes. On failure, the package owner restores and verifies the previous package and launchers, removes transaction residue after verified recovery, and reports the package result without granting restart permission. The live diagnostic retains packageRollbackVerified; the cross-version restart sentinel persists the prior strict { serviceRestartSafe: false, reason } shape so an older restored runtime can read the recovery guidance.

The dependency, #134490, merged at 80ae248de1c050d2508f378245b2f1add18f47ed. This branch includes canonical main through accb53f8753cd4ce3abc39802871c8b5bf55bf63; the reviewed and published head is 6d0c911f0243fad01014386d6d4eed6319c3a56d.

Evidence

  • Untouched-main falsifier: d413210bc7420923d101ce64211511cdac7b9464 retained the synthetic 2.0.0-proof.candidate package and all candidate launcher digests after a blocking Doctor, proving the harness does not unconditionally report rollback.
  • Exact-head transaction matrix: 6d0c911f0243fad01014386d6d4eed6319c3a56d passed blocking Doctor, thrown Doctor, successful Doctor, and activation-failure scenarios. The failing paths restored the old package tree and all openclaw, .cmd, and .ps1 launcher digests with no package, shim, or staging residue; the success path retained the candidate and cleaned backups.
  • Exact-head live product path: AWS/Linux Crabbox run run_68ea6c22bb7d installed source 2026.8.1 and distinct candidate 2026.8.2-proof.6d0c911f0243. A permissioned legacy config made candidate Doctor block. update.run restored the original package version, tree, manifest, entrypoint, root identity, and launcher; removed every canonical package/shim stage and backup prefix; returned packageRollbackVerified: true with serviceRestartSafe: false; and left the managed service stopped. The restored old package then served /healthz and /readyz with HTTP 200 in an isolated read-only probe.
  • Cross-version recovery: the frozen 80ae248de1c050d2508f378245b2f1add18f47ed package read the persisted guidance with its strict schema, produced no stderr, and observed the restart-sentinel markers. No start or restart occurred.
  • Source-blind Behavior Validator: the exact 6d0c911f0243fad01014386d6d4eed6319c3a56d artifact bundle passed the combined success, rollback, activation-failure, thrown-Doctor, residue, older-schema, and untouched-main contract with 0.99 confidence.

Crabbox cleanup is complete: lease cbx_08099179d5fd (swift-shrimp) reported leaseStopped=true, and the subsequent AWS lease list was empty. The earlier run_fa1456f8958d ended during partial-clone object retrieval with HTTP 429 before product execution; its exact lease cbx_224e5670b357 was released and is retained only as setup-failure evidence.

Validation

  • Focused updater, recovery, sentinel, CLI, and Doctor tests passed, including 396 CLI/infra cases and 88 Doctor config cases on the final relevant code.
  • pnpm check:changed passed after the final relevant integration.
  • pnpm release:check completed its build, runtime-postbuild, plugin SDK, and UI stages. Plugin-inventory and native-locale diagnostics reproduced on canonical-main controls and are not attributed to this updater diff.
  • Max-P2 Autoreview found no actionable finding (0.88 confidence); the final ancestry-only merge did not change the PR diff.
  • Exact-head package build and tarball checks passed locally and on Crabbox. The Crabbox candidate package SHA-256 was 35867add25f632d500a03ae154d42ffdb567525f384377fa43a98e73f429f91b.
  • Hosted required checks are green on the published head, including the retried security-fast and openclaw/ci-gate.
  • Raw video is unavailable. Two bounded capture attempts failed on recorder transport; no further recorder attempt was made. The immutable terminal proof above is canonical.

Scope

This PR is limited to staged npm activation after candidate Doctor and truthful package-rollback diagnostics. It does not add pnpm or Bun rollback, service-health rollback, post-swap runtime/service-state restoration, a state checkpoint, or Docker fixture repair.

steipete and others added 8 commits September 1, 2026 08:44
Prefer npm before ClawHub only among declared plugin identities, preserving explicit source/version intent, artifact integrity and capability consent. Keep the exact installed beta cohort and require typed target absence before fallback.

Preserve authored environment references through both Doctor writers, resolve snapshot destinations at operation time, and keep migration-only metadata out of redacted snapshots. Avoid loading channel runtimes for unused pairing account facts while retaining captured migration-owner attribution.

Record activation safety at package/Git mutation boundaries. Keep installed-CLI recovery, verify runtime/native-service identity, fence Windows autostart, preserve child status, and avoid duplicating consumed notifications or rejecting completed install switches. Surface update-specific disconnect diagnostics without changing explicit-restart guidance in Model Setup.

Retain the upgrade-survivor first-hop, approval and installed-version oracles. Repair CI's type-only Doctor cycle and stale source-policy, final-Doctor and Teams whitespace expectations without weakening timeouts, gates or the main-owned Markdown fix.

PR: #134490
Remove superseded version-only verification copy and the unused idle label from the eager catalog. Keep identity-aware verification and all recovery guidance unchanged, align translation fixtures, and restore the existing merged startup budget without increasing its baseline or limits.
Carry unresolved non-retained plugin capability refusals from missing-install
repair through post-core convergence as typed outcomes, preserving the existing
update failure and restart boundary. Keep usable retained artifacts and
transient fetch failures on their existing notice/warning paths.

Give test invocations a native process HOME before config imports and worker
creation. Preserve bounded live/profile context, report selection, installed
tool caches, and process-group/pipe-owned namespace cleanup or truthful
retention. Keep unknown or mixed explicit real-home selections closed.
Resolve the repo-owned staging helper from its owning cwd and await complete
PID readiness before cancelling native report fixtures.

Align the survivor recovery oracle with typed consent errors that intentionally
have no Doctor reason. Preserve strict plugin/code/version/core-step checks and
historical warning-only reports; successful-update admission still rejects
refusals. Keep the local TestHomeMode alias private and satisfy helper lint.

PR: #134490
…ration

Carry the prepared, provenance-validated ClawHub package instead of discarding
it into a boolean. Suppress the declared installed counterpart without deriving
an npm identity from overlaid display metadata or hiding an npm namesake.
Keep lazy prepared catalog facts and first-normalized-record icon behavior.

Retain explicit ClawHub-only actions and npm-first dual-source actions, and
cover the selected source's pinned inspection metadata with existing tables.
The incoming duplicate-row cases fail before the provenance fact is retained.

PR: #134490
Register the three runtime dependencies in the canonical extraction and trust inventory. Extracted planners and publishers now load the real home policy, context, and selection modules without stubs or weaker assertions. The existing extracted-anchor regression fails before this change and the full wrapper suite passes afterward.
Read the explicitly selected profile with a non-login Bash command so
system and user login startup cannot replace the source HOME first.
Keep positional profile quoting, child-only HOME/USERPROFILE, existing
profile opt-in and test/native-home isolation unchanged.

The existing six profile-home matrix cases failed on Linux CI run
33536959196, job 99953769387. New exact-head Linux CI remains required;
this local repair does not refresh or admit the prior native proof.

PR: #134490
@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Sep 1, 2026
@steipete
steipete force-pushed the steipete/upgrade-experience-final-3e21d8 branch from 6e43294 to 0857eb2 Compare September 1, 2026 19:01
Base automatically changed from steipete/upgrade-experience-final-3e21d8 to main September 1, 2026 23:33
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: matrix Channel integration: matrix channel: msteams Channel integration: msteams channel: whatsapp-web Channel integration: whatsapp-web app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations size: XL and removed size: M labels Sep 1, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the docs Improvements or additions to documentation label Sep 2, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Sep 2, 2026
@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label Sep 2, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 6d0c911f0243fad01014386d6d4eed6319c3a56d. The final additive correction preserves packageRollbackVerified in current-process triage diagnostics while keeping serviceRestartSafe: false; the cross-version restart sentinel still strips the local-only field for the older strict schema. No runtime/service-state restoration is added in this PR.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

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

@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Updater-owner decision for the exact-head ClawSweeper review: accepted.

For this npm transaction, candidate Doctor remains service-external while the package and launcher swap is rollbackable. The existing post-update finalizer continues to own successful managed-service refresh and restart. Failed candidate verification restores package artifacts, reports packageRollbackVerified, keeps serviceRestartSafe: false, and does not restart. Coherent post-swap runtime/service-state restoration remains in the child workstream and is intentionally not added here.

Exact-head evidence: 6d0c911f0243fad01014386d6d4eed6319c3a56d passed the source-blind contract and AWS run run_68ea6c22bb7d; the blocking Doctor restored source 2026.8.1 after activating distinct candidate 2026.8.2-proof.6d0c911f0243, removed transaction residue, left the service stopped, and kept the old strict recovery schema readable.

@fuller-stack-dev
fuller-stack-dev merged commit d11b4d5 into main Sep 2, 2026
495 of 498 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the codex/update-postverify-rollback branch September 2, 2026 12:09
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged exact reviewed head 6d0c911f0243fad01014386d6d4eed6319c3a56d as squash commit d11b4d59f4ab26195a0ebb2ed96373123ee9783e after exact-head ClawSweeper review, source-blind validation, hosted required checks, and AWS Crabbox run run_68ea6c22bb7d passed.

The retained merge receipt is refs/openclaw/pr-merge-outcomes/135462. The local wrapper was interrupted after GitHub accepted the merge; read-only reconciliation verified the landed tree against the prepared head before this completion receipt was posted.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…35462)

* fix(update): preserve configuration and verify upgrade recovery

Prefer npm before ClawHub only among declared plugin identities, preserving explicit source/version intent, artifact integrity and capability consent. Keep the exact installed beta cohort and require typed target absence before fallback.

Preserve authored environment references through both Doctor writers, resolve snapshot destinations at operation time, and keep migration-only metadata out of redacted snapshots. Avoid loading channel runtimes for unused pairing account facts while retaining captured migration-owner attribution.

Record activation safety at package/Git mutation boundaries. Keep installed-CLI recovery, verify runtime/native-service identity, fence Windows autostart, preserve child status, and avoid duplicating consumed notifications or rejecting completed install switches. Surface update-specific disconnect diagnostics without changing explicit-restart guidance in Model Setup.

Retain the upgrade-survivor first-hop, approval and installed-version oracles. Repair CI's type-only Doctor cycle and stale source-policy, final-Doctor and Teams whitespace expectations without weakening timeouts, gates or the main-owned Markdown fix.

PR: openclaw#134490

* test(msteams): align the corrected main whitespace fixture

* perf(ui): remove unreachable update translations

Remove superseded version-only verification copy and the unused idle label from the eager catalog. Keep identity-aware verification and all recovery guidance unchanged, align translation fixtures, and restore the existing merged startup budget without increasing its baseline or limits.

* fix(update): retain consent failures and isolate validation homes

Carry unresolved non-retained plugin capability refusals from missing-install
repair through post-core convergence as typed outcomes, preserving the existing
update failure and restart boundary. Keep usable retained artifacts and
transient fetch failures on their existing notice/warning paths.

Give test invocations a native process HOME before config imports and worker
creation. Preserve bounded live/profile context, report selection, installed
tool caches, and process-group/pipe-owned namespace cleanup or truthful
retention. Keep unknown or mixed explicit real-home selections closed.
Resolve the repo-owned staging helper from its owning cwd and await complete
PID readiness before cancelling native report fixtures.

Align the survivor recovery oracle with typed consent errors that intentionally
have no Doctor reason. Preserve strict plugin/code/version/core-step checks and
historical warning-only reports; successful-update admission still rejects
refusals. Keep the local TestHomeMode alias private and satisfy helper lint.

PR: openclaw#134490

* fix(plugins): preserve declared catalog identity during upgrade integration

Carry the prepared, provenance-validated ClawHub package instead of discarding
it into a boolean. Suppress the declared installed counterpart without deriving
an npm identity from overlaid display metadata or hiding an npm namesake.
Keep lazy prepared catalog facts and first-normalized-record icon behavior.

Retain explicit ClawHub-only actions and npm-first dual-source actions, and
cover the selected source's pinned inspection metadata with existing tables.
The incoming duplicate-row cases fail before the provenance fact is retained.

PR: openclaw#134490

* fix(ci): include home isolation in PR anchor closure

Register the three runtime dependencies in the canonical extraction and trust inventory. Extracted planners and publishers now load the real home policy, context, and selection modules without stubs or weaker assertions. The existing extracted-anchor regression fails before this change and the full wrapper suite passes afterward.

* fix(test): preserve source home when loading profiles

Read the explicitly selected profile with a non-login Bash command so
system and user login startup cannot replace the source HOME first.
Keep positional profile quoting, child-only HOME/USERPROFILE, existing
profile opt-in and test/native-home isolation unchanged.

The existing six profile-home matrix cases failed on Linux CI run
33536959196, job 99953769387. New exact-head Linux CI remains required;
this local repair does not refresh or admit the prior native proof.

PR: openclaw#134490

* fix(update): roll back npm candidate after Doctor failure

* fix(update): roll back npm candidate after Doctor failure

* fix(update): separate package rollback evidence

* fix(update): preserve rollback sentinel compatibility

* fix(update): keep staged Doctor service-external

* test(update): verify exact post-Doctor restoration

* test(update): narrow restored version assertion

* test(update): cover all rollback residue prefixes

* fix(update): preserve package rollback diagnostics

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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