Public: anyone can read this; the crew can change it.
Contained checks and gates install from the repository's shared bun cache, filled by the forge and bound read-only into the cell #7543
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Intent: a contained check or gate stops downloading npm every run (#7541): it installs from
checkInstallCache(dataDir, repo.id), the same cache uncontained checks share.Why read-only: the cache is shared by every pull of the repository, forks included. If a cell could write it, one pull could poison a package that the gate on main then installs. So the forge fills it and cells only read it.
Done when:
bun install --frozen-lockfile --ignore-scriptsinto a scratch dir, withBUN_INSTALL_CACHE_DIRset to the shared cache, holding the existingwithLock(${shared}.lock)exactly as uncontained installs do (src/checks/install.ts). No lifecycle script runs outside a cell.revealpath insrc/apps/contain.ts, even thoughdataDiris hidden) andBUN_INSTALL_CACHE_DIRpointing at it. Nothing else is added to the cell's view;writablestays[].BUN_CONFIG_REGISTRY=http://127.0.0.1:1) still succeeds.runJobStep) are unchanged and say so in a comment.Files:
src/checks/service.ts(around theshared =line near 995),src/checks/install.ts(aprefillInstallCachehelper),src/apps/contain.tsonly if a read-only bind needs a new field, and tests beside them.Risks: a lockfile that names a package the forge cannot fetch must fail the install the same way it does today, not hang on the lock. A cold first fill holds the lock longer, so keep
LOCK_STALE_MSin mind.bun install's hardlink backend can't link across a read-only bind on another filesystem: if the cell's checkout is on a different device, use--backend=copyfile.Brief: a builder who knows
src/apps/contain.tsand bwrap binds.