From 0897b70aaecd4f1c3e04f85ec2f7d1cc529b53dd Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Mon, 9 Nov 2026 00:59:55 -0500 Subject: [PATCH 1/6] feat(mobile): a Captain's seats list under its row, with Stop crew Co-Authored-By: Claude Opus 5.5 --- FORK.md | 787 +++++++++--------- .../features/threads/thread-list-v2-items.tsx | 33 +- .../features/threads/useThreadListV2.test.tsx | 4 + .../src/features/threads/useThreadListV2.ts | 5 +- apps/mobile/src/j5/crew/CaptainSeats.tsx | 308 +++++++ apps/mobile/src/j5/crew/spawnedChildren.ts | 132 +++ apps/mobile/src/j5/upstreamSeams.test.ts | 12 + apps/web/src/j5/fleet/FleetPage.tsx | 2 +- apps/web/src/j5/fleet/fleet.logic.test.ts | 2 +- apps/web/src/j5/fleet/fleet.logic.ts | 2 +- apps/web/src/j5/fleet/fleetPresentation.ts | 2 +- apps/web/src/j5/threads/SpawnedChildren.tsx | 7 +- .../src/j5/threads/SpawnedChildrenClient.ts | 53 +- .../src/j5/threads/sidebarMembership.test.ts | 15 - apps/web/src/j5/threads/sidebarMembership.ts | 13 +- .../j5/threads/spawnedChildren.logic.test.ts | 204 +---- .../src/j5/threads/spawnedChildren.logic.ts | 136 --- packages/client-runtime/package.json | 8 + .../client-runtime/src/j5}/crewState.test.ts | 2 +- .../client-runtime/src/j5}/crewState.ts | 5 +- .../src/j5/spawnedChildren.test.ts | 220 +++++ .../client-runtime/src/j5/spawnedChildren.ts | 202 +++++ 22 files changed, 1343 insertions(+), 811 deletions(-) create mode 100644 apps/mobile/src/j5/crew/CaptainSeats.tsx create mode 100644 apps/mobile/src/j5/crew/spawnedChildren.ts delete mode 100644 apps/web/src/j5/threads/sidebarMembership.test.ts rename {apps/web/src/j5/crew => packages/client-runtime/src/j5}/crewState.test.ts (99%) rename {apps/web/src/j5/crew => packages/client-runtime/src/j5}/crewState.ts (97%) create mode 100644 packages/client-runtime/src/j5/spawnedChildren.test.ts create mode 100644 packages/client-runtime/src/j5/spawnedChildren.ts diff --git a/FORK.md b/FORK.md index 361bf0f548fa2..6432ebf0ba5ce 100644 --- a/FORK.md +++ b/FORK.md @@ -49,7 +49,7 @@ Mobile follows the same add-beside rule with a fixed seam set, decided on 2026-0 | ------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | | Timeline delegate | `features/threads/ThreadFeed.tsx` message rows | The A2A timeline's groups from the shared classifier, `packages/client-runtime/src/j5/userMessagePresentation.ts` (web case 7) | Landed: case 97. | | Queue-row formatter | `features/threads/ThreadQueueControl.tsx` | The sender line and the letter's first line for queued deliveries (web case 24) | Landed: case 97. | -| Thread-row identity | `features/threads/thread-list-v2-items.tsx` | Crew membership (web case 23) | Not landed. The row mounts only the persona's `AgentIdentityChip`, at upstream's title inset. | +| Thread-row identity | `features/threads/thread-list-v2-items.tsx` | Crew membership (web case 23) | Landed for spawned agents (case 115). The row also mounts the persona's `AgentIdentityChip`, at upstream's title inset. | | Route registration | `Stack.tsx` and the settings row targets | J5 screens such as Inbox, Fleet and Artifacts | Landed for Artifacts (case 98) and the Inbox (case 101): `Stack.tsx` spreads `j5ThreadArtifactRoutes` and `j5InboxRoutes`. Fleet is not landed. | | Link resolver | the thread feed's markdown link press (`features/threads/ThreadFeed.tsx`) | `artifacts/…` links open the artifact instead of a workspace file | Landed (case 98). | @@ -136,7 +136,7 @@ Landing-order collision: two cases landed as `15.`; resolved by the `b` suffix o 22. B4's typed confirmation presentation seam: `apps/web/src/confirmDialog.ts` extends only the in-memory `requestConfirmDialog(message, options, presentation?)` coordinator state with optional `ReactNode` content and `confirmLabel`; `apps/web/src/components/ConfirmDialogHost.tsx` renders the typed node and label when present and otherwise keeps its existing string title/description plus `Confirm` path. The host has no J5 import, payload decoding, or private prefix branch. J5 owns the archive row content in `apps/web/src/j5/a2a/ArchiveWarningContent.tsx`; `apps/web/src/j5/a2a/archiveFlow.ts` builds and passes it for consequential archive facts, with `Archive anyway` only when one or more open asks are measured and `Archive` otherwise. `apps/web/src/components/Sidebar.tsx` and `apps/web/src/hooks/useThreadActionMenu.ts` use the existing confirmation coordinator to carry the presentation. Existing string callers omit the third argument and remain byte-for-byte on the prior path. Jackson's Variant B title `Archive ?` supersedes the earlier Designer condition that put “anyway” in the question; the explicit button label now disambiguates the action. On every rebase, verify the host stays J5-agnostic, the absent-presentation string branch remains intact, and the two archive doors continue to pass J5-owned presentation only for fact-backed warnings. -23. The thread card's J5 identity, Crew chips and spawned children: `apps/web/src/components/sidebar/SidebarThreadRow.tsx`, the full-card row upstream moved out of `Sidebar.tsx`, imports and mounts J5-owned `apps/web/src/j5/threads/ThreadCardIdentity.tsx` in place of the project label, passing the thread id, its environment, upstream's own project display name and the persona assignment. The label is the project, as upstream shows it; J5 adds the persona chip, a seat chip on Crew members and the Captain mark on launchers (`apps/web/src/j5/crew/CrewMembershipsClient.ts` and `CaptainMark.tsx`, over the J5 RPC `j5.crews.listMemberships`, case 64). The list stays flat by recency and no grouping is introduced. The same card mounts J5-owned `apps/web/src/j5/threads/SpawnedChildren.tsx` immediately before its closing ``; since v0.1.7 the row has a second layout for upstream's project folders (the Labs "Boring sidebar"), which mounts `ThreadCardIdentity` and `SpawnedChildren` the same way, so the identity, the Crew chips and the expander show in both. `SpawnedChildren` renders a collapsed expander of the row's placed children from `SpawnedChildrenClient.ts` (`j5.fleet.listSpawnedChildren`); the nested rows are J5-rendered and never reuse the upstream card component. `Sidebar.tsx`'s `useSidebarThreads` calls J5-owned `useThreadRowReads` once with every thread shell, not only the listed rows, because a spawned child has no row of its own; it requests both reads. The row set is serialized once (`useKeyedThreadRefs`). Spawned children are not listed rows, so three more `Sidebar.tsx` edits make their rename and context menu work and must survive a sync: `renamingChildThreadKey`, the renaming thread key when it belongs to no listed row, passed down through `SidebarThreadRow`'s `renamingChildThreadKey` prop to `SpawnedChildren`; a fallback to upstream's `readThreadShell`, through which the context-menu callback finds a child when the listed rows do not hold it; and `childSection`, which classifies such a child as settled or snoozed from its own shell (`resolveSidebarThreadSection`) so the menu offers the right actions. Both per-thread stores (`createScopedThreadReadStore` in `packages/client-runtime/src/j5/scopedThreadReadStore.ts`, reached through the `./j5/scopedThreadReadStore` export this case adds to upstream-owned `packages/client-runtime/package.json`) keep an empty answer loaded so a reordered row set never re-reads it, keep the previous snapshot when a batch changes nothing so rows skip their render, and a Crew or Fleet change (case 64's change stream) re-reads only the rows the roster names as involved (`fleetInvolvedThreadRefs`: seats, their Captains, spawners with placed children), so those reads follow Crew activity rather than the length of the thread list (2026-09-17, after Jackson's review of PR #149). The expander's remembered expansion is keyed by environment, parent, and group. Sidebar membership (register D22) is decided in J5-owned `apps/web/src/j5/threads/sidebarMembership.ts` (`isSidebarMember`, applied in upstream's `partitionSidebarThreads` as one `.filter` on its `filterSidebarV2VisibleThreads` result). It is fed by `spawnedByAgent`, which the spawned-children read states from placement provenance for each requested row; `useSidebarThreads` reads it through one `useAgentSpawnedThreadKeys` call (`SpawnedChildrenClient.ts`) and passes it as `agentSpawnedThreadKeys`, one J5 field on `SidebarThreadPartitionInput`. Agent-spawned Peer Agents therefore leave the top level unless pinned. `Sidebar` makes a second `useAgentSpawnedThreadKeys` call so upstream's route reveal only finds threads with a row of their own (`sidebarRowThread` in its `findThread`); a pending reveal for a spawned thread would otherwise widen a project scope chosen later. The participant-homes read that used to carry this is removed. The Roster that keeps every agent visible is the J5-owned `/fleet` page over `j5.fleet.read`, which groups by upstream's logical project on the client. The existing tooltip remains the secondary detail for folder, machine, and model. The thin Sidebar integration must remain card-only: search and slim rows are byte-for-byte unchanged. +23. The thread card's J5 identity, Crew chips and spawned children: `apps/web/src/components/sidebar/SidebarThreadRow.tsx`, the full-card row upstream moved out of `Sidebar.tsx`, imports and mounts J5-owned `apps/web/src/j5/threads/ThreadCardIdentity.tsx` in place of the project label, passing the thread id, its environment, upstream's own project display name and the persona assignment. The label is the project, as upstream shows it; J5 adds the persona chip, a seat chip on Crew members and the Captain mark on launchers (`apps/web/src/j5/crew/CrewMembershipsClient.ts` and `CaptainMark.tsx`, over the J5 RPC `j5.crews.listMemberships`, case 64). The list stays flat by recency and no grouping is introduced. The same card mounts J5-owned `apps/web/src/j5/threads/SpawnedChildren.tsx` immediately before its closing ``; since v0.1.7 the row has a second layout for upstream's project folders (the Labs "Boring sidebar"), which mounts `ThreadCardIdentity` and `SpawnedChildren` the same way, so the identity, the Crew chips and the expander show in both. `SpawnedChildren` renders a collapsed expander of the row's placed children from `SpawnedChildrenClient.ts` (`j5.fleet.listSpawnedChildren`); the nested rows are J5-rendered and never reuse the upstream card component. `Sidebar.tsx`'s `useSidebarThreads` calls J5-owned `useThreadRowReads` once with every thread shell, not only the listed rows, because a spawned child has no row of its own; it requests both reads. The row set is serialized once (`useKeyedThreadRefs`). Spawned children are not listed rows, so three more `Sidebar.tsx` edits make their rename and context menu work and must survive a sync: `renamingChildThreadKey`, the renaming thread key when it belongs to no listed row, passed down through `SidebarThreadRow`'s `renamingChildThreadKey` prop to `SpawnedChildren`; a fallback to upstream's `readThreadShell`, through which the context-menu callback finds a child when the listed rows do not hold it; and `childSection`, which classifies such a child as settled or snoozed from its own shell (`resolveSidebarThreadSection`) so the menu offers the right actions. Both per-thread stores (`createScopedThreadReadStore` in `packages/client-runtime/src/j5/scopedThreadReadStore.ts`, reached through the `./j5/scopedThreadReadStore` export this case adds to upstream-owned `packages/client-runtime/package.json`) keep an empty answer loaded so a reordered row set never re-reads it, keep the previous snapshot when a batch changes nothing so rows skip their render, and a Crew or Fleet change (case 64's change stream) re-reads only the rows the roster names as involved (`fleetInvolvedThreadRefs`: seats, their Captains, spawners with placed children), so those reads follow Crew activity rather than the length of the thread list (2026-09-17, after Jackson's review of PR #149). The expander's remembered expansion is keyed by environment, parent, and group. Sidebar membership (register D22) is decided by `isSidebarMember` (shared with mobile from `packages/client-runtime/src/j5/spawnedChildren.ts`, case 115, and re-exported by J5-owned `apps/web/src/j5/threads/sidebarMembership.ts`, applied in upstream's `partitionSidebarThreads` as one `.filter` on its `filterSidebarV2VisibleThreads` result). It is fed by `spawnedByAgent`, which the spawned-children read states from placement provenance for each requested row; `useSidebarThreads` reads it through one `useAgentSpawnedThreadKeys` call (`SpawnedChildrenClient.ts`) and passes it as `agentSpawnedThreadKeys`, one J5 field on `SidebarThreadPartitionInput`. Agent-spawned Peer Agents therefore leave the top level unless pinned. `Sidebar` makes a second `useAgentSpawnedThreadKeys` call so upstream's route reveal only finds threads with a row of their own (`sidebarRowThread` in its `findThread`); a pending reveal for a spawned thread would otherwise widen a project scope chosen later. The participant-homes read that used to carry this is removed. The Roster that keeps every agent visible is the J5-owned `/fleet` page over `j5.fleet.read`, which groups by upstream's logical project on the client. The existing tooltip remains the secondary detail for folder, machine, and model. The thin Sidebar integration must remain card-only: search and slim rows are byte-for-byte unchanged. 24. N42/N62's single participant-identity rendering seam: `apps/web/src/components/chat/MessagesTimeline.tsx` imports only J5-owned identity helpers. `ConversationTimeline` collects the participant ids of the deliveries and spawn briefs among its entries (`participantIdsForThreadA2ADelivery`, `participantIdsForSpawnBrief`), reads them once with `useParticipantIdentities`, and puts the labels and the sender threads (local or on a peer, which make a sender's name open its thread) on `TimelineRowCtx`, whose type in `apps/web/src/components/chat/timelineRowContext.ts` gains `participantLabels` and `participantThreads`; case 7's row seam reads them there. The same component draws a Peer Agent's lineage: upstream's divider at the top of the thread, which says "Subagent of" for a delegated child, says "Spawned by" with the spawner's identity, and offers Open spawner thread when that thread is known, for a thread with no parent link whose first message is its spawner's brief (`presentSpawnBrief` in J5-owned `apps/web/src/j5/a2a/SpawnBrief.tsx`). `apps/web/src/components/chat/QueuedRunsControl.tsx` names a queued message's sender as the timeline does once it is sent (register D38, Jackson's decision 15 of 2026-11-05). Upstream's rows (Send now, edit, remove) are taken whole at v0.1.7, so people no longer reorder from the UI (decision 11; agents keep `queued-run.reorder` through `t3_queue`). One J5 hook over the queue's messages, `useJ5QueuedSenders` from J5-owned `apps/web/src/j5/a2a/QueuedSender.tsx`, reads them through the shared classifier (`packages/client-runtime/src/j5/userMessagePresentation.ts`) and the identity read. Each row's `j5Sender` gives upstream's folded row J5's presentation and the letter's text without its envelope, and `J5QueuedSenderLine` draws the participant's name with its Exchange badge or Automation or Outside agent tag (`J5SenderLine`, shared with the timeline from `ThreadA2ARenderer.tsx`). The row sits on the left (`items-start`) for anyone but the reader, as in the timeline, and on the right for the reader's own. J5's old `From : ` prefix is gone, so the name shows once, and upstream's own agent messages now name their sender above the row too. "Sent by T3 Code" reads `Sent by {APP_BASE_NAME}`. The reachability proof is the sole active-thread `ChatView` mounts: `apps/web/src/components/ChatView.tsx` mounts upstream's `ThreadTimeline`, which mounts `MessagesTimeline`, and mounts `QueuedRunsControl` only for a server thread. Both upstream files therefore reach J5-owned `ParticipantIdentitiesClient.ts`, `ParticipantIdentity.ts`, and `ThreadA2ARenderer.tsx`; generic timeline and queue text keep their byte-for-byte fallback. On every rebase, keep the one identity read where the timeline's entries are known and the sender hook in the queue, rather than embedding another renderer in either upstream component. The human-authored minimap filter is applied in upstream's `apps/web/src/components/chat/timelineMinimapItems.ts`, through J5-owned `isHumanAuthoredUserMessage` (`apps/web/src/j5/a2a/minimapMessages.ts`). @@ -551,6 +551,8 @@ migrations after upstream migrations. 114. Mobile roster review for a Captain's Crew proposal ([#836](https://github.com/Jacksondr5/j5code/issues/836), Jackson's decisions 1 and 2 of 2026-11-07/08: a phone approves, declines and removes seats, showing each seat's access; other edits stay on web). `apps/mobile/src/features/threads/ThreadDetailScreen.tsx` mounts J5-owned `J5ComposerControls` (`apps/mobile/src/j5/composer/`) beside case 49's `PlaybookComposerControl`, under the same conditions; every J5 row above the composer joins there, not as another seam. Its first row, `CrewRosterStrip` (`apps/mobile/src/j5/crew/`), shows one row per open, human-approved proposal for the thread and opens the `ThreadCrewProposal` screen, which case 98's `j5ThreadRoutes` spread registers. The gate filter, seat lines, playbook notes and preview binding live in `packages/client-runtime/src/j5/crewProposals.ts` (a new `./j5/crew-proposals` export in `packages/client-runtime/package.json`), shared with web's card; approval sends only the token from a complete preview of the seats on screen. +115. Mobile lists a spawner's agents under its row (register D22, the mobile half of case 23; [#836](https://github.com/Jacksondr5/j5code/issues/836) decisions 3 and 4). `apps/mobile/src/features/threads/useThreadListV2.ts` passes its threads through J5-owned `useCrewListedThreads` (`apps/mobile/src/j5/crew/spawnedChildren.ts`), which keeps the spawned-children read (`j5.fleet.listSpawnedChildren`) current for every listed thread and drops the threads an agent spawned unless they are pinned, so every list, shelf and reorder computed after it sees the same rows. Mobile has no Fleet roster to bound re-reads by, so a moved `crew` or `fleet` revision re-reads that server's listed rows in one batched read. `apps/mobile/src/features/threads/thread-list-v2-items.tsx` mounts J5-owned `CaptainSeatsToggle` (`apps/mobile/src/j5/crew/CaptainSeats.tsx`) inside the card row's bottom line, before the pull request badge, and inside the slim row before its time, so a collapsed spawner is no taller; and it mounts `CaptainSeats` after the row's swipeable, outside its long-press menu, handing it upstream's own `STATUS_LABEL_BY_STATUS` so seat rows read as rows do. The expanded seats show each Crew's summary, Stop crew while a seat is running, "Not started", and "Replaced by". The grouping, the membership rule and the Crew state labels moved from web to `packages/client-runtime/src/j5/spawnedChildren.ts` and `crewState.ts`, reached through the `./j5/spawned-children` and `./j5/crew-state` exports this case adds to `packages/client-runtime/package.json`. Its test mocks the hook as a passthrough, since the hook reads server connections. On a pin advance: keep the one wrap at the top of `useThreadListV2`, the toggle inside both row layouts, and the seats outside the swipeable. + ## Pin and upstream advance runbook Current pin: `322f6544dfad0a3c8a0c8cbecf2c7f7874b14268`, upstream's stable release tag `v0.1.7` on `main` (released 2026-11-04, frozen 2026-11-07). The previous pin was `d2c440312e5f39d59827ed466838a623516454d6`, upstream's stable release tag `v0.1.3`. @@ -723,395 +725,398 @@ supplies one of them. `R` means retained edit, `A` adapted prior edit, and `N` n upstream path. These history letters do not indicate approval. The deleted hook remains explicitly marked. -| Upstream-owned path | History | Contract | -| --------------------------------------------------------------------------- | ------- | -------------------------------------------------- | -| `.agents/skills/test-t3-app/SKILL.md` | N | 68 | -| `.github/SECURITY.md` (deleted) | N | B | -| `.github/workflows/ci.yml` | A | C | -| `.github/workflows/mobile-fingerprint-check.yml` | R | C | -| `.gitignore` | R | H | -| `apps/desktop/package.json` | R | B | -| `apps/desktop/resources/dmg/dmg-background-latest.svg` | R | B | -| `apps/desktop/resources/dmg/dmg-background-nightly.svg` | R | B | -| `apps/desktop/scripts/electron-launcher.mjs` | R | B, H | -| `apps/desktop/scripts/electron-launcher.test.mjs` | R | B, H | -| `apps/desktop/src/app/DesktopApp.ts` | N | B | -| `apps/desktop/src/app/DesktopAppIdentity.test.ts` | R | B | -| `apps/desktop/src/app/DesktopClerk.test.ts` | R | B, 76 | -| `apps/desktop/src/app/DesktopConfig.ts` | R | B, H | -| `apps/desktop/src/app/DesktopConnectionCatalogStore.test.ts` | R | B | -| `apps/desktop/src/app/DesktopPreReadyPlatform.test.ts` | N | B | -| `apps/desktop/src/app/DesktopEarlyElectronStartup.test.ts` | R | B, H | -| `apps/desktop/src/app/DesktopEarlyElectronStartup.ts` | R | B, H | -| `apps/desktop/src/app/DesktopEnvironment.test.ts` | R | B, H | -| `apps/desktop/src/app/DesktopEnvironment.ts` | R | B, H | -| `apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts` | R | B | -| `apps/desktop/src/app/DesktopObservability.test.ts` | R | B, H | -| `apps/desktop/src/app/DesktopStatePaths.ts` | R | B, H | -| `apps/desktop/src/backend/DesktopBackendConfiguration.test.ts` | R | B, H, 50 | -| `apps/desktop/src/backend/DesktopBackendConfiguration.ts` | R | B, H, 50 | -| `apps/desktop/src/backend/DesktopBackendManager.ts` | R | B, H | -| `apps/desktop/src/backend/DesktopServerExposure.test.ts` | R | B | -| `apps/desktop/src/electron/ElectronProtocol.ts` | R | B | -| `apps/desktop/src/settings/DesktopAppSettings.test.ts` | R | B, H | -| `apps/desktop/src/settings/DesktopClientSettings.test.ts` | R | B, H | -| `apps/desktop/src/settings/DesktopSavedEnvironments.test.ts` | R | B, H | -| `apps/desktop/src/updates/updatesTestHarness.ts` | N | B, H | -| `apps/desktop/src/window/DesktopWindow.test.ts` | R | B, H | -| `apps/desktop/src/wsl/DesktopWslEnvironment.test.ts` | N | 50 | -| `apps/desktop/src/wsl/DesktopWslEnvironment.ts` | N | 50 | -| `apps/desktop/src/wsl/DesktopWslServerTree.test.ts` | R | B | -| `apps/mobile/app.config.ts` | A | B | -| `apps/mobile/metro.config.js` | A | 113 | -| `apps/mobile/package.json` | A | B, 45 | -| `apps/mobile/src/features/threads/NewTaskDraftScreen.tsx` | A | 45, 90, 100, Saved-agent mentions | -| `apps/mobile/src/features/threads/ThreadDetailScreen.tsx` | A | 45, 49, 114 | -| `apps/mobile/src/features/threads/ThreadRouteScreen.tsx` | A | 69, 90, 99 | -| `apps/mobile/src/features/settings/SettingsRouteScreen.tsx` | A | 72, Role library, 105 | -| `apps/mobile/src/features/settings/components/SettingsScreen.tsx` | N | 72 | -| `apps/mobile/src/features/settings/settings-environment-filter.tsx` | N | 72 | -| `apps/mobile/src/Stack.tsx` | A | 72, 98, 101, 103, Role library, 105, 114 | -| `apps/mobile/src/features/home/ThreadListToolbar.tsx` | N | 102 | -| `apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx` | N | 102 | -| `apps/mobile/src/features/archive/ArchivedThreadsRouteScreen.tsx` | N | 72 | -| `apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx` | N | 90 | -| `apps/mobile/src/features/threads/ThreadFeed.tsx` | N | 90 | -| `apps/mobile/src/features/threads/NewTaskRouteScreen.tsx` | N | 90 | -| `apps/mobile/src/features/projects/AddProjectScreen.tsx` | N | 90 | -| `apps/mobile/src/lib/filePreview.test.ts` | N | 90 | -| `apps/mobile/src/features/projects/AddProjectScreen.test.ts` | N | 90 | -| `apps/mobile/src/features/threads/new-task-flow-provider.tsx` | A | 45, 90 | -| `apps/mobile/src/features/threads/use-composer-command-menu.ts` | A | 45, 49 | -| `apps/mobile/src/features/threads/use-composer-command-menu.test.ts` | A | 45, 49 | -| `apps/mobile/src/state/use-thread-composer-state.ts` | A | 45 | -| `apps/mobile/src/App.tsx` | R | B, 21, 70 | -| `apps/mobile/src/connection/runtime.ts` | N | 70 | -| `apps/mobile/src/features/connection/permissionUpdateNotice.ts` | N | 73 | -| `apps/mobile/src/features/connection/pairing.test.ts` | R | B | -| `apps/mobile/src/features/connection/pairing.ts` | R | B | -| `apps/mobile/src/widgets/AgentActivity.tsx` | R | B | -| `apps/server/package.json` | N | B | -| `apps/server/scripts/migrate-dev-db.test.ts` | R | H | -| `apps/server/scripts/migrate-dev-db.ts` | A | H | -| `apps/server/scripts/t3-sqlite-state.test.ts` | R | H | -| `apps/server/scripts/t3-sqlite-state.ts` | A | H | -| `apps/server/src/auth/EnvironmentAuth.ts` | N | 70 | -| `apps/server/src/auth/http.ts` | N | 70 | -| `apps/server/src/binCli.ts` | N | 35, 82, B | -| `apps/server/src/cli/app.test.ts` | N | H | -| `apps/server/src/cli/app.ts` | N | H | -| `apps/server/src/cli/config.test.ts` | A | H | -| `apps/server/src/cli/config.ts` | R | H | -| `apps/server/src/cli/pair.test.ts` | R | H, 79 | -| `apps/server/src/cli/auth.ts` | N | 79 | -| `apps/server/src/cli/pair.ts` | R | H, 79 | -| `apps/server/src/cli/server.ts` | N | B | -| `apps/server/src/cli/theme.test.ts` | N | H | -| `apps/server/src/cli/theme.ts` | N | H, B | -| `apps/server/src/cli/triage.ts` | N | H | -| `apps/server/src/cli/uninstall.ts` | N | 40, 52 | -| `apps/server/src/cli/update.ts` | N | 40, 53 | -| `apps/server/src/device/EasDeviceHost.test.ts` | N | B | -| `apps/server/src/device/EasDeviceHost.ts` | N | B | -| `apps/server/src/cloud/pinnedRuntime.test.ts` | N | 50 | -| `apps/server/src/cloud/pinnedRuntime.ts` | N | 50 | -| `apps/server/src/cloud/selfUpdate.test.ts` | N | 50 | -| `apps/server/src/cloud/servicePreflight.ts` | N | B, 50 | -| `apps/server/src/cloud/serviceProtocol.ts` | N | 50 | -| `apps/server/src/provider/Drivers/ClaudeSkills.test.ts` | N | 43 | -| `apps/server/src/provider/Drivers/ClaudeSkills.ts` | N | 42–44 | -| `apps/server/src/provider/ClaudeProvider.ts` | N | 43 | -| `apps/server/src/provider/CodexProvider.ts` | N | 43 | -| `apps/server/src/provider/ProviderRegistry.test.ts` | N | 42, 43 | -| `apps/server/src/provider/ProviderRegistry.ts` | N | 42, 43 | -| `apps/server/src/provider/providerMaintenanceRunner.test.ts` | N | 42 | -| `apps/server/src/provider/testUtils/providerRegistryMock.ts` | N | 42 | -| `apps/server/src/serverRuntimeStartup.ts` | N | 51 | -| `apps/server/src/serverSettings.test.ts` | N | 42 | -| `apps/server/src/serverSettings.ts` | N | 42 | -| `apps/server/src/serviceLauncher.test.ts` | N | 50, 85 | -| `apps/web/src/components/settings/settingsSearch.test.ts` | N | 43 | -| `apps/web/src/threadNotifications.ts` | N | 87, 108 | -| `apps/web/src/threadNotifications.test.ts` | N | 108 | -| `apps/web/src/components/settings/SettingsPanels.tsx` | N | 87, 108 | -| `apps/web/src/components/settings/settingsSearch.ts` | N | 42–44, 72, 77, 87, 92, 105, 108 | -| `apps/web/src/components/settings/SettingsSidebarNav.tsx` | N | 42, 72, 73 | -| `knip.jsonc` | N | 95 | -| `packages/client-runtime/src/state/runtime.test.ts` | N | 42 | -| `packages/client-runtime/src/state/threadWorkflows.ts` | N | 109 | -| `packages/client-runtime/src/state/threadWorkflows.test.ts` | N | 109 | -| `packages/contracts/src/auth.ts` | N | 35 | -| `packages/contracts/src/environmentHttp.ts` | N | 70 | -| `apps/server/src/cloud/bootService.test.ts` | A | H, 50 | -| `apps/server/src/cloud/bootService.ts` | A | H | -| `apps/server/src/environment/ServerEnvironment.test.ts` | N | 34, 48 | -| `apps/server/src/environment/ServerEnvironment.ts` | N | 34, 48 | -| `apps/server/src/environment/ServerEnvironmentLabel.ts` | N | 67 | -| `apps/server/src/httpCors.ts` | N | B | -| `apps/server/src/mcp/McpHttpServer.ts` | R | 2 | -| `apps/server/src/mcp/OrchestratorMcpService.ts` | A | Saved-agent mentions, 107 | -| `packages/contracts/src/previewAutomation.ts` | N | 74 | -| `apps/server/src/preview/ServerBrowserStream.ts` | N | Preview stream session invalidation (#798) | -| `apps/server/src/preview/ServerBrowserStream.test.ts` | N | Preview stream session invalidation (#798) | -| `apps/server/src/preview/ServerBrowser.test.ts` | N | 74 | -| `apps/server/src/preview/ServerBrowser.ts` | N | 74, B | -| `apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts` | A | 8, 47, Saved-agent mentions | -| `apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts` | N | 47, 89, Saved-agent mentions, Role library | -| `apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts` | A | 8, N, Saved-agent mentions | -| `apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts` | A | 8, 47, N, Saved-agent mentions, Role library | -| `packages/provider-core/src/server/ProviderAdapter.ts` | R | 47, 60, N, Role library | -| `packages/provider-core/src/server/orchestrationInstructions.ts` | N | 8, B | -| `packages/provider-pi/src/server/mcpExtensionSource.test.ts` | N | 8 | -| `apps/server/src/orchestration-v2/ProviderTurnControlService.test.ts` | N | 106 | -| `apps/server/src/orchestration-v2/ProviderTurnControlService.ts` | R | 26, 106 | -| `apps/server/src/orchestration-v2/ProviderTurnStartService.test.ts` | A | N, 106, Role library | -| `apps/server/src/orchestration-v2/ProviderTurnStartService.ts` | A | 30, N, 106 | -| `packages/contracts/src/orchestrationV2.ts` | N | 106 | -| `apps/server/src/orchestration-v2/RunFinalizationService.ts` | R | 30 | -| `apps/server/src/orchestration-v2/ThreadLaunchService.ts` | R | Saved-agent launch, 111 | -| `apps/server/src/orchestration-v2/runtimeLayer.test.ts` | R | 3 | -| `apps/server/src/orchestration-v2/ThreadSearch.ts` | N | 69, 91 | -| `apps/server/src/orchestration-v2/ThreadSearch.test.ts` | N | 69 | -| `apps/server/src/orchestration-v2/runtimeLayer.ts` | R | 5, 21, 26, 30, 38, 91, 106 | -| `apps/server/src/os-jank.ts` | R | H | -| `apps/server/src/persistence/Sqlite.ts` | A | 1, 31 | -| `apps/server/src/project/RepositoryIdentityResolver.test.ts` | N | gh default repository patch | -| `apps/server/src/project/RepositoryIdentityResolver.ts` | N | gh default repository patch | -| `apps/server/src/server.ts` | A | 5, 9, MCP idle connection patch, 53, 69, 70 | -| `apps/server/src/serviceLauncher.ts` | R | H, 50, 85 | -| `apps/server/src/storageCleanup.ts` | N | Git 2.56 gitfile patch | -| `apps/server/src/telemetry/AnalyticsService.ts` | N | B, 63, 86 | -| `apps/server/src/telemetry/FeatureUsage.ts` | N | 96 | -| `apps/server/src/testUtils/shardWeights.json` | N | 65 | -| `apps/server/src/ws.ts` | A | 37, 42, 58, 78, Role library, Saved-agent mentions | -| `apps/server/src/ws.ts` (the access gate and view) | N | 69 | -| `apps/web/index.html` | R | B | -| `apps/web/src/branding.ts` | R | B | -| `apps/web/src/commandPaletteBus.ts` | R | 42 | -| `packages/contracts/src/index.ts` | N | 42, 44 | -| `packages/contracts/src/rpc.ts` | A | 42, 44, 45, 64, 69 | -| `packages/contracts/src/clientRpcPermissions.ts` | N | 64 | -| `packages/client-runtime/src/rpc/client.ts` | A | 45, 64, 69, 73 | -| `apps/web/src/composer-logic.ts` | A | 45, 49 | -| `apps/server/src/auth/RpcAuthorization.ts` | A | 42, 44, 45, 64 | -| `apps/web/src/components/AppSidebarLayout.tsx` | N | 75 | -| `apps/web/src/components/ChatView.tsx` | A | 33, 45, 69, Role library, Saved-agent mentions | -| `apps/web/src/connection/runtime.ts` | N | 70 | -| `apps/web/src/environments/primary/auth.ts` | N | 70 | -| `apps/web/src/components/CommandPalette.tsx` | A | 42, 71, 75, 90, 34 | -| `apps/web/src/components/ConfirmDialogHost.tsx` | R | 22 | -| `apps/web/src/components/Sidebar.logic.test.ts` | R | 23 | -| `apps/web/src/components/Sidebar.tsx` | A | 21–23, 71, 73, 90 | -| `apps/web/src/components/chat/ChatComposer.tsx` | A | Saved-agent mentions, Role library, 45, 49, 73, 91 | -| `apps/web/src/components/chat/timelineMinimapItems.ts` | A | 24 | -| `apps/web/src/components/chat/MessagesTimeline.tsx` | A | 24, 80, 104 | -| `apps/web/src/components/chat/QueuedRunsControl.tsx` | A | 24, 80 | -| `apps/web/src/components/sidebar/SidebarChrome.tsx` | A | 6, 33, 75, B | -| `apps/web/src/onboarding/firstRun.ts` | N | 75 | -| `apps/web/src/confirmDialog.test.ts` | R | 22 | -| `apps/web/src/confirmDialog.ts` | R | 22 | -| `apps/web/src/contextMenuFallback.ts` | N | 71 | -| `apps/web/src/hooks/useThreadActionMenu.ts` | A | 21, 69, 71 | -| `apps/web/src/hooks/useThreadActionMenu.test.ts` | A | 71 | -| `apps/web/src/components/chat/ChatHeader.tsx` | N | 73, 90 | -| `apps/web/src/components/chat/ThreadDetailsPanel.tsx` | N | 73 | -| `apps/web/src/components/settings/SettingsScopeSentence.tsx` | N | 72 | -| `apps/web/src/components/settings/SettingsScopeContext.tsx` | N | 72 | -| `apps/web/src/components/settings/useAvailableSettingsSearchItems.ts` | N | 72 | -| `apps/web/src/components/settings/useSettingsProjectGroups.ts` | N | 72 | -| `apps/web/src/routes/_chat.settings.tsx` | N | 72 | -| `apps/web/src/components/GitActionsControl.tsx` | N | 90 | -| `apps/web/src/components/BranchToolbarBranchSelector.tsx` | N | 90 | -| `apps/web/src/lib/chatThreadActions.ts` | N | 90 | -| `apps/web/src/hooks/useScratchProject.ts` | N | 90 | -| `apps/web/src/components/chat/TimelineAssistantRows.tsx` | N | 90 | -| `apps/web/src/components/chat/ThreadRelationshipsControl.tsx` | N | 90 | -| `apps/web/src/components/chat/composerCommandKey.ts` | N | 91 | -| `apps/web/src/routes/welcome.tsx` | N | 73 | -| `apps/web/src/components/PermissionUpdateNotice.ts` | N | 73 | -| `apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx` | N | 80 | -| `apps/web/src/routes/pair.tsx` | N | 73 | -| `apps/web/src/routes/__root.tsx` | N | 71, 73 | -| `apps/web/src/routes/_chat.index.tsx` | R | B, 73 | -| `apps/web/src/shortcuts/chatRouteCommands.ts` | N | B | -| `apps/web/src/routeTree.gen.ts` | R | generated route registrations for 6/9 | -| `apps/web/src/components/onboarding/WelcomeWizard.tsx` | R | 39, B | -| `apps/web/tsconfig.json` | R | B | -| `packages/client-runtime/package.json` | R | 7, 23, 34, 45, 69, 70, 75, 101, 114, Role library | -| `packages/client-runtime/src/connection/compatibility.ts` | A | 56 | -| `packages/client-runtime/src/operations/commands.ts` | R | Saved-agent mentions | -| `packages/contracts/package.json` | N | 34 | -| `packages/contracts/src/environment.ts` | N | 34, 48 | -| `packages/contracts/src/server.test.ts` | N | 43 | -| `packages/contracts/src/server.ts` | N | 42, 43 | -| `packages/contracts/src/settings.test.ts` | N | 42 | -| `packages/contracts/src/settings.ts` | N | 42, B, 105, 107 | -| `packages/shared/package.json` | N | 43, 46, 49, 52 | -| `packages/shared/src/devHome.test.ts` | R | H | -| `packages/shared/src/paletteSearch.test.ts` | N | B | -| `apps/mobile/src/features/settings/environment-maintenance.test.ts` | N | 40 | -| `apps/server/src/provider/testing/ProviderInstanceRegistryLive.fixture.mjs` | N | 43 | -| `packages/provider-cursor/src/server/status.test.ts` | N | B | -| `apps/server/src/provider/CodexDeveloperInstructions.test.ts` | N | 8 | -| `apps/web/test/appScenarios.renders.tsx` | N | 80 | -| `apps/mobile/src/features/home/useThreadListActions.ts` | N | 21 | -| `apps/web/test/renderScenarios.renders.tsx` | N | 80 | -| `packages/shared/src/devHome.ts` | R | H | -| `packages/ssh/src/tunnel.ts` | R | H, 50 | -| `pnpm-lock.yaml` | N | 45 | -| `scripts/build-cli-archive.ts` | N | 50 | -| `scripts/build-desktop-artifact.test.ts` | A | B, S, 50 | -| `scripts/build-desktop-artifact.ts` | R | B, S, 50 | -| `scripts/check-changed.ts` | N | 93 | -| `scripts/dev-runner.test.ts` | R | H, 63, 83, 88 | -| `scripts/dev-runner.ts` | R | H, 63, 83, 88 | -| `scripts/export-android-icons.ts` | N | B | -| `scripts/install.ps1` | N | 40, 50 | -| `scripts/install.sh` | N | 40, 50, 52 | -| `scripts/smoke-cli-archive.ts` | N | 50 | -| `vite.config.ts` | R | H | -| `apps/web/src/composer-logic.test.ts` | N | 49 | -| `apps/web/src/components/chat/ComposerCommandMenu.tsx` | A | 49, Saved-agent mentions | -| `packages/shared/src/composerTrigger.ts` | A | 49, Saved-agent mentions | -| `packages/shared/src/composerInlineTokens.ts` | A | 49, Saved-agent mentions | -| `apps/mobile/src/features/threads/ComposerCommandPopover.tsx` | A | 49, Saved-agent mentions | -| `apps/mobile/src/features/threads/ThreadFeed.tsx` | N | 97, 98 | -| `apps/mobile/src/features/threads/ThreadQueueControl.tsx` | N | 97, 99 | -| `apps/mobile/src/lib/filePreview.test.ts` | N | 97, 99 | -| `apps/mobile/src/features/threads/thread-search-match.tsx` | N | 99 | -| `apps/mobile/src/features/threads/thread-work-log.tsx` | N | 99 | -| `apps/mobile/src/features/threads/ThreadComposer.tsx` | A | 49, 100, Role library, Saved-agent mentions | -| `apps/mobile/src/state/threadOutboxDelivery.ts` | A | Saved-agent mentions | -| `assets/dev/app-icon.icon/Assets/annotations.svg` | N | B | -| `assets/dev/app-icon.icon/Assets/text.svg` | N | B | -| `assets/dev/app-icon.icon/icon.json` | N | B | -| `assets/nightly/app-icon.icon/Assets/text.svg` | N | B | -| `assets/nightly/app-icon.icon/icon.json` | N | B | -| `assets/prod/app-icon.icon/Assets/text.svg` | N | B | -| `assets/prod/app-icon.icon/icon.json` | N | B | -| `.github/workflows/desktop-macos-preview-publish.yml` | N | C | -| `.github/workflows/mobile-eas-preview.yml` | N | C | -| `.github/workflows/thread-transfer-report.yml` | N | C | -| `.github/ISSUE_TEMPLATE/bug_report.yml` | N | J5 CI and packaging | -| `.github/ISSUE_TEMPLATE/config.yml` | N | J5 CI and packaging | -| `.github/workflows/desktop-macos-preview.yml` | N | C | -| `.github/workflows/issue-labels.yml` | N | C | -| `.github/workflows/mobile-showcase-screenshots.yml` | N | C | -| `.github/workflows/pr-size.yml` | N | J5 CI and packaging | -| `.github/workflows/web-preview.yml` | N | C | -| `.github/workflows/windows-tests.yml` | N | C | -| `apps/server/src/mcp/McpInvocationContext.ts` | N | 2, 33, B | -| `apps/desktop/src/app/DesktopAppIdentity.ts` | N | B | -| `apps/desktop/src/app/DesktopCliCommand.ts` | N | 57 | -| `apps/desktop/src/app/DesktopCliShim.ts` | N | 57, H | -| `apps/desktop/src/app/DesktopUserData.ts` | N | H | -| `apps/desktop/src/compileCache.ts` | N | H | -| `apps/server/src/cli/browser.ts` | N | H, B | -| `apps/server/src/cli/invocation.ts` | N | 40 | -| `apps/server/src/cli/trace.ts` | N | H | -| `apps/server/src/mcp/McpSessionRegistry.ts` | N | 33 | -| `apps/server/src/observability/RpcInstrumentation.ts` | N | 58 | -| `packages/provider-acp/src/server/adapter.ts` | N | B | -| `packages/provider-cursor/src/server/adapter.ts` | N | B | -| `packages/provider-opencode/src/server/v2/adapter.ts` | N | B | -| `packages/provider-opencode/src/server/adapter.ts` | N | N | -| `apps/server/src/orchestration-v2/Orchestrator.ts` | N | Role library, Saved-agent mentions, 106 | -| `apps/server/src/orchestration-v2/ProjectionStore.ts` | N | Role library | -| `apps/server/src/orchestration-v2/RuntimePolicy.ts` | N | 47, Role library | -| `apps/server/src/orchestration-v2/ThreadManagementService.ts` | N | 26 | -| `apps/server/src/provider/providerCompatibility.ts` | N | 59, B | -| `apps/server/src/scheduledTasks/ScheduledTaskService.ts` | N | 12 | -| `apps/web/src/components/ServerUpdateAction.tsx` | N | 40, B | -| `apps/web/src/components/settings/CliCommandSettingsRow.tsx` | N | 57 | -| `apps/web/src/components/settings/ConnectionsSettings.tsx` | N | 48, B | -| `apps/web/src/components/sidebar/mainAppLocation.ts` | N | 6, 33 | -| `apps/web/src/legalLinks.ts` | N | B | -| `apps/web/src/versionSkew.ts` | N | 40 | -| `packages/client-runtime/src/state/environmentHttpAuth.ts` | N | 34 | -| `packages/contracts/src/scheduledTask.ts` | N | 12 | -| `packages/shared/src/codexAuthHandoff.ts` | N | B | -| `packages/shared/src/git.ts` | N | B | -| `packages/shared/src/providerAuthReturnUrl.ts` | N | B | -| `apps/server/src/orchestration-v2/RestartContinuation.ts` | N | B | -| `apps/server/src/process/agentScope.ts` | N | 25 | -| `apps/server/src/serverOwnership.ts` | N | B, 25, 84 | -| `apps/web/src/components/chat/RightPanelSurfaceContent.tsx` | N | 33 | -| `apps/web/src/components/promptLinks/copyPromptLink.ts` | N | 76 | -| `apps/web/src/components/settings/MobileAppSettingsRow.tsx` | N | 77 | -| `packages/provider-core/src/server/subagentProjection.ts` | N | Role library | -| `packages/provider-cursor/src/server/accountUsage.ts` | N | B | -| `packages/provider-opencode/src/settings.ts` | N | B | -| `packages/shared/src/cliRelease.ts` | N | 40 | -| `packages/shared/src/promptLinks.test.ts` | N | 76 | -| `packages/shared/src/promptLinks.ts` | N | B, 76 | -| `packages/shared/src/projectSettings.test.ts` | N | 107 | -| `apps/web/src/components/chat/TimelineUserMessageRow.tsx` | N | 7, 80, B | -| `apps/web/src/components/chat/timelineRowContext.ts` | N | 24 | -| `apps/web/src/components/chat/TimelineWorkEntryRow.tsx` | N | 80 | -| `apps/web/src/components/chat/chatViewSend.ts` | N | 80 | -| `apps/web/src/components/chat/MarkdownFileLink.tsx` | N | 33 | -| `apps/web/src/components/ChatMarkdown.tsx` | N | 33 | -| `apps/web/src/components/RightPanelTabs.tsx` | N | 33, B | -| `apps/web/src/components/pullRequest/PullRequestsPage.tsx` | N | 33, B | -| `apps/web/src/components/sidebar/SidebarThreadRow.tsx` | N | 23, 94 | -| `apps/web/src/components/chat/useComposerSend.ts` | N | 19, 45, Saved-agent mentions | -| `apps/web/src/components/chat/useProposedPlanSend.ts` | N | 45 | -| `apps/web/src/components/chat/useComposerMenuItems.ts` | N | 49, Saved-agent mentions | -| `apps/web/src/components/chat/ComposerControlsBar.tsx` | N | Saved-agent mentions | -| `apps/web/src/components/desktopUpdate.logic.ts` | N | 40, B | -| `apps/server/src/serverRuntimeState.test.ts` | N | 84 | -| `apps/server/src/ws.test.ts` | N | 69, 78 | -| `apps/server/vite.config.ts` | N | 86 | -| `.github/workflows/stale-needs-more-info.yml` | N | C | -| `.github/workflows/relay-preview.yml` | N | C | -| `.github/workflows/relay-preview-cleanup.yml` | N | C | -| `apps/web/src/components/chat/MessagesTimeline.browser.test.tsx` | N | 7, 80 | -| `apps/web/src/components/chat/QueuedRunsControl.browser.test.tsx` | N | 80 | -| `apps/web/src/components/settings/ProjectSettingsPanel.browser.test.tsx` | N | 72 | -| `apps/web/src/components/chat/guestShareAvailability.ts` | N | 92 | -| `apps/web/src/components/settings/LabsSettingsPanel.tsx` | N | 92 | -| `apps/web/src/lib/bootError.ts` | N | B | -| `apps/web/src/lib/bootError.test.ts` | N | B | -| `packages/contracts/src/orchestratorMcp.ts` | N | B | -| `scripts/mobile-native-client.ts` | N | B | -| `packages/contracts/src/threadSearch.ts` | N | 94 | -| `apps/web/src/components/ThreadSearchMatch.tsx` | N | 94 | -| `apps/web/src/components/CommandPalette.logic.ts` | N | 94 | -| `apps/web/src/components/CommandPaletteThreadItems.tsx` | N | 94 | -| `.github/workflows/agent-context-budget.yml` | N | C, 110 | -| `.github/workflows/mobile-eas-preview-fork.yml` | N | C | -| `.github/workflows/mobile-fingerprint-label.yml` | N | C | -| `apps/server/src/provider/AgentContextBudget.test.ts` | N | 110 | -| `apps/server/src/provider/agentContextBudget.json` | N | 110 | -| `apps/server/src/mcp/McpToolAccess.ts` | N | 2 | -| `packages/shared/src/threadLinks.ts` | N | 76 | -| `apps/web/src/components/settings/settingsLayout.tsx` | N | 112 | -| `apps/web/src/components/settings/LinkedEnvironmentsSettings.tsx` | N | 112 | -| `apps/server/src/mcp/toolkits/project/handlers.test.ts` | N | 76, 111 | -| `apps/server/src/mcp/toolkits/project/handlers.ts` | N | 111 | -| `packages/shared/src/threadLinks.test.ts` | N | 76 | -| `apps/mobile/app.config.test.ts` | N | B, 76 | -| `apps/web/public/.well-known/apple-app-site-association.json` | N | B, 76 | -| `apps/web/public/.well-known/assetlinks.json` | N | B, 76 | -| `apps/web/src/components/chat/threadDetailsItems.ts` | N | 73 | -| `apps/web/src/components/sidebar/SidebarProjectFolderHeader.tsx` | N | 90 | -| `apps/mobile/src/features/threads/new-task-flow-provider.test.tsx` | N | 90 | -| `apps/web/src/components/CommandPalette.composition.browser.test.tsx` | N | 90 | -| `apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx` | N | 90 | -| `apps/web/src/components/onboarding/WelcomeWizard.import.browser.test.tsx` | N | 39 | -| `packages/provider-core/src/server/orchestrationInstructions.test.ts` | N | B, 8 | -| `apps/server/src/cli/up.ts` | N | B, 79 | -| `apps/server/src/cliCompileCache.ts` | N | B, H | -| `packages/shared/src/managedPolicyFile.ts` | N | B | -| `apps/server/src/policy/policyTemplates.ts` | N | B | -| `apps/server/src/cli/policy.ts` | N | B | -| `apps/server/src/cloud/serviceProtection.ts` | N | B | -| `apps/desktop/src/app/DesktopStartupRecovery.ts` | N | B | -| `apps/server/src/triage/TriageService.ts` | N | B | -| `apps/server/src/triage/triagePrompt.ts` | N | B | -| `apps/web/src/components/GitHubStarPrompt.tsx` | N | B | -| `apps/web/src/components/GitHubStarPrompt.test.ts` | N | B | -| `apps/web/src/components/ui/standalone-page.tsx` | N | B | +| Upstream-owned path | History | Contract | +| --------------------------------------------------------------------------- | ------- | ------------------------------------------------------ | +| `.agents/skills/test-t3-app/SKILL.md` | N | 68 | +| `.github/SECURITY.md` (deleted) | N | B | +| `.github/workflows/ci.yml` | A | C | +| `.github/workflows/mobile-fingerprint-check.yml` | R | C | +| `.gitignore` | R | H | +| `apps/desktop/package.json` | R | B | +| `apps/desktop/resources/dmg/dmg-background-latest.svg` | R | B | +| `apps/desktop/resources/dmg/dmg-background-nightly.svg` | R | B | +| `apps/desktop/scripts/electron-launcher.mjs` | R | B, H | +| `apps/desktop/scripts/electron-launcher.test.mjs` | R | B, H | +| `apps/desktop/src/app/DesktopApp.ts` | N | B | +| `apps/desktop/src/app/DesktopAppIdentity.test.ts` | R | B | +| `apps/desktop/src/app/DesktopClerk.test.ts` | R | B, 76 | +| `apps/desktop/src/app/DesktopConfig.ts` | R | B, H | +| `apps/desktop/src/app/DesktopConnectionCatalogStore.test.ts` | R | B | +| `apps/desktop/src/app/DesktopPreReadyPlatform.test.ts` | N | B | +| `apps/desktop/src/app/DesktopEarlyElectronStartup.test.ts` | R | B, H | +| `apps/desktop/src/app/DesktopEarlyElectronStartup.ts` | R | B, H | +| `apps/desktop/src/app/DesktopEnvironment.test.ts` | R | B, H | +| `apps/desktop/src/app/DesktopEnvironment.ts` | R | B, H | +| `apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts` | R | B | +| `apps/desktop/src/app/DesktopObservability.test.ts` | R | B, H | +| `apps/desktop/src/app/DesktopStatePaths.ts` | R | B, H | +| `apps/desktop/src/backend/DesktopBackendConfiguration.test.ts` | R | B, H, 50 | +| `apps/desktop/src/backend/DesktopBackendConfiguration.ts` | R | B, H, 50 | +| `apps/desktop/src/backend/DesktopBackendManager.ts` | R | B, H | +| `apps/desktop/src/backend/DesktopServerExposure.test.ts` | R | B | +| `apps/desktop/src/electron/ElectronProtocol.ts` | R | B | +| `apps/desktop/src/settings/DesktopAppSettings.test.ts` | R | B, H | +| `apps/desktop/src/settings/DesktopClientSettings.test.ts` | R | B, H | +| `apps/desktop/src/settings/DesktopSavedEnvironments.test.ts` | R | B, H | +| `apps/desktop/src/updates/updatesTestHarness.ts` | N | B, H | +| `apps/desktop/src/window/DesktopWindow.test.ts` | R | B, H | +| `apps/desktop/src/wsl/DesktopWslEnvironment.test.ts` | N | 50 | +| `apps/desktop/src/wsl/DesktopWslEnvironment.ts` | N | 50 | +| `apps/desktop/src/wsl/DesktopWslServerTree.test.ts` | R | B | +| `apps/mobile/app.config.ts` | A | B | +| `apps/mobile/metro.config.js` | A | 113 | +| `apps/mobile/package.json` | A | B, 45 | +| `apps/mobile/src/features/threads/NewTaskDraftScreen.tsx` | A | 45, 90, 100, Saved-agent mentions | +| `apps/mobile/src/features/threads/ThreadDetailScreen.tsx` | A | 45, 49, 114 | +| `apps/mobile/src/features/threads/ThreadRouteScreen.tsx` | A | 69, 90, 99 | +| `apps/mobile/src/features/settings/SettingsRouteScreen.tsx` | A | 72, Role library, 105 | +| `apps/mobile/src/features/settings/components/SettingsScreen.tsx` | N | 72 | +| `apps/mobile/src/features/settings/settings-environment-filter.tsx` | N | 72 | +| `apps/mobile/src/Stack.tsx` | A | 72, 98, 101, 103, Role library, 105, 114 | +| `apps/mobile/src/features/home/ThreadListToolbar.tsx` | N | 102 | +| `apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx` | N | 102 | +| `apps/mobile/src/features/archive/ArchivedThreadsRouteScreen.tsx` | N | 72 | +| `apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx` | N | 90 | +| `apps/mobile/src/features/threads/ThreadFeed.tsx` | N | 90 | +| `apps/mobile/src/features/threads/NewTaskRouteScreen.tsx` | N | 90 | +| `apps/mobile/src/features/projects/AddProjectScreen.tsx` | N | 90 | +| `apps/mobile/src/lib/filePreview.test.ts` | N | 90 | +| `apps/mobile/src/features/projects/AddProjectScreen.test.ts` | N | 90 | +| `apps/mobile/src/features/threads/new-task-flow-provider.tsx` | A | 45, 90 | +| `apps/mobile/src/features/threads/use-composer-command-menu.ts` | A | 45, 49 | +| `apps/mobile/src/features/threads/use-composer-command-menu.test.ts` | A | 45, 49 | +| `apps/mobile/src/state/use-thread-composer-state.ts` | A | 45 | +| `apps/mobile/src/App.tsx` | R | B, 21, 70 | +| `apps/mobile/src/connection/runtime.ts` | N | 70 | +| `apps/mobile/src/features/connection/permissionUpdateNotice.ts` | N | 73 | +| `apps/mobile/src/features/connection/pairing.test.ts` | R | B | +| `apps/mobile/src/features/connection/pairing.ts` | R | B | +| `apps/mobile/src/widgets/AgentActivity.tsx` | R | B | +| `apps/server/package.json` | N | B | +| `apps/server/scripts/migrate-dev-db.test.ts` | R | H | +| `apps/server/scripts/migrate-dev-db.ts` | A | H | +| `apps/server/scripts/t3-sqlite-state.test.ts` | R | H | +| `apps/server/scripts/t3-sqlite-state.ts` | A | H | +| `apps/server/src/auth/EnvironmentAuth.ts` | N | 70 | +| `apps/server/src/auth/http.ts` | N | 70 | +| `apps/server/src/binCli.ts` | N | 35, 82, B | +| `apps/server/src/cli/app.test.ts` | N | H | +| `apps/server/src/cli/app.ts` | N | H | +| `apps/server/src/cli/config.test.ts` | A | H | +| `apps/server/src/cli/config.ts` | R | H | +| `apps/server/src/cli/pair.test.ts` | R | H, 79 | +| `apps/server/src/cli/auth.ts` | N | 79 | +| `apps/server/src/cli/pair.ts` | R | H, 79 | +| `apps/server/src/cli/server.ts` | N | B | +| `apps/server/src/cli/theme.test.ts` | N | H | +| `apps/server/src/cli/theme.ts` | N | H, B | +| `apps/server/src/cli/triage.ts` | N | H | +| `apps/server/src/cli/uninstall.ts` | N | 40, 52 | +| `apps/server/src/cli/update.ts` | N | 40, 53 | +| `apps/server/src/device/EasDeviceHost.test.ts` | N | B | +| `apps/server/src/device/EasDeviceHost.ts` | N | B | +| `apps/server/src/cloud/pinnedRuntime.test.ts` | N | 50 | +| `apps/server/src/cloud/pinnedRuntime.ts` | N | 50 | +| `apps/server/src/cloud/selfUpdate.test.ts` | N | 50 | +| `apps/server/src/cloud/servicePreflight.ts` | N | B, 50 | +| `apps/server/src/cloud/serviceProtocol.ts` | N | 50 | +| `apps/server/src/provider/Drivers/ClaudeSkills.test.ts` | N | 43 | +| `apps/server/src/provider/Drivers/ClaudeSkills.ts` | N | 42–44 | +| `apps/server/src/provider/ClaudeProvider.ts` | N | 43 | +| `apps/server/src/provider/CodexProvider.ts` | N | 43 | +| `apps/server/src/provider/ProviderRegistry.test.ts` | N | 42, 43 | +| `apps/server/src/provider/ProviderRegistry.ts` | N | 42, 43 | +| `apps/server/src/provider/providerMaintenanceRunner.test.ts` | N | 42 | +| `apps/server/src/provider/testUtils/providerRegistryMock.ts` | N | 42 | +| `apps/server/src/serverRuntimeStartup.ts` | N | 51 | +| `apps/server/src/serverSettings.test.ts` | N | 42 | +| `apps/server/src/serverSettings.ts` | N | 42 | +| `apps/server/src/serviceLauncher.test.ts` | N | 50, 85 | +| `apps/web/src/components/settings/settingsSearch.test.ts` | N | 43 | +| `apps/web/src/threadNotifications.ts` | N | 87, 108 | +| `apps/web/src/threadNotifications.test.ts` | N | 108 | +| `apps/web/src/components/settings/SettingsPanels.tsx` | N | 87, 108 | +| `apps/web/src/components/settings/settingsSearch.ts` | N | 42–44, 72, 77, 87, 92, 105, 108 | +| `apps/web/src/components/settings/SettingsSidebarNav.tsx` | N | 42, 72, 73 | +| `knip.jsonc` | N | 95 | +| `packages/client-runtime/src/state/runtime.test.ts` | N | 42 | +| `packages/client-runtime/src/state/threadWorkflows.ts` | N | 109 | +| `packages/client-runtime/src/state/threadWorkflows.test.ts` | N | 109 | +| `packages/contracts/src/auth.ts` | N | 35 | +| `packages/contracts/src/environmentHttp.ts` | N | 70 | +| `apps/server/src/cloud/bootService.test.ts` | A | H, 50 | +| `apps/server/src/cloud/bootService.ts` | A | H | +| `apps/server/src/environment/ServerEnvironment.test.ts` | N | 34, 48 | +| `apps/server/src/environment/ServerEnvironment.ts` | N | 34, 48 | +| `apps/server/src/environment/ServerEnvironmentLabel.ts` | N | 67 | +| `apps/server/src/httpCors.ts` | N | B | +| `apps/server/src/mcp/McpHttpServer.ts` | R | 2 | +| `apps/server/src/mcp/OrchestratorMcpService.ts` | A | Saved-agent mentions, 107 | +| `packages/contracts/src/previewAutomation.ts` | N | 74 | +| `apps/server/src/preview/ServerBrowserStream.ts` | N | Preview stream session invalidation (#798) | +| `apps/server/src/preview/ServerBrowserStream.test.ts` | N | Preview stream session invalidation (#798) | +| `apps/server/src/preview/ServerBrowser.test.ts` | N | 74 | +| `apps/server/src/preview/ServerBrowser.ts` | N | 74, B | +| `apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts` | A | 8, 47, Saved-agent mentions | +| `apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts` | N | 47, 89, Saved-agent mentions, Role library | +| `apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts` | A | 8, N, Saved-agent mentions | +| `apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts` | A | 8, 47, N, Saved-agent mentions, Role library | +| `packages/provider-core/src/server/ProviderAdapter.ts` | R | 47, 60, N, Role library | +| `packages/provider-core/src/server/orchestrationInstructions.ts` | N | 8, B | +| `packages/provider-pi/src/server/mcpExtensionSource.test.ts` | N | 8 | +| `apps/server/src/orchestration-v2/ProviderTurnControlService.test.ts` | N | 106 | +| `apps/server/src/orchestration-v2/ProviderTurnControlService.ts` | R | 26, 106 | +| `apps/server/src/orchestration-v2/ProviderTurnStartService.test.ts` | A | N, 106, Role library | +| `apps/server/src/orchestration-v2/ProviderTurnStartService.ts` | A | 30, N, 106 | +| `packages/contracts/src/orchestrationV2.ts` | N | 106 | +| `apps/server/src/orchestration-v2/RunFinalizationService.ts` | R | 30 | +| `apps/server/src/orchestration-v2/ThreadLaunchService.ts` | R | Saved-agent launch, 111 | +| `apps/server/src/orchestration-v2/runtimeLayer.test.ts` | R | 3 | +| `apps/server/src/orchestration-v2/ThreadSearch.ts` | N | 69, 91 | +| `apps/server/src/orchestration-v2/ThreadSearch.test.ts` | N | 69 | +| `apps/server/src/orchestration-v2/runtimeLayer.ts` | R | 5, 21, 26, 30, 38, 91, 106 | +| `apps/server/src/os-jank.ts` | R | H | +| `apps/server/src/persistence/Sqlite.ts` | A | 1, 31 | +| `apps/server/src/project/RepositoryIdentityResolver.test.ts` | N | gh default repository patch | +| `apps/server/src/project/RepositoryIdentityResolver.ts` | N | gh default repository patch | +| `apps/server/src/server.ts` | A | 5, 9, MCP idle connection patch, 53, 69, 70 | +| `apps/server/src/serviceLauncher.ts` | R | H, 50, 85 | +| `apps/server/src/storageCleanup.ts` | N | Git 2.56 gitfile patch | +| `apps/server/src/telemetry/AnalyticsService.ts` | N | B, 63, 86 | +| `apps/server/src/telemetry/FeatureUsage.ts` | N | 96 | +| `apps/server/src/testUtils/shardWeights.json` | N | 65 | +| `apps/server/src/ws.ts` | A | 37, 42, 58, 78, Role library, Saved-agent mentions | +| `apps/server/src/ws.ts` (the access gate and view) | N | 69 | +| `apps/web/index.html` | R | B | +| `apps/web/src/branding.ts` | R | B | +| `apps/web/src/commandPaletteBus.ts` | R | 42 | +| `packages/contracts/src/index.ts` | N | 42, 44 | +| `packages/contracts/src/rpc.ts` | A | 42, 44, 45, 64, 69 | +| `packages/contracts/src/clientRpcPermissions.ts` | N | 64 | +| `packages/client-runtime/src/rpc/client.ts` | A | 45, 64, 69, 73 | +| `apps/web/src/composer-logic.ts` | A | 45, 49 | +| `apps/server/src/auth/RpcAuthorization.ts` | A | 42, 44, 45, 64 | +| `apps/web/src/components/AppSidebarLayout.tsx` | N | 75 | +| `apps/web/src/components/ChatView.tsx` | A | 33, 45, 69, Role library, Saved-agent mentions | +| `apps/web/src/connection/runtime.ts` | N | 70 | +| `apps/web/src/environments/primary/auth.ts` | N | 70 | +| `apps/web/src/components/CommandPalette.tsx` | A | 42, 71, 75, 90, 34 | +| `apps/web/src/components/ConfirmDialogHost.tsx` | R | 22 | +| `apps/web/src/components/Sidebar.logic.test.ts` | R | 23 | +| `apps/web/src/components/Sidebar.tsx` | A | 21–23, 71, 73, 90 | +| `apps/web/src/components/chat/ChatComposer.tsx` | A | Saved-agent mentions, Role library, 45, 49, 73, 91 | +| `apps/web/src/components/chat/timelineMinimapItems.ts` | A | 24 | +| `apps/web/src/components/chat/MessagesTimeline.tsx` | A | 24, 80, 104 | +| `apps/web/src/components/chat/QueuedRunsControl.tsx` | A | 24, 80 | +| `apps/web/src/components/sidebar/SidebarChrome.tsx` | A | 6, 33, 75, B | +| `apps/web/src/onboarding/firstRun.ts` | N | 75 | +| `apps/web/src/confirmDialog.test.ts` | R | 22 | +| `apps/web/src/confirmDialog.ts` | R | 22 | +| `apps/web/src/contextMenuFallback.ts` | N | 71 | +| `apps/web/src/hooks/useThreadActionMenu.ts` | A | 21, 69, 71 | +| `apps/web/src/hooks/useThreadActionMenu.test.ts` | A | 71 | +| `apps/web/src/components/chat/ChatHeader.tsx` | N | 73, 90 | +| `apps/web/src/components/chat/ThreadDetailsPanel.tsx` | N | 73 | +| `apps/web/src/components/settings/SettingsScopeSentence.tsx` | N | 72 | +| `apps/web/src/components/settings/SettingsScopeContext.tsx` | N | 72 | +| `apps/web/src/components/settings/useAvailableSettingsSearchItems.ts` | N | 72 | +| `apps/web/src/components/settings/useSettingsProjectGroups.ts` | N | 72 | +| `apps/web/src/routes/_chat.settings.tsx` | N | 72 | +| `apps/web/src/components/GitActionsControl.tsx` | N | 90 | +| `apps/web/src/components/BranchToolbarBranchSelector.tsx` | N | 90 | +| `apps/web/src/lib/chatThreadActions.ts` | N | 90 | +| `apps/web/src/hooks/useScratchProject.ts` | N | 90 | +| `apps/web/src/components/chat/TimelineAssistantRows.tsx` | N | 90 | +| `apps/web/src/components/chat/ThreadRelationshipsControl.tsx` | N | 90 | +| `apps/web/src/components/chat/composerCommandKey.ts` | N | 91 | +| `apps/web/src/routes/welcome.tsx` | N | 73 | +| `apps/web/src/components/PermissionUpdateNotice.ts` | N | 73 | +| `apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx` | N | 80 | +| `apps/web/src/routes/pair.tsx` | N | 73 | +| `apps/web/src/routes/__root.tsx` | N | 71, 73 | +| `apps/web/src/routes/_chat.index.tsx` | R | B, 73 | +| `apps/web/src/shortcuts/chatRouteCommands.ts` | N | B | +| `apps/web/src/routeTree.gen.ts` | R | generated route registrations for 6/9 | +| `apps/web/src/components/onboarding/WelcomeWizard.tsx` | R | 39, B | +| `apps/web/tsconfig.json` | R | B | +| `packages/client-runtime/package.json` | R | 7, 23, 34, 45, 69, 70, 75, 101, 114, 115, Role library | +| `packages/client-runtime/src/connection/compatibility.ts` | A | 56 | +| `packages/client-runtime/src/operations/commands.ts` | R | Saved-agent mentions | +| `packages/contracts/package.json` | N | 34 | +| `packages/contracts/src/environment.ts` | N | 34, 48 | +| `packages/contracts/src/server.test.ts` | N | 43 | +| `packages/contracts/src/server.ts` | N | 42, 43 | +| `packages/contracts/src/settings.test.ts` | N | 42 | +| `packages/contracts/src/settings.ts` | N | 42, B, 105, 107 | +| `packages/shared/package.json` | N | 43, 46, 49, 52 | +| `packages/shared/src/devHome.test.ts` | R | H | +| `packages/shared/src/paletteSearch.test.ts` | N | B | +| `apps/mobile/src/features/settings/environment-maintenance.test.ts` | N | 40 | +| `apps/server/src/provider/testing/ProviderInstanceRegistryLive.fixture.mjs` | N | 43 | +| `packages/provider-cursor/src/server/status.test.ts` | N | B | +| `apps/server/src/provider/CodexDeveloperInstructions.test.ts` | N | 8 | +| `apps/web/test/appScenarios.renders.tsx` | N | 80 | +| `apps/mobile/src/features/home/useThreadListActions.ts` | N | 21 | +| `apps/web/test/renderScenarios.renders.tsx` | N | 80 | +| `packages/shared/src/devHome.ts` | R | H | +| `packages/ssh/src/tunnel.ts` | R | H, 50 | +| `pnpm-lock.yaml` | N | 45 | +| `scripts/build-cli-archive.ts` | N | 50 | +| `scripts/build-desktop-artifact.test.ts` | A | B, S, 50 | +| `scripts/build-desktop-artifact.ts` | R | B, S, 50 | +| `scripts/check-changed.ts` | N | 93 | +| `scripts/dev-runner.test.ts` | R | H, 63, 83, 88 | +| `scripts/dev-runner.ts` | R | H, 63, 83, 88 | +| `scripts/export-android-icons.ts` | N | B | +| `scripts/install.ps1` | N | 40, 50 | +| `scripts/install.sh` | N | 40, 50, 52 | +| `scripts/smoke-cli-archive.ts` | N | 50 | +| `vite.config.ts` | R | H | +| `apps/web/src/composer-logic.test.ts` | N | 49 | +| `apps/web/src/components/chat/ComposerCommandMenu.tsx` | A | 49, Saved-agent mentions | +| `packages/shared/src/composerTrigger.ts` | A | 49, Saved-agent mentions | +| `packages/shared/src/composerInlineTokens.ts` | A | 49, Saved-agent mentions | +| `apps/mobile/src/features/threads/ComposerCommandPopover.tsx` | A | 49, Saved-agent mentions | +| `apps/mobile/src/features/threads/ThreadFeed.tsx` | N | 97, 98 | +| `apps/mobile/src/features/threads/ThreadQueueControl.tsx` | N | 97, 99 | +| `apps/mobile/src/lib/filePreview.test.ts` | N | 97, 99 | +| `apps/mobile/src/features/threads/thread-search-match.tsx` | N | 99 | +| `apps/mobile/src/features/threads/thread-work-log.tsx` | N | 99 | +| `apps/mobile/src/features/threads/thread-list-v2-items.tsx` | N | 115 | +| `apps/mobile/src/features/threads/useThreadListV2.ts` | N | 115 | +| `apps/mobile/src/features/threads/useThreadListV2.test.tsx` | N | 115 | +| `apps/mobile/src/features/threads/ThreadComposer.tsx` | A | 49, 100, Role library, Saved-agent mentions | +| `apps/mobile/src/state/threadOutboxDelivery.ts` | A | Saved-agent mentions | +| `assets/dev/app-icon.icon/Assets/annotations.svg` | N | B | +| `assets/dev/app-icon.icon/Assets/text.svg` | N | B | +| `assets/dev/app-icon.icon/icon.json` | N | B | +| `assets/nightly/app-icon.icon/Assets/text.svg` | N | B | +| `assets/nightly/app-icon.icon/icon.json` | N | B | +| `assets/prod/app-icon.icon/Assets/text.svg` | N | B | +| `assets/prod/app-icon.icon/icon.json` | N | B | +| `.github/workflows/desktop-macos-preview-publish.yml` | N | C | +| `.github/workflows/mobile-eas-preview.yml` | N | C | +| `.github/workflows/thread-transfer-report.yml` | N | C | +| `.github/ISSUE_TEMPLATE/bug_report.yml` | N | J5 CI and packaging | +| `.github/ISSUE_TEMPLATE/config.yml` | N | J5 CI and packaging | +| `.github/workflows/desktop-macos-preview.yml` | N | C | +| `.github/workflows/issue-labels.yml` | N | C | +| `.github/workflows/mobile-showcase-screenshots.yml` | N | C | +| `.github/workflows/pr-size.yml` | N | J5 CI and packaging | +| `.github/workflows/web-preview.yml` | N | C | +| `.github/workflows/windows-tests.yml` | N | C | +| `apps/server/src/mcp/McpInvocationContext.ts` | N | 2, 33, B | +| `apps/desktop/src/app/DesktopAppIdentity.ts` | N | B | +| `apps/desktop/src/app/DesktopCliCommand.ts` | N | 57 | +| `apps/desktop/src/app/DesktopCliShim.ts` | N | 57, H | +| `apps/desktop/src/app/DesktopUserData.ts` | N | H | +| `apps/desktop/src/compileCache.ts` | N | H | +| `apps/server/src/cli/browser.ts` | N | H, B | +| `apps/server/src/cli/invocation.ts` | N | 40 | +| `apps/server/src/cli/trace.ts` | N | H | +| `apps/server/src/mcp/McpSessionRegistry.ts` | N | 33 | +| `apps/server/src/observability/RpcInstrumentation.ts` | N | 58 | +| `packages/provider-acp/src/server/adapter.ts` | N | B | +| `packages/provider-cursor/src/server/adapter.ts` | N | B | +| `packages/provider-opencode/src/server/v2/adapter.ts` | N | B | +| `packages/provider-opencode/src/server/adapter.ts` | N | N | +| `apps/server/src/orchestration-v2/Orchestrator.ts` | N | Role library, Saved-agent mentions, 106 | +| `apps/server/src/orchestration-v2/ProjectionStore.ts` | N | Role library | +| `apps/server/src/orchestration-v2/RuntimePolicy.ts` | N | 47, Role library | +| `apps/server/src/orchestration-v2/ThreadManagementService.ts` | N | 26 | +| `apps/server/src/provider/providerCompatibility.ts` | N | 59, B | +| `apps/server/src/scheduledTasks/ScheduledTaskService.ts` | N | 12 | +| `apps/web/src/components/ServerUpdateAction.tsx` | N | 40, B | +| `apps/web/src/components/settings/CliCommandSettingsRow.tsx` | N | 57 | +| `apps/web/src/components/settings/ConnectionsSettings.tsx` | N | 48, B | +| `apps/web/src/components/sidebar/mainAppLocation.ts` | N | 6, 33 | +| `apps/web/src/legalLinks.ts` | N | B | +| `apps/web/src/versionSkew.ts` | N | 40 | +| `packages/client-runtime/src/state/environmentHttpAuth.ts` | N | 34 | +| `packages/contracts/src/scheduledTask.ts` | N | 12 | +| `packages/shared/src/codexAuthHandoff.ts` | N | B | +| `packages/shared/src/git.ts` | N | B | +| `packages/shared/src/providerAuthReturnUrl.ts` | N | B | +| `apps/server/src/orchestration-v2/RestartContinuation.ts` | N | B | +| `apps/server/src/process/agentScope.ts` | N | 25 | +| `apps/server/src/serverOwnership.ts` | N | B, 25, 84 | +| `apps/web/src/components/chat/RightPanelSurfaceContent.tsx` | N | 33 | +| `apps/web/src/components/promptLinks/copyPromptLink.ts` | N | 76 | +| `apps/web/src/components/settings/MobileAppSettingsRow.tsx` | N | 77 | +| `packages/provider-core/src/server/subagentProjection.ts` | N | Role library | +| `packages/provider-cursor/src/server/accountUsage.ts` | N | B | +| `packages/provider-opencode/src/settings.ts` | N | B | +| `packages/shared/src/cliRelease.ts` | N | 40 | +| `packages/shared/src/promptLinks.test.ts` | N | 76 | +| `packages/shared/src/promptLinks.ts` | N | B, 76 | +| `packages/shared/src/projectSettings.test.ts` | N | 107 | +| `apps/web/src/components/chat/TimelineUserMessageRow.tsx` | N | 7, 80, B | +| `apps/web/src/components/chat/timelineRowContext.ts` | N | 24 | +| `apps/web/src/components/chat/TimelineWorkEntryRow.tsx` | N | 80 | +| `apps/web/src/components/chat/chatViewSend.ts` | N | 80 | +| `apps/web/src/components/chat/MarkdownFileLink.tsx` | N | 33 | +| `apps/web/src/components/ChatMarkdown.tsx` | N | 33 | +| `apps/web/src/components/RightPanelTabs.tsx` | N | 33, B | +| `apps/web/src/components/pullRequest/PullRequestsPage.tsx` | N | 33, B | +| `apps/web/src/components/sidebar/SidebarThreadRow.tsx` | N | 23, 94 | +| `apps/web/src/components/chat/useComposerSend.ts` | N | 19, 45, Saved-agent mentions | +| `apps/web/src/components/chat/useProposedPlanSend.ts` | N | 45 | +| `apps/web/src/components/chat/useComposerMenuItems.ts` | N | 49, Saved-agent mentions | +| `apps/web/src/components/chat/ComposerControlsBar.tsx` | N | Saved-agent mentions | +| `apps/web/src/components/desktopUpdate.logic.ts` | N | 40, B | +| `apps/server/src/serverRuntimeState.test.ts` | N | 84 | +| `apps/server/src/ws.test.ts` | N | 69, 78 | +| `apps/server/vite.config.ts` | N | 86 | +| `.github/workflows/stale-needs-more-info.yml` | N | C | +| `.github/workflows/relay-preview.yml` | N | C | +| `.github/workflows/relay-preview-cleanup.yml` | N | C | +| `apps/web/src/components/chat/MessagesTimeline.browser.test.tsx` | N | 7, 80 | +| `apps/web/src/components/chat/QueuedRunsControl.browser.test.tsx` | N | 80 | +| `apps/web/src/components/settings/ProjectSettingsPanel.browser.test.tsx` | N | 72 | +| `apps/web/src/components/chat/guestShareAvailability.ts` | N | 92 | +| `apps/web/src/components/settings/LabsSettingsPanel.tsx` | N | 92 | +| `apps/web/src/lib/bootError.ts` | N | B | +| `apps/web/src/lib/bootError.test.ts` | N | B | +| `packages/contracts/src/orchestratorMcp.ts` | N | B | +| `scripts/mobile-native-client.ts` | N | B | +| `packages/contracts/src/threadSearch.ts` | N | 94 | +| `apps/web/src/components/ThreadSearchMatch.tsx` | N | 94 | +| `apps/web/src/components/CommandPalette.logic.ts` | N | 94 | +| `apps/web/src/components/CommandPaletteThreadItems.tsx` | N | 94 | +| `.github/workflows/agent-context-budget.yml` | N | C, 110 | +| `.github/workflows/mobile-eas-preview-fork.yml` | N | C | +| `.github/workflows/mobile-fingerprint-label.yml` | N | C | +| `apps/server/src/provider/AgentContextBudget.test.ts` | N | 110 | +| `apps/server/src/provider/agentContextBudget.json` | N | 110 | +| `apps/server/src/mcp/McpToolAccess.ts` | N | 2 | +| `packages/shared/src/threadLinks.ts` | N | 76 | +| `apps/web/src/components/settings/settingsLayout.tsx` | N | 112 | +| `apps/web/src/components/settings/LinkedEnvironmentsSettings.tsx` | N | 112 | +| `apps/server/src/mcp/toolkits/project/handlers.test.ts` | N | 76, 111 | +| `apps/server/src/mcp/toolkits/project/handlers.ts` | N | 111 | +| `packages/shared/src/threadLinks.test.ts` | N | 76 | +| `apps/mobile/app.config.test.ts` | N | B, 76 | +| `apps/web/public/.well-known/apple-app-site-association.json` | N | B, 76 | +| `apps/web/public/.well-known/assetlinks.json` | N | B, 76 | +| `apps/web/src/components/chat/threadDetailsItems.ts` | N | 73 | +| `apps/web/src/components/sidebar/SidebarProjectFolderHeader.tsx` | N | 90 | +| `apps/mobile/src/features/threads/new-task-flow-provider.test.tsx` | N | 90 | +| `apps/web/src/components/CommandPalette.composition.browser.test.tsx` | N | 90 | +| `apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx` | N | 90 | +| `apps/web/src/components/onboarding/WelcomeWizard.import.browser.test.tsx` | N | 39 | +| `packages/provider-core/src/server/orchestrationInstructions.test.ts` | N | B, 8 | +| `apps/server/src/cli/up.ts` | N | B, 79 | +| `apps/server/src/cliCompileCache.ts` | N | B, H | +| `packages/shared/src/managedPolicyFile.ts` | N | B | +| `apps/server/src/policy/policyTemplates.ts` | N | B | +| `apps/server/src/cli/policy.ts` | N | B | +| `apps/server/src/cloud/serviceProtection.ts` | N | B | +| `apps/desktop/src/app/DesktopStartupRecovery.ts` | N | B | +| `apps/server/src/triage/TriageService.ts` | N | B | +| `apps/server/src/triage/triagePrompt.ts` | N | B | +| `apps/web/src/components/GitHubStarPrompt.tsx` | N | B | +| `apps/web/src/components/GitHubStarPrompt.test.ts` | N | B | +| `apps/web/src/components/ui/standalone-page.tsx` | N | B | The 2026-09-08 import correction adds bounded file-content schemas and shared selection preparation in `packages/client-runtime/src/state/agentPersonas.ts`, plus import/removal commands in the existing orchestration atom module. Clients send selected JSON contents to the chosen environment, never local paths as server destinations. J5 library code validates and atomically persists imports under a process-wide mutation permit, overlays them on source definitions, and preserves launch snapshots on replacement/removal. The Settings registrations remain thin mounts. Focused tests cover nested file selections, single-file selection, atomic rejection, conflicts, persisted imports, concurrent sessions, restoration, snapshots, and RPC scopes. Native picker/browser interaction still requires an authorized client pass. diff --git a/apps/mobile/src/features/threads/thread-list-v2-items.tsx b/apps/mobile/src/features/threads/thread-list-v2-items.tsx index 1e859f73cc6c7..e2147d5406ccc 100644 --- a/apps/mobile/src/features/threads/thread-list-v2-items.tsx +++ b/apps/mobile/src/features/threads/thread-list-v2-items.tsx @@ -39,6 +39,7 @@ import { SymbolView, type AppSymbolName } from "../../components/ui/AppSymbol"; import { AppText as Text } from "../../components/ui/AppText"; import { Menu } from "../../components/ui/Menu"; import { AgentIdentityChip } from "../../j5/agents/AgentIdentityChip"; +import { CaptainSeats, CaptainSeatsToggle } from "../../j5/crew/CaptainSeats"; import { EnvironmentMachineSymbol } from "../../components/EnvironmentMachineSymbol"; import { ProjectFavicon } from "../../components/ProjectFavicon"; import { ProviderIcon, ProviderInstanceIcon } from "../../components/ProviderIcon"; @@ -1277,6 +1278,14 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: { ) : ( )} + {pr ? ( ) : null} + {props.hasQueuedMessages ? : null} ); + const captainSeats = ( + + ); + if (!canOperateThread) - return {rowContent(() => {})}; + return ( + <> + {rowContent(() => {})} + {captainSeats} + + ); return ( @@ -1517,6 +1547,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: { )} + {captainSeats} ); }); diff --git a/apps/mobile/src/features/threads/useThreadListV2.test.tsx b/apps/mobile/src/features/threads/useThreadListV2.test.tsx index 7eac8955efa14..979aef1eb0b65 100644 --- a/apps/mobile/src/features/threads/useThreadListV2.test.tsx +++ b/apps/mobile/src/features/threads/useThreadListV2.test.tsx @@ -17,6 +17,10 @@ vi.mock("../../state/threads", () => ({ threadFamilies: { mountRows: () => () => {} }, })); vi.mock("../../state/atom-registry", () => ({ appAtomRegistry: undefined })); +// J5 (case 115): the D22 filter reads server connections; this test lists every thread. +vi.mock("../../j5/crew/spawnedChildren", () => ({ + useCrewListedThreads: (threads: T) => threads, +})); it("reuses a large thread list across tab renders and updates when its inputs change", async () => { vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true); diff --git a/apps/mobile/src/features/threads/useThreadListV2.ts b/apps/mobile/src/features/threads/useThreadListV2.ts index fcf1048d2b6af..d98b453ced30c 100644 --- a/apps/mobile/src/features/threads/useThreadListV2.ts +++ b/apps/mobile/src/features/threads/useThreadListV2.ts @@ -2,6 +2,7 @@ import type { OlderSettledScope } from "@t3tools/client-runtime/state/threads"; import type { EnvironmentId } from "@t3tools/contracts"; import { useMemo, useSyncExternalStore } from "react"; +import { useCrewListedThreads } from "../../j5/crew/spawnedChildren"; import { scopedProjectKey } from "../../lib/scopedEntities"; import { useOlderSettledShelf, useOlderSettledShelfGrowth } from "../../state/olderSettledShelf"; import type { PendingNewTask } from "../../state/use-pending-new-tasks"; @@ -66,7 +67,9 @@ export function useThreadListV2(input: { readonly settledShelfExpanded: boolean; readonly selectedThreadKey: string | null; }) { - const { threads, workingShelfEnabled } = input; + const { workingShelfEnabled } = input; + // J5 (register D22): an agent-spawned thread lists under its spawner, not at the top level. + const threads = useCrewListedThreads(input.threads); const layoutTime = useMemo( () => threadListV2LayoutTime({ threads, now: input.now, searchQuery: input.searchQuery }), [threads, input.now, input.searchQuery], diff --git a/apps/mobile/src/j5/crew/CaptainSeats.tsx b/apps/mobile/src/j5/crew/CaptainSeats.tsx new file mode 100644 index 0000000000000..860e8ccb70a95 --- /dev/null +++ b/apps/mobile/src/j5/crew/CaptainSeats.tsx @@ -0,0 +1,308 @@ +import { useAtomValue } from "@effect/atom-react"; +import { scopeThreadRef } from "@t3tools/client-runtime/environment"; +import { seatQuietLabel } from "@t3tools/client-runtime/j5/crew-state"; +import { + groupSpawnedChildren, + selectSpawnedChildRows, + spawnedChildrenCountLabel, + stoppableCrew, + type SpawnedChildGroup, +} from "@t3tools/client-runtime/j5/spawned-children"; +import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/models"; +import type { EnvironmentId } from "@t3tools/contracts"; +import type { SpawnedChild } from "@t3tools/contracts/j5"; +import * as Cause from "effect/Cause"; +import { useState, useSyncExternalStore } from "react"; +import { Alert, Pressable, View } from "react-native"; + +import { SymbolView, type AppSymbolName } from "../../components/ui/AppSymbol"; +import { AppText as Text } from "../../components/ui/AppText"; +import { + resolveThreadListV2Status, + type ThreadListV2Status, +} from "../../features/threads/threadListV2"; +import { cn } from "../../lib/cn"; +import { relativeTime } from "../../lib/time"; +import { appAtomRegistry } from "../../state/atom-registry"; +import { useThreadShells } from "../../state/entities"; +import { j5Environment } from "../state"; +import { useSpawnedChildren } from "./spawnedChildren"; + +/** Upstream's row status labels, handed in by the row so seats read the way rows do. */ +export type SeatStatusLabels = Partial< + Record< + ThreadListV2Status, + { + readonly label: string; + readonly icon: AppSymbolName; + readonly className: string; + readonly iconTintClassName: string; + } + > +>; + +// Expanded spawners for this session, shared by the in-row toggle and the seats below the row. +let expanded: ReadonlySet = new Set(); +const listeners = new Set<() => void>(); +const subscribe = (listener: () => void) => { + listeners.add(listener); + return () => { + listeners.delete(listener); + }; +}; +const getExpanded = () => expanded; +const expansionKey = (thread: EnvironmentThreadShell) => `${thread.environmentId}/${thread.id}`; +const toggle = (key: string) => { + const next = new Set(expanded); + if (next.has(key)) next.delete(key); + else next.add(key); + expanded = next; + listeners.forEach((listener) => listener()); +}; + +function useGroups(thread: EnvironmentThreadShell, children: ReadonlyArray) { + const threads = useThreadShells(); + // Children are placed on the parent's environment; the same local id elsewhere is unrelated. + const threadsById = new Map( + threads + .filter((candidate) => candidate.environmentId === thread.environmentId) + .map((candidate) => [candidate.id as string, candidate]), + ); + return groupSpawnedChildren(selectSpawnedChildRows(children, threadsById)); +} + +/** + * The spawner's count and expand control, inside its existing row so a collapsed row is no + * taller. Most rows have no children and render nothing. + */ +export function CaptainSeatsToggle(props: { + readonly thread: EnvironmentThreadShell; + readonly mutedClassName: string; +}) { + const children = useSpawnedChildren(scopeThreadRef(props.thread.environmentId, props.thread.id)); + if (children.length === 0) return null; + return ; +} + +function SeatsToggle(props: { + readonly thread: EnvironmentThreadShell; + readonly mutedClassName: string; + readonly spawned: ReadonlyArray; +}) { + const groups = useGroups(props.thread, props.spawned); + const key = expansionKey(props.thread); + const isOpen = useSyncExternalStore(subscribe, getExpanded, getExpanded).has(key); + if (groups.length === 0) return null; + const count = spawnedChildrenCountLabel(groups); + const needsAttention = !isOpen && groups.some((group) => group.needsAttention); + return ( + toggle(key)} + onLongPress={() => undefined} + style={({ pressed }) => ({ opacity: pressed ? 0.6 : 1 })} + > + + + {count} + + {needsAttention ? : null} + + ); +} + +/** The seats and agents under an expanded spawner's row, one block per Crew and one for solo agents. */ +export function CaptainSeats(props: { + readonly thread: EnvironmentThreadShell; + readonly statusLabels: SeatStatusLabels; + readonly onSelectThread: (thread: EnvironmentThreadShell) => void; +}) { + const children = useSpawnedChildren(scopeThreadRef(props.thread.environmentId, props.thread.id)); + const isOpen = useSyncExternalStore(subscribe, getExpanded, getExpanded).has( + expansionKey(props.thread), + ); + if (!isOpen || children.length === 0) return null; + return ; +} + +function SeatGroups(props: { + readonly thread: EnvironmentThreadShell; + readonly statusLabels: SeatStatusLabels; + readonly onSelectThread: (thread: EnvironmentThreadShell) => void; + readonly spawned: ReadonlyArray; +}) { + const groups = useGroups(props.thread, props.spawned); + return ( + + {groups.map((group) => ( + + ))} + + ); +} + +function SeatGroup(props: { + readonly environmentId: EnvironmentId; + readonly group: SpawnedChildGroup; + readonly statusLabels: SeatStatusLabels; + readonly onSelectThread: (thread: EnvironmentThreadShell) => void; +}) { + const { group } = props; + const canStop = useAtomValue(j5Environment.stopCrew.permissionAtom(props.environmentId)); + const stoppable = canStop ? stoppableCrew(group) : null; + const [stopping, setStopping] = useState(false); + const stop = (crew: { readonly crewInstanceId: string; readonly crewName: string }) => { + setStopping(true); + void j5Environment.stopCrew + .run(appAtomRegistry, { + environmentId: props.environmentId, + input: { crewInstanceId: crew.crewInstanceId }, + }) + .then((result) => { + if (result._tag === "Failure") throw Cause.squash(result.cause); + }) + .catch((error: unknown) => { + Alert.alert( + `Couldn't stop crew ${crew.crewName}`, + error instanceof Error ? error.message : String(error), + ); + }) + .finally(() => setStopping(false)); + }; + return ( + + + + {group.crew === null ? null : ( + {group.crew.crewName} · + )} + {group.summary} + + {stoppable === null ? null : ( + // Interrupts this Crew's running seats; it retires nothing. + stop(stoppable)} + style={({ pressed }) => ({ opacity: stopping ? 0.5 : pressed ? 0.6 : 1 })} + > + Stop crew + + )} + + {group.rows.map(({ child, thread }) => ( + + ))} + + ); +} + +function SeatStatus(props: { + readonly child: SpawnedChild; + readonly thread: EnvironmentThreadShell; + readonly statusLabels: SeatStatusLabels; +}) { + const { child, thread } = props; + // A replaced member's last run says nothing about it now; being replaced does. + if (child.replaced !== undefined) + return ( + + Replaced by {child.replaced.replacedBy} + + ); + const status = resolveThreadListV2Status(thread); + // Upstream reads an idle session as Waiting; a seat says how its last run ended instead. + const live = + status === "waiting" && thread.runtime?.status === "idle" + ? undefined + : props.statusLabels[status]; + if (live === undefined) + return ( + + {child.seat === null + ? "Idle" + : seatQuietLabel({ notStarted: child.seat.notStarted, runtime: thread.runtime })} + + ); + return ( + + + {live.label} + + ); +} + +function SeatRow(props: { + readonly child: SpawnedChild; + readonly thread: EnvironmentThreadShell | undefined; + readonly statusLabels: SeatStatusLabels; + readonly onSelectThread: (thread: EnvironmentThreadShell) => void; +}) { + const { child, thread } = props; + // A seat the client holds no facts for is listed, not opened: there may be no thread. + if (thread === undefined) + return ( + + + {child.seat?.seat ?? "Seat"} + + Unknown + + ); + // A seat thread is titled by its seat, so the badge repeats it only once renamed. + const renamedSeat = + child.seat !== null && child.seat.seat !== thread.title ? child.seat.seat : null; + return ( + props.onSelectThread(thread)} + style={({ pressed }) => ({ opacity: pressed ? 0.6 : 1 })} + > + + {renamedSeat === null ? null : ( + + {renamedSeat} + + )} + + {thread.title} + + + {relativeTime(thread.updatedAt)} + + + + + ); +} diff --git a/apps/mobile/src/j5/crew/spawnedChildren.ts b/apps/mobile/src/j5/crew/spawnedChildren.ts new file mode 100644 index 0000000000000..f706ddcda2485 --- /dev/null +++ b/apps/mobile/src/j5/crew/spawnedChildren.ts @@ -0,0 +1,132 @@ +import { useAtomValue } from "@effect/atom-react"; +import type { PreparedConnection } from "@t3tools/client-runtime/connection"; +import { scopedThreadKey, scopeThreadRef } from "@t3tools/client-runtime/environment"; +import { createScopedThreadReadStore } from "@t3tools/client-runtime/j5/scopedThreadReadStore"; +import { + isSidebarMember, + replaceSpawnedChildren, + spawnedChildrenRows, + type SpawnedChildrenRow, + type SpawnedChildrenRowEntry, +} from "@t3tools/client-runtime/j5/spawned-children"; +import type { EnvironmentId, ScopedThreadRef, ThreadId } from "@t3tools/contracts"; +import type { SpawnedChild } from "@t3tools/contracts/j5"; +import * as Cause from "effect/Cause"; +import * as Option from "effect/Option"; +import { AsyncResult, Atom } from "effect/reactivity"; +import { useEffect, useMemo, useSyncExternalStore } from "react"; + +import { environmentCatalog } from "../../connection/catalog"; +import { appAtomRegistry } from "../../state/atom-registry"; +import { environmentSession } from "../../state/session"; +import { j5Sharing } from "../sharing/guestAccess"; +import { j5Environment } from "../state"; + +const store = createScopedThreadReadStore({ + load: async (environmentId, threadIds) => { + const result = await j5Environment.listSpawnedChildren.run(appAtomRegistry, { + environmentId, + input: { threadIds }, + }); + if (result._tag === "Failure") throw Cause.squash(result.cause); + return spawnedChildrenRows(result.value); + }, + replace: replaceSpawnedChildren, +}); + +/** + * Each catalogued environment's prepared connection, or null while it is not connected or the + * person reaches less than the whole server, which refuses these reads (web's `useThreadRowReads`). + */ +const threadReadConnectionsAtom = Atom.make((get) => { + const connections = new Map(); + for (const id of get(environmentCatalog.catalogValueAtom).entries.keys()) { + const state = Option.getOrNull(AsyncResult.value(get(environmentCatalog.stateAtom(id)))); + const prepared = get(environmentSession.preparedConnectionValueAtom(id)); + const readable = state?.phase === "connected" && !get(j5Sharing.isNarrow(id)); + connections.set(id, readable ? Option.getOrNull(prepared) : null); + } + return connections; +}).pipe(Atom.withLabel("mobile-j5:spawned-children-connections")); + +/** Each environment's Crew and Fleet revisions; a moved pair means placements may have changed. */ +const placementRevisionsAtom = Atom.make((get) => { + const revisions: Array = []; + for (const id of get(threadReadConnectionsAtom).keys()) + revisions.push([id, get(j5Environment.rereadOn("crew", "fleet")({ environmentId: id }))]); + return JSON.stringify(revisions); +}).pipe(Atom.withLabel("mobile-j5:placement-revisions")); + +// Shared by every list that mounts the hook, so two lists re-read a moved environment once. +const heardRevisions = new Map(); + +/** + * Mobile has no Fleet roster to bound re-reads by, so a moved revision re-reads that + * environment's listed rows: one batched read, whose reply names only rows with children. + */ +const requestRows = (refs: ReadonlyArray, revisions: string) => { + store.request(refs); + const moved = new Set(); + for (const [environmentId, revision] of JSON.parse(revisions) as Array< + [EnvironmentId, string | null] + >) { + if (revision === null || heardRevisions.get(environmentId) === revision) continue; + heardRevisions.set(environmentId, revision); + moved.add(environmentId); + } + if (moved.size > 0) + store.request( + refs.filter((ref) => moved.has(ref.environmentId)), + true, + ); +}; + +/** + * The list's threads without the ones an agent spawned (register D22): those show under their + * spawner's row unless pinned. Also keeps the spawned-children read current for every thread. + */ +export function useCrewListedThreads< + T extends { + readonly environmentId: EnvironmentId; + readonly id: ThreadId; + readonly archivedAt: string | null; + readonly pinnedAt?: string | null | undefined; + }, +>(threads: ReadonlyArray): ReadonlyArray { + const connections = useAtomValue(threadReadConnectionsAtom); + const revisions = useAtomValue(placementRevisionsAtom); + // The list re-renders while turns stream, so the effect keys on the serialized row set. + const key = JSON.stringify( + threads.flatMap((thread) => + thread.archivedAt === null ? [[thread.environmentId, thread.id]] : [], + ), + ); + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- asks the servers which listed threads have agents under them or were spawned by one, again when placements change. + useEffect(() => { + store.setConnections(connections); + const refs = (JSON.parse(key) as Array<[EnvironmentId, ThreadId]>).map( + ([environmentId, threadId]) => scopeThreadRef(environmentId, threadId), + ); + requestRows(refs, revisions); + }, [connections, key, revisions]); + const snapshot = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot); + return useMemo( + () => + threads.filter((thread) => + isSidebarMember( + thread, + snapshot.get(scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id))) + ?.spawnedByAgent === true, + ), + ), + [threads, snapshot], + ); +} + +const EMPTY: ReadonlyArray = []; + +/** The agents placed under one thread, as last read. */ +export function useSpawnedChildren(ref: ScopedThreadRef): ReadonlyArray { + const snapshot = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot); + return snapshot.get(scopedThreadKey(ref))?.children ?? EMPTY; +} diff --git a/apps/mobile/src/j5/upstreamSeams.test.ts b/apps/mobile/src/j5/upstreamSeams.test.ts index f6b37fd342dfb..5ae33a20259bb 100644 --- a/apps/mobile/src/j5/upstreamSeams.test.ts +++ b/apps/mobile/src/j5/upstreamSeams.test.ts @@ -172,6 +172,18 @@ const SEAMS: ReadonlyArray = [ "", ], }, + { + file: "features/threads/thread-list-v2-items.tsx", + record: "case 115: spawned agents under their spawner's row", + from: "../../j5/crew/CaptainSeats", + reaches: [" void>(); diff --git a/apps/web/src/j5/threads/SpawnedChildrenClient.ts b/apps/web/src/j5/threads/SpawnedChildrenClient.ts index ca0a36c5343cd..94e90821cceb6 100644 --- a/apps/web/src/j5/threads/SpawnedChildrenClient.ts +++ b/apps/web/src/j5/threads/SpawnedChildrenClient.ts @@ -1,54 +1,23 @@ import type { PreparedConnection } from "@t3tools/client-runtime/connection"; -import { scopedThreadKey, scopeThreadRef } from "@t3tools/client-runtime/environment"; +import { scopedThreadKey } from "@t3tools/client-runtime/environment"; import { createScopedThreadReadStore } from "@t3tools/client-runtime/j5/scopedThreadReadStore"; -import type { EnvironmentId, ScopedThreadRef, ThreadId } from "@t3tools/contracts"; -import type { SpawnedChild, SpawnedChildrenEntry } from "@t3tools/contracts/j5"; +import { + replaceSpawnedChildren, + spawnedChildrenRows, + type SpawnedChildrenRow, + type SpawnedChildrenRowEntry, +} from "@t3tools/client-runtime/j5/spawned-children"; +import type { EnvironmentId, ScopedThreadRef } from "@t3tools/contracts"; +import type { SpawnedChild } from "@t3tools/contracts/j5"; import * as Cause from "effect/Cause"; import { useSyncExternalStore } from "react"; import { appAtomRegistry } from "../../rpc/atomRegistry"; import { j5Environment } from "../state"; -export type { SpawnedChild, SpawnedChildrenEntry } from "@t3tools/contracts/j5"; +export type { SpawnedChild } from "@t3tools/contracts/j5"; -/** What the read says about one visible row: the agents placed under it, and how it came to be. */ -export interface SpawnedChildrenRow { - readonly children: ReadonlyArray; - /** An agent spawned this thread, so it shows under its spawner (register D22). */ - readonly spawnedByAgent: boolean; -} -type RowEntry = SpawnedChildrenRow & { readonly threadId: ThreadId }; - -/** One entry per requested row the read has something to say about. */ -export const spawnedChildrenRows = (response: { - readonly entries: ReadonlyArray; - readonly spawnedByAgent: ReadonlyArray; -}): ReadonlyArray => { - const children = new Map(response.entries.map((entry) => [entry.threadId, entry.children])); - const spawned = new Set(response.spawnedByAgent); - return [...new Set([...children.keys(), ...spawned])].map((threadId) => ({ - threadId, - children: children.get(threadId) ?? [], - spawnedByAgent: spawned.has(threadId), - })); -}; - -/** The visible rows are the whole truth for their children; parents that lost all children lose their entry. */ -export const replaceSpawnedChildren = ( - previous: ReadonlyMap, - environmentId: EnvironmentId, - requested: ReadonlyArray, - entries: ReadonlyArray, -) => { - const next = new Map(previous); - for (const threadId of requested) - next.delete(scopedThreadKey(scopeThreadRef(environmentId, threadId))); - for (const { threadId, ...row } of entries) - next.set(scopedThreadKey(scopeThreadRef(environmentId, threadId)), row); - return next; -}; - -const store = createScopedThreadReadStore({ +const store = createScopedThreadReadStore({ load: async (environmentId, threadIds) => { const result = await j5Environment.listSpawnedChildren.run(appAtomRegistry, { environmentId, diff --git a/apps/web/src/j5/threads/sidebarMembership.test.ts b/apps/web/src/j5/threads/sidebarMembership.test.ts deleted file mode 100644 index 90c8cd01224ce..0000000000000 --- a/apps/web/src/j5/threads/sidebarMembership.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { describe, expect, it } from "vite-plus/test"; - -import { isSidebarMember } from "./sidebarMembership"; - -describe("sidebar membership", () => { - it("moves an agent-spawned thread under its spawner unless it is pinned", () => { - expect(isSidebarMember({ pinnedAt: null }, true)).toBe(false); - expect(isSidebarMember({ pinnedAt: "2026-09-09T00:00:00Z" }, true)).toBe(true); - }); - - it("keeps every thread an agent did not spawn, including rows the read has not answered for", () => { - expect(isSidebarMember({ pinnedAt: null }, false)).toBe(true); - expect(isSidebarMember({}, false)).toBe(true); - }); -}); diff --git a/apps/web/src/j5/threads/sidebarMembership.ts b/apps/web/src/j5/threads/sidebarMembership.ts index cf110301f755a..38c302eb2e2c4 100644 --- a/apps/web/src/j5/threads/sidebarMembership.ts +++ b/apps/web/src/j5/threads/sidebarMembership.ts @@ -1,13 +1,6 @@ -/** - * Sidebar membership (register D22): human-created agents show; agent-spawned Peer Agents (Crew - * members included) appear under their spawner unless the user pinned them. `spawnedByAgent` is - * the spawned-children read's statement of placement provenance. A row the read has not answered - * for shows, never guesses. - */ -export const isSidebarMember = ( - thread: { readonly pinnedAt?: string | null | undefined }, - spawnedByAgent: boolean, -) => !(spawnedByAgent && thread.pinnedAt == null); +import { isSidebarMember } from "@t3tools/client-runtime/j5/spawned-children"; + +export { isSidebarMember }; /** The thread as a top-level sidebar row, or undefined when it lists under its spawner. */ export const sidebarRowThread = ( diff --git a/apps/web/src/j5/threads/spawnedChildren.logic.test.ts b/apps/web/src/j5/threads/spawnedChildren.logic.test.ts index 90db72af25c0e..d5423bd659bfd 100644 --- a/apps/web/src/j5/threads/spawnedChildren.logic.test.ts +++ b/apps/web/src/j5/threads/spawnedChildren.logic.test.ts @@ -1,134 +1,8 @@ import { describe, expect, it } from "vite-plus/test"; -import { scopedThreadKey, scopeThreadRef } from "@t3tools/client-runtime/environment"; -import { EnvironmentId, ThreadId } from "@t3tools/contracts"; -import type { SpawnedChild } from "./SpawnedChildrenClient"; -import { replaceSpawnedChildren, spawnedChildrenRows } from "./SpawnedChildrenClient"; -import { - groupSpawnedChildren, - readExpandedSpawnParents, - selectSpawnedChildRows, - spawnedChildrenNeedAttention, - spawnedGroupExpansionKey, - stoppableCrew, - writeExpandedSpawnParents, -} from "./spawnedChildren.logic"; - -const child = ( - id: string, - seat: string | null, - crew: { crewInstanceId: string; crewName: string } = { - crewInstanceId: "crew:1", - crewName: "Review Pair", - }, -): SpawnedChild => ({ - threadId: ThreadId.make(id), - participantId: `agent:j5:a2a:${id}`, - seat: seat === null ? null : { ...crew, seat }, -}); -const thread = ( - id: string, - updatedAt: string, - overrides: Partial<{ - archivedAt: string | null; - hasPendingApprovals: boolean; - hasPendingUserInput: boolean; - runtime: { status: "running" } | null; - }> = {}, -) => ({ - id, - updatedAt, - archivedAt: null, - hasPendingApprovals: false, - hasPendingUserInput: false, - ...overrides, -}); - -describe("spawned children under a sidebar row", () => { - const threads = new Map([ - ["builder", thread("builder", "2026-09-09T10:00:00Z", { hasPendingUserInput: true })], - ["critic", thread("critic", "2026-09-09T11:00:00Z")], - ["retired", thread("retired", "2026-09-09T12:00:00Z", { archivedAt: "2026-09-09T12:30:00Z" })], - ]); - - it("keeps live children with known threads, newest first", () => { - const rows = selectSpawnedChildRows( - [ - child("builder", "builder"), - child("critic", "critic"), - child("retired", "sitter"), - child("pending", null), - ], - threads, - ); - expect(rows.map(({ child }) => child.threadId)).toEqual(["critic", "builder"]); - expect(spawnedChildrenNeedAttention(rows)).toBe(true); - }); - - it("groups seats by Crew, newest Crew first, with the solo peers as one more group", () => { - const blog = { crewInstanceId: "crew:2", crewName: "Blog Migration" }; - const all = new Map([ - ...threads, - ["writer", thread("writer", "2026-09-09T13:00:00Z", { runtime: { status: "running" } })], - ["solo", thread("solo", "2026-09-09T09:00:00Z")], - ]); - const groups = groupSpawnedChildren( - selectSpawnedChildRows( - [ - child("builder", "builder"), - child("critic", "critic"), - child("writer", "writer", blog), - child("solo", null), - ], - all, - ), - ); - expect(groups.map((group) => [group.key, group.crew?.crewName ?? null, group.summary])).toEqual( - [ - ["crew:crew:2", "Blog Migration", "1 seat · 1 running"], - // A seat waiting on a person is said on the Crew's header; idle seats stay unsaid. - ["crew:crew:1", "Review Pair", "2 seats · 1 needs you"], - ["agents", null, "1 agent"], - ], - ); - expect(groups.map((group) => group.needsAttention)).toEqual([false, true, false]); - expect(groups[1]!.rows.map(({ child }) => child.threadId)).toEqual(["critic", "builder"]); - expect(groupSpawnedChildren([])).toEqual([]); - expect(spawnedGroupExpansionKey("env:a", "captain", "crew:crew:1")).toBe( - "env:a/captain/crew:crew:1", - ); - expect(spawnedGroupExpansionKey("env:b", "captain", "crew:crew:1")).not.toBe( - spawnedGroupExpansionKey("env:a", "captain", "crew:crew:1"), - ); - }); - - it("offers Stop on a Crew's own group only while one of its seats is running", () => { - const blog = { crewInstanceId: "crew:2", crewName: "Blog Migration" }; - const running = new Map([ - ["builder", thread("builder", "2026-09-09T10:00:00Z", { runtime: { status: "running" } })], - ["critic", thread("critic", "2026-09-09T11:00:00Z")], - ["writer", thread("writer", "2026-09-09T12:00:00Z")], - ["solo", thread("solo", "2026-09-09T13:00:00Z", { runtime: { status: "running" } })], - ]); - const groups = groupSpawnedChildren( - selectSpawnedChildRows( - [ - child("builder", "builder"), - child("critic", "critic"), - child("writer", "writer", blog), - child("solo", null), - ], - running, - ), - ); - // Blog Migration is idle, Review Pair has a running seat, and the solo group never stops. - expect(groups.map((group) => stoppableCrew(group))).toEqual([ - null, - { crewInstanceId: "crew:1", crewName: "Review Pair" }, - null, - ]); - }); +import { readExpandedSpawnParents, writeExpandedSpawnParents } from "./spawnedChildren.logic"; +describe("spawned children expansion", () => { it("remembers expansion per parent and tolerates broken or missing storage", () => { const backing = new Map(); const storage = { @@ -141,78 +15,4 @@ describe("spawned children under a sidebar row", () => { expect(readExpandedSpawnParents(storage).size).toBe(0); expect(readExpandedSpawnParents(undefined).size).toBe(0); }); - - it("treats the visible rows as the whole truth for their children", () => { - const environmentId = EnvironmentId.make("env:a"); - const key = (id: string) => scopedThreadKey(scopeThreadRef(environmentId, ThreadId.make(id))); - const row = (children: ReadonlyArray>, spawnedByAgent = false) => ({ - children, - spawnedByAgent, - }); - const previous = new Map([ - [key("captain"), row([child("builder", "builder")])], - [key("other"), row([child("x", null)])], - ]); - const next = replaceSpawnedChildren( - previous, - environmentId, - [ThreadId.make("captain"), ThreadId.make("solo")], - [{ threadId: ThreadId.make("solo"), ...row([child("y", null)]) }], - ); - expect([...next.keys()].toSorted()).toEqual([key("other"), key("solo")].toSorted()); - }); - - it("answers for a row an agent spawned even when nothing is placed under it", () => { - expect( - spawnedChildrenRows({ - entries: [{ threadId: ThreadId.make("captain"), children: [child("builder", "builder")] }], - spawnedByAgent: [ThreadId.make("builder"), ThreadId.make("captain")], - }), - ).toEqual([ - { - threadId: "captain", - children: [child("builder", "builder")], - spawnedByAgent: true, - }, - { threadId: "builder", children: [], spawnedByAgent: true }, - ]); - expect( - spawnedChildrenRows({ - entries: [{ threadId: ThreadId.make("solo"), children: [child("y", null)] }], - spawnedByAgent: [], - }), - ).toEqual([{ threadId: "solo", children: [child("y", null)], spawnedByAgent: false }]); - }); - - it("keeps a Crew seat with no thread as unknown, and measures it once its thread arrives", () => { - const known = new Map([ - ["builder", thread("builder", "2026-09-09T10:00:00Z", { runtime: { status: "running" } })], - ]); - const seats = [child("builder", "builder"), child("critic", "critic")]; - const [review] = groupSpawnedChildren(selectSpawnedChildRows(seats, known)); - expect(review!.summary).toBe("2 seats · 1 running · 1 unknown"); - // The seat with no facts sorts last and carries none. - expect(review!.rows.map(({ child, thread }) => [child.threadId, thread?.id ?? null])).toEqual([ - ["builder", "builder"], - ["critic", null], - ]); - const [later] = groupSpawnedChildren( - selectSpawnedChildRows( - seats, - new Map([...known, ["critic", thread("critic", "2026-09-09T11:00:00Z")]]), - ), - ); - expect(later!.summary).toBe("2 seats · 1 running"); - }); - - it("names a Crew with no loaded seat at all instead of dropping it", () => { - const groups = groupSpawnedChildren( - selectSpawnedChildRows([child("builder", "builder"), child("critic", "critic")], new Map()), - ); - expect(groups.map((group) => [group.crew?.crewName ?? null, group.summary])).toEqual([ - ["Review Pair", "2 seats · 2 unknown"], - ]); - expect(stoppableCrew(groups[0]!)).toBeNull(); - expect(spawnedChildrenNeedAttention(groups[0]!.rows)).toBe(false); - }); }); diff --git a/apps/web/src/j5/threads/spawnedChildren.logic.ts b/apps/web/src/j5/threads/spawnedChildren.logic.ts index dfed12b3d94b4..0bd0982a2e6f5 100644 --- a/apps/web/src/j5/threads/spawnedChildren.logic.ts +++ b/apps/web/src/j5/threads/spawnedChildren.logic.ts @@ -1,139 +1,3 @@ -import { - crewHasRunningSeat, - formatCrewStateSummary, - summarizeCrewState, - type CrewSeatThread, -} from "../crew/crewState"; -import type { SpawnedChild } from "./SpawnedChildrenClient"; - -export interface SpawnedChildThread extends CrewSeatThread { - readonly id: string; -} - -export interface SpawnedChildRow { - readonly child: SpawnedChild; - /** Undefined for a Crew seat whose thread the client holds no facts for: its state is unknown. */ - readonly thread: T | undefined; -} - -const activityOf = (row: SpawnedChildRow) => - row.thread?.updatedAt ?? ""; - -/** - * Live children, most recent first. A Crew seat the client holds no thread for stays as a row - * with no facts, so its Crew never under-counts or vanishes; it sorts last and reads as unknown. - * A solo peer with no thread in client state waits until it arrives. - */ -export function selectSpawnedChildRows( - children: ReadonlyArray, - threadsById: ReadonlyMap, -): ReadonlyArray> { - return children - .flatMap((child): Array> => { - const thread = threadsById.get(child.threadId); - if (thread === undefined) return child.seat === null ? [] : [{ child, thread }]; - return thread.archivedAt !== null - ? [] - : [{ child, thread: { ...thread, notStarted: child.seat?.notStarted ?? false } }]; - }) - .toSorted((left, right) => activityOf(right).localeCompare(activityOf(left))); -} - -/** The collapsed header's discovery cue: a measured "needs a human" fact on any child. */ -export const spawnedChildrenNeedAttention = ( - rows: ReadonlyArray>, -) => - rows.some( - ({ thread }) => - thread !== undefined && (thread.hasPendingApprovals || thread.hasPendingUserInput), - ); - -/** - * One collapsible group under a Captain's row: a named Crew, or the solo Peer Agents it spawned - * outside any Crew. A Captain that commands several Crews gets one group per Crew, so each can - * be watched, opened, and named on its own. - */ -export interface SpawnedChildGroup { - /** Stable within the parent: `crew:` for a Crew, `agents` for the solo peers. */ - readonly key: string; - readonly crew: { readonly crewInstanceId: string; readonly crewName: string } | null; - readonly rows: ReadonlyArray>; - /** "3 seats · 1 running · 1 needs you" for a Crew, "2 agents" for the solo group. */ - readonly summary: string; - readonly needsAttention: boolean; -} - -const SOLO_GROUP_KEY = "agents"; -const crewGroupKey = (crewInstanceId: string) => `crew:${crewInstanceId}`; - -/** - * Crews first, the one with the newest seat activity on top, then the solo peers. Each Crew's - * summary answers "what is the state of this Crew?" from its seats' measured facts; idle seats - * are the quiet default and stay unsaid. - */ -export const groupSpawnedChildren = ( - rows: ReadonlyArray>, -): ReadonlyArray> => { - const crews = new Map>>(); - const solo: Array> = []; - for (const row of rows) { - if (row.child.seat === null) solo.push(row); - else { - const seats = crews.get(row.child.seat.crewInstanceId) ?? []; - seats.push(row); - crews.set(row.child.seat.crewInstanceId, seats); - } - } - // Rows arrive newest first, so each Crew's first seat carries its newest activity. - const crewGroups = [...crews.entries()] - .toSorted(([, left], [, right]) => activityOf(right[0]!).localeCompare(activityOf(left[0]!))) - .map(([crewInstanceId, seats]): SpawnedChildGroup => { - const state = formatCrewStateSummary(summarizeCrewState(seats.map(({ thread }) => thread))); - const count = `${seats.length} ${seats.length === 1 ? "seat" : "seats"}`; - return { - key: crewGroupKey(crewInstanceId), - crew: { crewInstanceId, crewName: seats[0]!.child.seat!.crewName }, - rows: seats, - summary: state === null ? count : `${count} · ${state}`, - needsAttention: spawnedChildrenNeedAttention(seats), - }; - }); - if (solo.length === 0) return crewGroups; - return [ - ...crewGroups, - { - key: SOLO_GROUP_KEY, - crew: null, - rows: solo, - summary: `${solo.length} ${solo.length === 1 ? "agent" : "agents"}`, - needsAttention: spawnedChildrenNeedAttention(solo), - }, - ]; -}; - -/** - * Expansion is remembered per group under its parent, so the Crew you watch stays open on - * reload; the environment is part of the key because the same local thread id on two - * environments is two different rows. - */ -export const spawnedGroupExpansionKey = ( - environmentId: string, - parentThreadId: string, - groupKey: string, -) => `${environmentId}/${parentThreadId}/${groupKey}`; - -/** - * The Crew a Stop control on a group's header would stop: the group is a Crew and at least one - * seat has a turn to interrupt. The solo-peer group and an idle Crew offer nothing. - */ -export const stoppableCrew = ( - group: SpawnedChildGroup, -): { readonly crewInstanceId: string; readonly crewName: string } | null => - group.crew !== null && - crewHasRunningSeat(summarizeCrewState(group.rows.map(({ thread }) => thread))) - ? group.crew - : null; - const STORAGE_KEY = "j5:sidebar:spawned-children:expanded"; export const readExpandedSpawnParents = ( diff --git a/packages/client-runtime/package.json b/packages/client-runtime/package.json index 184fc9b5c0bdd..3fc8634377ac1 100644 --- a/packages/client-runtime/package.json +++ b/packages/client-runtime/package.json @@ -515,6 +515,14 @@ "types": "./src/j5/crewNotices.ts", "default": "./src/j5/crewNotices.ts" }, + "./j5/crew-state": { + "types": "./src/j5/crewState.ts", + "default": "./src/j5/crewState.ts" + }, + "./j5/spawned-children": { + "types": "./src/j5/spawnedChildren.ts", + "default": "./src/j5/spawnedChildren.ts" + }, "./pull-request-project-filter": { "types": "./src/pullRequestProjectFilter.ts", "default": "./src/pullRequestProjectFilter.ts" diff --git a/apps/web/src/j5/crew/crewState.test.ts b/packages/client-runtime/src/j5/crewState.test.ts similarity index 99% rename from apps/web/src/j5/crew/crewState.test.ts rename to packages/client-runtime/src/j5/crewState.test.ts index bd392dc5c9b58..9ce68999e0713 100644 --- a/apps/web/src/j5/crew/crewState.test.ts +++ b/packages/client-runtime/src/j5/crewState.test.ts @@ -8,7 +8,7 @@ import { seatRunLabel, summarizeCrewState, type CrewSeatThread, -} from "./crewState"; +} from "./crewState.ts"; const seat = (overrides: Partial = {}): CrewSeatThread => ({ runtime: { status: "idle" }, diff --git a/apps/web/src/j5/crew/crewState.ts b/packages/client-runtime/src/j5/crewState.ts similarity index 97% rename from apps/web/src/j5/crew/crewState.ts rename to packages/client-runtime/src/j5/crewState.ts index f07e1b2becda2..df2759b119416 100644 --- a/apps/web/src/j5/crew/crewState.ts +++ b/packages/client-runtime/src/j5/crewState.ts @@ -1,7 +1,4 @@ -import { - threadRuntimeIsActive, - type ThreadRuntimeSummary, -} from "@t3tools/client-runtime/state/models"; +import { threadRuntimeIsActive, type ThreadRuntimeSummary } from "../state/models.ts"; /** The seat facts a Crew summary reads; every field is something the client already holds. */ export interface CrewSeatThread { diff --git a/packages/client-runtime/src/j5/spawnedChildren.test.ts b/packages/client-runtime/src/j5/spawnedChildren.test.ts new file mode 100644 index 0000000000000..742f63cbf4330 --- /dev/null +++ b/packages/client-runtime/src/j5/spawnedChildren.test.ts @@ -0,0 +1,220 @@ +import { describe, expect, it } from "vite-plus/test"; +import { EnvironmentId, ThreadId } from "@t3tools/contracts"; +import type { SpawnedChild } from "@t3tools/contracts/j5"; + +import { scopedThreadKey, scopeThreadRef } from "../environment/scoped.ts"; +import { + groupSpawnedChildren, + isSidebarMember, + replaceSpawnedChildren, + selectSpawnedChildRows, + spawnedChildrenCountLabel, + spawnedChildrenNeedAttention, + spawnedChildrenRows, + spawnedGroupExpansionKey, + stoppableCrew, +} from "./spawnedChildren.ts"; + +describe("sidebar membership", () => { + it("moves an agent-spawned thread under its spawner unless it is pinned", () => { + expect(isSidebarMember({ pinnedAt: null }, true)).toBe(false); + expect(isSidebarMember({ pinnedAt: "2026-09-09T00:00:00Z" }, true)).toBe(true); + }); + + it("keeps every thread an agent did not spawn, including rows the read has not answered for", () => { + expect(isSidebarMember({ pinnedAt: null }, false)).toBe(true); + expect(isSidebarMember({}, false)).toBe(true); + }); +}); + +const child = ( + id: string, + seat: string | null, + crew: { crewInstanceId: string; crewName: string } = { + crewInstanceId: "crew:1", + crewName: "Review Pair", + }, +): SpawnedChild => ({ + threadId: ThreadId.make(id), + participantId: `agent:j5:a2a:${id}`, + seat: seat === null ? null : { ...crew, seat }, +}); +const thread = ( + id: string, + updatedAt: string, + overrides: Partial<{ + archivedAt: string | null; + hasPendingApprovals: boolean; + hasPendingUserInput: boolean; + runtime: { status: "running" } | null; + }> = {}, +) => ({ + id, + updatedAt, + archivedAt: null, + hasPendingApprovals: false, + hasPendingUserInput: false, + ...overrides, +}); + +describe("spawned children under a sidebar row", () => { + const threads = new Map([ + ["builder", thread("builder", "2026-09-09T10:00:00Z", { hasPendingUserInput: true })], + ["critic", thread("critic", "2026-09-09T11:00:00Z")], + ["retired", thread("retired", "2026-09-09T12:00:00Z", { archivedAt: "2026-09-09T12:30:00Z" })], + ]); + + it("keeps live children with known threads, newest first", () => { + const rows = selectSpawnedChildRows( + [ + child("builder", "builder"), + child("critic", "critic"), + child("retired", "sitter"), + child("pending", null), + ], + threads, + ); + expect(rows.map(({ child }) => child.threadId)).toEqual(["critic", "builder"]); + expect(spawnedChildrenNeedAttention(rows)).toBe(true); + }); + + it("groups seats by Crew, newest Crew first, with the solo peers as one more group", () => { + const blog = { crewInstanceId: "crew:2", crewName: "Blog Migration" }; + const all = new Map([ + ...threads, + ["writer", thread("writer", "2026-09-09T13:00:00Z", { runtime: { status: "running" } })], + ["solo", thread("solo", "2026-09-09T09:00:00Z")], + ]); + const groups = groupSpawnedChildren( + selectSpawnedChildRows( + [ + child("builder", "builder"), + child("critic", "critic"), + child("writer", "writer", blog), + child("solo", null), + ], + all, + ), + ); + expect(groups.map((group) => [group.key, group.crew?.crewName ?? null, group.summary])).toEqual( + [ + ["crew:crew:2", "Blog Migration", "1 seat · 1 running"], + // A seat waiting on a person is said on the Crew's header; idle seats stay unsaid. + ["crew:crew:1", "Review Pair", "2 seats · 1 needs you"], + ["agents", null, "1 agent"], + ], + ); + expect(groups.map((group) => group.needsAttention)).toEqual([false, true, false]); + expect(spawnedChildrenCountLabel(groups)).toBe("3 seats · 1 agent"); + expect(spawnedChildrenCountLabel(groups.slice(2))).toBe("1 agent"); + expect(groups[1]!.rows.map(({ child }) => child.threadId)).toEqual(["critic", "builder"]); + expect(groupSpawnedChildren([])).toEqual([]); + expect(spawnedGroupExpansionKey("env:a", "captain", "crew:crew:1")).toBe( + "env:a/captain/crew:crew:1", + ); + expect(spawnedGroupExpansionKey("env:b", "captain", "crew:crew:1")).not.toBe( + spawnedGroupExpansionKey("env:a", "captain", "crew:crew:1"), + ); + }); + + it("offers Stop on a Crew's own group only while one of its seats is running", () => { + const blog = { crewInstanceId: "crew:2", crewName: "Blog Migration" }; + const running = new Map([ + ["builder", thread("builder", "2026-09-09T10:00:00Z", { runtime: { status: "running" } })], + ["critic", thread("critic", "2026-09-09T11:00:00Z")], + ["writer", thread("writer", "2026-09-09T12:00:00Z")], + ["solo", thread("solo", "2026-09-09T13:00:00Z", { runtime: { status: "running" } })], + ]); + const groups = groupSpawnedChildren( + selectSpawnedChildRows( + [ + child("builder", "builder"), + child("critic", "critic"), + child("writer", "writer", blog), + child("solo", null), + ], + running, + ), + ); + // Blog Migration is idle, Review Pair has a running seat, and the solo group never stops. + expect(groups.map((group) => stoppableCrew(group))).toEqual([ + null, + { crewInstanceId: "crew:1", crewName: "Review Pair" }, + null, + ]); + }); + + it("treats the visible rows as the whole truth for their children", () => { + const environmentId = EnvironmentId.make("env:a"); + const key = (id: string) => scopedThreadKey(scopeThreadRef(environmentId, ThreadId.make(id))); + const row = (children: ReadonlyArray>, spawnedByAgent = false) => ({ + children, + spawnedByAgent, + }); + const previous = new Map([ + [key("captain"), row([child("builder", "builder")])], + [key("other"), row([child("x", null)])], + ]); + const next = replaceSpawnedChildren( + previous, + environmentId, + [ThreadId.make("captain"), ThreadId.make("solo")], + [{ threadId: ThreadId.make("solo"), ...row([child("y", null)]) }], + ); + expect([...next.keys()].toSorted()).toEqual([key("other"), key("solo")].toSorted()); + }); + + it("answers for a row an agent spawned even when nothing is placed under it", () => { + expect( + spawnedChildrenRows({ + entries: [{ threadId: ThreadId.make("captain"), children: [child("builder", "builder")] }], + spawnedByAgent: [ThreadId.make("builder"), ThreadId.make("captain")], + }), + ).toEqual([ + { + threadId: "captain", + children: [child("builder", "builder")], + spawnedByAgent: true, + }, + { threadId: "builder", children: [], spawnedByAgent: true }, + ]); + expect( + spawnedChildrenRows({ + entries: [{ threadId: ThreadId.make("solo"), children: [child("y", null)] }], + spawnedByAgent: [], + }), + ).toEqual([{ threadId: "solo", children: [child("y", null)], spawnedByAgent: false }]); + }); + + it("keeps a Crew seat with no thread as unknown, and measures it once its thread arrives", () => { + const known = new Map([ + ["builder", thread("builder", "2026-09-09T10:00:00Z", { runtime: { status: "running" } })], + ]); + const seats = [child("builder", "builder"), child("critic", "critic")]; + const [review] = groupSpawnedChildren(selectSpawnedChildRows(seats, known)); + expect(review!.summary).toBe("2 seats · 1 running · 1 unknown"); + // The seat with no facts sorts last and carries none. + expect(review!.rows.map(({ child, thread }) => [child.threadId, thread?.id ?? null])).toEqual([ + ["builder", "builder"], + ["critic", null], + ]); + const [later] = groupSpawnedChildren( + selectSpawnedChildRows( + seats, + new Map([...known, ["critic", thread("critic", "2026-09-09T11:00:00Z")]]), + ), + ); + expect(later!.summary).toBe("2 seats · 1 running"); + }); + + it("names a Crew with no loaded seat at all instead of dropping it", () => { + const groups = groupSpawnedChildren( + selectSpawnedChildRows([child("builder", "builder"), child("critic", "critic")], new Map()), + ); + expect(groups.map((group) => [group.crew?.crewName ?? null, group.summary])).toEqual([ + ["Review Pair", "2 seats · 2 unknown"], + ]); + expect(stoppableCrew(groups[0]!)).toBeNull(); + expect(spawnedChildrenNeedAttention(groups[0]!.rows)).toBe(false); + }); +}); diff --git a/packages/client-runtime/src/j5/spawnedChildren.ts b/packages/client-runtime/src/j5/spawnedChildren.ts new file mode 100644 index 0000000000000..d94818c5f123d --- /dev/null +++ b/packages/client-runtime/src/j5/spawnedChildren.ts @@ -0,0 +1,202 @@ +import type { EnvironmentId, ThreadId } from "@t3tools/contracts"; +import type { SpawnedChild, SpawnedChildrenEntry } from "@t3tools/contracts/j5"; + +import { scopedThreadKey, scopeThreadRef } from "../environment/scoped.ts"; +import { + crewHasRunningSeat, + formatCrewStateSummary, + summarizeCrewState, + type CrewSeatThread, +} from "./crewState.ts"; + +/** + * List membership (register D22): human-created agents show; agent-spawned Peer Agents (Crew + * members included) appear under their spawner unless the user pinned them. `spawnedByAgent` is + * the spawned-children read's statement of placement provenance. A row the read has not answered + * for shows, never guesses. + */ +export const isSidebarMember = ( + thread: { readonly pinnedAt?: string | null | undefined }, + spawnedByAgent: boolean, +) => !(spawnedByAgent && thread.pinnedAt == null); + +/** What the read says about one visible row: the agents placed under it, and how it came to be. */ +export interface SpawnedChildrenRow { + readonly children: ReadonlyArray; + /** An agent spawned this thread, so it shows under its spawner (register D22). */ + readonly spawnedByAgent: boolean; +} +export type SpawnedChildrenRowEntry = SpawnedChildrenRow & { readonly threadId: ThreadId }; + +/** One entry per requested row the read has something to say about. */ +export const spawnedChildrenRows = (response: { + readonly entries: ReadonlyArray; + readonly spawnedByAgent: ReadonlyArray; +}): ReadonlyArray => { + const children = new Map(response.entries.map((entry) => [entry.threadId, entry.children])); + const spawned = new Set(response.spawnedByAgent); + return [...new Set([...children.keys(), ...spawned])].map((threadId) => ({ + threadId, + children: children.get(threadId) ?? [], + spawnedByAgent: spawned.has(threadId), + })); +}; + +/** The visible rows are the whole truth for their children; parents that lost all children lose their entry. */ +export const replaceSpawnedChildren = ( + previous: ReadonlyMap, + environmentId: EnvironmentId, + requested: ReadonlyArray, + entries: ReadonlyArray, +) => { + const next = new Map(previous); + for (const threadId of requested) + next.delete(scopedThreadKey(scopeThreadRef(environmentId, threadId))); + for (const { threadId, ...row } of entries) + next.set(scopedThreadKey(scopeThreadRef(environmentId, threadId)), row); + return next; +}; + +export interface SpawnedChildThread extends CrewSeatThread { + readonly id: string; +} + +export interface SpawnedChildRow { + readonly child: SpawnedChild; + /** Undefined for a Crew seat whose thread the client holds no facts for: its state is unknown. */ + readonly thread: T | undefined; +} + +const activityOf = (row: SpawnedChildRow) => + row.thread?.updatedAt ?? ""; + +/** + * Live children, most recent first. A Crew seat the client holds no thread for stays as a row + * with no facts, so its Crew never under-counts or vanishes; it sorts last and reads as unknown. + * A solo peer with no thread in client state waits until it arrives. + */ +export function selectSpawnedChildRows( + children: ReadonlyArray, + threadsById: ReadonlyMap, +): ReadonlyArray> { + return children + .flatMap((child): Array> => { + const thread = threadsById.get(child.threadId); + if (thread === undefined) return child.seat === null ? [] : [{ child, thread }]; + return thread.archivedAt !== null + ? [] + : [{ child, thread: { ...thread, notStarted: child.seat?.notStarted ?? false } }]; + }) + .sort((left, right) => activityOf(right).localeCompare(activityOf(left))); +} + +/** The collapsed header's discovery cue: a measured "needs a human" fact on any child. */ +export const spawnedChildrenNeedAttention = ( + rows: ReadonlyArray>, +) => + rows.some( + ({ thread }) => + thread !== undefined && (thread.hasPendingApprovals || thread.hasPendingUserInput), + ); + +/** + * One collapsible group under a Captain's row: a named Crew, or the solo Peer Agents it spawned + * outside any Crew. A Captain that commands several Crews gets one group per Crew, so each can + * be watched, opened, and named on its own. + */ +export interface SpawnedChildGroup { + /** Stable within the parent: `crew:` for a Crew, `agents` for the solo peers. */ + readonly key: string; + readonly crew: { readonly crewInstanceId: string; readonly crewName: string } | null; + readonly rows: ReadonlyArray>; + /** "3 seats · 1 running · 1 needs you" for a Crew, "2 agents" for the solo group. */ + readonly summary: string; + readonly needsAttention: boolean; +} + +const SOLO_GROUP_KEY = "agents"; +const crewGroupKey = (crewInstanceId: string) => `crew:${crewInstanceId}`; + +/** + * Crews first, the one with the newest seat activity on top, then the solo peers. Each Crew's + * summary answers "what is the state of this Crew?" from its seats' measured facts; idle seats + * are the quiet default and stay unsaid. + */ +export const groupSpawnedChildren = ( + rows: ReadonlyArray>, +): ReadonlyArray> => { + const crews = new Map>>(); + const solo: Array> = []; + for (const row of rows) { + if (row.child.seat === null) solo.push(row); + else { + const seats = crews.get(row.child.seat.crewInstanceId) ?? []; + seats.push(row); + crews.set(row.child.seat.crewInstanceId, seats); + } + } + // Rows arrive newest first, so each Crew's first seat carries its newest activity. + const crewGroups = [...crews.entries()] + .sort(([, left], [, right]) => activityOf(right[0]!).localeCompare(activityOf(left[0]!))) + .map(([crewInstanceId, seats]): SpawnedChildGroup => { + const state = formatCrewStateSummary(summarizeCrewState(seats.map(({ thread }) => thread))); + const count = `${seats.length} ${seats.length === 1 ? "seat" : "seats"}`; + return { + key: crewGroupKey(crewInstanceId), + crew: { crewInstanceId, crewName: seats[0]!.child.seat!.crewName }, + rows: seats, + summary: state === null ? count : `${count} · ${state}`, + needsAttention: spawnedChildrenNeedAttention(seats), + }; + }); + if (solo.length === 0) return crewGroups; + return [ + ...crewGroups, + { + key: SOLO_GROUP_KEY, + crew: null, + rows: solo, + summary: `${solo.length} ${solo.length === 1 ? "agent" : "agents"}`, + needsAttention: spawnedChildrenNeedAttention(solo), + }, + ]; +}; + +/** + * Expansion is remembered per group under its parent, so the Crew you watch stays open on + * reload; the environment is part of the key because the same local thread id on two + * environments is two different rows. + */ +export const spawnedGroupExpansionKey = ( + environmentId: string, + parentThreadId: string, + groupKey: string, +) => `${environmentId}/${parentThreadId}/${groupKey}`; + +/** + * The Crew a Stop control on a group's header would stop: the group is a Crew and at least one + * seat has a turn to interrupt. The solo-peer group and an idle Crew offer nothing. + */ +export const stoppableCrew = ( + group: SpawnedChildGroup, +): { readonly crewInstanceId: string; readonly crewName: string } | null => + group.crew !== null && + crewHasRunningSeat(summarizeCrewState(group.rows.map(({ thread }) => thread))) + ? group.crew + : null; + +const counted = (count: number, noun: string) => `${count} ${noun}${count === 1 ? "" : "s"}`; + +/** The collapsed count on the spawner's own row: "3 seats", "2 agents", "2 seats · 1 agent". */ +export const spawnedChildrenCountLabel = ( + groups: ReadonlyArray>, +) => { + let seats = 0; + let agents = 0; + for (const group of groups) + if (group.crew === null) agents += group.rows.length; + else seats += group.rows.length; + return [seats > 0 ? counted(seats, "seat") : null, agents > 0 ? counted(agents, "agent") : null] + .filter((part) => part !== null) + .join(" · "); +}; From eaff762bc280e30d73fba36f0a38c93b22d5cf33 Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Mon, 9 Nov 2026 01:13:05 -0500 Subject: [PATCH 2/6] perf(mobile): seat reads re-render only their own row Co-Authored-By: Claude Opus 5.5 --- apps/mobile/src/j5/crew/CaptainSeats.tsx | 12 +++++----- apps/mobile/src/j5/crew/spawnedChildren.ts | 26 ++++++++++++---------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/apps/mobile/src/j5/crew/CaptainSeats.tsx b/apps/mobile/src/j5/crew/CaptainSeats.tsx index 860e8ccb70a95..f735647fc0ec9 100644 --- a/apps/mobile/src/j5/crew/CaptainSeats.tsx +++ b/apps/mobile/src/j5/crew/CaptainSeats.tsx @@ -50,8 +50,12 @@ const subscribe = (listener: () => void) => { listeners.delete(listener); }; }; -const getExpanded = () => expanded; const expansionKey = (thread: EnvironmentThreadShell) => `${thread.environmentId}/${thread.id}`; +/** One row's expansion, so toggling a row re-renders only that row. */ +const useIsExpanded = (key: string) => { + const read = () => expanded.has(key); + return useSyncExternalStore(subscribe, read, read); +}; const toggle = (key: string) => { const next = new Set(expanded); if (next.has(key)) next.delete(key); @@ -91,7 +95,7 @@ function SeatsToggle(props: { }) { const groups = useGroups(props.thread, props.spawned); const key = expansionKey(props.thread); - const isOpen = useSyncExternalStore(subscribe, getExpanded, getExpanded).has(key); + const isOpen = useIsExpanded(key); if (groups.length === 0) return null; const count = spawnedChildrenCountLabel(groups); const needsAttention = !isOpen && groups.some((group) => group.needsAttention); @@ -128,9 +132,7 @@ export function CaptainSeats(props: { readonly onSelectThread: (thread: EnvironmentThreadShell) => void; }) { const children = useSpawnedChildren(scopeThreadRef(props.thread.environmentId, props.thread.id)); - const isOpen = useSyncExternalStore(subscribe, getExpanded, getExpanded).has( - expansionKey(props.thread), - ); + const isOpen = useIsExpanded(expansionKey(props.thread)); if (!isOpen || children.length === 0) return null; return ; } diff --git a/apps/mobile/src/j5/crew/spawnedChildren.ts b/apps/mobile/src/j5/crew/spawnedChildren.ts index f706ddcda2485..6e5971ce40b3e 100644 --- a/apps/mobile/src/j5/crew/spawnedChildren.ts +++ b/apps/mobile/src/j5/crew/spawnedChildren.ts @@ -110,23 +110,25 @@ export function useCrewListedThreads< requestRows(refs, revisions); }, [connections, key, revisions]); const snapshot = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot); - return useMemo( - () => - threads.filter((thread) => - isSidebarMember( - thread, - snapshot.get(scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id))) - ?.spawnedByAgent === true, - ), + return useMemo(() => { + const listed = threads.filter((thread) => + isSidebarMember( + thread, + snapshot.get(scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id))) + ?.spawnedByAgent === true, ), - [threads, snapshot], - ); + ); + // The same array when nothing was dropped, so the list's own memos keep their values. + return listed.length === threads.length ? threads : listed; + }, [threads, snapshot]); } const EMPTY: ReadonlyArray = []; /** The agents placed under one thread, as last read. */ export function useSpawnedChildren(ref: ScopedThreadRef): ReadonlyArray { - const snapshot = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot); - return snapshot.get(scopedThreadKey(ref))?.children ?? EMPTY; + const key = scopedThreadKey(ref); + // Per row: a batch keeps untouched rows' values, so other rows' updates skip this one. + const read = () => store.getSnapshot().get(key)?.children ?? EMPTY; + return useSyncExternalStore(store.subscribe, read, read); } From 6c7a1907494f7998b5c48dc3ab0aed032b0d019c Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Mon, 9 Nov 2026 02:30:45 -0500 Subject: [PATCH 3/6] docs(fork): keep the client-runtime ledger cell inside the table's width Co-Authored-By: Claude Opus 5.5 --- FORK.md | 784 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 392 insertions(+), 392 deletions(-) diff --git a/FORK.md b/FORK.md index 6432ebf0ba5ce..ea58c5ca5c450 100644 --- a/FORK.md +++ b/FORK.md @@ -725,398 +725,398 @@ supplies one of them. `R` means retained edit, `A` adapted prior edit, and `N` n upstream path. These history letters do not indicate approval. The deleted hook remains explicitly marked. -| Upstream-owned path | History | Contract | -| --------------------------------------------------------------------------- | ------- | ------------------------------------------------------ | -| `.agents/skills/test-t3-app/SKILL.md` | N | 68 | -| `.github/SECURITY.md` (deleted) | N | B | -| `.github/workflows/ci.yml` | A | C | -| `.github/workflows/mobile-fingerprint-check.yml` | R | C | -| `.gitignore` | R | H | -| `apps/desktop/package.json` | R | B | -| `apps/desktop/resources/dmg/dmg-background-latest.svg` | R | B | -| `apps/desktop/resources/dmg/dmg-background-nightly.svg` | R | B | -| `apps/desktop/scripts/electron-launcher.mjs` | R | B, H | -| `apps/desktop/scripts/electron-launcher.test.mjs` | R | B, H | -| `apps/desktop/src/app/DesktopApp.ts` | N | B | -| `apps/desktop/src/app/DesktopAppIdentity.test.ts` | R | B | -| `apps/desktop/src/app/DesktopClerk.test.ts` | R | B, 76 | -| `apps/desktop/src/app/DesktopConfig.ts` | R | B, H | -| `apps/desktop/src/app/DesktopConnectionCatalogStore.test.ts` | R | B | -| `apps/desktop/src/app/DesktopPreReadyPlatform.test.ts` | N | B | -| `apps/desktop/src/app/DesktopEarlyElectronStartup.test.ts` | R | B, H | -| `apps/desktop/src/app/DesktopEarlyElectronStartup.ts` | R | B, H | -| `apps/desktop/src/app/DesktopEnvironment.test.ts` | R | B, H | -| `apps/desktop/src/app/DesktopEnvironment.ts` | R | B, H | -| `apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts` | R | B | -| `apps/desktop/src/app/DesktopObservability.test.ts` | R | B, H | -| `apps/desktop/src/app/DesktopStatePaths.ts` | R | B, H | -| `apps/desktop/src/backend/DesktopBackendConfiguration.test.ts` | R | B, H, 50 | -| `apps/desktop/src/backend/DesktopBackendConfiguration.ts` | R | B, H, 50 | -| `apps/desktop/src/backend/DesktopBackendManager.ts` | R | B, H | -| `apps/desktop/src/backend/DesktopServerExposure.test.ts` | R | B | -| `apps/desktop/src/electron/ElectronProtocol.ts` | R | B | -| `apps/desktop/src/settings/DesktopAppSettings.test.ts` | R | B, H | -| `apps/desktop/src/settings/DesktopClientSettings.test.ts` | R | B, H | -| `apps/desktop/src/settings/DesktopSavedEnvironments.test.ts` | R | B, H | -| `apps/desktop/src/updates/updatesTestHarness.ts` | N | B, H | -| `apps/desktop/src/window/DesktopWindow.test.ts` | R | B, H | -| `apps/desktop/src/wsl/DesktopWslEnvironment.test.ts` | N | 50 | -| `apps/desktop/src/wsl/DesktopWslEnvironment.ts` | N | 50 | -| `apps/desktop/src/wsl/DesktopWslServerTree.test.ts` | R | B | -| `apps/mobile/app.config.ts` | A | B | -| `apps/mobile/metro.config.js` | A | 113 | -| `apps/mobile/package.json` | A | B, 45 | -| `apps/mobile/src/features/threads/NewTaskDraftScreen.tsx` | A | 45, 90, 100, Saved-agent mentions | -| `apps/mobile/src/features/threads/ThreadDetailScreen.tsx` | A | 45, 49, 114 | -| `apps/mobile/src/features/threads/ThreadRouteScreen.tsx` | A | 69, 90, 99 | -| `apps/mobile/src/features/settings/SettingsRouteScreen.tsx` | A | 72, Role library, 105 | -| `apps/mobile/src/features/settings/components/SettingsScreen.tsx` | N | 72 | -| `apps/mobile/src/features/settings/settings-environment-filter.tsx` | N | 72 | -| `apps/mobile/src/Stack.tsx` | A | 72, 98, 101, 103, Role library, 105, 114 | -| `apps/mobile/src/features/home/ThreadListToolbar.tsx` | N | 102 | -| `apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx` | N | 102 | -| `apps/mobile/src/features/archive/ArchivedThreadsRouteScreen.tsx` | N | 72 | -| `apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx` | N | 90 | -| `apps/mobile/src/features/threads/ThreadFeed.tsx` | N | 90 | -| `apps/mobile/src/features/threads/NewTaskRouteScreen.tsx` | N | 90 | -| `apps/mobile/src/features/projects/AddProjectScreen.tsx` | N | 90 | -| `apps/mobile/src/lib/filePreview.test.ts` | N | 90 | -| `apps/mobile/src/features/projects/AddProjectScreen.test.ts` | N | 90 | -| `apps/mobile/src/features/threads/new-task-flow-provider.tsx` | A | 45, 90 | -| `apps/mobile/src/features/threads/use-composer-command-menu.ts` | A | 45, 49 | -| `apps/mobile/src/features/threads/use-composer-command-menu.test.ts` | A | 45, 49 | -| `apps/mobile/src/state/use-thread-composer-state.ts` | A | 45 | -| `apps/mobile/src/App.tsx` | R | B, 21, 70 | -| `apps/mobile/src/connection/runtime.ts` | N | 70 | -| `apps/mobile/src/features/connection/permissionUpdateNotice.ts` | N | 73 | -| `apps/mobile/src/features/connection/pairing.test.ts` | R | B | -| `apps/mobile/src/features/connection/pairing.ts` | R | B | -| `apps/mobile/src/widgets/AgentActivity.tsx` | R | B | -| `apps/server/package.json` | N | B | -| `apps/server/scripts/migrate-dev-db.test.ts` | R | H | -| `apps/server/scripts/migrate-dev-db.ts` | A | H | -| `apps/server/scripts/t3-sqlite-state.test.ts` | R | H | -| `apps/server/scripts/t3-sqlite-state.ts` | A | H | -| `apps/server/src/auth/EnvironmentAuth.ts` | N | 70 | -| `apps/server/src/auth/http.ts` | N | 70 | -| `apps/server/src/binCli.ts` | N | 35, 82, B | -| `apps/server/src/cli/app.test.ts` | N | H | -| `apps/server/src/cli/app.ts` | N | H | -| `apps/server/src/cli/config.test.ts` | A | H | -| `apps/server/src/cli/config.ts` | R | H | -| `apps/server/src/cli/pair.test.ts` | R | H, 79 | -| `apps/server/src/cli/auth.ts` | N | 79 | -| `apps/server/src/cli/pair.ts` | R | H, 79 | -| `apps/server/src/cli/server.ts` | N | B | -| `apps/server/src/cli/theme.test.ts` | N | H | -| `apps/server/src/cli/theme.ts` | N | H, B | -| `apps/server/src/cli/triage.ts` | N | H | -| `apps/server/src/cli/uninstall.ts` | N | 40, 52 | -| `apps/server/src/cli/update.ts` | N | 40, 53 | -| `apps/server/src/device/EasDeviceHost.test.ts` | N | B | -| `apps/server/src/device/EasDeviceHost.ts` | N | B | -| `apps/server/src/cloud/pinnedRuntime.test.ts` | N | 50 | -| `apps/server/src/cloud/pinnedRuntime.ts` | N | 50 | -| `apps/server/src/cloud/selfUpdate.test.ts` | N | 50 | -| `apps/server/src/cloud/servicePreflight.ts` | N | B, 50 | -| `apps/server/src/cloud/serviceProtocol.ts` | N | 50 | -| `apps/server/src/provider/Drivers/ClaudeSkills.test.ts` | N | 43 | -| `apps/server/src/provider/Drivers/ClaudeSkills.ts` | N | 42–44 | -| `apps/server/src/provider/ClaudeProvider.ts` | N | 43 | -| `apps/server/src/provider/CodexProvider.ts` | N | 43 | -| `apps/server/src/provider/ProviderRegistry.test.ts` | N | 42, 43 | -| `apps/server/src/provider/ProviderRegistry.ts` | N | 42, 43 | -| `apps/server/src/provider/providerMaintenanceRunner.test.ts` | N | 42 | -| `apps/server/src/provider/testUtils/providerRegistryMock.ts` | N | 42 | -| `apps/server/src/serverRuntimeStartup.ts` | N | 51 | -| `apps/server/src/serverSettings.test.ts` | N | 42 | -| `apps/server/src/serverSettings.ts` | N | 42 | -| `apps/server/src/serviceLauncher.test.ts` | N | 50, 85 | -| `apps/web/src/components/settings/settingsSearch.test.ts` | N | 43 | -| `apps/web/src/threadNotifications.ts` | N | 87, 108 | -| `apps/web/src/threadNotifications.test.ts` | N | 108 | -| `apps/web/src/components/settings/SettingsPanels.tsx` | N | 87, 108 | -| `apps/web/src/components/settings/settingsSearch.ts` | N | 42–44, 72, 77, 87, 92, 105, 108 | -| `apps/web/src/components/settings/SettingsSidebarNav.tsx` | N | 42, 72, 73 | -| `knip.jsonc` | N | 95 | -| `packages/client-runtime/src/state/runtime.test.ts` | N | 42 | -| `packages/client-runtime/src/state/threadWorkflows.ts` | N | 109 | -| `packages/client-runtime/src/state/threadWorkflows.test.ts` | N | 109 | -| `packages/contracts/src/auth.ts` | N | 35 | -| `packages/contracts/src/environmentHttp.ts` | N | 70 | -| `apps/server/src/cloud/bootService.test.ts` | A | H, 50 | -| `apps/server/src/cloud/bootService.ts` | A | H | -| `apps/server/src/environment/ServerEnvironment.test.ts` | N | 34, 48 | -| `apps/server/src/environment/ServerEnvironment.ts` | N | 34, 48 | -| `apps/server/src/environment/ServerEnvironmentLabel.ts` | N | 67 | -| `apps/server/src/httpCors.ts` | N | B | -| `apps/server/src/mcp/McpHttpServer.ts` | R | 2 | -| `apps/server/src/mcp/OrchestratorMcpService.ts` | A | Saved-agent mentions, 107 | -| `packages/contracts/src/previewAutomation.ts` | N | 74 | -| `apps/server/src/preview/ServerBrowserStream.ts` | N | Preview stream session invalidation (#798) | -| `apps/server/src/preview/ServerBrowserStream.test.ts` | N | Preview stream session invalidation (#798) | -| `apps/server/src/preview/ServerBrowser.test.ts` | N | 74 | -| `apps/server/src/preview/ServerBrowser.ts` | N | 74, B | -| `apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts` | A | 8, 47, Saved-agent mentions | -| `apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts` | N | 47, 89, Saved-agent mentions, Role library | -| `apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts` | A | 8, N, Saved-agent mentions | -| `apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts` | A | 8, 47, N, Saved-agent mentions, Role library | -| `packages/provider-core/src/server/ProviderAdapter.ts` | R | 47, 60, N, Role library | -| `packages/provider-core/src/server/orchestrationInstructions.ts` | N | 8, B | -| `packages/provider-pi/src/server/mcpExtensionSource.test.ts` | N | 8 | -| `apps/server/src/orchestration-v2/ProviderTurnControlService.test.ts` | N | 106 | -| `apps/server/src/orchestration-v2/ProviderTurnControlService.ts` | R | 26, 106 | -| `apps/server/src/orchestration-v2/ProviderTurnStartService.test.ts` | A | N, 106, Role library | -| `apps/server/src/orchestration-v2/ProviderTurnStartService.ts` | A | 30, N, 106 | -| `packages/contracts/src/orchestrationV2.ts` | N | 106 | -| `apps/server/src/orchestration-v2/RunFinalizationService.ts` | R | 30 | -| `apps/server/src/orchestration-v2/ThreadLaunchService.ts` | R | Saved-agent launch, 111 | -| `apps/server/src/orchestration-v2/runtimeLayer.test.ts` | R | 3 | -| `apps/server/src/orchestration-v2/ThreadSearch.ts` | N | 69, 91 | -| `apps/server/src/orchestration-v2/ThreadSearch.test.ts` | N | 69 | -| `apps/server/src/orchestration-v2/runtimeLayer.ts` | R | 5, 21, 26, 30, 38, 91, 106 | -| `apps/server/src/os-jank.ts` | R | H | -| `apps/server/src/persistence/Sqlite.ts` | A | 1, 31 | -| `apps/server/src/project/RepositoryIdentityResolver.test.ts` | N | gh default repository patch | -| `apps/server/src/project/RepositoryIdentityResolver.ts` | N | gh default repository patch | -| `apps/server/src/server.ts` | A | 5, 9, MCP idle connection patch, 53, 69, 70 | -| `apps/server/src/serviceLauncher.ts` | R | H, 50, 85 | -| `apps/server/src/storageCleanup.ts` | N | Git 2.56 gitfile patch | -| `apps/server/src/telemetry/AnalyticsService.ts` | N | B, 63, 86 | -| `apps/server/src/telemetry/FeatureUsage.ts` | N | 96 | -| `apps/server/src/testUtils/shardWeights.json` | N | 65 | -| `apps/server/src/ws.ts` | A | 37, 42, 58, 78, Role library, Saved-agent mentions | -| `apps/server/src/ws.ts` (the access gate and view) | N | 69 | -| `apps/web/index.html` | R | B | -| `apps/web/src/branding.ts` | R | B | -| `apps/web/src/commandPaletteBus.ts` | R | 42 | -| `packages/contracts/src/index.ts` | N | 42, 44 | -| `packages/contracts/src/rpc.ts` | A | 42, 44, 45, 64, 69 | -| `packages/contracts/src/clientRpcPermissions.ts` | N | 64 | -| `packages/client-runtime/src/rpc/client.ts` | A | 45, 64, 69, 73 | -| `apps/web/src/composer-logic.ts` | A | 45, 49 | -| `apps/server/src/auth/RpcAuthorization.ts` | A | 42, 44, 45, 64 | -| `apps/web/src/components/AppSidebarLayout.tsx` | N | 75 | -| `apps/web/src/components/ChatView.tsx` | A | 33, 45, 69, Role library, Saved-agent mentions | -| `apps/web/src/connection/runtime.ts` | N | 70 | -| `apps/web/src/environments/primary/auth.ts` | N | 70 | -| `apps/web/src/components/CommandPalette.tsx` | A | 42, 71, 75, 90, 34 | -| `apps/web/src/components/ConfirmDialogHost.tsx` | R | 22 | -| `apps/web/src/components/Sidebar.logic.test.ts` | R | 23 | -| `apps/web/src/components/Sidebar.tsx` | A | 21–23, 71, 73, 90 | -| `apps/web/src/components/chat/ChatComposer.tsx` | A | Saved-agent mentions, Role library, 45, 49, 73, 91 | -| `apps/web/src/components/chat/timelineMinimapItems.ts` | A | 24 | -| `apps/web/src/components/chat/MessagesTimeline.tsx` | A | 24, 80, 104 | -| `apps/web/src/components/chat/QueuedRunsControl.tsx` | A | 24, 80 | -| `apps/web/src/components/sidebar/SidebarChrome.tsx` | A | 6, 33, 75, B | -| `apps/web/src/onboarding/firstRun.ts` | N | 75 | -| `apps/web/src/confirmDialog.test.ts` | R | 22 | -| `apps/web/src/confirmDialog.ts` | R | 22 | -| `apps/web/src/contextMenuFallback.ts` | N | 71 | -| `apps/web/src/hooks/useThreadActionMenu.ts` | A | 21, 69, 71 | -| `apps/web/src/hooks/useThreadActionMenu.test.ts` | A | 71 | -| `apps/web/src/components/chat/ChatHeader.tsx` | N | 73, 90 | -| `apps/web/src/components/chat/ThreadDetailsPanel.tsx` | N | 73 | -| `apps/web/src/components/settings/SettingsScopeSentence.tsx` | N | 72 | -| `apps/web/src/components/settings/SettingsScopeContext.tsx` | N | 72 | -| `apps/web/src/components/settings/useAvailableSettingsSearchItems.ts` | N | 72 | -| `apps/web/src/components/settings/useSettingsProjectGroups.ts` | N | 72 | -| `apps/web/src/routes/_chat.settings.tsx` | N | 72 | -| `apps/web/src/components/GitActionsControl.tsx` | N | 90 | -| `apps/web/src/components/BranchToolbarBranchSelector.tsx` | N | 90 | -| `apps/web/src/lib/chatThreadActions.ts` | N | 90 | -| `apps/web/src/hooks/useScratchProject.ts` | N | 90 | -| `apps/web/src/components/chat/TimelineAssistantRows.tsx` | N | 90 | -| `apps/web/src/components/chat/ThreadRelationshipsControl.tsx` | N | 90 | -| `apps/web/src/components/chat/composerCommandKey.ts` | N | 91 | -| `apps/web/src/routes/welcome.tsx` | N | 73 | -| `apps/web/src/components/PermissionUpdateNotice.ts` | N | 73 | -| `apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx` | N | 80 | -| `apps/web/src/routes/pair.tsx` | N | 73 | -| `apps/web/src/routes/__root.tsx` | N | 71, 73 | -| `apps/web/src/routes/_chat.index.tsx` | R | B, 73 | -| `apps/web/src/shortcuts/chatRouteCommands.ts` | N | B | -| `apps/web/src/routeTree.gen.ts` | R | generated route registrations for 6/9 | -| `apps/web/src/components/onboarding/WelcomeWizard.tsx` | R | 39, B | -| `apps/web/tsconfig.json` | R | B | -| `packages/client-runtime/package.json` | R | 7, 23, 34, 45, 69, 70, 75, 101, 114, 115, Role library | -| `packages/client-runtime/src/connection/compatibility.ts` | A | 56 | -| `packages/client-runtime/src/operations/commands.ts` | R | Saved-agent mentions | -| `packages/contracts/package.json` | N | 34 | -| `packages/contracts/src/environment.ts` | N | 34, 48 | -| `packages/contracts/src/server.test.ts` | N | 43 | -| `packages/contracts/src/server.ts` | N | 42, 43 | -| `packages/contracts/src/settings.test.ts` | N | 42 | -| `packages/contracts/src/settings.ts` | N | 42, B, 105, 107 | -| `packages/shared/package.json` | N | 43, 46, 49, 52 | -| `packages/shared/src/devHome.test.ts` | R | H | -| `packages/shared/src/paletteSearch.test.ts` | N | B | -| `apps/mobile/src/features/settings/environment-maintenance.test.ts` | N | 40 | -| `apps/server/src/provider/testing/ProviderInstanceRegistryLive.fixture.mjs` | N | 43 | -| `packages/provider-cursor/src/server/status.test.ts` | N | B | -| `apps/server/src/provider/CodexDeveloperInstructions.test.ts` | N | 8 | -| `apps/web/test/appScenarios.renders.tsx` | N | 80 | -| `apps/mobile/src/features/home/useThreadListActions.ts` | N | 21 | -| `apps/web/test/renderScenarios.renders.tsx` | N | 80 | -| `packages/shared/src/devHome.ts` | R | H | -| `packages/ssh/src/tunnel.ts` | R | H, 50 | -| `pnpm-lock.yaml` | N | 45 | -| `scripts/build-cli-archive.ts` | N | 50 | -| `scripts/build-desktop-artifact.test.ts` | A | B, S, 50 | -| `scripts/build-desktop-artifact.ts` | R | B, S, 50 | -| `scripts/check-changed.ts` | N | 93 | -| `scripts/dev-runner.test.ts` | R | H, 63, 83, 88 | -| `scripts/dev-runner.ts` | R | H, 63, 83, 88 | -| `scripts/export-android-icons.ts` | N | B | -| `scripts/install.ps1` | N | 40, 50 | -| `scripts/install.sh` | N | 40, 50, 52 | -| `scripts/smoke-cli-archive.ts` | N | 50 | -| `vite.config.ts` | R | H | -| `apps/web/src/composer-logic.test.ts` | N | 49 | -| `apps/web/src/components/chat/ComposerCommandMenu.tsx` | A | 49, Saved-agent mentions | -| `packages/shared/src/composerTrigger.ts` | A | 49, Saved-agent mentions | -| `packages/shared/src/composerInlineTokens.ts` | A | 49, Saved-agent mentions | -| `apps/mobile/src/features/threads/ComposerCommandPopover.tsx` | A | 49, Saved-agent mentions | -| `apps/mobile/src/features/threads/ThreadFeed.tsx` | N | 97, 98 | -| `apps/mobile/src/features/threads/ThreadQueueControl.tsx` | N | 97, 99 | -| `apps/mobile/src/lib/filePreview.test.ts` | N | 97, 99 | -| `apps/mobile/src/features/threads/thread-search-match.tsx` | N | 99 | -| `apps/mobile/src/features/threads/thread-work-log.tsx` | N | 99 | -| `apps/mobile/src/features/threads/thread-list-v2-items.tsx` | N | 115 | -| `apps/mobile/src/features/threads/useThreadListV2.ts` | N | 115 | -| `apps/mobile/src/features/threads/useThreadListV2.test.tsx` | N | 115 | -| `apps/mobile/src/features/threads/ThreadComposer.tsx` | A | 49, 100, Role library, Saved-agent mentions | -| `apps/mobile/src/state/threadOutboxDelivery.ts` | A | Saved-agent mentions | -| `assets/dev/app-icon.icon/Assets/annotations.svg` | N | B | -| `assets/dev/app-icon.icon/Assets/text.svg` | N | B | -| `assets/dev/app-icon.icon/icon.json` | N | B | -| `assets/nightly/app-icon.icon/Assets/text.svg` | N | B | -| `assets/nightly/app-icon.icon/icon.json` | N | B | -| `assets/prod/app-icon.icon/Assets/text.svg` | N | B | -| `assets/prod/app-icon.icon/icon.json` | N | B | -| `.github/workflows/desktop-macos-preview-publish.yml` | N | C | -| `.github/workflows/mobile-eas-preview.yml` | N | C | -| `.github/workflows/thread-transfer-report.yml` | N | C | -| `.github/ISSUE_TEMPLATE/bug_report.yml` | N | J5 CI and packaging | -| `.github/ISSUE_TEMPLATE/config.yml` | N | J5 CI and packaging | -| `.github/workflows/desktop-macos-preview.yml` | N | C | -| `.github/workflows/issue-labels.yml` | N | C | -| `.github/workflows/mobile-showcase-screenshots.yml` | N | C | -| `.github/workflows/pr-size.yml` | N | J5 CI and packaging | -| `.github/workflows/web-preview.yml` | N | C | -| `.github/workflows/windows-tests.yml` | N | C | -| `apps/server/src/mcp/McpInvocationContext.ts` | N | 2, 33, B | -| `apps/desktop/src/app/DesktopAppIdentity.ts` | N | B | -| `apps/desktop/src/app/DesktopCliCommand.ts` | N | 57 | -| `apps/desktop/src/app/DesktopCliShim.ts` | N | 57, H | -| `apps/desktop/src/app/DesktopUserData.ts` | N | H | -| `apps/desktop/src/compileCache.ts` | N | H | -| `apps/server/src/cli/browser.ts` | N | H, B | -| `apps/server/src/cli/invocation.ts` | N | 40 | -| `apps/server/src/cli/trace.ts` | N | H | -| `apps/server/src/mcp/McpSessionRegistry.ts` | N | 33 | -| `apps/server/src/observability/RpcInstrumentation.ts` | N | 58 | -| `packages/provider-acp/src/server/adapter.ts` | N | B | -| `packages/provider-cursor/src/server/adapter.ts` | N | B | -| `packages/provider-opencode/src/server/v2/adapter.ts` | N | B | -| `packages/provider-opencode/src/server/adapter.ts` | N | N | -| `apps/server/src/orchestration-v2/Orchestrator.ts` | N | Role library, Saved-agent mentions, 106 | -| `apps/server/src/orchestration-v2/ProjectionStore.ts` | N | Role library | -| `apps/server/src/orchestration-v2/RuntimePolicy.ts` | N | 47, Role library | -| `apps/server/src/orchestration-v2/ThreadManagementService.ts` | N | 26 | -| `apps/server/src/provider/providerCompatibility.ts` | N | 59, B | -| `apps/server/src/scheduledTasks/ScheduledTaskService.ts` | N | 12 | -| `apps/web/src/components/ServerUpdateAction.tsx` | N | 40, B | -| `apps/web/src/components/settings/CliCommandSettingsRow.tsx` | N | 57 | -| `apps/web/src/components/settings/ConnectionsSettings.tsx` | N | 48, B | -| `apps/web/src/components/sidebar/mainAppLocation.ts` | N | 6, 33 | -| `apps/web/src/legalLinks.ts` | N | B | -| `apps/web/src/versionSkew.ts` | N | 40 | -| `packages/client-runtime/src/state/environmentHttpAuth.ts` | N | 34 | -| `packages/contracts/src/scheduledTask.ts` | N | 12 | -| `packages/shared/src/codexAuthHandoff.ts` | N | B | -| `packages/shared/src/git.ts` | N | B | -| `packages/shared/src/providerAuthReturnUrl.ts` | N | B | -| `apps/server/src/orchestration-v2/RestartContinuation.ts` | N | B | -| `apps/server/src/process/agentScope.ts` | N | 25 | -| `apps/server/src/serverOwnership.ts` | N | B, 25, 84 | -| `apps/web/src/components/chat/RightPanelSurfaceContent.tsx` | N | 33 | -| `apps/web/src/components/promptLinks/copyPromptLink.ts` | N | 76 | -| `apps/web/src/components/settings/MobileAppSettingsRow.tsx` | N | 77 | -| `packages/provider-core/src/server/subagentProjection.ts` | N | Role library | -| `packages/provider-cursor/src/server/accountUsage.ts` | N | B | -| `packages/provider-opencode/src/settings.ts` | N | B | -| `packages/shared/src/cliRelease.ts` | N | 40 | -| `packages/shared/src/promptLinks.test.ts` | N | 76 | -| `packages/shared/src/promptLinks.ts` | N | B, 76 | -| `packages/shared/src/projectSettings.test.ts` | N | 107 | -| `apps/web/src/components/chat/TimelineUserMessageRow.tsx` | N | 7, 80, B | -| `apps/web/src/components/chat/timelineRowContext.ts` | N | 24 | -| `apps/web/src/components/chat/TimelineWorkEntryRow.tsx` | N | 80 | -| `apps/web/src/components/chat/chatViewSend.ts` | N | 80 | -| `apps/web/src/components/chat/MarkdownFileLink.tsx` | N | 33 | -| `apps/web/src/components/ChatMarkdown.tsx` | N | 33 | -| `apps/web/src/components/RightPanelTabs.tsx` | N | 33, B | -| `apps/web/src/components/pullRequest/PullRequestsPage.tsx` | N | 33, B | -| `apps/web/src/components/sidebar/SidebarThreadRow.tsx` | N | 23, 94 | -| `apps/web/src/components/chat/useComposerSend.ts` | N | 19, 45, Saved-agent mentions | -| `apps/web/src/components/chat/useProposedPlanSend.ts` | N | 45 | -| `apps/web/src/components/chat/useComposerMenuItems.ts` | N | 49, Saved-agent mentions | -| `apps/web/src/components/chat/ComposerControlsBar.tsx` | N | Saved-agent mentions | -| `apps/web/src/components/desktopUpdate.logic.ts` | N | 40, B | -| `apps/server/src/serverRuntimeState.test.ts` | N | 84 | -| `apps/server/src/ws.test.ts` | N | 69, 78 | -| `apps/server/vite.config.ts` | N | 86 | -| `.github/workflows/stale-needs-more-info.yml` | N | C | -| `.github/workflows/relay-preview.yml` | N | C | -| `.github/workflows/relay-preview-cleanup.yml` | N | C | -| `apps/web/src/components/chat/MessagesTimeline.browser.test.tsx` | N | 7, 80 | -| `apps/web/src/components/chat/QueuedRunsControl.browser.test.tsx` | N | 80 | -| `apps/web/src/components/settings/ProjectSettingsPanel.browser.test.tsx` | N | 72 | -| `apps/web/src/components/chat/guestShareAvailability.ts` | N | 92 | -| `apps/web/src/components/settings/LabsSettingsPanel.tsx` | N | 92 | -| `apps/web/src/lib/bootError.ts` | N | B | -| `apps/web/src/lib/bootError.test.ts` | N | B | -| `packages/contracts/src/orchestratorMcp.ts` | N | B | -| `scripts/mobile-native-client.ts` | N | B | -| `packages/contracts/src/threadSearch.ts` | N | 94 | -| `apps/web/src/components/ThreadSearchMatch.tsx` | N | 94 | -| `apps/web/src/components/CommandPalette.logic.ts` | N | 94 | -| `apps/web/src/components/CommandPaletteThreadItems.tsx` | N | 94 | -| `.github/workflows/agent-context-budget.yml` | N | C, 110 | -| `.github/workflows/mobile-eas-preview-fork.yml` | N | C | -| `.github/workflows/mobile-fingerprint-label.yml` | N | C | -| `apps/server/src/provider/AgentContextBudget.test.ts` | N | 110 | -| `apps/server/src/provider/agentContextBudget.json` | N | 110 | -| `apps/server/src/mcp/McpToolAccess.ts` | N | 2 | -| `packages/shared/src/threadLinks.ts` | N | 76 | -| `apps/web/src/components/settings/settingsLayout.tsx` | N | 112 | -| `apps/web/src/components/settings/LinkedEnvironmentsSettings.tsx` | N | 112 | -| `apps/server/src/mcp/toolkits/project/handlers.test.ts` | N | 76, 111 | -| `apps/server/src/mcp/toolkits/project/handlers.ts` | N | 111 | -| `packages/shared/src/threadLinks.test.ts` | N | 76 | -| `apps/mobile/app.config.test.ts` | N | B, 76 | -| `apps/web/public/.well-known/apple-app-site-association.json` | N | B, 76 | -| `apps/web/public/.well-known/assetlinks.json` | N | B, 76 | -| `apps/web/src/components/chat/threadDetailsItems.ts` | N | 73 | -| `apps/web/src/components/sidebar/SidebarProjectFolderHeader.tsx` | N | 90 | -| `apps/mobile/src/features/threads/new-task-flow-provider.test.tsx` | N | 90 | -| `apps/web/src/components/CommandPalette.composition.browser.test.tsx` | N | 90 | -| `apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx` | N | 90 | -| `apps/web/src/components/onboarding/WelcomeWizard.import.browser.test.tsx` | N | 39 | -| `packages/provider-core/src/server/orchestrationInstructions.test.ts` | N | B, 8 | -| `apps/server/src/cli/up.ts` | N | B, 79 | -| `apps/server/src/cliCompileCache.ts` | N | B, H | -| `packages/shared/src/managedPolicyFile.ts` | N | B | -| `apps/server/src/policy/policyTemplates.ts` | N | B | -| `apps/server/src/cli/policy.ts` | N | B | -| `apps/server/src/cloud/serviceProtection.ts` | N | B | -| `apps/desktop/src/app/DesktopStartupRecovery.ts` | N | B | -| `apps/server/src/triage/TriageService.ts` | N | B | -| `apps/server/src/triage/triagePrompt.ts` | N | B | -| `apps/web/src/components/GitHubStarPrompt.tsx` | N | B | -| `apps/web/src/components/GitHubStarPrompt.test.ts` | N | B | -| `apps/web/src/components/ui/standalone-page.tsx` | N | B | +| Upstream-owned path | History | Contract | +| --------------------------------------------------------------------------- | ------- | -------------------------------------------------- | +| `.agents/skills/test-t3-app/SKILL.md` | N | 68 | +| `.github/SECURITY.md` (deleted) | N | B | +| `.github/workflows/ci.yml` | A | C | +| `.github/workflows/mobile-fingerprint-check.yml` | R | C | +| `.gitignore` | R | H | +| `apps/desktop/package.json` | R | B | +| `apps/desktop/resources/dmg/dmg-background-latest.svg` | R | B | +| `apps/desktop/resources/dmg/dmg-background-nightly.svg` | R | B | +| `apps/desktop/scripts/electron-launcher.mjs` | R | B, H | +| `apps/desktop/scripts/electron-launcher.test.mjs` | R | B, H | +| `apps/desktop/src/app/DesktopApp.ts` | N | B | +| `apps/desktop/src/app/DesktopAppIdentity.test.ts` | R | B | +| `apps/desktop/src/app/DesktopClerk.test.ts` | R | B, 76 | +| `apps/desktop/src/app/DesktopConfig.ts` | R | B, H | +| `apps/desktop/src/app/DesktopConnectionCatalogStore.test.ts` | R | B | +| `apps/desktop/src/app/DesktopPreReadyPlatform.test.ts` | N | B | +| `apps/desktop/src/app/DesktopEarlyElectronStartup.test.ts` | R | B, H | +| `apps/desktop/src/app/DesktopEarlyElectronStartup.ts` | R | B, H | +| `apps/desktop/src/app/DesktopEnvironment.test.ts` | R | B, H | +| `apps/desktop/src/app/DesktopEnvironment.ts` | R | B, H | +| `apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts` | R | B | +| `apps/desktop/src/app/DesktopObservability.test.ts` | R | B, H | +| `apps/desktop/src/app/DesktopStatePaths.ts` | R | B, H | +| `apps/desktop/src/backend/DesktopBackendConfiguration.test.ts` | R | B, H, 50 | +| `apps/desktop/src/backend/DesktopBackendConfiguration.ts` | R | B, H, 50 | +| `apps/desktop/src/backend/DesktopBackendManager.ts` | R | B, H | +| `apps/desktop/src/backend/DesktopServerExposure.test.ts` | R | B | +| `apps/desktop/src/electron/ElectronProtocol.ts` | R | B | +| `apps/desktop/src/settings/DesktopAppSettings.test.ts` | R | B, H | +| `apps/desktop/src/settings/DesktopClientSettings.test.ts` | R | B, H | +| `apps/desktop/src/settings/DesktopSavedEnvironments.test.ts` | R | B, H | +| `apps/desktop/src/updates/updatesTestHarness.ts` | N | B, H | +| `apps/desktop/src/window/DesktopWindow.test.ts` | R | B, H | +| `apps/desktop/src/wsl/DesktopWslEnvironment.test.ts` | N | 50 | +| `apps/desktop/src/wsl/DesktopWslEnvironment.ts` | N | 50 | +| `apps/desktop/src/wsl/DesktopWslServerTree.test.ts` | R | B | +| `apps/mobile/app.config.ts` | A | B | +| `apps/mobile/metro.config.js` | A | 113 | +| `apps/mobile/package.json` | A | B, 45 | +| `apps/mobile/src/features/threads/NewTaskDraftScreen.tsx` | A | 45, 90, 100, Saved-agent mentions | +| `apps/mobile/src/features/threads/ThreadDetailScreen.tsx` | A | 45, 49, 114 | +| `apps/mobile/src/features/threads/ThreadRouteScreen.tsx` | A | 69, 90, 99 | +| `apps/mobile/src/features/settings/SettingsRouteScreen.tsx` | A | 72, Role library, 105 | +| `apps/mobile/src/features/settings/components/SettingsScreen.tsx` | N | 72 | +| `apps/mobile/src/features/settings/settings-environment-filter.tsx` | N | 72 | +| `apps/mobile/src/Stack.tsx` | A | 72, 98, 101, 103, Role library, 105, 114 | +| `apps/mobile/src/features/home/ThreadListToolbar.tsx` | N | 102 | +| `apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx` | N | 102 | +| `apps/mobile/src/features/archive/ArchivedThreadsRouteScreen.tsx` | N | 72 | +| `apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx` | N | 90 | +| `apps/mobile/src/features/threads/ThreadFeed.tsx` | N | 90 | +| `apps/mobile/src/features/threads/NewTaskRouteScreen.tsx` | N | 90 | +| `apps/mobile/src/features/projects/AddProjectScreen.tsx` | N | 90 | +| `apps/mobile/src/lib/filePreview.test.ts` | N | 90 | +| `apps/mobile/src/features/projects/AddProjectScreen.test.ts` | N | 90 | +| `apps/mobile/src/features/threads/new-task-flow-provider.tsx` | A | 45, 90 | +| `apps/mobile/src/features/threads/use-composer-command-menu.ts` | A | 45, 49 | +| `apps/mobile/src/features/threads/use-composer-command-menu.test.ts` | A | 45, 49 | +| `apps/mobile/src/state/use-thread-composer-state.ts` | A | 45 | +| `apps/mobile/src/App.tsx` | R | B, 21, 70 | +| `apps/mobile/src/connection/runtime.ts` | N | 70 | +| `apps/mobile/src/features/connection/permissionUpdateNotice.ts` | N | 73 | +| `apps/mobile/src/features/connection/pairing.test.ts` | R | B | +| `apps/mobile/src/features/connection/pairing.ts` | R | B | +| `apps/mobile/src/widgets/AgentActivity.tsx` | R | B | +| `apps/server/package.json` | N | B | +| `apps/server/scripts/migrate-dev-db.test.ts` | R | H | +| `apps/server/scripts/migrate-dev-db.ts` | A | H | +| `apps/server/scripts/t3-sqlite-state.test.ts` | R | H | +| `apps/server/scripts/t3-sqlite-state.ts` | A | H | +| `apps/server/src/auth/EnvironmentAuth.ts` | N | 70 | +| `apps/server/src/auth/http.ts` | N | 70 | +| `apps/server/src/binCli.ts` | N | 35, 82, B | +| `apps/server/src/cli/app.test.ts` | N | H | +| `apps/server/src/cli/app.ts` | N | H | +| `apps/server/src/cli/config.test.ts` | A | H | +| `apps/server/src/cli/config.ts` | R | H | +| `apps/server/src/cli/pair.test.ts` | R | H, 79 | +| `apps/server/src/cli/auth.ts` | N | 79 | +| `apps/server/src/cli/pair.ts` | R | H, 79 | +| `apps/server/src/cli/server.ts` | N | B | +| `apps/server/src/cli/theme.test.ts` | N | H | +| `apps/server/src/cli/theme.ts` | N | H, B | +| `apps/server/src/cli/triage.ts` | N | H | +| `apps/server/src/cli/uninstall.ts` | N | 40, 52 | +| `apps/server/src/cli/update.ts` | N | 40, 53 | +| `apps/server/src/device/EasDeviceHost.test.ts` | N | B | +| `apps/server/src/device/EasDeviceHost.ts` | N | B | +| `apps/server/src/cloud/pinnedRuntime.test.ts` | N | 50 | +| `apps/server/src/cloud/pinnedRuntime.ts` | N | 50 | +| `apps/server/src/cloud/selfUpdate.test.ts` | N | 50 | +| `apps/server/src/cloud/servicePreflight.ts` | N | B, 50 | +| `apps/server/src/cloud/serviceProtocol.ts` | N | 50 | +| `apps/server/src/provider/Drivers/ClaudeSkills.test.ts` | N | 43 | +| `apps/server/src/provider/Drivers/ClaudeSkills.ts` | N | 42–44 | +| `apps/server/src/provider/ClaudeProvider.ts` | N | 43 | +| `apps/server/src/provider/CodexProvider.ts` | N | 43 | +| `apps/server/src/provider/ProviderRegistry.test.ts` | N | 42, 43 | +| `apps/server/src/provider/ProviderRegistry.ts` | N | 42, 43 | +| `apps/server/src/provider/providerMaintenanceRunner.test.ts` | N | 42 | +| `apps/server/src/provider/testUtils/providerRegistryMock.ts` | N | 42 | +| `apps/server/src/serverRuntimeStartup.ts` | N | 51 | +| `apps/server/src/serverSettings.test.ts` | N | 42 | +| `apps/server/src/serverSettings.ts` | N | 42 | +| `apps/server/src/serviceLauncher.test.ts` | N | 50, 85 | +| `apps/web/src/components/settings/settingsSearch.test.ts` | N | 43 | +| `apps/web/src/threadNotifications.ts` | N | 87, 108 | +| `apps/web/src/threadNotifications.test.ts` | N | 108 | +| `apps/web/src/components/settings/SettingsPanels.tsx` | N | 87, 108 | +| `apps/web/src/components/settings/settingsSearch.ts` | N | 42–44, 72, 77, 87, 92, 105, 108 | +| `apps/web/src/components/settings/SettingsSidebarNav.tsx` | N | 42, 72, 73 | +| `knip.jsonc` | N | 95 | +| `packages/client-runtime/src/state/runtime.test.ts` | N | 42 | +| `packages/client-runtime/src/state/threadWorkflows.ts` | N | 109 | +| `packages/client-runtime/src/state/threadWorkflows.test.ts` | N | 109 | +| `packages/contracts/src/auth.ts` | N | 35 | +| `packages/contracts/src/environmentHttp.ts` | N | 70 | +| `apps/server/src/cloud/bootService.test.ts` | A | H, 50 | +| `apps/server/src/cloud/bootService.ts` | A | H | +| `apps/server/src/environment/ServerEnvironment.test.ts` | N | 34, 48 | +| `apps/server/src/environment/ServerEnvironment.ts` | N | 34, 48 | +| `apps/server/src/environment/ServerEnvironmentLabel.ts` | N | 67 | +| `apps/server/src/httpCors.ts` | N | B | +| `apps/server/src/mcp/McpHttpServer.ts` | R | 2 | +| `apps/server/src/mcp/OrchestratorMcpService.ts` | A | Saved-agent mentions, 107 | +| `packages/contracts/src/previewAutomation.ts` | N | 74 | +| `apps/server/src/preview/ServerBrowserStream.ts` | N | Preview stream session invalidation (#798) | +| `apps/server/src/preview/ServerBrowserStream.test.ts` | N | Preview stream session invalidation (#798) | +| `apps/server/src/preview/ServerBrowser.test.ts` | N | 74 | +| `apps/server/src/preview/ServerBrowser.ts` | N | 74, B | +| `apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts` | A | 8, 47, Saved-agent mentions | +| `apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts` | N | 47, 89, Saved-agent mentions, Role library | +| `apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts` | A | 8, N, Saved-agent mentions | +| `apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts` | A | 8, 47, N, Saved-agent mentions, Role library | +| `packages/provider-core/src/server/ProviderAdapter.ts` | R | 47, 60, N, Role library | +| `packages/provider-core/src/server/orchestrationInstructions.ts` | N | 8, B | +| `packages/provider-pi/src/server/mcpExtensionSource.test.ts` | N | 8 | +| `apps/server/src/orchestration-v2/ProviderTurnControlService.test.ts` | N | 106 | +| `apps/server/src/orchestration-v2/ProviderTurnControlService.ts` | R | 26, 106 | +| `apps/server/src/orchestration-v2/ProviderTurnStartService.test.ts` | A | N, 106, Role library | +| `apps/server/src/orchestration-v2/ProviderTurnStartService.ts` | A | 30, N, 106 | +| `packages/contracts/src/orchestrationV2.ts` | N | 106 | +| `apps/server/src/orchestration-v2/RunFinalizationService.ts` | R | 30 | +| `apps/server/src/orchestration-v2/ThreadLaunchService.ts` | R | Saved-agent launch, 111 | +| `apps/server/src/orchestration-v2/runtimeLayer.test.ts` | R | 3 | +| `apps/server/src/orchestration-v2/ThreadSearch.ts` | N | 69, 91 | +| `apps/server/src/orchestration-v2/ThreadSearch.test.ts` | N | 69 | +| `apps/server/src/orchestration-v2/runtimeLayer.ts` | R | 5, 21, 26, 30, 38, 91, 106 | +| `apps/server/src/os-jank.ts` | R | H | +| `apps/server/src/persistence/Sqlite.ts` | A | 1, 31 | +| `apps/server/src/project/RepositoryIdentityResolver.test.ts` | N | gh default repository patch | +| `apps/server/src/project/RepositoryIdentityResolver.ts` | N | gh default repository patch | +| `apps/server/src/server.ts` | A | 5, 9, MCP idle connection patch, 53, 69, 70 | +| `apps/server/src/serviceLauncher.ts` | R | H, 50, 85 | +| `apps/server/src/storageCleanup.ts` | N | Git 2.56 gitfile patch | +| `apps/server/src/telemetry/AnalyticsService.ts` | N | B, 63, 86 | +| `apps/server/src/telemetry/FeatureUsage.ts` | N | 96 | +| `apps/server/src/testUtils/shardWeights.json` | N | 65 | +| `apps/server/src/ws.ts` | A | 37, 42, 58, 78, Role library, Saved-agent mentions | +| `apps/server/src/ws.ts` (the access gate and view) | N | 69 | +| `apps/web/index.html` | R | B | +| `apps/web/src/branding.ts` | R | B | +| `apps/web/src/commandPaletteBus.ts` | R | 42 | +| `packages/contracts/src/index.ts` | N | 42, 44 | +| `packages/contracts/src/rpc.ts` | A | 42, 44, 45, 64, 69 | +| `packages/contracts/src/clientRpcPermissions.ts` | N | 64 | +| `packages/client-runtime/src/rpc/client.ts` | A | 45, 64, 69, 73 | +| `apps/web/src/composer-logic.ts` | A | 45, 49 | +| `apps/server/src/auth/RpcAuthorization.ts` | A | 42, 44, 45, 64 | +| `apps/web/src/components/AppSidebarLayout.tsx` | N | 75 | +| `apps/web/src/components/ChatView.tsx` | A | 33, 45, 69, Role library, Saved-agent mentions | +| `apps/web/src/connection/runtime.ts` | N | 70 | +| `apps/web/src/environments/primary/auth.ts` | N | 70 | +| `apps/web/src/components/CommandPalette.tsx` | A | 42, 71, 75, 90, 34 | +| `apps/web/src/components/ConfirmDialogHost.tsx` | R | 22 | +| `apps/web/src/components/Sidebar.logic.test.ts` | R | 23 | +| `apps/web/src/components/Sidebar.tsx` | A | 21–23, 71, 73, 90 | +| `apps/web/src/components/chat/ChatComposer.tsx` | A | Saved-agent mentions, Role library, 45, 49, 73, 91 | +| `apps/web/src/components/chat/timelineMinimapItems.ts` | A | 24 | +| `apps/web/src/components/chat/MessagesTimeline.tsx` | A | 24, 80, 104 | +| `apps/web/src/components/chat/QueuedRunsControl.tsx` | A | 24, 80 | +| `apps/web/src/components/sidebar/SidebarChrome.tsx` | A | 6, 33, 75, B | +| `apps/web/src/onboarding/firstRun.ts` | N | 75 | +| `apps/web/src/confirmDialog.test.ts` | R | 22 | +| `apps/web/src/confirmDialog.ts` | R | 22 | +| `apps/web/src/contextMenuFallback.ts` | N | 71 | +| `apps/web/src/hooks/useThreadActionMenu.ts` | A | 21, 69, 71 | +| `apps/web/src/hooks/useThreadActionMenu.test.ts` | A | 71 | +| `apps/web/src/components/chat/ChatHeader.tsx` | N | 73, 90 | +| `apps/web/src/components/chat/ThreadDetailsPanel.tsx` | N | 73 | +| `apps/web/src/components/settings/SettingsScopeSentence.tsx` | N | 72 | +| `apps/web/src/components/settings/SettingsScopeContext.tsx` | N | 72 | +| `apps/web/src/components/settings/useAvailableSettingsSearchItems.ts` | N | 72 | +| `apps/web/src/components/settings/useSettingsProjectGroups.ts` | N | 72 | +| `apps/web/src/routes/_chat.settings.tsx` | N | 72 | +| `apps/web/src/components/GitActionsControl.tsx` | N | 90 | +| `apps/web/src/components/BranchToolbarBranchSelector.tsx` | N | 90 | +| `apps/web/src/lib/chatThreadActions.ts` | N | 90 | +| `apps/web/src/hooks/useScratchProject.ts` | N | 90 | +| `apps/web/src/components/chat/TimelineAssistantRows.tsx` | N | 90 | +| `apps/web/src/components/chat/ThreadRelationshipsControl.tsx` | N | 90 | +| `apps/web/src/components/chat/composerCommandKey.ts` | N | 91 | +| `apps/web/src/routes/welcome.tsx` | N | 73 | +| `apps/web/src/components/PermissionUpdateNotice.ts` | N | 73 | +| `apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx` | N | 80 | +| `apps/web/src/routes/pair.tsx` | N | 73 | +| `apps/web/src/routes/__root.tsx` | N | 71, 73 | +| `apps/web/src/routes/_chat.index.tsx` | R | B, 73 | +| `apps/web/src/shortcuts/chatRouteCommands.ts` | N | B | +| `apps/web/src/routeTree.gen.ts` | R | generated route registrations for 6/9 | +| `apps/web/src/components/onboarding/WelcomeWizard.tsx` | R | 39, B | +| `apps/web/tsconfig.json` | R | B | +| `packages/client-runtime/package.json` | R | 7, 23, 34, 45, 69, 70, 75, 101, 114, Role library | +| `packages/client-runtime/src/connection/compatibility.ts` | A | 56 | +| `packages/client-runtime/src/operations/commands.ts` | R | Saved-agent mentions | +| `packages/contracts/package.json` | N | 34 | +| `packages/contracts/src/environment.ts` | N | 34, 48 | +| `packages/contracts/src/server.test.ts` | N | 43 | +| `packages/contracts/src/server.ts` | N | 42, 43 | +| `packages/contracts/src/settings.test.ts` | N | 42 | +| `packages/contracts/src/settings.ts` | N | 42, B, 105, 107 | +| `packages/shared/package.json` | N | 43, 46, 49, 52 | +| `packages/shared/src/devHome.test.ts` | R | H | +| `packages/shared/src/paletteSearch.test.ts` | N | B | +| `apps/mobile/src/features/settings/environment-maintenance.test.ts` | N | 40 | +| `apps/server/src/provider/testing/ProviderInstanceRegistryLive.fixture.mjs` | N | 43 | +| `packages/provider-cursor/src/server/status.test.ts` | N | B | +| `apps/server/src/provider/CodexDeveloperInstructions.test.ts` | N | 8 | +| `apps/web/test/appScenarios.renders.tsx` | N | 80 | +| `apps/mobile/src/features/home/useThreadListActions.ts` | N | 21 | +| `apps/web/test/renderScenarios.renders.tsx` | N | 80 | +| `packages/shared/src/devHome.ts` | R | H | +| `packages/ssh/src/tunnel.ts` | R | H, 50 | +| `pnpm-lock.yaml` | N | 45 | +| `scripts/build-cli-archive.ts` | N | 50 | +| `scripts/build-desktop-artifact.test.ts` | A | B, S, 50 | +| `scripts/build-desktop-artifact.ts` | R | B, S, 50 | +| `scripts/check-changed.ts` | N | 93 | +| `scripts/dev-runner.test.ts` | R | H, 63, 83, 88 | +| `scripts/dev-runner.ts` | R | H, 63, 83, 88 | +| `scripts/export-android-icons.ts` | N | B | +| `scripts/install.ps1` | N | 40, 50 | +| `scripts/install.sh` | N | 40, 50, 52 | +| `scripts/smoke-cli-archive.ts` | N | 50 | +| `vite.config.ts` | R | H | +| `apps/web/src/composer-logic.test.ts` | N | 49 | +| `apps/web/src/components/chat/ComposerCommandMenu.tsx` | A | 49, Saved-agent mentions | +| `packages/shared/src/composerTrigger.ts` | A | 49, Saved-agent mentions | +| `packages/shared/src/composerInlineTokens.ts` | A | 49, Saved-agent mentions | +| `apps/mobile/src/features/threads/ComposerCommandPopover.tsx` | A | 49, Saved-agent mentions | +| `apps/mobile/src/features/threads/ThreadFeed.tsx` | N | 97, 98 | +| `apps/mobile/src/features/threads/ThreadQueueControl.tsx` | N | 97, 99 | +| `apps/mobile/src/lib/filePreview.test.ts` | N | 97, 99 | +| `apps/mobile/src/features/threads/thread-search-match.tsx` | N | 99 | +| `apps/mobile/src/features/threads/thread-work-log.tsx` | N | 99 | +| `apps/mobile/src/features/threads/thread-list-v2-items.tsx` | N | 115 | +| `apps/mobile/src/features/threads/useThreadListV2.ts` | N | 115 | +| `apps/mobile/src/features/threads/useThreadListV2.test.tsx` | N | 115 | +| `apps/mobile/src/features/threads/ThreadComposer.tsx` | A | 49, 100, Role library, Saved-agent mentions | +| `apps/mobile/src/state/threadOutboxDelivery.ts` | A | Saved-agent mentions | +| `assets/dev/app-icon.icon/Assets/annotations.svg` | N | B | +| `assets/dev/app-icon.icon/Assets/text.svg` | N | B | +| `assets/dev/app-icon.icon/icon.json` | N | B | +| `assets/nightly/app-icon.icon/Assets/text.svg` | N | B | +| `assets/nightly/app-icon.icon/icon.json` | N | B | +| `assets/prod/app-icon.icon/Assets/text.svg` | N | B | +| `assets/prod/app-icon.icon/icon.json` | N | B | +| `.github/workflows/desktop-macos-preview-publish.yml` | N | C | +| `.github/workflows/mobile-eas-preview.yml` | N | C | +| `.github/workflows/thread-transfer-report.yml` | N | C | +| `.github/ISSUE_TEMPLATE/bug_report.yml` | N | J5 CI and packaging | +| `.github/ISSUE_TEMPLATE/config.yml` | N | J5 CI and packaging | +| `.github/workflows/desktop-macos-preview.yml` | N | C | +| `.github/workflows/issue-labels.yml` | N | C | +| `.github/workflows/mobile-showcase-screenshots.yml` | N | C | +| `.github/workflows/pr-size.yml` | N | J5 CI and packaging | +| `.github/workflows/web-preview.yml` | N | C | +| `.github/workflows/windows-tests.yml` | N | C | +| `apps/server/src/mcp/McpInvocationContext.ts` | N | 2, 33, B | +| `apps/desktop/src/app/DesktopAppIdentity.ts` | N | B | +| `apps/desktop/src/app/DesktopCliCommand.ts` | N | 57 | +| `apps/desktop/src/app/DesktopCliShim.ts` | N | 57, H | +| `apps/desktop/src/app/DesktopUserData.ts` | N | H | +| `apps/desktop/src/compileCache.ts` | N | H | +| `apps/server/src/cli/browser.ts` | N | H, B | +| `apps/server/src/cli/invocation.ts` | N | 40 | +| `apps/server/src/cli/trace.ts` | N | H | +| `apps/server/src/mcp/McpSessionRegistry.ts` | N | 33 | +| `apps/server/src/observability/RpcInstrumentation.ts` | N | 58 | +| `packages/provider-acp/src/server/adapter.ts` | N | B | +| `packages/provider-cursor/src/server/adapter.ts` | N | B | +| `packages/provider-opencode/src/server/v2/adapter.ts` | N | B | +| `packages/provider-opencode/src/server/adapter.ts` | N | N | +| `apps/server/src/orchestration-v2/Orchestrator.ts` | N | Role library, Saved-agent mentions, 106 | +| `apps/server/src/orchestration-v2/ProjectionStore.ts` | N | Role library | +| `apps/server/src/orchestration-v2/RuntimePolicy.ts` | N | 47, Role library | +| `apps/server/src/orchestration-v2/ThreadManagementService.ts` | N | 26 | +| `apps/server/src/provider/providerCompatibility.ts` | N | 59, B | +| `apps/server/src/scheduledTasks/ScheduledTaskService.ts` | N | 12 | +| `apps/web/src/components/ServerUpdateAction.tsx` | N | 40, B | +| `apps/web/src/components/settings/CliCommandSettingsRow.tsx` | N | 57 | +| `apps/web/src/components/settings/ConnectionsSettings.tsx` | N | 48, B | +| `apps/web/src/components/sidebar/mainAppLocation.ts` | N | 6, 33 | +| `apps/web/src/legalLinks.ts` | N | B | +| `apps/web/src/versionSkew.ts` | N | 40 | +| `packages/client-runtime/src/state/environmentHttpAuth.ts` | N | 34 | +| `packages/contracts/src/scheduledTask.ts` | N | 12 | +| `packages/shared/src/codexAuthHandoff.ts` | N | B | +| `packages/shared/src/git.ts` | N | B | +| `packages/shared/src/providerAuthReturnUrl.ts` | N | B | +| `apps/server/src/orchestration-v2/RestartContinuation.ts` | N | B | +| `apps/server/src/process/agentScope.ts` | N | 25 | +| `apps/server/src/serverOwnership.ts` | N | B, 25, 84 | +| `apps/web/src/components/chat/RightPanelSurfaceContent.tsx` | N | 33 | +| `apps/web/src/components/promptLinks/copyPromptLink.ts` | N | 76 | +| `apps/web/src/components/settings/MobileAppSettingsRow.tsx` | N | 77 | +| `packages/provider-core/src/server/subagentProjection.ts` | N | Role library | +| `packages/provider-cursor/src/server/accountUsage.ts` | N | B | +| `packages/provider-opencode/src/settings.ts` | N | B | +| `packages/shared/src/cliRelease.ts` | N | 40 | +| `packages/shared/src/promptLinks.test.ts` | N | 76 | +| `packages/shared/src/promptLinks.ts` | N | B, 76 | +| `packages/shared/src/projectSettings.test.ts` | N | 107 | +| `apps/web/src/components/chat/TimelineUserMessageRow.tsx` | N | 7, 80, B | +| `apps/web/src/components/chat/timelineRowContext.ts` | N | 24 | +| `apps/web/src/components/chat/TimelineWorkEntryRow.tsx` | N | 80 | +| `apps/web/src/components/chat/chatViewSend.ts` | N | 80 | +| `apps/web/src/components/chat/MarkdownFileLink.tsx` | N | 33 | +| `apps/web/src/components/ChatMarkdown.tsx` | N | 33 | +| `apps/web/src/components/RightPanelTabs.tsx` | N | 33, B | +| `apps/web/src/components/pullRequest/PullRequestsPage.tsx` | N | 33, B | +| `apps/web/src/components/sidebar/SidebarThreadRow.tsx` | N | 23, 94 | +| `apps/web/src/components/chat/useComposerSend.ts` | N | 19, 45, Saved-agent mentions | +| `apps/web/src/components/chat/useProposedPlanSend.ts` | N | 45 | +| `apps/web/src/components/chat/useComposerMenuItems.ts` | N | 49, Saved-agent mentions | +| `apps/web/src/components/chat/ComposerControlsBar.tsx` | N | Saved-agent mentions | +| `apps/web/src/components/desktopUpdate.logic.ts` | N | 40, B | +| `apps/server/src/serverRuntimeState.test.ts` | N | 84 | +| `apps/server/src/ws.test.ts` | N | 69, 78 | +| `apps/server/vite.config.ts` | N | 86 | +| `.github/workflows/stale-needs-more-info.yml` | N | C | +| `.github/workflows/relay-preview.yml` | N | C | +| `.github/workflows/relay-preview-cleanup.yml` | N | C | +| `apps/web/src/components/chat/MessagesTimeline.browser.test.tsx` | N | 7, 80 | +| `apps/web/src/components/chat/QueuedRunsControl.browser.test.tsx` | N | 80 | +| `apps/web/src/components/settings/ProjectSettingsPanel.browser.test.tsx` | N | 72 | +| `apps/web/src/components/chat/guestShareAvailability.ts` | N | 92 | +| `apps/web/src/components/settings/LabsSettingsPanel.tsx` | N | 92 | +| `apps/web/src/lib/bootError.ts` | N | B | +| `apps/web/src/lib/bootError.test.ts` | N | B | +| `packages/contracts/src/orchestratorMcp.ts` | N | B | +| `scripts/mobile-native-client.ts` | N | B | +| `packages/contracts/src/threadSearch.ts` | N | 94 | +| `apps/web/src/components/ThreadSearchMatch.tsx` | N | 94 | +| `apps/web/src/components/CommandPalette.logic.ts` | N | 94 | +| `apps/web/src/components/CommandPaletteThreadItems.tsx` | N | 94 | +| `.github/workflows/agent-context-budget.yml` | N | C, 110 | +| `.github/workflows/mobile-eas-preview-fork.yml` | N | C | +| `.github/workflows/mobile-fingerprint-label.yml` | N | C | +| `apps/server/src/provider/AgentContextBudget.test.ts` | N | 110 | +| `apps/server/src/provider/agentContextBudget.json` | N | 110 | +| `apps/server/src/mcp/McpToolAccess.ts` | N | 2 | +| `packages/shared/src/threadLinks.ts` | N | 76 | +| `apps/web/src/components/settings/settingsLayout.tsx` | N | 112 | +| `apps/web/src/components/settings/LinkedEnvironmentsSettings.tsx` | N | 112 | +| `apps/server/src/mcp/toolkits/project/handlers.test.ts` | N | 76, 111 | +| `apps/server/src/mcp/toolkits/project/handlers.ts` | N | 111 | +| `packages/shared/src/threadLinks.test.ts` | N | 76 | +| `apps/mobile/app.config.test.ts` | N | B, 76 | +| `apps/web/public/.well-known/apple-app-site-association.json` | N | B, 76 | +| `apps/web/public/.well-known/assetlinks.json` | N | B, 76 | +| `apps/web/src/components/chat/threadDetailsItems.ts` | N | 73 | +| `apps/web/src/components/sidebar/SidebarProjectFolderHeader.tsx` | N | 90 | +| `apps/mobile/src/features/threads/new-task-flow-provider.test.tsx` | N | 90 | +| `apps/web/src/components/CommandPalette.composition.browser.test.tsx` | N | 90 | +| `apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx` | N | 90 | +| `apps/web/src/components/onboarding/WelcomeWizard.import.browser.test.tsx` | N | 39 | +| `packages/provider-core/src/server/orchestrationInstructions.test.ts` | N | B, 8 | +| `apps/server/src/cli/up.ts` | N | B, 79 | +| `apps/server/src/cliCompileCache.ts` | N | B, H | +| `packages/shared/src/managedPolicyFile.ts` | N | B | +| `apps/server/src/policy/policyTemplates.ts` | N | B | +| `apps/server/src/cli/policy.ts` | N | B | +| `apps/server/src/cloud/serviceProtection.ts` | N | B | +| `apps/desktop/src/app/DesktopStartupRecovery.ts` | N | B | +| `apps/server/src/triage/TriageService.ts` | N | B | +| `apps/server/src/triage/triagePrompt.ts` | N | B | +| `apps/web/src/components/GitHubStarPrompt.tsx` | N | B | +| `apps/web/src/components/GitHubStarPrompt.test.ts` | N | B | +| `apps/web/src/components/ui/standalone-page.tsx` | N | B | The 2026-09-08 import correction adds bounded file-content schemas and shared selection preparation in `packages/client-runtime/src/state/agentPersonas.ts`, plus import/removal commands in the existing orchestration atom module. Clients send selected JSON contents to the chosen environment, never local paths as server destinations. J5 library code validates and atomically persists imports under a process-wide mutation permit, overlays them on source definitions, and preserves launch snapshots on replacement/removal. The Settings registrations remain thin mounts. Focused tests cover nested file selections, single-file selection, atomic rejection, conflicts, persisted imports, concurrent sessions, restoration, snapshots, and RPC scopes. Native picker/browser interaction still requires an authorized client pass. From 12987094ca6b50d11a502fb60661bcc302bba48f Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Mon, 9 Nov 2026 02:33:22 -0500 Subject: [PATCH 4/6] docs(fork): name case 115 in the client-runtime ledger row Co-Authored-By: Claude Opus 5.5 --- FORK.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FORK.md b/FORK.md index ea58c5ca5c450..7ca6eabc4dc98 100644 --- a/FORK.md +++ b/FORK.md @@ -939,7 +939,7 @@ explicitly marked. | `apps/web/src/routeTree.gen.ts` | R | generated route registrations for 6/9 | | `apps/web/src/components/onboarding/WelcomeWizard.tsx` | R | 39, B | | `apps/web/tsconfig.json` | R | B | -| `packages/client-runtime/package.json` | R | 7, 23, 34, 45, 69, 70, 75, 101, 114, Role library | +| `packages/client-runtime/package.json` | R | 7,23,34,45,69,70,75,101,114,115, Role library | | `packages/client-runtime/src/connection/compatibility.ts` | A | 56 | | `packages/client-runtime/src/operations/commands.ts` | R | Saved-agent mentions | | `packages/contracts/package.json` | N | 34 | From c1abdae4bed2d8b1a912d74027029b455b8fc94f Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Mon, 9 Nov 2026 02:45:51 -0500 Subject: [PATCH 5/6] fix(mobile): the seat count no longer makes a Captain's row taller Co-Authored-By: Claude Opus 5.5 --- apps/mobile/src/j5/crew/CaptainSeats.tsx | 47 +++++++++++++----------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/apps/mobile/src/j5/crew/CaptainSeats.tsx b/apps/mobile/src/j5/crew/CaptainSeats.tsx index f735647fc0ec9..d3e2284ae96ae 100644 --- a/apps/mobile/src/j5/crew/CaptainSeats.tsx +++ b/apps/mobile/src/j5/crew/CaptainSeats.tsx @@ -100,28 +100,31 @@ function SeatsToggle(props: { const count = spawnedChildrenCountLabel(groups); const needsAttention = !isOpen && groups.some((group) => group.needsAttention); return ( - toggle(key)} - onLongPress={() => undefined} - style={({ pressed }) => ({ opacity: pressed ? 0.6 : 1 })} - > - - - {count} - - {needsAttention ? : null} - + // As tall as the provider icon beside it, so the text's taller line box can't grow the row. + + toggle(key)} + onLongPress={() => undefined} + style={({ pressed }) => ({ opacity: pressed ? 0.6 : 1 })} + > + + + {count} + + {needsAttention ? : null} + + ); } From 29955e6799c36dd8ac6338cee34ade0f51f242b8 Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Mon, 9 Nov 2026 02:48:30 -0500 Subject: [PATCH 6/6] fix(mobile): size the seat count's box to the provider icon exactly Co-Authored-By: Claude Opus 5.5 --- apps/mobile/src/j5/crew/CaptainSeats.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/mobile/src/j5/crew/CaptainSeats.tsx b/apps/mobile/src/j5/crew/CaptainSeats.tsx index d3e2284ae96ae..652ba86573a06 100644 --- a/apps/mobile/src/j5/crew/CaptainSeats.tsx +++ b/apps/mobile/src/j5/crew/CaptainSeats.tsx @@ -101,7 +101,7 @@ function SeatsToggle(props: { const needsAttention = !isOpen && groups.some((group) => group.needsAttention); return ( // As tall as the provider icon beside it, so the text's taller line box can't grow the row. - +