diff --git a/FORK.md b/FORK.md index 43f73b45d39cc..ff44b8db01437 100644 --- a/FORK.md +++ b/FORK.md @@ -432,7 +432,7 @@ migrations after upstream migrations. 69. A connection whose person's scope is narrower than the server is narrowed to it ([#532](https://github.com/Jacksondr5/j5code/issues/532), [#636](https://github.com/Jacksondr5/j5code/issues/636), register D33, Jackson's 2026-10-09, 2026-10-11 and 2026-10-17 decisions). Upstream's permissions are per connection and cover the whole server. J5 reads, for each session, whose device it is (J5-owned `apps/server/src/j5/sharing/PersonAccess.ts`, `sessionReach`): a person's, by the binding case 70 records as the session is issued; the first owner's, by the subjects of the startup link, the desktop app, T3 Connect (`cloud-connect`, which upstream mints only for the cloud account the server is linked to) and the development credential; a service's (`peer:*`, `machine:*`, `mcp-client`, `cli-issued-session`); or a device no one has claimed. A service session and a person who holds Collaborator or Owner at server scope are wide and get upstream's own answers, the same objects. Everyone else is narrowed: a person at a project or a thread at either level, a Viewer at server scope, and an unclaimed device. A narrowed session is refused everything but an allow-list, every listed request is checked against the level the person holds at the scope it names, and the answers that name the host are reduced. All of it is J5-owned code under `apps/server/src/j5/sharing/`, reached from two upstream server files. In `apps/server/src/server.ts`, `layerAuth` is upstream's `EnvironmentAuth.layer` wrapped in `gateEnvironmentAuth` (`AccessGate.ts`): a narrowed session keeps its permissions only on the routes `accessHttpRule` allows (`/ws`, a reachable thread's loads, and J5's artifact read for a reachable project), so every other route's own permission check refuses it. In `apps/server/src/ws.ts`, the per-connection `RpcAuthorization.layer` is wrapped in `layerRpcAuthorization`, which refuses a narrowed session every request not in `ACCESS_RPC_RULES` and checks each listed one: at a thread or project the payload names, at the level given (`thread`, `project`); for a person who holds Collaborator anywhere, whatever folder it names (`collaborator`: files, terminals' folders, git, previews' profiles, the host's devices; a terminal or an agent reaches every folder anyway, Jackson 2026-10-17), and the server's Playbook library, read only (AC20); for anyone (`anyone`: what a client reports of itself); for a person with a level at server scope (`server`: the Fleet page, Personas, the providers' skills, every Playbook run, read only); or answered narrowly by its handler (`narrowed`). Upstream's own permission check runs after J5's on every request, so what a level's permissions lack (settings, providers, access, relay management, environment maintenance) is refused by upstream. A request still running is ended when the person's reach changes so that it no longer meets its rule (`PersonAccess.subscribeChanges`). Whether a session is wide is read once, when the socket opens; a change that would alter it renews the session (case 70). `layerWsRpc` reads `connectionView(currentSession)` (`GuestView.ts`) once, and six handlers pass their answer through it: `server.getConfig` (`Effect.map(j5View.config)`), `subscribeServerConfig` (`.pipe(j5View.configStream)`), `subscribeServerLifecycle` (`.pipe(j5View.lifecycleStream)`), `orchestration.subscribeShell` (`j5View.shellStream` around upstream's `subscribeOrchestrationV2Shell`), and `scheduledTasks.list` and `scheduledTasks.subscribe` (`j5View.scheduledTasks`, `j5View.scheduledTasksStream`), which list a narrowed person only the tasks bound to a thread they reach or, for a task bound to no thread, its project's, and give a Viewer no webhook address. The configuration is reduced for a Viewer and an unclaimed device (AC24) and given whole to a narrowed Collaborator, who can open a terminal on the host; the lifecycle welcome is reduced and the sidebar filtered for every narrowed session, and a Viewer's projects and threads carry placeholder folders where a Collaborator's carry the real ones. `apps/server/src/orchestration-v2/http.ts` is upstream's file: the HTTP sidebar snapshot (`GET /api/orchestration/shell`) is refused to a narrowed session, and upstream's client then reads the sidebar from the socket's feed (`packages/client-runtime/src/state/shell.ts` falls back when the HTTP load fails), so the feed is the one filtered path. A Viewer may ask `assets.createUrl` for an attachment or a tool's image only when `PersonAccess.messageAssetLevel` finds it in a thread they reach: in a message's attachments, or in a turn item's output, where a page a tool published is named; a Collaborator may ask for any asset. A favicon reaches a narrowed person through J5 and never by a host path (Jackson's 2026-10-12 decision; `GuestProjectIcons.ts`, no upstream edit): a reduced project carries `guestIconPath(projectId)` as its `faviconPath`, `ACCESS_RPC_RULES` reads the project id from a `project-favicon` request's `path`, checks `PersonAccess.projectInFeed`, and answers in place of upstream's handler with a link to `GET /api/j5/sharing/project-icon//`, signed with J5's own key, which serves the file through upstream's exported `issueAssetUrl`, `resolveAsset` and `assetFileResponse`. Both allow-lists refuse by default, so a route or request upstream adds is closed to a narrowed session until J5 lists it; `ACCESS_RPC_RULES` is keyed by the RPC group's method names, so a method upstream renames or removes fails to compile. The reduced configuration is built field by field (`reduceServerConfig`, `reduceProvider`), so a field upstream adds is left out for a Viewer until J5 lists it. The client half adds three J5 RPC groups and one call in each chat view: `J5AccessRpcGroup`, `J5PeopleRpcGroup` and `J5SharedConversationRpcGroup` (J5-owned `packages/contracts/src/j5/access.ts`, `people.ts` and `sharedConversation.ts`) are merged in `packages/contracts/src/rpc.ts`, and their streams (`j5.access.subscribeThreadLevel`, `j5.people.subscribeScopeChanges`, `j5.sharedConversation.subscribeThreadAuthorsChanges`) join `EnvironmentSubscriptionRpcTag` in `packages/client-runtime/src/rpc/client.ts` (one line each, the shape of cases 45 and 64); `packages/client-runtime/package.json` exports `./j5/sharing`. In `apps/server/src/ws.ts`, case 58's `layerJ5WsRpc(...)` call passes the connection's `session`, so the handlers answer for the session the socket was opened with. Upstream's web chat view (`apps/web/src/components/ChatView.tsx`) and mobile thread screen (`apps/mobile/src/features/threads/ThreadRouteScreen.tsx`) each call J5-owned `useCanOperateThread(environmentId, threadId)` from their app's `j5/sharing/access.ts` (web) or `j5/sharing/guestAccess.ts` (mobile) where they computed `canOperateThread` (one import and one call), and upstream's thread action menu (`apps/web/src/hooks/useThreadActionMenu.ts`) calls `readCanOperateThread(threadRef)` from `apps/web/src/j5/sharing/threadOperability.ts`. On a pin advance: keep the wrapping calls where the answers are produced; if upstream adds another place that sends a `ServerConfig`, a lifecycle event, a shell item or a list of scheduled tasks, a narrowed session cannot reach it until it is listed, and it must pass through `GuestView` when it is; if upstream changes how the shell feed resumes or what its items are, reread `GuestView.ts`; if upstream's client stops falling back to the feed when the HTTP sidebar snapshot is refused, a narrowed person's sidebar stays empty; if upstream adds an asset kind or changes where attachments are named (`orchestration_v2_projection_messages` `$.attachments[].id`, or a turn item's payload), reread `messageAssetLevel`; if upstream reshapes its permissions, reread case 70's level mapping; if upstream changes how its client keys a favicon request or the three asset functions, reread `GuestProjectIcons.ts`, whose test runs upstream's real resolution. 70. Every device belongs to a person, holds its level's permissions, and renews when the level changes ([#535](https://github.com/Jacksondr5/j5code/issues/535), [#636](https://github.com/Jacksondr5/j5code/issues/636), register D33, Jackson's 2026-10-11 approval on [#531](https://github.com/Jacksondr5/j5code/issues/531) of one small edit inside upstream's pairing code, and his 2026-10-17 rulings). A level's permissions are listed in one place, J5-owned `packages/contracts/src/j5/levels.ts` (`LEVEL_PERMISSIONS`), and a device holds its person's highest level's set cut to the ceiling it was paired with (`devicePermissions`). Whose device a session is, and that ceiling, are recorded in J5's own table `j5_a2a_person_session` (J5 migrations 34 and 39) as upstream issues the session, without changing upstream's tables. The person a pairing credential is for is recorded in `j5_a2a_pairing_intent` (migration 39), found again by a hash of the credential because upstream's pairing code holds the credential when it issues a session. `apps/server/src/auth/EnvironmentAuth.ts` carries the edit, at seven sites: one import; two lines in `make` (`const j5TiedToPerson = yield* makePairingSessionIssuer` and `const j5ApprovesMcpClient = yield* makeMcpApprovalCheck`, each read with `Effect.serviceOption`, so upstream's own tests build the layer without them); one pipe step, `j5TiedToPerson(grant, credential)`, on each of the two `sessions.issue` calls that issue a session from a pairing grant (`createBrowserSession` and `exchangeBootstrapCredentialForAccessToken`); and one check in `consumeMcpApprovalCode`, so only a code an Owner's level backs approves an MCP client (`PairingIntents.approvesMcpClient`: not a J5 link's credential, subject `j5:link`, and not one whose intent names someone who is not an Owner); and the message a browser session from another origin is refused with is a named export, `FOREIGN_ORIGIN_DIAGNOSTIC`, so J5's renewal refuses what upstream refuses. Lowering or removing an Owner voids every MCP approval checked before it, however soon after the check it lands, and leaves MCP client sessions already issued alone: J5-owned `McpApproval.layerGatedMcpOAuth` decorates upstream's `McpOAuth` (`apps/server/src/auth/McpOAuth.ts` is not edited), reads which change of Owners it is (`Access.ownersGeneration`, under the same lock as a change of level) before upstream's `approve` checks the approval, ties that to the code in the redirect `approve` returns, and gives it to the exchange of that code; `layerGatedEnvironmentAuth` wraps `issueMcpClientSession` in `Access.issueMcpClient`, which refuses under that lock if the Owners changed since, or if no approval was given to it. In `server.ts`, `McpOAuth.layer` is wrapped in `gateMcpOAuth` where `McpOAuthHttp.layer` is given it (one import and one line). For a credential with no intent the pipe step costs one read by primary key and returns upstream's own effect, and binds the session to the first owner when the credential is the startup link's, the desktop app's or T3 Connect's (`FIRST_OWNER_SUBJECTS`; if upstream mints another credential for the server's own account, add its subject there, or its device is one no one has claimed). For one with an intent it runs upstream's `sessions.issue` and the binding in one transaction (`PairingIntents.issueSession`), so the session and the record of whose it is commit together, and it issues nothing when the credential carries more than its person may hold now, when its person was removed, or when it carries the retired guest subject `j5:guest`. In `apps/server/src/server.ts`, `layerAuth` (case 69) gains one line, `Layer.provideMerge(J5PeopleLive)`, above `layerPersistence`: it gives `PersonAccess` and `PairingIntents` to upstream's `EnvironmentAuth.layer` and to J5's own services. `apps/server/src/auth/http.ts`'s `pairingCredential` handler, which Connections' "Create link" calls, records after `issuePairingCredential` that the link pairs a device for the person whose device made it, under the permissions chosen there (`recordConnectionsLinkCreator`; one import and one call); a link whose maker cannot be recorded is revoked before the request fails. A change of level ends each of the person's sessions for renewal (`Access.ts`): the binding is marked and upstream's `SessionStore.revoke` ends the session, which closes its open sockets at once, in the transaction that changes the level. The device then renews on J5's route `POST /api/j5/session/renew` (`SessionRenewal.ts`, no upstream edit) with its old token: upstream's `SessionStore.verify` checks a token's signature before whether it was revoked and names a revoked token's session, so the route issues a session that holds the new permissions, with the old session's method, subject, client and expiry, only for a session J5 marked, once. `apps/web/src/environments/primary/auth.ts` calls `renewPrimarySession` before its sign-in gate sends a browser to pair (one import and one line), and J5-owned `SessionRenewalWatcher` reloads the page once when the primary connection drops and renewal succeeds. `apps/web/src/connection/runtime.ts` adds J5-owned `@t3tools/client-runtime/j5/session-renewal` to the connection runtime (one import and one line), which renews a saved server's bearer token when its connection is refused for authentication; `packages/client-runtime/package.json` exports it. DPoP sessions, mobile and a device offline past its session's life are paired again by hand; an MCP client holds no person's level, so a change of level does not touch it. The refusal of a browser paired as one person opening a link made for another reaches the pairing page with its reason through three upstream files, each a line or a literal: `packages/contracts/src/environmentHttp.ts` (`EnvironmentAuthInvalidError`'s optional `pairingRefusal: "paired_as_someone_else"`), `apps/server/src/auth/http.ts` (`failEnvironmentAuthInvalid`'s third argument, passed by the `browserSession` handler), and `apps/web/src/environments/primary/auth.ts` (the rejected-credential error's flag). `layerGatedEnvironmentAuth` (case 69's J5-owned decorator) wraps `createBrowserSession` to refuse that before upstream is called, so the link is not used up, and wraps `revokeSession`, `revokeClientSession`, `revokeOtherSessionsExcept` and `revokeOtherClientSessions` so that ending a device cuts it loose from its person first, and with that from any renewal. On a pin advance: if upstream adds another place that turns a pairing grant into a session, it must go through `j5TiedToPerson`, or the device is one no one has claimed; if upstream reshapes its permissions, update `LEVEL_PERMISSIONS` and the definition (`levelPermissions.test.ts` pins each level's set by upstream's names); if upstream adds a method that ends a session, wrap it in the decorator; if upstream changes `SessionStore.verify`'s order of checks or stops naming a revoked token's session, renewal stops working and must be rethought; if upstream adds a pairing path that issues a session from something other than a pairing grant, record whose its sessions are or narrow them; if upstream changes how it refuses a browser session from another origin, keep `FOREIGN_ORIGIN_DIAGNOSTIC` the message it refuses with; if upstream stops returning the code in `approve`'s redirect, or issues an MCP client's session other than from `exchangeCode` through `EnvironmentAuth.issueMcpClientSession`, every MCP sign-in is refused (`McpApproval.test.ts` runs upstream's own sign-in through the gate) and the tie must be rethought; if upstream provides `McpOAuth.layer` somewhere else, wrap it there too. 71. An Owner shares from the app ([#535](https://github.com/Jacksondr5/j5code/issues/535), [#636](https://github.com/Jacksondr5/j5code/issues/636), register D33, Jackson's 2026-10-12 design and approval of an appended item in the thread menu, and the 2026-10-17 design review of the one Share dialog). The Share dialog (one for a thread, a project and the server), the link step and their state are J5-owned files under `apps/web/src/j5/sharing/`. Upstream's thread action menu (`apps/web/src/hooks/useThreadActionMenu.ts`, already carrying case 69's one call) gains one import and two calls: the list upstream's `buildThreadActionMenuItems` returns is passed through `withSharingMenuItems(items, threadRef)`, and after the menu closes `if (runSharingMenuAction(clicked.value, threadRef)) return;` opens the dialog J5 asked for and keeps J5's ids away from upstream's switch. `withSharingMenuItems` inserts "Share thread…" after "Copy" (disabled on a device without `access:write`, People and access AC34). For someone who is not an Owner of the thread's server it also leaves out Archive, Delete and "Project settings" (AC14, AC27), leaves out "Mark unread" for a Viewer of the thread (the read marker is everyone's, Shared conversations AC19), and puts "Leave thread" where Archive was when they hold a level on the thread itself (AC48). The ids (`j5:share-thread`, `j5:leave-thread`) are outside upstream's `ThreadActionMenuId` union, and `runSharingMenuAction` is the type guard that takes them back out, so upstream's `components/threadActionMenu.logic.ts` is untouched. `apps/web/src/hooks/useThreadActionMenu.test.ts` carries two J5 cases at its end (the item's place, and that picking it reaches none of upstream's actions). Upstream's sidebar builds and handles the same menu itself (`apps/web/src/components/Sidebar.tsx`, the thread row's right-click): one import, the builder wrapped where the list is built, `buildWithSharingMenuItems(buildThreadActionMenuItems, threadRef)({…})`, which leaves upstream's arguments where they are, and the same `if (runSharingMenuAction(clicked.value, threadRef)) return;` after the menu closes. The dialogs are opened from places that render nothing, so `apps/web/src/routes/__root.tsx` mounts J5's `` beside upstream's `` (one import, one line), the way upstream draws its own confirm and custom-snooze dialogs; the host also draws the name question a server asks before a device uses it (AC5, AC6), renews a session ended for a change of level (case 70), tells an Owner once that links made before the move to levels stopped working, and takes someone off a thread no longer theirs. `apps/web/src/components/CommandPalette.tsx` gains one import, one hook call (`useSharingPaletteItems({ activeThread, projectRef: contextualProjectRef })`, beside where `actionItems` is declared) and `actionItems.push(...sharingPaletteItems)` before the "Project settings" entry, for "Share thread", "Share project", "Share server", "Open People" and "Change your name"; the palette searches an entry's `searchTerms` only, so each entry's title is among its terms (Jackson's 2026-10-12 approval). The web menu draws an item's icon from the table in `apps/web/src/contextMenuFallback.ts`, which gains one entry, `users` (lucide's four shapes, six lines and a comment), so that J5's item lines up with its neighbours. `j5/sharing/sharingMenu.ts` and `sharingDialogs.ts` import nothing of React or the connection runtime, because that test mocks `react`. A link always opens on the server itself; the link step's route choice mirrors helpers that are private to upstream's `apps/web/src/components/settings/ConnectionsSettings.tsx` (`selectPairingEndpoint`'s default, `endpointDefaultPreferenceKey`, `endpointShareHint`), copied into J5-owned `j5/sharing/shareLink.logic.ts` with no upstream edit; what upstream already exports (`isQrShareableEndpoint`, `selectQrEndpointOption`, `pairingUrls.ts`, `QRCodeSvg`, the saved default route in `uiStateStore`) is imported. On a pin advance: compare those helpers with upstream's and carry over any change to how a route is picked or described; if upstream moves `api.contextMenu.show(items, position)` in the hook, re-apply the two calls around it, and the same in the sidebar's thread-row menu; if the palette's `actionItems` list or the root's dialog hosts move, re-apply the append and the mount where they went; if upstream renames the "copy", "archive", "delete", "project-settings" or "mark-unread" items, "Share thread…" falls to the end of the menu or an Owner's item shows to someone who is not one, and `sharingMenu.test.ts` still passes, so check both menus in a browser. -72. Settings › People, and Settings for someone who is not an Owner ([#535](https://github.com/Jacksondr5/j5code/issues/535), [#636](https://github.com/Jacksondr5/j5code/issues/636), register D33, Jackson's 2026-10-12 design and approval of the Settings navigation and route registration, and his 2026-10-17 ruling that Settings is an Owner's). The page (`apps/web/src/j5/sharing/PeoplePage.tsx`) and everything it draws are J5-owned; `apps/web/src/routes/settings.people.tsx` is a J5-owned route file in upstream's routes folder, the shape of `settings.skills.tsx` (case 42), and `routeTree.gen.ts` regenerates with it. Registering a settings section takes upstream's own tables, each one entry: in `apps/web/src/components/settings/settingsSearch.ts` the `SettingsPath` union, `SETTINGS_SECTION_LABELS` (after Connections, which sets the sidebar order), `SETTINGS_CATEGORY_SCOPES` (`"connections"`) and one search item, `people`; in `SettingsSidebarNav.tsx` the icon map (`UsersIcon`); in `SettingsScopeSentence.tsx` one line adding the path to `SETTINGS_DEVICE_ONLY_PATHS`, since the page has its own server picker. Settings is an Owner's (AC27 to AC29), by four calls into J5-owned `j5/sharing/settingsAccess.tsx`, each one import and one or two lines. `SettingsSidebarNav.tsx` builds its list through `useSettingsNavItems(…)` around upstream's own filter: for someone who owns no connected server it keeps only the pages in `PAGES_FOR_EVERYONE` (Appearance, SnapShots, People) and adds Open-source licenses, which upstream reaches only from General, as a page of its own. `useAvailableSettingsSearchItems.ts` returns `useShownSettingsSearchItems(items)`, so search finds the same pages, in the sidebar and the command palette alike. `apps/web/src/routes/settings.tsx` wraps upstream's `SettingsScopeBoundary` and the `` in ``, which shows that person a "Coming soon" notice in place of any other page, one upstream adds later among them, so a link to one (a thread's "Manage scheduled tasks") still lands; the gate is outside the boundary because a server the person does not own leaves the boundary's scope unavailable. `SettingsScopeContext.tsx` and `SettingsScopeSentence.tsx` read their servers through `useOwnedEnvironments(useEnvironments().environments)`, and `useSettingsProjectGroups.ts` its projects through `useOwnedEnvironments(useProjects())`, so Settings lists and changes only the servers and projects the person owns, in the scope picker and the project panel alike; upstream applies a change to every listed server and greys a row unless all of them allow it. `ProjectSettingsPanel.test.tsx` mocks `j5/sharing/settingsAccess` (one comment and four lines), because the test replaces the connection runtime with `undefined` and J5's access atoms are made from it when their module loads. J5's Fleet page and inbox, which name a project from any server, group every server's projects themselves (`j5/logicalProjects.ts`). A server that has not answered yet counts as owned, so an Owner's Settings does not flicker. J5's own Settings pages (Personas, Playbooks, Skills) list only owned servers the same way. The project page carries no Sharing section (AC34). On a pin advance: if upstream reshapes how a settings section is declared, re-register People after Connections; if upstream resolves Settings' servers anywhere besides those two files, filter it there too, or a server the person does not own greys out their Settings; if upstream renames the Appearance or SnapShots path, update `PAGES_FOR_EVERYONE` (its test pins the list); if upstream adds a settings page of its own for people or access, read D33 before keeping J5's. +72. Settings › People, and Settings for someone who is not an Owner ([#535](https://github.com/Jacksondr5/j5code/issues/535), [#636](https://github.com/Jacksondr5/j5code/issues/636), register D33, Jackson's 2026-10-12 design and approval of the Settings navigation and route registration, and his 2026-10-17 ruling that Settings is an Owner's). The page (`apps/web/src/j5/sharing/PeoplePage.tsx`) and everything it draws are J5-owned; `apps/web/src/routes/settings.people.tsx` is a J5-owned route file in upstream's routes folder, the shape of `settings.skills.tsx` (case 42), and `routeTree.gen.ts` regenerates with it. Registering a settings section takes upstream's own tables, each one entry: in `apps/web/src/components/settings/settingsSearch.ts` the `SettingsPath` union, `SETTINGS_SECTION_LABELS` (after Connections, which sets the sidebar order), `SETTINGS_CATEGORY_SCOPES` (`"connections"`) and one search item, `people`; in `SettingsSidebarNav.tsx` the icon map (`UsersIcon`); in `SettingsScopeSentence.tsx` one line adding the path to `SETTINGS_DEVICE_ONLY_PATHS`, since the page has its own server picker, and one more adding Open-source licenses, which is the same for every server and which a non-Owner sees, so it shows no server picker. Settings is an Owner's (AC27 to AC29), by four calls into J5-owned `j5/sharing/settingsAccess.tsx`, each one import and one or two lines. `SettingsSidebarNav.tsx` builds its list through `useSettingsNavItems(…)` around upstream's own filter: for someone who owns no connected server it keeps only the pages in `PAGES_FOR_EVERYONE` (Appearance, SnapShots, People) and adds Open-source licenses, which upstream reaches only from General, as a page of its own. `useAvailableSettingsSearchItems.ts` returns `useShownSettingsSearchItems(items)`, so search finds the same pages, in the sidebar and the command palette alike. `apps/web/src/routes/settings.tsx` wraps upstream's `SettingsScopeBoundary` and the `` in ``, which shows that person a "Coming soon" notice in place of any other page, one upstream adds later among them, so a link to one (a thread's "Manage scheduled tasks") still lands; the gate is outside the boundary because a server the person does not own leaves the boundary's scope unavailable. `SettingsScopeContext.tsx` and `SettingsScopeSentence.tsx` read their servers through `useOwnedEnvironments(useEnvironments().environments)`, and `useSettingsProjectGroups.ts` its projects through `useOwnedEnvironments(useProjects())`, so Settings lists and changes only the servers and projects the person owns, in the scope picker and the project panel alike; upstream applies a change to every listed server and greys a row unless all of them allow it. `ProjectSettingsPanel.test.tsx` mocks `j5/sharing/settingsAccess` (one comment and four lines), because the test replaces the connection runtime with `undefined` and J5's access atoms are made from it when their module loads. J5's Fleet page and inbox, which name a project from any server, group every server's projects themselves (`j5/logicalProjects.ts`). A server that has not answered yet counts as owned, so an Owner's Settings does not flicker. J5's own Settings pages (Personas, Playbooks, Skills) list only owned servers the same way. The project page carries no Sharing section (AC34). On a pin advance: if upstream reshapes how a settings section is declared, re-register People after Connections; if upstream resolves Settings' servers anywhere besides those two files, filter it there too, or a server the person does not own greys out their Settings; if upstream renames the Appearance or SnapShots path, update `PAGES_FOR_EVERYONE` (its test pins the list); if upstream adds a settings page of its own for people or access, read D33 before keeping J5's. 73. A thread says who reaches it, and the client fits what a person's level lets them do ([#535](https://github.com/Jacksondr5/j5code/issues/535), [#541](https://github.com/Jacksondr5/j5code/issues/541), [#636](https://github.com/Jacksondr5/j5code/issues/636), register D33, Jackson's 2026-10-12 design and approval of one mount or item in each of these files, and his 2026-10-13 approvals of the route files and of the two edits that quiet what could only fail). All of it is J5-owned code under `apps/web/src/j5/sharing/`, mounted once in each upstream file, and it reads what the server says the connection is (`j5.access.getConnectionAccess`, read again when people or levels change) and the level it holds over each thread (`j5.access.subscribeThreadLevel`). `apps/web/src/components/chat/ChatHeader.tsx`: one import and `` after the breadcrumb, for a server thread; it draws nothing unless more than one person reaches the thread. `apps/web/src/components/chat/ThreadDetailsPanel.tsx`: one import and `` after `ThreadRelationshipsPanel`, under the same `density === "full" && !props.draftId` condition as its neighbours; and `const readOnly = !useCanOperateThread(…)` with `&& !readOnly` on the condition that mounts upstream's `ThreadAutomationsPanel`, so a Viewer of the thread sees no Automations. `apps/web/src/components/chat/ChatComposer.tsx`: one import, one hook call after the props are read (`useViewOnlyComposerProps(environmentId, canOperateThread)`), and one spread, `{...viewOnlyComposerProps}`, after upstream's `placeholder={…}` prop, so that someone who is not an Owner and cannot write to the thread reads "You can read this thread, but not send anything to it."; the collapsed composer's fallback literal becomes `(viewOnlyComposerProps.placeholder ?? "Ask anything...")`. The chip and the section ask the server who reaches the thread (`j5.people.listScope`) and ask again when its counter moves (`j5.people.subscribeScopeChanges`). Two route files carry a person's way in. `apps/web/src/routes/pair.tsx`: the import of upstream's `PairingRouteSurface` becomes J5's `JoinLinkPairingSurface`, and the JSX tag changes with it (three lines; upstream's `components/auth/PairingRouteSurface.tsx` is not edited). J5's surface asks `POST /api/j5/links/describe` what a link opens, without spending it, only for a link that carries J5's mark, and waits up to five seconds; everything else gets upstream's surface with the props it was given, and an ordinary pairing token is sent nowhere but upstream's own exchange. The person confirms or types their name and joins on `POST /api/j5/links/join`, which answers with an upstream pairing credential the page exchanges at once. The Share dialog puts the mark, `j5share=1`, in the fragment beside upstream's `token`; upstream reads the fragment as parameters and takes only `token`. `apps/web/src/routes/_chat.index.tsx`: one import, and `` is wrapped in ``, which renders its child at once for anyone at server scope and before the server answers, and for someone who reaches less shows their one thread, a list, or that nothing is shared with them (AC30). `apps/web/src/routes/__root.tsx`: one import, one hook call beside `primaryEnvironmentAuthenticated`, `useFirstRunSetupOffered(primaryEnvironmentAuthenticated)`, and `FirstRunGate`'s `enabled` reads its answer: the wizard is offered only to an Owner of the primary server the server has a name for, by that server's answer, so the name is asked first (AC6), and upstream's gate decides again when the answer arrives; a failed or missing answer offers nothing. `apps/web/src/routes/welcome.tsx`, the wizard's own address, gains one import and two lines before its return, `const setupRefusal = useSetupWizardRefusal(localAvailable); if (setupRefusal !== null) return setupRefusal;`, which draws nothing until the primary server answers and then sends anyone the wizard is not offered to to the first screen, where the name is asked; the hosted app, with no server of its own, is left to upstream. `apps/web/src/components/Sidebar.tsx`: one import, `const isNarrowEverywhere = useIsNarrowEverywhere()` beside the primary environment's id, and `&& !isNarrowEverywhere` on the empty list's `projects.length === 0` condition, so someone who reaches no whole server reads upstream's "No threads yet" in place of an "Add project" button that could only fail. Two more quiet upstream notices a person sees fail (J5-owned `apps/web/src/j5/sharing/upstreamNotices.ts`; Jackson's standing permission on this workstream for one import and one or two lines, used 2026-10-18): `apps/web/src/components/PermissionUpdateNotice.tsx` (one import, one changed line) lists its servers through `useEnvironmentsForPermissionNotice(useEnvironments().environments)`, which leaves out a server that places the connection as a person or a device it will ask about, and one that has not answered yet, as J5 sets and renews those permissions from the person's level, so "Pair again" never applies; its test (`PermissionUpdateNotice.test.tsx`, three added lines as formatted) mocks that hook as passing every server through. `apps/web/src/routes/__root.tsx` (one import, one added and one changed line) mounts `ProviderUpdateLaunchNotification` on `const providerUpdatesShown = useProviderUpdateNoticeShown(primaryEnvironmentAuthenticated)` in place of `primaryEnvironmentAuthenticated`, so the provider updates notice shows only to a connection holding Manage providers. On a pin advance: if upstream moves the composer's `placeholder` prop, keep the spread after it; if upstream renames `PermissionUpdateNotice`'s server list or moves the provider updates mount, filter or gate it where it moved; if upstream reorders the details panel, keep People after Lineage and the condition on the Automations mount; if upstream changes how a pairing address carries its token, or starts to refuse a fragment it does not know, reread `SHARE_LINK_MARK` in J5-owned `packages/contracts/src/j5/sharing.ts`; if upstream renames `PairingRouteSurface` or changes its props, J5's surface fails to compile; if upstream's index route stops rendering `IndexDraftLanding`, re-wrap whatever it renders; if upstream renames `FirstRunGate`'s `enabled`, or decides first run before `enabled` can change, someone who is not an Owner may be offered the wizard. 74. An agent's browser tab is private unless it names a profile (register D34, Jackson's 2026-10-13 decision). Upstream's `resolveOpenProfile` in `apps/server/src/preview/ServerBrowser.ts` gives a `preview_open` call without a `profileId` the person's default profile, whose stored state every agent tab on the server shares. J5 changes that one return to `INCOGNITO_BROWSER_PROFILE_ID`, which the file already imports, so the tab gets its own throwaway storage through upstream's existing incognito path. A named profile resolves as upstream's does. The `preview_open` description in `apps/server/src/mcp/toolkits/preview/tools.ts` changes one clause to say what omitting `profileId` now means. `ServerBrowser.test.ts` changes two expectations and their test titles. On a pin advance, keep the return and the description clause; if upstream makes agent tabs private by default, take upstream's and retire this case and D34. 75. Highlights, a client's "What's new" ([#624](https://github.com/Jacksondr5/j5code/issues/624), register D35, Jackson's 2026-10-17 decision and design). The entries, the client filter and the rule for what is new are J5-owned `packages/client-runtime/src/j5/highlights.ts`, reached through the `./j5/highlights` export this case appends to upstream-owned `packages/client-runtime/package.json`; the web button, list, art, seen record and palette entry are J5-owned files under `apps/web/src/j5/highlights/`. Four upstream files are touched. `apps/web/src/components/sidebar/SidebarChrome.tsx`: `SidebarUtilityMenu`'s `SidebarMenu` gains the class `@container/utility`, which the button's container query reads to hide itself where the row is too narrow, and `` is mounted immediately before `` (one import, one line). The button's item carries `ms-auto` and cancels the update button's own `ms-auto` with `[&+li]:ms-0`, so the two sit together at the end of the row. `apps/web/src/components/AppSidebarLayout.tsx` mounts `` after upstream's `` (one import, one line): the palette sits outside the sidebar provider, and this helper leaves a utility page and opens a collapsed sidebar when the palette asks for the list. `apps/web/src/components/CommandPalette.tsx` gains one import, one hook call (`useHighlightsPaletteItems()`, beside case 71's) and appends its items to case 71's `actionItems.push(...)`. `apps/web/src/onboarding/firstRun.ts`: `useCompleteOnboarding`, which every path that finishes first run calls (the wizard, the gate's silent completion for a client on an existing workspace, and hosted mode), calls `markAllHighlightsSeen()` before it writes `onboardingCompletedAt` (one import, one call). A finished client with no record is then an existing one, and the order makes that hold whenever the highlights code first reads it. On a pin advance: if upstream moves the utility row, the update button or `MainAppLocationTracker`, re-apply the mounts where they went; if upstream adds another writer of `onboardingCompletedAt`, it needs the same call before it; if upstream's palette `actionItems` moves, re-apply the append as in case 71. diff --git a/apps/web/src/components/settings/SettingsScopeSentence.tsx b/apps/web/src/components/settings/SettingsScopeSentence.tsx index 0abf9e1d91b72..0ac8648687b43 100644 --- a/apps/web/src/components/settings/SettingsScopeSentence.tsx +++ b/apps/web/src/components/settings/SettingsScopeSentence.tsx @@ -47,6 +47,8 @@ export const SETTINGS_DEVICE_ONLY_PATHS: ReadonlySet = new Set([ "/settings/snap-shot", "/settings/connections", "/settings/people", + // J5 (case 72): the licenses are the same for every server, and non-Owners see this page. + "/settings/open-source-licenses", ]); interface SettingsScopeMenuProps {