SubagentStop endpoint + hook: completion intake, post-agent steps, advancement #429

Closed
opened 2026-08-18 18:31:43 +00:00 by jared · 1 comment
Owner

#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)

# #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)
Author
Owner

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 JSON

Follow-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

## 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 JSON **Follow-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
jared closed this issue 2026-08-18 21:31:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#429
No description provided.