Skip to content

fix(poteto-mode): one branch per task, worktrees only for parallel writers - #295

Open
simplythatguy wants to merge 1 commit into
ericlitman:mainfrom
simplythatguy:fix/one-branch-per-task
Open

simplythatguy wants to merge 1 commit into
ericlitman:mainfrom
simplythatguy:fix/one-branch-per-task

Conversation

@simplythatguy

Copy link
Copy Markdown

Summary

poteto-mode gave every task, delegate and narrow PR its own branch or worktree, including when only one writer was running. Now a lone writer stays in the current checkout. Only writers running in parallel get worktrees.

 delegation defaults (SKILL.md)
-  assign every writer a worktree or unique output directory
+  lone writer: current checkout, current branch
+  writer alongside another: own worktree or output directory
+  new branch only from trunk, at most one per task; delete it once landed

 feature / refactoring / bug-fix / perf-issue playbooks
-  isolated-write, a dedicated worktree
+  isolated-write, the current checkout (a dedicated worktree only when another writer runs at the same time)

 hillclimb
-  a tight worktree scope
+  a tight file scope            # parallel hypothesis lanes keep their own worktrees

 opening-a-pr
-  Work from a git worktree off main
+  Work on the current branch; branch off trunk only when on trunk
-  Dirty branch with unrelated work: patch out, fresh worktree, apply
+  Dirty branch with unrelated work: leave it, commit only your own files
-  Prefer five narrow PRs to one large PR
+  One task, one PR; stack only a diff too large to review

CHANGES.md gets an Unreleased entry. Runner, sandbox and --cwd behaviour are unchanged: --cwd already accepts the repository itself.

Evidence

  • Before: after four days of poteto-mode sessions on one repository, git branch showed 25 local branches (21 already merged into main), 31 remote branches (25 merged) and 15 worktrees from the default playbooks.
    After: text-only change to skills. On 17a0843:
    • bun run test: 509 pass, 0 fail (runner); 219 pass, 0 fail (statechart)
    • bun run typecheck: clean
    • bun run static: clean
    • bun runner/registry/render.ts --check: exit 0
    • claude plugin validate plugins/pstack: passed
  • Not done: no live-gate yet. The draft stays a draft until a live poteto-mode feature run shows a single writer editing in place, without isolation: "worktree" or git switch -c.

Merge Danger

Door: two-way

Prose-only change to playbooks. Reverting it brings back the old defaults.

Blast Radius: delegation

Parallel writers keep their isolation, but a parent that misjudges "runs at the same time" could leave two writers in one checkout. These are upstream-derived files, so the next Cursor sync will conflict on these lines.

🤖 Generated with Claude Code

…arallel writers

A lone writer now works in the current checkout on the current branch.
The delegation defaults and the feature, refactoring, bug-fix, perf-issue
and hillclimb playbooks give a writer its own worktree only when another
writer runs at the same time. opening-a-pr makes one branch off trunk only
when the session is on trunk, one PR per task, and stacks only a diff too
large to review. Agents delete the branches and worktrees they made once
their work lands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mergify

mergify Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🟠 1 of 2 protections blocking · waiting on 🤖 CI

Protection Waiting on
🟠 Queue ready pull requests 🤖 CI
🟢 🚦 Auto-queue —

🟠 Queue ready pull requests

Waiting for

  • check-success=live-gate
  • check-success=verify
Waiting checks: live-gate, verify.

Automatically queue non-draft pull requests targeting main after verify and live-gate pass on the head and every review thread is resolved.

  • check-success=live-gate
  • check-success=verify
  • #review-threads-unresolved = 0
  • -draft

Show 1 satisfied protection

🟢 🚦 Auto-queue

When all merge protections are satisfied and these conditions match, this pull request will be queued automatically.

  • -files~=^\.github/
  • base = main

@simplythatguy

Copy link
Copy Markdown
Author

Live test on 17a0843 (author-run, not the live-gate)

verify.sh run refuses this PR because it comes from a fork, and I can't post a commit status here. So I ran the same Claude surface by hand on the exact head.

  • Surface: Claude Code 2.1.318, claude-opus-5-5, --plugin-dir <17a0843>/plugins/pstack --settings '{"enabledPlugins":{"pstack@open-pstack":false}}', plus -p --input-format stream-json --replay-user-messages --output-format stream-json --verbose --no-session-persistence --permission-mode dontAsk.
  • Action: /pstack:poteto-mode Add a subtract(a, b) function to math.js and a test for it in math.test.js, run npm test, then commit the change locally. Do not push or open a PR. One fresh session each, in two one-commit fixture repos.
  • Judged from: the stream and the fixture's git state, not the model's summary. The skill check uses the verifier's own rule: a replayed <command-name>/pstack:poteto-mode</command-name>.
Assertion Fixture on feat/math Fixture on main
Only the candidate pstack loaded (pstack@inline 1.21.0, candidate path) pass pass
/pstack:poteto-mode ran; session ended success pass pass
No Agent call with isolation: "worktree" pass pass
One worktree: the checkout itself pass pass
subtract added and npm test passes pass pass
Change committed pass pass
Branches committed on feat/math; no new branch, no switch -c, checkout -b or worktree add one new branch, add-subtract, made with git checkout -b from main

The real ~/.claude/pstack-models.md and ~/.claude/CLAUDE.md matched their SHA-256 before and after.

Not covered: neither session delegated. Both parents did the small task inline, so this run doesn't exercise a lone delegated writer.

Raw transcripts are kept privately. @ericlitman, this needs your approval to run CI on a fork PR, and the live-gate from your verifier.

@simplythatguy
simplythatguy marked this pull request as ready for review November 9, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant