Files
kandev/docs/plans/subtask-completion-trigger/task-03-orchestrator-trigger-dispatch.md
T
2026-08-23 17:34:52 +00:00

1.9 KiB

id, title, status, wave, depends_on, plan, spec
id title status wave depends_on plan spec
03-orchestrator-trigger-dispatch Orchestrator trigger dispatch done 2
01-backend-child-completion-repository
02-workflow-event-contracts
plan.md ../../specs/tasks/requirements/subtask-completion-trigger.md

Task 03: Orchestrator trigger dispatch

Acceptance

  • A child task state transition from non-terminal to terminal evaluates the parent only when every active direct child is terminal.
  • The parent receives exactly one engine.TriggerOnChildrenCompleted for the same completed child set.
  • Transition actions from on_children_completed apply the normal workflow lifecycle: on_exit, persisted parent step change, data patch persistence, and on_enter.

Verification

go test ./internal/orchestrator/...

Files Likely Touched

  • apps/backend/internal/orchestrator/service.go
  • apps/backend/internal/orchestrator/event_handlers_children_completed.go
  • apps/backend/internal/orchestrator/event_handlers_children_completed_test.go
  • apps/backend/internal/orchestrator/event_handlers_workflow.go
  • apps/backend/internal/orchestrator/workflow_store.go

Dependencies

  • 01-backend-child-completion-repository
  • 02-workflow-event-contracts

Inputs

  • Spec: docs/specs/tasks/requirements/subtask-completion-trigger.md, sections State machine, Failure modes, Persistence guarantees, Scenarios.
  • Plan: Backend Workflow Trigger Dispatch.
  • Existing patterns: processOnTurnCompleteViaEngine, applyEngineTransition, office/engine_dispatcher.Dispatcher, and watcher task event subscription wiring.

Output Contract

When finished, update this task frontmatter to status: done, update the checkbox in plan.md, and report:

  • Summary of trigger dispatch and idempotency behavior.
  • Files changed.
  • Tests run and their result.
  • Any blockers or follow-up risks.