Repository navigation
feat(service): the Mac's commands are sealed for following over Neon Realtime, claimed by id - #3274
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
luke-agent
Bot
changed the base branch from
main
to
luke/neon-realtime-scope-inbox
October 17, 2026 01:16
This was referenced Oct 17, 2026
luke-agent
Bot
force-pushed
the
luke/neon-realtime-scope-inbox
branch
from
October 18, 2026 19:21
0a6e6cd to
35d1920
Compare
luke-agent
Bot
force-pushed
the
luke/neon-realtime-mac-commands
branch
from
October 18, 2026 19:50
540286a to
ec49c51
Compare
luke-agent
Bot
force-pushed
the
luke/neon-realtime-scope-inbox
branch
from
October 18, 2026 21:12
35d1920 to
ff729c0
Compare
luke-agent
Bot
force-pushed
the
luke/neon-realtime-mac-commands
branch
from
October 18, 2026 21:41
ec49c51 to
b3d46c5
Compare
luke-agent
Bot
force-pushed
the
luke/neon-realtime-scope-inbox
branch
from
October 19, 2026 18:52
ff729c0 to
7c1c859
Compare
luke-agent
Bot
force-pushed
the
luke/neon-realtime-mac-commands
branch
from
October 19, 2026 18:52
b3d46c5 to
1fc8bac
Compare
luke-agent
Bot
force-pushed
the
luke/neon-realtime-scope-inbox
branch
from
October 20, 2026 00:57
7c1c859 to
40e92d8
Compare
luke-agent
Bot
force-pushed
the
luke/neon-realtime-mac-commands
branch
from
October 20, 2026 01:24
1fc8bac to
3612722
Compare
luke-agent
Bot
force-pushed
the
luke/neon-realtime-scope-inbox
branch
from
October 20, 2026 01:29
a7cb527 to
39ca561
Compare
luke-agent
Bot
force-pushed
the
luke/neon-realtime-mac-commands
branch
from
October 20, 2026 01:30
3612722 to
f5099ab
Compare
luke-agent
Bot
force-pushed
the
luke/neon-realtime-scope-inbox
branch
from
October 20, 2026 01:43
39ca561 to
40e1669
Compare
luke-agent
Bot
force-pushed
the
luke/neon-realtime-mac-commands
branch
from
October 20, 2026 01:53
f5099ab to
c078c53
Compare
luke-agent
Bot
force-pushed
the
luke/neon-realtime-scope-inbox
branch
2 times, most recently
from
October 20, 2026 15:50
ff97170 to
9710e65
Compare
luke-agent
Bot
force-pushed
the
luke/neon-realtime-mac-commands
branch
from
October 20, 2026 21:55
7516be4 to
846b137
Compare
luke-agent
Bot
changed the base branch from
luke/neon-realtime-scope-inbox
to
luke/live-tx-wait
October 20, 2026 21:55
luke-agent
Bot
force-pushed
the
luke/live-tx-wait
branch
from
October 20, 2026 22:20
7614a60 to
53c8ce1
Compare
luke-agent
Bot
changed the base branch from
luke/live-tx-wait
to
luke/live-same-user
October 20, 2026 23:30
luke-agent
Bot
force-pushed
the
luke/neon-realtime-mac-commands
branch
from
October 20, 2026 23:30
846b137 to
372d3e2
Compare
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
luke-agent
Bot
force-pushed
the
luke/neon-realtime-mac-commands
branch
from
October 21, 2026 00:07
372d3e2 to
740b9b3
Compare
…nd listened for on their own A Mac following its account's commands through the live layer needs three things the held read did in one: - the unclaimed commands of its kinds as one live statement (`live.macCommands`, GET /api/live/mac-commands?kinds=), under the same-user check and polled or sealed like every live read; - a claim of one command by its id inside the claim window on the service's clock (`macCommands.claim`, POST /api/mac-commands/claim); - its presence for its kinds said on its own (`macCommands.listening`, POST /api/mac-commands/listening), since a live read writes nothing. The held read stays for released desktops. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
luke-agent
Bot
force-pushed
the
luke/neon-realtime-mac-commands
branch
from
October 21, 2026 00:21
740b9b3 to
abf8d9a
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 4 · Mac commands, on #4228 (
luke/live-same-user). The service side of following the Mac's commands through the live layer: Neon Realtime whereLUKE_REALTIME=on, and the held poll (#4272) everywhere else. It replaces the always-on held read ofGET /api/mac-commands.The held read does three jobs: it marks the Mac as listening, waits for commands, and claims them. A live read writes nothing, so each job gets its own procedure, on #4273's kinds:
live.macCommands(GET /api/live/mac-commands?kinds=): the commands of the named kinds that no Mac of the account has claimed, as one statement (macCommandsLiveStatement:user_id = $1 AND kind IN (…) AND claimed_at IS NULL, no clock window). It goes throughsealedPartsand is checked bysameUserlike every live read. The reader sorts the rows (macCommandsOfLiveRows, earliest queued first, a shell row's text or a browser row'sparams).macCommands.claim(POST /api/mac-commands/claim {id}): claims one command by id. TheCLAIM_WINDOWis enforced here, on the service's clock. It answers with the command ornot-found. Bearer only.macCommands.listening(POST /api/mac-commands/listening {kinds}):markMacListeningfor the named kinds. Bearer only.The held
GET /api/mac-commandsand the result routes are unchanged for released desktops.Tests:
mac-command-store.test.ts: the live statement delivers only the account's own commands of the named kinds, and a claim by id takes a command once, for its own account, inside the window.mac-commands-procedures.test.ts: claim and listening, byte for byte. A cookie is refused.live-procedures.test.ts: the read is sealed for the bearer and the named kinds, and a read naming another account gets 401.live-statements.test.ts:mac.commandscalls only immutable functions, and Neon's drizzleAdapter seals it.mac-command-client.test.ts:livenames the kinds and the user (a 401 means signed out), andclaim.Checked piece by piece:
tscfor features, service and database; vitest over features, service live, mac-commands and the store; knip; oxlint.