os-sdlc: ADR-0121 async guard fires for non-pipeline Agent dispatches — false sync-only errors in any session with a pipeline.db #409

Closed
opened 2026-08-16 00:29:20 +00:00 by jared · 2 comments
Owner

Context

The ADR-0121 guard in plugins/os-sdlc/hooks/post_tool_use.rb (commit 1d8a520, 2026-08-15) checks tool_response.status == "async_launched" before the agent name is resolved to a pipeline stage. dispatchable_event returns any non-nil subagent_type ("general-purpose", "os-backlog:ticket-skeptic", ...), so in any repo whose .sdlc/pipeline.db has a ticket row, every background Agent dispatch — including bookkeeping subagents unrelated to the pipeline — emits the loud "Pipeline agents must be dispatched synchronously" error into the session. Before the guard, such events reached engine.handle_event, which no-ops on non-stage names. Observed live: 10+ spurious errors during non-pipeline dispatches in session https://claude.ai/code/session_01GSYJVRGmBiLGjPppHjY3bZ (2026-08-15). The guard's own tests (plugins/os-sdlc/tests/runner/post_tool_use_async_dispatch_test.rb) only exercise pipeline-stage agent names.

VERDICT: CREATE — validation/false-positive defect in a newly shipped guard; hard floor.

Tasks

  • Emit the async_launched guard error only when the event's subagent_type resolves to a known pipeline stage (reuse the same name mapping engine.handle_event/the transition table uses); non-stage async dispatches must stay silent no-ops.
  • Test coverage: async_launched event with a non-stage subagent_type (e.g. "general-purpose") produces no output and no pipeline advance; existing stage-name guard tests unchanged.

Acceptance criteria

  • A background dispatch of a non-pipeline agent in a repo with an active pipeline.db emits nothing.
  • A background dispatch of a pipeline-stage agent still emits the loud sync-only error and does not advance the pipeline.
  • Suite green, changed files rubocop-clean.

Out of scope

Full async-completion support (already scoped out by #402); hook arming/manifest work (#333/#400).

## Context The ADR-0121 guard in plugins/os-sdlc/hooks/post_tool_use.rb (commit 1d8a520, 2026-08-15) checks tool_response.status == "async_launched" before the agent name is resolved to a pipeline stage. dispatchable_event returns any non-nil subagent_type ("general-purpose", "os-backlog:ticket-skeptic", ...), so in any repo whose .sdlc/pipeline.db has a ticket row, every background Agent dispatch — including bookkeeping subagents unrelated to the pipeline — emits the loud "Pipeline agents must be dispatched synchronously" error into the session. Before the guard, such events reached engine.handle_event, which no-ops on non-stage names. Observed live: 10+ spurious errors during non-pipeline dispatches in session https://claude.ai/code/session_01GSYJVRGmBiLGjPppHjY3bZ (2026-08-15). The guard's own tests (plugins/os-sdlc/tests/runner/post_tool_use_async_dispatch_test.rb) only exercise pipeline-stage agent names. VERDICT: CREATE — validation/false-positive defect in a newly shipped guard; hard floor. ## Tasks - [ ] Emit the async_launched guard error only when the event's subagent_type resolves to a known pipeline stage (reuse the same name mapping engine.handle_event/the transition table uses); non-stage async dispatches must stay silent no-ops. - [ ] Test coverage: async_launched event with a non-stage subagent_type (e.g. "general-purpose") produces no output and no pipeline advance; existing stage-name guard tests unchanged. ## Acceptance criteria - [ ] A background dispatch of a non-pipeline agent in a repo with an active pipeline.db emits nothing. - [ ] A background dispatch of a pipeline-stage agent still emits the loud sync-only error and does not advance the pipeline. - [ ] Suite green, changed files rubocop-clean. ## Out of scope Full async-completion support (already scoped out by #402); hook arming/manifest work (#333/#400).
Author
Owner

Work starting: pre-flight passed (verdict CREATE, checklist present). Running via /os-sdlc:implement in parallel with #365.

Work starting: pre-flight passed (verdict CREATE, checklist present). Running via /os-sdlc:implement in parallel with #365.
Author
Owner

Resolution

Done: ADR-0121 async guard now errors only for known pipeline-stage agents; non-stage and no-in-flight-ticket background dispatches are silent no-ops (TransitionTable#known_agent? + Engine#pipeline_agent?), fail-open choice disclosed and pinned by test

Evidence: commit d66aea7 on branch worktree-issue-409; suite 931 runs 0 failures; changed files rubocop-clean; reviewer APPROVE at .sdlc/tickets/409/verdict.md

Follow-ups: #410: gate subprocess ignores ticket target_name (skeptic VERDICT: CREATE)

## Resolution **Done:** ADR-0121 async guard now errors only for known pipeline-stage agents; non-stage and no-in-flight-ticket background dispatches are silent no-ops (TransitionTable#known_agent? + Engine#pipeline_agent?), fail-open choice disclosed and pinned by test **Evidence:** commit d66aea7 on branch worktree-issue-409; suite 931 runs 0 failures; changed files rubocop-clean; reviewer APPROVE at .sdlc/tickets/409/verdict.md **Follow-ups:** #410: gate subprocess ignores ticket target_name (skeptic VERDICT: CREATE)
jared closed this issue 2026-08-16 01:03:21 +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#409
No description provided.