push architecture slice 7: graph-status + practice surfaces ride the events channel; coverage polls accepted-by-design; stale poll comments + architecture.md observability section rewritten to the push model

This commit is contained in:
amosblomqvist
2026-10-02 18:03:47 +03:00
parent 8795345c82
commit 26131b3599
13 changed files with 190 additions and 104 deletions
+7 -5
View File
@@ -6,11 +6,13 @@ import type { JobRecord } from "@/src/core";
/**
* Background-job observability channel (contracts.ts "THE ASYNC PROTOCOL" §4).
*
* ONE central poller (in Chat) fetches GET /api/jobs?chatId=… and publishes
* the list here; every job surface consumes it — the transcript dispatch
* cards (the ack box with live status) and the sub-agents sidebar panel.
* Cards used to each run their own poller on input-available parts; under
* the ack-protocol the tool part resolves immediately, so the poller moved
* ONE central fetch (in Chat) reads GET /api/jobs?chatId=… and publishes
* the list here — on mount, per jobs-changed announcement (the store emits
* post-write), and on channel resync (push-architecture S4, 2026-10-02);
* every job surface consumes it — the transcript dispatch cards (the ack
* box with live status) and the sub-agents sidebar panel. Cards used to
* each run their own poller on input-available parts; under the
* ack-protocol the tool part resolves immediately, so the fetch moved
* to the composition root and the cards became pure renderers of this data.
*/
export const JobsContext = createContext<JobRecord[]>([]);