SubagentStop endpoint + hook: completion intake, post-agent steps, advancement #429
Labels
No labels
P0
P1
P2
P3
bug
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
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#429
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?
#429 SubagentStop endpoint + hook: completion intake, post-agent steps,
advancement (open)
@jared created 2026-08-18 14:31
Parent
#425
Map: #425
What to build
A SubagentStop hook (same ^os-sdlc:.*$ matcher) posting the full payload
plus the produced handoff to a new runner Thor command that stamps dispatch
completed_at, records the handoff row, runs the post-agent steps (test gate,
then on green lint over diffed files), records step results, and advances
routing state through the existing Engine/TransitionTable per ADR-0097.
After this ticket a real background-dispatched pipeline agent advances the
pipeline at actual completion — the core behaviour of #425. Run bin/refresh-
plugins after plugin-source edits.
Acceptance criteria
[ ] CLI-seam tests cover completion stamping, handoff recording, green-path
advancement, failed-gate routing to the human decision point, step-result
rows, and loud stall on a completion for an unknown dispatch
[ ] hook remains a thin shell
Blocked by
#428
Origin
• Trigger: /to-tickets skill on #425 spec
• Improvised this session: none
• Chain: #425 (DESIGN — spec of #425) ← decomposed via /to-tickets user
approval 2026-08-18
• Root candidate: none (this is a decomposition task)
Resolution
Done: New stdin-JSON Thor command subagent-stop: stamps pending round dispatch completed_at (unknown dispatch or inactive implementation = loud stall, exit 3), records the produced handoff row + created_handoff_id, runs post-agent steps via existing GateEvaluator (test gate, lint over git-diffed .rb files only on green), records step_results rows (new table: dispatch_id/step/exit_status), green path completes the implementation, red gate escalates via the existing escalations mechanism (new implementation_id column). Webhook-thin SubagentStop hook (matcher ^os-sdlc:.*$) relays runner stdout as additionalContext. Disclosed deviation from AC wording: advancement does NOT call the ticket-coupled Engine/TransitionTable — round dispatches carry no ticket_id, so fabricating a Ticket row to reuse TicketFlow would contradict the #427/#428 round/ticket separation; sequencing instead lives in the tested-Ruby CompletionIntake class, honoring ADR-0097's substance (sequencing in tested Ruby, never prose). Real map-routing semantics arrive with #430/#431.
Evidence: commit
8050c83; full runner suite 306 runs/659 assertions 0 failures; rubocop clean on all 11 touched files; hook tested by piping synthetic SubagentStop JSONFollow-ups: one, verdict: real-harness risk, must be checked before map close — the hook reads event field handoff_content, which is an assumption, not a verified harness field; if the live SubagentStop event carries no such field the recorded handoff content will be nil. Assigned to #433 assembly acceptance (the /os-sdlc:implement dogfood run exercises the live event shape) and recorded in the map workbench; no separate ticket since #433 already owns live-shape verification