fix(framework): install deps on worktree bootstrap + legible deps-preflight at gate seam (#856)
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
Worker git-worktrees under a fresh `git worktree add` have empty node_modules/.bin (pnpm workspaces do not share node_modules across worktrees), so every gate binary (tsc/eslint/prettier/vitest) fails with a raw `sh: 1: <tool>: not found` before the QA gate suite ever runs a real check. That failure is indistinguishable from a genuine test/lint failure -- a false-red gate that was responsible for 131/147 fleet tool-errors. - plugins/mosaic-framework/src/index.ts: the injected "Git Worktree Requirement" instructions now direct every worker to run `pnpm install --frozen-lockfile --prefer-offline` immediately after `git worktree add`/`cd`, before any gate is invoked. - packages/mosaic/framework/tools/qa/qa-hook-stdin.sh: the common gate-entry seam (registered as the PostToolUse hook for every Edit/Write/MultiEdit in runtime/claude/settings.json) now preflights node_modules/.bin presence for JS/TS files and fails with an explicit "deps not installed -- run pnpm install" sentinel instead of silently letting a raw not-found surface downstream. - packages/mosaic/framework/tools/qa/test-deps-preflight.sh: new regression harness (wired into test:framework-shell) covering missing node_modules/.bin, empty node_modules/.bin, populated node_modules/.bin, and non-JS/TS skip behavior. Closes #856.
This commit is contained in:
@@ -217,12 +217,22 @@ git fetch origin
|
||||
mkdir -p ~/src/${projectName}-worktrees
|
||||
git worktree add ~/src/${projectName}-worktrees/<task-slug> -b <branch-name> origin/main
|
||||
cd ~/src/${projectName}-worktrees/<task-slug>
|
||||
pnpm install --frozen-lockfile --prefer-offline
|
||||
# ... all work happens here ...
|
||||
git push origin <branch-name>
|
||||
cd ~/src/${projectName} && git worktree remove ~/src/${projectName}-worktrees/<task-slug>
|
||||
\`\`\`
|
||||
|
||||
Worktrees path: \`~/src/<repo>-worktrees/<task-slug>\` — NEVER use /tmp.`);
|
||||
Worktrees path: \`~/src/<repo>-worktrees/<task-slug>\` — NEVER use /tmp.
|
||||
|
||||
\`pnpm install --frozen-lockfile --prefer-offline\` MUST run immediately after
|
||||
\`git worktree add\`/\`cd\`, BEFORE any gate (\`pnpm test\`/\`lint\`/\`typecheck\`/\`format:check\`)
|
||||
is invoked. pnpm workspaces do NOT share \`node_modules\` across separate git
|
||||
worktrees — a fresh worktree has an empty \`node_modules/.bin\`, so every gate
|
||||
binary (\`tsc\`/\`eslint\`/\`prettier\`/\`vitest\`) fails \`sh: 1: <tool>: not found\`
|
||||
until deps are installed. That failure is indistinguishable from a real
|
||||
test/lint failure — a false-red gate. Never skip this step and never reorder
|
||||
it after the first gate invocation.`);
|
||||
|
||||
// 6. Completion gates
|
||||
sections.push(`# Completion Gates — ENFORCED
|
||||
|
||||
Reference in New Issue
Block a user