Parent: #476
Outcome
The Business Hub shows authoritative harness truth within a bounded delay, including terminal completion and background-worker writes. Cached rollups cannot remain active/stalled after the run is DONE.
Audit finding
The UI has polling/WebSocket mechanisms, but cache invalidation and terminal semantics are incomplete:
- The run signature covers selected top-level files/directories, but omits changing child contracts such as builder, validation, prompt, and stage artifact files.
- Once a run is cached as unchanged, terminal runs may not be reparsed unless a scoped request forces it.
- In-memory “events behind” repair is only attached in a narrow path, while the rollup index can preattach a pipeline rollup and bypass that fallback.
- The status path can stamp the manifest as
DONE without persisting a reliable completed_at.
- Run-status derivation can ignore or underweight manifest terminal state, so a completed run becomes
active and later stalled.
- Harness persistence/invalidation is coupled to successful tool-return paths. A background worker or direct control-plane write can complete a stage without emitting the same UI invalidation signal.
The dashboard is therefore not purely hallucinating from mission records, but it can display stale derived truth instead of current authoritative harness state.
Required design
Single authoritative change signal
Every committed harness transition must atomically increment a monotonically increasing state_generation and emit an outbox event. The dashboard signature should depend on that generation/event cursor rather than guessing which child files might have changed.
Terminal-state correctness
- Persist
completed_at atomically with status: DONE.
- Derive terminal status directly from authoritative manifest/state-machine truth.
- Never apply generic staleness classification to a terminal run.
- Surface corruption or partial state as an explicit degraded/error state, not cached success.
Reactive delivery
- Publish committed transition events to all Business Hub instances.
- Retain bounded polling as reconciliation, not as the primary source of truth.
- Invalidate per-run and aggregate caches on the same transaction/outbox event.
- Reconcile event cursor against state generation after reconnect/restart.
Acceptance criteria
Required integration tests
Likely implementation surface
- Business Hub rollup cache/signature
- server polling/WebSocket broadcaster
- harness state commit/outbox
- run status derivation and terminal timestamps
- pipeline-state/rollup adapters
Dependencies
Use the transactional transition/outbox foundation from #481.
Parent: #476
Outcome
The Business Hub shows authoritative harness truth within a bounded delay, including terminal completion and background-worker writes. Cached rollups cannot remain active/stalled after the run is DONE.
Audit finding
The UI has polling/WebSocket mechanisms, but cache invalidation and terminal semantics are incomplete:
DONEwithout persisting a reliablecompleted_at.activeand laterstalled.The dashboard is therefore not purely hallucinating from mission records, but it can display stale derived truth instead of current authoritative harness state.
Required design
Single authoritative change signal
Every committed harness transition must atomically increment a monotonically increasing
state_generationand emit an outbox event. The dashboard signature should depend on that generation/event cursor rather than guessing which child files might have changed.Terminal-state correctness
completed_atatomically withstatus: DONE.Reactive delivery
Acceptance criteria
DONEandcompleted_atare persisted in the same commit.Required integration tests
Likely implementation surface
Dependencies
Use the transactional transition/outbox foundation from #481.