Skip to content

Share links 2: a guest views one thread, enforced by the server #532

Closed

Description

@Jacksondr5

Second of three pieces for share links. Depends on the people-and-grants issue.

Definition: Shared server (PR #529). Rulings and code findings: docs/j5/worklog/2026-10-09-multi-player-session.md (PR #509).

What this piece delivers

A guest with a View grant on a thread opens it and reads it, and the server refuses everything else. This is the one promise a share makes that the server enforces, so the filter every later piece depends on is built and proven here.

  • A guest's client lists only the threads their grants cover (AC23), including the agents beneath a granted thread (AC8).
  • The guest reads the conversation with its agent-to-agent cards, the diffs and files the thread's work touched, and watches its preview tabs; they see prompts with no controls; the composer is read-only (AC12).
  • A request for a thread, project or file outside the guest's grants is refused whatever client sent it (AC15), and so is everything in AC14.
  • Adding or removing a grant changes what the guest's connected clients show without pairing again (AC10, AC11).
  • Nothing from this server reaches the guest's inbox or Fleet page (AC24).

Findings to build on (read from the code, nothing run)

  • A thread view loads over HTTP first: GET /api/orchestration/shell for the sidebar and /api/orchestration/threads/:id/bounded (falling back to /threads/:id, with /history for older pages) for the conversation. Each checks only the read permission (orchestration-v2/http.ts). The WebSocket then carries subscribeShell and subscribeThread. Web and mobile share this through packages/client-runtime.
  • The WebSocket permission check (auth/RpcAuthorization.ts, provided per connection in ws.ts) is an RPC middleware that sees the request's name and payload and can refuse it. It does not receive the session today, and it never sees the items of a stream.
  • Feeds that carry many threads must be filtered where they are produced: subscribeShell and the HTTP shell snapshot, the archived shell snapshot and stream, searchThreads, subscribePreviewEvents, the terminal event and metadata streams, the scheduled task list and stream, pullRequestsLinkedThreads, subscribeProjectClones, subscribeDeviceState, and J5's own artifact, playbook and handoff streams (handlers not read).
  • About 24 requests are keyed by a folder the client supplies, including reviewGetDiffPreview and subscribeVcsStatus, which a thread view uses for changed files. projectsReadFile reads any file given an absolute path. These need a rule that ties a folder to a granted thread, or a refusal.
  • Preview: previewList is per thread; /api/preview-stream/ws and the download route check the read permission and not the thread. Upstream at 2625327090 moved stream input and upload to the preview permission; j5/main does not have that yet.
  • Assets: assetsCreateUrl then GET /api/assets.
  • J5 HTTP reads the web thread view makes: participant identities, spawned children, crew memberships, open count.
  • The filter denies by default: a guest is refused any request type that has no guest decision. For the WebSocket that is one typed table beside RPC_REQUIRED_SCOPES. For HTTP there is no single guard; the shared helpers requireEnvironmentScope and authenticateMediaRequest are the candidate place to refuse a guest unless the route has opted in.

Not determined: whether a plain thread view mounts subscribeTerminalMetadata; which J5 reads mobile makes; whether upstream's clients hide controls a session lacks permission for.

Size and upstream

The filter alone touches about seven upstream-owned files (ws.ts, auth/RpcAuthorization.ts, orchestration-v2/http.ts, preview/ServerBrowserStream.ts, auth/http.ts, the preview manager or its handler, the asset route). Each needs a FORK.md entry, and the change to what a session may read needs an entry in the register of divergences.

Verifying

Tests should prove the refusals from the server side, with a guest session making requests a client would never send: another thread's id, a folder outside the granted thread, an absolute file path, another thread's preview tab.

Activity

  1. Jacksondr5 commented on Oct 11, 2026

    @Jacksondr5
    OwnerAuthor

    Re-sliced on 2026-10-11: this is now the second of four. It depends on #531 for the data and lands before 535 makes a link possible, so on j5/main the filter has no guest to act on until then. Its tests create guests directly.

  2. Jacksondr5 commented on Oct 11, 2026

    @Jacksondr5
    OwnerAuthor

    Decided 2026-10-11 (Jackson): for the first version a view guest gets the thread-keyed diffs only (getTurnDiff, getFullThreadDiff, getTurnItem). Every request keyed by a folder the client names is refused to a guest, including the changed-files panel and file contents. File and diff viewing is a seldom-used feature and may be dropped for guests altogether if it proves a problem.

    Checked the same day: a guest cannot create a session. Every path that issues one needs the Manage access permission (pairing links, MCP client consent), a shell on the host (the CLI), or the dev token. Piece 3 (#535) gets a test that a guest link never carries Manage access.

  3. Jacksondr5 commented on Oct 11, 2026

    @Jacksondr5
    OwnerAuthor

    Design after reading the code on 2026-10-11 (branch j5code/share-2-guest-filter, stacked on #536). Nothing is written yet.

    One gate for all HTTP, including WebSocket upgrades. Every route that authenticates calls EnvironmentAuth.authenticateHttpRequest or authenticateWebSocketUpgrade: upstream's HTTP API middleware, the preview stream, the device hub proxy, and J5's own routes. The earlier finding that HTTP has no single guard was wrong. J5 decorates the EnvironmentAuth service where server.ts composes it (the same shape as the thread-lineage decorator, FORK.md case 38). For a session marked as a guest's, the decorator refuses every path that is not on J5's allow-list; for any other session it does nothing, so members pay only a string comparison.

    Allow-list for a view guest: /ws; the auth endpoints a client needs to stay signed in (/api/auth/session, /api/auth/websocket-ticket); /api/orchestration/shell, filtered in its handler; /api/orchestration/threads/:id, /bounded and /history, each checked against the guest's access to that thread. Everything else is refused, including /api/projects, pairing links, clients, the relay routes, assets, the preview stream and J5's HTTP reads.

    WebSocket requests. For a guest's connection J5 wraps the per-connection RpcScopeAuthorization (one line in ws.ts). The table is an allow-list keyed by method name, typed against the RPC group so a renamed method fails to compile. A method not on it is refused, so new upstream methods need no classification to be safe. Each entry names where the thread id sits in the payload and the level it needs.

    Feeds. The sidebar feed (subscribeShell and the HTTP shell snapshot) is filtered where it is produced: its snapshot, and every live change after it. This is the hard part and the largest upstream edit.

    Proposed split into two PRs: (a) the gate, the WebSocket table, the thread loads and the filtered sidebar feed, with server tests that make requests a client never would; (b) what the client does with a view-only thread (read-only composer, controls hidden), verified in a real client.

    Open: watching preview tabs. It needs the preview event feed filtered and a thread check on the preview stream routes, and it depends on upstream's 50647de014. Proposed to move it to its own piece after (b).

  4. Jacksondr5 commented on Oct 11, 2026

    @Jacksondr5
    OwnerAuthor

    Decided 2026-10-11 (Jackson): watching preview tabs moves to its own piece, #540. This issue covers the conversation, the thread-keyed diffs and the sidebar. Multi-person links are designed in #541; nothing in this piece blocks them. Set-aside items are listed in #542.

  5. Jacksondr5 commented on Oct 11, 2026

    @Jacksondr5
    OwnerAuthor

    Progress, 2026-10-11. Branch j5code/share-2-guest-filter (stacked on #536), commit 78ac47bcd8. No PR yet.

    Built and tested (apps/server/src/j5/sharing/GuestGate.ts, 7 tests):

    • HTTP gate. gateEnvironmentAuth wraps upstream's EnvironmentAuth in server.ts. A guest's session comes back with its permissions only on /ws and on the three thread loads for a thread a grant covers; on every other route it comes back with none, so the route's own permission check refuses it with upstream's ordinary missing-permission response. No new error type and no edit to any route.
    • WebSocket requests. layerRpcAuthorization replaces one line in ws.ts. A guest may make only the requests in GUEST_RPC_RULES (subscribeThread, the three diff reads, searchThread and its stream), each for a thread a grant covers. An unlisted request is refused whatever it names.
    • A member's session passes through both untouched; the tests assert it.

    Still to do before a PR:

    1. The sidebar feed: filter subscribeShell and /api/orchestration/shell for a guest, then allow them. Until then a guest has no thread list.
    2. The requests a client makes when it connects (server.getConfig, subscribeServerConfig, subscribeServerLifecycle and others): read what each returns and allow the ones that leak nothing, or give a guest a reduced answer.
    3. FORK.md case 65 and the register of divergences entry.
    4. One pass in a real client as a guest, to see what the client does with the refusals.
  6. Jacksondr5 commented on Oct 12, 2026

    @Jacksondr5
    OwnerAuthor

    Research on what a guest's web client needs, by a Peer Agent on an isolated live-test server (2026-10-12). Observed in a browser unless marked inferred. The reduced configuration it tested follows the report.

    Report

    Guest web-client research (2026-10-12)

    Scope and evidence

    Live Browser panel test of scratch branch merged with origin/j5/main (setup script from #551/#554), isolated home .j5code/live-test/home, web 6478 / server 14518. The setup script built the disposable repository and replay fixtures; no live-install database was used. Guest was created through a temporary CLI subject patch plus PersonAccess.createGuest/bindSession/putGrant, with orchestration:read, orchestration:operate, preview:operate, a View grant, and subject=j5:guest. All patches were research-only. Browser profiles separated guest (incognito) from member (default). One new member thread used Claude Haiku 4.5, Current checkout, to create guest-research.txt; database run status was completed and file contents verified. Granting that new thread allowed a real checkpoint diff to be tested. No guest turn ran.

    OBSERVED means Browser panel / test-server request logging / real serialized response; INFERRED means source reading only. No remote/relay, mobile, empty-grant, grant-revocation, large history, custom provider, attachment or prompt-answer tests.

    Scratch merge commit: 6a89cb82fbdd841fe1292dc151d706a41b6006b1.

    Exact reduced response: /tmp/guest-minimal-config.json. Screenshot of minimal config, sanitized project shell and expanded real diff: /tmp/guest-final-diff.png. Earlier screenshot with projects=[]: /tmp/guest-minimal-diff.png. Research patch: /tmp/guest-research.patch. These screenshots were captured only against the isolated test server.

    1. Requests and denial effects

    OBSERVED unmodified gate: pairing succeeds; GET /api/auth/session still reports authenticated:true with granted permissions. subscribeServerConfig is refused, client eventually shows Still connecting / J5 Code could not confirm this workspace. / Reload. No sign-out, no automatic tight config retry. Source: packages/client-runtime/src/rpc/session.ts:132 maps authorization to ConnectionBlockedError(permission); :229 starts config stream; :292 awaits first config; packages/client-runtime/src/connection/supervisor.ts:927 parks blocked attempts with retryAt:null until a signal. apps/web/src/components/onboarding/FirstRunGate.tsx:48 uses a 4-second stalled gate.

    Application requests below exclude individual JS/CSS/font/Vite module fetches, which are public frontend resources; document routes /pair, /, /draft/:id and /:environmentId/:threadId load the frontend. This is the union actually seen as successive refusals were relaxed, including default side panels and the initial draft landing; not every optional call fires for every configuration.

    HTTP method / route Original gate Observed result / purpose
    GET /.well-known/t3/environment Public, unaffected Discovery succeeds; carries descriptor (including host label/platform) independently of reduced config.
    POST /api/auth/browser-session Bootstrap, unaffected Consumes guest link, sets guest cookie.
    GET /api/auth/session Unaffected getSessionState closure Authenticated with read/operate/preview permissions; not empty scopes.
    GET /ws Allowed Cookie-auth socket opens; individual RPCs gate separately.
    GET /api/orchestration/shell Refused Shell unavailable; HTTP loader tries socket fallback. Fresh startup stays gated until shell and lifecycle available.
    GET /api/orchestration/threads/:id/bounded Allowed for granted id Actual initial conversation load observed.
    GET /api/orchestration/threads/:id and /history Allowed for granted id Supported alternatives/history, not exercised in this short conversation.
    POST /api/j5/a2a/client-reads/crew-memberships Refused 403 No membership decoration; conversation still renders.
    POST /api/j5/a2a/client-reads/spawned-children Refused 403 No child decoration; conversation still renders.
    POST /api/j5/a2a/client-reads/fleet Refused 403 Fleet support data fails; conversation still renders.
    POST /api/j5/a2a/client-reads/open-count Refused 403 Inbox badge ?; repeated foreground reads.
    POST /api/j5/a2a/crews/proposals Refused 403 Proposal data absent; repeated foreground reads.
    POST /api/j5/playbooks/thread Refused 403 No playbook section; conversation still renders.
    POST /api/observability/v1/traces Refused 403 Export errors in console; no sign-out or conversation failure.

    INFERRED conditional route: POST /api/auth/websocket-ticket (remote connection / ticket auth) uses auth service internals and is unaffected by gate, not observed in this cookie-based connection. Routes defined packages/contracts/src/environmentHttp.ts:457,464,479. getSessionState calls authenticateRequest internally at apps/server/src/auth/EnvironmentAuth.ts:770, not the decorated authenticateHttpRequest. The gate's rule table alone does not describe these auth endpoints' behavior.

    RPC observed Original gate Visible behavior / need
    subscribeServerConfig Refused Hard connection prerequisite; blocked as above.
    subscribeServerLifecycle Refused Fresh onboarding waits for welcome; no app for a single thread without it.
    orchestration.subscribeShell Refused No authoritative sidebar; required after HTTP snapshot, or as snapshot fallback.
    orchestration.subscribeThread Allowed granted thread Required live conversation.
    orchestration.getFullThreadDiff Allowed granted thread Actual diff call when clicking Open diff; expanded one-line addition renders.
    subscribeVcsStatus Refused Missing source-control status, read-only transcript/diff still works.
    vcs.listRefs Refused Repeated retries; branch picker cannot load refs.
    server.discoverSourceControl Refused Missing repository actions; transcript/diff fine.
    projects.readFile Refused Project-config reading unavailable; transcript fine.
    assets.createUrl Refused Assets/icon fallback; no transcript blocker in tested text-only thread.
    subscribeDeviceState Refused Device state unavailable; transcript fine.
    subscribePreviewEvents Refused Browser state unavailable; transcript fine. Seen with full config, unnecessary with serverBrowser absent.
    preview.list Refused Browser list unavailable; transcript fine.
    preview.reportProfiles Refused No visible error; reporter suppresses failure UI.
    subscribeProjectClones Refused Clone status unavailable; transcript fine; full config only.
    j5.agentPersonas.getCatalog Refused Persona picker data unavailable; transcript fine; full config only.
    scheduledTasks.subscribe Refused Details panel displays Could not load automations: This is not shared with you on this server.
    orchestration.getArchivedShellSnapshot Refused Settled/archive data unavailable; tested current thread remains listed.
    orchestration.dispatchCommand Refused Automatic visit/state commands can occur; tested send refusal described below.
    server.refreshProviders Refused Provider refresh unavailable; no startup-blocking toast observed.
    server.reportClientActivity Refused Background report fails without breaking conversation; repeated.
    orchestration.getThreadProjection Refused Send preflight only in this test; error restored draft. Not needed to display transcript.

    server.getConfig was allowed but not observed as the initial handshake: it is the fallback probe when connectionProbe is not advertised (packages/client-runtime/src/rpc/session.ts:373). If advertising connectionProbe:true, server.probe must work instead. Remaining originally allowed reads getTurnDiff/getTurnItem/searchThread/searchThreadStream were not needed by this short render and remain granted-thread-only.

    Retry findings:

    • OBSERVED repeated 403 inbox-count and Crew-proposal calls. INFERRED cadence 7,500 ms while visible: apps/web/src/j5/a2a/HumanInboxBell.tsx:21, apps/web/src/j5/crew/crewProposalsClient.ts:22, apps/web/src/j5/useVisibleRefresh.ts:3. refreshJ5Sources only skips unsupported/disconnected/in-flight sources, not permission failures (apps/web/src/j5/state.ts:104).
    • OBSERVED recurring vcs.listRefs authorization warnings. INFERRED exponential 1-second delay capped at 30 seconds with unconditional Stream.retry: packages/client-runtime/src/state/vcs.ts:41, :207.
    • OBSERVED repeated client activity requests. INFERRED 25,000-ms periodic reporting: apps/web/src/lib/backgroundActivityReporter.ts:25,:251.
    • Generic durable subscriptions explicitly do not retry an EnvironmentAuthorizationError when handling expected failures: packages/client-runtime/src/rpc/client.ts:360-376. This does NOT cover the VCS refs or J5 polling mechanisms above.
    • No sign-out observed. Environment HTTP helper renews a DPoP credential once only for invalid-credential errors, not scope errors: packages/client-runtime/src/state/environmentHttpAuth.ts:193-224.

    Exact final research allow-list

    HTTP additions to existing gate: GET /api/orchestration/shell. Kept GET /ws and GET /api/orchestration/threads/:id, /bounded, /history, with grant checks on thread loads. Auth/discovery remain accessible via their original service paths; no new permission grant on them.

    RPC additions: server.getConfig, subscribeServerConfig, subscribeServerLifecycle, orchestration.subscribeShell. Kept original granted-thread methods orchestration.subscribeThread, orchestration.getTurnDiff, orchestration.getFullThreadDiff, orchestration.getTurnItem, orchestration.searchThread, orchestration.searchThreadStream. Everything else stayed refused. getThreadProjection was temporarily admitted only to reach the send command for refusal testing, then removed. No mutation was allowed.

    The final config stream sent one reduced snapshot then stayed open (Stream.never); do not confuse this scratch proof with a production implementation. A production filter must also sanitize every settings/provider/editor/theme/usage delta. Filtering only loadServerConfig leaks via subscribeServerConfig live updates and late editor updates (apps/server/src/ws.ts:2972-3084 in scratch; original HEAD line ~2972 onward).

    2. ServerConfig and every settings/provider field

    OBSERVED final config contains ONLY the ten required top-level keys: environment, auth, cwd, keybindingsConfigPath, keybindings, issues, providers, availableEditors, observability, settings. Exact JSON file above is the Schema-encoded response, not a pseudocode sample. environment retains actual environmentId/serverVersion/protocolVersion, generic label Shared server, platform unknown/other and capabilities.repositoryIdentity:false. auth is the real non-secret auth descriptor. Paths use /; lists are []; observability has path / and all booleans false; settings is DEFAULT_SERVER_SETTINGS. No optional top-level flags are needed for the tested transcript and checkpoint diff. This is schema-minimal top-level shape, not a claim that generic auth/platform strings or each optional nested value have all been independently minimized.

    Important UX limit: providers:[] renders the conversation and diff, but composer says Enable a provider in Settings to send a message and offers Open provider settings. This is not a correct guest View UI. Suppressing providers is not a substitute for thread permission UI.

    Required/safe replacement and optional field tables follow. Settings defaults are decoded by packages/contracts/src/settings.ts:1459 and encoded in the response. No host-specific settings value was necessary. Client-local diff layout/fonts/theme remain the guest's own client settings.

    Secrets, OBSERVED in a real serialized config: dummy Bitbucket accessToken/apiToken and GitHub tokens inserted in isolated settings returned ••••••; Codex and Claude auth snapshots contained nonempty email and label fields (did not publish values). INFERRED redactor also empties provider environment values, marks valueRedacted, and masks usage-limit managementKey. It does not recursively scrub arbitrary unknown provider config blobs: never treat full settings as generally secret-free. Source apps/server/src/serverSettings.ts:173-230; packages/contracts/src/server.ts:63-73. Current ServerSettings has providerInstances, not a legacy providers map.

    3. Other feeds

    Lifecycle: contract packages/contracts/src/server.ts:872-929. Welcome has environment, cwd, projectName and optional bootstrap metadata; ready has time/environment/update result; migration event has total thread count. A fresh one-thread browser requires a welcome (FirstRunGate.tsx:97,155; onboarding/firstRun.logic.ts:59,151). OBSERVED isolated A/B: with reduced config and shell permitted but lifecycle alone refused, clearing guest onboarding and reloading still produced Still connecting; server log showed config, lifecycle, shell HTTP and subscribeShell, with no conversation UI. Returning browser with completed onboarding can get further without one; do not generalize that to new guests. OBSERVED sanitized welcome/ready with generic environment, cwd /, projectName Shared project, bootstrapStatus complete, no bootstrap IDs, and migration events filtered out, passed a fresh guest reload. Full lifecycle reveals host cwd and bootstrap identities. Use reduced lifecycle or change the client gate.

    subscribeAuthAccess: not called on this startup. It is mounted in Connections settings only with access:read (apps/web/src/components/settings/ConnectionsSettings.tsx:2294-2306). It contains other client sessions and pairing links, not current thread grants (packages/client-runtime/src/state/auth.ts:14-67). Keep refused. Other startup subscriptions above can remain refused for this minimal render, but panel errors/polling need client follow-up. Preview watching is explicitly out of issue scope (#540).

    4. Shell and projects

    OBSERVED projects:[] + exactly one granted thread row still lists/opens the thread in the current default flat sidebar, and the actual checkpoint diff renders. It drops the project badge/header and some project actions. Therefore a project is not strictly necessary for this tested thread row. A sanitized project is preferable to preserve context / compatibility with grouping. A second pass with {id:<real>,title:'Shared project',workspaceRoot:'/',defaultModelSelection:null,scripts:[],createdAt:<original>,updatedAt:<original>} also rendered correctly. Source schema packages/contracts/src/orchestrationProject.ts:9-27; Sidebar.tsx:2580,2638; DiffPanel.tsx:225-245. Legacy/grouped sidebar not live-tested.

    Project leaks: workspaceRoot; repositoryIdentity including provider/repository/root identity; defaultModelSelection (configured provider/model); scripts (commands/cwd/preview URL); icons/favicon paths or URLs. autoPull/defaultThreadEnvMode expose settings. Required project fields are id/title/workspaceRoot/defaultModelSelection/scripts/createdAt/updatedAt; optional ones can be omitted. Nonempty workspaceRoot requires a placeholder if a project object is retained.

    Retain thread.projectId correspondence if publishing a project, all required thread-shell fields, schemaVersion, snapshotSequence and regular stream envelope/sequence semantics. Thread shells independently contain branch/worktreePath/PR links/lineage/provider IDs; reducing projects alone does not scrub those. Metadata/resume snapshots also contain projects (ws.ts subscribeOrchestrationV2Shell loadProjectMetadataSnapshot). Filter snapshot AND delta paths, including removals and grant changes; do not reset sequence to filtered counts. If advertising resume completion support, preserve caught-up completion signals even for empty filtered batches. These stream/revocation requirements are INFERRED, not verified by this scratch filter.

    5. View-only composer

    OBSERVED with operate scope and provider available: typing/submitting first fails getThreadProjection preflight, shows inline thread error This is not shared with you on this server., restores the composer text. Temporarily allowing this read then reaches orchestration.dispatchCommand; same inline error and restored draft. No provider run was created (one completed run before/after). No sign-out or automatic resend observed.

    INFERRED ChatView's canOperateThread comes from environment-wide useEnvironmentScope (ChatView.tsx:1584; state/session.ts:21-37). ComposerPrimaryActions.tsx:129 disables sending when false. Error rollback/restoration is ChatView.tsx:10070-10140. An environment without operate can disable sends but cannot represent View on one thread and Collaborate on another while sharing one session.

    permissionAtom is an existing extension point, not existing per-thread access support: packages/client-runtime/src/state/commandPermissions.ts:19-40 keys availability by environment + required scope set and does not consult a grant. createEnvironmentRpcCommand supplies this helper (state/runtime.ts:808), but CLIENT_GUARDED_RPC_SCOPES currently does not even list orchestration.dispatchCommand (packages/contracts/src/clientRpcPermissions.ts:12-44). Thread-level access needs a supplied capability/grant and a thread-aware UI/authorization policy; merely adding a config field will not hide/disable this composer or every approval/action. View UI should hide composer and mutation controls explicitly, not show missing-provider onboarding.

    Appendix: exhaustive schema-field classification

    N = actual identity/protocol/access plumbing; D = drop or use a neutral/default value; U = value only serves features outside a View guest. “Required” means property required by top-level/entry schema unless noted. Every setting was replaced by DEFAULT_SERVER_SETTINGS in the live test.

    ServerConfig (packages/contracts/src/server.ts:651)

    Field Class Replacement / schema
    environment N keep real environmentId and compatible protocol/version; generic label/platform, minimal capabilities
    auth N auth mechanism descriptor; no credentials in it
    cwd D required nonempty string, / worked
    keybindingsConfigPath U required nonempty string, / worked
    keybindings D required array, [] worked (no configured shortcuts)
    issues U required array, []
    providers U required array, [] (missing-provider composer warning)
    availableEditors U required array, []
    remoteOpenTargets U optional, omitted
    directEndpoints U optional, omitted
    observability U required object; logsDirectoryPath /, required booleans false, URL fields omitted
    settings D/U required object; normalized DEFAULT_SERVER_SETTINGS
    shellResumeCompletionMarker D optional compatibility/render/read capability; omitted in final live test; retaining accurate read features is useful
    shellRevealInFileManager U optional, omitted
    shellRevealInFileManagerKind U optional, omitted
    threadResumeCompletionMarker D optional compatibility/render/read capability; omitted in final live test; retaining accurate read features is useful
    threadSnapshotPagination D optional compatibility/render/read capability; omitted in final live test; retaining accurate read features is useful
    reasoningMessages D optional compatibility/render/read capability; omitted in final live test; retaining accurate read features is useful
    threadFind D optional compatibility/render/read capability; omitted in final live test; retaining accurate read features is useful
    threadFindProgressive D optional compatibility/render/read capability; omitted in final live test; retaining accurate read features is useful
    scratchWorkspaceRoot U optional, omitted
    newProjectsRoot U optional, omitted
    environmentThemes U optional, omitted
    usageLimitSources U optional, omitted

    ServerSettings (packages/contracts/src/settings.ts:1230)

    The schema decodes {} to DEFAULT_SERVER_SETTINGS (line 1459); do not copy actual host values. All fields below can take their default. The exact normalized values used are in guest-minimal-config.json. defaultThreadEnvMode defaults null and is omitted on the wire (OmittedWhenNull).

    Field Class / role
    worktreeCleanup U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    storageCleanup U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    worktreesDirectory U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    previousWorktreesDirectories U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    responseStreamingMode D — streaming presentation; default paragraph
    enableProviderUpdateChecks U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    continueThreadsAfterServerUpdate U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    enableAgentBrowserAccess U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    projectAgentBrowserAccessOverrides U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    defaultAutoPull U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    defaultProjectScripts U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    projectScriptOverrides U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    projectAutoPullOverrides U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    defaultModelSelection U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    defaultRuntimeMode U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    projectSettingsOverrides U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    projectSettingsFolded U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    enableAgentDeviceAccess U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    enableDeviceSupport U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    deviceOnboardingCompleted U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    deviceHosts U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    sidebarAutoSettleAfterDays U — settle policy/UI hints; default
    snoozeLimitedThreads U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    autoResumeLimitedThreads U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    sidebarAutoSettleOnMerge U — settle policy/UI hints; default
    backgroundActivity U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    automaticGitFetchInterval U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    providerHealthRefreshInterval U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    backgroundActivityProfile U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    defaultTheme D — optional host theme preference; empty
    defaultThemeSetAt D — theme preference version; empty
    environmentIcon D — generic icon; null
    defaultThreadEnvMode U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    newWorktreesStartFromOrigin U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    worktreeSubmodules U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    addProjectBaseDirectory U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    skillCatalogSource U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    textGenerationModelSelection U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    branchNamingMode U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    branchNamePrefix U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    branchNameInstructions U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    removeAgentCreditsOnMerge U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    sourceControlWritingStyle U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    sourceControlWriterModelSelection U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    pullRequestMergeMethod U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    providerInstances U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    observability U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    bitbucket U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    github U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    usageLimitSources U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    cursorKeychainUsageEnabled U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    usagePriceOverrides U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient
    usageModelAliases U — creation, mutation, provider/settings, background policy, or usage feature; default is sufficient

    ServerProvider entries (packages/contracts/src/server.ts:245)

    Entire array may be []; no entry or subfield is needed for tested read-only transcript/diff. Entry identity/model metadata can improve custom model labels but was not needed for the tested built-in Haiku/Sonnet history. If retaining an entry, obey these required fields. Nested model/skill/workspace/options/auth-action payloads are unnecessary if their parent is omitted/empty; do not expose them solely to satisfy a view guest.

    Field Class Schema when entry present
    skillDiscoveryError U/D — omit entire provider entry for View optional
    instanceId U/D — omit entire provider entry for View required
    driver U/D — omit entire provider entry for View required
    displayName U/D — omit entire provider entry for View optional
    accentColor U/D — omit entire provider entry for View optional
    iconUrl U/D — omit entire provider entry for View optional
    badgeLabel U/D — omit entire provider entry for View optional
    continuation U/D — omit entire provider entry for View optional
    showInteractionModeToggle U/D — omit entire provider entry for View optional
    reportsContextWindow U/D — omit entire provider entry for View optional
    supportedRuntimeModes U/D — omit entire provider entry for View optional
    requiresNewThreadForModelChange U/D — omit entire provider entry for View optional
    supportsConversationRollback U/D — omit entire provider entry for View optional
    supportsTextGeneration U/D — omit entire provider entry for View optional
    setup U/D — omit entire provider entry for View optional
    nativeSessions U/D — omit entire provider entry for View optional
    configurableProviders U/D — omit entire provider entry for View optional
    runtimePaths U/D — omit entire provider entry for View optional
    enabled U/D — omit entire provider entry for View required
    installed U/D — omit entire provider entry for View required
    version U/D — omit entire provider entry for View required
    status U/D — omit entire provider entry for View required
    auth U/D — omit entire provider entry for View required
    checkedAt U/D — omit entire provider entry for View required
    message U/D — omit entire provider entry for View optional
    availability U/D — omit entire provider entry for View optional
    unavailableReason U/D — omit entire provider entry for View optional
    models U/D — omit entire provider entry for View required
    updateRequiredModels U/D — omit entire provider entry for View optional
    slashCommands U/D — omit entire provider entry for View decoding default []
    skills U/D — omit entire provider entry for View decoding default []
    workspaceSnapshots U/D — omit entire provider entry for View optional
    usageLimits U/D — omit entire provider entry for View optional
    versionAdvisory U/D — omit entire provider entry for View optional
    compatibilityAdvisory U/D — omit entire provider entry for View optional
    updateState U/D — omit entire provider entry for View optional

    Provider auth subfields (server.ts:63): status is required if auth is retained; type, label, email, action, canLogout, subscriptionSharing, profileId are optional. None is needed for View. Email/label/profileId are account information; action may contain sign-in URLs and should not be exposed. If keeping a display-only provider entry, avoid forwarding the real auth object.

    Server observability (server.ts:347): logsDirectoryPath, localTracingEnabled, otlpTracesEnabled, otlpMetricsEnabled are required; otlpLogsEnabled defaults false; otlpTracesUrl, otlpMetricsUrl, otlpLogsUrl optional. All U; placeholders/false/omission worked.

    Cleanup

    The setup-script server was stopped. Scratch source edits and the temporary in-repo grant script were reverted/removed; git status is clean at the requested local merge commit. Nothing was pushed and no PR was opened. The isolated home/repository remain ignored for reproduction. No automated suite was run: this was source research plus live verification, with schema encoding exercised by actual responses.

    Reduced ServerConfig that rendered a thread and its diff
    {
      "environment": {
        "environmentId": "462032d5-afc1-4de6-904e-06f69448318a",
        "label": "Shared server",
        "platform": {
          "os": "unknown",
          "arch": "other"
        },
        "serverVersion": "0.0.48",
        "orchestrationProtocolVersion": 2,
        "capabilities": {
          "repositoryIdentity": false
        }
      },
      "auth": {
        "policy": "loopback-browser",
        "bootstrapMethods": [
          "one-time-token"
        ],
        "sessionMethods": [
          "browser-session-cookie",
          "bearer-access-token",
          "dpop-access-token"
        ],
        "sessionCookieName": "t3_session_14518_acb2abb826dc",
        "serverUpdateScope": "environment:maintain"
      },
      "cwd": "/",
      "keybindingsConfigPath": "/",
      "keybindings": [],
      "issues": [],
      "providers": [],
      "availableEditors": [],
      "observability": {
        "logsDirectoryPath": "/",
        "localTracingEnabled": false,
        "otlpTracesEnabled": false,
        "otlpMetricsEnabled": false,
        "otlpLogsEnabled": false
      },
      "settings": {
        "worktreeCleanup": null,
        "storageCleanup": {
          "worktreeAfterDays": null,
          "worktreeOnMerge": false,
          "worktreeOnDelete": false,
          "worktreeUnchanged": false,
          "browserArtifactsAfterDays": null,
          "logsAfterDays": null
        },
        "worktreesDirectory": "",
        "previousWorktreesDirectories": [],
        "responseStreamingMode": "paragraph",
        "enableProviderUpdateChecks": true,
        "continueThreadsAfterServerUpdate": false,
        "enableAgentBrowserAccess": true,
        "projectAgentBrowserAccessOverrides": {},
        "defaultAutoPull": false,
        "defaultProjectScripts": [],
        "projectScriptOverrides": {},
        "projectAutoPullOverrides": {},
        "defaultModelSelection": null,
        "defaultRuntimeMode": "full-access",
        "projectSettingsOverrides": {},
        "projectSettingsFolded": false,
        "enableAgentDeviceAccess": false,
        "enableDeviceSupport": false,
        "deviceOnboardingCompleted": false,
        "deviceHosts": [],
        "sidebarAutoSettleAfterDays": 3,
        "snoozeLimitedThreads": false,
        "autoResumeLimitedThreads": false,
        "sidebarAutoSettleOnMerge": true,
        "backgroundActivity": {
          "schemaVersion": 1,
          "profile": "balanced",
          "overrides": {}
        },
        "automaticGitFetchInterval": 30000,
        "providerHealthRefreshInterval": 300000,
        "backgroundActivityProfile": "balanced",
        "defaultTheme": "",
        "defaultThemeSetAt": "",
        "environmentIcon": null,
        "newWorktreesStartFromOrigin": true,
        "worktreeSubmodules": null,
        "addProjectBaseDirectory": "",
        "skillCatalogSource": "",
        "textGenerationModelSelection": {
          "instanceId": "codex",
          "model": "gpt-6-luna",
          "options": [
            {
              "id": "reasoningEffort",
              "value": "low"
            }
          ]
        },
        "branchNamingMode": "static",
        "branchNamePrefix": "j5code",
        "branchNameInstructions": "",
        "removeAgentCreditsOnMerge": false,
        "sourceControlWritingStyle": {
          "mode": "repo_conventions",
          "customInstructions": "",
          "followChangeRequestTemplates": true
        },
        "sourceControlWriterModelSelection": null,
        "pullRequestMergeMethod": null,
        "providerInstances": {},
        "observability": {
          "otlpTracesUrl": "",
          "otlpMetricsUrl": "",
          "otlpLogsUrl": ""
        },
        "bitbucket": {
          "email": "",
          "accessToken": "",
          "apiToken": ""
        },
        "github": {
          "hosts": {},
          "tokens": {}
        },
        "usageLimitSources": {},
        "cursorKeychainUsageEnabled": false,
        "usagePriceOverrides": {},
        "usageModelAliases": {}
      }
    }```
    
    </details>
  7. Jacksondr5 commented on Oct 12, 2026

    @Jacksondr5
    OwnerAuthor

    Two notes, 2026-10-12.

    Client piece approved (Jackson). A guest's view-only thread gets a read-only composer through per-thread levels: the server tells a guest's client the level it holds on each thread, and upstream's chat view makes one call into a J5 function where it reads the server-wide permission today, on web and mobile. For any connection that is not a guest's the function returns upstream's own answer. Reporting a view-only guest as lacking 'Operate tasks' was considered and dropped: it cannot express View on one thread and Collaborate on another.

    For the next upstream advance. Upstream's 48595c787c (consolidate browser credential handling) restructures authenticateRequest in auth/EnvironmentAuth.ts. The guest gate wraps the service's two public entry points, authenticateHttpRequest and authenticateWebSocketUpgrade, so an internal restructure should not break it. The advance must confirm that no new entry point was added beside them and that every authenticating route still goes through one of the two. Upstream still has no guest, sharing or per-thread permission concept as of 511d20c6f2.

  8. Jacksondr5 commented on Oct 13, 2026

    @Jacksondr5
    OwnerAuthor

    Done in the stack #536, #561, #577, merged to j5/main on 2026-10-12 as one operation. What was set aside is listed in #542; preview watching is #540, project artifacts #578, and the cost note #579.

  9. added this to the V1: Viewer sharing milestone on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions