# ADR-0006: EventBus contract is defined Day 1 (Phase 2); SSE implementation lands Phase 19

**Status:** Accepted (Phase 2; preserves Spec A's EventBus design)

## Context

The console must surface engine events: failures, warnings, fallback firings,
successes, and informational ticks. The transport choice (polling vs. SSE
vs. WebSocket) is a separable concern from the contract. If the contract
isn't defined upfront, every consumer (events drawer, summary bar, status
pill, mobile activity tab) invents its own ad-hoc shape and the eventual SSE
wire-up reshuffles everything.

## Decision

Define `EngineEvent` and `EventFilter` as zod schemas in
`@recoil/contracts/events.ts` during Phase 2. Pre-Phase-19, fixtures emit
events from `@recoil/fixtures.getEvents(filter)`. Phase 19 adds the FastAPI
SSE endpoint that emits the same shape — no consumer change required. The
schema carries `schemaVersion: 1` from Day 1, so producers and consumers
disagree loudly when a future schema bump lands.

## Consequences

Every event consumer (drawer, bar, pill, mobile tab) compiles against one
schema from Phase 4 onward. Phase 19 is a transport swap, not a contract
migration. The cost: fixtures must stay shape-faithful as the engine event
emitter evolves; that drift is caught by zod parse failures in fixture
tests.
