Repository navigation
fix(deps): reduce source install filesystem churn with isolated linking - #135728
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin, a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 10:43 PM ET / September 2, 2026, 02:43 UTC. ClawSweeper reviewWhat this changesThis PR switches source installs to pnpm isolated linking and updates package-local runtime resolution, plugin builds, packaging checks, tests, and contributor guidance accordingly. Merge readinessNo concrete introduced defect was found in the inspected packaging, plugin-runtime, Codex, or CUA paths. Keep this maintainer-owned PR open until exact-head CI completes and the pnpm v12.1 virtual-store encoding claim is directly verified. Priority: P2 Review scores
Verification
How this fits togetherThe workspace dependency layout supplies plugin builds, package artifacts, test subprocesses, and native SDK launchers. Isolated linking relocates real packages into owner-specific dependency trees, so each consumer must resolve from its declaring package. flowchart LR
A[Source checkout] --> B[pnpm isolated links]
B --> C[Package-owned dependencies]
C --> D[Plugin build and packaging]
C --> E[Native SDK resolution]
D --> F[Source runtime artifacts]
E --> G[Plugin startup]
Decision needed
Why: The new verifier reimplements pnpm’s internal virtual-store naming. Local evidence corroborates an older implementation, but not the asserted v12.1 source contract, and CI is still running. Before merge
Agent review detailsSecurityNone. PR surfaceSource +19, Tests +382, Docs +13, Config +13, Other +91. Total +518 across 46 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Retain the package-owned resolution approach, then merge after exact-head CI is green and a maintainer verifies the linked pnpm v12.1 virtual-store naming implementation. Do we have a high-confidence way to reproduce the issue? Yes in source: isolated linking relocates package dependencies, and the introduced tests exercise the affected owner-relative paths. This reviewer did not execute the patch. Is this the best way to solve the issue? Unclear: the inspected owner boundaries support this approach, but direct pnpm v12.1 contract evidence and exact-head CI are needed before calling it the best merge-ready solution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3a60bd396949. 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 (4 earlier review cycles)
|
|
Addressed the patched-plugin packaging finding in 34b8ab9. The verifier now checks the isolated virtual-store location derived from the exact frozen snapshot, including pnpm 12's shortened store paths. It retains matching patch hashes, importer/specifier checks, package identity checks, and existing hoisted-install support. It rejects links into foreign, redirected, or unpatched slots. Both new isolated packaging cases failed with the original verifier and pass after the repair; the complete packaging suite passes all 44 tests. I also built and packed the real Matrix plugin locally, verified tarball integrity, and compared all five patched matrix-js-sdk files byte-for-byte against the installed patched source. This was local packing only, not publication. The other compatibility repairs have passed the full 123-plugin declaration-boundary compile, 23 declaration-generator tests, the full-tree Knip scan, and 12 boundary/Slack behavior tests. A separate Linux frozen install/full build and seven Linux native/process/declaration/memory test files passed. Earlier local filesystem-heavy tests timed out; their unchanged Linux counterparts passed. CI is rerunning on this exact head before landing. The APFS eligibility claim was checked directly against pnpm v12.1.0's clone-cache implementation. This enables the optimization; it makes no measured install-speed or pointer-latency claim. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Follow-up pushed in 6318572: keep Crabline external so its crypto loader's The remaining pnpm contract question is directly verified against the v12.1.0 tag, not inferred from the tests: A second fresh Blacksmith Testbox run verified hashes for all 38 changed files at 34b8ab9, then passed a frozen Linux install, the complete build including declarations, and real Matrix runtime build/packing with tarball integrity and all five patched SDK files checked byte-for-byte. Lease @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
The next CI pass exposed the remaining Matrix runtime ownership problem: its unified root chunk still imported The native Node regression uses two plugins with different versions of one dependency and checks that both retain their versions while sharing the same host SDK instance. It also checks a copied staging tree and repeated metadata generation. All 37 focused build tests and 42 postbuild/overlay tests pass. Existing Matrix runtime-shim and Discord asset coverage now checks their package-owned output path. Independent owner-boundary inspection and fresh scoped Codex autoreview found no accepted findings at the selected review threshold. Blacksmith Testbox The preceding CI run also had a Windows Gateway teardown deadline failure in unchanged code; its exact shard was retried without changing the timeout. The new full CI run remains required before landing. The maintainer-requested default migration is intentional; the pinned pnpm contract was directly verified in the linked source recorded in the PR body. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Final pre-merge verification for a2449fe: CI run 33583866577 completed successfully with no failed or pending jobs. Fresh PR checks show 260 passing checks and 37 conditionally skipped checks; the required The source-install migration is explicitly requested and accepted by the maintainer. The pnpm contract is directly verified against the v12.1.0 tag: filesystem/peer encoding, UTF-8-safe shortening, and clone-cache eligibility. This closes the reviewer's retrieval gap; it is not inferred from the test fixtures. The PR body and preceding proof comments record the frozen macOS/Linux installs, unchanged resolved dependency snapshots/patches/overrides, 123-plugin boundary compile, real Matrix tarball/patch-byte verification, native SDK checks, subprocess/memory tests, 37 build-ownership tests, 42 postbuild/overlay tests, and the failing-before/passing-after Matrix restart proof on Blacksmith Testbox. All task-owned leases are stopped. No package publication, timeout relaxation, or numeric performance claim is included. The completed current-head ClawSweeper review reports no actionable code findings. Independent package-ownership inspection and fresh scoped Codex autoreview are complete. Proceeding through native prepare/merge with the exact-head CI gate satisfied. |
|
Merged via squash.
|
…ng (openclaw#135728) * fix(deps): reduce source install filesystem churn with isolated linking * fix(deps): preserve package ownership under isolated linking * fix(deps): retain isolated package ownership in packaging and declarations * fix(build): preserve Crabline dependency ownership with isolated linking * fix(build): keep external plugin runtimes with their dependency owners
…law#135903) Emit artifact-owned relative POSIX dependency links while preserving Windows junctions and plugin-local dependency ownership. Cover whole-checkout relocation with the original root unavailable and shared SDK identity intact. Fixes openclaw#135896. Follow-up to openclaw#135728.
…aged plugin root The official 2026.9.1 image cannot load its bundled externally distributed plugins (codex, diagnostics-otel): doctor and plugins inspect report every declared dependency as missing. Since the workspace moved to pnpm's isolated linker (openclaw#135728) those packages live only in /app/node_modules/.pnpm and are linked from /app/extensions/<id>/node_modules, neither of which is an ancestor of the packaged root /app/dist/extensions/<id> that the dependency lookup (src/plugins/status-dependencies-core.ts) and the managed Codex launcher resolution (extensions/codex/src/app-server/managed-binary.ts) start from. 2026.8.2 worked only because the hoisted linker placed them in /app/node_modules. Docker-selected plugins are built as unified outputs, so the source-checkout dependency links added in openclaw#135903 never applied to them. Move linkSourcePluginDependencies into a plain-Node module and have the Docker assembly stage link each retained root-package-excluded plugin's production install under dist/extensions/<id>/node_modules after package lifecycle cleanup, failing the image build when a declared dependency still does not resolve from the packaged root. Fixes openclaw#138777. Reported by 8bitsforge. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…aged plugin root (#139117) The official 2026.9.1 image cannot load its bundled externally distributed plugins (codex, diagnostics-otel): doctor and plugins inspect report every declared dependency as missing. Since the workspace moved to pnpm's isolated linker (#135728) those packages live only in /app/node_modules/.pnpm and are linked from /app/extensions/<id>/node_modules, neither of which is an ancestor of the packaged root /app/dist/extensions/<id> that the dependency lookup (src/plugins/status-dependencies-core.ts) and the managed Codex launcher resolution (extensions/codex/src/app-server/managed-binary.ts) start from. 2026.8.2 worked only because the hoisted linker placed them in /app/node_modules. Docker-selected plugins are built as unified outputs, so the source-checkout dependency links added in #135903 never applied to them. Move linkSourcePluginDependencies into a plain-Node module and have the Docker assembly stage link each retained root-package-excluded plugin's production install under dist/extensions/<id>/node_modules after package lifecycle cleanup, failing the image build when a declared dependency still does not resolve from the packaged root. Fixes #138777. Reported by 8bitsforge. Co-authored-by: Claude Fable 5.1 <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
…aged plugin root (openclaw#139117) The official 2026.9.1 image cannot load its bundled externally distributed plugins (codex, diagnostics-otel): doctor and plugins inspect report every declared dependency as missing. Since the workspace moved to pnpm's isolated linker (openclaw#135728) those packages live only in /app/node_modules/.pnpm and are linked from /app/extensions/<id>/node_modules, neither of which is an ancestor of the packaged root /app/dist/extensions/<id> that the dependency lookup (src/plugins/status-dependencies-core.ts) and the managed Codex launcher resolution (extensions/codex/src/app-server/managed-binary.ts) start from. 2026.8.2 worked only because the hoisted linker placed them in /app/node_modules. Docker-selected plugins are built as unified outputs, so the source-checkout dependency links added in openclaw#135903 never applied to them. Move linkSourcePluginDependencies into a plain-Node module and have the Docker assembly stage link each retained root-package-excluded plugin's production install under dist/extensions/<id>/node_modules after package lifecycle cleanup, failing the image build when a declared dependency still does not resolve from the packaged root. Fixes openclaw#138777. Reported by 8bitsforge. Co-authored-by: Claude Fable 5.1 <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Resolves a problem where source installs cannot use pnpm 12.1's whole-package APFS clone cache because the workspace forces the flat hoisted linker. Concurrent installs can generate substantial per-file filesystem activity on macOS.
Why This Change Was Made
Use the isolated linker, keeping pnpm's default internal hoisting. The APFS clone-cache implementation explicitly excludes the hoisted linker. This enables that optimization on supported volumes without changing the package manager, enabling the global virtual store, or weakening dependency policy.
The full CI matrix exposed existing assumptions about a flat dependency tree, so this includes the compatibility repairs needed to make the switch safely. CUA and Codex resolve native optional dependencies from their actual SDK package location, retaining digest/version and pinned-binary checks. Release planning excludes pnpm-created launcher metadata from the retained YAML tree while preserving its existing pinned canonical-byte digest and rejecting external module loads. Test fixtures resolve dependencies through their owning package, and compiled subprocesses bundle workspace-private dependencies rather than expecting those packages at the root. Doctor fixtures retain their private source/UI ownership while canonicalizing dependency paths. Relocated boundary declarations retain their owning package's dependency resolution, and public Vitest mock types keep test-helper declarations portable.
Nine dependencies already used by root tests/tooling are explicit root development dependencies, all at versions already present in the lockfile. Package snapshots, patches, overrides, and transitive versions are unchanged. Discord test adapters live inside the Discord package; its dependency-ownership contract remains enforced. Explicit public type annotations keep emitted declarations portable. Crabline stays external to preserve the package-relative crypto loader. Matrix, Discord, and Feishu use the existing package-local runtime build path; postbuild links each generated plugin to its own source dependencies after metadata cleanup. This preserves independent dependency versions and the shared host SDK, including copied QA runtime trees.
Patched-plugin packaging now verifies isolated virtual-store locations as well as the existing hoisted layout, including pnpm 12's shortened store paths. Frozen importer, patch-hash and package-identity checks remain enforced; redirected or unpatched slots are rejected. The real Matrix package was packed locally, its tarball integrity verified, and all five patched matrix-js-sdk files compared byte-for-byte with the installed patched source. No package was published.
User Impact
Source checkouts can use pnpm's isolated linking and eligible whole-package APFS clones. Existing checkouts should stop jobs using their dependencies before running
pnpm install --frozen-lockfile; migration guidance is in CONTRIBUTING.md. This does not alter running worktrees automatically, cap concurrent installs, or promise a measured install-time or pointer-latency improvement.Evidence
ERR_MODULE_NOT_FOUNDbefore its direct declaration and passed using the existing patched snapshot afterward.Earlier CI runs caught the compatibility failures addressed here; it was not treated as merge-ready evidence. No numeric performance claim or dependency upgrade is included.