Repository navigation
feat(server): a member brings a guest in with a share link - #582
Merged
Jacksondr5 merged 2 commits intoOct 13, 2026
Merged
Jacksondr5 merged 2 commits into
Jacksondr5 merged 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
This review includes 38 billable files and costs up to $9.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 21 minutes for your next included review. View limit details
Comment |
Jacksondr5
added a commit
that referenced
this pull request
Oct 13, 2026
Jacksondr5
force-pushed
the
j5code/share-3b-people-and-links
branch
from
October 13, 2026 05:31
19a8684 to
0c67b22
Compare
This was referenced Oct 13, 2026
One commit for the rebase onto j5/main, in place of these: - feat(server): a member brings a guest in with a share link - fix(server): a guest's device ended from upstream's list loses its open connection - fix(server): a member who opens a guest's link stays a member - fix(server): a guest is told the server's real name and platform - feat(server): a guest sees the icon a person chose for a project - feat(web): the pairing page says why a member's browser was refused a guest's link - fix(server): a guest's old session is cut loose when its browser pairs again - feat(server): what the share links UI asks of people, grants and named links - fix(server): a guest's browser that tries a link that does not work keeps its session - feat(server): a name belongs to one person on a server, and the owner has one - feat(server): the people list says which row is the asking connection's own - feat(server): the owner's name reaches clients and agents, and sharing waits for it - refactor(server): the names migration no longer provides for people who already share a name Refs #532 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Jacksondr5
force-pushed
the
j5code/share-3b-people-and-links
branch
from
October 13, 2026 05:40
0c67b22 to
d67577c
Compare
A name is written inside the bracketed line that tells an agent who a message is from. A name holding a bracket could make that line read as two. The one name rule now refuses both brackets, for a guest, a rename, a self-given name and the owner's name. Parentheses stay allowed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 of 8 tasks
Jacksondr5
marked this pull request as ready for review
October 13, 2026 20:39
Jacksondr5
added a commit
that referenced
this pull request
Nov 23, 2026
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
Nothing can create a guest.
PersonAccesscan record one, give it grants and tie a session to it, and only tests call it, so no member can bring anyone in (Shared server AC17, AC19, AC20, AC25). This is the server half of #535; the Share dialog and People page are a separate piece.What changed
People, grants and devices. A new service,
People(apps/server/src/j5/sharing/People.ts), and J5 requests over it inpackages/contracts/src/j5/sharing.ts:j5.sharing.listPeopleaccess:readcreateGuest,putGrant,removeGrant,removePerson,revokeDevice,createLink,revokeLinkaccess:writerevokeLinkcancels a guest's unused link and refuses a member's pairing linklistOwnGrants,leaveGrantorchestration:readThe manage requests are absent from
GUEST_RPC_RULES, so a guest is refused them whatever its session holds, and there is no MCP tool for any of them.leaveGranthas its own rule kind,ownGrant: the target must be exactly a grant the session's own guest holds. A grant keeps the optional line a member writes when sharing (Shared conversations AC6); nothing sends it to an agent yet.The link. A share link is one of upstream's single-use pairing links with the subject
j5:guest, a seven-day life and exactlyorchestration:read,orchestration:operateandpreview:operate. Which guest it is for is recorded inj5_a2a_guest_link(J5 migration 35), found again by a hash of the credential.Tying the session to the person. Upstream's
EnvironmentAuth.tscalls J5 as one pipe step where it issues a session from a pairing grant. For a guest's link, upstream'ssessions.issueand the insert intoj5_a2a_person_sessionrun in one transaction, so they commit together or not at all. It issues nothing when the link names no guest, carries any permission outside the three, or sharing is not wired in.Every path that turns a pairing grant into something:
createBrowserSession)/oauth/tokenbearer and DPoP exchange (exchangeBootstrapCredentialForAccessToken)consumeMcpApprovalCode)Every change publishes.
removePersonandrevokeDevicego throughPersonAccess, which publishes to the feeds already open for that guest, as grant changes do.Ending a device, however it is ended. Upstream leaves a revoked session's open socket open, and its Connections page ends a session through upstream's own methods. J5's decorator around
EnvironmentAuth(layerGatedEnvironmentAuth, a J5 file) now cuts a guest's session loose from its guest before any of upstream's four revoke methods runs, so the guest's open feeds end and its requests find nothing. For a member's session that costs one delete by primary key that matches nothing; "revoke other clients" is one delete for all of them.A guest's browser that pairs again. Upstream replaces the browser's old session inside its session store, around the four revoke methods. The decorator cuts a guest's old session loose from its guest once upstream has paired the browser, whatever link was opened, so a socket still open on it ends and reads nothing. It is done after pairing succeeds and not before, because upstream replaces the old session only then: a guest's browser that tries a junk or used link keeps its session, its grants and its device row. A session that ends by expiring passes through none of this, as for a member upstream.
A guest is told the server's real name and platform (Jackson, 2026-10-12). The reduced configuration and lifecycle welcome carried the fixed label "Shared server" and a placeholder platform, so a guest of two servers saw two with one name. Upstream's public descriptor at
/.well-known/t3/environmentalready gives both to anyone who can reach the server. Everything else in the reduction is unchanged.A guest sees the icon a person chose for a project (Jackson, 2026-10-12). The reduced project now carries
projectIcon(a named glyph, an emoji or a monogram), which is plain data. A favicon file is still withheld; see the decisions below.What the settled UI design asks of this layer (design of 2026-10-12,
artifacts/share-links-ui-design.md).createLinktakes alifetime:1h,24h,7d(the default) or30d, and nothing else.renamePersonrenames a guest. Every person's name, whoever typed it, is one line of visible characters up to 80: no control characters, line breaks, format, private-use, unassigned or surrogate characters, no square brackets (a name goes inside the bracketed line that tells an agent who wrote a message; parentheses are allowed), and no more than two combining marks in a row.listThreadPeoplesays who can reach one thread: the guests whose grants cover it, each with their level and every grant that covers it (thread,ancestororproject), and the members. Any member's connection may ask. A guest may ask it of a thread its own grants cover (athreadrule at View) and is told names and levels only: no ids, devices, links, notes or other grants. The server has recorded no name for any member, so a member row carriesdisplayName: null.subscribeThreadPeopleChangesis a count that moves when that answer changes for that connection, under the same rule. For the People page, the plan is asharingcounter on feat(j5): J5's read models follow a change stream, not timers #586'sj5.reads.subscribeChangesat the rebase, since that stream is server-wide and a guest is refused it.listOwnGrantsno longer tells a guest the line a member wrote about them for the agent.createGuest,renamePersonandsetOwnerNamerefuse a name another person already has, withPersonNameTakenError("That name is already in use on this server. Choose another."). Names are compared folded: NFKC, lower-cased, trimmed, whitespace runs made one. Look-alike letters across scripts are not caught. The name is stored and shown as typed. A unique index on the folded name (J5 migration 37) holds it under concurrent writes. Names already recorded are folded by the migration; no release had a way to make a second person, so it does not provide for two people who already share one, and would fail on such a database. Rebased ontoj5/mainas one commit; the fifteen it replaces are listed in its message. The layers are not to be run separately against a database anyone keeps: migration 37 is here and 36 is in feat(server): one view-only link several people can join a thread with #585, so a database run on this layer alone and then moved to feat(server): one view-only link several people can join a thread with #585 would skip 36. The stack merges as one. A person may re-case their own name, and a name given up or removed is free again.j5.reads.subscribeChangescarries a sixth counter,sharing, that moves when a person, a name (the owner's too), a grant, a device or a share link changes. The sharing services notify it after each write, as the Crew stores do. A guest is refused that stream and follows the thread it has open.setOwnerName { displayName }(access:write) names the person the server belongs to, on the local operator's existing row, under the same rules.listPeopleandlistThreadPeoplereturn it for the member; a guest of a thread reads it as one of the people on that thread. Until it is set there is none. Every connection that is not a guest's is that one owner today; several named members is set aside (Sharing v2: what was set aside #542).getConnectionAccessanswers{ kind: "member", ownerName }(nulluntil set) for a member and{ kind: "guest" }, with no name, for a guest. This is one read of the operator's row per member connection, on a request that connection already makes.createGuestandcreateLinkare refused withOwnerNameRequiredError("Set your name first, so the people you share with know who you are.") while the owner has none.putGrantfor a guest who already exists is not held back.j5_list_participantshaddisplay_name: null; it now carries the owner's name once set. No other field of the row and nothing in the tool's description changed, and nothing was added to J5's standing instructions or any envelope (Consider: tell every agent who owns the server, in J5's standing instructions #595). Aname_containsfilter can now match the owner. For Jackson to read before merge.listPeoplemarks the asking connection's own row withyou: true. Only a member's connection is told of people, and every such connection is the one member there is, so it is the member's row.UI changes
No client code changed for the icon; the page text is one sentence in upstream's web pairing error.
Not captured: a monogram or named-glyph icon (same field, same path as the emoji), and mobile, whose pairing never meets this refusal.
Decisions to check
revokeLinkcancels it before it is used.PersonAccess.bindSessionstays, used only by tests. Four test files stand in for upstream's sign-in and bind a session directly; moving them onto real pairing would mean building upstream's real auth in each.pairingRefusal: "guest_link_for_member", beside upstream's own optionaldpopFailureReason;reasonstaysinvalid_credential, so a client from before this ignores the key and shows "Invalid pairing token". I chose an optional key over a newreasonliteral because an older client fails to decode an unknown literal and would show "Primary environment request failed … (HTTP 401)". Mobile is untouched: it pairs through/oauth/token, which carries no earlier session and is never refused this way. A browser with no session costs nothing more; one with a session costs one read of J5's record of guest links.Live testing
Run by the builder on an isolated
j5-live-testserver at1502675f48(default flags); the review panel's independent tester re-ran these checks and they held. There is no UI, so requests were sent over a real socket by a script holding a member's session; the link was opened in an incognito browser profile.subscribeThreadended with "This is not shared with you on this server". Revoking the browser's device emptied its sidebar, and its cookie stopped signing in (/api/auth/sessionunauthenticated, ticket request 401); the other device carried on. The guest's own socket was refusedlistPeople,createGuest,createLinkandremovePerson, left its own project grant, and was refused leaving a grant it did not hold. A member callingleaveGrantgotNotAGuestError. Removing the person ended the remaining device (401) and the unused link (401).342180fd4cplus the layer above): a member ran a turn in a new thread through the UI. A guest held that thread's feed open on a real socket. The guest's device was revoked through upstream's own route,POST /api/auth/clients/revoke: the feed ended with the same refusal. The member's next turn reached the member's feed and not the guest's, and the guest could not get a new socket.ecf26c205bplus the layer above): signed in as a member, I opened a guest's link in the same browser profile. The page showed "Invalid pairing token. Check the token and try again.",/api/auth/sessionstill reported Manage access, and the same link then paired a second profile as the guest with its one thread.efb88efcd8against the previous tip5c85445061,--base): the two pairs above. On the new code the member stayed a member and the same link then paired a second profile as the guest, whose sidebar and thread header showed the project's emoji.b651c96b83): one browser paired as guest A and read the thread, then paired as guest B. The people list moved the device from A to B, no binding was left for A's session, and A's old cookie got 401.6cd32815e9under the layers above): a one-hour link expired in 60 minutes; a guest was renamed; a member asking who is on a thread was told ids, names, levels and how each reaches it; the guest asking was told the same without ids, and was refused another thread; its own grants came back as target and level only; its change count stayed at 0 for a grant on another thread and moved to 1 for one on its own.2e9bef4670under the layers above): the owner was named; a second guest writtenMARCO, a guest named like the owner and a rename onto the owner's name were each refused; a guest re-cased its own name; a guest of a thread was told the owner's name and no id.704423b494, the whole stack): with the owner unnamed a member's connection was toldownerName: null, andcreateGuestandcreateOpenLinkwere refused withOwnerNameRequiredError; aftersetOwnerNamethe connection was told the name and both went through; a guest's connection was told{ kind: "guest" }only.j5/main(commit3ed8990140, the top of the stack; the pushed tip differs only in one test file's formatting), in headless browsers. A guest's browser, watched for about a minute: it sentj5.crews.listMembershipsandj5.fleet.listSpawnedChildrenonce each, in the same instant asgetConnectionAccess, and each was refused once with no retry; it never openedj5.reads.subscribeChangesand sent no inbox, Fleet or proposal read; nothing on screen showed an error. The server's trace agrees (one span each).j5.agentPersonas.getCatalogwas also sent once and refused. A member's browser opened the stream and read the inbox count, Fleet and proposals; thesharingcounter moved when another connection created a guest; after one Claude Haiku turn in which the agent asked the person a question,inboxmoved, the client re-read the count and the sidebar showed 1. No J5 request of the member's failed.vcs.listRefs(8 in a minute) andserver.reportClientActivity(7), each refused.Upstream impact
apps/server/src/auth/EnvironmentAuth.ts: 11 lines added, 2 changed (one import, one line inmake, one pipe step on each of twosessions.issuecalls, one condition inconsumeMcpApprovalCode).FORK.mdcase 70. Approved by Jackson on Share links 1: people, grants, and recognising a guest connection #531, 2026-10-11.apps/server/src/server.ts: 3 lines (one import, oneLayer.provideMergeinside case 69'slayerAuth). Case 70.packages/contracts/src/environmentHttp.ts: 2 lines (the optionalpairingRefusalkey and its comment). Case 70. Approved by Jackson, 2026-10-12.apps/server/src/auth/http.ts: 5 lines (one import, a third optional argument and its spread infailEnvironmentAuthInvalid, two lines at thebrowserSessionhandler). Case 70.apps/web/src/environments/primary/auth.ts: 6 lines added, 1 changed (an optional field on the rejected-credential error, its message, and one line where the error is made). Case 70.rpc.ts,client.tsandws.tsare unchanged: the new requests join the group case 69 already merges.Checklist
FORK.md(case text and file-table row) in this PRdocs/j5/product/upstream.mdAGENTS.md) — server and contracts only. No client calls these yet; agents deliberately cannot. Reverse states exist for each: remove a grant, revoke a device, remove a person, leavedocs/j5/product/and user docs rewritten where this changes them — no user docs until there is a screen to describeTests:
apps/server/src/j5/sharing/People.test.tsruns upstream's realEnvironmentAuthover a real database. The existing tests inapps/server/src/auth/pass unchanged.Claude Opus 5.5, Claude Code
🤖 Generated with Claude Code