Skip to content

Node tooling installs from integrity-locked dependency trees - #856

Closed
zlareb1 wants to merge 4 commits into
mainfrom
fix/security-node-tool-locks
Closed

zlareb1 wants to merge 4 commits into
mainfrom
fix/security-node-tool-locks

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

Compiler indexers, package managers and agent test tools install from integrity-checked dependency locks. Package verification disables install scripts before importing published SDK code.

Why

A fixed top-level npm version still resolves mutable dependency ranges, and lifecycle scripts can fetch native replacements outside a lock. Private tooling projects commit the full package graph and artifact integrity, install with vendor lifecycle scripts disabled, and bind their required native binaries locally. Compiler tools keep relative executable links so the installed tree works in native deployments and copied image stages.

Scope and risk

This adds locked projects for compiler tools, agent test CLIs, the workflow package manager and codespace setup. The existing compiler and agent versions are retained. The workflow package manager moves to the patched same-major version 10.34.9; its bootstrap lock and the integration's packageManager field agree, preventing an automatic download of the older version. The copied course setup includes its own matching CLI manifest and lock.

All tooling npm ci commands use --ignore-scripts. A local binder checks each required native package against the committed graph and exact wrapper version, refuses missing or escaped binary paths, and binds the downloaded executable without running a vendor installer. The compiler lock includes baseline x64 native variants that an installer could otherwise download outside the graph. An offline, script-disabled rebuild refreshes package-manager launchers. Platform jobs use the locally installed native binaries and refuse a missing agent executable. Native optional packages resolve beside their CLI package in the locked tree, including the platform binary paths. Workflow path filters include their tooling locks. The server image copies the compiler manifests before invoking its installer. Missing or mismatched native packages fail installation, including optional packages whose extraction failure npm treats as nonfatal. No replacement download is attempted. The production command names and install prefix stay the same.

The release check continues to install the exact version under verification, with lifecycle scripts disabled and registry signatures checked before the SDK import. The package smoke check also disables lifecycle scripts for the locally built tarball. These acceptance checks keep their existing import and version assertions.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: native compiler-tool installations use the script and its adjacent code-toolchains directory from the same checkout. Container builds copy both. Matching native optional packages are required; use Node for the target platform and do not omit optional dependencies. Missing native packages stop installation. The standalone codespace setup includes its own matching binder. Existing callers retain the same prefix and executable names.
  • Rollback: reinstall the earlier tooling script and its inputs. No database, migration, API or provider changes.

Tests

  • This composition includes the merged request-context fixture isolation; production privacy guards and victim assertions are unchanged. Full CI must pass on the current head.
  • Eighteen focused native-binding and course-copy cases pass, covering valid inputs, absent native packages and binaries, escaped paths, prevalidation before binding, disabled lifecycle commands and a nested-install leak control. These results cover the Linux fixture controls; the final platform handling and Windows launcher-manifest case require current-head CI.
  • An actual bounded offline compiler installation completes its script-disabled setup, local native binding, offline launcher rebuild and workspace probe. Its subsequent checks of executable versions exceed the enforced memory ceiling, so that control is incomplete and is not reported as passing. It is not retried with higher limits or another runner. Further native-version, platform and image qualification runs in CI.
  • Every install-script owner in the tooling graphs is inspected. Native binding and package-manager shim setup are replaced with explicit local operations; obsolete global-shim cleanup is skipped. Four baseline native packages are added to the compiler lock, with existing versions unchanged.
  • The copied native binders are byte-identical. Changed-source formatting, prose and whitespace checks pass. No model calls, local image builds, service deployments or broad local suites run.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated: Codex added tooling manifests and installers, generated locks, checked the native installation paths and ran focused validation.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Full formatting, lint, type, platform and image checks pass in CI.
  • Tooling locks are generated from their manifests; no generated server API or schema files change.
  • No wire, migration, coding-agent plugin behavior or frontend changes.
  • Repository text follows the public-copy rules.
  • Commits are signed off.

Keep compiler and agent CLI dependencies reproducible across native and container installs. Use a patched locked workflow package manager and check release package signatures before importing code with install scripts disabled.

Signed-off-by: zlareb1 <[email protected]>
Disable package lifecycle scripts and require matching native packages from the committed graph before binding launchers. Retain baseline CPU variants and offline shim rebuilding, and test missing-native failures with network and process leak controls.

Signed-off-by: zlareb1 <[email protected]>
@zlareb1 zlareb1 mentioned this pull request Nov 18, 2026
6 tasks done
@zlareb1 zlareb1 closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant