v0.18.0 — worktree-isolated pipeline flow
Worktree-isolated pipeline flow + optional PR (feature 004)
Every bender pipeline session now runs inside a dedicated git worktree on a
dedicated session branch (bender/session/<id>). The main working tree is
never written to by bender; concurrent sessions do not collide. Worktree
isolation is mandatory — incompatible repos (git missing, bare,
mid-rebase / merge / cherry-pick) refuse to start with a specific exit code.
Pull requests are strictly opt-in via bender sessions pr <id>: no push,
no PR, no remote mutation without explicit invocation. Uses the user's
locally installed platform CLI (gh for GitHub today; glab stubbed for a
future release).
New CLI
bender worktree create <session-id> [--base-branch=BRANCH]bender worktree list [--json]bender worktree remove <session-id> [--force]bender worktree prune [--older-than=DURATION]bender sessions pr <session-id> [--draft] [--refuse-update] [--json]bender sessions listgains WORKTREE / BRANCH / PR columns (v1 sessions labeledlegacy)
Schema (backwards-compatible)
state.jsonv1 → v2: addsworktree,session_branch,base_branch,base_sha, optionalpull_request- v1 files continue to load (flagged as
legacyin the UI; no migration needed) - 5 new event kinds:
worktree_created,worktree_removed,worktree_missing,pr_opened,pr_update_refused
Exit-code table
| Code | Meaning |
|---|---|
| 10 | git unavailable / repo bare / not a git repo |
| 11 | repo mid-rebase / mid-merge / mid-cherry-pick |
| 12 | configured worktree root violates placement rules |
| 13 | session branch bender/session/<id> already exists |
| 20 | remove/pr: session does not exist |
| 21 | remove: refused on an active session |
| 30 | pr: session not eligible (active / no commits) |
| 31 | pr: no adapter matches the configured remote |
| 32 | pr: push or platform-CLI call failed |
| 33 | pr: refused to update existing PR under --refuse-update |
New packages
internal/worktree— lifecycle primitives,GitRunner+ExecRunner+FakeRunnerinternal/pr—Adapterinterface, GitHub adapter viagh, GitLab stub
Not affected
- Existing commands, skills, and pipeline contracts are untouched.
- v1 sessions on disk continue to load — no migration required.
See the README bender worktree and bender sessions pr sections for the
full walkthrough.