Repository navigation
feat(server): a guest's connection reaches only what its grants cover - #561
Merged
Jacksondr5 merged 7 commits intoOct 13, 2026
Merged
Conversation
One gate in front of upstream's auth service narrows a guest's permissions to the routes J5 allows, and one wrapper on the per-connection RPC check allows a guest only listed requests for threads a grant covers. Both refuse by default. A member's connection is untouched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hat is shared A guest's client cannot connect without the server configuration, the lifecycle welcome and the sidebar feed, and each was refused. A guest's connection now gets all three in a reduced form: the configuration and welcome name nothing of the host, and the sidebar, over HTTP and over the feed, holds only the threads the guest's grants cover and their projects. A grant given or removed while the guest is connected restarts their feed from a fresh snapshot, so it shows without a reconnect. A member's connection is answered by upstream's code untouched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The gate's comments named case 65, which the shard weights took first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The guest check ran once, before the handler, so a thread feed or a streaming search opened while a grant held kept delivering after the grant was removed. A guest's thread request now runs against the guest's grants changing: on the first change that leaves the thread out of reach it ends with the refusal a new request would get. Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 of 8 tasks
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 12, 2026
Jacksondr5
marked this pull request as ready for review
October 13, 2026 01:11
|
Warning Review limit reached
This review includes 10 billable files and costs up to $2.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 59 minutes for your next included review. View limit details
Comment |
This was referenced Oct 13, 2026
Jacksondr5
added a commit
that referenced
this pull request
Oct 13, 2026
Rebased onto guest sharing (#536, #561, #577). The guest gate refuses every J5 read by default; the client now skips them for a connection it knows is a guest's, as it did for the HTTP reads, and hides the playbook boards. Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 of 8 tasks
Jacksondr5
added a commit
that referenced
this pull request
Oct 13, 2026
* feat(j5): J5's client reads run over WebSocket methods J5's client reads called J5's own HTTP routes, each with its own authentication, error shape and "is this route missing" probe. Upstream's rule is that a small read is a socket query and a large, compressible payload goes over HTTP. Fourteen reads move to RPC methods: the Inbox list and open count, Crew proposals, runtime requests and memberships, the Fleet, spawned children, the archive preflight, participant identities, the peer list, the three playbook reads and the artifact list. Their routes are removed. Reading one artifact's content stays on HTTP, because it can be megabytes. Part of #506 (step 3). Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(web): the Artifacts page waits for the socket before listing The list is read over the socket now, which comes up after the prepared connection the page waited for, so a direct visit to /artifacts failed as "not connected" until Try again. Found in live testing. Review fixes: FORK.md no longer names deleted route files, and says which views skip an unsupported server. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(server): drop an unused import Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(j5): a known guest is sent none of J5's socket reads Rebased onto guest sharing (#536, #561, #577). The guest gate refuses every J5 read by default; the client now skips them for a connection it knows is a guest's, as it did for the HTTP reads, and hides the playbook boards. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(mobile): the playbook board calls its hooks unconditionally Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Problem
A guest can be recorded and granted a thread (#536), and nothing limits what a guest's connection can read. Upstream's permissions are per connection and server-wide, so a guest holding "view" would see every thread, project and file listing on the server. This is the second of four stacked pieces (#532), and it has to land before anything can make a guest link (#535).
Stacked on #536. Three things described below are changed by #577, the layer above, which merges with this one: the HTTP sidebar snapshot is refused to a guest and its filter removed (a guest's client uses the socket feed), so this stack does not edit
orchestration-v2/http.ts; a guest is given a reduced provider list; and a guest may load the attachments of a granted thread's messages.What changed
A guest is a session whose subject is
j5:guest. Everything here starts with that one comparison and leaves any other session exactly as upstream handles it.j5/sharing/GuestGate.ts). Every route and WebSocket upgrade signs in through upstream'sEnvironmentAuth; J5 wraps it whereserver.tscomposes it. A guest's session keeps its permissions only on/ws, the sidebar snapshot, and the three thread loads for a thread a grant covers. On every other route it comes back with none, so that route's own check refuses it with upstream's ordinary missing-permission response. No route was edited to add a check.j5/sharing/GuestView.ts):Upstream files:
ws.ts(+14 −5),server.ts(+8 −4),orchestration-v2/http.ts(+4 −1). Recorded as FORK.md case 69 and divergence D33.Things a reviewer should check
/.well-known/t3/environmentdescriptor (real server label and platform);lineageandforkedFromon a granted thread's row, which can name the id of a thread the guest was not granted; the session cookie name, which contains the server port.Verified
vp test run apps/server/src/j5/sharing: 32 pass. The feed tests run upstream's realsubscribeOrchestrationV2Shelland real HTTP route on real persistence. They cover: a guest's configuration holds no host path, address, account or non-default setting; the sidebar over both transports holds only granted threads, including after changes to an ungranted thread, a new thread and an ungranted project; every item a guest receives is one the member received, in the same order with the same number; a grant given and removed while connected changes the feed and another guest's change does not; a guest with no person recorded gets an empty sidebar; a member gets the same objects back.GuestGate.test.ts: another thread's id, a thread that does not exist, an unlisted request that names the granted thread, a request name that does not exist yet./api/projects,server.getSettings, the archived sidebar andprojects.readFilewere refused; the three feeds returned reduced answers with no host strings; a member's same calls returned the full answers.An independent security review (Fable 5.1) tried to break the promise and found one real gap, fixed here: a thread stream a guest already had open kept delivering after its grant was removed. A guest's thread-keyed request now ends, refused as a new one would be, as soon as a grant change leaves the thread out of reach, and stays open through changes that do not. It confirmed that every authenticating route signs in through the two gated functions, that the allowed requests cannot be made to name another thread, and that a member's connection is unchanged.
Not verified: that ending a request in the middleware interrupts a real streaming handler over a socket (the tests use a stand-in handler, and the claim rests on reading how the RPC server wraps a stream into one effect); a browser pass on this exact code; a grant change on a running server, since nothing outside a test can change a grant yet.
Not in this PR
What the client shows a guest: the composer is not read-only yet, and a guest's client keeps polling a few things that are refused (inbox count, Crew proposals). That is the next piece. No guest can exist outside a test until #535.
Checklist
FORK.md(case text and file-table row) in this PRdocs/j5/product/upstream.md: D33; decisions on Share links 1: people, grants, and recognising a guest connection #531 and Share links 2: a guest views one thread, enforced by the server #532 and indocs/j5/worklog/2026-10-09-multi-player-session.mdAGENTS.md): server only; HTTP and WebSocket both gated; a grant removed takes access away while connecteddocs/j5/product/and user docs rewritten where this changes them: the definition merged in docs(j5): define members, guests, grants and shared conversations #529; nothing user-visible yetRefs #532.
Opus 5.5, Claude Code in J5 Code. The first commits and the review are mine; a Peer Agent on Opus 5.5 built the reduced answers and the feed filter; a Peer Agent on GPT-6 Astra did the browser research.
🤖 Generated with Claude Code