Skip to content

worktree_setup manifest hook: worktrees are missing gitignored inputs (node_modules), and every spec/check hand-rolls the workaround #42

Description

@mlava

Symptom

Worktrees are created clean from HEAD, so gitignored inputs — node_modules above all — don't exist in them. Every JS/TS task needs [ -e node_modules ] || ln -s <main-repo>/node_modules node_modules in BOTH the worker spec and the check's verify script; forgetting either fails the lane for environment reasons that look like worker failures. (This is the inverse of the documented footgun where gitignored outputs silently vanish from patch exports.)

Evidence

All 12 lanes of a 2026-07-14 fix swarm (protocol-spec-fixes) carried the symlink boilerplate twice each — 24 copies of the same line.

Proposed fix

A run-level (and/or task-level) worktree_setup field in the manifest: a command executed once per worktree after creation, before the worker spawns, with its output captured to the worker log. Example:

{ "worktrees": true, "repo": "/path/repo", "worktree_setup": "ln -s /path/repo/node_modules node_modules" }

Lint could suggest it when repo contains a package.json and worktree_setup is absent. A failing setup command should surface as a setup error (see #37's setup_error plumbing), not as a worker failure.

Size: M.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions