Problem
Every worktree thrawn creates (task worktrees and _integration) is a fresh checkout branched from the base commit. Installed dependencies don't carry over — so on a Ruby repo, if the run touches Gemfile.lock, the first bin/rspec in the integration worktree fails with missing gems.
Observed on a real run (gh-4 on a Rails repo): the merged code was fine, but checks went red purely because the fresh _integration worktree needed bundle install. The integrator agent then burned a whole fix attempt (out of integrator_attempts = 2) rediscovering and running bundle install — several minutes of opus time for a deterministic one-liner.
This will recur on every run in any repo where checks need installed deps (bundler, npm/yarn, mix deps.get, pip, …).
Proposal
Add a per-repo setup hook to .thrawn.toml, run in each freshly created worktree before the task agent starts / before checks run:
[thrawn]
setup = ["bundle install"] # or ["npm ci"], ["mix deps.get"], …
Behaviour:
- Run in task worktrees after
git worktree add, before the agent spawns (agents also benefit — they can run tests while working)
- Run in
_integration after merging, before the first check command
- Failure of a setup command should fail fast with its output — not dispatch an integrator
- Log to
.thrawn/runs/<run>/setup-<where>.log
Alternatives considered
- Making
bundle install the first entry in [checks] commands — works today as a per-repo workaround, but it conflates setup with verification, doesn't help task worktrees, and still counts a setup failure as a "checks failing" integrator trigger
- Auto-detecting (Gemfile →
bundle install, package.json → npm ci, …) — could complement the hook as a default, but an explicit hook should exist first
Acceptance
Problem
Every worktree thrawn creates (task worktrees and
_integration) is a fresh checkout branched from the base commit. Installed dependencies don't carry over — so on a Ruby repo, if the run touchesGemfile.lock, the firstbin/rspecin the integration worktree fails with missing gems.Observed on a real run (
gh-4on a Rails repo): the merged code was fine, but checks went red purely because the fresh_integrationworktree neededbundle install. The integrator agent then burned a whole fix attempt (out ofintegrator_attempts = 2) rediscovering and runningbundle install— several minutes of opus time for a deterministic one-liner.This will recur on every run in any repo where checks need installed deps (bundler, npm/yarn, mix deps.get, pip, …).
Proposal
Add a per-repo setup hook to
.thrawn.toml, run in each freshly created worktree before the task agent starts / before checks run:Behaviour:
git worktree add, before the agent spawns (agents also benefit — they can run tests while working)_integrationafter merging, before the first check command.thrawn/runs/<run>/setup-<where>.logAlternatives considered
bundle installthe first entry in[checks] commands— works today as a per-repo workaround, but it conflates setup with verification, doesn't help task worktrees, and still counts a setup failure as a "checks failing" integrator triggerbundle install, package.json →npm ci, …) — could complement the hook as a default, but an explicit hook should exist firstAcceptance
setupcommands from.thrawn.tomlrun in every new task worktree and in_integrationbefore checksthrawn/tests/test_thrawn.py(fake setup command, both worktree kinds, failure path)