os-sdlc-implementation-report refuses after implementation_complete #836
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#836
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's Finish step says: "On any terminal payload, run
os-sdlc-implementation-report SESSION_ID". Afterimplementation_complete, the report CLI refuses. The report looks up only unfinished rows (Implementation.active_for,command/dispatch_commands.rb:127-136). The terminal step has already stampedcompleted_at(command/implementation/landing.rb:27), so the lookup finds nothing. The CLI also parses--helpas a session id.Observed
Implementation 78 (#827) returned
implementation_completefrom dispatch 782 on 2026-09-29. The next report call failed:Reproduce
Approach
Decided 2026-09-30. The report looks up one implementation by id, in any state. The orchestrator calls it after
/os:worktree finish, not inside the worktree before-remove hook.New Finish order in
plugins/os-sdlc/skills/implement/SKILL.md:This depends on four facts, each verified 2026-09-30:
implementation_idin the open payload (presenter/implementation/open_payload.rb:16).transcript_path(model/agent.rb:8-13).git worktree removedoes not delete~/.claude/projects/<worktree-slug>/; 11 such directories for removed worktrees exist on disk..sdlc/pipeline.dbis a symlink to the main database (plugins/os/lib/worktree/start_command.rb:105-112), so the row survives removal.record_usage!skips rows that already have usage (model/dispatch/usage.rb:6), so a later report does not change stamped data.The sweep in the worktree before-remove hook (ADR-0193, ADR-0240) exists only to stamp usage before removal. The facts above make it unnecessary.
Required work:
os-sdlc-implementation-reporttakes an integer implementation id, parsed with strictInteger(arg), and looks it up withImplementation[id].--sweep-onlyfromcontroller/boot/inputs.rbandcommand/dispatch_commands.rb— check:grep -rn "sweep-only\|sweep_missing_usage" plugins/os-sdlc/lib plugins/os-sdlc/binprints nothing.worktree-before-remove=…--sweep-only {implementation}line from.cc-os/config— check:grep -n sweep-only .cc-os/configprints nothing.plugins/os-sdlc/skills/implement/SKILL.mdFinish, runos-sdlc-implementation-report IMPLEMENTATION_IDafter/os:worktree finish, with the id from the open payload — check:grep -n "implementation-report" plugins/os-sdlc/skills/implement/SKILL.md.plugins/os-sdlc/skills/responsibility-refactor/SKILL.md:81, pass the implementation id — check:grep -n "implementation-report" plugins/os-sdlc/skills/responsibility-refactor/SKILL.md.--sweep-only), and ADR-0240 (sweep in the before-remove hook) — check:/os-adr:find implementation-report.Rejected: fall back to
Implementation.current_for(session_id)— the report stays keyed by session, and the orchestrator already holds the implementation id.Rejected: the skill stops calling the report and renders the terminal payload — the payload is built before the last dispatch's usage is in its transcript (ADR-0175), so the last dispatch's model and tokens stay NULL.
Acceptance criteria
os-sdlc-implementation-report <id>runs, then it exits 0 and prints the summary JSON withdispatches,totals, andlens.--helpor any other non-integer argument, when the report runs, then it fails with a usage error and does not look up an implementation.Owner sketch
Non-goals
worktree-before-removefeature inos:worktreestays.Retired tests
plugins/os-sdlc/tests/model/implementation_report_cli_test.rb#test_sweep_missing_usage_stamps_usage
plugins/os-sdlc/tests/model/implementation_report_cli_test.rb#test_sweep_missing_usage_leaves_another_implementation_untouched
plugins/os-sdlc/tests/model/implementation_report_cli_test.rb#test_sweep_missing_usage_prints_nothing_via_the_cli
plugins/os-sdlc/tests/model/implementation_report_cli_test.rb#test_sweep_missing_usage_exits_loudly_for_an_unknown_implementation_id
plugins/os-sdlc/tests/model/implementation_report_cli_test.rb#test_implementation_report_exits_loudly_for_a_session_with_no_active_implementation
plugins/os-sdlc/tests/controller/process_io_seam_test.rb#test_a_loud_refusal_reaches_the_invocation_stderr_and_returns_3
Origin
command/dispatch_commands.rb:127-136) ← the terminal step closes the implementation before the skill calls the report (command/implementation/landing.rb:27) ← DESIGN (ADR-0175 report keyed by session id)VERDICT: CREATE — real defect; the documented Finish step calls a CLI that refuses after implementation_complete; chain ends in DESIGN; no duplicate (ticket-skeptic, 2026-09-29).
Second reproduction 2026-09-30: session cbf5e0d7-f339-4520-ad90-e032956bdca4, implementation 3 (#826). After implementation_complete,
os-sdlc-implementation-report <session>printedno active implementation for session. The Orchestrator used the dispatches and totals from the terminal payload instead.Work started via /os-sdlc:implement on branch
ticket-836(worktree .claude/worktrees/ticket-836).Blocked by #841. Implementation 4 failed.
suite-check, gate[required-work, suite].verdict:error. The gate crashed withSequel::NotNullConstraintViolation: NOT NULL constraint failed: correction_rounds.gate_type. The trigger wasos-sdlc-required-work-check 4, which exits 3 withharness error: Errno::ENOENT - /os-adr:find. Required-work item 6 uses a slash command as its check, and the check runner cannot execute it.docs/adrhas nothing newer than 0250..claude/worktrees/ticket-836(branchticket-836), 8 files. I did not merge it.To continue: fix #841, or rewrite item 6's check as a runnable command. Then start a new
implementation-open.Resolution
Done: os-sdlc-implementation-report takes a strict integer implementation id and reports an implementation in any state; --sweep-only, sweep_missing_usage, Accounting#sweep deleted; implement skill runs the report after /os:worktree finish on completion; responsibility-refactor skill passes the id; ADR-0251 amends ADR-0175/0193/0240. Implementation 4 reached suite-check with all earlier gates green, then failed on a gate crash (#841); hand-finished: ADR written, SKILL.md Finish wording limited to completion, suite and lint rerun.
Evidence: main
063075f1(fast-forward from ticket-836). ruby plugins/os-sdlc/tests/all.rb: 1337 runs, 2954 assertions, 0 failures, 0 errors, 9 skips, 18.0s. rubocop on the 6 changed Ruby files: no offenses. Live: os-sdlc-implementation-report 4 printed the 9-dispatch summary for the failed implementation after worktree removal; os-sdlc-implementation-report --help exits 3 with the usage line. .cc-os/config has no sweep-only line.Follow-ups: #841 gate crash on a failed required-work/retired-tests step (P1); #842 delete worktree-before-remove and --implementation from os:worktree (user decision B); #843 Required-work ownership rule and slash-command check refusal.