Skip to content

fix(update): keep the service profile when switching to Git - #140263

Merged
fuller-stack-dev merged 3 commits into
mainfrom
fix/update-admitted-git-doctor-profile-r294
Sep 6, 2026
Merged

fuller-stack-dev merged 3 commits into
mainfrom
fix/update-admitted-git-doctor-profile-r294

Conversation

@fuller-stack-dev

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

Copy link
Copy Markdown
Member

Related: #139722, #135541, #113565

Additional instructions

This is a same-repository branch, editable under normal repository permissions. GitHub's fork-collaboration flag does not apply.

What Problem This Solves

When switching a package installation to Git, the updater captured the service environment before deferred inspection populated it. Backup and Doctor could then use the invoking profile instead of the owned Gateway's distinct profile, replacing the caller's prior backup and missing the intended service backup.

This follows the late profile finding on #139722 and preserves the original work and attribution linked through #135541. It also addresses this PR's foreign-profile finding: retained inspection metadata is not authority to write another profile.

Why This Change Was Made

Read the captured owned service environment when backup, Doctor and source-publication recovery need it. The existing owned-context producer rejects foreign service metadata. Inspection, schema refusal, reinspection, stop and activation ordering stay unchanged.

User Impact

Backup and Doctor use the owned service's config, state and profile. Foreign or absent service metadata does not redirect those operations from the caller. No schema, dependency, service-policy or new persistence contract is introduced.

Evidence

  • The original defect reproduced on unmodified canonical b3f87ed37006008e2b161679b004cbaa4797a6c5: wrong Doctor profile, missing managed backup, and replaced caller backup. The original owned-profile repair passed its nine selected controls.
  • The new foreign-profile defect reproduced on public efd0d24ba3a262cdbbeaeb8e6819b6c2d5f7f8a7. The foreign case failed on backup replacement and Doctor selectors; the owned and ordinary foreign Git controls passed.
  • The correction passes all 11 selected ownership/caller cases. After canonical integration, 22 selected CLI and CLI-process cases pass, including wrapper-retirement recovery and rollback schema/diagnostic controls. The strict foreign-profile case uses an unrelated source checkout that package planning does not adopt. It preserves config, prior backup and directory entries at Doctor entry and completion, with no service stop/install/restart. Recovery, absent/stopped package, incompatible Git and alias-retargeting controls pass.
  • These tests execute the real update command, package-exposure composition and config-backup owner with fresh synthetic profiles. Service and subprocess operations are mocked. They are not live-service, installed-package or combined-upgrade proof.
  • Fresh P0–P2 Autoreview found no actionable issues in the correction. The native 29-stage changed-file plan passed before integration. The six affected assertion/format/graph/core-type/test-type/lint commands passed afterward; unchanged receipts are carried, not described as a second full run.
  • Signed public head da79731cd10b0e2af3bd56e7dd9631f0f13fe5df, tree 035be43905999de5b69036d50943d93948713472, preserves the original public ancestry. Its three repair blobs match the tested candidate. The final canonical range changes unrelated capability/config/provider/agent-tool paths; the updated assertion inventory passes.
  • Exact-head CI 34050229623, native prepare and native merge reconciliation passed. The production npm bulk audit completed successfully, with its explicit upstream-repository advisory limitation. The refreshed ClawSweeper review resolved the prior P1. Verified squash add29edb0b648d70907bb42014fc162fcab78385 contains the same repair blobs. The first post-request reachability check failed; reconciliation confirmed the accepted merge without a second dispatch. Earlier green CI 34044675199 is retained only as historical evidence.

The earlier foreign-package fixture separately observed a run record under the package service selected by pre-route run admission. That behavior predates this PR and remains recorded for the run owner's assessment; it is not normalized into an unchanged-state claim. This PR does not change run admission or claim the combined upgrade journey is complete.

Focused ownership regression:

CI=1 node scripts/run-vitest.mjs src/cli/update-cli.test.ts -t 'uses only the owned profile when switching package installs to dev|keeps foreign-service updates in the caller profile'

Node 24.20.0, pinned pnpm 12.3.4 dependencies. The broader 11-case selection is retained with the raw red/green logs.

Resolve the admitted managed-service environment when package-to-Git backup, Doctor, and source-publication recovery consume it. Preserve deferred inspection and mutation ordering.

Follow-up to #139722; original all-agent preflight context is #135541.
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 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.

@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review September 6, 2026 16:11
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S maintainer Maintainer-authored PR labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 2:04 PM ET / 18:04 UTC.

ClawSweeper review

What this changes

The updater defers profile selection when switching from a package installation to Git so backup, Doctor, and recovery use the owned Gateway’s profile.

Merge readiness

✅ Ready for maintainer review

This repair remains necessary on pinned main. The corrected head resolves the previous foreign-profile finding, and the inspected diff introduces no remaining actionable defect.

Priority: P2
Reviewed head: da79731cd10b0e2af3bd56e7dd9631f0f13fe5df

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow owner-boundary repair with meaningful reported regression coverage and the previous blocker addressed.
Proof confidence 🌊 off-meta tidepool Not applicable: The member-author exemption applies. The previous authority concern is resolved by the owned-context producer and focused regression through real backup I/O, with foreign files checked before Doctor dispatch and afterward. Doctor and service execution remain mocked, so this is not installed-upgrade proof; no unresolved change-specific authority scenario warrants retaining the exceptional proof gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-author exemption applies. The previous authority concern is resolved by the owned-context producer and focused regression through real backup I/O, with foreign files checked before Doctor dispatch and afterward. Doctor and service execution remain mocked, so this is not installed-upgrade proof; no unresolved change-specific authority scenario warrants retaining the exceptional proof gate.
Evidence reviewed 7 items Pinned main still needs the repair: The fetched main revision passes preManagedServiceStop?.serviceEnv immediately, before deferred Git inspection populates the context. The PR instead supplies a callback. Release-source inspection was unavailable, so no shipped-fix claim is made.
Previous finding resolved: The callback now returns ownedManagedUpdateContext?.env. Its existing producer requires successful inspection, an owned service verdict, and service environment data; foreign inspection metadata cannot enter this callback’s result.
Consumers use the deferred environment: Git exposure reads the callback when post-verification Doctor runs, and failed publication recovery reads it when checking the package service. The sole production caller supplies the callback; this is an internal API change.
Findings None None.
Security None None.

How this fits together

OpenClaw’s updater coordinates installation changes with managed Gateway ownership. The selected environment determines which configuration is backed up and passed to Doctor before service finalization.

flowchart TD
  A[Package to Git update] --> B[Inspect managed Gateway]
  B --> C{Installation owned?}
  C -->|Yes| D[Admitted service profile]
  C -->|No| E[Caller profile]
  D --> F[Deferred profile lookup]
  E --> F
  F --> G[Config backup and Doctor]
  F --> H[Publication recovery]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +4, Tests +100. Total +104 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 7 3 +4
Tests 1 154 54 +100
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 161 57 +104

Review metrics

None.

Technical review

Best possible solution:

Keep profile selection at the existing ownership boundary and consume that admitted environment when backup, Doctor, and recovery actually run.

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

Yes, from source: package-to-Git execution captures the environment before deferred inspection, so a distinct owned service profile is missed. The contributor reports a failing regression; this review did not execute it.

Is this the best way to solve the issue?

Yes. A deferred lookup of the existing owned context repairs the timing defect without duplicating ownership policy or changing stored formats.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The member-author exemption applies. The previous authority concern is resolved by the owned-context producer and focused regression through real backup I/O, with foreign files checked before Doctor dispatch and afterward. Doctor and service execution remain mocked, so this is not installed-upgrade proof; no unresolved change-specific authority scenario warrants retaining the exceptional proof gate.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove merge-risk: 🚨 security-boundary: Current PR review selected no merge-risk labels.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This fixes a bounded package-to-Git update defect affecting distinct caller and managed-service profiles.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The member-author exemption applies. The previous authority concern is resolved by the owned-context producer and focused regression through real backup I/O, with foreign files checked before Doctor dispatch and afterward. Doctor and service execution remain mocked, so this is not installed-upgrade proof; no unresolved change-specific authority scenario warrants retaining the exceptional proof gate.

Evidence

What I checked:

Likely related people:

  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: 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 (1 earlier review cycle)
  • reviewed 2026-09-06T16:19:31.523Z sha efd0d24 :: needs real behavior proof before merge. :: [P1] Return only an owned service environment from the deferred lookup

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Addressed the P1 in the corrected head da79731. The deferred getter now reads ownedManagedUpdateContext?.env, not the retained inspection result. Foreign metadata cannot redirect config backup or Doctor.

The regression ran against unmodified public efd0d24: the foreign-profile case failed on backup replacement and Doctor selectors, while the owned and ordinary foreign Git controls passed. With the correction, all 11 selected ownership/caller cases pass. Canonical integration adds 11 passing adjacent finalization/rollback controls, for 22 selected passes.

The regression executes the real update command and config-backup owner with fresh, distinct profiles. At Doctor entry and completion it checks the foreign config, prior backup and directory entries, plus absence of foreign stop/install/restart. The foreign fixture is a separate source checkout that package planning does not adopt. Service and subprocess calls are mocked; this is product-boundary proof, not a live installation claim.

The earlier foreign-package fixture also exposed a pre-existing run-admission target discrepancy before this getter executes. That failed observation is preserved and explicitly qualified in the PR body; it is not counted as unchanged-state proof or silently fixed by this patch.

Fresh max-P2 review is scoped-clean. The native 29-stage plan passed, followed by mapped integration checks. Exact corrected-head CI/security and native preparation remain required before merge.

Retained raw SHA256 identities: red stdout 4ca4066dca1bf12ee295e6fe04e37da86bb9b28ae0f0d7857cb2d74e8f279fc9; green stdout 1c7416dc819a302bdce877a3e9de6a9c07488e4b583dfe98b153340e394568e3; integrated focused stdout bfaf4dd5d893712e0dc876338758de66b52c0637521f769c077c01d04819069e; separate wrapper-failure control 6e37cde7fd7ea7a9064be52b6558b216b2dd1755fba9c652b301b6ef3cb600e2.

@clawsweeper clawsweeper Bot added 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 6, 2026
@fuller-stack-dev
fuller-stack-dev merged commit add29ed into main Sep 6, 2026
116 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/update-admitted-git-doctor-profile-r294 branch September 6, 2026 18:08
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via the native exact-head squash workflow.

  • Reviewed/prepared head: da79731cd10b0e2af3bd56e7dd9631f0f13fe5df.
  • Verified landed commit: add29edb0b648d70907bb42014fc162fcab78385, with a valid GitHub signature and the same three repair blobs.
  • Exact-head CI 34050229623 passed, including the completed production npm bulk audit. That audit does not cover upstream repository advisories.
  • The original and foreign-profile regressions, 22 selected integrated controls, native checks and scoped max-P2 review are retained. The refreshed ClawSweeper review resolved the prior P1 and found no remaining actionable defect.

The initial merge request succeeded, but its first reachability check stopped local closeout. Native recovery reconciled the accepted request and verified the landed tree with exit 0. No second merge request was submitted. Recovery records and worktree metadata are preserved; this is an operator completion comment, not a claim that automatic cleanup ran.

Backup, Doctor and recovery now consume the admitted owned service profile after deferred inspection. Foreign inspection metadata cannot redirect those writes. Original #135541 and merged #139722 remain linked and credited. This does not claim the combined installed-upgrade journey or complete issue #113565.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* origin/main: (25 commits)
  docs(releases): keep the release-notes nav group to version routes (#140353)
  fix(ui): hide trust wrappers in imported chat history
  fix(subagents): subagent list building decodes unrelated saved prompts in large session stores (#139540)
  test(process): share relay startup fixtures (#140345)
  refactor(doctor): inline GitHub skill discovery inputs (#140343)
  refactor(ui): share channel status type definitions (#140331)
  refactor: simplify queue state and infrastructure dispatch (#140311)
  fix: require saved agent turns before update verification succeeds (#140274)
  fix(update): keep the service profile when switching to Git (#140263)
  fix(ui): prevent image avatars overlapping mobile chat (#140341)
  fix(test): accept release subpages in docs route shape (#140337)
  refactor(plugins): share uninstall mutation ownership (#140322)
  refactor(agents): use canonical tool execution arguments (#140280)
  perf(cli): keep inference metadata and domain help lazy (#140327)
  refactor(plugins): simplify self-hosted setup results (#140332)
  refactor(config): reuse parent lookup for unset operations (#140326)
  fix(plugins): preserve exact installed-index mutation receipts (#140328)
  test(agents): simplify MCP and LSP boundary fixtures (#140312)
  fix(ui): preserve literal source previews and copied whitespace (#140306)
  fix: OpenCode Go/Zen requests are missing the required x-opencode-session header (#137464)
  ...
fuller-stack-dev added a commit that referenced this pull request Sep 6, 2026
* fix(update): keep the service profile when switching to Git

Resolve the admitted managed-service environment when package-to-Git backup, Doctor, and source-publication recovery consume it. Preserve deferred inspection and mutation ordering.

Follow-up to #139722; original all-agent preflight context is #135541.

* fix(update): restrict deferred Git profile to owned service

(cherry picked from commit add29ed)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
…#140263)

* fix(update): keep the service profile when switching to Git

Resolve the admitted managed-service environment when package-to-Git backup, Doctor, and source-publication recovery consume it. Preserve deferred inspection and mutation ordering.

Follow-up to openclaw#139722; original all-agent preflight context is openclaw#135541.

* fix(update): restrict deferred Git profile to owned service
fuller-stack-dev added a commit that referenced this pull request Sep 10, 2026
…mission (#140339)

* feat(update): verify served agent turns are persisted

Related: #124396
(cherry picked from commit a12b5fa)

* feat(update): persist recovery claims and guard interrupted admission

Related: #124396

Persist exact operational records in the existing shared machine-state owner, with revision fencing, observed effects, candidate handoffs, serving proofs, and history-preserving checkpoint carry-forward. Refuse new admission and diagnostic completion while operational recovery remains pending.

Integration checkpoint: package descriptors, terminal pair retention, checkpoint publication discovery, and matching-runtime replay still require the coordinated producer and finalizer consumers. Focused recovery/history/CLI tests: 75 passed; typechecking, focused lint, and independent P0-P2 review passed. Production unused-export checks remain blocked by the unfinished consumer integration.

(cherry picked from commit 5037c12fe8528136d7b32e6804230db23af63c10)

* fix(update): bind recovery checkpoints to admitted source

(cherry picked from commit 9d8bbc7bcabec9ae5fddbcb8fcc88935136fc49c)

* fix(update): reject aliased recovery databases

(cherry picked from commit b1d10c113bdf6d2ff8eae0c8d7bbb0af6318f418)

* feat(update): capture and restore verified update checkpoints

Related: #124396

Capture digest-bound config, plugin payload, service files and SQLite state.
Restore compatible newer work with three-way preservation, preserving FTS and
row identities, while refusing incompatible changes before publication.

Integrate the existing recovery owner for immutable plan references, exact
record/logical-data binding, two-copy sealing, interrupted preparation and
resource reconciliation. Keep live SQLite reads artifact-preserving.

Integration checkpoint: 34 focused tests, core/core-test typing, scoped type-aware lint and independent
P0-P2 review pass. The full changed-file gate still identifies absent real
production consumers; finalizer lifecycle and recovery admission/replay wiring
remain coordinated follow-ups. No complete whole-state rollout or containment
claim is made here.

(cherry picked from commit ec216121b2a8e6214576709fd0774eff28e0ae0a)

* fix(update): revalidate checkpoint sources before sealing

Bind source content, physical identity and absence again after all resource
copies so service and environment preimages cannot silently become stale
before manifest publication. Recheck owner-held exclusion before returning.

Three regressions reproduce edited, same-byte recreated and newly-created
service resources on the previous implementation. All 37 focused checkpoint
and real recovery integration tests pass, along with production/test typing,
scoped lint and fresh P0-P2 independent review.

The full changed-file gate still fails on missing production consumers in
the existing checkpoint/recovery/verifier stack. This additive integration
commit changes no public API and does not claim complete rollback or landing.

Related: #124396
(cherry picked from commit 85976a48ca3858cabab3de19c53c274614e5d90f)

* fix(update): block admission across interrupted database publication

Detect existing checkpoint restore families before any writable admission when the canonical shared database is missing. Treat locators as evidence requiring reconciliation, never as mutation authority. Keep first-install admission and existing pending-recovery checks intact.

Four real CLI negative controls reproduced new history database creation. All 65 focused recovery and CLI tests pass; production/test typechecks, scoped lint and independent P0-P2 review pass. Full changed gate still flags missing production consumers in the unfinished stack. Private integration checkpoint; no full replay or retention claim.

(cherry picked from commit 324bcd2d1c09d39b66442d56951177f9cdf0e459)

* fix(update): bind displaced recovery to publication record

(cherry picked from commit 4936cbfefd95f71934c3de75c31324d2e48b3616)

* fix(update): bind checkpoint file restores to mutation outputs

(cherry picked from commit f855a3ed6fa757a7797e1dc6f03468ce73fd5644)

* fix(update): bind plugin rollback to committed row receipts

(cherry picked from commit 2c4a077dbeeae6db9a03d9939fa469a396363371)

* test(update): verify exact checkpoint inventory and SQLite capture

(cherry picked from commit c24926024c64a7c718f1d1df15ab3a3b3c07d73c)

* fix(update): expose canonical recovery row ownership selector

* fix(update): enforce staged runtime validation before sealing

* fix(update): bind legacy admission plans to original config sources

* feat(update): persist checkpoint after-images by completed interval

(cherry picked from commit ee2bf95f44d624f258a8fbe2f9fe4cd4ef38b6b6)

* fix(update): preserve pre-stop file preimages through checkpoint sealing

(cherry picked from commit 5c81b9caf154334fa65d17d298417bedf5e5208e)

* fix: require saved agent turns before update verification succeeds (#140274)

* feat(update): verify served agent turns are persisted

Related: #124396

* fix: verify update serving and persistence on the final Gateway boot

* fix: retire advisory inference after durable update verification

* test: align Doctor update controls with boot-bound verification

* fix(test): accept release subpages in docs route shape

(cherry picked from commit 20673ed)

---------

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit cbd5419)

* fix(update): converge plugins before managed service activation

* fix(update): keep the service profile when switching to Git (#140263)

* fix(update): keep the service profile when switching to Git

Resolve the admitted managed-service environment when package-to-Git backup, Doctor, and source-publication recovery consume it. Preserve deferred inspection and mutation ordering.

Follow-up to #139722; original all-agent preflight context is #135541.

* fix(update): restrict deferred Git profile to owned service

(cherry picked from commit add29ed)

* fix(update): await post-core writer settlement before continuing

Join child close and termination helper before returning committed plugin results, preserving committed work across termination races. Keep convergence as a step so restarting and verifying history remain monotonic.

* fix(update): validate checkpoint publication by resource role

(cherry picked from commit dd3e2e9ba7136acc87616ffd97560c8d53dfac15)

* fix(update): report unavailable checkpoint exclusion before apply

(cherry picked from commit 5c4021420f9f466da55fb656fc0ac1d80c100e12)

* feat(update): reconcile checkpoints before recovery claims

(cherry picked from commit 57ac8738a103bdf5b00a3a59278c047d8615a606)

* fix(update): stop repair continuation after authority loss

* feat(update): seal staged service files before native load

* feat(update): validate restored state with previous runtime

(cherry picked from commit cec342aa8e1e8e33e22f789c430e936e716b63e4)

* fix(update): retain pending staged-load failures

* test(update): supply retained runtime to checkpoint adapter

* feat(update): import immutable package recovery runtime

Use the exact four-file runtime closure from package-owner commit 6703db8f2b925e9c28235e24e418eb0f66ce5967. Package swap integration remains with its owner.

(cherry picked from commit 5f7338df8a87e07e51570a92208df0531d4148a7)

* feat(update): commit verified recovery outcomes and retained pairs

Persist typed package effects with fenced retry acknowledgements. Atomically commit terminal history and select the next retained package/checkpoint pair before superseded retirement. Preserve selection during rollback and interrupted cleanup; complete CLI runs from durable outcomes.

(cherry picked from commit bbf6f99bf05d6e6d88c651fcddd1120e5c735a6b)

* fix(update): consume durable terminal outcomes in finalization

* fix(update): reject serving proof after recovery changes

* feat(update): integrate retained package generation prerequisite

Exact committed-source slice: 56b2924..fc22114.
Includes only missing package owner paths; existing runtime imports preserved.

* feat(update): integrate bounded retained-generation readers

Exact committed-source slice: fc22114..e2279391b42f7794de0c82bded390e6f114477ba.
Includes only missing package owner paths; existing runtime imports preserved.

* feat(update): integrate canonical package recovery swap

Exact committed-source slice: e2279391b42f7794de0c82bded390e6f114477ba..6703db8f2b925e9c28235e24e418eb0f66ce5967.
Includes only missing package owner paths; existing runtime imports preserved.

* test(update): reopen retained recovery after-images with source binding

(cherry picked from commit 409b1ce3165bd9b3a06a72ecbb2b24d0bd10d2a5)

* feat(update): bind early recovery file preimages

Keep purpose-validated original file artifacts in a separate fenced recovery slot before lifecycle mutation. Reopen and recheck current claims before early lifecycle actions; require a later full checkpoint to link the exact early artifact without accepting it as complete state.

(cherry picked from commit e929332b9ee6794930d96e1626907205d35eda36)

* test(update): cover retained-reader publication races

(cherry picked from commit c20f9ff59aa9a4b3e515940ab72fbacbb80e5af8)

* fix(update): propagate durable package recovery hooks

* fix(update): retain exact backup diagnostics after failed publication

* fix(update): revalidate resource before recovery progress

(cherry picked from commit 85d3929a12968b5dd0feba2ede6f2e7ac1c07533)

* fix(update): validate restored agent databases with retained runtime

(cherry picked from commit 95a8ba67873858fd43970be8d11e003b09c69cb8)

* fix: coordinate cached state and direct config writes

* fix: coordinate shared-state checkpointing on retirement

* fix(state): retain handle exclusion through native and source-reader lifetimes

* fix(state): retain heartbeat exclusion through renewal and worker exit

* test(macos): preserve canonical modes in worker install fixture

* fix(state): bind source capture to its current physical exclusion

* fix(state): bind maintenance capture to settled heartbeat ownership

* fix(state): compose live lease owners for checkpoint capture

* feat(update): persist native manager recovery intent

(cherry picked from commit 8a0a2a3af098f4036b51a0bf82462578bb25ddaa)

* fix(update): bind checkpoints before releasing source exclusion

* fix(config): serialize writes to shared include targets

* feat(update): replay sealed checkpoint restoration

(cherry picked from commit b922f75b28db236c37131e4e26e649862ed8ef03)

* test(update): reconcile retained runtime replay fixture

* feat(update): bind systemd recovery manager identities

(cherry picked from commit a8b359cd7aa6852397bd00041c524b58ff3665ee)

* fix(update): inspect loaded systemd commands without activation

* fix(update): guard interrupted preview history settlement

(cherry picked from commit 588f70478515c7cfd53c642ba46b32bf4c5e6f3a)

* fix(update): settle interrupted previews within admitted command scope

* fix(update): reject uncertain loaded service admission

(cherry picked from commit 00c9931e91a8174feda08fa80af74ef4a61b43a7)

* fix(update): inspect loaded systemd runtime without activation

* fix(update): keep definition admission non-activating

* fix(update): retain observed native manager account identity

* test(update): exercise physical checkpoint publication owners

(cherry picked from commit 73bd1544bbf35bf51df7c83a2c1c8ba005837cae)

* feat(state): rebind live leases after checkpoint publication

(cherry picked from commit 1832bd986d1905f89e76a71ca11196f97a0c940b)

* fix(update): replay sealed recovery from rollback

(cherry picked from commit d4c2ad61c400e36d0fd582bee8b6b18b584f346f)

* fix(update): bind recovery CAS to publication custody

(cherry picked from commit d7da34a4480ced7cf28a5caa18543fd1be091d1e)

* fix(update): classify native admission read failures

(cherry picked from commit 0bf7e1faf2230885ec5236a4ce748e01949c9683)

* fix(update): defer legacy config writes until admitted execution

* fix(update): consume live publication in rollback

(cherry picked from commit 30ee0442378d9768c8324926a097d80c7cd06bf8)

* fix(update): preserve pending recovery through finalization and unwind

* fix(update): refuse finalization before displaced source admission

* fix(update): retain live executor ownership through command settlement

Reuse the managed handoff lease for direct invocations and borrow only the exact live helper assignment. Check the original executor after awaited candidate validation and retain it through recovery unwind. Keep physical checkpoint exclusion and durable recovery startup as separate unfinished integration.

* fix(update): retain executor authority across native lifecycle effects

* fix(update): inspect legacy terminal outcomes without granting mutation authority

* fix(update): fence migrated workers through descendant extinction

* fix(update): bind staged startup and original source capture

* fix(update): bind original native facts under lifecycle ownership

* fix(update): retain native stop authority through acknowledgement

* fix(update): preserve owned recovery across CI and artifact replacement

Retain the live state coordinator through heartbeat worker teardown, preserve the first lease failure across nested maintenance, and settle fresh locally owned pre-activation signals without migrating state. Treat explicit artifact targets, including package aliases, as replacements regardless of equal versions.
Separate shared type and fixture contracts to remove static dependency cycles, register the real Gateway client callsite, and correct platform and atomic-publication fixture boundaries.
Source-bound regression checks and independent review are retained with the CI correction proof; hosted exact-head checks and clean-head built presenter verification remain separate landing requirements.

* fix(update): finish package baseline reads before durable startup

Keep bounded file observations within their own reader lifetime. Await
startup and descriptor persistence afterward, preserving independent
package readback, retention, and native activation fences.

* fix(update): preserve typed recovery queries and isolated test owners

* fix(update): reconcile untouched preparation under live owners

Keep bounded package roots concurrent, preserve no-effect failed preparation evidence, and support loaded-only synthetic service inspection. Make the native deletion test barrier explicitly owned.

* fix(update): distinguish SQLite metadata reader export

* fix(update): resume journaled rollback with absent package root

* test(update): isolate Windows ACL creation in platform simulations

* fix(update): drain logical owners before checkpoint publication

* fix(update): settle retained agent WAL under publication custody

* fix(update): preserve WAL boundaries and deterministic lease fixtures

* fix(update): retain exact mutation custody through Doctor and rollback

* Fix preflight signal ownership and failed native restart recovery

* test(state): isolate competing maintenance lease claims

* fix(update): bind all phase receipts during checkpoint recovery

* fix(update): reconcile stopped candidate suppression under fresh authority

* fix(update): inspect collected systemd units under recovery custody

* fix(update): admit retained stopped service replay under fresh custody

* fix(update): inspect collected service processes on the native interface

* fix(update): admit sealed stopped recovery on ordinary entry

* fix(locks): report bounded stale-owner acquisition evidence

* fix: keep shipped SDK context aliases pending removal (#142708)

(cherry picked from commit c7cb45d)

* fix(update): validate ordinary interrupted-update recovery

Simplify the ordinary recovery path, retain strict existing-record refusal, and
repair cross-version admission, source ownership, native observation, and
checkpoint startup-metadata handling. Exclude the inactive capsule subsystem.

Validate the exact source with complete package build, independent reviews,
and serial installed rollback, upgrade, transport, signal, and interruption cases.

* fix(update): remove type cycle and scope migration test cleanup

* fix(update): retry owned PID-less activation observation transitions

* test(update): isolate refusal cases and join fixture descendants

* feat(update): defer full-state recovery and retain compatible rollback

* fix(update): separate type contracts and remove deferred recovery orphans

* fix(update): retain executor checks across native task recovery

* fix(update): avoid unsolicited notices after package rollback

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Jason Sy <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
…mission (openclaw#140339)

* feat(update): verify served agent turns are persisted

Related: openclaw#124396
(cherry picked from commit a12b5fa)

* feat(update): persist recovery claims and guard interrupted admission

Related: openclaw#124396

Persist exact operational records in the existing shared machine-state owner, with revision fencing, observed effects, candidate handoffs, serving proofs, and history-preserving checkpoint carry-forward. Refuse new admission and diagnostic completion while operational recovery remains pending.

Integration checkpoint: package descriptors, terminal pair retention, checkpoint publication discovery, and matching-runtime replay still require the coordinated producer and finalizer consumers. Focused recovery/history/CLI tests: 75 passed; typechecking, focused lint, and independent P0-P2 review passed. Production unused-export checks remain blocked by the unfinished consumer integration.

(cherry picked from commit 5037c12fe8528136d7b32e6804230db23af63c10)

* fix(update): bind recovery checkpoints to admitted source

(cherry picked from commit 9d8bbc7bcabec9ae5fddbcb8fcc88935136fc49c)

* fix(update): reject aliased recovery databases

(cherry picked from commit b1d10c113bdf6d2ff8eae0c8d7bbb0af6318f418)

* feat(update): capture and restore verified update checkpoints

Related: openclaw#124396

Capture digest-bound config, plugin payload, service files and SQLite state.
Restore compatible newer work with three-way preservation, preserving FTS and
row identities, while refusing incompatible changes before publication.

Integrate the existing recovery owner for immutable plan references, exact
record/logical-data binding, two-copy sealing, interrupted preparation and
resource reconciliation. Keep live SQLite reads artifact-preserving.

Integration checkpoint: 34 focused tests, core/core-test typing, scoped type-aware lint and independent
P0-P2 review pass. The full changed-file gate still identifies absent real
production consumers; finalizer lifecycle and recovery admission/replay wiring
remain coordinated follow-ups. No complete whole-state rollout or containment
claim is made here.

(cherry picked from commit ec216121b2a8e6214576709fd0774eff28e0ae0a)

* fix(update): revalidate checkpoint sources before sealing

Bind source content, physical identity and absence again after all resource
copies so service and environment preimages cannot silently become stale
before manifest publication. Recheck owner-held exclusion before returning.

Three regressions reproduce edited, same-byte recreated and newly-created
service resources on the previous implementation. All 37 focused checkpoint
and real recovery integration tests pass, along with production/test typing,
scoped lint and fresh P0-P2 independent review.

The full changed-file gate still fails on missing production consumers in
the existing checkpoint/recovery/verifier stack. This additive integration
commit changes no public API and does not claim complete rollback or landing.

Related: openclaw#124396
(cherry picked from commit 85976a48ca3858cabab3de19c53c274614e5d90f)

* fix(update): block admission across interrupted database publication

Detect existing checkpoint restore families before any writable admission when the canonical shared database is missing. Treat locators as evidence requiring reconciliation, never as mutation authority. Keep first-install admission and existing pending-recovery checks intact.

Four real CLI negative controls reproduced new history database creation. All 65 focused recovery and CLI tests pass; production/test typechecks, scoped lint and independent P0-P2 review pass. Full changed gate still flags missing production consumers in the unfinished stack. Private integration checkpoint; no full replay or retention claim.

(cherry picked from commit 324bcd2d1c09d39b66442d56951177f9cdf0e459)

* fix(update): bind displaced recovery to publication record

(cherry picked from commit 4936cbfefd95f71934c3de75c31324d2e48b3616)

* fix(update): bind checkpoint file restores to mutation outputs

(cherry picked from commit f855a3ed6fa757a7797e1dc6f03468ce73fd5644)

* fix(update): bind plugin rollback to committed row receipts

(cherry picked from commit 2c4a077dbeeae6db9a03d9939fa469a396363371)

* test(update): verify exact checkpoint inventory and SQLite capture

(cherry picked from commit c24926024c64a7c718f1d1df15ab3a3b3c07d73c)

* fix(update): expose canonical recovery row ownership selector

* fix(update): enforce staged runtime validation before sealing

* fix(update): bind legacy admission plans to original config sources

* feat(update): persist checkpoint after-images by completed interval

(cherry picked from commit ee2bf95f44d624f258a8fbe2f9fe4cd4ef38b6b6)

* fix(update): preserve pre-stop file preimages through checkpoint sealing

(cherry picked from commit 5c81b9caf154334fa65d17d298417bedf5e5208e)

* fix: require saved agent turns before update verification succeeds (openclaw#140274)

* feat(update): verify served agent turns are persisted

Related: openclaw#124396

* fix: verify update serving and persistence on the final Gateway boot

* fix: retire advisory inference after durable update verification

* test: align Doctor update controls with boot-bound verification

* fix(test): accept release subpages in docs route shape

(cherry picked from commit 20673ed)

---------

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 17fa116)

* fix(update): converge plugins before managed service activation

* fix(update): keep the service profile when switching to Git (openclaw#140263)

* fix(update): keep the service profile when switching to Git

Resolve the admitted managed-service environment when package-to-Git backup, Doctor, and source-publication recovery consume it. Preserve deferred inspection and mutation ordering.

Follow-up to openclaw#139722; original all-agent preflight context is openclaw#135541.

* fix(update): restrict deferred Git profile to owned service

(cherry picked from commit 6ffc287)

* fix(update): await post-core writer settlement before continuing

Join child close and termination helper before returning committed plugin results, preserving committed work across termination races. Keep convergence as a step so restarting and verifying history remain monotonic.

* fix(update): validate checkpoint publication by resource role

(cherry picked from commit dd3e2e9ba7136acc87616ffd97560c8d53dfac15)

* fix(update): report unavailable checkpoint exclusion before apply

(cherry picked from commit 5c4021420f9f466da55fb656fc0ac1d80c100e12)

* feat(update): reconcile checkpoints before recovery claims

(cherry picked from commit 57ac8738a103bdf5b00a3a59278c047d8615a606)

* fix(update): stop repair continuation after authority loss

* feat(update): seal staged service files before native load

* feat(update): validate restored state with previous runtime

(cherry picked from commit cec342aa8e1e8e33e22f789c430e936e716b63e4)

* fix(update): retain pending staged-load failures

* test(update): supply retained runtime to checkpoint adapter

* feat(update): import immutable package recovery runtime

Use the exact four-file runtime closure from package-owner commit 6703db8f2b925e9c28235e24e418eb0f66ce5967. Package swap integration remains with its owner.

(cherry picked from commit 5f7338df8a87e07e51570a92208df0531d4148a7)

* feat(update): commit verified recovery outcomes and retained pairs

Persist typed package effects with fenced retry acknowledgements. Atomically commit terminal history and select the next retained package/checkpoint pair before superseded retirement. Preserve selection during rollback and interrupted cleanup; complete CLI runs from durable outcomes.

(cherry picked from commit bbf6f99bf05d6e6d88c651fcddd1120e5c735a6b)

* fix(update): consume durable terminal outcomes in finalization

* fix(update): reject serving proof after recovery changes

* feat(update): integrate retained package generation prerequisite

Exact committed-source slice: 4f148ac..fc22114.
Includes only missing package owner paths; existing runtime imports preserved.

* feat(update): integrate bounded retained-generation readers

Exact committed-source slice: fc22114..e2279391b42f7794de0c82bded390e6f114477ba.
Includes only missing package owner paths; existing runtime imports preserved.

* feat(update): integrate canonical package recovery swap

Exact committed-source slice: e2279391b42f7794de0c82bded390e6f114477ba..6703db8f2b925e9c28235e24e418eb0f66ce5967.
Includes only missing package owner paths; existing runtime imports preserved.

* test(update): reopen retained recovery after-images with source binding

(cherry picked from commit 409b1ce3165bd9b3a06a72ecbb2b24d0bd10d2a5)

* feat(update): bind early recovery file preimages

Keep purpose-validated original file artifacts in a separate fenced recovery slot before lifecycle mutation. Reopen and recheck current claims before early lifecycle actions; require a later full checkpoint to link the exact early artifact without accepting it as complete state.

(cherry picked from commit e929332b9ee6794930d96e1626907205d35eda36)

* test(update): cover retained-reader publication races

(cherry picked from commit c20f9ff59aa9a4b3e515940ab72fbacbb80e5af8)

* fix(update): propagate durable package recovery hooks

* fix(update): retain exact backup diagnostics after failed publication

* fix(update): revalidate resource before recovery progress

(cherry picked from commit 85d3929a12968b5dd0feba2ede6f2e7ac1c07533)

* fix(update): validate restored agent databases with retained runtime

(cherry picked from commit 95a8ba67873858fd43970be8d11e003b09c69cb8)

* fix: coordinate cached state and direct config writes

* fix: coordinate shared-state checkpointing on retirement

* fix(state): retain handle exclusion through native and source-reader lifetimes

* fix(state): retain heartbeat exclusion through renewal and worker exit

* test(macos): preserve canonical modes in worker install fixture

* fix(state): bind source capture to its current physical exclusion

* fix(state): bind maintenance capture to settled heartbeat ownership

* fix(state): compose live lease owners for checkpoint capture

* feat(update): persist native manager recovery intent

(cherry picked from commit 8a0a2a3af098f4036b51a0bf82462578bb25ddaa)

* fix(update): bind checkpoints before releasing source exclusion

* fix(config): serialize writes to shared include targets

* feat(update): replay sealed checkpoint restoration

(cherry picked from commit b922f75b28db236c37131e4e26e649862ed8ef03)

* test(update): reconcile retained runtime replay fixture

* feat(update): bind systemd recovery manager identities

(cherry picked from commit a8b359cd7aa6852397bd00041c524b58ff3665ee)

* fix(update): inspect loaded systemd commands without activation

* fix(update): guard interrupted preview history settlement

(cherry picked from commit 588f70478515c7cfd53c642ba46b32bf4c5e6f3a)

* fix(update): settle interrupted previews within admitted command scope

* fix(update): reject uncertain loaded service admission

(cherry picked from commit 00c9931e91a8174feda08fa80af74ef4a61b43a7)

* fix(update): inspect loaded systemd runtime without activation

* fix(update): keep definition admission non-activating

* fix(update): retain observed native manager account identity

* test(update): exercise physical checkpoint publication owners

(cherry picked from commit 73bd1544bbf35bf51df7c83a2c1c8ba005837cae)

* feat(state): rebind live leases after checkpoint publication

(cherry picked from commit 1832bd986d1905f89e76a71ca11196f97a0c940b)

* fix(update): replay sealed recovery from rollback

(cherry picked from commit d4c2ad61c400e36d0fd582bee8b6b18b584f346f)

* fix(update): bind recovery CAS to publication custody

(cherry picked from commit d7da34a4480ced7cf28a5caa18543fd1be091d1e)

* fix(update): classify native admission read failures

(cherry picked from commit 0bf7e1faf2230885ec5236a4ce748e01949c9683)

* fix(update): defer legacy config writes until admitted execution

* fix(update): consume live publication in rollback

(cherry picked from commit 30ee0442378d9768c8324926a097d80c7cd06bf8)

* fix(update): preserve pending recovery through finalization and unwind

* fix(update): refuse finalization before displaced source admission

* fix(update): retain live executor ownership through command settlement

Reuse the managed handoff lease for direct invocations and borrow only the exact live helper assignment. Check the original executor after awaited candidate validation and retain it through recovery unwind. Keep physical checkpoint exclusion and durable recovery startup as separate unfinished integration.

* fix(update): retain executor authority across native lifecycle effects

* fix(update): inspect legacy terminal outcomes without granting mutation authority

* fix(update): fence migrated workers through descendant extinction

* fix(update): bind staged startup and original source capture

* fix(update): bind original native facts under lifecycle ownership

* fix(update): retain native stop authority through acknowledgement

* fix(update): preserve owned recovery across CI and artifact replacement

Retain the live state coordinator through heartbeat worker teardown, preserve the first lease failure across nested maintenance, and settle fresh locally owned pre-activation signals without migrating state. Treat explicit artifact targets, including package aliases, as replacements regardless of equal versions.
Separate shared type and fixture contracts to remove static dependency cycles, register the real Gateway client callsite, and correct platform and atomic-publication fixture boundaries.
Source-bound regression checks and independent review are retained with the CI correction proof; hosted exact-head checks and clean-head built presenter verification remain separate landing requirements.

* fix(update): finish package baseline reads before durable startup

Keep bounded file observations within their own reader lifetime. Await
startup and descriptor persistence afterward, preserving independent
package readback, retention, and native activation fences.

* fix(update): preserve typed recovery queries and isolated test owners

* fix(update): reconcile untouched preparation under live owners

Keep bounded package roots concurrent, preserve no-effect failed preparation evidence, and support loaded-only synthetic service inspection. Make the native deletion test barrier explicitly owned.

* fix(update): distinguish SQLite metadata reader export

* fix(update): resume journaled rollback with absent package root

* test(update): isolate Windows ACL creation in platform simulations

* fix(update): drain logical owners before checkpoint publication

* fix(update): settle retained agent WAL under publication custody

* fix(update): preserve WAL boundaries and deterministic lease fixtures

* fix(update): retain exact mutation custody through Doctor and rollback

* Fix preflight signal ownership and failed native restart recovery

* test(state): isolate competing maintenance lease claims

* fix(update): bind all phase receipts during checkpoint recovery

* fix(update): reconcile stopped candidate suppression under fresh authority

* fix(update): inspect collected systemd units under recovery custody

* fix(update): admit retained stopped service replay under fresh custody

* fix(update): inspect collected service processes on the native interface

* fix(update): admit sealed stopped recovery on ordinary entry

* fix(locks): report bounded stale-owner acquisition evidence

* fix: keep shipped SDK context aliases pending removal (openclaw#142708)

(cherry picked from commit 8ab0f61)

* fix(update): validate ordinary interrupted-update recovery

Simplify the ordinary recovery path, retain strict existing-record refusal, and
repair cross-version admission, source ownership, native observation, and
checkpoint startup-metadata handling. Exclude the inactive capsule subsystem.

Validate the exact source with complete package build, independent reviews,
and serial installed rollback, upgrade, transport, signal, and interruption cases.

* fix(update): remove type cycle and scope migration test cleanup

* fix(update): retry owned PID-less activation observation transitions

* test(update): isolate refusal cases and join fixture descendants

* feat(update): defer full-state recovery and retain compatible rollback

* fix(update): separate type contracts and remove deferred recovery orphans

* fix(update): retain executor checks across native task recovery

* fix(update): avoid unsolicited notices after package rollback

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Jason Sy <[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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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