Skip to content

fix(home): an agent's npm install can no longer rewrite the software checkout (v0.437.1) - #811

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/npm-stop-file
Sep 10, 2026
Merged

fix(home): an agent's npm install can no longer rewrite the software checkout (v0.437.1)#811
vikasprogrammer merged 1 commit into
mainfrom
feat/npm-stop-file

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

Why

npm installs into the nearest ancestor that has a package.json. On a box whose data home is <checkout>/data, an agent's npm install in a scratch folder installed into the software checkout: instawp's infra-ops ran npm install playwright-core, npm rewrote the live checkout's package.json + lockfile, and make-live refused to deploy the dirty checkout.

What

  • src/edge/npm-boundary.tsensureNpmBoundary(home) writes a minimal private package.json at the data home root (never overwrites an existing one). Called on every tenant build in tenant-registry.
  • Agent installs now land in <home>/node_modules (still resolvable from every agent folder); the checkout is never touched. /data is already gitignored at the repo root, so the file can't dirty the checkout itself.

Validation

scripts/npm-boundary-test.cjs asserts via npm's own npm prefix (checkout before, home after; no overwrite). Full npm run test:governance green. Verified on the instawp box: npm prefix from an agent folder → the data home.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DhrGcimwmAypei3a25oq71

…checkout (v0.437.1)

npm installs into the nearest ancestor with a package.json. With the data home
at <checkout>/data, an agent's `npm install` in a scratch folder rewrote the
live checkout's package.json + lockfile (instawp infra-ops, playwright-core),
and make-live then refused the dirty checkout. Each tenant build now writes a
minimal private package.json at the data home root, never overwriting one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DhrGcimwmAypei3a25oq71
@vikasprogrammer
vikasprogrammer merged commit c90ce29 into main Sep 10, 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