Repository navigation
feat(service,features,host): a plan's inbox and an agent's are read through the central live layer - #3232
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
e15c855 to
d8ed1ae
Compare
874c503 to
0a6e6cd
Compare
|
Heads-up from the Inbox thread work: #3469 (open, merges on green) adds |
|
Another note from the Inbox work: #3618, which merges on green, adds a per-member read marker in a new |
d8ed1ae to
d1e6acb
Compare
0a6e6cd to
35d1920
Compare
d1e6acb to
a8cbc21
Compare
35d1920 to
ff729c0
Compare
…leAdapter()
Neon's guide seals a Drizzle select through its Drizzle adapter rather than
raw SQL over toSQL(). LiveStatement now carries the select it was rendered
from (LiveStatement.query), and the sealer passes it to
createRealtime({ adapter: drizzleAdapter() }).seal({ query }), which also
refuses a select whose key is not the name Postgres answers it under. A
statement written as text alone, as the tests' stand-ins are, or one
binding an instant, which the adapter does not encode, is still sealed
with rawSql.
@neon/realtime-drizzle 0.1.0 declares drizzle-orm >=0.45.2 <0.46.0 as its
peer; it reads only what 1.0.0-rc.4 builds the same way, so the peer is
allowed in pnpm-workspace.yaml and the version pinned.
live-statements.test.ts now also seals every statement /api/live/inbox
seals through the adapter. The rows a subscription delivers are the same:
this changes no user-visible behaviour.
Split out of #3232 so the Realtime plumbing can land without a feature.
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…othing yet live-follow.ts follows a read the service sealed as Neon's guide says to: every part's sealed statement subscribed to on one socket, every seal renewed ten seconds before the earliest expires (a failed reseal asked again a second later), and each change answered as every part's rows whole, undecoded, once each part has its first result (liveRows). It fails with LiveBroken where Realtime's client does not load, a subscription stops for good, or a renewal is refused. openRealtimeClient loads Realtime's own client only when a read is first followed, so @luke/host depends on @neon/realtime again (#4074 dropped it with the account inbox's follow). No feature follows a read through it yet, so this changes no user-visible behaviour. Split out of #3232, whose scope inbox is its first user. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
ea54779 to
ab80e71
Compare
9710e65 to
6c444fa
Compare
|
Both notes are handled in this version:
The account follow (#3217) isn't part of this stack, and the account inbox stays on its held read. |
6c444fa to
0add6f0
Compare
0add6f0 to
1259bad
Compare
1259bad to
8ab1e2d
Compare
8ab1e2d to
f68e223
Compare
f68e223 to
782179c
Compare
…hrough the central live layer Service: live.taskInbox and live.agentInbox on the oRPC live contract. Each first checks the read names the caller's own account (sameUser), then reads the plan or the agent as that account, as the held read does, so one it does not reach is not found, and answers its open items and latest settled ones as one statement, and their threads' latest messages and the files they carried as two more, sealed or, as main runs it, polled and held until they move (sealedParts). Every statement calls only immutable functions (live-statements.test.ts). Features: scopeInboxLiveAnswerSchema and scopeInboxLiveRowsSchema, the reader that joins the parts back into the held read's items (inboxOfLiveRows), and taskInboxLive / agentInboxLive on the client, naming the account and read as signed out under another's session. Host: scope-inbox-follow.ts keeps one liveRows read per plan or agent (an RcMap) while windows read it and 30 s after, named for the account signed in when it started. A window's codingAgents.inbox / agentInbox read with a cursor is answered as soon as the items move past it, or unchanged when the 20 s hold ends, so the renderer is unchanged. A sign-out lets every read go. The account inbox stays on its held read. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
782179c to
81e378e
Compare
A plan's inbox and an agent's are read through the central live layer: the sealed live procedures on the service, and
liveRowson 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 tomainonce #4228 merges.What changes
Service (
live-procedures.ts,inbox-store.ts)live.taskInboxandlive.agentInboxprocedures. Each:sameUser);LUKE_REALTIMEoff, asmainruns, the rows are answered inline (sealedParts), held until they move pastafter.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)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.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.