Add implementation-close CLI to hand-finish an open implementation and stop its daemon #617
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.
Dependencies
No dependencies set
Reference
jared/cc-os#617
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?
Context
A hand-finished implementation stays open in
.sdlc/pipeline.db:completed_atis null,os-sdlc-runner next SESSION_IDstill points at it,implementation-reportprintselapsed_s: null, andLspDaemonLifecycle.closenever runs, so the lsp-probe daemon for the worktree root stays up until its idle timeout.Implementation#complete!exists on the model and already stops the daemon, but no CLI subcommand reaches it.abandon_unfinished!runs only at the nextimplementation-openfor the same session.Observed on #607 implementation 3 (session 4974deff-0140-4813-8cd1-e96c6356a214): all eight dispatches passed, the run was hand-finished after #614's crash, and the row is still open at position
refactorer.Change
closed?is true when any ofcompleted_at,failed_at,escalated_at,abandoned_atis set. No schema change: the reason for the hand finish lives on the ticket close comment.LspProbe::Daemon.stop(root:)must tolerate a root whose worktree directory is already gone; the first use is implementation 3, whose worktree was removed.Out of scope: a
closed_bycolumn (schema bump wipes the shared DB from a worktree runner, ADR-0129).Tasks
Implementation#closed?.implementation-close IMPLEMENTATION_IDsubcommand: refuses a missing or closed implementation, elsecomplete!(root)and prints the JSON line.Daemon.stop(root:)returns cleanly when the root directory does not exist (already true on main).ruby plugins/os-sdlc/tests/all.rb; green.os-sdlc-runner implementation-close 3from the main checkout.Acceptance criteria
os-sdlc-runner implementation-close 3setscompleted_aton implementation 3 and exits 0.implementation 3 is already closed.implementation-reportfor the session prints a numericelapsed_s.Owner sketch
Cases
implementation-close IDruns, thencompleted_atis stamped, the lifecycle close is called with the root, and stdout is a JSON line withimplementation_idandcompleted_at.completed_atset, whenimplementation-close IDruns, then it exits non-zero withimplementation ID is already closedand changes nothing.implementation-close IDruns, then it exits non-zero withno implementation ID.LspProbe::Daemon.stop(root:)returns nil for a missing root directory. No test added.)Origin
Work started via os-sdlc pipeline on branch ticket-617 (session 4974deff). #614 and #613 merged first.
Deviation (impl 6): case 4 is already satisfied on main (Daemon.stop tolerates a missing root; FileUtils.rm_f is lenient). Three test-reviewer rounds (49, 51, 53) failed on the case-4 example only. Main loop marked case 4 as already satisfied and instructed the test-writer to drop the example.
Resolution
Done: implementation-close IMPLEMENTATION_ID subcommand: refuses a missing or closed implementation, else complete!(root:) and prints a JSON line; Implementation#closed?; shared DispatchCommands.implementation_for.
Evidence: Branch ticket-617, pipeline implementation 6 reached implementation_complete (14 dispatches, 1 retry, suite-check 58 green); three examples in cli_implementation_close_test.rb; case 4 was already true on main and dropped by decision (see ticket comment).
Follow-ups: none