Repository navigation
fix(postinstall): preserve other installs' runtime dependencies - #134099
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Preserve legacy plugin-runtime dependency roots and sibling global links while installing a new package because another installed Gateway may still use them. Keep package-local dist pruning, source-checkout protection, the existing cleanup opt-out, and root lifecycle completion intact. Doctor remains the explicit owner of operator-state migration and legacy cleanup. Carry the bounded CI fixture regressions needed to prove this upgrade path: settle PowerShell completion test-runner readiness and queued requests when a real child exits before READY, and cover default/overridden prepared follow-up model metadata without catalog discovery. These are test-only repairs, not a production catalog or real PowerShell coverage claim. Preserve the already-landed media fixture preparation and canonical installed- CLI recovery, staged rollback, and interrupted legacy-marker retry behavior. The earlier database-postinstall migration removal remains upstream work. Related: #134099 (postinstall isolation across installed versions).
565cb5e to
ddda232
Compare
|
Codex review: blocked before merge. Reviewed September 4, 2026, 2:49 AM ET / 06:49 UTC. ClawSweeper reviewWhat this changesThis PR confines package postinstall cleanup to its installed package and changes Doctor to preserve shared plugin runtime caches while removing only dangling global runtime aliases. Merge readiness⛔ Blocked before merge - 3 items remain Keep open. Current main still invokes the broad Doctor cleanup that can remove shared runtime roots, while this PR replaces it with dangling-alias-only repair; no introduced correctness defect was found. The remaining blocker is exact-head native upgrade proof, and this maintainer-labeled PR must not be auto-closed. Priority: P1 Review scores
Verification
How this fits togetherPackage postinstall runs during npm installation, while Doctor performs explicit repair afterward. Both touch plugin dependency artifacts, so their cleanup boundary determines whether another OpenClaw installation can keep resolving its runtime dependencies. flowchart LR
A[Package update] --> B[Package postinstall]
B --> C[Installed package artifacts]
D[Doctor repair] --> E[Global runtime aliases]
F[Shared runtime caches] --> E
C --> G[Updated OpenClaw install]
E --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource -488, Tests -61, Docs +33, Other -278. Total -794 across 33 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the proposed ownership split, then land only after an exact-head package update and Doctor run demonstrates that shared dependencies and a valid alias remain usable while package-local debris is removed. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source invokes broad legacy cleanup, and the introduced fixtures define a focused multi-install/shared-reader scenario that would expose removal of the shared root or alias. Is this the best way to solve the issue? Yes. Separating package-local cleanup from shared operator-state repair and checking the actual alias with filesystem stat is the narrowest owner-boundary repair; the outstanding need is real upgrade proof, not another implementation path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fd9adb5af2c2. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
ddda232 to
ead36b6
Compare
Preserve legacy plugin-runtime dependency roots and sibling global links while installing a new package because another installed Gateway may still use them. Keep package-local dist pruning, source-checkout protection, the existing cleanup opt-out, and root lifecycle completion intact. Doctor remains the explicit owner of operator-state migration and legacy cleanup. Carry the bounded CI fixture regressions needed to prove this upgrade path: settle PowerShell completion test-runner readiness and queued requests when a real child exits before READY, and cover default/overridden prepared follow-up model metadata without catalog discovery. These are test-only repairs, not a production catalog or real PowerShell coverage claim. Preserve the already-landed media fixture preparation and canonical installed- CLI recovery, staged rollback, and interrupted legacy-marker retry behavior. The earlier database-postinstall migration removal remains upstream work. Related: #134099 (postinstall isolation across installed versions).
Stop deleting shared cache roots or valid runtime aliases during Doctor repair. Keep genuine dangling-link repair, the shipped legacy health selector, and installer-owned package-local cleanup. Cover live readers and cache-preservation fixtures, and retire stale test wiring and ratchet entries. Installer upgrade-safety follow-up for #134099. Validated 339 primary and 68 supplemental tests, 31 staged checks, and P0-P2 autoreview. Fresh packages and the native update matrix remain pending.
Check runtime aliases through the filesystem instead of lexically normalizing stored targets. A directory symlink followed by .. can otherwise make a live alias appear missing and cause Doctor to unlink it. Retain recorded targets for diagnostics and genuine ENOENT/ENOTDIR repair. Add a POSIX health/removal regression. Installer upgrade-safety follow-up for #134099. Validated 270 tests, 29 changed checks, and P0-P2 source reviews. Package production and the native update matrix remain pending.
Complete the current-install sibling of the published-upgrade fixture repair. Use managed service-token auth without creating conflicting legacy device identity or pairing files after setup Doctor has initialized SQLite. Preserve setup Doctor, its child-only markers, config parking/restoration, service ownership and readiness, and intentional migration specimens. Extend the existing marker test to reject retired identity files and remove obsolete seeder stubs. Add braces to two pre-existing lifecycle-test loops required by the touched-file lint gate. Clarify package-local debris versus shared runtime preservation in the update testing guide. Related: #134099 (preserve other installations' runtime dependencies). No product authentication, migration, configuration, or SQLite change. Native restart-unhealthy and cleanup failure remain unproven by this fixture repair; fresh complete native update/Doctor proof is still required.
Assert the canonical sourced dependency fixture and the ordered cleanup phases around Doctor instead of moved inline helpers or deleted diagnostic text. Keep detailed dependency ownership coverage in the existing fixture behavior suite. Refs #134099 (preserve other installations' runtime dependencies).
Assert the canonical sourced dependency fixture and the ordered cleanup phases around Doctor instead of moved inline helpers or deleted diagnostic text. Keep detailed dependency ownership coverage in the existing fixture behavior suite. Refs #134099 (preserve other installations' runtime dependencies).
|
Landed f584661fac60 from reviewed source 54a796827b81. The PR body now contains completed native survivor proof for final head All four final fixed configurations passed real package update → Doctor → Doctor: both shared-root selectors, each with same-install and separate-install consumers. Every command exited 0. The original reader processes retained uncached dependency/mirror reads, valid aliases, synthetic SQLite bytes/handles, and the unknown-consumer sentinel. Seeded package-local debris disappeared during update. The four released-package controls reproduced shared-root loss and late-import errors despite exit-0 update/Doctor commands. All isolated readers and state were cleaned up. This is native macOS The final mechanical rebase uses main's canonical audit repair from #137989 unchanged and drops the superseded branch repair. The dependency-preservation patch is identical, the final package/native proof was refreshed, and a fresh full P0–P2 review is clean. Local changed-file checks and every non-audit CI lane passed. Peter explicitly instructed "ignore npm stuff" after both production-advisory attempts failed with timeouts/HTTP 503. The PR was merged under that npm-only waiver; no successful advisory result is claimed and the failed checks remain recorded. Repository rules and audit policy are unchanged. Post-merge verification: the landed patch ID exactly matches the reviewed patch ( |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Preserve legacy plugin-runtime dependency roots and sibling global links while installing a new package because another installed Gateway may still use them. Keep package-local dist pruning, source-checkout protection, the existing cleanup opt-out, and root lifecycle completion intact. Doctor remains the explicit owner of operator-state migration and legacy cleanup. Carry the bounded CI fixture regressions needed to prove this upgrade path: settle PowerShell completion test-runner readiness and queued requests when a real child exits before READY, and cover default/overridden prepared follow-up model metadata without catalog discovery. These are test-only repairs, not a production catalog or real PowerShell coverage claim. Preserve the already-landed media fixture preparation and canonical installed- CLI recovery, staged rollback, and interrupted legacy-marker retry behavior. The earlier database-postinstall migration removal remains upstream work. Related: #134099 (postinstall isolation across installed versions).
Stop deleting shared cache roots or valid runtime aliases during Doctor repair. Keep genuine dangling-link repair, the shipped legacy health selector, and installer-owned package-local cleanup. Cover live readers and cache-preservation fixtures, and retire stale test wiring and ratchet entries. Installer upgrade-safety follow-up for #134099. Validated 339 primary and 68 supplemental tests, 31 staged checks, and P0-P2 autoreview. Fresh packages and the native update matrix remain pending.
Check runtime aliases through the filesystem instead of lexically normalizing stored targets. A directory symlink followed by .. can otherwise make a live alias appear missing and cause Doctor to unlink it. Retain recorded targets for diagnostics and genuine ENOENT/ENOTDIR repair. Add a POSIX health/removal regression. Installer upgrade-safety follow-up for #134099. Validated 270 tests, 29 changed checks, and P0-P2 source reviews. Package production and the native update matrix remain pending.
Declare the migrated-session fixture's no-override return as undefined to match the canonical setup callback after the upstream environment-contract tightening. Preserve the fixture body, scenario overrides and assertions. Verified with root-test tsgo red/same-command green and 51 existing fixture tests. Managed P0-P2 review is clean for this one-line repair only.
Complete the current-install sibling of the published-upgrade fixture repair. Use managed service-token auth without creating conflicting legacy device identity or pairing files after setup Doctor has initialized SQLite. Preserve setup Doctor, its child-only markers, config parking/restoration, service ownership and readiness, and intentional migration specimens. Extend the existing marker test to reject retired identity files and remove obsolete seeder stubs. Add braces to two pre-existing lifecycle-test loops required by the touched-file lint gate. Clarify package-local debris versus shared runtime preservation in the update testing guide. Related: #134099 (preserve other installations' runtime dependencies). No product authentication, migration, configuration, or SQLite change. Native restart-unhealthy and cleanup failure remain unproven by this fixture repair; fresh complete native update/Doctor proof is still required.
Assert the canonical sourced dependency fixture and the ordered cleanup phases around Doctor instead of moved inline helpers or deleted diagnostic text. Keep detailed dependency ownership coverage in the existing fixture behavior suite. Refs #134099 (preserve other installations' runtime dependencies).
99acf31 to
54a7968
Compare
|
🦞👀 Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…claw#134099) Keep package postinstall cleanup inside its installed package and remove Doctor's shared runtime dependency pruning. Follow actual filesystem targets when repairing dangling aliases, preserving dependencies and mirrors used by other installations or profiles. Retain lifecycle completion, package-local cleanup, and the shipped informational Doctor selector. Refresh survivor fixtures and documentation, remove redundant vision fixture coverage, and align the companion cleanup-phase guard. Use the canonical audit fix from current main after resolving the overlapping CI repair. Validation includes failing/passing owner regressions, focused owner and sibling suites, full package integrity checks, native before/fixed update-and-Doctor survivor comparisons, and independent P0-P2 reviews. Detailed final package, native, and CI evidence is in the PR body. Related to openclaw#128782; follows the separate Doctor-owned database migration repair in openclaw#129475, with prior contributions from @BryanTegomoh and @obviyus. Maintainer override: Peter explicitly waived the npm advisory-service outage for this landing. Exact-head CI passed every other selected lane; the audit returned only timeouts/HTTP 503 and no clearance. The failed checks remain recorded, and audit/repository policy is unchanged.
Root cause: src/commands/backup-resource-inventory.ts:82 `MANAGED_STATE_ROOTS` left out the legacy `plugin-runtime-deps` cache, so backup archived it and wrote every absolute link inside it into the manifest's `externalSymbolicLinks`, which overflows the 1 MiB manifest cap. Fixes #203082 Thanks @sukhdeepjohar for the diagnosis and fix, and @dygg2001 for the report and the link counts that pinned it down. ## What Problem This Solves On installs that ran OpenClaw before 2026.5.2, `openclaw backup create` can stop with "Backup manifest exceeds 1048576 byte limit" and save no backup at all. Those releases built a bundled-plugin dependency cache at `~/.openclaw/plugin-runtime-deps`, including a mirror of OpenClaw's own program files as links into the install folder. Nothing deletes that cache today (#134099 keeps it, because another installation may still use it). Backup copies it and lists every one of those links in the archive's manifest, which has a 1 MiB limit. The reporter of #203082 has 7,464 such links, enough to overflow it. The "19k session files" in the issue title are not the cause: the manifest has no per-file entries for sessions (live session files are reported as volatile and kept out of the manifest). The reporter's own count confirms it: 7,464 of their 7,619 outside links are in this cache; the remaining 155 fit easily. ## User Impact Backups of long-running installs complete again. The old cache stays on disk untouched but is no longer copied into backups, and the thousands of "External link preserved" lines it caused disappear from backup and restore output. Current OpenClaw never reads that cache. An older OpenClaw restored from such a backup rebuilds it at startup, as it always did. ## Why This Change Was Made Backup already leaves out installer-managed and rebuildable folders under the state directory (`dev/`, `git/`, `npm/`, legacy `npm-runtime/`, `tmp/`, `tools/`), and reports each as "regenerable". The old plugin cache is the same kind of folder but was missing from that list. This adds it, so backup never opens it. It is not a user exclusion switch, and links elsewhere are judged and reported exactly as before. The manifest limit is unchanged. Nothing user-authored lives there: the cache was written only by the bundled-plugin dependency stager (package roots named `openclaw-<version>-<hash>` with `node_modules`, a `dist` mirror and stamps), documented as an OpenClaw-owned package root. The only remaining references in shipped code match the name in link targets or process command lines (`doctor` dangling-alias cleanup, ACPX process reaper); none reads the folder. ## Evidence Both sides built in an isolated Linux container. The legacy cache was built by the published 2026.4.24, 2026.4.25, 2026.4.26 and 2026.4.27 releases themselves, run in turn on one state directory (9,883 links, 7,275 of them absolute links into the installed package's `dist`). Full proof lines: #203923 (comment) | build | state | `backup create --output --verify` | |---|---|---| | main 7d0cc1e | normal + legacy cache, run 1 and 2 | rc=1, "Backup manifest exceeds 1048576 byte limit", no archive | | this PR | normal + legacy cache, run 1 and 2 | rc=0, manifest 2,407 bytes, `plugin-runtime-deps` listed as regenerable, 0 archive entries from it | | main and this PR | normal, no legacy cache | rc=0, identical archive entry lists, same skipped roots | | main 7d0cc1e | normal + 19,000 session files | rc=0, manifest 2,318 bytes | The PR's archive passed `backup verify`, restored into an empty directory, and a Gateway started on the restored state reported ready. Test: the existing managed-root exclusion test in `backup-create.test.ts` now includes `plugin-runtime-deps`; it fails on main and passes here. The separate test file from the first commit was folded into it. ## Merge danger Two-way door: a revert restores the old archive contents; no state, config or contract is written or migrated. Blast radius: backup create/verify of state directories that still contain `plugin-runtime-deps`. Co-authored-by: Ayaan Zaidi <[email protected]>
Root cause: src/commands/backup-resource-inventory.ts:82 `MANAGED_STATE_ROOTS` left out the legacy `plugin-runtime-deps` cache, so backup archived it and wrote every absolute link inside it into the manifest's `externalSymbolicLinks`, which overflows the 1 MiB manifest cap. Fixes openclaw#203082 Thanks @sukhdeepjohar for the diagnosis and fix, and @dygg2001 for the report and the link counts that pinned it down. ## What Problem This Solves On installs that ran OpenClaw before 2026.5.2, `openclaw backup create` can stop with "Backup manifest exceeds 1048576 byte limit" and save no backup at all. Those releases built a bundled-plugin dependency cache at `~/.openclaw/plugin-runtime-deps`, including a mirror of OpenClaw's own program files as links into the install folder. Nothing deletes that cache today (openclaw#134099 keeps it, because another installation may still use it). Backup copies it and lists every one of those links in the archive's manifest, which has a 1 MiB limit. The reporter of openclaw#203082 has 7,464 such links, enough to overflow it. The "19k session files" in the issue title are not the cause: the manifest has no per-file entries for sessions (live session files are reported as volatile and kept out of the manifest). The reporter's own count confirms it: 7,464 of their 7,619 outside links are in this cache; the remaining 155 fit easily. ## User Impact Backups of long-running installs complete again. The old cache stays on disk untouched but is no longer copied into backups, and the thousands of "External link preserved" lines it caused disappear from backup and restore output. Current OpenClaw never reads that cache. An older OpenClaw restored from such a backup rebuilds it at startup, as it always did. ## Why This Change Was Made Backup already leaves out installer-managed and rebuildable folders under the state directory (`dev/`, `git/`, `npm/`, legacy `npm-runtime/`, `tmp/`, `tools/`), and reports each as "regenerable". The old plugin cache is the same kind of folder but was missing from that list. This adds it, so backup never opens it. It is not a user exclusion switch, and links elsewhere are judged and reported exactly as before. The manifest limit is unchanged. Nothing user-authored lives there: the cache was written only by the bundled-plugin dependency stager (package roots named `openclaw-<version>-<hash>` with `node_modules`, a `dist` mirror and stamps), documented as an OpenClaw-owned package root. The only remaining references in shipped code match the name in link targets or process command lines (`doctor` dangling-alias cleanup, ACPX process reaper); none reads the folder. ## Evidence Both sides built in an isolated Linux container. The legacy cache was built by the published 2026.4.24, 2026.4.25, 2026.4.26 and 2026.4.27 releases themselves, run in turn on one state directory (9,883 links, 7,275 of them absolute links into the installed package's `dist`). Full proof lines: openclaw#203923 (comment) | build | state | `backup create --output --verify` | |---|---|---| | main 706c3cf | normal + legacy cache, run 1 and 2 | rc=1, "Backup manifest exceeds 1048576 byte limit", no archive | | this PR | normal + legacy cache, run 1 and 2 | rc=0, manifest 2,407 bytes, `plugin-runtime-deps` listed as regenerable, 0 archive entries from it | | main and this PR | normal, no legacy cache | rc=0, identical archive entry lists, same skipped roots | | main 706c3cf | normal + 19,000 session files | rc=0, manifest 2,318 bytes | The PR's archive passed `backup verify`, restored into an empty directory, and a Gateway started on the restored state reported ready. Test: the existing managed-root exclusion test in `backup-create.test.ts` now includes `plugin-runtime-deps`; it fails on main and passes here. The separate test file from the first commit was folded into it. ## Merge danger Two-way door: a revert restores the old archive contents; no state, config or contract is written or migrated. Blast radius: backup create/verify of state directories that still contain `plugin-runtime-deps`. Co-authored-by: Ayaan Zaidi <[email protected]>
Root cause: src/commands/backup-resource-inventory.ts:82 `MANAGED_STATE_ROOTS` left out the legacy `plugin-runtime-deps` cache, so backup archived it and wrote every absolute link inside it into the manifest's `externalSymbolicLinks`, which overflows the 1 MiB manifest cap. Fixes #203082 Thanks @sukhdeepjohar for the diagnosis and fix, and @dygg2001 for the report and the link counts that pinned it down. On installs that ran OpenClaw before 2026.5.2, `openclaw backup create` can stop with "Backup manifest exceeds 1048576 byte limit" and save no backup at all. Those releases built a bundled-plugin dependency cache at `~/.openclaw/plugin-runtime-deps`, including a mirror of OpenClaw's own program files as links into the install folder. Nothing deletes that cache today (#134099 keeps it, because another installation may still use it). Backup copies it and lists every one of those links in the archive's manifest, which has a 1 MiB limit. The reporter of #203082 has 7,464 such links, enough to overflow it. The "19k session files" in the issue title are not the cause: the manifest has no per-file entries for sessions (live session files are reported as volatile and kept out of the manifest). The reporter's own count confirms it: 7,464 of their 7,619 outside links are in this cache; the remaining 155 fit easily. Backups of long-running installs complete again. The old cache stays on disk untouched but is no longer copied into backups, and the thousands of "External link preserved" lines it caused disappear from backup and restore output. Current OpenClaw never reads that cache. An older OpenClaw restored from such a backup rebuilds it at startup, as it always did. Backup already leaves out installer-managed and rebuildable folders under the state directory (`dev/`, `git/`, `npm/`, legacy `npm-runtime/`, `tmp/`, `tools/`), and reports each as "regenerable". The old plugin cache is the same kind of folder but was missing from that list. This adds it, so backup never opens it. It is not a user exclusion switch, and links elsewhere are judged and reported exactly as before. The manifest limit is unchanged. Nothing user-authored lives there: the cache was written only by the bundled-plugin dependency stager (package roots named `openclaw-<version>-<hash>` with `node_modules`, a `dist` mirror and stamps), documented as an OpenClaw-owned package root. The only remaining references in shipped code match the name in link targets or process command lines (`doctor` dangling-alias cleanup, ACPX process reaper); none reads the folder. Both sides built in an isolated Linux container. The legacy cache was built by the published 2026.4.24, 2026.4.25, 2026.4.26 and 2026.4.27 releases themselves, run in turn on one state directory (9,883 links, 7,275 of them absolute links into the installed package's `dist`). Full proof lines: #203923 (comment) | build | state | `backup create --output --verify` | |---|---|---| | main 7d0cc1e | normal + legacy cache, run 1 and 2 | rc=1, "Backup manifest exceeds 1048576 byte limit", no archive | | this PR | normal + legacy cache, run 1 and 2 | rc=0, manifest 2,407 bytes, `plugin-runtime-deps` listed as regenerable, 0 archive entries from it | | main and this PR | normal, no legacy cache | rc=0, identical archive entry lists, same skipped roots | | main 7d0cc1e | normal + 19,000 session files | rc=0, manifest 2,318 bytes | The PR's archive passed `backup verify`, restored into an empty directory, and a Gateway started on the restored state reported ready. Test: the existing managed-root exclusion test in `backup-create.test.ts` now includes `plugin-runtime-deps`; it fails on main and passes here. The separate test file from the first commit was folded into it. Two-way door: a revert restores the old archive contents; no state, config or contract is written or migrated. Blast radius: backup create/verify of state directories that still contain `plugin-runtime-deps`. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit f6fca13) Companion audit: 8cff45e is selected later in this lane for startup races; e3dd914 is separate Git backup commit validation. Neither is required for excluding an installer-owned cache. Release adaptation: Extend the stable compact managed-root list with only the legacy plugin dependency cache; preserve the stable root set otherwise. Co-authored-by: RomneyDa <[email protected]>
Related: #128782 (installation migrated an older Gateway's database; already closed). Follow-up to #129475, the Doctor-owned plugin-registry migration merged as 5f714ef, with @BryanTegomoh's contribution and @obviyus's co-authorship. This PR fixes the remaining dependency-cleanup boundary.
What Problem This Solves
Installing another OpenClaw copy or running Doctor could delete shared runtime dependency caches, mirrors, and valid global aliases still used by another installation or profile. An existing Node consumer could keep running until its next uncached import failed with
MODULE_NOT_FOUND. A separate npm prefix does not isolate inherited home, config, or state paths.Why This Change Was Made
Postinstall now cleans only its installed package and completes the existing lifecycle marker. Doctor's shared-root pruning owner is deleted. Doctor removes genuinely dangling runtime aliases by following the actual symlink with
fs.stat(fullPath); lexical path normalization could otherwise erase an intermediate directory symlink and misclassify a live target.The shipped
core/doctor/legacy-plugin-dependencieslint selector remains informational and default-off. Existing lifecycle completion, recovery, package-local cleanup, and genuine dangling-link repair remain supported. There are no new dependencies, configuration options, runtime compatibility readers, or SQLite/schema changes.The branch was integrated with current main while preserving the newer Gateway profile repair and survivor phase wrapper. The existing child-process readiness fix and meaningful survivor regressions remain; redundant prepared-vision fixture coverage was removed because main already tests that behavior.
User Impact
Package install/update and Doctor preserve shared dependency roots, versioned caches, mirrors, unknown consumer files, and valid aliases used by other installations or profiles, including roots selected through
STATE_DIRECTORYandOPENCLAW_PLUGIN_STAGE_DIR. Installation-local stale artifacts are still removed. The Doctor, update, testing, and plugin dependency-resolution guides describe this ownership boundary.Production: +33/-723 (net -690). Tests: +421/-658. Test support: +395/-294. Docs: +60/-27. Ratchets: +1/-2. No changelog, version, or release publication change.
Evidence
Current source:
54a796827b8145b22df2d27275d7ed893927fc29; integration base:82d2c992a25bc38336e1a5d49e1ef15d03798f19. The dependency-preservation patch is identical to the reviewed pre-audit patch (stable patch IDb8bd5646d22b6c8d3d7f2fff29c63471af528f2b). Final native proof passed after the necessary mainline conflict resolution. Current-head CI passed every selected lane except the production advisory audit. Two attempts obtained no audit result from npm. Peter explicitly waived this npm outage for landing the exact reviewed head; no successful audit is claimed.ENOENTfor the deleted shared root, and passes with the candidate. The complete focused selection passed 259 tests in 7 files across 4 shards; the rebase-sensitive package workflow check passed separately.node scripts/run-vitest.mjs test/scripts/postinstall-bundled-plugins.test.ts src/commands/doctor/shared/plugin-runtime-symlinks.test.ts src/commands/doctor/repair-sequencing.test.ts src/flows/doctor-health-contributions.test.ts test/scripts/upgrade-survivor-plugin-dependencies.test.ts test/scripts/upgrade-survivor-assertions.test.ts src/cli/completion-cli.runner.process.test.ts node scripts/run-vitest.mjs test/scripts/package-acceptance-workflow.test.ts -t 'lets reusable Docker E2E consume an already resolved package artifact' node scripts/check-changed.mjs --base 82d2c992a25b --timed node scripts/package-openclaw-for-docker.mjs --output-dir /tmp/pr-134099-native/rebased-package --output-name openclaw-fixed.tgzBest-fix judgment: repair the cleanup owner, rather than add downstream retries or try to infer whether every external consumer is idle. The package owns its files; cache names do not establish exclusive ownership. Direct Node filesystem behavior and the POSIX symlink regression support the alias check; see Node's filesystem contract.
CI integration correction: the first refreshed run exposed a stale phase name in the companion guard test. The same targeted test failed locally before the one-line correction; all 24 tests in that file, its changed-file checks, and a fresh P0–P2 review passed afterward. The guard itself and runtime behavior are unchanged.
A second CI shard exposed a fractional-backoff defect in the audit owner. Main subsequently landed the canonical fix in #137989 (
e63a41414fa). The PR now uses those audit files unchanged; the temporary overlapping branch repair was dropped during rebase. This keeps the final change focused on install/Doctor ownership.Native update and Doctor proof
Passed on the final source commit, macOS, Node 26.8.1 / npm 12.0.2. The real installed
[email protected]CLI performed a supportedupdate --tag <target> --no-restart --yes --json, followed bydoctor --fix --non-interactivetwice. The negative target was the released[email protected]; the fixed target was the final source tarball. Every update and Doctor command exited 0, including the negative controls.STATE_DIRECTORYOPENCLAW_PLUGIN_STAGE_DIRSTATE_DIRECTORYOPENCLAW_PLUGIN_STAGE_DIRTwo original Node reader processes stayed alive throughout each case. At every phase, nonce-bound acknowledgements exercised previously unloaded direct/relative/mirror CJS modules and filesystem reads through the intermediate-directory-symlink/
..alias. Fixed runs preserved the shared root, unknown-consumer sentinel, live alias bytes, open synthetic schema-8 SQLite handles, tokens, and database hashes. Negative runs required the exact root loss withMODULE_NOT_FOUND/ENOENT, so a generic command failure could not satisfy the control.The final fixed refresh also seeded four synthetic debris paths physically inside the old installed package and verified they disappeared during the real update. This proves update-level cleanup; the focused regression separately proves postinstall's cleanup ownership. Each fixed installation matched 125 postinstall/build-info/compiled Doctor member hashes from the candidate. All readers exited normally and all isolated state, package prefixes, baseline template, and npm cache were removed.
Final tarball SHA-256:
9263a7b7b152a318eb6cfdf4abdce8dc21bf4dc844b90497b9d2c5dccfd09e6c. Build identity:54a796827b8145b22df2d27275d7ed893927fc29. Final runner SHA-256:9d40534ed61e552966df35fcf75513df798eb430bfeacd7ce6be8a7b42e1a72b; reader SHA-256:fd261f4c9b9fa75a6616557f209bedf392ad6766eb8c79e560af5171fa866992. The released-package controls are retained from the completed earlier eight-case run; all four fixed configurations were refreshed after the mechanical rebase onto main's canonical audit fix.Scope: native package update and Doctor with synthetic long-lived dependency/SQLite readers. This is not a running Gateway, cross-platform service-restart matrix, or live provider/channel test. Earlier incomplete managed-service attempts are not claimed as proof. Isolated state/config paths and an unused loopback port prevented host-service interaction. npm lifecycle permission covered the exact baseline, negative, and candidate identities; three unrelated transitive install scripts remained blocked. No SQLite schema, migration, persistent representation, or runtime database ownership changed in this PR; the earlier database repair remains #129475.
This completes the latest ClawSweeper native-survivor and rank-up request. The data-model flag is addressed by the unchanged storage contract and observed preservation, rather than a new migration.
Current-head CI: npm advisory outage explicitly waived by Peter for landing, run 33847990653, attempt 2. Every other selected lane passed. In attempt 1, all four production-advisory requests timed out. The exact
security-fastretry on the same head timed out three times, then received HTTP 503Service Unavailable; the strict audit exited 2 without clearance. The same local audit also exhausted its budget, and npm's own installed client returned HTTP 503 on a one-package bulk request. No audit-policy or source change was made. Peter explicitly instructed "ignore npm stuff" after these two attempts. Code review, final package/native proof, local changed-file checks and every other selected CI lane are complete. Landed f584661fac60 with Peter's explicit waiver, preserving the failed audit and aggregate gate as recorded; no repository rules or audit policy were changed. The landed patch ID matches the reviewed source exactly, and the three runtime owner files are byte-identical to the verified candidate.