2.8 KiB
2.8 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-order-runtime-state-publication | Order runtime state publication | completed | 1 | plan.md | ../../specs/tasks/requirements/runtime-state-publication-order.md |
Task 01: Order runtime state publication
Acceptance
- A successful
WAITING_FOR_INPUT -> RUNNINGsession transition reconciles an eligible task toIN_PROGRESSbefore publishingsession.state_changed(RUNNING). - Existing archive, Office, clarification/cancellation, terminal-state, and session-state CAS guards remain intact; reconciliation failure does not hide the running session.
- Already-
RUNNINGstream churn performs no redundant task-state writes or state events, and the executor-success reconciliation remains available. - The WebSocket gateway forwards task and session lifecycle notifications from one ordered wildcard subscription, preserving their order for remote event buses.
Verification
cd apps/backend && go test \
-run 'TestSetSessionRunning_(PublishesTaskStateBeforeRunningSession|NoRedundantTaskWrites|WritesOnTransition)' \
./internal/orchestrator
cd apps/backend && go test -race \
-run 'Test(SetSessionRunning_PublishesTaskStateBeforeRunningSession|ReconcileTaskStateForRuntime_)' \
./internal/orchestrator
cd apps/backend && go test \
-run 'TestUpdateTaskStateIfSessionState_' \
./internal/task/repository/sqlite
cd apps/backend && go test \
-run 'TestTaskEventBroadcaster_(UsesOrderedWildcardForLifecycleStates|OrdersLifecycleStateNotifications|NoDuplicateSubscriptions|PreservesAllFields)' \
./internal/gateway/websocket
cd apps/backend && go test \
-run TestMemoryEventBus_MultiTokenWildcard \
./internal/events/bus
Files likely touched
apps/backend/internal/orchestrator/event_handlers_streaming.goapps/backend/internal/orchestrator/event_handlers_streaming_test.goapps/backend/internal/gateway/websocket/task_notifications.goapps/backend/internal/gateway/websocket/task_notifications_test.goapps/backend/internal/events/bus/memory.goapps/backend/internal/events/bus/memory_test.go
Dependencies
None.
Parallelism
Sequential. The production ordering and its regression test share the same orchestrator lifecycle seam.
Inputs
- Spec
What,Failure modes, andScenarios. - ADR
docs/decisions/2026-07-30-runtime-task-state-before-running-event.md. - Existing
updateTaskSessionStateWithHookpre-publication seam. - Existing
reconcileTaskStateForRuntimeLockedguarded task-state writer. - Existing no-redundant-write and runtime-state race tests.
Output contract
Report the RED failure reason, GREEN results, files changed, exact commands and results, remaining risks, and the task/plan status updates. Do not change frontend grouping or synthesize task state from session events.