implementation-open places the worktree through worktree start; payload tells the skill to enter, exit, and finish #846
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
Reference
jared/cc-os#846
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The implement skill decides the worktree in prose before it opens the implementation (
plugins/os-sdlc/skills/implement/SKILL.md:45). Nothing in code stops an implementation from running in the primary checkout on main.implementation-openbinds the DB for its cwd; in a linked worktree without ADR-0143 links it silently creates a secondpipeline.db. It also deletes retired test files under its cwd (command/implementation/open.rb:34).This ticket is the os-sdlc part of ADR-0253: open places the worktree through the os plugin's
worktree start, and the payload tells the skill what to do. It depends on #844, which adds the start modes andfinish --keep.Reproduce
n/a: design change; nothing fails today.
Approach
implementation-openbinds the primary checkout's DB, then shells out once toworktree start ticket-<n>(found on PATH), then opens with the printed path as root. The payload gains aworktreeblock. os-sdlc's ownadapter/git/worktree.rbis deleted; the os worktree CLI is the only worktree creator (ADR-0157).Required work:
plugins/os-sdlc/lib/os_sdlc/controller/boot/inputs.rb, theimplementation-openinput binds the project in the primary checkout, not in the cwd: take the cwd's path relative to its git top-level, apply it under the primary checkout (parent ofgit rev-parse --git-common-dir), then resolve withRootSearch.outermostas today. Projects whose.sdlc/project.yamlsits below the git top-level (for example~/dev/ruby-gems/<gem>,~/dev/cc-plugins/api-wrapper) must keep working. The input also keeps the session cwd for the placement and forenter— check:grep -n "common-dir\|primary_root" plugins/os-sdlc/lib/os_sdlc/controller/boot/inputs.rb plugins/os-sdlc/lib/os_sdlc/adapter/git/repo.rbplugins/os-sdlc/lib/os_sdlc/adapter/worktree_placement.rb: findsworktreeonenv["PATH"], runsworktree start ticket-<n>with the session cwd, and parsesmode,path,branch,finish. A missing CLI, a non-zero exit, or output without all four keys raisesWorktreePlacement::Failedwith the CLI's stderr or the missing key.DispatchCommands.implementation_opencalls the placement with the session cwd beforeImplementation::Open.call, then passes the project root inside the printed worktree path (the printed path plus the same relative project path) as root toOpenandTracker::Tea.for, and turnsWorktreePlacement::Failedintoexit_loudly("implementation-open worktree: ...").Implementation::Open.callandOpenPayload.fortake aworktree:value. The open payload gainsworktree: { mode, path, branch, enter, exit, finish }:enteris true when the session cwd differs frompath;exitis false only formode: persistent;finishis the stringstartprinted, unchanged.plugins/os-sdlc/lib/os_sdlc/adapter/git/worktree.rb, andadapter/git/branch.rbwhen it has no other sender — check:! test -e plugins/os-sdlc/lib/os_sdlc/adapter/git/worktree.rbtests/support/tmpdir_test_case.rbscaffold_sdlc_projectmakes a real repo (git init), not a bare.gitdirectory;tests/support/in_process_dispatch_script.rbpasses an env whosePATHholds a stubworktreethat prints aticket-continuereport withpath:set to the test directory. Existing CLI tests that runimplementation-openkeep passing.Documentation, done by the orchestrator, not by a pipeline agent:
input.dir; open now binds the primary) and ADR-0188 (root search stops at the worktree top).plugins/os-sdlc/skills/implement/SKILL.mdSetup, Start, and Finish; delete the/os:worktree startstep (open now runs it): Start — ifworktree.enter, callEnterWorktree(path: worktree.path); comment the ticket withworktree.branch; on "Merge conflicts in:" resolve with/mattpocock-skills:resolving-merge-conflicts, commit, re-run open. Finish — ifworktree.exit, callExitWorktree(action: keep); then runworktree.finishas printed.docs/implementation-status/os-sdlc.md(or the owning leaf).bin/refresh-plugins.Rejected: detect the start state in the skill (agents can pick the wrong mode; ADR-0157); bind the cwd DB with a pre-bind check (two binds); call
plugins/os/bin/worktreeby repo path (fails outside cc-os).Acceptance criteria
worktreeon PATH, whenimplementation-openruns for ticket 844, then it runsworktree start ticket-844once, before it loads project.yaml or fetches the ticket.implementation-openruns, then the implementation row is written to the primary checkout's.sdlc/pipeline.dband nopipeline.dbis created in the worktree.startprints mode, path, branch, and finish, when open succeeds, then the payloadworktreeblock holds them andfinishequals the printed string.worktree.enteris false; otherwise it is true.mode: persistent, when open succeeds, thenworktree.exitis false; for the ticket modes it is true.worktreeis not on PATH, when open runs, then it exits non-zero, stderr starts withimplementation-open worktree:, and no implementation row is created.startexits 1, when open runs, then it exits non-zero withstart's stderr afterimplementation-open worktree:, and no implementation row is created.startexits 0 but prints nomode:line, when open runs, then it exits non-zero, stderr namesmode, and no implementation row is created..sdlc/project.yamlsits in a subdirectory, when open runs from that subdirectory, then it binds the same subdirectory's DB in the primary checkout and uses the same subdirectory inside the worktree as root.Retired tests
plugins/os-sdlc/tests/adapter/git/worktree_test.rb
Owner sketch
Origin
implementation-openbinds cwd and has no branch guard ← DESIGN: ADR-0157, ADR-0213Blocked by: #844.
VERDICT: CREATE — user-requested hard floor; split from #844 which carries ADR-0253 (2026-09-30).
Work started on branch ticket-846 (worktree .claude/worktrees/ticket-846, mode ticket-new) via /os-sdlc:implement. #842 and #844 merged (main
9ac00e4a).Implementation 12 failed at change-auditor (dispatch 80), verdict:error. Cause: the worktree-session harness guard refused the agent's os-sdlc-subagent-stop --json call four times (#848); the agent then sent a bare {dispatch_id: 80}, which the Runner recorded as an empty completion. The audit itself found no UNMAPPED/CONFLICT items; it noted tests/adapter/git/branch_test.rb must be retired with branch.rb. Blocked on how to run the pipeline around #848.
Body stale (Tracker::Tea.for -> Tracker.for; untyped checks to be rewritten after #847) and item 6 edits existing test support files, which needs the #863 children. Label removed until both are done.
Blocked by #866 (Forgejo dependency recorded).