Skip to content

fix: keep installations with their update owner - #204866

Merged
obviyus merged 25 commits into
mainfrom
update-class-d-install-owner
Nov 25, 2026
Merged

obviyus merged 25 commits into
mainfrom
update-class-d-install-owner

Conversation

@obviyus

@obviyus obviyus commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Two update paths could claim the same installation. A converted install could fall into the retained in-place updater; reinstalling its Gateway from an unmarked npm entry could replace the resident launcher. Before first conversion, a different npm root could also claim an empty state slot. Node-only hosts were sent into a Gateway trial with nobody to activate it.

Related: #204516, #203807, #204266, and the converted-install legacy fall-through. #203628's runtime selection is a separate release-runtime issue, not changed here. #204515 npm adoption behavior is retained.

User Impact

  • Converted installs stay with their resident launcher. Installer-kind switches and immutable activation refuse with a reason and next step instead of replacing it; dry runs retain the existing read-only preview.
  • Ordinary and planned Gateway service installs select the verified launcher for the captured state directory; explicit retained recovery entrypoints still win.
  • Before conversion, node-only package installs with a node service but no Gateway definition or live local Gateway keep their package route; no launcher, forwarding entry or pending Gateway trial is created. Node-only Git checkouts keep the release updater and requested --sha. Already-converted installs keep their resident release owner, including --no-restart preparation after the Gateway service was removed.
  • Node-only package results name the updated installation's node install --force and node restart commands. They do not claim a retained node runtime was restarted, and guidance consumes captured result facts without a new service scan or state read.
  • Documented versions, dist-tags, npm specs/artifacts, deferred restart and implicit Git channel selection keep their existing behavior.
  • Windows process snapshots honor the existing native inspection budget instead of two hidden five-second ceilings. Unknown inspection remains distinct from proof that a service stopped.

Ownership Cut

The existing admission adapter owns the release-versus-package decision; the complete release routing block moved there to keep update-command.ts below its 700-line ratchet. The same read-only ownership guard stays before CLI cleanup/run creation and is rechecked under preparation's lock. Final service argument selection replaces the old invocation-based launcher selector. No new persistent state, schema, marker or flag.

After the single custody integration, production tokei code on this PR's eleven touched runtime files, excluding tests/support/harness: 4,595 → 4,814 (+219) against integrated main 8aaf3820112a4755d9aebb431e6c247b6d5d5412. Shared native-observer changes already landed in #204868 and are no longer counted here. No unrelated deletion was used to meet a line quota.

Evidence

AWS targeted proof passed 151 tests across nine files: routing 14, service entry/planning 62, Windows inspection 75. These lanes ran independently on Linux; the Windows lane uses native-inspection mocks, not a Windows live claim. Runtime source is b59eee4e13b3a71725b69a914211eea9e7ae75ad; the subsequent commit is documentation-only.

The qualified base comparison has 18 intended assertion failures and 133 passing controls: routing eight, service-entry/planning four, inspection budgets six. Earlier archived-checkout dependency failures were fixture setup, not product reds; fixed green lanes were not rerun for that repair.

Integration and remaining proof

The scheduled-task SQL-to-file observer hunk is shared with #204868; the second PR to land rebases the identical hunk rather than maintaining an independent variant.

A rare first-conversion refusal applies when a live foreground Gateway's root is opaque and it cannot accept the requested update over RPC. With operator access, the Gateway can classify its own argv and handle update.run. Otherwise the message offers Control UI/operator-access update or stopping the Gateway through its existing owner and rerunning. No lock or protocol field was added.

Against integrated main, the test change measures +740 lines, with 340 reviewed allocation lines above the normal 400-line allowance. config/test-lines-allocations/204866-install-update-owner.txt maps the thirteen changed test files to their contracts; upstream-owned native-observer credit was removed. Existing controls preserve package routing, Git SHA, converted/legacy ownership and immutable inspection-only output.

The two existing legacy-layout launcher cases in git-release.test.ts now pass the captured state environment and { planned: entry }, retaining both launcher and legacy path assertions. An explicit string entrypoint is reserved for --restore-service-cli and must win over ordinary launcher selection; those cases represent ordinary installation planning, not recovery.

The retained legacy service-staging producer resolves its release launcher before passing an explicit service CLI (d831dde27f). CI on that head proved the three unchanged no-restart staging cases red: the selector still treated the explicit launcher as a package CLI root. dd83c4f630 repairs that single selector by directly selecting a recognized accessible Gateway launcher, preserving Node and other recovery strings. Focused AWS proof passed all three regressions, the existing launcher control, and all four service-entry controls: 8 passed, unchanged assertions. The 38 unrelated service cases were intentionally excluded by the focused name filter.

Final head 2536f8aea4 passed CI and the security/aggregate gate: 70 successful checks, none pending or failed. It differs from reviewed/Linux-qualified 48e606149e only by three local test-helper rename substitutions fixing no-shadow; assertions and production bytes are identical. Main's exact-head and delta reviews are clean.

  • Integrated AWS qualification passed: current owner/preview/merge controls, full build, package integrity, and real Linux stable 2026.11.9 upgrade flows. Deferred conversion staged the launcher and committed on public restart; read-only-npm PATH service reinstall kept launcher ExecStart, committed the same pending trial, and the following update committed. A converted node-only install prepared a pending release without activating it; an unconverted node-only install used npm with no trial and named exact install/restart commands rather than claiming activation. Source 48e606149e is production-identical to final 2536f8aea4. Healthy relabels retain that source; this is not a schema-bump or live-Windows claim. Historical shallow-Git setup failed before tests and is not a merge gate.
  • Windows 11 ARM64 status/restart follows the exclusively owned custody lane; per maintainer direction it can be recorded after landing. No live-Windows pass is claimed.
  • All requested landing gates are green. The single required custody merge is complete; Main owns landing. No further scope or merge is planned.

Launcher manifest, budget and one-strike changes are deliberately outside this PR.

Cover converted legacy-route refusal, node-only package ownership, first-conversion root identity, captured service env, and native inspection budgets.
Keep converted installs out of the in-place installer while preserving documented release targets and implicit Git routing.
Keep node-only installs on the package route, check initial service and foreground ownership under the preparation lock, and select the resident service launcher from captured install env.
Honor the existing native inspection budget instead of competing five-second clamps.
Document converted-route refusals, retained recovery precedence, and node-only package updates without Gateway trials.
@clawsweeper

clawsweeper Bot commented Nov 24, 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 gateway Gateway runtime cli CLI command changes commands Command implementations size: L labels Nov 24, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 24, 2026
@clawsweeper

clawsweeper Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head cac1b6204faac493a8a6c111cc3c6b902604af49, but the PR head is now dd83c4f630469428f37069da5482df20ad303a52. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (1 earlier review cycle)
  • reviewed 2026-11-24T20:06:06.675Z sha cac1b62 :: needs changes before merge. :: [P2] Give converted node-only hosts a recovery step that can succeed

Use the package updater's captured absent-Gateway verdict to name node install --force and restart from the updated package.
Keep result guidance synchronous in settled package maintenance: no service scan, state read, release-preparation hook, or foreground-consumer expansion.
Preserve JSON advice and print platform-appropriate commands without claiming a node restart happened.
Cover human and JSON result advice, absence/failure boundaries, and executable Windows commands without invoking native service inspection.
@obviyus
obviyus marked this pull request as ready for review November 24, 2026 20:42
Use bounded strict file-lock identity rather than the SQL owner lease when installed process evidence is inconclusive.
Preserve the shared PowerShell cold-start deadline and avoid treating portless embedded/startup custody as proof that the task stopped.
Observe strict bounded file-lock identity for environment-only Gateway ports without opening the SQL owner lease.
Keep both the listener port and the matching installed candidate PID checks; file custody does not attest Scheduler identity.
Keep the same read-only slot guard before CLI cleanup/run creation and recheck under the preparation lock.
Allow RPC takeover for an opaque live foreground owner, while local-only preparation gets the approved recoverable refusal without a new lock or protocol field.
Preserve real mock exports, captured Bun install env assertions, exact node-result expectations, and file-observer fixture semantics.
Record the reviewed 259-line excess above the 400-line allowance, with each changed test file mapped to its distinct user-visible contract.
Document the installation-specific node owner commands and the rare recoverable first-conversion refusal when an unidentified foreground Gateway cannot accept RPC takeover.
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XL and removed size: L labels Nov 24, 2026
obviyus added a commit that referenced this pull request Nov 25, 2026
## What Problem This Solves

The launcher currently guesses restore coverage by scanning `.pre-<generation>` files. That freezes directory depth, excluded names and ctime policy into the installed launcher. This is the candidate-writer stage of replacing that knowledge with explicit restore intent (related #204394, #204752, #204775, #198389 and #204095).

## User Impact

The active candidate writes `<prefix>/releases/<target-release-id>/.restore` as `{v:1,runId,files:[{live,preimage}]}` before publishing its replayable swap plan or canonical schema/config changes. The trial's existing target release owns the receipt by construction; run IDs are recorded, not compared. Paths are absolute; null pre-images explicitly remove new files and SQLite WAL/SHM/journal/seal companions.

Under exclusive custody, SQLite originals are checkpointed and closed, then their complete main files are hard-linked as adjacent run-bound images. Publication renames a different prepared inode over the live path; it does not modify the image. Normal adjacent images add no database byte copy. The fallback copies bytes only if the filesystem rejects hard linking, recording its cause. No new size admission or disk-copy reservation is added.

Retries within that prepared release reuse immutable images; another release cannot reuse its receipt, including a retry prepared by old2026.11.15 code. A changed or missing restore plan refuses instead of re-imaging mutated state. Known no-upgrade trials record an empty plan under the same exclusive owner. Ordinary non-trial starts are unchanged. Cleanup consumes only the manifest captured by its own candidate process after confirmed committed IPC, never rereading a slot or matching IDs.

## Scope and Compatibility

Legacy `.pre-<generation>` files and `Trial.config` remain in use: today's launcher continues to work and ignores the new manifest. This PR does not enable external stores yet, change the launcher reader, add reader floors, or start in-place migrations. A hard-linked image is valid for this rename-based swap only; the later in-place cutover must use its approved clone/copy pre-image primitive.

The state owner is the only manifest/image writer. UpdateOwner supplied both revisions of the committed-IPC cleanup caller; no `src/update/` file was edited directly here. Receipts stay with their prepared releases. Old retained-image cleanup errors cannot block a different release's no-upgrade preparation; the A-delayed/B-safe regression remains and also deletes A's receipt before invoking its captured cleanup.

## Evidence

On `8b410b54`, isolated AWS checks passed **88 owner tests**; baseline5e5ecba4 failed exactly the two selected missing-manifest/order regressions. The JSON gate positively verified those causes, not an arbitrary exit. A recovered OOM-interrupted broad run was not claimed green. On `cb5abca7`, **35 changed-owner tests**, assertion safety, SQLite worker/dialect guards, core types and targeted production lint passed on32GiB. Targeted test lint found a shadowing fixture variable, now renamed through LSP. CI's Bun lane exposed an orderly `process.exit(0)` WAL fixture; it now uses a real forced crash and retains the physical WAL/data assertions. This review repair also removes stale-run comparisons by per-release scope and captured cleanup. No manual proof on the new scope has run while the required predecessor PRs are pending.

One-worker AWS wall times at8b410b54: writer63.535s, startup63.798s, swap-owner73.935s. The first writer suite included51.888s compiled-worker preparation; the native filesystem/WAL assertions themselves are small. Current-head CI owns its fresh check results.

The real filesystem WAL/config fixtures asserted hard links with zero byte copies; the forced `EXDEV` fixture exercised one actual copy fallback. No genuine cross-device failure was observed. Adjacent images normally share their source's filesystem; individually mounted files or unsupported hard linking can require the fallback. This is not a population-frequency estimate.

**Must not land before #204868 (custody), then #204866 (install owner).** Per the lead's sequence, merge main once after both land, then run the native crash/full-package qualification on that integrated head. No further manual writer proof will run before that point. The hard-link immutability assumption requires custody; checkpointing alone is not claimed to fix the previously observed malformed rollback. The in-place/floor stage separately waits for ReaderFloor.

## Size

`tokei` on all four touched production files, including the update caller, against integrated main25efa334: **1,058 → 1,388 (+330)**. Tests: **+479 net lines**, with a 79-line excess allocation for distinct WAL, durable-ordering, retry, frozen rollback, symlink, captured cleanup and startup contracts. No competing legacy reader is deleted in this explicitly sequenced writer-first stage; its removal belongs to the following reader PR.

## Conflict Integration

Merged main25efa334 once to clear the named conflict. Resolutions retained main's config/include inventory and external/workspace/missing-include fixtures together with the managed-trial manifest case. No `src/update/` conflict or direct edit was involved. No manual proof was run. The later main merge and native crash qualification still wait for the predecessor landing order above.

Co-authored-by: Ayaan Zaidi <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 25, 2026
…ce (#205233)

* fix(ci): preserve updater fixture source and release identity

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* fix(ci): restore the Git pin and resident package in updater acceptance

Worked on by:
- @vincentkoc
- @RomneyDa

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 8e6d786a-d944-493c-88c8-774b069266cd

* fix(ci): expect resident-owner refusal for Git-to-package on guarded targets

Targets with the #204866 ownership guard refuse --channel stable from a resident-owned Git install. The channel-switch lane now asserts that refusal and that the Git install stays in place; older cuts without the guard, including 2026.12.1, still prove the switch.

Co-authored-by: RomneyDa <[email protected]>

Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/plaid-krill-f4610d

Worked on by:
- @vincentkoc
- @RomneyDa

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 8948194f-9c68-8fc2-b08b-98c8dbe3c08b

* test(ci): include the admission report in the parent admission fixture

The update-channel-switch contract now reads update-command-admission-report.ts; the default parent admission fixture must carry it.

Co-authored-by: RomneyDa <[email protected]>

Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/plaid-krill-f4610d

Worked on by:
- @vincentkoc
- @RomneyDa

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 043bf936-fc33-8b39-a692-df58dcd58515

---------

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
tideclaw-bot added a commit that referenced this pull request Nov 25, 2026
…ce (#205233)

* fix(ci): preserve updater fixture source and release identity

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* fix(ci): restore the Git pin and resident package in updater acceptance

Worked on by:
- @vincentkoc
- @RomneyDa

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 8e6d786a-d944-493c-88c8-774b069266cd

* fix(ci): expect resident-owner refusal for Git-to-package on guarded targets

Targets with the #204866 ownership guard refuse --channel stable from a resident-owned Git install. The channel-switch lane now asserts that refusal and that the Git install stays in place; older cuts without the guard, including 2026.12.1, still prove the switch.

Co-authored-by: RomneyDa <[email protected]>

Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/plaid-krill-f4610d

Worked on by:
- @vincentkoc
- @RomneyDa

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 8948194f-9c68-8fc2-b08b-98c8dbe3c08b

* test(ci): include the admission report in the parent admission fixture

The update-channel-switch contract now reads update-command-admission-report.ts; the default parent admission fixture must carry it.

Co-authored-by: RomneyDa <[email protected]>

Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/plaid-krill-f4610d

Worked on by:
- @vincentkoc
- @RomneyDa

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 043bf936-fc33-8b39-a692-df58dcd58515

---------

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
(cherry picked from commit ded2602)
obviyus added a commit that referenced this pull request Nov 26, 2026
Closes #205617
Related: #204516, #204866

## What Problem This Solves

After an update has converted an installation to resident releases, `gateway install --force` can replace the launcher with the current package's `dist/index.js`. The Gateway can still answer health checks, but its pending trial loses the resident ready/rollback owner. Reusing a checked durable CLI can bypass the launcher for the same reason.

## User Impact

Ordinary Gateway installs and reinstalls keep the selected state directory's resident launcher, including a first pending trial whose previous version is still an unmodified npm package. Explicit retained-CLI recovery keeps precedence; separate node services, unowned npm installs, and supported legacy forwarding-package layouts keep their existing entries. No flag, schema, trial-format or protocol change.

## Why This Change Was Made

The existing release ownership predicate already knows that a published release **or v2 trial** owns the installation. Move that unchanged predicate into the existing release store and use it in the service selector; retain the existing legacy forwarding-package probe. Delete the competing inference that an ordinary install must identify its owner only from the currently serving package.

A checked same-version durable copy now uses the same service-specific planned entry as a new durable install, rather than masquerading as an explicit recovery override. The raw-string durable reuse return and its unused path calculation are removed; retained recovery strings and node entry rules are unchanged. The shared install-plan composition remains unchanged.

An unreadable/malformed trial is not silently ignored by reinstall: the existing store reader fails visibly instead of guessing a different service owner. Launcher-file existence alone does not establish ownership.

Scoped tokei production code (seven touched production files, tests excluded): **2,495 → 2,498 (+3)**. No line-cap exemption or guard compression. The updating contract is updated.

## Evidence

- Pinned base: `90297095602f362f3af2353a6a718c6867dad203`.
- **Red on base:** [AWS run_c1fd8b7dc8d3b4039c9990aa60d04f68](https://crabbox.openclaw.ai/portal/runs/run_c1fd8b7dc8d3b4039c9990aa60d04f68). The real `buildGatewayInstallPlan`/argument builder returned npm `dist/index.js` instead of the launcher for the pending plain-npm fallback; checked Gateway durable reuse returned its durable `dist/index.js` instead of the launcher. Both expected assertions failed. Settled release, legacy forwarding, orphan-launcher and node controls passed (2 failed / 4 passed selected cases); no assertion or expectation was narrowed.
- **Green:** [AWS run_ddbc17a2ba58265e394c69f8bd77071d](https://crabbox.openclaw.ai/portal/runs/run_ddbc17a2ba58265e394c69f8bd77071d): **55 tests passed in four suites**, production core types plus command/service test-project types passed, exact changed-file lint and test-line guard passed (+68 before formatting, allowance400). Two formatting-only repairs were captured from AWS oxfmt and applied exactly; no behavior/type rerun. Formatting passed in [AWS run_40c90a984fcc254b4765ae94d92f4302](https://crabbox.openclaw.ai/portal/runs/run_40c90a984fcc254b4765ae94d92f4302).
- **Linux product gate PASSED:** [run_bac6c35b5f73cb91506fe10ff177aac8](https://crabbox.openclaw.ai/portal/runs/run_bac6c35b5f73cb91506fe10ff177aac8). Published10→head; ordinary `gateway install --force` **without --wrapper** wrote actual `openclaw-launcher.mjs` (native MainPID50978). Same prepared trial `fc340ad2-4263-432e-8490-e478ba20e1f1` committed/succeeded (actual attempts2); authenticated serving connection reported2026.11.11-beta.1 and matching successor build, schema43 verified. Next public run `da46ec0a-1ec1-46a5-9fce-1a5c5c1092b2` was admitted, packed/installed/maintained, and finished `skipped/already-current` rather than stuck active; **no third release trial is claimed**. The corrected fixture allows legitimate phase progress during install-and-start while pinning immutable trial identity. Native stop/uninstall and npm-config cleanup passed; exact AWS leasecbx_f402bce8b884 released with `--wait`, exit0.
- Source qualification: product build/proof uses pre-format carrier **5a9b2d43e7533d0ff1af9ac7fbae29ade472b6fd**. Its exact diff to PR head90e1fa0147 is only two formatting hunks: a test statement wrap and a Promise type-union wrap erased at build. Main accepted formatting-only equivalence for product bytes, **not exact-source identity**; no stamp rewriting or rebuild. No native result or trial was fabricated. Full facts/hashes/source capsules: `direction-2026-11-24/UpdateOwner-reinstall-linux-receipt.json` and `UpdateOwner-reinstall-linux-artifacts/fresh-receipts.tgz`.
- Exact-head local review is complete: patch correct, security cleared, no findings, confidence0.88 (`~/.cache/clawsweeper-local-review/90e1fa014790.md`). The product-path gap noted at review is covered by the passing native receipt above. CI pending; no Windows/macOS proof claimed.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 26, 2026
## What Problem This Solves

Two update paths could claim the same installation. A converted install could fall into the retained in-place updater; reinstalling its Gateway from an unmarked npm entry could replace the resident launcher. Before first conversion, a different npm root could also claim an empty state slot. Node-only hosts were sent into a Gateway trial with nobody to activate it.

Related: openclaw#204516, openclaw#203807, openclaw#204266, and the converted-install legacy fall-through. openclaw#203628's runtime selection is a separate release-runtime issue, not changed here. openclaw#204515 npm adoption behavior is retained.

## User Impact

- Converted installs stay with their resident launcher. Installer-kind switches and immutable activation refuse with a reason and next step instead of replacing it; dry runs retain the existing read-only preview.
- Ordinary and planned Gateway service installs select the verified launcher for the captured state directory; explicit retained recovery entrypoints still win.
- Before conversion, node-only package installs with a node service but no Gateway definition or live local Gateway keep their package route; no launcher, forwarding entry or pending Gateway trial is created. Node-only Git checkouts keep the release updater and requested `--sha`. Already-converted installs keep their resident release owner, including `--no-restart` preparation after the Gateway service was removed.
- Node-only package results name the updated installation's `node install --force` and `node restart` commands. They do not claim a retained node runtime was restarted, and guidance consumes captured result facts without a new service scan or state read.
- Documented versions, dist-tags, npm specs/artifacts, deferred restart and implicit Git channel selection keep their existing behavior.
- Windows process snapshots honor the existing native inspection budget instead of two hidden five-second ceilings. Unknown inspection remains distinct from proof that a service stopped.

## Ownership Cut

The existing admission adapter owns the release-versus-package decision; the complete release routing block moved there to keep `update-command.ts` below its 700-line ratchet. The same read-only ownership guard stays before CLI cleanup/run creation and is rechecked under preparation's lock. Final service argument selection replaces the old invocation-based launcher selector. No new persistent state, schema, marker or flag.

After the single custody integration, production `tokei` code on this PR's eleven touched runtime files, excluding tests/support/harness: **4,595 → 4,814 (+219)** against integrated main `44d311177c0f4e86eb4ecb6828371c9eaa81b4f6`. Shared native-observer changes already landed in openclaw#204868 and are no longer counted here. No unrelated deletion was used to meet a line quota.

## Evidence

AWS [targeted proof](https://crabbox.openclaw.ai/portal/runs/run_8314f1f6e7468775618b5e1b8125915c) passed **151 tests across nine files**: routing 14, service entry/planning 62, Windows inspection 75. These lanes ran independently on Linux; the Windows lane uses native-inspection mocks, not a Windows live claim. Runtime source is `b59eee4e13b3a71725b69a914211eea9e7ae75ad`; the subsequent commit is documentation-only.

The [qualified base comparison](https://crabbox.openclaw.ai/portal/runs/run_59926da4d8eb490b0855d67398d0fcd1) has **18 intended assertion failures and 133 passing controls**: routing eight, service-entry/planning four, inspection budgets six. Earlier archived-checkout dependency failures were fixture setup, not product reds; fixed green lanes were not rerun for that repair.

## Integration and remaining proof

The scheduled-task SQL-to-file observer hunk is shared with openclaw#204868; the second PR to land rebases the identical hunk rather than maintaining an independent variant.

A rare first-conversion refusal applies when a live foreground Gateway's root is opaque and it cannot accept the requested update over RPC. With operator access, the Gateway can classify its own argv and handle `update.run`. Otherwise the message offers Control UI/operator-access update or stopping the Gateway through its existing owner and rerunning. No lock or protocol field was added.

Against integrated main, the test change measures **+740 lines**, with **340 reviewed allocation lines** above the normal 400-line allowance. `config/test-lines-allocations/204866-install-update-owner.txt` maps the thirteen changed test files to their contracts; upstream-owned native-observer credit was removed. Existing controls preserve package routing, Git SHA, converted/legacy ownership and immutable inspection-only output.

The two existing legacy-layout launcher cases in `git-release.test.ts` now pass the captured state environment and `{ planned: entry }`, retaining both launcher and legacy path assertions. An explicit string entrypoint is reserved for `--restore-service-cli` and must win over ordinary launcher selection; those cases represent ordinary installation planning, not recovery.

The retained legacy service-staging producer resolves its release launcher before passing an explicit service CLI (`d831dde27f`). CI on that head proved the three unchanged no-restart staging cases red: the selector still treated the explicit launcher as a package CLI root. `dd83c4f630` repairs that single selector by directly selecting a recognized accessible Gateway launcher, preserving Node and other recovery strings. [Focused AWS proof](https://crabbox.openclaw.ai/portal/runs/run_cfcb09aada70caf4e34f1ea6f25fb287) passed all three regressions, the existing launcher control, and all four service-entry controls: **8 passed**, unchanged assertions. The 38 unrelated service cases were intentionally excluded by the focused name filter.

Final head `2536f8aea4` passed [CI](https://github.com/openclaw/openclaw/actions/runs/45544076053) and the [security/aggregate gate](https://github.com/openclaw/openclaw/actions/runs/45548330474): **70 successful checks, none pending or failed**. It differs from reviewed/Linux-qualified `48e606149e` only by three local test-helper rename substitutions fixing no-shadow; assertions and production bytes are identical. Main's exact-head and delta reviews are clean.

- [Integrated AWS qualification](https://crabbox.openclaw.ai/portal/runs/run_e165cd4d147a24e0808417237069d4ae) passed: current owner/preview/merge controls, full build, package integrity, and real Linux stable **2026.11.9** upgrade flows. Deferred conversion staged the launcher and committed on public restart; read-only-npm PATH service reinstall kept launcher ExecStart, committed the same pending trial, and the following update committed. A converted node-only install prepared a pending release without activating it; an unconverted node-only install used npm with no trial and named exact install/restart commands rather than claiming activation. Source `48e606149e` is production-identical to final `2536f8aea4`. Healthy relabels retain that source; this is not a schema-bump or live-Windows claim. Historical shallow-Git setup failed before tests and is not a merge gate.
- Windows 11 ARM64 status/restart follows the exclusively owned custody lane; per maintainer direction it can be recorded after landing. No live-Windows pass is claimed.
- All requested landing gates are green. The single required custody merge is complete; Main owns landing. No further scope or merge is planned.

Launcher manifest, budget and one-strike changes are deliberately outside this PR.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 26, 2026
## What Problem This Solves

The launcher currently guesses restore coverage by scanning `.pre-<generation>` files. That freezes directory depth, excluded names and ctime policy into the installed launcher. This is the candidate-writer stage of replacing that knowledge with explicit restore intent (related openclaw#204394, openclaw#204752, openclaw#204775, openclaw#198389 and openclaw#204095).

## User Impact

The active candidate writes `<prefix>/releases/<target-release-id>/.restore` as `{v:1,runId,files:[{live,preimage}]}` before publishing its replayable swap plan or canonical schema/config changes. The trial's existing target release owns the receipt by construction; run IDs are recorded, not compared. Paths are absolute; null pre-images explicitly remove new files and SQLite WAL/SHM/journal/seal companions.

Under exclusive custody, SQLite originals are checkpointed and closed, then their complete main files are hard-linked as adjacent run-bound images. Publication renames a different prepared inode over the live path; it does not modify the image. Normal adjacent images add no database byte copy. The fallback copies bytes only if the filesystem rejects hard linking, recording its cause. No new size admission or disk-copy reservation is added.

Retries within that prepared release reuse immutable images; another release cannot reuse its receipt, including a retry prepared by old2026.11.15 code. A changed or missing restore plan refuses instead of re-imaging mutated state. Known no-upgrade trials record an empty plan under the same exclusive owner. Ordinary non-trial starts are unchanged. Cleanup consumes only the manifest captured by its own candidate process after confirmed committed IPC, never rereading a slot or matching IDs.

## Scope and Compatibility

Legacy `.pre-<generation>` files and `Trial.config` remain in use: today's launcher continues to work and ignores the new manifest. This PR does not enable external stores yet, change the launcher reader, add reader floors, or start in-place migrations. A hard-linked image is valid for this rename-based swap only; the later in-place cutover must use its approved clone/copy pre-image primitive.

The state owner is the only manifest/image writer. UpdateOwner supplied both revisions of the committed-IPC cleanup caller; no `src/update/` file was edited directly here. Receipts stay with their prepared releases. Old retained-image cleanup errors cannot block a different release's no-upgrade preparation; the A-delayed/B-safe regression remains and also deletes A's receipt before invoking its captured cleanup.

## Evidence

On `8b410b54`, isolated AWS checks passed **88 owner tests**; baseline5e5ecba4 failed exactly the two selected missing-manifest/order regressions. The JSON gate positively verified those causes, not an arbitrary exit. A recovered OOM-interrupted broad run was not claimed green. On `cb5abca7`, **35 changed-owner tests**, assertion safety, SQLite worker/dialect guards, core types and targeted production lint passed on32GiB. Targeted test lint found a shadowing fixture variable, now renamed through LSP. CI's Bun lane exposed an orderly `process.exit(0)` WAL fixture; it now uses a real forced crash and retains the physical WAL/data assertions. This review repair also removes stale-run comparisons by per-release scope and captured cleanup. No manual proof on the new scope has run while the required predecessor PRs are pending.

One-worker AWS wall times at8b410b54: writer63.535s, startup63.798s, swap-owner73.935s. The first writer suite included51.888s compiled-worker preparation; the native filesystem/WAL assertions themselves are small. Current-head CI owns its fresh check results.

The real filesystem WAL/config fixtures asserted hard links with zero byte copies; the forced `EXDEV` fixture exercised one actual copy fallback. No genuine cross-device failure was observed. Adjacent images normally share their source's filesystem; individually mounted files or unsupported hard linking can require the fallback. This is not a population-frequency estimate.

**Must not land before openclaw#204868 (custody), then openclaw#204866 (install owner).** Per the lead's sequence, merge main once after both land, then run the native crash/full-package qualification on that integrated head. No further manual writer proof will run before that point. The hard-link immutability assumption requires custody; checkpointing alone is not claimed to fix the previously observed malformed rollback. The in-place/floor stage separately waits for ReaderFloor.

## Size

`tokei` on all four touched production files, including the update caller, against integrated main25efa334: **1,058 → 1,388 (+330)**. Tests: **+479 net lines**, with a 79-line excess allocation for distinct WAL, durable-ordering, retry, frozen rollback, symlink, captured cleanup and startup contracts. No competing legacy reader is deleted in this explicitly sequenced writer-first stage; its removal belongs to the following reader PR.

## Conflict Integration

Merged main25efa334 once to clear the named conflict. Resolutions retained main's config/include inventory and external/workspace/missing-include fixtures together with the managed-trial manifest case. No `src/update/` conflict or direct edit was involved. No manual proof was run. The later main merge and native crash qualification still wait for the predecessor landing order above.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 26, 2026
…ce (openclaw#205233)

* fix(ci): preserve updater fixture source and release identity

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* fix(ci): restore the Git pin and resident package in updater acceptance

Worked on by:
- @vincentkoc
- @RomneyDa

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 8e6d786a-d944-493c-88c8-774b069266cd

* fix(ci): expect resident-owner refusal for Git-to-package on guarded targets

Targets with the openclaw#204866 ownership guard refuse --channel stable from a resident-owned Git install. The channel-switch lane now asserts that refusal and that the Git install stays in place; older cuts without the guard, including 2026.12.1, still prove the switch.

Co-authored-by: RomneyDa <[email protected]>

Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/plaid-krill-f4610d

Worked on by:
- @vincentkoc
- @RomneyDa

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 8948194f-9c68-8fc2-b08b-98c8dbe3c08b

* test(ci): include the admission report in the parent admission fixture

The update-channel-switch contract now reads update-command-admission-report.ts; the default parent admission fixture must carry it.

Co-authored-by: RomneyDa <[email protected]>

Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/plaid-krill-f4610d

Worked on by:
- @vincentkoc
- @RomneyDa

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 043bf936-fc33-8b39-a692-df58dcd58515

---------

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 26, 2026
…05655)

Closes openclaw#205617
Related: openclaw#204516, openclaw#204866

## What Problem This Solves

After an update has converted an installation to resident releases, `gateway install --force` can replace the launcher with the current package's `dist/index.js`. The Gateway can still answer health checks, but its pending trial loses the resident ready/rollback owner. Reusing a checked durable CLI can bypass the launcher for the same reason.

## User Impact

Ordinary Gateway installs and reinstalls keep the selected state directory's resident launcher, including a first pending trial whose previous version is still an unmodified npm package. Explicit retained-CLI recovery keeps precedence; separate node services, unowned npm installs, and supported legacy forwarding-package layouts keep their existing entries. No flag, schema, trial-format or protocol change.

## Why This Change Was Made

The existing release ownership predicate already knows that a published release **or v2 trial** owns the installation. Move that unchanged predicate into the existing release store and use it in the service selector; retain the existing legacy forwarding-package probe. Delete the competing inference that an ordinary install must identify its owner only from the currently serving package.

A checked same-version durable copy now uses the same service-specific planned entry as a new durable install, rather than masquerading as an explicit recovery override. The raw-string durable reuse return and its unused path calculation are removed; retained recovery strings and node entry rules are unchanged. The shared install-plan composition remains unchanged.

An unreadable/malformed trial is not silently ignored by reinstall: the existing store reader fails visibly instead of guessing a different service owner. Launcher-file existence alone does not establish ownership.

Scoped tokei production code (seven touched production files, tests excluded): **2,495 → 2,498 (+3)**. No line-cap exemption or guard compression. The updating contract is updated.

## Evidence

- Pinned base: `7fa79a55c4cf9eafe50b4e161e28e00e4e147e06`.
- **Red on base:** [AWS run_c1fd8b7dc8d3b4039c9990aa60d04f68](https://crabbox.openclaw.ai/portal/runs/run_c1fd8b7dc8d3b4039c9990aa60d04f68). The real `buildGatewayInstallPlan`/argument builder returned npm `dist/index.js` instead of the launcher for the pending plain-npm fallback; checked Gateway durable reuse returned its durable `dist/index.js` instead of the launcher. Both expected assertions failed. Settled release, legacy forwarding, orphan-launcher and node controls passed (2 failed / 4 passed selected cases); no assertion or expectation was narrowed.
- **Green:** [AWS run_ddbc17a2ba58265e394c69f8bd77071d](https://crabbox.openclaw.ai/portal/runs/run_ddbc17a2ba58265e394c69f8bd77071d): **55 tests passed in four suites**, production core types plus command/service test-project types passed, exact changed-file lint and test-line guard passed (+68 before formatting, allowance400). Two formatting-only repairs were captured from AWS oxfmt and applied exactly; no behavior/type rerun. Formatting passed in [AWS run_40c90a984fcc254b4765ae94d92f4302](https://crabbox.openclaw.ai/portal/runs/run_40c90a984fcc254b4765ae94d92f4302).
- **Linux product gate PASSED:** [run_bac6c35b5f73cb91506fe10ff177aac8](https://crabbox.openclaw.ai/portal/runs/run_bac6c35b5f73cb91506fe10ff177aac8). Published10→head; ordinary `gateway install --force` **without --wrapper** wrote actual `openclaw-launcher.mjs` (native MainPID50978). Same prepared trial `fc340ad2-4263-432e-8490-e478ba20e1f1` committed/succeeded (actual attempts2); authenticated serving connection reported2026.11.11-beta.1 and matching successor build, schema43 verified. Next public run `da46ec0a-1ec1-46a5-9fce-1a5c5c1092b2` was admitted, packed/installed/maintained, and finished `skipped/already-current` rather than stuck active; **no third release trial is claimed**. The corrected fixture allows legitimate phase progress during install-and-start while pinning immutable trial identity. Native stop/uninstall and npm-config cleanup passed; exact AWS leasecbx_f402bce8b884 released with `--wait`, exit0.
- Source qualification: product build/proof uses pre-format carrier **5a9b2d43e7533d0ff1af9ac7fbae29ade472b6fd**. Its exact diff to PR head90e1fa0147 is only two formatting hunks: a test statement wrap and a Promise type-union wrap erased at build. Main accepted formatting-only equivalence for product bytes, **not exact-source identity**; no stamp rewriting or rebuild. No native result or trial was fabricated. Full facts/hashes/source capsules: `direction-2026-11-24/UpdateOwner-reinstall-linux-receipt.json` and `UpdateOwner-reinstall-linux-artifacts/fresh-receipts.tgz`.
- Exact-head local review is complete: patch correct, security cleared, no findings, confidence0.88 (`~/.cache/clawsweeper-local-review/90e1fa014790.md`). The product-path gap noted at review is covered by the passing native receipt above. CI pending; no Windows/macOS proof claimed.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 26, 2026
## What Problem This Solves

Two update paths could claim the same installation. A converted install could fall into the retained in-place updater; reinstalling its Gateway from an unmarked npm entry could replace the resident launcher. Before first conversion, a different npm root could also claim an empty state slot. Node-only hosts were sent into a Gateway trial with nobody to activate it.

Related: #204516, #203807, #204266, and the converted-install legacy fall-through. #203628's runtime selection is a separate release-runtime issue, not changed here. #204515 npm adoption behavior is retained.

## User Impact

- Converted installs stay with their resident launcher. Installer-kind switches and immutable activation refuse with a reason and next step instead of replacing it; dry runs retain the existing read-only preview.
- Ordinary and planned Gateway service installs select the verified launcher for the captured state directory; explicit retained recovery entrypoints still win.
- Before conversion, node-only package installs with a node service but no Gateway definition or live local Gateway keep their package route; no launcher, forwarding entry or pending Gateway trial is created. Node-only Git checkouts keep the release updater and requested `--sha`. Already-converted installs keep their resident release owner, including `--no-restart` preparation after the Gateway service was removed.
- Node-only package results name the updated installation's `node install --force` and `node restart` commands. They do not claim a retained node runtime was restarted, and guidance consumes captured result facts without a new service scan or state read.
- Documented versions, dist-tags, npm specs/artifacts, deferred restart and implicit Git channel selection keep their existing behavior.
- Windows process snapshots honor the existing native inspection budget instead of two hidden five-second ceilings. Unknown inspection remains distinct from proof that a service stopped.

## Ownership Cut

The existing admission adapter owns the release-versus-package decision; the complete release routing block moved there to keep `update-command.ts` below its 700-line ratchet. The same read-only ownership guard stays before CLI cleanup/run creation and is rechecked under preparation's lock. Final service argument selection replaces the old invocation-based launcher selector. No new persistent state, schema, marker or flag.

After the single custody integration, production `tokei` code on this PR's eleven touched runtime files, excluding tests/support/harness: **4,595 → 4,814 (+219)** against integrated main `8aaf3820112a4755d9aebb431e6c247b6d5d5412`. Shared native-observer changes already landed in #204868 and are no longer counted here. No unrelated deletion was used to meet a line quota.

## Evidence

AWS [targeted proof](https://crabbox.openclaw.ai/portal/runs/run_8314f1f6e7468775618b5e1b8125915c) passed **151 tests across nine files**: routing 14, service entry/planning 62, Windows inspection 75. These lanes ran independently on Linux; the Windows lane uses native-inspection mocks, not a Windows live claim. Runtime source is `b59eee4e13b3a71725b69a914211eea9e7ae75ad`; the subsequent commit is documentation-only.

The [qualified base comparison](https://crabbox.openclaw.ai/portal/runs/run_59926da4d8eb490b0855d67398d0fcd1) has **18 intended assertion failures and 133 passing controls**: routing eight, service-entry/planning four, inspection budgets six. Earlier archived-checkout dependency failures were fixture setup, not product reds; fixed green lanes were not rerun for that repair.

## Integration and remaining proof

The scheduled-task SQL-to-file observer hunk is shared with #204868; the second PR to land rebases the identical hunk rather than maintaining an independent variant.

A rare first-conversion refusal applies when a live foreground Gateway's root is opaque and it cannot accept the requested update over RPC. With operator access, the Gateway can classify its own argv and handle `update.run`. Otherwise the message offers Control UI/operator-access update or stopping the Gateway through its existing owner and rerunning. No lock or protocol field was added.

Against integrated main, the test change measures **+740 lines**, with **340 reviewed allocation lines** above the normal 400-line allowance. `config/test-lines-allocations/204866-install-update-owner.txt` maps the thirteen changed test files to their contracts; upstream-owned native-observer credit was removed. Existing controls preserve package routing, Git SHA, converted/legacy ownership and immutable inspection-only output.

The two existing legacy-layout launcher cases in `git-release.test.ts` now pass the captured state environment and `{ planned: entry }`, retaining both launcher and legacy path assertions. An explicit string entrypoint is reserved for `--restore-service-cli` and must win over ordinary launcher selection; those cases represent ordinary installation planning, not recovery.

The retained legacy service-staging producer resolves its release launcher before passing an explicit service CLI (`d831dde27f`). CI on that head proved the three unchanged no-restart staging cases red: the selector still treated the explicit launcher as a package CLI root. `dd83c4f630` repairs that single selector by directly selecting a recognized accessible Gateway launcher, preserving Node and other recovery strings. [Focused AWS proof](https://crabbox.openclaw.ai/portal/runs/run_cfcb09aada70caf4e34f1ea6f25fb287) passed all three regressions, the existing launcher control, and all four service-entry controls: **8 passed**, unchanged assertions. The 38 unrelated service cases were intentionally excluded by the focused name filter.

Final head `2536f8aea4` passed [CI](https://github.com/openclaw/openclaw/actions/runs/45544076053) and the [security/aggregate gate](https://github.com/openclaw/openclaw/actions/runs/45548330474): **70 successful checks, none pending or failed**. It differs from reviewed/Linux-qualified `48e606149e` only by three local test-helper rename substitutions fixing no-shadow; assertions and production bytes are identical. Main's exact-head and delta reviews are clean.

- [Integrated AWS qualification](https://crabbox.openclaw.ai/portal/runs/run_e165cd4d147a24e0808417237069d4ae) passed: current owner/preview/merge controls, full build, package integrity, and real Linux stable **2026.11.9** upgrade flows. Deferred conversion staged the launcher and committed on public restart; read-only-npm PATH service reinstall kept launcher ExecStart, committed the same pending trial, and the following update committed. A converted node-only install prepared a pending release without activating it; an unconverted node-only install used npm with no trial and named exact install/restart commands rather than claiming activation. Source `48e606149e` is production-identical to final `2536f8aea4`. Healthy relabels retain that source; this is not a schema-bump or live-Windows claim. Historical shallow-Git setup failed before tests and is not a merge gate.
- Windows 11 ARM64 status/restart follows the exclusively owned custody lane; per maintainer direction it can be recorded after landing. No live-Windows pass is claimed.
- All requested landing gates are green. The single required custody merge is complete; Main owns landing. No further scope or merge is planned.

Launcher manifest, budget and one-strike changes are deliberately outside this PR.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 0fea252)

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 26, 2026
## What Problem This Solves

The launcher currently guesses restore coverage by scanning `.pre-<generation>` files. That freezes directory depth, excluded names and ctime policy into the installed launcher. This is the candidate-writer stage of replacing that knowledge with explicit restore intent (related #204394, #204752, #204775, #198389 and #204095).

## User Impact

The active candidate writes `<prefix>/releases/<target-release-id>/.restore` as `{v:1,runId,files:[{live,preimage}]}` before publishing its replayable swap plan or canonical schema/config changes. The trial's existing target release owns the receipt by construction; run IDs are recorded, not compared. Paths are absolute; null pre-images explicitly remove new files and SQLite WAL/SHM/journal/seal companions.

Under exclusive custody, SQLite originals are checkpointed and closed, then their complete main files are hard-linked as adjacent run-bound images. Publication renames a different prepared inode over the live path; it does not modify the image. Normal adjacent images add no database byte copy. The fallback copies bytes only if the filesystem rejects hard linking, recording its cause. No new size admission or disk-copy reservation is added.

Retries within that prepared release reuse immutable images; another release cannot reuse its receipt, including a retry prepared by old2026.11.15 code. A changed or missing restore plan refuses instead of re-imaging mutated state. Known no-upgrade trials record an empty plan under the same exclusive owner. Ordinary non-trial starts are unchanged. Cleanup consumes only the manifest captured by its own candidate process after confirmed committed IPC, never rereading a slot or matching IDs.

## Scope and Compatibility

Legacy `.pre-<generation>` files and `Trial.config` remain in use: today's launcher continues to work and ignores the new manifest. This PR does not enable external stores yet, change the launcher reader, add reader floors, or start in-place migrations. A hard-linked image is valid for this rename-based swap only; the later in-place cutover must use its approved clone/copy pre-image primitive.

The state owner is the only manifest/image writer. UpdateOwner supplied both revisions of the committed-IPC cleanup caller; no `src/update/` file was edited directly here. Receipts stay with their prepared releases. Old retained-image cleanup errors cannot block a different release's no-upgrade preparation; the A-delayed/B-safe regression remains and also deletes A's receipt before invoking its captured cleanup.

## Evidence

On `8b410b54`, isolated AWS checks passed **88 owner tests**; baseline5e5ecba4 failed exactly the two selected missing-manifest/order regressions. The JSON gate positively verified those causes, not an arbitrary exit. A recovered OOM-interrupted broad run was not claimed green. On `cb5abca7`, **35 changed-owner tests**, assertion safety, SQLite worker/dialect guards, core types and targeted production lint passed on32GiB. Targeted test lint found a shadowing fixture variable, now renamed through LSP. CI's Bun lane exposed an orderly `process.exit(0)` WAL fixture; it now uses a real forced crash and retains the physical WAL/data assertions. This review repair also removes stale-run comparisons by per-release scope and captured cleanup. No manual proof on the new scope has run while the required predecessor PRs are pending.

One-worker AWS wall times at8b410b54: writer63.535s, startup63.798s, swap-owner73.935s. The first writer suite included51.888s compiled-worker preparation; the native filesystem/WAL assertions themselves are small. Current-head CI owns its fresh check results.

The real filesystem WAL/config fixtures asserted hard links with zero byte copies; the forced `EXDEV` fixture exercised one actual copy fallback. No genuine cross-device failure was observed. Adjacent images normally share their source's filesystem; individually mounted files or unsupported hard linking can require the fallback. This is not a population-frequency estimate.

**Must not land before #204868 (custody), then #204866 (install owner).** Per the lead's sequence, merge main once after both land, then run the native crash/full-package qualification on that integrated head. No further manual writer proof will run before that point. The hard-link immutability assumption requires custody; checkpointing alone is not claimed to fix the previously observed malformed rollback. The in-place/floor stage separately waits for ReaderFloor.

## Size

`tokei` on all four touched production files, including the update caller, against integrated main25efa334: **1,058 → 1,388 (+330)**. Tests: **+479 net lines**, with a 79-line excess allocation for distinct WAL, durable-ordering, retry, frozen rollback, symlink, captured cleanup and startup contracts. No competing legacy reader is deleted in this explicitly sequenced writer-first stage; its removal belongs to the following reader PR.

## Conflict Integration

Merged main25efa334 once to clear the named conflict. Resolutions retained main's config/include inventory and external/workspace/missing-include fixtures together with the managed-trial manifest case. No `src/update/` conflict or direct edit was involved. No manual proof was run. The later main merge and native crash qualification still wait for the predecessor landing order above.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 31c4e6b)

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 26, 2026
Closes #205617
Related: #204516, #204866

## What Problem This Solves

After an update has converted an installation to resident releases, `gateway install --force` can replace the launcher with the current package's `dist/index.js`. The Gateway can still answer health checks, but its pending trial loses the resident ready/rollback owner. Reusing a checked durable CLI can bypass the launcher for the same reason.

## User Impact

Ordinary Gateway installs and reinstalls keep the selected state directory's resident launcher, including a first pending trial whose previous version is still an unmodified npm package. Explicit retained-CLI recovery keeps precedence; separate node services, unowned npm installs, and supported legacy forwarding-package layouts keep their existing entries. No flag, schema, trial-format or protocol change.

## Why This Change Was Made

The existing release ownership predicate already knows that a published release **or v2 trial** owns the installation. Move that unchanged predicate into the existing release store and use it in the service selector; retain the existing legacy forwarding-package probe. Delete the competing inference that an ordinary install must identify its owner only from the currently serving package.

A checked same-version durable copy now uses the same service-specific planned entry as a new durable install, rather than masquerading as an explicit recovery override. The raw-string durable reuse return and its unused path calculation are removed; retained recovery strings and node entry rules are unchanged. The shared install-plan composition remains unchanged.

An unreadable/malformed trial is not silently ignored by reinstall: the existing store reader fails visibly instead of guessing a different service owner. Launcher-file existence alone does not establish ownership.

Scoped tokei production code (seven touched production files, tests excluded): **2,495 → 2,498 (+3)**. No line-cap exemption or guard compression. The updating contract is updated.

## Evidence

- Pinned base: `90297095602f362f3af2353a6a718c6867dad203`.
- **Red on base:** [AWS run_c1fd8b7dc8d3b4039c9990aa60d04f68](https://crabbox.openclaw.ai/portal/runs/run_c1fd8b7dc8d3b4039c9990aa60d04f68). The real `buildGatewayInstallPlan`/argument builder returned npm `dist/index.js` instead of the launcher for the pending plain-npm fallback; checked Gateway durable reuse returned its durable `dist/index.js` instead of the launcher. Both expected assertions failed. Settled release, legacy forwarding, orphan-launcher and node controls passed (2 failed / 4 passed selected cases); no assertion or expectation was narrowed.
- **Green:** [AWS run_ddbc17a2ba58265e394c69f8bd77071d](https://crabbox.openclaw.ai/portal/runs/run_ddbc17a2ba58265e394c69f8bd77071d): **55 tests passed in four suites**, production core types plus command/service test-project types passed, exact changed-file lint and test-line guard passed (+68 before formatting, allowance400). Two formatting-only repairs were captured from AWS oxfmt and applied exactly; no behavior/type rerun. Formatting passed in [AWS run_40c90a984fcc254b4765ae94d92f4302](https://crabbox.openclaw.ai/portal/runs/run_40c90a984fcc254b4765ae94d92f4302).
- **Linux product gate PASSED:** [run_bac6c35b5f73cb91506fe10ff177aac8](https://crabbox.openclaw.ai/portal/runs/run_bac6c35b5f73cb91506fe10ff177aac8). Published10→head; ordinary `gateway install --force` **without --wrapper** wrote actual `openclaw-launcher.mjs` (native MainPID50978). Same prepared trial `fc340ad2-4263-432e-8490-e478ba20e1f1` committed/succeeded (actual attempts2); authenticated serving connection reported2026.11.11-beta.1 and matching successor build, schema43 verified. Next public run `da46ec0a-1ec1-46a5-9fce-1a5c5c1092b2` was admitted, packed/installed/maintained, and finished `skipped/already-current` rather than stuck active; **no third release trial is claimed**. The corrected fixture allows legitimate phase progress during install-and-start while pinning immutable trial identity. Native stop/uninstall and npm-config cleanup passed; exact AWS leasecbx_f402bce8b884 released with `--wait`, exit0.
- Source qualification: product build/proof uses pre-format carrier **5a9b2d43e7533d0ff1af9ac7fbae29ade472b6fd**. Its exact diff to PR head90e1fa0147 is only two formatting hunks: a test statement wrap and a Promise type-union wrap erased at build. Main accepted formatting-only equivalence for product bytes, **not exact-source identity**; no stamp rewriting or rebuild. No native result or trial was fabricated. Full facts/hashes/source capsules: `direction-2026-11-24/UpdateOwner-reinstall-linux-receipt.json` and `UpdateOwner-reinstall-linux-artifacts/fresh-receipts.tgz`.
- Exact-head local review is complete: patch correct, security cleared, no findings, confidence0.88 (`~/.cache/clawsweeper-local-review/90e1fa014790.md`). The product-path gap noted at review is covered by the passing native receipt above. CI pending; no Windows/macOS proof claimed.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit b9d0210)

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
obviyus added a commit that referenced this pull request Nov 26, 2026
## What Problem This Solves

A same-version Git update can leave bundled plugins pinned to an older release directory. The new core starts, but post-update plugin activation rejects the stale installation claim and can abort the reload batch.

Related: #204866, #205655.

## User Impact

Packaged bundled plugins follow the selected core without a second path-install owner. User settings and explicit local/source-checkout selections stay intact; this does not uninstall plugins or delete their code. Existing registered Git-plugin peer-link repair stays in its current owner.

No schema, stored-record shape, launcher format, or public plugin API changes.

## Why This Change Was Made

The existing stale-record owner ran after channel synchronization and required a different package version. Retire proven foreign compiled-bundle records before planning, using the existing physical ownership policy instead of version and path-string guesses. Dev synchronization also stops creating redundant records for packaged bundles. The late competing prune operation and its obsolete wrapper are removed.

Production code on this PR's three runtime files, measured with `tokei` against `81bc5ec79fe4`: **848 → 829 lines (−19)**. Net test lines: **+21**. Record retirement and development-channel synchronization use one loop.

## Evidence

- Base regression: **9 intended assertion failures / 8 passes** on `81bc5ec79fe4`, covering same-version foreign bundles and dev image ownership.
- Repaired source: **146 tests / 13 focused files** pass in **295.98 s**; core/plugin/Doctor type lanes, scoped lint and format checks pass.
- Full build **327 s**; canonical package and tarball integrity check **147 s**, passed on the same source: https://crabbox.openclaw.ai/portal/runs/run_dc18498ac0ce67bf255a724603a87da8 . Normal transport carrier `52ac74c7ea423bf3ba7dc40fa7ede4f87d3a923e`; qualified tree `ab0be1d46d2b4479f5d61dab4caf3732957a006e` is identical to committed head `ed2da82d62dccacc41f779b61341714a98677c32`. The build stamp names the carrier, not the eventual PR SHA.
- Linux product proof is incomplete: published `2026.11.10` → first Git release → resident predecessor and predecessor plugin completion passed, but the harness's diagnostic plugin locator was refused before candidate activation. No candidate retirement/reload pass or zero-stale-record result is claimed. Raw failure and partial proof: #205952 (comment) . Native profile was stopped/uninstalled, exact AWS lease released with `--wait`. The final proposed retry was cancelled before allocation under the direction to stop adding proof machinery.
- Final head `075c60763f62537163644c935f22c166329cb419` only folds the two adjacent record loops into one, preserving updated source-owned records before the final retirement filter. Owner red/green tests and the clean review above qualify the behavior before this loop consolidation; CI runs on the final head. Main's accepted live follow-up is the next Peanutto nightly.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 27, 2026
…05952)

## What Problem This Solves

A same-version Git update can leave bundled plugins pinned to an older release directory. The new core starts, but post-update plugin activation rejects the stale installation claim and can abort the reload batch.

Related: openclaw#204866, openclaw#205655.

## User Impact

Packaged bundled plugins follow the selected core without a second path-install owner. User settings and explicit local/source-checkout selections stay intact; this does not uninstall plugins or delete their code. Existing registered Git-plugin peer-link repair stays in its current owner.

No schema, stored-record shape, launcher format, or public plugin API changes.

## Why This Change Was Made

The existing stale-record owner ran after channel synchronization and required a different package version. Retire proven foreign compiled-bundle records before planning, using the existing physical ownership policy instead of version and path-string guesses. Dev synchronization also stops creating redundant records for packaged bundles. The late competing prune operation and its obsolete wrapper are removed.

Production code on this PR's three runtime files, measured with `tokei` against `158fa1971e14`: **848 → 829 lines (−19)**. Net test lines: **+21**. Record retirement and development-channel synchronization use one loop.

## Evidence

- Base regression: **9 intended assertion failures / 8 passes** on `158fa1971e14`, covering same-version foreign bundles and dev image ownership.
- Repaired source: **146 tests / 13 focused files** pass in **295.98 s**; core/plugin/Doctor type lanes, scoped lint and format checks pass.
- Full build **327 s**; canonical package and tarball integrity check **147 s**, passed on the same source: https://crabbox.openclaw.ai/portal/runs/run_dc18498ac0ce67bf255a724603a87da8 . Normal transport carrier `52ac74c7ea423bf3ba7dc40fa7ede4f87d3a923e`; qualified tree `ab0be1d46d2b4479f5d61dab4caf3732957a006e` is identical to committed head `ed2da82d62dccacc41f779b61341714a98677c32`. The build stamp names the carrier, not the eventual PR SHA.
- Linux product proof is incomplete: published `2026.11.10` → first Git release → resident predecessor and predecessor plugin completion passed, but the harness's diagnostic plugin locator was refused before candidate activation. No candidate retirement/reload pass or zero-stale-record result is claimed. Raw failure and partial proof: openclaw#205952 (comment) . Native profile was stopped/uninstalled, exact AWS lease released with `--wait`. The final proposed retry was cancelled before allocation under the direction to stop adding proof machinery.
- Final head `075c60763f62537163644c935f22c166329cb419` only folds the two adjacent record loops into one, preserving updated source-owned records before the final retirement filter. Owner red/green tests and the clean review above qualify the behavior before this loop consolidation; CI runs on the final head. Main's accepted live follow-up is the next Peanutto nightly.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 28, 2026
## What Problem This Solves

A same-version Git update can leave bundled plugins pinned to an older release directory. The new core starts, but post-update plugin activation rejects the stale installation claim and can abort the reload batch.

Related: #204866, #205655.

## User Impact

Packaged bundled plugins follow the selected core without a second path-install owner. User settings and explicit local/source-checkout selections stay intact; this does not uninstall plugins or delete their code. Existing registered Git-plugin peer-link repair stays in its current owner.

No schema, stored-record shape, launcher format, or public plugin API changes.

## Why This Change Was Made

The existing stale-record owner ran after channel synchronization and required a different package version. Retire proven foreign compiled-bundle records before planning, using the existing physical ownership policy instead of version and path-string guesses. Dev synchronization also stops creating redundant records for packaged bundles. The late competing prune operation and its obsolete wrapper are removed.

Production code on this PR's three runtime files, measured with `tokei` against `81bc5ec79fe4`: **848 → 829 lines (−19)**. Net test lines: **+21**. Record retirement and development-channel synchronization use one loop.

## Evidence

- Base regression: **9 intended assertion failures / 8 passes** on `81bc5ec79fe4`, covering same-version foreign bundles and dev image ownership.
- Repaired source: **146 tests / 13 focused files** pass in **295.98 s**; core/plugin/Doctor type lanes, scoped lint and format checks pass.
- Full build **327 s**; canonical package and tarball integrity check **147 s**, passed on the same source: https://crabbox.openclaw.ai/portal/runs/run_dc18498ac0ce67bf255a724603a87da8 . Normal transport carrier `52ac74c7ea423bf3ba7dc40fa7ede4f87d3a923e`; qualified tree `ab0be1d46d2b4479f5d61dab4caf3732957a006e` is identical to committed head `ed2da82d62dccacc41f779b61341714a98677c32`. The build stamp names the carrier, not the eventual PR SHA.
- Linux product proof is incomplete: published `2026.11.10` → first Git release → resident predecessor and predecessor plugin completion passed, but the harness's diagnostic plugin locator was refused before candidate activation. No candidate retirement/reload pass or zero-stale-record result is claimed. Raw failure and partial proof: #205952 (comment) . Native profile was stopped/uninstalled, exact AWS lease released with `--wait`. The final proposed retry was cancelled before allocation under the direction to stop adding proof machinery.
- Final head `075c60763f62537163644c935f22c166329cb419` only folds the two adjacent record loops into one, preserving updated source-owned records before the final retirement filter. Owner red/green tests and the clean review above qualify the behavior before this loop consolidation; CI runs on the final head. Main's accepted live follow-up is the next Peanutto nightly.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 05c15ac)
tideclaw-bot added a commit that referenced this pull request Nov 28, 2026
Source commit: 0fea252
Source PR: #204866

Release adaptation: Backport only the independent Windows snapshot fix
and deadline/unknown-state regressions. Use the existing caller remainder
or cold-spawn fallback rather than the hidden five-second ceiling. Omit
resident launcher and installation-owner changes, which target the main
update engine and are not present in this stable line.

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
## What Problem This Solves

A same-version Git update can leave bundled plugins pinned to an older release directory. The new core starts, but post-update plugin activation rejects the stale installation claim and can abort the reload batch.

Related: #204866, #205655.

## User Impact

Packaged bundled plugins follow the selected core without a second path-install owner. User settings and explicit local/source-checkout selections stay intact; this does not uninstall plugins or delete their code. Existing registered Git-plugin peer-link repair stays in its current owner.

No schema, stored-record shape, launcher format, or public plugin API changes.

## Why This Change Was Made

The existing stale-record owner ran after channel synchronization and required a different package version. Retire proven foreign compiled-bundle records before planning, using the existing physical ownership policy instead of version and path-string guesses. Dev synchronization also stops creating redundant records for packaged bundles. The late competing prune operation and its obsolete wrapper are removed.

Production code on this PR's three runtime files, measured with `tokei` against `81bc5ec79fe4`: **848 → 829 lines (−19)**. Net test lines: **+21**. Record retirement and development-channel synchronization use one loop.

## Evidence

- Base regression: **9 intended assertion failures / 8 passes** on `81bc5ec79fe4`, covering same-version foreign bundles and dev image ownership.
- Repaired source: **146 tests / 13 focused files** pass in **295.98 s**; core/plugin/Doctor type lanes, scoped lint and format checks pass.
- Full build **327 s**; canonical package and tarball integrity check **147 s**, passed on the same source: https://crabbox.openclaw.ai/portal/runs/run_dc18498ac0ce67bf255a724603a87da8 . Normal transport carrier `52ac74c7ea423bf3ba7dc40fa7ede4f87d3a923e`; qualified tree `ab0be1d46d2b4479f5d61dab4caf3732957a006e` is identical to committed head `ed2da82d62dccacc41f779b61341714a98677c32`. The build stamp names the carrier, not the eventual PR SHA.
- Linux product proof is incomplete: published `2026.11.10` → first Git release → resident predecessor and predecessor plugin completion passed, but the harness's diagnostic plugin locator was refused before candidate activation. No candidate retirement/reload pass or zero-stale-record result is claimed. Raw failure and partial proof: #205952 (comment) . Native profile was stopped/uninstalled, exact AWS lease released with `--wait`. The final proposed retry was cancelled before allocation under the direction to stop adding proof machinery.
- Final head `075c60763f62537163644c935f22c166329cb419` only folds the two adjacent record loops into one, preserving updated source-owned records before the final retirement filter. Owner red/green tests and the clean review above qualify the behavior before this loop consolidation; CI runs on the final head. Main's accepted live follow-up is the next Peanutto nightly.

Co-authored-by: Ayaan Zaidi <[email protected]>

(cherry picked from commit 05c15ac)

Release adaptation: Retain bundled selection at the existing channel update and Doctor convergence owners; adapt documentation and assert the complete stable install-record set instead of importing the absent main reload batch. Existing discovered-owner and Doctor convergence assertions remain.

Companion audit: PR #205952 is selected; keep bundled update/Doctor consumer changes together and preserve explicit links and npm installations.

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot added a commit that referenced this pull request Nov 30, 2026
…ce (#205233)

* fix(ci): preserve updater fixture source and release identity

Co-authored-by: vincentkoc <[email protected]>

* fix(ci): restore the Git pin and resident package in updater acceptance

Worked on by:
- @vincentkoc
- @RomneyDa

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 8e6d786a-d944-493c-88c8-774b069266cd

* fix(ci): expect resident-owner refusal for Git-to-package on guarded targets

Targets with the #204866 ownership guard refuse --channel stable from a resident-owned Git install. The channel-switch lane now asserts that refusal and that the Git install stays in place; older cuts without the guard, including 2026.12.1, still prove the switch.

Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/plaid-krill-f4610d

Worked on by:
- @vincentkoc
- @RomneyDa

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 8948194f-9c68-8fc2-b08b-98c8dbe3c08b

* test(ci): include the admission report in the parent admission fixture

The update-channel-switch contract now reads update-command-admission-report.ts; the default parent admission fixture must carry it.

Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/plaid-krill-f4610d

Worked on by:
- @vincentkoc
- @RomneyDa

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 043bf936-fc33-8b39-a692-df58dcd58515

---------

Co-authored-by: vincentkoc <[email protected]>
(cherry picked from commit ded2602)

Release adaptation: retain stable lifecycle/legacy assertions rather than importing the unavailable receipt helper; the shipped survivor orchestrator uses its existing legacy npm route, while the admission probe validates both layouts. Use the stable legacy switch as the unpinned default.

Follow-up audit: aeb7edb is the immediately following selected packaged-SHA/registry companion. e85cda3, e0f0687, c2cfab0, 6fa79a5, 293eb51, ac02524, 3b1ca5b, 05c15ac and b9d0210 address independent orchestration, coverage or product installer behavior.

Co-authored-by: RomneyDa <[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 docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant