Skip to content

story-123: A run invoked from a worktree creates its worktree where the repository's other trees already stand - #191

Merged
jerodw merged 6 commits into
mainfrom
story/story-123
Sep 9, 2026
Merged

story-123: A run invoked from a worktree creates its worktree where the repository's other trees already stand#191
jerodw merged 6 commits into
mainfrom
story/story-123

Conversation

@jerodw

@jerodw jerodw commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Story

A run invoked from a worktree creates its worktree where the repository's other trees already stand.

orchestration/worktrees.py held two derivations of where repository-level state lives, and they disagreed about which tree the repository is.

primary_root asks git for the common directory, so it answers with the repository's primary working tree whichever tree it is asked from — that is what makes the outbox queue one per repository. worktree_root, with worktree_dir unset, answered with the sibling of whichever tree it happened to be asked from.

So a run started from inside a worktree created its new worktree beside that one, nesting trees, instead of putting it where the repository's other trees already are. The two answers now come from one rule.

Evidence

  • Suite: 5472 passed, 1 skipped (exit 0)
  • Clean clone with the story committed: exit 0
  • Verification passed, no blocking issues
  • 0 retries, 0 self-routes, 1 correction pass, $15.79
  • New module tests/test_a_run_creates_its_worktree_beside_the_others.py (374 lines); 7 files changed, +557 / −6

A question this raises that no standard answers

Story-123 uses primary_root, which story-118 added, and story-123 was planned before story-118 merged.

The verifier checked the bytes and they are fine: a diff of orchestration/worktrees.py against main shows only this story's own hunks — the DEFAULT_SUFFIX comment, the worktree_root docstring, and the two-line expression — so the imported function's body matches main's exactly.

What it could not settle is the practice: whether a story building on a sibling that has not yet landed is something this repository sanctions. Nothing in .harness/standards/ speaks to it, and it has not come up before because stories have been run one at a time. It is worth deciding now that several are planned and unrun at once.

Notes for review

The second unverified note is narrower: two end-to-end absence assertions were not shown to fail by driving the pre-story behaviour, so their falsifiability is argued from reading rather than demonstrated.

🤖 Generated with Claude Code

https://claude.ai/code/session_019WkxmJ5ArLEaC2RDPGkbRU

jerodw and others added 6 commits September 8, 2026 20:30
…ere the repository's other trees already stand
…he repository's other trees already stand

Implemented by the l5 harness story workflow.
# Conflicts:
#	.harness/history/execution-log.jsonl
#	.harness/history/inspection-log.jsonl
The schema still described the old default, a sibling of whatever tree the
harness was invoked in — which from a worktree names the nested path this
story exists to stop producing.

The architecture note credited story-118 with primary_root and said it is
what makes the outbox queue one per repository. This story added it, and the
queue reaches its answer by its own route. The docstring justified the
function by the queue for the same reason.

Found by this story's own post-story inspection, filed as 188, 189 and 190.
189 is the duplicated derivation and is left to a story of its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WkxmJ5ArLEaC2RDPGkbRU
@jerodw
jerodw merged commit 8f74b24 into main Sep 9, 2026
3 checks passed
@jerodw
jerodw deleted the story/story-123 branch September 9, 2026 06:06
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