Server-Sent Events stream of `kg.session.committed` /
`kg.board.cleared` events for the given board.
The stream reads the `global_update_outbox` table for the latest events
and emits new rows at a 1-second poll cadence. This endpoint is the
backing data source for the React `useKgLiveEvents` hook (Frontend
responsibility — hook implementation lives in the sibling UI repo).
Protocol:
event: kg.session.committed
data: {"event_id": ..., "session_id": ..., "payload": {...}}
Filter by `since` to resume a dropped connection without replaying the
entire outbox backlog. Absence ⇒ start from now().
Bug fix (QueuePool exhaustion): este handler NÃO injeta mais
``db: AsyncSession = Depends(get_db)`` porque a session da request
ficaria viva durante toda a vida do SSE stream (loop ``while True``
forever) — cada cliente prendia 1 conexão do pool, e um pool de 15
saturava com poucas tabs/clientes (somando consolidation_worker,
outbox_worker, dispatcher e endpoints normais). Em vez disso abrimos
uma sessão **por iteração** via ``async_session_factory``, devolvendo
a conexão ao pool entre os ``sleep(1.0)``.
GET
/
api
/
v1
/
kg
/
boards
/
{board_id}
/
events
Stream Kg Events
curl --request GET \ --url https://api.example.com/api/v1/kg/boards/{board_id}/events