Skip to content

issue-work: Phase 1.6 worktree branches off origin/$DEFAULT_BRANCH (closes #61)#76

Merged
SnowboardTechie merged 3 commits into
mainfrom
bryan/dreamy-cray-15e604
May 3, 2026
Merged

issue-work: Phase 1.6 worktree branches off origin/$DEFAULT_BRANCH (closes #61)#76
SnowboardTechie merged 3 commits into
mainfrom
bryan/dreamy-cray-15e604

Conversation

@SnowboardTechie
Copy link
Copy Markdown
Owner

Summary

issue-work Phase 1.6 instructed the LLM to call EnterWorktree with a base_branch parameter that doesn't exist on the tool. Result: every worktree created by /issue-work branched off the session's current HEAD instead of the default branch — silently wrong whenever the skill was invoked from inside another worktree (the common case in this repo) or from a trunk parked on a feature branch.

This PR rewrites Phase 1.6 to a three-step pattern: resolve {TRUNK_ROOT} (now bound explicitly at the end of Phase 1.4), run git -C "{TRUNK_ROOT}" worktree add -b {branch} {path} "origin/$DEFAULT_BRANCH" against the trunk, then EnterWorktree(path: ...) to switch in. Mirrors the precedent set by #68 and the {TRUNK_ROOT} placeholder convention from #72. Adjacent drift fixed alongside: Phase 1.5's two $TRUNK shell-var references rename to {TRUNK_ROOT} for consistency, and references/repo-resolution.md:113 corrects its description of EnterWorktree's contract.

Test plan

  • frontmatter-lint.yml — runs locally clean (14 agents, 18 skills validated)
  • docs-lint.yml — relative trailing-slash pattern returns no matches
  • version-check.ymlCHANGELOG.md entry under [Unreleased] / Fixed; plugin.json version unchanged so non-release path applies
  • Smoke test (post-merge, per ticket AC): invoke /issue-work {ticket} from inside another worktree, confirm git log --oneline -1 issue-{N}-{slug}^ resolves to the tip of origin/main

Three review passes via /pr-self-review (correctness / security / simplicity) ran in pre-pr mode after the initial commit; 8 findings accepted in-loop, 2 pushed back as out-of-scope (kebab-slug path-traversal tightening — threat model is the user's own tickets, git check-ref-format rejects ..-style branch names; 60-char cap truncation under-spec — over-specifying for a non-issue). No critical or major findings outstanding. Full triage record in the state dir's summary.md.

Acceptance criteria from #61, all met:

  • Phase 1.6 no longer references a non-existent EnterWorktree base_branch or branch_name parameter.
  • {TRUNK_ROOT} bound explicitly in Phase 1.4 before git worktree add runs.
  • Default branch pinned via origin/\$DEFAULT_BRANCH.
  • Resume case documented in Phase 1.6 + the Edge Cases table row.

Changelog

  • Non-release PR — added a bullet under `## [Unreleased]` / `### Fixed` in `CHANGELOG.md`.

@SnowboardTechie SnowboardTechie added bug Something isn't working quick win Small, self-contained scope — good candidate for a focused session labels May 3, 2026
@SnowboardTechie SnowboardTechie marked this pull request as ready for review May 3, 2026 22:57
@SnowboardTechie SnowboardTechie merged commit 16d9720 into main May 3, 2026
3 checks passed
@SnowboardTechie SnowboardTechie deleted the bryan/dreamy-cray-15e604 branch May 3, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working quick win Small, self-contained scope — good candidate for a focused session

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant