Skip to content

build: run parallel work in worktrunk worktrees beside the repository - #266

Merged
CaffeinatedCoder merged 3 commits into
release/2.4.0from
build/worktrunk-worktrees
Oct 31, 2026
Merged

CaffeinatedCoder merged 3 commits into
release/2.4.0from
build/worktrunk-worktrees

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Closes #265

Problem

Parallel work ran in worktrees from three sources, each with a flaw. The desktop app's sessions go to .claude/worktrees/ inside the repository, kept out of git add -A only by .git/info/exclude. Agent worktrees started at origin/main instead of the release branch. Hand-made worktrees lived in the scratchpad or /tmp. The main checkout had 19 linked worktrees, 17 of them under .claude/worktrees/.

Change

  • Decision 126 and the runbook design/worktrees.md: worktrees go beside the repository (../CodoMetis.TypeKit-worktrees/<branch>), made with wt switch -c. worktrunk's default branch is set to the open release/<version> in each clone, so new branches, the plugin's agent worktrees, and wt remove/wt step prune base on it. Nothing is copied into a new worktree.
  • tools/BashGuard refuses wt merge and wt step squash|rebase|push. It skips worktrunk's global options and allows --help. Work lands by PR with a merge commit (decision 94).
  • .gitignore gets .claude/worktrees/.
  • AGENTS.md (the guard, the code graph, workflow step 6), CONTRIBUTING (Pull requests, Releasing step 5: move the default branch when a release branch is cut), the plan's page map and the ADR index link the runbook.

Merge order: this PR uses decision 0126. 0122 to 0124 are in the stack #188, #189 and #190, and 0125 is the third-party-licenses record. DesignRecordTests.The_records_are_numbered_without_a_gap fails here until those reach release/2.4.0, so merge this PR after them.

Tests

  • CodoMetis.TypeKit.BashGuard.Tests: 112 passed, with 29 new cases (16 refused forms, 12 allowed, one message test).
    • Seed 1, the detection removed: 17 of them fail.
    • Seed 2, the value of -C, --config or --config-set read as the subcommand: 4 of them fail.
  • CodoMetis.TypeKit.Conventions.Tests: 2,029 of 2,030 pass. The one failure is the record-number gap above.
  • Measured in this worktree, made by wt switch -c with no --base: it branched from release/2.4.0. The tools built cold in 2 s and the solution in 27 s, with nothing copied in.

🤖 Generated with Claude Code

Worktrees for parallel fixes and features come from `wt switch -c`, at
../CodoMetis.TypeKit-worktrees/<branch>, with worktrunk's default branch set to
the open release branch, so new branches, the plugin's agent worktrees and
`wt remove`/`wt step prune` all base on release/<version> rather than main.

The Bash guard refuses `wt merge` and `wt step squash|rebase|push`, which squash,
rebase or fast-forward locally: work lands by a PR and a merge commit (decision
94). Seeded twice: the detection removed fails 17 cases, an option's value read
as the subcommand fails 4.

No .worktreeinclude and no copy hook: a fresh worktree built the solution cold
in 27 s with nothing copied in. `.claude/worktrees/` joins .gitignore for the
desktop app's own sessions. design/worktrees.md is the runbook; decision 126
the reasons.

Refs #265

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CaffeinatedCoder CaffeinatedCoder added this to the 2.4.0 milestone Oct 31, 2026
@CaffeinatedCoder CaffeinatedCoder added chore Build, CI, tooling, packaging, refactoring with no behaviour change area/tooling The repository's tools: prober, verdict, guard, docs-query, smoke test labels Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tooling The repository's tools: prober, verdict, guard, docs-query, smoke test chore Build, CI, tooling, packaging, refactoring with no behaviour change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant