feat(service,features,host): a plan's inbox and an agent's are read through the central live layer
Merged
CH
1h ago+3084+3084+0123456789012345678901234567890123456789-158-158-012345678901234567890123456789
A plan's inbox and an agent's are read through the central live layer: the sealed live procedures on the service, and liveRows on the host. This replaces the service's own held inbox read for the window.
Stacked on #4228 (luke/live-same-user). It will be retargeted to main once #4228 merges.
What changes
Service (live-procedures.ts, inbox-store.ts)
- New
live.taskInboxandlive.agentInboxprocedures. Each:- checks the read names the caller's own account (
sameUser); - reads the plan or agent as that account, so one it doesn't reach is not found;
- answers three statements: the open items with the latest settled ones, their threads' latest messages, and their files.
- checks the read names the caller's own account (
- With
LUKE_REALTIMEoff, asmainruns, the rows are answered inline (sealedParts), held until they move pastafter. - Every statement calls only immutable functions (
live-statements.test.ts).
Features
scopeInboxLiveAnswerSchemaandscopeInboxLiveRowsSchema.inboxOfLiveRows, which joins the three parts back into the held read's items.taskInboxLiveandagentInboxLiveon the client. Each names the account, and reads a session of another account as signed out.
Host (scope-inbox-follow.ts)
- One
liveRowsread per plan or agent (anRcMap), kept while windows read it and for 30 s after. Each read names the account that was signed in when it started. codingAgents.inboxandcodingAgents.agentInboxwith a cursor answer as soon as the items move past it, or unchanged when the 20 s hold ends. So the renderer doesn't change in this PR.- A sign-out lets every read go.
The account inbox stays on its held read.
Tests
live-procedures.test.ts: each read is sealed for the bearer, answered polled when asked, not found for a stranger, and signed out when it names another account.live-statements.test.ts: the immutability check covers the new statements.inbox-store.test.ts: the live rows equal the held read's items, read markers included.compose-coding-agents.test.ts: the host answers reads from the followed rows.