chore: install deps in a fresh bb worktree (MX-243) - #18
Merged
Conversation
A bb-managed worktree checks out tracked files only, so this repo's worktrees arrived with no node_modules and bb said nothing — an absent .bb-env-setup.sh means provisioning continues silently. The agent standing in that worktree then copies a dependency tree from another checkout on this disk, which leaves no diff, no install log and no lockfile change (MX-239: 12 of 15 candidate donors held the wrong resolved version). The --cache inside the workspace is not decorative: from inside the agent Bash sandbox a plain `npm install` fails claiming ~/.npm "contains root-owned files" and prescribes sudo, which is false and unrunnable by an agent. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MGrin/bb-plugin-accountsandMGrin/bb-plugin-flare-operatorare bb projects that track apackage.jsonand had no committed.bb-env-setup.sh, so every worktree bb created for them arrived with nonode_modules— and bb continues silently when the hook is absent (bb guide environments), so nothing said so.The failure that follows is silent too: the agent standing in that empty worktree sources a dependency tree from another checkout on this disk. Measured in MX-239 over 15 candidate donors, 12 held the wrong resolved version, and that green leaves no diff, no install log and no lockfile change.
What this adds
One tracked
.bb-env-setup.shat the repo root — tracked is load-bearing, an untracked one is absent in the worktree and never runs — plus.npmcache/in.gitignore.--cache "$PWD/.npmcache"is deliberate and the comment says why: from inside the agent Bash sandbox a plainnpm installfails claiming~/.npm"contains root-owned files" and prescribessudo chown. That is false (0 of ~114500 files there are root-owned) — it is a sandbox read-denial wearing an ownership error, with a remedy an agent cannot run.The script is never fatal: bb deletes the new worktree if the hook exits non-zero.
Verified
Ran
env bash .bb-env-setup.sh— the way bb runs it — in a fresh worktree with nonode_modules, then the repo's own suite against the tree it produced.shellcheck -xclean.🤖 Generated with Claude Code