diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 0f4a7f0245b..b6ffb63b826 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -2,193 +2,42 @@ Thanks for contributing to Orca. -## Before You Start - -- Found a security vulnerability? Do not open a public issue or PR; report it privately as described in [`SECURITY.md`](./SECURITY.md). -- Keep changes scoped to a clear user-facing improvement, bug fix, or refactor. -- Orca targets macOS, Linux, and Windows. Every change must stay compatible with all three platforms unless the code is explicitly guarded by a runtime platform check. -- For keyboard shortcuts, use runtime platform checks in renderer code and `CmdOrCtrl` in Electron menu accelerators. -- For shortcut labels, show `⌘` and `⇧` on macOS, and `Ctrl+` and `Shift+` on Linux and Windows. -- For file paths, use Node or Electron path utilities such as `path.join`. -- Orca must work against local repositories, remote servers, and SSH worktrees. Do not assume a process, file, credential, shell, or network path exists only on the local machine. -- Orca supports many CLI agents, integrations, and git providers. Keep generic behavior provider-neutral; guard integration-specific logic behind explicit checks. -- Keep changes well-engineered and performant: follow existing architecture, avoid unnecessary work in hot paths, clean up owned resources, and use concrete module names. -- For UI work, follow [`docs/STYLEGUIDE.md`](../docs/STYLEGUIDE.md), use the tokens and shadcn primitives it specifies, and verify polished behavior across platforms, light/dark mode, and SSH latency. +Found a security vulnerability? Do not open a public issue or PR; report it privately as described in [`SECURITY.md`](./SECURITY.md). ## Local Setup -Install Node 24, pnpm, and the Bun version in [`config/.bun-version`](../config/.bun-version). -`pnpm test` runs Vitest on Bun, with Node workers for runtime contracts such as SQLite, -native PTYs, socket liveness, and V8 memory behavior. `pnpm test:node` runs the same suites -entirely on Node. Builds and dependency installation still use Node and pnpm. - -The server, its workers and its packaged dependencies target Node 24. The compatibility -launcher and CLI still target Node 18; the launcher hands off to bundled Node 24 before -loading server code. WSL guest programs and host discovery retain their Node 18 minimum. -Keep Node 24 APIs and server imports out of these host compatibility paths. Running an -unpackaged server directly requires Node 24 or newer. - -Use the pnpm version in `packageManager` in [`package.json`](../package.json): `corepack enable` -needs Corepack 0.34.5 or newer to start the pinned pnpm (`npm install -g corepack@latest`). On -Windows it writes shims next to `node.exe` and fails with `EPERM` outside an elevated shell when -Node is in `C:\Program Files\nodejs`; run `npm install -g pnpm@` instead. - -`pnpm install` compiles native modules such as `node-pty` with `node-gyp` and loads them in -Electron, so a fresh machine also needs: - -- **macOS**: Xcode Command Line Tools (`xcode-select --install`). -- **Windows**: Python 3 and Visual Studio Build Tools with the "Desktop development with C++" - workload. -- **Linux**: a C++ toolchain, Python 3, and the libraries Electron loads even on a headless - machine, plus `xvfb`, which the `*.electron.test.ts` files in `pnpm test` use when `DISPLAY` is - unset. On Ubuntu 24.04+ and Debian 13+: - - ```bash - sudo apt-get update && sudo apt-get install -y build-essential python3 xvfb libgtk-3-0 libnss3 libgbm1 libasound2t64 - ``` - - Older releases name the last package `libasound2`. +Install Node 24, the pnpm version in `packageManager` in [`package.json`](../package.json), and the Bun version in [`config/.bun-version`](../config/.bun-version). `pnpm install` compiles native modules, so you also need a C++ toolchain and Python 3 (Xcode Command Line Tools on macOS, Visual Studio Build Tools on Windows, `build-essential` and Electron's libraries on Linux). ```bash pnpm install +pnpm -C mobile install --frozen-lockfile # mobile/ has its own lockfile; build and lint need it pnpm dev ``` -`mobile/` is a separate pnpm project with its own lockfile, so the root `pnpm install` leaves its -dependencies uninstalled. `pnpm build` (`build:mobile-web` fails without them) and the lint -passes that cover `mobile/` need them. Install them before building or linting, and again -when `mobile/pnpm-lock.yaml` changes: +`pnpm dev` in a linked Git worktree uses its own profile and ports, so instances in different worktrees run side by side. -```bash -pnpm -C mobile install --frozen-lockfile -``` - -### Dev Profiles and Parallel Instances - -`pnpm dev` in a linked Git worktree uses its own userData profile, renderer port, and remote -debugging (CDP) port, so dev instances in different worktrees run side by side. The main checkout -keeps the shared `orca-dev` profile. Ports are derived from the worktree path and move to the next -free port when taken: renderer ports start at 15200 and CDP ports at 9333. - -On startup the runner prints one stdout line and writes the same JSON to `out/dev-instance.json`: - -```text -ORCA_DEV_INSTANCE {"userData":".../orca-dev-wt/1d3830d4d3","profile":"worktree","rendererPort":15339,"rendererUrl":"http://localhost:15339","cdpPort":9513,"cdpUrl":"http://127.0.0.1:9513","repoRoot":"...","runnerPid":4242} -``` - -| Option | Effect | -| ----------------------------------------------------------------------- | ---------------------------------------------------------- | -| `pnpm dev --shared-profile` or `ORCA_DEV_PROFILE=shared` | Use the shared `orca-dev` profile | -| `pnpm dev --worktree-profile` or `ORCA_DEV_PROFILE=worktree` | Use a per-worktree profile, including in the main checkout | -| `ORCA_DEV_USER_DATA_PATH=` | Use an explicit profile directory | -| `REMOTE_DEBUGGING_PORT=`, `ORCA_DEV_RENDERER_PORT=` | Pin a port | -| `pnpm dev --seed-profile[=]` or `ORCA_DEV_SEED_PROFILE=` | Seed an empty profile on first launch | - -Per-worktree profiles live in `orca-dev-wt/` next to `orca-dev` (`~/Library/Application -Support` on macOS, `%APPDATA%` on Windows, `$XDG_CONFIG_HOME` or `~/.config` on Linux). The -automatic storage cleanup removes them once their worktree is gone and nothing still runs from -them. `config/scripts/orca-dev.mjs` and the `orca-dev` terminal wrapper target the profile this -checkout's `pnpm dev` used. - -Seeding copies a slim set of state from another profile: projects, workspaces, settings, SSH -targets, and the Orca account session. Terminal sessions, PTY leases, automations, caches, logs, -and lock files are not copied, and the source profile is only read. The default source is -`orca-dev`, or the installed app's profile when `orca-dev` is empty. Seed from `orca-dev` when you -need the signed-in account session: dev builds cannot decrypt secrets the installed app encrypted. - -```bash -pnpm dev:seed-profile [--from=] [--to=] [--reset] -pnpm dev:fresh [--keep] [--seed-from[=]] # temporary profile, removed on exit -``` - -### Targeting Local Tests - -Use a test file or directory when you know the relevant suites. For dependency-based -feedback, Vitest can select tests affected by your edits: - -```bash -pnpm test:changed src/main/runtime --maxWorkers=2 -pnpm test --changed=origin/main --maxWorkers=2 -pnpm test src/shared/automations/scheduling/automation-cron-input-validation.test.ts --maxWorkers=2 -``` - -`test:changed` considers staged, unstaged, and untracked files. `--changed=origin/main` -also includes committed changes since the branch's merge base. Update that ref when -you need a newer baseline. Both accept the same path filters and options as `pnpm test`. -When Git reports no changed files at all, the launcher exits before starting Vitest. - -Affected tests use Vitest's static import graph. Run suites explicitly for computed -dynamic imports, fixture files, subprocess inputs, or other dependencies outside that -graph. Local affected tests do not replace CI. - -Use `pnpm test`, not raw `vitest`: only it keeps the transform cache that makes repeat runs fast. - -Most unit files share a worker and its module cache with the files before them. After each file -the worker undoes mocks, fake timers, stubs, env, cwd, and leftover timers, listeners, and globals. -Files using `vi.doMock`, `vi.resetModules`, a DOM environment, or direct `globalThis` writes keep -their own worker. If a file passes alone but fails after others, add `// @orca-isolated-worker` -to it; `ORCA_VITEST_ISOLATE_EVERY_FILE=1` isolates every file to confirm a leak. - -To reduce main-process rebuild CPU and memory when you do not need its source maps, -set `ORCA_DEV_MAIN_SOURCEMAPS=0` before `pnpm dev`. In Bash/zsh: - -```bash -ORCA_DEV_MAIN_SOURCEMAPS=0 pnpm dev -``` - -In PowerShell, use `$env:ORCA_DEV_MAIN_SOURCEMAPS='0'` before `pnpm dev`. -Remove the variable when debugging the main process with source maps. Renderer and -preload settings are unaffected; production builds always keep their hidden main maps. - -`pnpm dev` serves the renderer with Vite's bundled dev mode: a few bundled chunks instead of -thousands of module requests, so the first render and full reloads are faster. While a rebuild is -pending, a newly opened pop-out, space, or web window may briefly get placeholder HTML. If the -renderer misbehaves, set `ORCA_DEV_BUNDLED=0` (PowerShell: `$env:ORCA_DEV_BUNDLED='0'`) and report it. - -Local installs use pnpm's global virtual store: each package version is one slot -under `~/pnpm/store` that every worktree links to, instead of a full `node_modules` per worktree. -An existing worktree converts on its next `pnpm install`, and an older branch without the setting -converts back the same way. CI always uses the normal layout. On Windows, pnpm links with -junctions when you lack the symlink privilege, so no administrator rights or Developer Mode are -needed. Things to know: - -- Keep `~/node_modules` (and any other `node_modules` above the store) out of your home - directory. Node resolves upward from the store slot, so a stray one there supplies - dependencies the package never declared and hides missing-dependency bugs; `pnpm install` warns - when it finds one. -- Native addons are never rebuilt in place in a shared slot: each CPU gets its own build - beside it (see [`native-build-entry.cjs`](../config/scripts/native-build/node-addons/native-build-entry.cjs)), so - cross-arch packaging is safe for other worktrees. -- `ORCA_PNPM_GLOBAL_VIRTUAL_STORE=0` opts out. Keep it set - in your shell: `pnpm run` re-checks the install and relinks a worktree whose layout no longer - matches. - -Ordinary installs include native optional dependencies for the current OS and CPU only. -Before a cross-architecture build (including `pnpm build:mac`, which produces both x64 and -arm64 artifacts by default), run `pnpm install:release` to add the other CPU's variants. - -Linux `pnpm build`, `pnpm build:native`, and Linux packaging require a running Docker -daemon to build the clipboard helper against Ubuntu 20.04 rather than the host's -newer libraries. A verified cached helper can be reused without Docker. For native -Wayland development, run `pnpm build:native` before `pnpm dev` to make text copying -available. See the [clipboard build guide](../native/wayland-clipboard/README.md#building-and-testing). -macOS and Windows builds do not use this helper or require Docker for it. +See [`docs/development.md`](../docs/development.md) for per-OS packages, Corepack and Windows notes, dev profiles and seeding, cross-architecture and Linux (Docker) builds, and troubleshooting. ## Branch Naming -Use a clear, descriptive branch name that reflects the change. +Use a clear, descriptive branch name that reflects the change, such as `fix/ctrl-backspace-delete-word`, `feat/shift-enter-newline`, or `chore/update-contributor-guide`. Avoid vague names like `test`, `misc`, or `changes`. -Good examples: +## Code Guidelines -- `fix/ctrl-backspace-delete-word` -- `feat/shift-enter-newline` -- `chore/update-contributor-guide` +- Keep changes scoped to a clear user-facing improvement, bug fix, or refactor. +- Orca targets macOS, Linux, and Windows. Guard platform-specific code with runtime checks, use `CmdOrCtrl` in Electron menu accelerators, show `⌘`/`⇧` labels on macOS and `Ctrl+`/`Shift+` elsewhere, and build paths with `path.join`. See [cross-platform support](../docs/agents-md-refs/cross-platform-support.md). +- Orca must work against local repositories, remote servers, and SSH worktrees. Do not assume a process, file, credential, shell, or network path exists only on the local machine. +- Keep generic behavior provider-neutral across CLI agents, integrations, and git providers; guard integration-specific logic behind explicit checks. +- Follow existing architecture, avoid unnecessary work in hot paths, clean up owned resources, and use concrete module names. +- For UI work, follow [`docs/STYLEGUIDE.md`](../docs/STYLEGUIDE.md) and verify behavior across platforms, light/dark mode, and SSH latency. -Avoid vague names like `test`, `misc`, or `changes`. +### Type Declarations: Prefer `.ts` Over `.d.ts` -## Before Opening a PR +Put project-owned types in `.ts` files. `.d.ts` is reserved for ambient shims (e.g., `env.d.ts`). `skipLibCheck: true` applies to our own `.d.ts` files too, so an unresolved type reference there silently becomes `any`. CI enforces this for `src/preload/` and `src/shared/`. -Run the same checks that CI runs, after the `mobile/` install from [Local Setup](#local-setup): +## Checks Before Opening a PR + +Run the same checks CI runs, after the `mobile/` install above: ```bash pnpm lint @@ -197,102 +46,28 @@ pnpm test pnpm build ``` -`pnpm lint` runs independent checks in a bounded pool. Use -`pnpm lint --maxWorkers=2 --timings` to limit concurrent checks and print their durations. +For faster repeat typechecks use `pnpm tc` (or `pnpm tc:node`, `pnpm tc:web`, `pnpm tc:cli`); run `pnpm tc:node` after editing shared tests. -For repeated local typechecks, use `pnpm tc` (or `pnpm tc:node`, `pnpm tc:web`, -and `pnpm tc:cli`). On Apple Silicon macOS and x64/arm64 Linux, these use the pinned -`tsrs` compiler with incremental caches. Keep `.cache/typecheck/` between checks; -delete it to force a fresh check. Caches are separate for each project, compiler -version, and worktree. At most two projects run together, subject to the memory budget. -Windows, Intel macOS, and other unsupported platforms use pinned Bun automatically. -Pass `--compiler=bun` to explicitly use Bun, or `--compiler=native` to use TypeScript. -CI uses `pnpm typecheck:ci`, which explicitly selects Bun and its CI concurrency. -Shared tests are checked by the -Node project; shared production code is checked in all three environments. -Run `pnpm tc:node` after editing shared tests, or `pnpm tc` to check everything. +Add a test when it would catch a regression of your behavior change or bug fix, not for shallow coverage; see [test anti-patterns](../docs/agents-md-refs/test-antipatterns.md). If your change affects UI or interaction behavior, verify it on the platforms it could impact. -Add high-quality tests for behavior changes and bug fixes. Prefer tests that would actually catch a regression, not shallow coverage that only exercises the happy path. +### Targeting Local Tests -If your change affects UI or interaction behavior, verify it on the platforms it could impact. +Use `pnpm test`, not raw `vitest`: only it keeps the transform cache that makes repeat runs fast. -## Type Declarations: Prefer `.ts` Over `.d.ts` +```bash +pnpm test src/shared/automations/scheduling/automation-cron-input-validation.test.ts --maxWorkers=2 +pnpm test:changed src/main/runtime --maxWorkers=2 # staged, unstaged, and untracked changes +pnpm test --changed=origin/main --maxWorkers=2 # also commits since the merge base +``` -Project-owned type declarations belong in `.ts` files. `.d.ts` is reserved for ambient shims (e.g., `env.d.ts`, `vite/client.d.ts`). TypeScript's `skipLibCheck: true` setting applies globally, including to our own `.d.ts` files, which means any unresolved type reference in a `.d.ts` silently becomes `any` at its call sites. Write your types in `.ts` files so the compiler actually checks them. - -CI enforces this for `src/preload/` and `src/shared/`. +Affected tests follow Vitest's static import graph, so run suites explicitly for dynamic imports, fixtures, or subprocess inputs. Local affected tests do not replace CI. If a file passes alone but fails after others, add `// @orca-isolated-worker` to it. ## Pull Requests -Each pull request should follow [`.github/pull_request_template.md`](./pull_request_template.md). In particular: +Fill in every section of [`.github/pull_request_template.md`](./pull_request_template.md): an ELI5, what changed and why, a linked issue (required for outside contributors), a before and after (screenshots or videos) for any UI or behavior change (only if there is truly no visual or interaction change, write exactly `N/A` and briefly say why), how you tested it, the risk, and under Review a short summary from your AI coding agent covering cross-platform, SSH/remote, agent and integration compatibility, performance, UI quality, and security. Keep each PR small and focused on one topic. -- if you are an outside contributor, link the issue your PR addresses -- open with an ELI5 of the change (plain language paragraph; the PR title is the one-liner) -- explain what changed and why, and stay focused on a single topic when possible -- for any UI or interaction change, attach **before and after** screenshots (or short videos); if there is no visual or interaction change, write `N/A` and briefly explain why -- include high-quality tests when behavior changes or bug fixes warrant them -- include a brief code review summary from your AI coding agent that explicitly checks cross-platform compatibility, SSH/remote/local compatibility, supported agent and integration compatibility, performance risk, UI quality when applicable, and basic security risk -- mention any platform-specific, remote/SSH-specific, agent-specific, integration-specific, or git-provider-specific behavior and testing notes -- **Include your X (Twitter) handle** in the PR template Author section — we shout out contributors when we merge features on [@orca_build](https://x.com/orca_build). +Version bumps, tags, and releases are maintainer-managed. Do not include release version changes unless a maintainer asks. Maintainers cut releases with the [Cut Release](https://github.com/stablyai/orca/actions/workflows/release-cut.yml) workflow. -## Release Process +## Getting Help -Version bumps, tags, and releases are maintainer-managed. Do not include release version changes in a normal contribution unless a maintainer asks for them. - -### Cutting a release (maintainers) - -All releases are cut from the **Cut Release** GitHub Actions workflow. There is no local `pnpm release:*` script — running releases locally is too easy to get wrong (dirty tree, wrong branch, stale main). - -**To cut a release:** - -1. Open [Actions → Cut Release](../../actions/workflows/release-cut.yml). -2. Click **Run workflow** and pick: - - **kind**: one of `rc`, `patch`, `minor`, `major`. - - **ref**: the branch, tag, or SHA to build from. Defaults to `main`. -3. Run it. - -The workflow resolves the next version from GitHub Releases, bumps `package.json`, tags, pushes, and runs the multi-platform build + publish inline. - -**How the next version is chosen:** - -All stable kinds (`patch`, `minor`, `major`) are computed off the latest _stable_ release, ignoring any RCs in between. - -- `kind=rc` + last tag was stable (e.g. `v1.3.14`) → `v1.3.15-rc.0`. -- `kind=rc` + active RC series (e.g. `v1.3.15-rc.2`) → `v1.3.15-rc.3`. -- `kind=patch` + latest stable `v1.3.14` → `v1.3.15` (regardless of any intermediate RCs). -- `kind=minor` + latest stable `v1.3.14` → `v1.4.0`. -- `kind=major` + latest stable `v1.3.14` → `v2.0.0`. - -**Safety guarantees:** - -- Stable releases are refused if the new version isn't strictly greater than the latest published stable. This is the only rule `electron-updater` actually needs — it compares semver within the `latest` channel, so a regressing stable is the one thing that breaks auto-update for fresh installs. -- Complete RC draft releases created by the release workflow are published before cutting a new tag only when the draft tag was built from the current release ref. Stale drafts are skipped so fixes cut a fresh RC instead of exposing old artifacts. -- If the latest RC tag exists but is still draft-only or missing its GitHub Release, the workflow resumes that tag only when it was built from the current release ref. Otherwise the next RC number is cut. -- RC numbering also considers release commits on `main`, so deleting a stale tag does not let a later cut reuse the same RC number. -- Off-main releases (when `ref` is not the tip of `main`) only push the tag. `main` is never mutated from a non-main ref, so you can safely release an older commit without polluting history. -- When `ref` is the tip of `main`, the workflow tries to fast-forward the version-bump commit onto `main`. If main requires pull requests, it leaves main unchanged and pushes only the release tag. Other push errors still stop the cut. - -**Common scenarios:** - -- **Normal release:** `kind=patch`, `ref=main`. -- **"A bad commit just landed on main, release the commit before it":** `kind=patch`, `ref=`. `main` is left alone; the tag points at the good SHA. Fix forward on `main` afterward. -- **One-off RC for a feature branch:** `kind=rc`, `ref=`. Produces an RC tag that does not touch `main`. -- **Minor or major bump:** `kind=minor` or `kind=major`. - -## Release Channels - -The public Homebrew cask tracks stable desktop releases: - -```bash -brew install --cask stablyai/orca/orca -``` - -Release candidates use a separate cask token: - -```bash -brew install --cask stablyai/orca/orca@rc -``` - -The two casks conflict because both install `Orca.app`. Switch channels with a -normal `brew uninstall --cask` followed by the install for the other channel. -Do not use `--zap` unless you intentionally want to remove local Orca state. +Ask questions on [Discord](https://discord.gg/fzjDKHxv8Q), or open an [issue](https://github.com/stablyai/orca/issues/new/choose) for bugs and feature requests. diff --git a/.github/workflows/performance-contracts.yml b/.github/workflows/performance-contracts.yml index 2af8bb94c6f..2c453310526 100644 --- a/.github/workflows/performance-contracts.yml +++ b/.github/workflows/performance-contracts.yml @@ -19,7 +19,6 @@ on: # Contracts without the .performance suffix. Keep in sync with config/vitest.performance.config.ts; # without these a rename lands green and only breaks the next nightly. - 'src/main/runtime/session-tabs/session-tabs-phone-layout-moves.test.ts' - - 'src/renderer/src/components/terminal-pane/pty-connection/startup/saved-resume-cancellation.test.ts' - 'src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-terminal-writer-acquire.test.ts' - 'src/shared/agent-launch/permissions/tui-agent-permission-choice.test.ts' - 'src/main/runtime/rpc/methods/projects/repo.test.ts' @@ -30,10 +29,8 @@ on: - 'src/main/codex-usage/scanner-incremental-append.test.ts' - 'src/main/usage/jsonl-file-reader.test.ts' - 'src/main/usage/jsonl-file-snapshot.test.ts' - - 'src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler-queue-retention.test.ts' - 'src/main/claude-usage/scanner-incremental-append.test.ts' - 'src/main/claude-usage/store-checkpoint-persistence.test.ts' - - 'src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.streaming-input.test.tsx' permissions: contents: read diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 13bed76ed0c..8826fd393ed 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -512,6 +512,10 @@ jobs: if: needs.code_paths.outputs.static_analysis == 'true' run: bun config/scripts/localization/source-extraction/audit-localization-coverage.mjs --check + - name: Verify startup and worktree localization coverage + if: needs.code_paths.outputs.static_analysis == 'true' + run: bun run verify:startup-worktree-localization-coverage + - name: Verify mobile localization if: needs.code_paths.outputs.static_analysis == 'true' run: bun config/scripts/localization/catalog-validation/verify-mobile-localization.mjs diff --git a/.gitignore b/.gitignore index 2da5dd09f72..b585bdd9e91 100644 --- a/.gitignore +++ b/.gitignore @@ -99,6 +99,7 @@ docs/** !docs/bug-reproductions/ !docs/bug-reproductions/** !docs/STYLEGUIDE.md +!docs/development.md !docs/styleguide/ !docs/styleguide/** !docs/agents-md-refs/ @@ -120,6 +121,9 @@ validation-screenshots/ test-results/ playwright-report/ +# Claude Code settings are machine-local. +**/.claude/settings.local.json + # Agent skills are installed per machine. /.claude/skills/ /.agents/skills/ diff --git a/README.md b/README.md index 8daff8adc7b..bc1defaa9c6 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,8 @@ _Or via a package manager:_ brew install --cask stablyai/orca/orca # Upgrade an existing install brew upgrade --cask stablyai/orca/orca +# Release candidates (conflicts with the stable cask; uninstall it first) +brew install --cask stablyai/orca/orca@rc # Arch Linux (AUR) — or stably-orca-git to build from source yay -S stably-orca-bin @@ -290,11 +292,9 @@ Pair with your desktop app to monitor and steer your agents from your phone. - **Discord:** Join the community on **[Discord](https://discord.gg/fzjDKHxv8Q)**. - **Twitter / X:** Follow **[@orca_build](https://x.com/orca_build)** for updates and announcements. -- **WeChat:** Scan to join an Orca community WeChat group. If one group is full, join another. +- **WeChat:** Scan to join an Orca community WeChat group. - WeChat QR code for the Orca community - WeChat QR code for the Orca community - WeChat QR code for the Orca community + WeChat QR code for the Orca community - **Feedback & Ideas:** We ship fast. Missing something? [Request a new feature](https://github.com/stablyai/orca/issues). - **Privacy:** See the [privacy & telemetry docs](https://www.onorca.dev/docs/telemetry) for what anonymous usage data Orca collects and how to opt out. diff --git a/cloud/apps/relay-edge/spike/run-all-lifecycle.ts b/cloud/apps/relay-edge/spike/run-all-lifecycle.ts index 04de1249906..a4e00c9fc29 100644 --- a/cloud/apps/relay-edge/spike/run-all-lifecycle.ts +++ b/cloud/apps/relay-edge/spike/run-all-lifecycle.ts @@ -1,5 +1,5 @@ // Later run-all.ts checks against the same host: rebind, orphan grace, silence, -// forced resets and pre-upgrade refusals. +// forced resets. import WebSocket from 'ws' import { GRACE_MS, ORIGIN, PING_MS, PORT, SILENCE_MS, makeControl, openPhone, record, sleep, waitFor, type Ctx, type Control } from './run-all-harness' @@ -89,12 +89,4 @@ export async function runLifecycleChecks(ctx: Ctx, main: Control, mainAck: Ack): back.client.closeNow() } - // Bad JWT -> 401 before upgrade; malformed host id -> 429. - { - const bad = new WebSocket(`ws://127.0.0.1:${PORT}/v1/host/control`, { headers: { authorization: 'Bearer nope' } }) - const status = await new Promise((res) => bad.on('unexpected-response', (_q, r) => res(r.statusCode ?? 0))) - const badHost = new WebSocket(`ws://127.0.0.1:${PORT}/v1/connect/short`) - const s2 = await new Promise((res) => badHost.on('unexpected-response', (_q, r) => res(r.statusCode ?? 0))) - record('R11/R5 ES256 JWKS rejects bad token (401); malformed host id 429', status === 401 && s2 === 429, `${status},${s2}`) - } } diff --git a/cloud/apps/relay-edge/spike/run-all.ts b/cloud/apps/relay-edge/spike/run-all.ts index ce1d8a6ee09..49627e7cf86 100644 --- a/cloud/apps/relay-edge/spike/run-all.ts +++ b/cloud/apps/relay-edge/spike/run-all.ts @@ -100,11 +100,6 @@ async function runTests(ctx: Ctx): Promise { const mainAck = await main.client.connect() const transport = main.bindTransport(mainAck.generation) - // Alarm-driven app ping, answered by the shipped client's pong handler. - await sleep(PING_MS * 3 + 300) - record('R2/R5 alarm-driven JSON ping parsed by shipped client, pong keeps control alive', - main.events.pings >= 2 && main.client.isLive(), `pings=${main.events.pings} live=${main.client.isLive()}`) - // Phone connect -> conn-open (strict, shipped parser) -> host data -> relay-hello (shipped parser). const phone = openPhone(ctx) const helloOk = await waitFor(() => phone.hello !== null, 5000) diff --git a/config/ast-grep/rule-tests/__snapshots__/claude-chat-entrypoint-callers-snapshot.yml b/config/ast-grep/rule-tests/__snapshots__/claude-chat-entrypoint-callers-snapshot.yml new file mode 100644 index 00000000000..6bd5f856dd1 --- /dev/null +++ b/config/ast-grep/rule-tests/__snapshots__/claude-chat-entrypoint-callers-snapshot.yml @@ -0,0 +1,14 @@ +id: claude-chat-entrypoint-callers +snapshots: + "import { withOrcaClaudeChatEntrypoint as stamp } from './claude-chat-entrypoint'": + labels: + - source: withOrcaClaudeChatEntrypoint + style: primary + start: 9 + end: 37 + 'withOrcaClaudeChatEntrypoint(env, platform)': + labels: + - source: withOrcaClaudeChatEntrypoint + style: primary + start: 0 + end: 28 diff --git a/config/ast-grep/rule-tests/__snapshots__/claude-chat-entrypoint-owner-snapshot.yml b/config/ast-grep/rule-tests/__snapshots__/claude-chat-entrypoint-owner-snapshot.yml new file mode 100644 index 00000000000..05f177c95df --- /dev/null +++ b/config/ast-grep/rule-tests/__snapshots__/claude-chat-entrypoint-owner-snapshot.yml @@ -0,0 +1,20 @@ +id: claude-chat-entrypoint-owner +snapshots: + "const env = { CLAUDE_CODE_ENTRYPOINT: 'orca' }": + labels: + - source: CLAUDE_CODE_ENTRYPOINT + style: primary + start: 14 + end: 36 + const identity = 'sdk-cli': + labels: + - source: sdk-cli + style: primary + start: 18 + end: 25 + "env['claude_code_entrypoint'] = 'other'": + labels: + - source: claude_code_entrypoint + style: primary + start: 5 + end: 27 diff --git a/config/ast-grep/rule-tests/__snapshots__/claude-entrypoint-key-owner-snapshot.yml b/config/ast-grep/rule-tests/__snapshots__/claude-entrypoint-key-owner-snapshot.yml new file mode 100644 index 00000000000..ea2790098fb --- /dev/null +++ b/config/ast-grep/rule-tests/__snapshots__/claude-entrypoint-key-owner-snapshot.yml @@ -0,0 +1,14 @@ +id: claude-entrypoint-key-owner +snapshots: + "env[CLAUDE_ENTRYPOINT_ENV] = 'orca'": + labels: + - source: CLAUDE_ENTRYPOINT_ENV + style: primary + start: 4 + end: 25 + "import { CLAUDE_ENTRYPOINT_ENV as key } from './claude-chat-entrypoint'": + labels: + - source: CLAUDE_ENTRYPOINT_ENV + style: primary + start: 9 + end: 30 diff --git a/config/ast-grep/rule-tests/claude-chat-entrypoint-callers-test.yml b/config/ast-grep/rule-tests/claude-chat-entrypoint-callers-test.yml new file mode 100644 index 00000000000..cca0fcf607c --- /dev/null +++ b/config/ast-grep/rule-tests/claude-chat-entrypoint-callers-test.yml @@ -0,0 +1,6 @@ +id: claude-chat-entrypoint-callers +valid: + - 'stripInheritedClaudeSessionEnv(env)' +invalid: + - 'withOrcaClaudeChatEntrypoint(env, platform)' + - "import { withOrcaClaudeChatEntrypoint as stamp } from './claude-chat-entrypoint'" diff --git a/config/ast-grep/rule-tests/claude-chat-entrypoint-owner-test.yml b/config/ast-grep/rule-tests/claude-chat-entrypoint-owner-test.yml new file mode 100644 index 00000000000..87a75f4a143 --- /dev/null +++ b/config/ast-grep/rule-tests/claude-chat-entrypoint-owner-test.yml @@ -0,0 +1,8 @@ +id: claude-chat-entrypoint-owner +valid: + - 'const env = withOrcaClaudeChatEntrypoint(configured, platform)' + - "const binary = 'orca'" +invalid: + - "const env = { CLAUDE_CODE_ENTRYPOINT: 'orca' }" + - "env['claude_code_entrypoint'] = 'other'" + - "const identity = 'sdk-cli'" diff --git a/config/ast-grep/rule-tests/claude-entrypoint-key-owner-test.yml b/config/ast-grep/rule-tests/claude-entrypoint-key-owner-test.yml new file mode 100644 index 00000000000..c63b8b38063 --- /dev/null +++ b/config/ast-grep/rule-tests/claude-entrypoint-key-owner-test.yml @@ -0,0 +1,6 @@ +id: claude-entrypoint-key-owner +valid: + - "const binary = 'orca'" +invalid: + - "env[CLAUDE_ENTRYPOINT_ENV] = 'orca'" + - "import { CLAUDE_ENTRYPOINT_ENV as key } from './claude-chat-entrypoint'" diff --git a/config/ast-grep/rules/claude-chat-entrypoint.yml b/config/ast-grep/rules/claude-chat-entrypoint.yml new file mode 100644 index 00000000000..cb56d1fa679 --- /dev/null +++ b/config/ast-grep/rules/claude-chat-entrypoint.yml @@ -0,0 +1,117 @@ +id: claude-chat-entrypoint-owner +language: typescript +severity: error +message: Keep the Claude identity literal in claude-chat-entrypoint.ts. +files: ['src/**'] +ignores: + - '**/*.test.*' + - '**/*.test-fixtures.*' + - '**/__fixtures__/**' + - 'src/shared/agent-launch/startup/claude-chat-entrypoint.ts' +rule: + all: + - any: + - kind: string_fragment + - kind: property_identifier + - kind: identifier + - regex: '(?i)^(CLAUDE_CODE_ENTRYPOINT|sdk-cli)$' +--- +id: claude-chat-entrypoint-owner-tsx +language: tsx +severity: error +message: Keep the Claude identity literal in claude-chat-entrypoint.ts. +files: ['src/**'] +ignores: + - '**/*.test.*' + - '**/*.test-fixtures.*' + - '**/__fixtures__/**' + - 'src/shared/agent-launch/startup/claude-chat-entrypoint.ts' +rule: + all: + - any: + - kind: string_fragment + - kind: property_identifier + - kind: identifier + - regex: '(?i)^(CLAUDE_CODE_ENTRYPOINT|sdk-cli)$' +--- +id: claude-chat-entrypoint-callers +language: typescript +severity: error +message: Only structured native chat and its own probes may apply the chat identity. +files: ['src/**'] +ignores: + - '**/*.test.*' + - '**/*.test-fixtures.*' + - '**/__fixtures__/**' + - 'src/shared/agent-launch/startup/claude-chat-entrypoint.ts' + - 'src/main/claude/claude-stream-json-connection.ts' + - 'src/main/claude/claude-agent-sdk-process-spawn.ts' + - 'src/main/claude/structured/launch/claude-structured-child-env.ts' + - 'src/main/claude/claude-model-catalog-probe.ts' +rule: + all: + - any: + - kind: string_fragment + - kind: property_identifier + - kind: identifier + - regex: '^withOrcaClaudeChatEntrypoint$' +--- +id: claude-chat-entrypoint-callers-tsx +language: tsx +severity: error +message: Only structured native chat and its own probes may apply the chat identity. +files: ['src/**'] +ignores: + - '**/*.test.*' + - '**/*.test-fixtures.*' + - '**/__fixtures__/**' + - 'src/shared/agent-launch/startup/claude-chat-entrypoint.ts' + - 'src/main/claude/claude-stream-json-connection.ts' + - 'src/main/claude/claude-agent-sdk-process-spawn.ts' + - 'src/main/claude/structured/launch/claude-structured-child-env.ts' + - 'src/main/claude/claude-model-catalog-probe.ts' +rule: + all: + - any: + - kind: string_fragment + - kind: property_identifier + - kind: identifier + - regex: '^withOrcaClaudeChatEntrypoint$' +--- +id: claude-entrypoint-key-owner +language: typescript +severity: error +message: Only the chat identity owner and inherited-session isolation may access this key directly. +files: ['src/**'] +ignores: + - '**/*.test.*' + - '**/*.test-fixtures.*' + - '**/__fixtures__/**' + - 'src/shared/agent-launch/startup/claude-chat-entrypoint.ts' + - 'src/shared/agent-launch/startup/claude-parent-session-env.ts' +rule: + all: + - any: + - kind: string_fragment + - kind: property_identifier + - kind: identifier + - regex: '^CLAUDE_ENTRYPOINT_ENV$' +--- +id: claude-entrypoint-key-owner-tsx +language: tsx +severity: error +message: Only the chat identity owner and inherited-session isolation may access this key directly. +files: ['src/**'] +ignores: + - '**/*.test.*' + - '**/*.test-fixtures.*' + - '**/__fixtures__/**' + - 'src/shared/agent-launch/startup/claude-chat-entrypoint.ts' + - 'src/shared/agent-launch/startup/claude-parent-session-env.ts' +rule: + all: + - any: + - kind: string_fragment + - kind: property_identifier + - kind: identifier + - regex: '^CLAUDE_ENTRYPOINT_ENV$' diff --git a/config/build-plugins/react-compiler-uncompiled-files.mjs b/config/build-plugins/react-compiler-uncompiled-files.mjs new file mode 100644 index 00000000000..9c7826c0f19 --- /dev/null +++ b/config/build-plugins/react-compiler-uncompiled-files.mjs @@ -0,0 +1,36 @@ +import { readFileSync } from 'node:fs' +import { resolve } from 'node:path' +import { fileURLToPath } from 'node:url' + +// Why: import.meta.url, not dirname — electron-vite's config bundle rewrites only the former. +const REPO_ROOT = fileURLToPath(new URL('../..', import.meta.url)) + +export const UNCOMPILED_LIST = 'config/react-compiler-uncompiled-files.txt' +// Hand-kept list plus every file still in a hazard ratchet; compiled, these would run differently. +export const UNCOMPILED_FILE_LISTS = [ + UNCOMPILED_LIST, + 'config/render-path-translate-baseline.txt', + 'config/react-compiler-hazard-baseline.txt' +] + +/** Repo-relative paths from a list or count baseline: `[count ]path[#detail][ # note]`. */ +export function parseListedFiles(text) { + return text + .split('\n') + .map((line) => line.trim()) + .filter((line) => line && !line.startsWith('#')) + .map((line) => + line + .replace(/^\d+\s+/, '') + .split('#')[0] + .trim() + ) +} + +export function readListedFiles(list, root = REPO_ROOT) { + return parseListedFiles(readFileSync(resolve(root, list), 'utf8')) +} + +export function reactCompilerExcludedFiles(root = REPO_ROOT) { + return [...new Set(UNCOMPILED_FILE_LISTS.flatMap((list) => readListedFiles(list, root)))] +} diff --git a/config/build-plugins/react-compiler.ts b/config/build-plugins/react-compiler.ts index fcdb314daa8..33ec76cc24b 100644 --- a/config/build-plugins/react-compiler.ts +++ b/config/build-plugins/react-compiler.ts @@ -1,25 +1,5 @@ -import { readFileSync } from 'node:fs' -import { resolve } from 'node:path' import type { Options } from '@vitejs/plugin-react' - -// Hand-kept list plus every file still in a hazard ratchet; compiled, these would run differently. -const UNCOMPILED_FILE_LISTS = [ - 'config/react-compiler-uncompiled-files.txt', - 'config/render-path-translate-baseline.txt', - 'config/react-compiler-hazard-baseline.txt' -] - -function listedFiles(list: string): string[] { - return readFileSync(resolve(list), 'utf8') - .split('\n') - .map((line) => line.trim()) - .filter((line) => line && !line.startsWith('#')) - .map((line) => line.replace(/^\d+\s+/, '').split('#')[0]) -} - -export function reactCompilerExcludedFiles(): string[] { - return [...new Set(UNCOMPILED_FILE_LISTS.flatMap(listedFiles))] -} +import { reactCompilerExcludedFiles } from './react-compiler-uncompiled-files.mjs' export function isReactCompilerEnabled(): boolean { return process.env.ORCA_REACT_COMPILER !== '0' diff --git a/config/flaky-test-pattern-baseline.txt b/config/flaky-test-pattern-baseline.txt index ae202c028d9..8ee00e478c2 100644 --- a/config/flaky-test-pattern-baseline.txt +++ b/config/flaky-test-pattern-baseline.txt @@ -30,8 +30,6 @@ 3 test-no-in-test-import-actual:src/renderer/src/components/terminal-pane/snapshots/remote-snapshot-alt-screen-host-chain.test.ts 1 test-no-in-test-import-actual:src/renderer/src/hooks/useIpcEvents-agent-status-pane-teardown.test.ts 1 test-no-in-test-import-actual:src/renderer/src/hooks/useIpcEvents-agent-status-snapshot-hydration.test.ts -1 test-no-in-test-import-actual:src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts -1 test-no-in-test-import-actual:src/renderer/src/lib/agent-session/launch/new-tab/agent-launch-caller-routing.test.ts 1 test-no-polling-loop:src/main/browser/cookies/browser-cookie-import-concurrency.test.ts 1 test-no-polling-loop:src/main/claude/claude-stop-ack-race.test.ts 1 test-no-polling-loop:src/main/claude/claude-stream-json-connection.test.ts @@ -257,14 +255,12 @@ 1 test-no-real-time-wait:src/main/windows/windows-process-tree-command-line-patch.test.ts 2 test-no-real-time-wait:src/main/windows/windows-pty-job.win32.test.ts 1 test-no-real-time-wait:src/main/worker-thread-child-process/worker-thread-child-process.test.ts -1 test-no-real-time-wait:src/main/workspaces/creation/preparation/worktree-create-preparation-cancellation.test.ts 1 test-no-real-time-wait:src/main/workspaces/removal/local-worktree-removal-recovery-live.test.ts 2 test-no-real-time-wait:src/main/wsl/execution/wsl-command-loop.test.ts 2 test-no-real-time-wait:src/main/wsl/orcad/wsl-orcad-real-distro-lane.test.ts 4 test-no-real-time-wait:src/renderer/src/components/activity/activity-auto-mark-read-loop.react185.test.tsx 1 test-no-real-time-wait:src/renderer/src/components/editor/DiagramViewerModal.test.tsx 1 test-no-real-time-wait:src/renderer/src/components/editor/combined-diff/load-sections/combined-diff-stale-analysis-work-budget.test.tsx -1 test-no-real-time-wait:src/renderer/src/components/native-chat/drafts/native-chat-composer-draft-lifecycle.test.tsx 4 test-no-real-time-wait:src/renderer/src/components/native-chat/drafts/native-chat-composer-draft-store.test.ts 1 test-no-real-time-wait:src/renderer/src/components/terminal-pane/layout/split/resolve-split-cwd.test.ts 2 test-no-real-time-wait:src/renderer/src/components/terminal-pane/pty-connection/emulation/fish-color-scheme-child-stdin.node-pty.test.ts @@ -274,7 +270,6 @@ 1 test-no-real-time-wait:src/renderer/src/components/terminal-pane/viewport/terminal-fit-restore.test.ts 1 test-no-real-time-wait:src/renderer/src/hooks/runtime-project-refresh-scheduler.test.ts 1 test-no-real-time-wait:src/renderer/src/lib/agent-session/resume/cli-fork/native-chat-cli-fork-preparation.test.ts -1 test-no-real-time-wait:src/renderer/src/lib/orca-yaml-trust-prompt-slot-eviction.test.ts 2 test-no-real-time-wait:src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-removal-preflight.test.ts 2 test-no-real-time-wait:src/shared/__tests__/process-host/windows-tree-kill-late-taskkill.win32.test.ts 1 test-no-real-time-wait:src/shared/darwin-process-table-capture.test.ts @@ -634,12 +629,12 @@ 2 test-no-wall-clock:src/renderer/src/components/dashboard/useLiveDashboardSnapshot.test.ts 1 test-no-wall-clock:src/renderer/src/components/native-chat/conversation/slots/NativeChatMessageList.opening-send.test.tsx 1 test-no-wall-clock:src/renderer/src/components/native-chat/conversation/slots/NativeChatMessageList.queued-turn-order.test.tsx -3 test-no-wall-clock:src/renderer/src/components/native-chat/conversation/turns/NativeChatMessageList.turn-indicator.test.tsx +2 test-no-wall-clock:src/renderer/src/components/native-chat/conversation/turns/NativeChatMessageList.turn-indicator.test.tsx 3 test-no-wall-clock:src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx 1 test-no-wall-clock:src/renderer/src/components/native-chat/session/structured/delivery/NativeChatMessageList.unsent-message.test.tsx 3 test-no-wall-clock:src/renderer/src/components/native-chat/surfaces/integration/NativeChatMessageList.test.tsx 2 test-no-wall-clock:src/renderer/src/components/native-chat/tools/tasks/NativeChatStructuredSessionStatus.test.tsx -3 test-no-wall-clock:src/renderer/src/components/sidebar/workspace-card/review/use-workspace-reference-details.test.tsx +1 test-no-wall-clock:src/renderer/src/components/sidebar/workspace-card/review/use-workspace-reference-details.test.tsx 1 test-no-wall-clock:src/renderer/src/components/sidebar/worktree-list/listing/WorktreeList.lineage-agent-expansion-coupling.test.tsx 2 test-no-wall-clock:src/renderer/src/components/task-page/jira/task-page-jira-cache-selectors.test.ts 2 test-no-wall-clock:src/renderer/src/components/terminal-pane/pty-connection/emulation/fish-color-scheme-child-stdin.node-pty.test.ts @@ -649,13 +644,11 @@ 1 test-no-wall-clock:src/renderer/src/components/worktree-jump/WorktreeJumpPalette.recent-tabs.behavior.test.tsx 4 test-no-wall-clock:src/renderer/src/components/worktree-jump/WorktreeJumpPalette.recent-tabs.test.tsx 2 test-no-wall-clock:src/renderer/src/hooks/ipc-events/agent-status-terminal-title-tab-write.test.ts -1 test-no-wall-clock:src/renderer/src/hooks/useIpcEvents-agent-status-hook-titles.test.ts 1 test-no-wall-clock:src/renderer/src/lib/paired-runtime-closed-tab-resume.test.ts 2 test-no-wall-clock:src/renderer/src/lib/use-tab-agent-observed-signal-dispatch.test.tsx 2 test-no-wall-clock:src/renderer/src/lib/wake-sleeping-agents-live-unmounted-pane.test.ts 1 test-no-wall-clock:src/renderer/src/lib/workspace/ownership/workspace-terminal-host-authority.test.ts 1 test-no-wall-clock:src/renderer/src/lib/workspace/activation/worktree-activation-emptied-workspace-reseed.test.ts -2 test-no-wall-clock:src/renderer/src/runtime/native-chat/tab-retirement/structured-agent-session-tab-retirement.test.ts 2 test-no-wall-clock:src/renderer/src/store/github/pull-requests/github-pr-branch-linked-pr-divergence.test.ts 6 test-no-wall-clock:src/renderer/src/store/slices/jira/jira.test.ts 5 test-no-wall-clock:src/renderer/src/store/slices/worktrees/metadata/worktree-meta-hosted-review.test.ts @@ -679,7 +672,6 @@ 2 test-no-wall-clock:tests/e2e/cross-version-wire/release-source-retention.unit.test.ts 1 test-no-wall-clock:tests/e2e/host-cold-park-remote-subscriber.unit.test.ts 2 test-no-wall-clock:tests/e2e/omp-child-session-recovery.unit.test.ts -1 test-no-wall-clock:tests/e2e/structured-session-tab-close-regressions.unit.test.ts 2 test-timeout-needs-reason:mobile/src/terminal/document/native-document-bundle.test.ts 1 test-timeout-needs-reason:mobile/src/test-support/rpc-recording/family-recordings.test.ts 1 test-timeout-needs-reason:mobile/src/test-support/rpc-recording/mutants/family-mutants.test.ts diff --git a/config/focus-setting-read-baseline.txt b/config/focus-setting-read-baseline.txt index 4b3f4c25346..f907d5d4bef 100644 --- a/config/focus-setting-read-baseline.txt +++ b/config/focus-setting-read-baseline.txt @@ -12,17 +12,17 @@ 3 src/renderer/src/components/LinearIssueTextEditor.tsx 3 src/renderer/src/components/LinearIssueWorkspace.tsx 5 src/renderer/src/components/LinearItemDrawer.tsx -1 src/renderer/src/components/NativeChatResumeOnRestartGroups.tsx +1 src/renderer/src/components/native-chat-recovery/tree/NativeChatResumeOnRestartGroups.tsx 1 src/renderer/src/components/activity/ActivityPrototypePage.tsx 1 src/renderer/src/components/activity/activity-scope-filter-controls.tsx 2 src/renderer/src/components/activity/activity-thread-actions.ts 1 src/renderer/src/components/activity/use-agent-pane-thread-store-data.ts 1 src/renderer/src/components/activity/use-agent-pane-threads.ts 4 src/renderer/src/components/agent/AgentSettingsDialog.tsx -1 src/renderer/src/components/automations/automation-host-client.ts +1 src/renderer/src/components/automations/hosts/automation-host-client.ts 1 src/renderer/src/components/automations/automations-page-fixtures.ts 1 src/renderer/src/components/automations/use-automations-page-controller.ts -1 src/renderer/src/components/automations/use-automations-page-destination-form.ts +1 src/renderer/src/components/automations/authoring/use-automations-page-destination-form.ts 1 src/renderer/src/components/browser-pane/ReopenBrowserPageOnServerButton.tsx 1 src/renderer/src/components/browser-pane/browser-reopen-on-server.ts 1 src/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-stream.ts @@ -204,11 +204,11 @@ 1 src/renderer/src/hooks/ipc-events/runtime-environment-subscription-selection.ts 1 src/renderer/src/hooks/ipc-events/settings-sidebar-ipc-bridge.ts 1 src/renderer/src/hooks/ipc-events/terminal-request-ipc-bridge.ts -1 src/renderer/src/hooks/use-active-skill-discovery-runtime-target.ts +1 src/renderer/src/hooks/skills/discovery/use-active-skill-discovery-runtime-target.ts 2 src/renderer/src/hooks/use-integration-provider-status-refresh.ts -1 src/renderer/src/hooks/useActiveProjectSkillRuntime.ts +1 src/renderer/src/hooks/skills/runtime/useActiveProjectSkillRuntime.ts 1 src/renderer/src/hooks/useEditorExternalWatch.ts -1 src/renderer/src/hooks/useInstalledAgentSkills.ts +1 src/renderer/src/hooks/skills/discovery/useInstalledAgentSkills.ts 1 src/renderer/src/hooks/useIpcEvents.ts 4 src/renderer/src/hooks/useIssueMetadata.ts 2 src/renderer/src/hooks/useLinearIssuePublication.ts @@ -230,11 +230,11 @@ 1 src/renderer/src/lib/workspace/ownership/runtime-session-mirror-owners.ts 1 src/renderer/src/lib/runtime-session-mirror-targets.ts 1 src/renderer/src/lib/workspace/ownership/single-runtime-legacy-owner.ts -1 src/renderer/src/lib/skill-runtime-command.ts -1 src/renderer/src/lib/terminal-close-route.ts -4 src/renderer/src/lib/terminal-worktree-route.ts # resolveTerminalPtyOwner: teardown, close and PTY identity read spawn's attribution (round 3 F8), which retired the deprecated resolver's readers +1 src/renderer/src/lib/skills/runtime/skill-runtime-command.ts +1 src/renderer/src/lib/workspace/ownership/terminal-close-route.ts +4 src/renderer/src/lib/workspace/ownership/terminal-worktree-route.ts # resolveTerminalPtyOwner: teardown, close and PTY identity read spawn's attribution (round 3 F8), which retired the deprecated resolver's readers 3 src/renderer/src/lib/unread-badge-count-selector.ts -1 src/renderer/src/lib/web-runtime-worktree-terminal-after-wake.ts +1 src/renderer/src/runtime/hosted-terminals/restoration/web-runtime-worktree-terminal-after-wake.ts 1 src/renderer/src/lib/work-items/linear/linear-issue-url-lookup.ts 1 src/renderer/src/lib/work-items/linear/linear-issue-write.ts 1 src/renderer/src/lib/workspace/activation/worktree-activation.ts diff --git a/config/host-list-render-baseline.txt b/config/host-list-render-baseline.txt index 09d3a029300..8cceee047a8 100644 --- a/config/host-list-render-baseline.txt +++ b/config/host-list-render-baseline.txt @@ -1,7 +1,7 @@ # JSX mapped straight over a host collection, per file, outside components/host-picker. # This is a RATCHET: counts may only go DOWN. Draw host lists with HostCombobox or # useBoundedHostRows. Prune after a fix: pnpm check:host-list-render-ratchet --prune -1 src/renderer/src/components/automations/AutomationRunsDashboard.tsx +1 src/renderer/src/components/automations/runs/AutomationRunsDashboard.tsx 1 src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanelControls.tsx 1 src/renderer/src/components/right-sidebar/source-control/ai/SourceControlAgentActionDialogForm.tsx 1 src/renderer/src/components/settings/browser/profiles/BrowserSessionCookiesSection.tsx diff --git a/config/main-layout-writer-baseline.txt b/config/main-layout-writer-baseline.txt index 096973f7717..38d52fa4386 100644 --- a/config/main-layout-writer-baseline.txt +++ b/config/main-layout-writer-baseline.txt @@ -3,9 +3,10 @@ # This is a RATCHET: counts may only go DOWN. Layout moves to one runtime owner; do not add # writers. Prune after removing writers: pnpm check:layout-writer-ratchets --prune 1 src/main/ipc/pty/ipc/leaf-move.ts +1 src/main/ipc/pty/pane/fresh-pane-binding.ts 1 src/main/ipc/pty/pane/pane-owner-replacement.ts 3 src/main/ipc/pty/pane/stable-owner.ts -2 src/main/ipc/pty/spawn-commit-binding.ts +1 src/main/ipc/pty/spawn-commit-binding.ts 1 src/main/ipc/renderer-shutdown-checkpoint.ts 1 src/main/ipc/runtime-environments/runtime-environment-removal-cleanup.ts 1 src/main/ipc/runtime-environments/runtime-environment-session-reconcile.ts @@ -32,6 +33,7 @@ 2 src/main/persistence/migrating-orcad-catalog/orcad-destination-client-state.ts 1 src/main/persistence/migrating-orcad-catalog/orcad-destination-workspace-session.ts 3 src/main/persistence/migrating-orcad-catalog/orcad-dormant-state-records.ts +1 src/main/persistence/migrating-orcad-catalog/orcad-migration-source-retention.ts 2 src/main/persistence/migrating-orcad-catalog/orcad-source-client-subtraction.ts 1 src/main/persistence/migrating-orcad-catalog/orcad-source-dormant-state.ts 1 src/main/persistence/migrating-orcad-catalog/orcad-source-scrollback-state.ts @@ -53,11 +55,11 @@ 2 src/main/pty/scrollback/terminal-scrollback-snapshots.ts 1 src/main/runtime/browser/client-pages/client-hosted-browser-page-persistence.ts 1 src/main/runtime/client/runtime-client-state.ts -1 src/main/runtime/session-tabs/headless-editor-tabs.ts 4 src/main/runtime/orchestration/terminal-authority/runtime-legacy-worker-terminal-recovery-persistence.ts 2 src/main/runtime/session-graph/session-graph-promotion.ts 2 src/main/runtime/session-lifecycle/projection/apply-mobile-session-tab-navigation.ts 2 src/main/runtime/session-lifecycle/projection/build-headless-mobile-session-browser-tabs.ts +1 src/main/runtime/session-tabs/headless-editor-tabs.ts 2 src/main/runtime/session-tabs/headless-tab-group-moves.ts 6 src/main/runtime/session-tabs/headless-tab-properties.ts 2 src/main/runtime/session-tabs/headless-terminal-tab-titles.ts @@ -72,5 +74,4 @@ 3 src/main/runtime/terminal/surface/mobile-session-layout-projection.ts 1 src/main/runtime/workspaces/session-hosts/get-runtime-id.ts 1 src/main/runtime/workspaces/session-hosts/runtime-workspace-session-controller.ts -1 src/main/persistence/migrating-orcad-catalog/orcad-migration-source-retention.ts 1 src/main/ssh/targets/ssh-target-id-migration.ts diff --git a/config/main-sync-fs-baseline.txt b/config/main-sync-fs-baseline.txt index a4efe1beedc..36b07604a3e 100644 --- a/config/main-sync-fs-baseline.txt +++ b/config/main-sync-fs-baseline.txt @@ -282,6 +282,7 @@ 1 src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-subscribe.ts 1 src/main/ipc/filesystem/watcher-process/rebinding-file-watch.ts 1 src/main/ipc/filesystem/watcher-process/watcher-event-root-path-rewrite.ts +1 src/main/ipc/floating-workspace-directory.ts 1 src/main/ipc/macos-keyboard-layout-snapshot.ts 1 src/main/ipc/notification-authorization-status.ts 1 src/main/ipc/pty/spawn-pane-env.ts @@ -550,7 +551,6 @@ 2 src/main/worker-threads/forked-child-entry-path.ts 4 src/main/workspace-hooks/hooks.ts 10 src/main/workspace-hooks/issue-command-file.ts -4 src/main/workspace-hooks/worktree-runner-script.ts 1 src/main/workspaces/catalog/folder-repo-git-conversion.ts 2 src/main/workspaces/catalog/folder-upgrade-worktree-path.ts 3 src/main/workspaces/execution-host/project-runtime-git-router.ts diff --git a/config/mobile-localization-coverage-allowlist.json b/config/mobile-localization-coverage-allowlist.json index 50d8243f0f7..113c65c34da 100644 --- a/config/mobile-localization-coverage-allowlist.json +++ b/config/mobile-localization-coverage-allowlist.json @@ -307,6 +307,27 @@ "dynamic": false, "count": 1 }, + { + "filePath": "mobile/src/terminal/session/MobileSessionLatchKeys.tsx", + "kind": "object-property:label", + "text": "Shift", + "dynamic": false, + "count": 1 + }, + { + "filePath": "mobile/src/terminal/session/MobileSessionLatchKeys.tsx", + "kind": "object-property:label", + "text": "Ctrl", + "dynamic": false, + "count": 1 + }, + { + "filePath": "mobile/src/terminal/session/MobileSessionLatchKeys.tsx", + "kind": "object-property:label", + "text": "Alt", + "dynamic": false, + "count": 1 + }, { "filePath": "mobile/src/tasks/mobile-smart-source-modes.ts", "kind": "object-property:label", @@ -539,21 +560,21 @@ "count": 1 }, { - "filePath": "mobile/src/transport/hosts/mobile-relay-host-overlay.ts", + "filePath": "mobile/src/host-catalog/mobile-relay-host-overlay.ts", "kind": "object-property:message", "text": "Expected exactly one endpoint for configured relay metadata", "dynamic": false, "count": 1 }, { - "filePath": "mobile/src/transport/hosts/mobile-relay-host-overlay.ts", + "filePath": "mobile/src/host-catalog/mobile-relay-host-overlay.ts", "kind": "object-property:message", "text": "Relay host identity mismatch", "dynamic": false, "count": 1 }, { - "filePath": "mobile/src/transport/hosts/mobile-relay-host-overlay.ts", + "filePath": "mobile/src/host-catalog/mobile-relay-host-overlay.ts", "kind": "object-property:message", "text": "Relay identity and endpoint must coexist", "dynamic": false, diff --git a/config/oxlint-code-quality-native-plugins.json b/config/oxlint-code-quality-native-plugins.json index 5f2fb031a51..e631f3c3fc8 100644 --- a/config/oxlint-code-quality-native-plugins.json +++ b/config/oxlint-code-quality-native-plugins.json @@ -14,7 +14,7 @@ "import/export": "warn", "import/named": "warn", "import/namespace": "warn", - "import/no-cycle": ["warn", { "maxDepth": 3 }], + "import/no-cycle": ["warn", { "ignoreTypes": true }], "import/no-duplicates": "warn", "import/no-empty-named-blocks": "warn", "import/no-self-import": "warn" diff --git a/config/react-compiler-bailout-baseline.txt b/config/react-compiler-bailout-baseline.txt index d1bc3f33bea..12aa339d614 100644 --- a/config/react-compiler-bailout-baseline.txt +++ b/config/react-compiler-bailout-baseline.txt @@ -28,27 +28,27 @@ 1 src/renderer/src/components/artifacts/ArtifactPublishButton.tsx 2 src/renderer/src/components/artifacts/ArtifactsPage.tsx 2 src/renderer/src/components/artifacts/useArtifactPagination.ts -2 src/renderer/src/components/automations/AutomationEditorPromptEditor.tsx -1 src/renderer/src/components/automations/AutomationHostFilterNotice.tsx -1 src/renderer/src/components/automations/AutomationProjectCombobox.tsx -1 src/renderer/src/components/automations/AutomationRunHistory.tsx -1 src/renderer/src/components/automations/AutomationRunsDashboard.tsx -1 src/renderer/src/components/automations/AutomationRunsTable.tsx +2 src/renderer/src/components/automations/authoring/AutomationEditorPromptEditor.tsx +1 src/renderer/src/components/automations/hosts/AutomationHostFilterNotice.tsx +1 src/renderer/src/components/automations/authoring/AutomationProjectCombobox.tsx +1 src/renderer/src/components/automations/runs/AutomationRunHistory.tsx +1 src/renderer/src/components/automations/runs/AutomationRunsDashboard.tsx +1 src/renderer/src/components/automations/runs/AutomationRunsTable.tsx 1 src/renderer/src/components/automations/AutomationsPageSurface.tsx -1 src/renderer/src/components/automations/use-automation-agent-picker-entries.ts -2 src/renderer/src/components/automations/use-automation-create-destination.ts -4 src/renderer/src/components/automations/use-automation-host-catalog.ts -4 src/renderer/src/components/automations/use-automation-list-search.ts -2 src/renderer/src/components/automations/use-automation-migrate-action.ts -1 src/renderer/src/components/automations/use-automation-runs-dashboard.ts -1 src/renderer/src/components/automations/use-automations-page-list-state.ts +1 src/renderer/src/components/automations/authoring/use-automation-agent-picker-entries.ts +2 src/renderer/src/components/automations/authoring/use-automation-create-destination.ts +4 src/renderer/src/components/automations/hosts/use-automation-host-catalog.ts +4 src/renderer/src/components/automations/listing/use-automation-list-search.ts +2 src/renderer/src/components/automations/authoring/use-automation-migrate-action.ts +1 src/renderer/src/components/automations/runs/use-automation-runs-dashboard.ts +1 src/renderer/src/components/automations/listing/use-automations-page-list-state.ts 1 src/renderer/src/components/automations/use-automations-page-local-state.ts 1 src/renderer/src/components/automations/use-automations-page-refresh.ts -1 src/renderer/src/components/automations/use-automations-page-setup-state.ts +1 src/renderer/src/components/automations/authoring/use-automations-page-setup-state.ts 1 src/renderer/src/components/automations/use-automations-page-store-state.ts -1 src/renderer/src/components/automations/use-external-automation-scope-retention.ts -2 src/renderer/src/components/automations/use-scoped-external-automations.ts -16 src/renderer/src/components/automations/use-selected-automation-run-history.ts +1 src/renderer/src/components/automations/external/use-external-automation-scope-retention.ts +2 src/renderer/src/components/automations/external/use-scoped-external-automations.ts +16 src/renderer/src/components/automations/runs/use-selected-automation-run-history.ts 7 src/renderer/src/components/browser-extension-install-dialog.tsx 1 src/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.tsx 2 src/renderer/src/components/browser-pane/annotate/MarkupOverlay.tsx @@ -206,7 +206,7 @@ 1 src/renderer/src/components/mobile/WindowsFirewallNotice.tsx 2 src/renderer/src/components/mobile/use-mobile-page-paired-devices.ts 1 src/renderer/src/components/mobile/use-mobile-pairing-generation.ts -1 src/renderer/src/components/native-chat-restart-runtimes.ts +1 src/renderer/src/components/native-chat-recovery/offers/native-chat-restart-runtimes.ts 1 src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx 8 src/renderer/src/components/native-chat/attachments/chips/use-native-chat-composer-attachments.ts 2 src/renderer/src/components/native-chat/attachments/intake/use-native-chat-resolved-path-attachments.ts @@ -542,16 +542,16 @@ 4 src/renderer/src/components/sidebar/worktree-list/viewport/use-row-measurement.ts 1 src/renderer/src/components/sidebar/worktree-list/viewport/use-scroll-to-top.ts 1 src/renderer/src/components/sidebar/worktree-list/viewport/use-virtualizer.ts -1 src/renderer/src/components/skills/SkillBundleInstallFlow.tsx -2 src/renderer/src/components/skills/SkillInstallDialog.tsx -4 src/renderer/src/components/skills/SkillInstallManagementDialog.tsx -1 src/renderer/src/components/skills/SkillShareDialog.tsx -1 src/renderer/src/components/skills/SkillSharedLinkRow.tsx +1 src/renderer/src/components/skills/installation/SkillBundleInstallFlow.tsx +2 src/renderer/src/components/skills/installation/SkillInstallDialog.tsx +4 src/renderer/src/components/skills/installation/SkillInstallManagementDialog.tsx +1 src/renderer/src/components/skills/sharing/SkillShareDialog.tsx +1 src/renderer/src/components/skills/sharing/SkillSharedLinkRow.tsx 1 src/renderer/src/components/skills/SkillsPage.tsx 1 src/renderer/src/components/skills/setup/WslAgentSkillSetupPanel.tsx -2 src/renderer/src/components/skills/use-owned-skill-shares.ts -1 src/renderer/src/components/skills/use-reviewed-skill-plan.ts -1 src/renderer/src/components/skills/use-skill-delete-flow.ts +2 src/renderer/src/components/skills/sharing/use-owned-skill-shares.ts +1 src/renderer/src/components/skills/freshness/use-reviewed-skill-plan.ts +1 src/renderer/src/components/skills/deletion/use-skill-delete-flow.ts 1 src/renderer/src/components/sparse/SparseCheckoutPresetSelect.tsx 1 src/renderer/src/components/ssh-host-recovery/SshHostMoveAnywayAction.tsx 2 src/renderer/src/components/star-nag/StarNagAgentValueMomentObserver.tsx @@ -651,7 +651,7 @@ 2 src/renderer/src/components/terminal-pane/mobile-driver/MobileDriverOverlay.tsx 1 src/renderer/src/components/terminal-pane/mobile-driver/TerminalPaneMobileDriverPortals.tsx 1 src/renderer/src/components/terminal-pane/mounting/use-terminal-pane-mount-lifecycle.ts -2 src/renderer/src/components/terminal-pane/parking/lifecycle/use-terminal-tab-cold-parking.ts +1 src/renderer/src/components/terminal-pane/parking/lifecycle/use-terminal-tab-cold-parking.ts 1 src/renderer/src/components/terminal-pane/parking/retention/terminal-pending-startup-park-presence.ts 1 src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/TerminalPaneRecoveryPortals.tsx 2 src/renderer/src/components/terminal-pane/session-fork/TerminalAgentSessionForkDialog.tsx @@ -693,21 +693,21 @@ 1 src/renderer/src/hooks/composer-state/workspace-identity-state.ts 3 src/renderer/src/hooks/linear-issue-committed-state.ts 1 src/renderer/src/hooks/use-audio-capture.ts -1 src/renderer/src/hooks/use-bundled-skill-install.ts +1 src/renderer/src/hooks/skills/installation/use-bundled-skill-install.ts 2 src/renderer/src/hooks/useDetectedAgents.ts 2 src/renderer/src/hooks/useGitHubTaskItems.ts 2 src/renderer/src/hooks/useImmediateMutation.ts -6 src/renderer/src/hooks/useInstalledAgentSkills.ts +6 src/renderer/src/hooks/skills/discovery/useInstalledAgentSkills.ts 1 src/renderer/src/hooks/useIssueMetadata.ts 3 src/renderer/src/hooks/useLinearIssuePublication.ts 1 src/renderer/src/hooks/useMacTccAttributionSeveredNotice.ts 1 src/renderer/src/hooks/useSettingsNavigationMetadata.ts -4 src/renderer/src/hooks/useSkillFreshness.ts +4 src/renderer/src/hooks/skills/freshness/useSkillFreshness.ts 1 src/renderer/src/hooks/useTaskPageGitHubWorkItemMutation.ts 6 src/renderer/src/hooks/useVirtualizedScrollAnchor.ts -1 src/renderer/src/lib/host-chat-program-acquisition.ts -1 src/renderer/src/lib/quick-open-file-history.ts -2 src/renderer/src/lib/worker-auto-close.ts +1 src/renderer/src/lib/agent-session/launch/inventory/host-chat-program-acquisition.ts +1 src/renderer/src/lib/files/search/quick-open-file-history.ts +2 src/renderer/src/runtime/agent-orchestration/worker-auto-close.ts 1 src/renderer/src/runtime/native-chat/naming/structured-chat-name-observation.ts 1 src/renderer/src/store/plugins/appearance/plugin-icon-themes.ts 5 src/renderer/src/store/retained-views/app-state-view.ts diff --git a/config/react-compiler-hazard-baseline.txt b/config/react-compiler-hazard-baseline.txt index 27196222a7d..3f359d3ae77 100644 --- a/config/react-compiler-hazard-baseline.txt +++ b/config/react-compiler-hazard-baseline.txt @@ -1,5 +1,5 @@ # Grandfathered code React Compiler would run differently (#:). # Generated; never hand-edit. Lower after a fix: pnpm check:react-compiler-compat-ratchet --prune 1 src/renderer/src/components/agent/agent-launch-picker-drafts.ts#useAgentPickerSetup:discarded-subscription -1 src/renderer/src/components/native-chat-restart-runtimes.ts#useNativeChatRestartRuntimes:discarded-subscription +1 src/renderer/src/components/native-chat-recovery/offers/native-chat-restart-runtimes.ts#useNativeChatRestartRuntimes:discarded-subscription 1 src/renderer/src/components/right-sidebar/source-control/ai/use-source-control-action-agent-choice.ts#useSourceControlActionAgentChoice:store-read-in-memo-block diff --git a/config/recurring-timer-baseline.txt b/config/recurring-timer-baseline.txt index e48d5c80d66..6e17989d975 100644 --- a/config/recurring-timer-baseline.txt +++ b/config/recurring-timer-baseline.txt @@ -85,9 +85,9 @@ 1 src/renderer/src/components/terminal-pane/render-health/terminal-render-desync-sentinel.ts 1 src/renderer/src/hooks/use-now.ts 1 src/renderer/src/lib/agent-session/hibernation/agent-hibernation-coordinator.ts -1 src/renderer/src/lib/crash-diagnostics.ts -1 src/renderer/src/lib/window-visibility-interval.ts -1 src/renderer/src/lib/worker-auto-close.ts +1 src/renderer/src/diagnostics/crash-reporting/crash-diagnostics.ts +1 src/renderer/src/lib/window-activity/window-visibility-interval.ts +1 src/renderer/src/runtime/agent-orchestration/worker-auto-close.ts 1 src/renderer/src/runtime/hosts/wsl/wsl-refused-read-watch.ts 1 src/shared/remote-runtime/control/remote-runtime-shared-control-app-heartbeat.ts 1 src/shared/remote-runtime/remote-runtime-socket-liveness.ts diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 744d4f96f31..90b27e1136b 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -460,10 +460,10 @@ "oracle": "Audit2251 narrows agent-paste-draft.test.ts from 25 authored cases (26 literal cases) to four. Retained cases cover buffered readiness on PTY binding, separate spawn/composer lifetimes, real per-PTY paste/Enter serialization against a competing paste, and frame closure/no Enter after a rejected content chunk. Intentionally lost alarms include agent marker and fallback examples, direct-write failure/rejection, missing-PTY and Codex process-only timeout paths, exact nonprimary-PTY routing, full large-body chunk reconstruction, escaping/CRLF samples, internal laziness/yield work assertions, oversized preflight refusal, and exact configured delay/budget counts. No equivalent replacement, new execution, real PTY/provider delivery, rendered/native UI, deployment, measured performance or cross-platform result is claimed. Historical prior account (preserved verbatim): Mobile owner-layout policy retires whole tests and mixed registrations without equivalent replacement coverage. Retained callbacks and reduced selectors need fresh execution at their stated scope; prior measurements do not validate them. Historical oracle: Audit2003: Remove agent-prompt absence routing, throwing/live/missing-probe and cached-probe-count examples from the stale-leaf source. Controller-proven absence, unknown-liveness admission, obsolete-absence clearing and same-ID respawn fences remain at a supplied provider/row seam. Preserve the independent wire-codec receipt only in its original scope. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove partial-runtime terminal-send guard/status/floor/query projection and argument-inventory samples. Retained RPC viewport admission, authenticated-client spoof refusal, text admission and stale-binding fences remain bounded mock-boundary behavior. The unchanged wire-codec receipt remains valid only for its original command; it does not validate this reduced RPC selector. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1908 removes the complete prompt-presentation hook and literal interactive-protocol mapping suites and narrows the interactive card and prompt-card input suites. Lost alarms include replacement approval A settling after answered B; collapse/expand composer ownership and partial-answer presentation; identical new waits after an unmounted view; collapsed transcript re-reads; answered/dismissed status-backed persistence and retirement; and literal answer-to-PTY byte arrays. The retained stale-PTY acknowledgment, cancellation/answer retry, and answered-approval remount/rebind assertions remain meaningful but are not equivalent replacement coverage. No fresh reduced-selector result, physical provider, rendered/native-focus, mixed-version deployment, soak, or measured-budget validation is claimed. The unchanged wire-codec receipt remains valid only for its exact command. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Retained unchanged-selector receipts are the only current execution evidence. Reduced-source assertions await validation. Historical prior oracle: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): After acknowledged phone replies with stale host status, the exact card disappears and Send is enabled; unknown, refused or unverifiable-settlement replies retain enabled choices, while an older host's accepted reply dismisses like an acknowledged one; a same-occurrence view toggle retains pending acknowledgment and real replacements discard it. A slow 32 KiB SSH answer completes all chunks before Enter; cancellation preserves issued bytes but omits remaining groups. Paired settlement invokes the actual provider and lost callbacks remain unknown; older hosts deliver ordinary messages, launch and selector groups once and their accepted answers dismiss as before. An answered card stays hidden across a view remount; a collapsed card is a strip that frees the composer and expands back; an identical question in a new wait shows again; a composer send caught by a new card keeps its bubble without submitting or clearing the line under it. Audit2450 removes the MobileNativeChatView failure-banner callback-only example whose old banner is supplied unchanged by its props. Retain fatal-read gating and the ordering test that preserves a new delivery notice. The removed false-send/old-banner combination has no equivalent replacement; prior raw receipts and budgets retain their original source scope. No new soak, platform, performance or red/green claim.", "commands": [ "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.prompt-card-composer.test.tsx src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts src/main/runtime/terminal/input/runtime-terminal-writer.test.ts src/main/runtime/rpc/terminal-send.test.ts src/main/runtime/terminal/input/terminal-send-stale-leaf-liveness.test.ts --maxWorkers=2", - "ORCA_BACKGROUND_LAUNCH=1 mobile/node_modules/.bin/vitest run --config mobile/vitest.config.ts mobile/src/session/native-chat/MobileNativeChatView.prompt-presentation.test.ts mobile/src/session/native-chat/MobileNativeChatView.failure-banner.test.ts mobile/src/session/mobile-prompt-controller.test.ts --maxWorkers=2", + "ORCA_BACKGROUND_LAUNCH=1 mobile/node_modules/.bin/vitest run --config mobile/vitest.config.ts mobile/src/session/native-chat/MobileNativeChatView.failure-banner.test.ts mobile/src/session/native-chat/input/mobile-prompt-controller.test.ts --maxWorkers=2", "ORCA_BACKGROUND_LAUNCH=1 pnpm test tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts --maxWorkers=1", "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts --maxWorkers=2", - "ORCA_BACKGROUND_LAUNCH=1 mobile/node_modules/.bin/vitest run --config mobile/vitest.config.ts mobile/src/session/native-chat/MobileNativeChatView.prompt-presentation.test.ts mobile/src/session/native-chat/MobileNativeChatView.failure-banner.test.ts --maxWorkers=2" + "ORCA_BACKGROUND_LAUNCH=1 mobile/node_modules/.bin/vitest run --config mobile/vitest.config.ts mobile/src/session/native-chat/MobileNativeChatView.failure-banner.test.ts --maxWorkers=2" ], "testFiles": [ "src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx", @@ -478,9 +478,9 @@ "src/main/runtime/terminal/input/runtime-terminal-writer.test.ts", "src/main/runtime/rpc/terminal-send.test.ts", "src/main/runtime/terminal/input/terminal-send-stale-leaf-liveness.test.ts", - "mobile/src/session/native-chat/MobileNativeChatView.prompt-presentation.test.ts", + "mobile/src/session/native-chat/MobileNativeChatView.failure-banner.test.ts", - "mobile/src/session/mobile-prompt-controller.test.ts", + "mobile/src/session/native-chat/input/mobile-prompt-controller.test.ts", "tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts" ], "assertionRefs": [ @@ -491,18 +491,12 @@ "sends only one cancellation, can cancel an answer, and permits retry after unknown" ] }, + { - "file": "mobile/src/session/native-chat/MobileNativeChatView.prompt-presentation.test.ts", - "assertions": [ - "a late answer cannot reshow an answered replacement occurrence", - "a late answer cannot dismiss a replacement session" - ] - }, - { - "file": "mobile/src/session/mobile-prompt-controller.test.ts", + "file": "mobile/src/session/native-chat/input/mobile-prompt-controller.test.ts", "assertions": [ "retains permission choices on %s", - "shows a collapsed prompt again as a new wait", + "keeps an acknowledged Deny hidden after the chat screen remounts on a lingering status", "settles the terminal answer for Q1 after Q2 arrives without hiding Q2", "keeps structured answer controls after a thrown send" @@ -1095,7 +1089,7 @@ "id": "settings.terminal-section-lifetime", "title": "Terminal settings search preserves matching section state", "maturity": "experimental", - "protection": "partial", + "protection": "none", "owner": "terminal-runtime", "layer": "renderer-unit", "surfaces": [ @@ -1105,66 +1099,43 @@ ], "platforms": ["macos", "linux", "windows"], "providers": ["local", "daemon", "ssh", "wsl", "remote-runtime"], - "coveredPlatforms": ["macos"], + "coveredPlatforms": [], "coveredProviders": [], - "coverageNotes": "Actual TerminalPane, ManageSessionsSection, health listener and scrollback form with mocked store/provider and display/action boundaries. Unix/Windows and Mac-client/Windows-host flags simulated; no physical provider, process-stop or native input coverage.", + "coverageNotes": "Module-layout wave1 retires the terminal-section lifetime owning suite and its complete dated receipt. The remaining TCC attribution notice suite does not establish the search-lifetime invariant. No current protection, replacement coverage, native/provider execution or fresh evidence is claimed. Historical scope before retirement: Actual TerminalPane, ManageSessionsSection, health listener and scrollback form with mocked store/provider and display/action boundaries. Unix/Windows and Mac-client/Windows-host flags simulated; no physical provider, process-stop or native input coverage.", "motivatingLinks": [ "https://github.com/stablyai/orca/blob/main/src/renderer/src/components/settings/terminal/TerminalPane.tsx" ], "invariant": "A matching settings section retains its state when preceding sections are filtered away; a section removed from search releases its owner and refreshes when shown again. A retained section still refreshes when another surface invalidates the session inventory. Diagnostic inventory never becomes authority for process death.", - "oracle": "Across 15 matched search edits the matched section keeps the same DOM node and the inventory/health read counts do not grow, instead of six reads each. A foreign inventory invalidation still reads once on the retained section and not after unmount. A draft and pending target survive matched search; actual hide/reopen reloads, explicit Refresh still reads, and hidden/unmounted health listeners do not fire.", - "commands": [ - "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.test.tsx" - ], - "testFiles": [ - "src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx", - "src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.test.tsx" - ], - "assertionRefs": [ - { - "file": "src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx", - "assertions": [ - "refreshes a retained section when another surface invalidates the inventory", - "refreshes explicitly, reloads genuinely hidden sections, and removes focus listeners", - "preserves an uncommitted scrollback draft while its section remains visible", - "retains a pending action target only while its section remains visible" - ] - } - ], - "evidenceRuns": [ - { - "date": "2026-09-26", - "runner": "local", - "platform": "macos", - "command": "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/TerminalPane.section-lifetime.test.tsx src/renderer/src/components/settings/TerminalTccAttributionNotice.test.tsx", - "currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.test.tsx", - "result": "passed", - "durationSeconds": 1.48, - "summary": "12 tests/2 suites pass after the shared SettingsSectionStack adoption and the inventory-invalidation subscription. Read-count oracles restated as node identity plus non-growing read counts; original main fails all three simulated platform cases, the draft, the pending target and the foreign-invalidation refresh." - } - ], + "oracle": "Target oracle, currently unprotected after whole-suite retirement: Across 15 matched search edits the matched section keeps the same DOM node and the inventory/health read counts do not grow, instead of six reads each. A foreign inventory invalidation still reads once on the retained section and not after unmount. A draft and pending target survive matched search; actual hide/reopen reloads, explicit Refresh still reads, and hidden/unmounted health listeners do not fire.", + "commands": [], + "testFiles": [], + "assertionRefs": [], + "evidenceRuns": [], "runtimeBudget": { "p95Seconds": 10, "scope": "Focused renderer-unit suites, p95 not established." }, "flakeHistory": { "status": "not-started", - "evidence": "Author and independent local evidence only; no CI soak." + "evidence": "No current search-lifetime suite or soak evidence remains. Historical statement before retirement: Author and independent local evidence only; no CI soak." }, "redGreenEvidence": { - "status": "complete", - "evidence": "Original new suite fails all three simulated platform read-count cases, draft and pending target; one cleanup/refresh control passes. Candidate6pass. Independent scratch5pass/original4fail1control." + "status": "missing", + "evidence": "The owning search-lifetime suite was retired whole. Its historical red/green result does not validate the remaining unrelated TCC attribution notice suite." }, "performanceBudget": { "required": true, - "evidence": "Actual child inventory and health reads 6 to 1 across 15 matched search edits. Fixed small section filter/map now lives in the shared SettingsSectionStack; no new polling, cache or subprocess. One added in-renderer invalidation listener replaces the incidental search-driven refresh, so a retained section stays as fresh as the signal every other inventory reader already uses. No packaged CPU/frame/heap claim." + "evidence": "Historical budget account only; no current selector or fresh performance measurement: Actual child inventory and health reads 6 to 1 across 15 matched search edits. Fixed small section filter/map now lives in the shared SettingsSectionStack; no new polling, cache or subprocess. One added in-renderer invalidation listener replaces the incidental search-driven refresh, so a retained section stays as fresh as the signal every other inventory reader already uses. No packaged CPU/frame/heap claim." }, "knownGaps": [ "CI soak pending.", "No physical local/daemon/SSH/WSL/remote-runtime provider, native Linux/Windows or process-stop behavior exercised; routing, PTY ownership, commands and wire formats unchanged.", "Matched searches keep the loaded snapshot until existing Refresh, completed mutation, a foreign inventory invalidation or genuine hide/reopen; health also refreshes on focus/revision.", "Pending action target and drafts remain while their parent section matches, including individual controls hidden inside a retained section.", - "No packaged app latency, heap, real focus or pending destructive-mutation completion evidence. Hidden Electron component visual proof is separate from the gate." + "No packaged app latency, heap, real focus or pending destructive-mutation completion evidence. Hidden Electron component visual proof is separate from the gate.", + "Module-layout wave1 intentionally retires complete prohibited owning registrations in src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx. Lost alarms: refreshes a retained section when another surface invalidates the inventory; refreshes explicitly, reloads genuinely hidden sections, and removes focus listeners; preserves an uncommitted scrollback draft while its section remains visible; retains a pending action target only while its section remains visible. No equivalent replacement coverage or pass for a reduced selector is claimed. All unrelated selectors and historical receipts retain their original scope.", + "Module-layout wave1 retires this complete historical receipt because its explicit current selector was reduced. It does not validate the reduced suite. Original receipt verbatim:\n{\n \"date\": \"2026-09-26\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/TerminalPane.section-lifetime.test.tsx src/renderer/src/components/settings/TerminalTccAttributionNotice.test.tsx\",\n \"currentCommand\": \"ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.test.tsx\",\n \"result\": \"passed\",\n \"durationSeconds\": 1.48,\n \"summary\": \"12 tests/2 suites pass after the shared SettingsSectionStack adoption and the inventory-invalidation subscription. Read-count oracles restated as node identity plus non-growing read counts; original main fails all three simulated platform cases, the draft, the pending target and the foreign-invalidation refresh.\"\n }", + "Module-layout wave1 historical red/green statement before owning-suite retirement, retained verbatim without current validation credit: {\"status\":\"complete\",\"evidence\":\"Original new suite fails all three simulated platform read-count cases, draft and pending target; one cleanup/refresh control passes. Candidate6pass. Independent scratch5pass/original4fail1control.\"}" ], "promotionCriteria": [ "Retain count, real draft, pending target and cleanup oracles; obtain stable CI history and relevant full-app/provider evidence before promotion." @@ -1649,13 +1620,13 @@ "invariant": "Automatic hibernation must retain two stable confirmations and fresh execution-host evidence before shutdown. Skipping a workspace with no completed agent must not authorize a newly completed pane using stale client PTYs.", "oracle": "Audit2058 intentionally retires the standalone visibility subscription/callback-count alarm without replacement. Audit2310 additionally retires two pane-age getter-map expiry/pruning samples without equivalent replacement. The reduced five-source hibernation selector was freshly run on Linux:52 tests pass. The earlier 54-test receipt is archived verbatim in knownGaps and does not validate the reduced source. Its prior macOS execution receipt/current-command association is archived verbatim in knownGaps and is not current execution evidence for the reduced selector. Current covered platform is Linux; remote replies remain scripted, with no live SSH/WSL/native provider or p95 claim. Historical prior account (preserved verbatim): Working and waiting agents across remote workspaces must not be shut down. A skipped workspace completing while another inventory awaits remains ineligible until two later host-confirmed passes, and so does a workspace that only becomes runtime-owned while an inventory is outstanding — a pass carrying no host evidence for a workspace never counts as one of its two confirmations. Folder and git workspaces hibernate the exact host PTY; rejected/truncated inventories and intervening input/output or state changes block shutdown.", "commands": [ - "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/lib/agent-session/hibernation/agent-hibernation-coordinator.test.ts src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.test.ts src/renderer/src/lib/agent-session/hibernation/agent-hibernation-pane-age.test.ts src/renderer/src/lib/foreground-terminal-tabs.test.ts src/renderer/src/lib/agent-session/hibernation/agent-hibernation-runtime-liveness-race.test.ts --maxWorkers=2" + "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/lib/agent-session/hibernation/agent-hibernation-coordinator.test.ts src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.test.ts src/renderer/src/lib/agent-session/hibernation/agent-hibernation-pane-age.test.ts src/renderer/src/components/terminal-pane/parking/retention/foreground-terminal-tabs.test.ts src/renderer/src/lib/agent-session/hibernation/agent-hibernation-runtime-liveness-race.test.ts --maxWorkers=2" ], "testFiles": [ "src/renderer/src/lib/agent-session/hibernation/agent-hibernation-coordinator.test.ts", "src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.test.ts", "src/renderer/src/lib/agent-session/hibernation/agent-hibernation-pane-age.test.ts", - "src/renderer/src/lib/foreground-terminal-tabs.test.ts", + "src/renderer/src/components/terminal-pane/parking/retention/foreground-terminal-tabs.test.ts", "src/renderer/src/lib/agent-session/hibernation/agent-hibernation-runtime-liveness-race.test.ts" ], "assertionRefs": [ @@ -1682,6 +1653,7 @@ "runner": "local", "platform": "linux", "command": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/lib/agent-session/hibernation/agent-hibernation-coordinator.test.ts src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.test.ts src/renderer/src/lib/agent-session/hibernation/agent-hibernation-pane-age.test.ts src/renderer/src/lib/foreground-terminal-tabs.test.ts src/renderer/src/lib/agent-session/hibernation/agent-hibernation-runtime-liveness-race.test.ts --maxWorkers=2", + "currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/lib/agent-session/hibernation/agent-hibernation-coordinator.test.ts src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.test.ts src/renderer/src/lib/agent-session/hibernation/agent-hibernation-pane-age.test.ts src/renderer/src/components/terminal-pane/parking/retention/foreground-terminal-tabs.test.ts src/renderer/src/lib/agent-session/hibernation/agent-hibernation-runtime-liveness-race.test.ts --maxWorkers=2", "result": "passed", "durationSeconds": 5.426, "summary": "52 tests across the five coordinator/planner/age/foreground/liveness-race files passed on public parent60aee85d9182f602af45cf5f6facae7257670061 plus the audit2310 test-removal candidate (source tree da2595af5391e9fa07a924ac69afede47ad31906). Includes the reduced two-case pane-age suite. Scripted runtime contracts; no live SSH/native WSL, soak or measured p95 claim." @@ -1796,7 +1768,7 @@ "Complete CI soak with zero unexplained flakes and preserve the observable oracle." ], "demotionRule": "Keep experimental until CI soak; investigate failures without relaxing fidelity or resource-count assertions.", - "coverageNotes": "Audit2365 further reduces the supporting renderer agent-status suites. It removes the title-batch publication bound and generated-title sample, ordered acceptance/publication and nested/reentrant scheduling ledgers, Jcode manually assembled session-start sample, freshness-tick epoch example, repeated quit-capture identity and batched-clear examples, and sequential/batch retained-cap examples. Those alarms are no longer present; the following historical account must not be read as current coverage for them. No equivalent replacement or fresh execution evidence is claimed. Audit1400 intentionally deletes or reduces the listed sources. No fresh execution result validates their reduced selectors. Historical coverage account: Actual title-sync subscriber and Zustand publications are covered on macOS. Existing fixtures include SSH/runtime owner invalidation and folder workspaces; no live remote transport was launched. The guard has no platform branches, remote execution, liveness verdict or wire change. The test-value audit retires sequential/batch same-reducer replay, isolated capture-field examples, provider permutations and mock scheduling ledgers from the supporting renderer suites. The title batch publication bound remains, as do checkpoint precedence and real shutdown capture checks. This supplies no replacement evidence for the retired alarms; historical executed commands, counts and results remain historical. The test-value audit also retires isolated freshness-epoch, timestamp/attribution-copy, suppressor/reference and retained below-cap/overwrite examples from agent-status.test.ts. The original title-sync assertion references remain; retained stale-snapshot, cleanup and hard-bound checks are not equivalent replacements for these lost alarms. Historical commands, counts and results remain historical. Audit1400: src/renderer/src/lib/ai-vault-tab-title-sync-inputs.test.ts reduced. Loses one scan/count registration; retains owner invalidation and actual stale-reference release. No equivalent replacement coverage is claimed.", + "coverageNotes": "Audit2365 further reduces the supporting renderer agent-status suites. It removes the title-batch publication bound and generated-title sample, ordered acceptance/publication and nested/reentrant scheduling ledgers, Jcode manually assembled session-start sample, freshness-tick epoch example, repeated quit-capture identity and batched-clear examples, and sequential/batch retained-cap examples. Those alarms are no longer present; the following historical account must not be read as current coverage for them. No equivalent replacement or fresh execution evidence is claimed. Audit1400 intentionally deletes or reduces the listed sources. No fresh execution result validates their reduced selectors. Historical coverage account: Actual title-sync subscriber and Zustand publications are covered on macOS. Existing fixtures include SSH/runtime owner invalidation and folder workspaces; no live remote transport was launched. The guard has no platform branches, remote execution, liveness verdict or wire change. The test-value audit retires sequential/batch same-reducer replay, isolated capture-field examples, provider permutations and mock scheduling ledgers from the supporting renderer suites. The title batch publication bound remains, as do checkpoint precedence and real shutdown capture checks. This supplies no replacement evidence for the retired alarms; historical executed commands, counts and results remain historical. The test-value audit also retires isolated freshness-epoch, timestamp/attribution-copy, suppressor/reference and retained below-cap/overwrite examples from agent-status.test.ts. The original title-sync assertion references remain; retained stale-snapshot, cleanup and hard-bound checks are not equivalent replacements for these lost alarms. Historical commands, counts and results remain historical. Audit1400: src/renderer/src/lib/ai-vault-tab-title-sync-inputs.test.ts reduced. Loses one scan/count registration; retains owner invalidation and actual stale-reference release. No equivalent replacement coverage is claimed. Audit3146 incorporates source3132: seven authored/nine expanded provider-session lifecycle and shutdown examples are deliberately retired without replacement, including completed-session remote/manual-shutdown promotion and quit/done precedence over heartbeat. Captured-record conditional replacement and clockless Codex owner/root turn-fact isolation remain; they do not replace these alarms or establish actual shutdown/resume coverage.", "invariant": "Title-sync publications must not enumerate unchanged session collections, while title identity, provider availability, active pane, stored title and effective execution-host changes retain their previous invalidation decisions.", "oracle": "No current automated execution oracle is claimed for this gate after Audit1400 retired changed-source receipts. Historical oracle account: Fifty live heartbeat publications with 500 retained and 500 sleeping records cause zero unchanged-map enumerations and no extra scheduled reconciliations. Provider identity, additions/removals, agent/pane ownership, effective host, active pane and stored title changes still invalidate.", "commands": [], @@ -2175,30 +2147,23 @@ "providers": ["local", "daemon", "wsl", "ssh", "remote-runtime"], "coveredPlatforms": ["linux"], "coveredProviders": [], - "coverageNotes": "Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The retained directory-level discovery command continues to discover the reduced family; historical wrapper mentions are not fresh import-closure or execution evidence. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2065 (sources2063/2064): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-startup-cwd-fallback-notice.spec.ts: prints a terminal notice when the startup cwd fell back to the workspace root. src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-pi-coalesce.test.ts: surfaces working frames when many spinner frames arrive in one chunk. src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-pi-spinner.test.ts: surfaces normalized working and idle labels across a spinner cycle; surfaces working even when a single chunk contains multiple spinner frames. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionStartupCwdFallbackNoticeTests } from '../startup/pty-connection-startup-cwd-fallback-notice.spec'; registerPtyConnectionStartupCwdFallbackNoticeTests(). Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2061 (sources2059/2060): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-agent-trust-hold.test.ts: spawns only after the answer, carrying \"let agents ask\" to main for this launch; reattaches a section terminal without asking or changing trust; spawns with today's default when the prompt is released without an answer. src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-ssh-hook-status-authority.spec.ts: leaves SSH IPC OSC 9999 status ownership in the main runtime. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-completion-and-notification.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionSshHookStatusAuthorityTests } from '../host-ownership/pty-connection-ssh-hook-status-authority.spec'; registerPtyConnectionSshHookStatusAuthorityTests(). Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-spawn-intent.test.ts: declares the intent only when the spawn resumes an agent; reports a deferral to the pane instead of an error toast. src/renderer/src/components/terminal-pane/pty-connection/startup/in-place-resume-hold.test.ts: owns the record while the start runs, through a nested start, and releases on settle; holds nothing for a start not resuming a record, or once the pane is disposed. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): The existing directory-level pnpm test selector includes eleven changed source files and automatically omits the three whole deletions. Keep this nonempty discovery command unchanged; no dated receipt uses this broad path. Removed agent admission fields, mock transport routing and terminal-id projection alarms are lost. Retained foreground state, actual headless xterm, redraw, abort/rebind reader and bridge claim progression remain scoped to their unchanged callbacks. No current-source execution, independent replacement, native transport or physical provider result is assigned. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally reduces src/renderer/src/components/terminal-pane/pty-connection/main-pane-start-wait.test.ts: Loses joined waiter invocation/failure notification and raw terminal error/paired-host readable sentence alarms; survivors preserve hold detection and card clearing. deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. deletes src/renderer/src/components/terminal-pane/pty-connection-pi-synchronized-input.test.ts: Loses typed-input forced synchronized-frame presentation alarm; setup implements the parser behavior it claims to exercise. deletes src/renderer/src/components/terminal-pane/pty-connection-unserved-ssh-pane.test.ts: Loses automatic SSH dial deduplication, passphrase gating, stale pane exclusion, and disposal cancellation alarms. deletes src/renderer/src/components/terminal-pane/pty-connection-remote-snapshot-source-grid.test.ts: Loses source grid before frame and destination grid restoration ordering alarm. deletes src/renderer/src/components/terminal-pane/pty-connection-restart-replacement.spec.ts: Loses wrapper-level hidden/visible restart resume, dispose/rebind suppression and finished-turn replay alarms; manual pipeline and mock-implemented binding invalidate the whole callbacks. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1391 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1361 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1342 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): macOS daemon-backed Electron journey verifies same PID and terminal identity plus rendered output. Focused renderer contracts pass on Linux, Windows and WSL. Neighboring SSH model and replay contracts pass locally; no new live SSH or paired-runtime journey. Audit1342: src/renderer/src/components/terminal-pane/pty-connection-unanswered-command-finish.spec.ts removed. Unanswered SSH shell finish keeps/drops mocked agent row matrix disappears. src/renderer/src/components/terminal-pane/pty-connection-split-cwd-resolution.test.ts reduced. Happy inherited-cwd wait and transport-option forwarding sample loses its individual alarm. src/renderer/src/components/terminal-pane/pty-connection-command-input-agent-identity.spec.ts removed. Typed Droid versus process/launch identity and SSH/runtime process-evidence matrices disappear. src/renderer/src/components/terminal-pane/pty-connection/reattach-success-settle.test.ts removed. Success/no-ID/expired/superseded attach-settlement bag alarms disappear. src/renderer/src/components/terminal-pane/pty-transport-user-input.test.ts reduced. Every-write kind forwarding and synchronous driving-attempt observer/rejection/ACK call counts disappear. src/renderer/src/components/terminal-pane/pty-connection-codex-restart-input-lookup.spec.ts removed. No global tab enumeration on ordinary/stale input and known restart notice input-block mock-call alarms. src/renderer/src/components/terminal-pane/pty-connection-layout-owner-wake.test.ts removed. Hidden-to-visible single-pane start request, attach-only argument and negative local wake-record alarms are intentionally dropped; no real server wake/ack occurs. src/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. src/renderer/src/components/terminal-pane/pty-connection-command-finished-cleanup.spec.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. src/renderer/src/components/terminal-pane/pty-connection-terminal-input-gating.spec.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Audit1361: src/renderer/src/components/terminal-pane/pty-connection/foreground-output-scan.test.ts reduced. Internal searched-character budget and ordinary/malformed no-op controls. No equivalent replacement coverage is claimed. Audit1365: focused Linux unit selection passed on source head 8880357cb420c45f1b808ae545a5bc609324624d. This new result has its own exact command; historical results keep their prior scope. Intentional test losses remain recorded in knownGaps. No physical-provider, native input, rendered E2E, p95, soak or replacement-coverage claim. Audit1369: src/renderer/src/components/terminal-pane/pty-connection/disposed-spawn-retention.test.ts removed. Rootless/removed/moved tabs, missing leaves, queued deletion and host-qualified/legacy deletion eligibility fixtures. No equivalent replacement coverage is claimed. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. Audit1396: src/renderer/src/components/terminal-pane/pty-connection-pending-spawn.spec.ts reduced. Lose standalone debug-state retention/log silence alarm. React StrictMode is not mounted; bindings manually simulate remount over mocked transport. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1400: src/renderer/src/components/terminal-pane/pty-connection/terminal-input-echo-delay.test.ts reduced. Removes two fabricated-binding pipeline registrations; retains timestamp-policy outcomes without wall-clock speed assertions. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. src/renderer/src/components/terminal-pane/pty-connection/main-pane-resume-banner.test.ts reduced. Loses subscription-budget and attach-start generation predicate alarms; actual restored-banner renderer is not exercised. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result.", + "coverageNotes": "Audit3086: the transport filename selector loses IPC suspension/input/reattach cases and the entire spawn-errors suite. Unique classification, ownership, fallback retirement, reply-limit, write-failure and teardown-branch alarms are intentionally retired without replacement. Remaining registrations are unchanged; no fresh execution or real provider result is claimed. Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The retained directory-level discovery command continues to discover the reduced family; historical wrapper mentions are not fresh import-closure or execution evidence. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2065 (sources2063/2064): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-startup-cwd-fallback-notice.spec.ts: prints a terminal notice when the startup cwd fell back to the workspace root. src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-pi-coalesce.test.ts: surfaces working frames when many spinner frames arrive in one chunk. src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-pi-spinner.test.ts: surfaces normalized working and idle labels across a spinner cycle; surfaces working even when a single chunk contains multiple spinner frames. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionStartupCwdFallbackNoticeTests } from '../startup/pty-connection-startup-cwd-fallback-notice.spec'; registerPtyConnectionStartupCwdFallbackNoticeTests(). Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2061 (sources2059/2060): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-agent-trust-hold.test.ts: spawns only after the answer, carrying \"let agents ask\" to main for this launch; reattaches a section terminal without asking or changing trust; spawns with today's default when the prompt is released without an answer. src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-ssh-hook-status-authority.spec.ts: leaves SSH IPC OSC 9999 status ownership in the main runtime. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-completion-and-notification.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionSshHookStatusAuthorityTests } from '../host-ownership/pty-connection-ssh-hook-status-authority.spec'; registerPtyConnectionSshHookStatusAuthorityTests(). Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-spawn-intent.test.ts: declares the intent only when the spawn resumes an agent; reports a deferral to the pane instead of an error toast. src/renderer/src/components/terminal-pane/pty-connection/startup/in-place-resume-hold.test.ts: owns the record while the start runs, through a nested start, and releases on settle; holds nothing for a start not resuming a record, or once the pane is disposed. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): The existing directory-level pnpm test selector includes eleven changed source files and automatically omits the three whole deletions. Keep this nonempty discovery command unchanged; no dated receipt uses this broad path. Removed agent admission fields, mock transport routing and terminal-id projection alarms are lost. Retained foreground state, actual headless xterm, redraw, abort/rebind reader and bridge claim progression remain scoped to their unchanged callbacks. No current-source execution, independent replacement, native transport or physical provider result is assigned. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally reduces src/renderer/src/components/terminal-pane/pty-connection/main-pane-start-wait.test.ts: Loses joined waiter invocation/failure notification and raw terminal error/paired-host readable sentence alarms; survivors preserve hold detection and card clearing. deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. deletes src/renderer/src/components/terminal-pane/pty-connection-pi-synchronized-input.test.ts: Loses typed-input forced synchronized-frame presentation alarm; setup implements the parser behavior it claims to exercise. deletes src/renderer/src/components/terminal-pane/pty-connection-unserved-ssh-pane.test.ts: Loses automatic SSH dial deduplication, passphrase gating, stale pane exclusion, and disposal cancellation alarms. deletes src/renderer/src/components/terminal-pane/pty-connection-remote-snapshot-source-grid.test.ts: Loses source grid before frame and destination grid restoration ordering alarm. deletes src/renderer/src/components/terminal-pane/pty-connection-restart-replacement.spec.ts: Loses wrapper-level hidden/visible restart resume, dispose/rebind suppression and finished-turn replay alarms; manual pipeline and mock-implemented binding invalidate the whole callbacks. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1391 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1361 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1342 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): macOS daemon-backed Electron journey verifies same PID and terminal identity plus rendered output. Focused renderer contracts pass on Linux, Windows and WSL. Neighboring SSH model and replay contracts pass locally; no new live SSH or paired-runtime journey. Audit1342: src/renderer/src/components/terminal-pane/pty-connection-unanswered-command-finish.spec.ts removed. Unanswered SSH shell finish keeps/drops mocked agent row matrix disappears. src/renderer/src/components/terminal-pane/pty-connection-split-cwd-resolution.test.ts reduced. Happy inherited-cwd wait and transport-option forwarding sample loses its individual alarm. src/renderer/src/components/terminal-pane/pty-connection-command-input-agent-identity.spec.ts removed. Typed Droid versus process/launch identity and SSH/runtime process-evidence matrices disappear. src/renderer/src/components/terminal-pane/pty-connection/reattach-success-settle.test.ts removed. Success/no-ID/expired/superseded attach-settlement bag alarms disappear. src/renderer/src/components/terminal-pane/pty-transport-user-input.test.ts reduced. Every-write kind forwarding and synchronous driving-attempt observer/rejection/ACK call counts disappear. src/renderer/src/components/terminal-pane/pty-connection-codex-restart-input-lookup.spec.ts removed. No global tab enumeration on ordinary/stale input and known restart notice input-block mock-call alarms. src/renderer/src/components/terminal-pane/pty-connection-layout-owner-wake.test.ts removed. Hidden-to-visible single-pane start request, attach-only argument and negative local wake-record alarms are intentionally dropped; no real server wake/ack occurs. src/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. src/renderer/src/components/terminal-pane/pty-connection-command-finished-cleanup.spec.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. src/renderer/src/components/terminal-pane/pty-connection-terminal-input-gating.spec.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Audit1361: src/renderer/src/components/terminal-pane/pty-connection/foreground-output-scan.test.ts reduced. Internal searched-character budget and ordinary/malformed no-op controls. No equivalent replacement coverage is claimed. Audit1365: focused Linux unit selection passed on source head 8880357cb420c45f1b808ae545a5bc609324624d. This new result has its own exact command; historical results keep their prior scope. Intentional test losses remain recorded in knownGaps. No physical-provider, native input, rendered E2E, p95, soak or replacement-coverage claim. Audit1369: src/renderer/src/components/terminal-pane/pty-connection/disposed-spawn-retention.test.ts removed. Rootless/removed/moved tabs, missing leaves, queued deletion and host-qualified/legacy deletion eligibility fixtures. No equivalent replacement coverage is claimed. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. Audit1396: src/renderer/src/components/terminal-pane/pty-connection-pending-spawn.spec.ts reduced. Lose standalone debug-state retention/log silence alarm. React StrictMode is not mounted; bindings manually simulate remount over mocked transport. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1400: src/renderer/src/components/terminal-pane/pty-connection/terminal-input-echo-delay.test.ts reduced. Removes two fabricated-binding pipeline registrations; retains timestamp-policy outcomes without wall-clock speed assertions. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. src/renderer/src/components/terminal-pane/pty-connection/main-pane-resume-banner.test.ts reduced. Loses subscription-budget and attach-start generation predicate alarms; actual restored-banner renderer is not exercised. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result.", "motivatingLinks": [ "https://github.com/user-attachments/assets/e8c6d1dc-6150-4c3d-b55a-3d12efefdd04", "https://github.com/user-attachments/assets/b0328f88-34ac-4d51-8119-9efe17072435" ], "invariant": "Adopting a prestarted terminal preserves its existing process and paints snapshot-covered startup output once while retaining subsequent live output. Missing sequence proof or blank snapshots must not authorize dropping output.", - "oracle": "Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The retained directory-level discovery command continues to discover the reduced family; historical wrapper mentions are not fresh import-closure or execution evidence. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2065 (sources2063/2064): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-startup-cwd-fallback-notice.spec.ts: prints a terminal notice when the startup cwd fell back to the workspace root. src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-pi-coalesce.test.ts: surfaces working frames when many spinner frames arrive in one chunk. src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-pi-spinner.test.ts: surfaces normalized working and idle labels across a spinner cycle; surfaces working even when a single chunk contains multiple spinner frames. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionStartupCwdFallbackNoticeTests } from '../startup/pty-connection-startup-cwd-fallback-notice.spec'; registerPtyConnectionStartupCwdFallbackNoticeTests(). Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2061 (sources2059/2060): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-agent-trust-hold.test.ts: spawns only after the answer, carrying \"let agents ask\" to main for this launch; reattaches a section terminal without asking or changing trust; spawns with today's default when the prompt is released without an answer. src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-ssh-hook-status-authority.spec.ts: leaves SSH IPC OSC 9999 status ownership in the main runtime. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-completion-and-notification.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionSshHookStatusAuthorityTests } from '../host-ownership/pty-connection-ssh-hook-status-authority.spec'; registerPtyConnectionSshHookStatusAuthorityTests(). Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-spawn-intent.test.ts: declares the intent only when the spawn resumes an agent; reports a deferral to the pane instead of an error toast. src/renderer/src/components/terminal-pane/pty-connection/startup/in-place-resume-hold.test.ts: owns the record while the start runs, through a nested start, and releases on settle; holds nothing for a start not resuming a record, or once the pane is disposed. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): The existing directory-level pnpm test selector includes eleven changed source files and automatically omits the three whole deletions. Keep this nonempty discovery command unchanged; no dated receipt uses this broad path. Removed agent admission fields, mock transport routing and terminal-id projection alarms are lost. Retained foreground state, actual headless xterm, redraw, abort/rebind reader and bridge claim progression remain scoped to their unchanged callbacks. No current-source execution, independent replacement, native transport or physical provider result is assigned. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Pass snapshot sequence and proven zero keyboard flags through real IPC transport projection. Deliver snapshot-covered and newer output before reattach resolves; drain replay parse callbacks and require one startup marker and the newer output. Repeat with no sequence and blank snapshot to retain unproven bytes. In Electron select a prestarted workspace, type a generated marker and compare PID and stable terminal identities before and after.", + "oracle": "Audit3086: the transport filename selector loses IPC suspension/input/reattach cases and the entire spawn-errors suite. Unique classification, ownership, fallback retirement, reply-limit, write-failure and teardown-branch alarms are intentionally retired without replacement. Remaining registrations are unchanged; no fresh execution or real provider result is claimed. Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The retained directory-level discovery command continues to discover the reduced family; historical wrapper mentions are not fresh import-closure or execution evidence. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2065 (sources2063/2064): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-startup-cwd-fallback-notice.spec.ts: prints a terminal notice when the startup cwd fell back to the workspace root. src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-pi-coalesce.test.ts: surfaces working frames when many spinner frames arrive in one chunk. src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-pi-spinner.test.ts: surfaces normalized working and idle labels across a spinner cycle; surfaces working even when a single chunk contains multiple spinner frames. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionStartupCwdFallbackNoticeTests } from '../startup/pty-connection-startup-cwd-fallback-notice.spec'; registerPtyConnectionStartupCwdFallbackNoticeTests(). Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2061 (sources2059/2060): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-agent-trust-hold.test.ts: spawns only after the answer, carrying \"let agents ask\" to main for this launch; reattaches a section terminal without asking or changing trust; spawns with today's default when the prompt is released without an answer. src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-ssh-hook-status-authority.spec.ts: leaves SSH IPC OSC 9999 status ownership in the main runtime. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-completion-and-notification.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionSshHookStatusAuthorityTests } from '../host-ownership/pty-connection-ssh-hook-status-authority.spec'; registerPtyConnectionSshHookStatusAuthorityTests(). Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-spawn-intent.test.ts: declares the intent only when the spawn resumes an agent; reports a deferral to the pane instead of an error toast. src/renderer/src/components/terminal-pane/pty-connection/startup/in-place-resume-hold.test.ts: owns the record while the start runs, through a nested start, and releases on settle; holds nothing for a start not resuming a record, or once the pane is disposed. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): The existing directory-level pnpm test selector includes eleven changed source files and automatically omits the three whole deletions. Keep this nonempty discovery command unchanged; no dated receipt uses this broad path. Removed agent admission fields, mock transport routing and terminal-id projection alarms are lost. Retained foreground state, actual headless xterm, redraw, abort/rebind reader and bridge claim progression remain scoped to their unchanged callbacks. No current-source execution, independent replacement, native transport or physical provider result is assigned. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Pass snapshot sequence and proven zero keyboard flags through real IPC transport projection. Deliver snapshot-covered and newer output before reattach resolves; drain replay parse callbacks and require one startup marker and the newer output. Repeat with no sequence and blank snapshot to retain unproven bytes. In Electron select a prestarted workspace, type a generated marker and compare PID and stable terminal identities before and after.", "commands": [ - "pnpm test src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-connect-spawn.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts", - "pnpm test src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-connect-spawn.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts", + "pnpm test src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts", + "pnpm test src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts", "pnpm test src/renderer/src/components/terminal-pane/pty-connection src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport", "pnpm test src/shared/terminal/protocol/escape/terminal-synchronized-output-socket-splits.test.ts" ], "testFiles": [ - "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-connect-spawn.test.ts", "src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts" ], "assertionRefs": [ - { - "file": "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-connect-spawn.test.ts", - "assertions": [ - "zero and nonzero snapshot sequence and proven zero keyboard flags survive IPC projection" - ] - }, { "file": "src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts", "assertions": [ @@ -2242,6 +2207,10 @@ "Exercise live SSH and paired-runtime snapshot adoption before claiming full provider coverage." ], "knownGaps": [ + "Audit3077 retires the IPC zero/nonzero snapshot-sequence and zero-keyboard-proof examples and their direct selectors. The retained join projects only sequence 7 and flags 3. No equivalent replacement or fresh gate execution is claimed.", + "Audit3069 retires nominal spawn/resume/banner wiring, first-fit and lookup-budget variants, private pending-map checks, the split-CWD disposal suite and startup command/draft baseline variants. Distinct regression alarms are intentionally lost without equivalent replacement; retained ownership, cancellation and recovery cases remain. Existing selectors and dated evidence retain their original scope.", + "Audit3061 retires the park-model supplied snapshot suite and nominal mode, cursor, focus, geometry and remote resume metadata variants. Their distinct alarms are intentionally lost; six retained mode/remote cases preserve selected tail-order, authority and parse-readiness boundaries without equivalent replacement. Existing selectors and dated evidence retain their original scope.", + "Audit3053 reduces hidden-replay coverage by retiring nominal overlap, resize, cursor metadata and standalone stalled-restore variants. Timeout, overflow, identity/generation fences and retained live-output coordination remain; the removed alarms are intentionally lost without equivalent replacement. Existing commands, assertion references and dated evidence retain their original scope.", "Audit2694 intentional coverage losses (source-only, no replacement): src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-command-finished-interrupt-arbitration.spec.ts: 'drops the command-finished status when pending interrupt inference is rejected': Loses the standalone rejected-inference-to-drop alarm; the delayed-write rows remain but are not equivalent to this immediate rejection example. src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-bell-query-reply-and-stale-input.spec.ts: 'forwards raw onData after a bell as a query reply': Loses raw onData forwarding after the manually raised bell, including its hibernation-counter expectations. src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-bell-query-reply-and-stale-input.spec.ts: 'blocks onData on a stale codex pane': The real isCodexPaneStale guard executes, and removing it would allow the typed a to reach transport. Intentionally loses this genuine stale-account typing refusal alarm. No retained query-reply test is claimed equivalent. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'omits byte-parser callbacks from the local transport options': Loses local main-authority callback omission and lifecycle callback presence checks. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'keeps byte-parser callbacks on remote-runtime transports': Loses remote-runtime parser callback preservation and factory-argument alarm, including this compatibility boundary; no mixed-version execution is covered. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'consumes pty:sideEffect facts with the live-path policy after spawn': Loses title/bell fact routing and exact 250ms delayed fake notification example. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'schedules the completion notification for genuine working→idle facts': Loses positive main-fact working-to-idle scheduling alarm. Retained stale/race cases do not replace this positive example. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'drops the agent status from a command-finished fact like the byte path did': Loses command-finished fact-to-drop routing and removeAgentStatus noncall alarm. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'routes pr-link facts to the worktree PR observer': Loses PR-link fact forwarding, worktree/tab/PTY arguments alarm; retained raw-byte nonconsumption is not equivalent. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'seeds and settles Command Code status from command-code facts': Real Command Code seed/settle policy runs. Loses positive seed, prompt payload, and 1499+1ms completion boundary alarm; retained newer-working cancellation is not equivalent. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'does not byte-scan Command Code output — facts are the only consumer': Loses Command Code-specific no-byte-parser alarm. Retained PR/OSC raw-byte exclusion does not cover this parser. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-notification-settings-gating.spec.ts: 'shares one raw store subscriber for agent-complete notification settings across panes': Actual shared subscribe/unsubscribe runs. Loses shared single-subscription and final-pane unsubscribe lifetime alarm, with no replacement claimed. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-task-complete-dispatch.spec.ts: 'dispatches agent-task-complete for generic Codex spinner titles after process identity is confirmed': Real coordinator evidence path runs over fake process answers. Loses positive generic-title/confirmed-Codex completion and inspectProcess-argument alarm. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-task-complete-dispatch.spec.ts: 'normalizes Pi-compatible remote titles to authoritative OMP launch identity': Real owner-compatible normalization runs. Loses Pi-to-OMP title/status normalization, active tab label, OSC observation, and retained launch-identity example; no real remote transport or equivalent replacement. Wrapper cleanup removes only the deleted bell factory import and its registration-only describe block; no additional authored removal credit. Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The retained directory-level discovery command continues to discover the reduced family; historical wrapper mentions are not fresh import-closure or execution evidence.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts: structural support changed only; no new authored removal credit. src/renderer/src/components/terminal-pane/pty-connection/spawn/unbound-pane-spawn-recovery.test.ts: requests a tab remount for an unbound spawn; leaves recovery to a remote transport that armed its own retry; requests a remount when the transport reports no recovery of its own; settles the spawn as failed before requesting a remount; prefers the restored leaf id when reporting the anomaly; falls back to the pane leaf id when no restored leaf exists. src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts: repaints from the main-owned snapshot when main drops pending output at the cap. src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-deferred-input-forwarding.spec.ts: routes terminal input through deferPtyInput so the host can withhold it; forwards terminal input directly when the host supplies no deferPtyInput. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts: records a mode 2031 subscribe from the raw chunk boundary without answering. src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts: retries a fresh-spawn native follow reset when renderer dimensions return. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts: forwards onBell to pane attention and notification policy; hands the bell to the attention module with its pane even when pane attention is off. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-foreground-agent.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionDeferredInputForwardingTests } from '../input/pty-connection-deferred-input-forwarding.spec', registerPtyConnectionDeferredInputForwardingTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionFreshNativeFollowResetTests } from '../output/pty-connection-fresh-native-follow-reset.spec', registerPtyConnectionFreshNativeFollowResetTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionTerminalBellAttentionTests } from '../notifications/pty-connection-terminal-bell-attention.spec', registerPtyConnectionTerminalBellAttentionTests(); no additional authored credit. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-deferred-input-forwarding.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/spawn/unbound-pane-spawn-recovery.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-foreground-agent.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts. Unresolved local/computed edges remain explicit debt.", "Audit2065 (sources2063/2064): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-startup-cwd-fallback-notice.spec.ts: prints a terminal notice when the startup cwd fell back to the workspace root. src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-pi-coalesce.test.ts: surfaces working frames when many spinner frames arrive in one chunk. src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-pi-spinner.test.ts: surfaces normalized working and idle labels across a spinner cycle; surfaces working even when a single chunk contains multiple spinner frames. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionStartupCwdFallbackNoticeTests } from '../startup/pty-connection-startup-cwd-fallback-notice.spec'; registerPtyConnectionStartupCwdFallbackNoticeTests(). Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence.", @@ -2263,7 +2232,8 @@ "Audit1417 intentionally reduces src/renderer/src/components/terminal-pane/pty-connection/main-pane-start-wait.test.ts: Loses joined waiter invocation/failure notification and raw terminal error/paired-host readable sentence alarms; survivors preserve hold detection and card clearing. deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. deletes src/renderer/src/components/terminal-pane/pty-connection-pi-synchronized-input.test.ts: Loses typed-input forced synchronized-frame presentation alarm; setup implements the parser behavior it claims to exercise. deletes src/renderer/src/components/terminal-pane/pty-connection-unserved-ssh-pane.test.ts: Loses automatic SSH dial deduplication, passphrase gating, stale pane exclusion, and disposal cancellation alarms. deletes src/renderer/src/components/terminal-pane/pty-connection-remote-snapshot-source-grid.test.ts: Loses source grid before frame and destination grid restoration ordering alarm. deletes src/renderer/src/components/terminal-pane/pty-connection-restart-replacement.spec.ts: Loses wrapper-level hidden/visible restart resume, dispose/rebind suppression and finished-turn replay alarms; manual pipeline and mock-implemented binding invalidate the whole callbacks. No equivalent replacement coverage or fresh result is claimed.", "Audit1939 (sources1934/1935): The existing directory-level pnpm test selector includes eleven changed source files and automatically omits the three whole deletions. Keep this nonempty discovery command unchanged; no dated receipt uses this broad path. Removed agent admission fields, mock transport routing and terminal-id projection alarms are lost. Retained foreground state, actual headless xterm, redraw, abort/rebind reader and bridge claim progression remain scoped to their unchanged callbacks. No current-source execution, independent replacement, native transport or physical provider result is assigned. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Exact retired authored alarms: 'bounds a startup title storm to one extra read ladder and never adopts the title as identity'; 'leaves untrackable providers free of client process scans'; 'keeps a legacy remote process hint unverifiable after a startup title'; 'releases a retained capability when disposed mid-read'; 'releases a retained capability when an exit schedules no successor read'; 'releases a retained capability when an untrackable $exit ends the read'; 'does not release when the cancelled read has a successor'; 'settles the visible confirmation when the pty id is gone before the read runs'; 'reports a read in flight when a command-finished read owns the pane'; 'reads the foreground once after a command starts and publishes the recognized agent'; 'does not replace known foreground identity with typed command inference'; 'revokes stale routing immediately while a known pane confirms a new command'; 'reads the foreground for a visible PTY so restored running Codex panes regain identity'; 'does not retry or publish visible PTY reads for an idle shell foreground'; 'retries visible PTY reads only while a foreground wrapper may resolve to an agent'; 'stops after the ladder and publishes no identity for a persistent unknown process'; 'does not treat a nested shell seen mid-command as prompt proof'; 'recognizes an agent started from a nested shell on a ladder re-read'; 'marks shell foreground on command finished without any foreground read'; 'trusts a rapid ordinary command finish without forcing a fresh scan'; 'still marks shell without a read for a duplicate D pair on an idle pane'; 'marks shell on a rapid command start->finish when the foreground is a shell'; 'marks shell foreground when the confirming read shows the agent is gone'; 'confirms a command finished for a launch-known agent pane before any read'; 'accepts a fresh shell result for a launch-known Droid pane'; 'marks a confirmed shell without repeating a post-boundary scan'; 'never reads or publishes for remote or ssh panes'; 'does not let forged OSC 133/777 output assert remote identity'; 'keeps command-only pane inference bounded for large pasted scripts'; 'skips jcode colors for command-only startup %s'; 'keeps explicit pane ownership ahead of a delayed command hint'; 'does not infer a TUI from %s'; 'survives a launch config registered before its identity lands'; 'prefers the tab launch agent over every later signal'; 'falls back through startup, then initial status, then the registered config'; 'ignores a registered agent name that is not a known TUI agent'; 'skips the OSC color answer for jcode and no one else'; 'drops a Done that landed before the command-finished fact'; 'keeps a program Done reported before the command-finished fact'; 'dismisses the kept result when the next command starts'; 'keeps a facet-less OSC Done from a non-agent program'; 'still drops a real agent Done'; 'still drops an interrupted program Done'; 'retires a hook-identified row the foreground tracker never read'; 'leaves a pane with an armed command-finished drop to its own confirming read'; 'leaves a remote pane to its execution host'; 'keeps the row when the host can verify the owner process itself'; 'keeps a row that belongs to a different agent'; 'does not watch the store for an owner it can never name'; 'control: a fresh host image repaints the pane without resizing the program'; 'asks the program to repaint when the image is %s'; 'asks the program to repaint when the host never answers the snapshot request'; 'repaints a full-screen TUI on the alternate screen the same way'; 'leaves the size alone while a phone or another desktop holds it'; 'grows a pane at the host minimum height instead of asking for the same clamped size'; 'does not nudge while the stream is still reconnecting'; 'mounts and remounts the tab owner while an unrelated workspace is active (%s)'; 'continues a recorded live folder owner despite ambiguous inventory (%s)'; 'resolves an encoded split surface using its parent tab and active leaf'; 'does not capture a remote revision for a local terminal'; 'omits incarnation and length for older runtime responses'; 'refuses %s owner before RPC'; 'refuses a resolved terminal belonging to another native PTY'; 'refuses a foreign remote terminal handle despite a matching native PTY ID'; 'refuses a remote handle owned by another environment'; 'refuses a remote terminal with no live native PTY'; 'does not fall back locally when remote lacks RPC'; 'rejects malformed or oversized encoded response %#'; 'maps a unified terminal tab id to its legacy owner id'; 'keeps non-terminal and unknown ids unchanged'; 'keeps an exact terminal owner ahead of a stale unified alias'; 'stays inert on a host that was not kept for the bridge'; 'stays inert for a pane main does not list, so it still dials the host'.", "Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-spawn-intent.test.ts: declares the intent only when the spawn resumes an agent; reports a deferral to the pane instead of an error toast. src/renderer/src/components/terminal-pane/pty-connection/startup/in-place-resume-hold.test.ts: owns the record while the start runs, through a nested start, and releases on settle; holds nothing for a start not resuming a record, or once the pane is disposed. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed.", - "Audit2061 (sources2059/2060): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-agent-trust-hold.test.ts: spawns only after the answer, carrying \"let agents ask\" to main for this launch; reattaches a section terminal without asking or changing trust; spawns with today's default when the prompt is released without an answer. src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-ssh-hook-status-authority.spec.ts: leaves SSH IPC OSC 9999 status ownership in the main runtime. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-completion-and-notification.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionSshHookStatusAuthorityTests } from '../host-ownership/pty-connection-ssh-hook-status-authority.spec'; registerPtyConnectionSshHookStatusAuthorityTests(). Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed." + "Audit2061 (sources2059/2060): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-agent-trust-hold.test.ts: spawns only after the answer, carrying \"let agents ask\" to main for this launch; reattaches a section terminal without asking or changing trust; spawns with today's default when the prompt is released without an answer. src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-ssh-hook-status-authority.spec.ts: leaves SSH IPC OSC 9999 status ownership in the main runtime. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-completion-and-notification.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionSshHookStatusAuthorityTests } from '../host-ownership/pty-connection-ssh-hook-status-authority.spec'; registerPtyConnectionSshHookStatusAuthorityTests(). Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed.", + "Audit3086: the transport filename selector loses IPC suspension/input/reattach cases and the entire spawn-errors suite. Unique classification, ownership, fallback retirement, reply-limit, write-failure and teardown-branch alarms are intentionally retired without replacement. Remaining registrations are unchanged; no fresh execution or real provider result is claimed." ], "demotionRule": "Keep experimental or demote if adoption duplicates covered output, drops newer or unproven output, changes terminal ownership, or flakes without explanation." }, @@ -4232,10 +4202,10 @@ "providers": ["remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": ["remote-runtime"], - "coverageNotes": "Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Deterministic main-IPC contract tests cover disconnect-driven close delivery, exactly-once close, per-subscription teardown isolation against a failing socket close and a throwing liveness probe, containment of a throwing renderer send on the unguarded host-close path, and continued suppression of stale payloads from a retired transport. A headed paired-server journey (real Orca host plus a separate paired Orca desktop client) covers hidden-but-mounted reveal, cold-parked reveal, and cold-parked reveal across a disconnect/reconnect. Live Linux and Windows paired-server evidence and real sleep/wake transport loss remain uncollected.", + "coverageNotes": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Deterministic main-IPC contract tests cover disconnect-driven close delivery, exactly-once close, per-subscription teardown isolation against a failing socket close and a throwing liveness probe, containment of a throwing renderer send on the unguarded host-close path, and continued suppression of stale payloads from a retired transport. A headed paired-server journey (real Orca host plus a separate paired Orca desktop client) covers hidden-but-mounted reveal, cold-parked reveal, and cold-parked reveal across a disconnect/reconnect. Live Linux and Windows paired-server evidence and real sleep/wake transport loss remain uncollected.", "motivatingLinks": ["tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts"], "invariant": "Every renderer-held runtime subscription receives exactly one terminal close event when its transport is retired, including when the retirement advanced the transport generation first, and a single failing teardown never abandons that environment's remaining subscriptions nor escapes into the transport that reported the close. Payload frames from a retired transport stay suppressed. A revealed remote terminal therefore reattaches over a live multiplex connection: its buffer restores, typed input reaches the host PTY, the echo paints without a tab flip, and the PTY converges on the revealed pane grid.", - "oracle": "Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): The main IPC contract test subscribes terminal.multiplex through the real handler, disconnects the environment, and asserts the renderer received exactly one {type: close} subscription event. Two isolation tests subscribe a second stream to the same environment and make the first one fail -- in its socket close, and in the liveness probe inside notifyClosed -- then assert the disconnect does not throw, both transports closed, and every close the renderer could still receive was delivered. A third drives a host-initiated close through the transport callback, which is the one notifyClosed call site with no surrounding guard, with a renderer send that throws, and asserts it cannot escape into the WebSocket close handler. A fourth test asserts that after retirement a late response frame is not forwarded and a late transport close does not re-send. The paired-server journey runs three reveal scenarios against one real host and one real paired desktop client, and for each records buffer restore, host-side receipt of the typed marker through an out-of-band host sink file, live paint without a tab flip, and PTY-versus-pane grid convergence.", + "oracle": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): The main IPC contract test subscribes terminal.multiplex through the real handler, disconnects the environment, and asserts the renderer received exactly one {type: close} subscription event. Two isolation tests subscribe a second stream to the same environment and make the first one fail -- in its socket close, and in the liveness probe inside notifyClosed -- then assert the disconnect does not throw, both transports closed, and every close the renderer could still receive was delivered. A third drives a host-initiated close through the transport callback, which is the one notifyClosed call site with no surrounding guard, with a renderer send that throws, and asserts it cannot escape into the WebSocket close handler. A fourth test asserts that after retirement a late response frame is not forwarded and a late transport close does not re-send. The paired-server journey runs three reveal scenarios against one real host and one real paired desktop client, and for each records buffer restore, host-side receipt of the typed marker through an out-of-band host sink file, live paint without a tab flip, and PTY-versus-pane grid convergence.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts", "pnpm exec playwright test tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" @@ -4319,7 +4289,24 @@ "Audit2412 removes whole useVirtualizedScrollAnchor.marks-restore-signal.test.ts (six fake-hook geometry/mark/convergence/user-takeover/clamp alarms), use-task-creation-draft-retention original3/4 (immediate discard mock-call count/unopened no-write), use-terminal-bulk-close-actions.placement original6/7 (absent new-agent append and one real history-publication count at consumed3/30 scale), PendingNativeChatCreation original6 (unmounted abort completion/timer cleanup), and wsl-move-dialog-store original1/9/13 (default whole-distro count/reference/reuse and rejected-preview/start refusal recovery). The history counter measures genuine publication work without entries/order/reopen assertions; its unique batching alarm is intentionally retired. Fake React scroll tests ignore dependency scheduling and cleanup; unique simulated arithmetic alarms are deliberately lost. Retained existing-terminal reorder is not new-agent append coverage; mounted handoff timeout is not abort coverage. No equivalent complete replacement or fresh validation is claimed.", "Audit2417 removes commit-actions-real-git original3/4 (ordinary clean cherry-pick and revert content, subject and current-branch samples), and pty-startup-ingress-exited-asker original8/12 (actual foreground-group read budget across100queued queries, and zero foreground reads across100normal chunks plus final emitted/accepted raw cursor equality). Counters measure actual callback work and scale is consumed; these internal-work alarms are deliberately retired. Retained unborn, conflict and sequencer cases are not equivalent ordinary-success coverage. No equivalent complete replacement or fresh validation is claimed.", "Audit2425 removes use-workspace-copy-status original5, which returns a fixture-supplied readError string through statusReadError. No consumer blocker or attempted branch switch established refusal; the unique error-forwarding sample is intentionally retired. Other copy ownership and stale-refresh cases are not equivalent error-path coverage. No equivalent replacement or fresh validation is claimed.", - "Audit2432 removes BranchPicker.test.tsx original3, which only asserted onOpenChange(true/false) with an always-mounted mocked Popover. It never reopened the picker or consumed the callback in the parent status-refresh owner, despite its title. Lose that unique open/close notification alarm. Retained blocker/collision recovery and asynchronous post-unmount outcome cases are not equivalent replacement coverage. No fresh validation of the reduced selector is claimed." + "Audit2432 removes BranchPicker.test.tsx original3, which only asserted onOpenChange(true/false) with an always-mounted mocked Popover. It never reopened the picker or consumed the callback in the parent status-refresh owner, despite its title. Lose that unique open/close notification alarm. Retained blocker/collision recovery and asynchronous post-unmount outcome cases are not equivalent replacement coverage. No fresh validation of the reduced selector is claimed.", + "Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed.", + "Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed.", + "Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed.", + "Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed.", + "Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation.", + "Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed.", + "Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked.", + "Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed.", + "Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms.", + "Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery.", + "Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction.", + "Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed.", + "Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed.", + "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed.", + "Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed.", + "Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed.", + "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired." ], "demotionRule": "Demote if a retired runtime transport can leave a renderer subscription without a close event, if a close is delivered more than once, if one failing teardown strands its sibling subscriptions, if payload frames from a retired transport reach the renderer, or if a revealed remote terminal can stay blank or reject input after a reconnect." }, @@ -4437,7 +4424,7 @@ "providers": ["remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2043: Remove the registration-wait, webview-security, preview-authorization, guest-lifecycle and grant-IPC unit suites and the sibling-directory assertion reference. Runtime and browser capability consumers also lose removed imported examples. Remaining document-policy, file-reader and grant-registry assertions do not replace those alarms. Preserve the 27 independent dated receipts at their original unchanged selectors; reduced prospective unit selectors have no fresh result or equivalent replacement claim. Historical prior account (preserved verbatim): Audit1973: Delete the browser RPC forwarding/schema/scalar suite and its prospective selector. Preserve all27 unrelated dated receipts; no actual browser operation alarm is replaced. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): The complete terminal-file-link-actions suite is removed. Lose supplied local/remote menu-row inventories, browser label/order/download/reveal callback forwarding, platform-copy and source-group pinning examples. No OS reveal/download, real remote preview or browser navigation was exercised; the other real document-preview sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1899 replays sealed Audit1895: workspace-doc-history.test.ts is entirely removed from its current command and testFiles. Supplied recency/dedupe/cap/title/identity examples and the10000-row getter-read budget alarm are intentionally lost. No current assertionRef or active receipt selects that file. Unrelated active receipts and all prior gap literals remain verbatim; no replacement history/index-work coverage or new browser/paired-preview gate execution is claimed. Historical coverage account before Audit1899: Audit1853 reduces LinkActionPopover.test.tsx and archives its complete 2026-09-06 mixed-selector receipt. The lost copy/open-state and Settings callback-order/omission alarms are accepted without equivalent replacement coverage. No fresh execution of this gate is credited. Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: Audit1687 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1630 removes low-value Git, GitHub/GitLab and IPC projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1571 removes mock forwarding, capability/schema inventories, private predicates, supplied error/result replays, and filesystem-mocked persistence checks without equivalent replacement claims. Retained changed tests also exercise real local permission-file reread, registry proxy rollback/credential retirement, site display recovery, and pending sender/credential/document admission with injected Electron/UI producers. Retained network tests exercise owned stream credit/cleanup, generation and retirement fences, real loopback proxy/SOCKS bytes and file-backed binding state. SSH/WSL/paired runtime, native sessions, authority producers and storage clears remain injected; simulated relaunch uses filesystem mocks. The unchanged profile-retirement suite was statically reviewed and not rerun. No actual SSH/WSL runtime, native Chromium jar deletion, durable process restart, remote DNS or external site proof. Receipts selecting changed tests are retired and unaffected receipts remain unchanged. Historical scope before this audit: Audit1568 removes API inventories, supplied mock-value/forwarding assertions, implementation-shape tables and negative/setup cases that do not reach their intended boundary, without equivalent replacement claims. Retained changed definitions exercise owned manager lifetime/queue/refcount/clamp and real synthetic process/files/staging boundaries. Seventeen unchanged native Electron definitions across this combined audit are statically reviewed and not rerun. Changed native suites exercise local popup wire/cookie/session and clean/native process-identity behavior; known popup-admission flaws remain unfixed. Unit native/event/session/registry inputs remain injected. No actual OS focus, registry/host execution, CRX verification or durable restart proof. Receipts selecting changed tests are retired and unaffected receipts remain unchanged. Historical scope before this audit: Audit1564 retires copied cookie key recipes, mock bridge/preview forwarding and flag tables, source-spelling/script inventories and setup-only alarms without equivalent replacement coverage. Retained changed cases exercise actual scoped SQLite merge/rollback/schema refusal, owned cancellation and grant authority/canonical containment, ranged response consistency, replacement guest ownership and executed guest-script promise/DOM cleanup behavior. Session, host response, geometry/observer and transport producers remain injected where documented. One unchanged native extension definition is not rerun locally; no actual remote filesystem, native layout/focus or authentication claim. Receipts selecting modified tests are retired; unaffected exact-selector receipts remain unchanged. Historical scope before this audit: Audit1412 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1386 changes referenced sources; no new execution result validates reduced selectors. Retained unchanged receipts apply only to unchanged commands. Historical coverage: Audit1308 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): A macOS desktop host and a separate paired Electron client exercise the Explorer preview action end to end: the document renders inside the client-local orca-preview guest, the client gains exactly one browser workspace and it is the document one, the host's own page registry and tab snapshot gain nothing, the split does not take focus from the source editor, an explicit click activates the preview, and closing it with its X leaves the editor and terminal intact. Both host oracles are read in a run where an ordinary URL browser tab from the same client does arrive in them, because a host that cannot project browser pages at all would otherwise answer the absence question the same way. A second journey quits that client with a document tab open and relaunches it on the same profile, which is the restore the user's original report turned on: the same workspace row comes back blank and named by the document, renders again, and does so over a grant URL that differs from the one that was quit. The same journey pins the guest URL to the orca-preview scheme, so a regression back to file:// or to a host browser page is visible. The rewritten journey caught a live gap the old one could not see: since previews became browser pages they had no chrome to hand focus to their guest, so main refused every reported link click as coming from an unfocused guest and the one route out of a preview was dead. Main's own log answered it — registered true, grant live, focused false — after the embedder reported the anchor really taking six real presses. The pane now hands focus over when it is the reader's surface, and the journey routes. The preview's own components moved out of the editor folder into browser-pane/workspace-doc/ with this change, since a preview is a browser pane and no longer an editor one; their i18n keys keep the historical auto.components.editor.HtmlDocPreview prefix rather than dropping thirty translated strings across four locales for a tidier key path. Seven gate commands named those files by their old paths and were re-issued at the new ones, and the nine dated runs behind them were retired rather than left naming files that are no longer there, on the same principle this gate already applied twice: vitest treats a missing named file as a filter and exits 0, so such a command reports green while silently running only the half that still exists. Each retired record's finding is carried into the replacement run recorded below it, including the red half of the entry/subresource pair, which was re-measured by re-applying its mutant at the new path rather than being dropped. The fence over the page-management channels was decided channel by channel before it was built, and that decision record is: of the 23 channels that can name a page, 6 are allowed for a workspace-document page — the tool channels the reader drives, which reach it through the one authority that reads both halves of the registry — 9 refuse (download accept and cancel, devtools, certificate proceed, client page metadata publish, viewport override, WebAuthn account response, registration probe, registration repair), 3 cannot name a page at all because they take a profile or a worktree instead, and the rest are the registration and activation doors, refused on membership. What shipped is not the per-channel guard that classification implies: eleven call sites read the browsing map directly, so a guard per channel is exactly the caller-flag seam that has to be remembered at every future call site. The registry was split in two instead, which makes the classification structural — a document guest is absent from the browsing map, so every refusing channel refuses by absence rather than by a guard, and a channel added later inherits the refusal without being classified at all. Unit contracts cover grant scoping and path containment, per-owner read routing, refusal of a truncated or over-cap read, the old-server binary degradation, scheme admission on will-attach-webview, the guest navigation policy, the plan layer's local/SSH/paired/out-of-worktree routing, and the distinct sentence the reader sees for each failure reason. The paired browser-creation surfaces this gate still owns — capability rejection cleanup, canonical page identity, reconciliation rollback, close convergence — keep their existing headed and headless journeys. Linux and Windows live journeys remain gaps. A refused subresource is a notice on a rendered document rather than a failure panel, since only the entry document's failure leaves the reader with nothing; the entry document is served as text by every owner and cannot be refused for its format at all. Grants die with the renderer document that minted them, at window creation and on every reload, because the renderer holds the only record of which preview owns which grant. The mint and revoke channels answer only the trusted renderer, and a preview tab is never republished to mobile clients, which have no grant to read it with. External URLs leave the preview only via a trusted user click on an anchor while the preview is focused; script-driven navigation and popups reach nothing. The guest's navigation sinks are deny-only and route no URL at all, and the guest carries a preview-only preload, pinned by will-attach-webview and denied to every other attach path, whose capture-phase click handler reports an anchor's URL to main; main answers only a report from a preview guest with a live bound grant that is the focused contents, and only for http(s). Two earlier reader-facing records from 2026-08-26, which measured a shape where a subresource failure was filtered out and the panel still carried an unsupported-asset sentence, were retired with that shape rather than left contradicting the 10/10 runs of the command they share. Two more were retired on the same principle when the external-link design changed: a record showing that removing a recent-input gate let the unattended document open two browser tabs, and a record showing that dropping the webview's allowpopups attribute left a target=_blank press with nothing to route. Both measured machinery that no longer exists — the input gate could not tell a script's navigation from the click it followed, which is the case now recorded below, and the preload intercepts the press before Chromium considers a popup at all, so allowpopups was removed. WebRTC is fenced by the guest's IP-handling policy alone: this Chromium answers a webrtc content-security-policy directive as unrecognized and gathers candidates anyway, so the directive is deliberately absent from the served policy and a unit assertion keeps it out. A standalone Electron probe on the same version gathered 7 candidates including a STUN reflexive one without the policy and 0 with it. Two command paths this gate used to carry no longer exist, and their structured evidence was retired with them rather than left naming files that are no longer there: vitest treats a missing named file as a filter and exits 0, so such a command reports green while silently running only the half that still exists. The first is src/renderer/src/lib/file-preview-capability-cleanup.test.ts, deleted in STA-5557 when HTML previews stopped creating paired browser tabs: on 2026-08-12 its five-assertion STA-4063 oracle ran red 5/5 on scan e4c278eb52 and on main bc2e30000b, partially green 2/5 on pre-fix PR #14100, and green 5/5 on candidate 14b5877a75; the surviving half of that oracle is web-runtime-browser-capability-cleanup.test.ts, still commanded above. The second is tests/e2e/paired-remote-html-browser-focus.spec.ts, renamed in STA-5557 to paired-remote-html-preview-local-render.spec.ts because the journey no longer proves anything about browser focus: its 2026-08-12 runs established the owning-runtime routing and no-focus-steal behavior of the then-current browser-tab preview (red on main 346e59c879 and a90a18d43d, green on candidates d05217c40d and b7de9c0961, red again with only the side-preview focus or routing seam disabled), and its 2026-08-26 runs are recorded below under the current path. An adversarial pass after the journey landed found four coverage gaps rather than shipping defects, and all four are pinned here. The page url had a third door: the navigation commit wrote whatever url was reported, unfenced, and while nothing reaches it for a document page today it sat one report away from giving a document page a URL that persistence, the publish boundary and the address bar all read. The group projection was the load-bearing half of the mobile publish boundary that no test had: removing it alone left the whole suite green, because no test in it had tab groups, while the phone payload gained a group whose order and active tab named a document tab it was never sent. The focus handoff was covered only in the narrowing direction, so widening it — dropping the page-activity check, or either half of the reader-surface check — survived both suites. And the handoff itself was offered once and never again, so another app taking the front left the preview's one route out shut until the pane remounted, which is a desktop gap rather than a test-only one. The standalone capability-cleanup and browser-placement ledger suites were removed, including their mixed-version rejection, cleanup transfer, capacity and partition alarms. web-runtime-session.test.ts no longer supplies browser creation, rollback or recovery assertions. The grouped workspace-document exclusion remains; the separate no-group publication example was removed. Existing live/browser-store evidence does not establish equivalent replacement alarms. Earlier descriptions of the removed fixtures and their run results are historical. The client-owned-placement and layout-groups suites are removed. The broad mirror fixture no longer supplies preview placement/reservation/move assertions. Browser rows retain pre-response replay and real local-workspace reuse; focus intent retains response ordering and exact-leaf sibling ordering. Supplied browser-layout and placement/focus projection alarms are lost; retained evidence is narrower and not equivalent. The test-value audit retires renderer grant-release mock ledgers, direct creation/title/session-field copies, notification/onboarding calls and several placement/per-page projections. Canonical-ID rejection, document reopen/restore and preview URL fences remain; they do not prove close-to-registry revocation or replace every lost alarm. Historical execution evidence is unchanged. The test-value audit removed the direct legacy editor-preview hydration example from tabs-hydration.test.ts. Dropping legacy preview chrome while preserving the same-document ordinary editor no longer has that alarm. The surviving corrupt-id deduplication case does not cover that migration, and retained preview journeys are not equivalent replacement coverage. Historical run counts and migration mutation findings describe the earlier suite. Audit1308: src/renderer/src/components/editor/EditorPanelShell.header.test.tsx removed. Header visibility and mocked editor-surface inventory alarms disappear. No equivalent replacement coverage is claimed. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1386: src/renderer/src/lib/doc-preview-grants.test.ts reduced. Repeated-mount mint count, ordinary release/remint and failed-mint cache retry standalone alarms removed; no actual grant server/access test. No equivalent replacement coverage is claimed. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/browser/guest-lifecycle/manager/browser-manager-guest-policy-profile.test.ts removed. Loses workspace-document in-grant navigation/popup refusal, cleanup/re-attach, cross-registry guest authorization and browsing-map separation alarms. No equivalent browser policy coverage is claimed. No equivalent replacement coverage is claimed. Audit1421 removes browser-address-bar-suggestions.test.ts. Document suggestion title/path matching, recency merging and path-prefix ranking alarms are lost. No equivalent replacement coverage is claimed. Historical receipts remain scoped to unchanged selectors; the reduced command has no new execution result. Audit2452 removes the whole fake-effect browser-close routing suite. Active selectors and assertion references no longer select it. Its requested-worktree default close, sibling-page close and explicit missing-page typed reply alarms are intentionally retired without equivalent replacement. Prior dated receipts remain unchanged and scoped to their original sources; no fresh execution of the reduced gate, rendered browser, live remote, mobile or cross-platform validation is claimed.", + "coverageNotes": "Audit3108: doc-preview-grants.test.ts now retains only the stale grant-rejection race: a late rejected grant request must not evict a newer grant registry entry, witnessed by later revocation of grant-2. Retire stable minted-location and outside-workspace POSIX/Windows request-projection alarms without replacement. The direct nonempty grant selector remains unchanged; no real grant-server/file authorization, SSH/HTML delivery or native-focus result is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2043: Remove the registration-wait, webview-security, preview-authorization, guest-lifecycle and grant-IPC unit suites and the sibling-directory assertion reference. Runtime and browser capability consumers also lose removed imported examples. Remaining document-policy, file-reader and grant-registry assertions do not replace those alarms. Preserve the 27 independent dated receipts at their original unchanged selectors; reduced prospective unit selectors have no fresh result or equivalent replacement claim. Historical prior account (preserved verbatim): Audit1973: Delete the browser RPC forwarding/schema/scalar suite and its prospective selector. Preserve all27 unrelated dated receipts; no actual browser operation alarm is replaced. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): The complete terminal-file-link-actions suite is removed. Lose supplied local/remote menu-row inventories, browser label/order/download/reveal callback forwarding, platform-copy and source-group pinning examples. No OS reveal/download, real remote preview or browser navigation was exercised; the other real document-preview sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1899 replays sealed Audit1895: workspace-doc-history.test.ts is entirely removed from its current command and testFiles. Supplied recency/dedupe/cap/title/identity examples and the10000-row getter-read budget alarm are intentionally lost. No current assertionRef or active receipt selects that file. Unrelated active receipts and all prior gap literals remain verbatim; no replacement history/index-work coverage or new browser/paired-preview gate execution is claimed. Historical coverage account before Audit1899: Audit1853 reduces LinkActionPopover.test.tsx and archives its complete 2026-09-06 mixed-selector receipt. The lost copy/open-state and Settings callback-order/omission alarms are accepted without equivalent replacement coverage. No fresh execution of this gate is credited. Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: Audit1687 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1630 removes low-value Git, GitHub/GitLab and IPC projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1571 removes mock forwarding, capability/schema inventories, private predicates, supplied error/result replays, and filesystem-mocked persistence checks without equivalent replacement claims. Retained changed tests also exercise real local permission-file reread, registry proxy rollback/credential retirement, site display recovery, and pending sender/credential/document admission with injected Electron/UI producers. Retained network tests exercise owned stream credit/cleanup, generation and retirement fences, real loopback proxy/SOCKS bytes and file-backed binding state. SSH/WSL/paired runtime, native sessions, authority producers and storage clears remain injected; simulated relaunch uses filesystem mocks. The unchanged profile-retirement suite was statically reviewed and not rerun. No actual SSH/WSL runtime, native Chromium jar deletion, durable process restart, remote DNS or external site proof. Receipts selecting changed tests are retired and unaffected receipts remain unchanged. Historical scope before this audit: Audit1568 removes API inventories, supplied mock-value/forwarding assertions, implementation-shape tables and negative/setup cases that do not reach their intended boundary, without equivalent replacement claims. Retained changed definitions exercise owned manager lifetime/queue/refcount/clamp and real synthetic process/files/staging boundaries. Seventeen unchanged native Electron definitions across this combined audit are statically reviewed and not rerun. Changed native suites exercise local popup wire/cookie/session and clean/native process-identity behavior; known popup-admission flaws remain unfixed. Unit native/event/session/registry inputs remain injected. No actual OS focus, registry/host execution, CRX verification or durable restart proof. Receipts selecting changed tests are retired and unaffected receipts remain unchanged. Historical scope before this audit: Audit1564 retires copied cookie key recipes, mock bridge/preview forwarding and flag tables, source-spelling/script inventories and setup-only alarms without equivalent replacement coverage. Retained changed cases exercise actual scoped SQLite merge/rollback/schema refusal, owned cancellation and grant authority/canonical containment, ranged response consistency, replacement guest ownership and executed guest-script promise/DOM cleanup behavior. Session, host response, geometry/observer and transport producers remain injected where documented. One unchanged native extension definition is not rerun locally; no actual remote filesystem, native layout/focus or authentication claim. Receipts selecting modified tests are retired; unaffected exact-selector receipts remain unchanged. Historical scope before this audit: Audit1412 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1386 changes referenced sources; no new execution result validates reduced selectors. Retained unchanged receipts apply only to unchanged commands. Historical coverage: Audit1308 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): A macOS desktop host and a separate paired Electron client exercise the Explorer preview action end to end: the document renders inside the client-local orca-preview guest, the client gains exactly one browser workspace and it is the document one, the host's own page registry and tab snapshot gain nothing, the split does not take focus from the source editor, an explicit click activates the preview, and closing it with its X leaves the editor and terminal intact. Both host oracles are read in a run where an ordinary URL browser tab from the same client does arrive in them, because a host that cannot project browser pages at all would otherwise answer the absence question the same way. A second journey quits that client with a document tab open and relaunches it on the same profile, which is the restore the user's original report turned on: the same workspace row comes back blank and named by the document, renders again, and does so over a grant URL that differs from the one that was quit. The same journey pins the guest URL to the orca-preview scheme, so a regression back to file:// or to a host browser page is visible. The rewritten journey caught a live gap the old one could not see: since previews became browser pages they had no chrome to hand focus to their guest, so main refused every reported link click as coming from an unfocused guest and the one route out of a preview was dead. Main's own log answered it — registered true, grant live, focused false — after the embedder reported the anchor really taking six real presses. The pane now hands focus over when it is the reader's surface, and the journey routes. The preview's own components moved out of the editor folder into browser-pane/workspace-doc/ with this change, since a preview is a browser pane and no longer an editor one; their i18n keys keep the historical auto.components.editor.HtmlDocPreview prefix rather than dropping thirty translated strings across four locales for a tidier key path. Seven gate commands named those files by their old paths and were re-issued at the new ones, and the nine dated runs behind them were retired rather than left naming files that are no longer there, on the same principle this gate already applied twice: vitest treats a missing named file as a filter and exits 0, so such a command reports green while silently running only the half that still exists. Each retired record's finding is carried into the replacement run recorded below it, including the red half of the entry/subresource pair, which was re-measured by re-applying its mutant at the new path rather than being dropped. The fence over the page-management channels was decided channel by channel before it was built, and that decision record is: of the 23 channels that can name a page, 6 are allowed for a workspace-document page — the tool channels the reader drives, which reach it through the one authority that reads both halves of the registry — 9 refuse (download accept and cancel, devtools, certificate proceed, client page metadata publish, viewport override, WebAuthn account response, registration probe, registration repair), 3 cannot name a page at all because they take a profile or a worktree instead, and the rest are the registration and activation doors, refused on membership. What shipped is not the per-channel guard that classification implies: eleven call sites read the browsing map directly, so a guard per channel is exactly the caller-flag seam that has to be remembered at every future call site. The registry was split in two instead, which makes the classification structural — a document guest is absent from the browsing map, so every refusing channel refuses by absence rather than by a guard, and a channel added later inherits the refusal without being classified at all. Unit contracts cover grant scoping and path containment, per-owner read routing, refusal of a truncated or over-cap read, the old-server binary degradation, scheme admission on will-attach-webview, the guest navigation policy, the plan layer's local/SSH/paired/out-of-worktree routing, and the distinct sentence the reader sees for each failure reason. The paired browser-creation surfaces this gate still owns — capability rejection cleanup, canonical page identity, reconciliation rollback, close convergence — keep their existing headed and headless journeys. Linux and Windows live journeys remain gaps. A refused subresource is a notice on a rendered document rather than a failure panel, since only the entry document's failure leaves the reader with nothing; the entry document is served as text by every owner and cannot be refused for its format at all. Grants die with the renderer document that minted them, at window creation and on every reload, because the renderer holds the only record of which preview owns which grant. The mint and revoke channels answer only the trusted renderer, and a preview tab is never republished to mobile clients, which have no grant to read it with. External URLs leave the preview only via a trusted user click on an anchor while the preview is focused; script-driven navigation and popups reach nothing. The guest's navigation sinks are deny-only and route no URL at all, and the guest carries a preview-only preload, pinned by will-attach-webview and denied to every other attach path, whose capture-phase click handler reports an anchor's URL to main; main answers only a report from a preview guest with a live bound grant that is the focused contents, and only for http(s). Two earlier reader-facing records from 2026-08-26, which measured a shape where a subresource failure was filtered out and the panel still carried an unsupported-asset sentence, were retired with that shape rather than left contradicting the 10/10 runs of the command they share. Two more were retired on the same principle when the external-link design changed: a record showing that removing a recent-input gate let the unattended document open two browser tabs, and a record showing that dropping the webview's allowpopups attribute left a target=_blank press with nothing to route. Both measured machinery that no longer exists — the input gate could not tell a script's navigation from the click it followed, which is the case now recorded below, and the preload intercepts the press before Chromium considers a popup at all, so allowpopups was removed. WebRTC is fenced by the guest's IP-handling policy alone: this Chromium answers a webrtc content-security-policy directive as unrecognized and gathers candidates anyway, so the directive is deliberately absent from the served policy and a unit assertion keeps it out. A standalone Electron probe on the same version gathered 7 candidates including a STUN reflexive one without the policy and 0 with it. Two command paths this gate used to carry no longer exist, and their structured evidence was retired with them rather than left naming files that are no longer there: vitest treats a missing named file as a filter and exits 0, so such a command reports green while silently running only the half that still exists. The first is src/renderer/src/lib/file-preview-capability-cleanup.test.ts, deleted in STA-5557 when HTML previews stopped creating paired browser tabs: on 2026-08-12 its five-assertion STA-4063 oracle ran red 5/5 on scan e4c278eb52 and on main bc2e30000b, partially green 2/5 on pre-fix PR #14100, and green 5/5 on candidate 14b5877a75; the surviving half of that oracle is web-runtime-browser-capability-cleanup.test.ts, still commanded above. The second is tests/e2e/paired-remote-html-browser-focus.spec.ts, renamed in STA-5557 to paired-remote-html-preview-local-render.spec.ts because the journey no longer proves anything about browser focus: its 2026-08-12 runs established the owning-runtime routing and no-focus-steal behavior of the then-current browser-tab preview (red on main 346e59c879 and a90a18d43d, green on candidates d05217c40d and b7de9c0961, red again with only the side-preview focus or routing seam disabled), and its 2026-08-26 runs are recorded below under the current path. An adversarial pass after the journey landed found four coverage gaps rather than shipping defects, and all four are pinned here. The page url had a third door: the navigation commit wrote whatever url was reported, unfenced, and while nothing reaches it for a document page today it sat one report away from giving a document page a URL that persistence, the publish boundary and the address bar all read. The group projection was the load-bearing half of the mobile publish boundary that no test had: removing it alone left the whole suite green, because no test in it had tab groups, while the phone payload gained a group whose order and active tab named a document tab it was never sent. The focus handoff was covered only in the narrowing direction, so widening it — dropping the page-activity check, or either half of the reader-surface check — survived both suites. And the handoff itself was offered once and never again, so another app taking the front left the preview's one route out shut until the pane remounted, which is a desktop gap rather than a test-only one. The standalone capability-cleanup and browser-placement ledger suites were removed, including their mixed-version rejection, cleanup transfer, capacity and partition alarms. web-runtime-session.test.ts no longer supplies browser creation, rollback or recovery assertions. The grouped workspace-document exclusion remains; the separate no-group publication example was removed. Existing live/browser-store evidence does not establish equivalent replacement alarms. Earlier descriptions of the removed fixtures and their run results are historical. The client-owned-placement and layout-groups suites are removed. The broad mirror fixture no longer supplies preview placement/reservation/move assertions. Browser rows retain pre-response replay and real local-workspace reuse; focus intent retains response ordering and exact-leaf sibling ordering. Supplied browser-layout and placement/focus projection alarms are lost; retained evidence is narrower and not equivalent. The test-value audit retires renderer grant-release mock ledgers, direct creation/title/session-field copies, notification/onboarding calls and several placement/per-page projections. Canonical-ID rejection, document reopen/restore and preview URL fences remain; they do not prove close-to-registry revocation or replace every lost alarm. Historical execution evidence is unchanged. The test-value audit removed the direct legacy editor-preview hydration example from tabs-hydration.test.ts. Dropping legacy preview chrome while preserving the same-document ordinary editor no longer has that alarm. The surviving corrupt-id deduplication case does not cover that migration, and retained preview journeys are not equivalent replacement coverage. Historical run counts and migration mutation findings describe the earlier suite. Audit1308: src/renderer/src/components/editor/EditorPanelShell.header.test.tsx removed. Header visibility and mocked editor-surface inventory alarms disappear. No equivalent replacement coverage is claimed. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1386: src/renderer/src/lib/doc-preview-grants.test.ts reduced. Repeated-mount mint count, ordinary release/remint and failed-mint cache retry standalone alarms removed; no actual grant server/access test. No equivalent replacement coverage is claimed. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/browser/guest-lifecycle/manager/browser-manager-guest-policy-profile.test.ts removed. Loses workspace-document in-grant navigation/popup refusal, cleanup/re-attach, cross-registry guest authorization and browsing-map separation alarms. No equivalent browser policy coverage is claimed. No equivalent replacement coverage is claimed. Audit1421 removes browser-address-bar-suggestions.test.ts. Document suggestion title/path matching, recency merging and path-prefix ranking alarms are lost. No equivalent replacement coverage is claimed. Historical receipts remain scoped to unchanged selectors; the reduced command has no new execution result. Audit2452 removes the whole fake-effect browser-close routing suite. Active selectors and assertion references no longer select it. Its requested-worktree default close, sibling-page close and explicit missing-page typed reply alarms are intentionally retired without equivalent replacement. Prior dated receipts remain unchanged and scoped to their original sources; no fresh execution of the reduced gate, rendered browser, live remote, mobile or cross-platform validation is claimed.", "motivatingLinks": [ "https://linear.app/stably/issue/STA-5557/remote-html-preview-render-workspace-files-locally-over-the-file", "https://linear.app/stably/issue/STA-3872/unable-to-open-html-files-in-remote-server", @@ -4448,7 +4435,7 @@ "https://github.com/stablyai/orca/pull/13876" ], "invariant": "Opening one HTML preview from a paired client renders the workspace document in exactly one client-local browser tab, located by that document and served over the orca-preview scheme. The client gains exactly that one browser workspace and it is the document one — blank where a URL page carries a URL, named by the document, with the chip naming the file — while the host gains no browser page at all, neither in its own page registry nor in the tab snapshot its clients publish into. The preview occupies its own split without taking focus from the source editor; an explicit click activates it, and closing it removes only the preview. Following a document from a file link is the other half of that switch and does move the reader to it, tab group included, whether the preview is new or already open, because opening a file is a request to look at it. A document tab quit with the client comes back as the same row on a grant the relaunched client mints afresh. A preview is named by the browser page it is open in, not by a namespace of its own, and the page registry has two halves: a workspace-document guest is registered in its own map and is absent from the browsing one entirely. That absence is the fence. Page, session and profile management, agent tab enumeration and command targeting, download routing and certificate attribution all read the browsing map directly, in more places than a per-channel guard could be remembered in, so none of them can name a document page and none of them carries a guard. Browser tools the reader drives (element grab, hover describe, selection capture, the annotation viewport bridge) are the one operation that legitimately spans the halves, and they go through the single authority that reads both, keyed by the page and its hosting renderer. The halves are disjoint in both directions: browsing registration refuses a page the document half already holds, and minting a grant refuses a page the browsing half already holds, so one id can never name a surface in both. The headless backend acts on that refusal by destroying the window it had already opened rather than leaving a policy-less page behind an id nothing can drive, keeping nothing under that id for its own shutdown to hand back. Registration refuses on the same terms when the guest it was asked about is already gone. The exit door is guarded in both its halves: a preview withdraws by revoking its grant and never through the unregister channel, so a page the document half holds arriving there is refused before either the registration teardown or the grab-state disposal beside it, which would otherwise drop the intent an in-flight preview grab compares by identity and leave that grab answering ok without ever arming its guest. A bridge request whose guest does not resolve is refused without tearing down the page it named, so a misaddressed request cannot cancel a healthy page's in-flight downloads and grabs. The annotation viewport bridge resolves its guest when its serialized op actually runs rather than when the request arrived, so a cross-process navigation while it waited cannot leave the bridge installed in a retired guest while the reader looks at a new one. State main keys by a preview's page is disposed when that page's grant is revoked, which is the only signal a preview's surface is gone. A tool asking for a page whose guest has not attached yet waits for that registration and arms when it arrives, rather than answering not-ready at the reader; that wait resolves only the request already naming this page, never the worktree-wide or any-tab waits the CLI and agents use to ask for a browser tab to drive. Handing the previewed document to the reader's own machine routes on the owners its grant was minted against — the file's own connection owner and the worktree's own runtime owner, neither read from the tab's stored fields. Only a document proven to live on this machine reaches the client OS; one with a resolved remote owner is downloaded first; and one whose owner cannot be resolved at all, workspace root included, is refused with a message naming that, because the download route would otherwise read the same absolute path on the client and hand back a same-named local file under the remote document's name. A runtime-owned path that falls outside its worktree root is refused by that route itself and surfaces as a failure toast rather than a download. Nothing the document does writes a file to this machine either: the preview partition denies downloads outright instead of routing them through the browser download flow, which has no page to attribute a preview's bytes to and would otherwise reserve a name in this desktop's Downloads folder and write them there unprompted. That refusal is visible to the reader and invisible to the document: the preview's shell carries a fixed sentence saying downloads are off, published at most once per preview per interval so a document asking in a loop cannot fill Orca's chrome, while the page itself gets back exactly what it got before, which is nothing. The sentence names no file, because the document chooses the name it offers; and a refusal never takes the document away the way an entry document's own failure does, whatever it names. A preview is a browser tab, not an editor tab in a preview mode: it is named the way a browser tab is named — by the document it shows when that document declares a title, and by the file it shows when it does not — while the chip goes on naming the file and the host whatever the document calls itself. A title is refused on the same terms the url is: a document that declares none has Chromium report the grant URL as its title, and that title is stored, mirrored onto the tab and written to disk, so anything carrying the scheme falls back to the file instead. It is created by the preview action as a page located by its document, it carries the workspace-relative path copy the editor's path header owned, and closing it revokes the grant that made the document readable while a URL tab closing beside it revokes nothing. Chrome persisted by builds that made previews editor tabs is dropped on restore rather than coming back naming a surface no restore can produce, and the ordinary editor tab for the same document is left alone. A document tab is held back at the mobile publish boundary — no client holds its grant, and the wire has no tab kind for it — while an ordinary browser tab beside it still publishes. It is held back from the group projection that publishes tab order, recency and group activity as well as from the tab list itself, so no published group names a tab the phone is never sent. A browser page can be located by a workspace document instead of a URL, and the document is the whole of its stored identity. The grant and the orca-preview URL that document is served over are minted when the page mounts and replaced by a hard reload, so neither is ever written to the page's url, mirrored onto its tab, persisted or published: such a page's url is the blank URL from creation through restore, including when a session written elsewhere carries a grant URL in, and what the session carries is the worktree and path a restored page mints afresh against today's owners. Every door onto a page's url holds that line — creation, the title update, and the navigation commit alike — so a report about a document page cannot give it a URL it never had, and the title fallback and the loading affordance follow the url each door actually wrote. The mirror carries the document too, so a tab entry cannot go on naming a document its active page has left. Every guest in the app is policy-attached through one door: a workspace document takes a restricted profile there rather than a separate installer beside it, so the attachment bookkeeping that door owns — what registration refuses, and what teardown frees — covers a preview on the same terms as a browsing page, and a preview takes none of the browsing machinery that door installs. That authority answers from the moment the embedder hands the guest over rather than only after a later navigation: the guest binds to the grant it is already showing, so the tools reach the document the reader opened and not just one they navigated to. A read the host reports as truncated or over-cap is refused rather than served partially, and a document outside the paired worktree is refused with a message naming that boundary instead of a bare read failure. The rendered document reaches nothing off-machine on its own: every served response carries a self-only content security policy, the preview session cancels any request that is not in-document, subframes cannot navigate outside the grant, a guest no document has yet bound to a grant may not navigate at all, the guest gathers no ICE candidates, and an SSH path that canonicalizes outside the grant root is refused before it is read. The one route out is a link the reader presses: a trusted click on an anchor, reported by the preview's own preload from a guest still bound to a live grant, leaves through the configured browser destination and captured source route — and only after the reader confirms the exact destination URL, so a document cannot spend a single stray press exfiltrating what it can read into a link it authored. The preview hands its guest that focus itself whenever it is the surface the reader is in — a browsing page gets it from the chrome around it, and a preview has no chrome to get it from — and it does so only then, so a preview mounted behind a terminal or an editor never takes the keyboard from what the reader is actually in. It offers again when the window itself takes focus back and nothing in the embedder has claimed that focus, because another app coming to the front lands focus on the embedder rather than the guest and the route out would otherwise stay shut until something remounted the pane — while the same window focus also arrives when the reader presses a tab, that being the guest's own blur returning, and taking focus back from there would fight the reader for their own click. Nothing else does. A navigation or popup the document starts by itself is swallowed whatever else is happening, including immediately after a genuine press elsewhere in the document, so a page that can read its grant cannot hand it to a browser tab; a middle click opens nothing; and a fragment link is answered inside the document. A preview attach carries the preview preload and no renderer-supplied one, and no other attach path can acquire it. A subresource the workspace will not send degrades the document to a notice naming that file, never to a failure panel over a page that rendered. A grant outlives neither the tab that owns it nor the renderer document that minted it, and only the trusted renderer can mint or revoke one. For the browser creations this gate still owns, owner-pinned creation returns the canonical host page identity before navigation readiness; delayed navigation cannot turn a created page into an unidentifiable failure or a duplicate retry. Capability rejection before host mutation must preserve the original error, issue no RPC, surface a failure toast, and remove only a caller-declared newly-created empty split. Post-create reconciliation failure requires exact rollback; ambiguous rollback rejects without local fallback.", - "oracle": "Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2043: Remove the registration-wait, webview-security, preview-authorization, guest-lifecycle and grant-IPC unit suites and the sibling-directory assertion reference. Runtime and browser capability consumers also lose removed imported examples. Remaining document-policy, file-reader and grant-registry assertions do not replace those alarms. Preserve the 27 independent dated receipts at their original unchanged selectors; reduced prospective unit selectors have no fresh result or equivalent replacement claim. Historical prior account (preserved verbatim): Audit1973: Delete the browser RPC forwarding/schema/scalar suite and its prospective selector. Preserve all27 unrelated dated receipts; no actual browser operation alarm is replaced. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): The complete terminal-file-link-actions suite is removed. Lose supplied local/remote menu-row inventories, browser label/order/download/reveal callback forwarding, platform-copy and source-group pinning examples. No OS reveal/download, real remote preview or browser navigation was exercised; the other real document-preview sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Audit1687 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Audit1421 narrows renderer unit coverage as recorded in coverageNotes. Prior oracle descriptions are historical for the changed suite. The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Retained unchanged-selector receipts are the only current execution evidence. Reduced-source assertions await validation. Historical prior oracle: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): In paired Electron, write an HTML fixture that declares its own title on the host, invoke the Explorer preview action on the client, and require the document text to be readable out of the orca-preview guest before judging any absence. With that presence established, require the client to hold exactly one browser workspace more than its baseline and that workspace to be the document one: page and tab url blank, the document path mirrored onto both, the tab named by the document's title, the chip naming the file, no editor row of the retired preview species anywhere, and the guest URL carrying the orca-preview scheme. Ask the host through its own page registry as well as through the tab snapshot, and in the same run open an ordinary URL browser tab from the same client and require that one to arrive in both — the presence precondition without which “the host gained nothing” is satisfied just as well by an oracle that cannot see browser pages at all. Require the preview to sit in a group other than the source editor's while the active group and tab remain the source editor's. Then click away to the terminal, click the preview tab, require it to reactivate and still render, close it with its own X, and require the document tab to be gone while the host still holds only the URL tab and the source group, source editor and terminal survive. Quit the client with a document tab open and relaunch it on the same profile: require the same workspace row to come back, blank and named by the document, rendering the document again over a grant URL that differs from the one that was quit, with no preview-scheme or document-named page anywhere in what the host holds. Prove the halves are live by flipping one product property at a time and requiring the run to fail: publish document workspaces to the host like ordinary ones, and stop mirroring the document onto the workspace row. Have the fixture document attempt its own egress on every load — an unattended window.open and location.href to an off-machine URL, plus an inline ICE gathering probe — and require the same baseline counts and a candidate count of zero, so the document's own attempts are measured rather than assumed. Then, as a separate phase after the close oracle has already run, bring the client window to the front, press the document's heading with a real mouse event, and require the document to report that the same press drove it to attempt a second window.open and location.href while both browser counts stay at that phase's baseline and nothing routes — the case a recent-input gate cannot distinguish from the press's own effect. Only then press the target=_blank link with a real mouse event and require both a recorded routing call that returned success and a browser count above that baseline, with the preview tab still open. Drive the preload's click policy as a unit oracle over a real document: a dispatched click, a trusted press on an external anchor, an anchor reached through what it wraps, an SVG animated href, a sibling preview link, fragment and percent-encoded fragment targets, a bare hash, and a middle click. Create a browser page located by a workspace document, handing creation a live grant URL, and require its stored url, its mirrored tab url and the written session payload all to be blank with no orca-preview string anywhere in what was written, while an ordinary page created the same way keeps the URL it was given and asks for the address bar the document page never does. Parse the written page and tab through the session schema and require the document to survive both halves. Hydrate them back and require the document page to return blank and still named — including when its page row was salvaged away and only the tab's own copy remains, and when a foreign session carried a grant URL into both rows. Drive the mirror across a page switch out of the document and back, and across a repair in which the document is the only mirrored field that differs. Name a document page from its document and require the tab to take that name, name it with an empty title and require the file, name it with a live grant URL and require the file again with no preview scheme anywhere in the written session, and require an ordinary blank browser tab beside it to still be called New Tab. Dispatch a title update out of a rendered preview's own guest and require it to reach the page state while the identity chip still reads the document's workspace-relative path. Attach a browsing guest and a workspace-document guest through the same method in one run and require the browsing one to take clicked-link routing, popup handling and auth-identity detach tracking while the document guest takes none of them, stays inside the grant it is showing, denies every window it asks for, and is dropped from the page-keyed document registry by the same teardown that frees its id for a later attach. Register a browsing guest and attach a workspace-document guest in one run against the real manager, require the one door to answer each page with the guest of its own half, and require the document page to be absent from the browsing map and from its enumeration. Drive both browsing registration entry points with a page the document half already holds and require them to register nothing, and drive the mint channel with a page the browsing half already holds and require it to refuse; and drive the offscreen one with a guest that is missing and with one already destroyed, requiring the same refusal. Arm a grab on a live preview target, drive the unregister channel at that same target in the window before the queued operation runs, and require the grab to reach the guest anyway — then drive the same sequence for an ordinary browser page and require its grab state to be disposed after all. Hold one viewport-bridge op open, queue a second behind it, swap the page's guest while that second op waits, and require the injection to land in the guest the page has then. Revoke a grant after a tool has run against its page and require that page's grab state to be cancelled and disposed. Ask a tool for a document page whose guest has not attached, require the request to park in the registration wait, attach the guest, and require the same request to arm on it; require a page nothing ever renders to answer not-ready once that wait elapses. With a document open, ask a tool for a browsing page id and require it to be answered by the browsing half or not at all, with the same channel reaching the document guest under the page it really renders. Drive open-externally for a document whose per-file owner is remote while the workspace-scoped owner is unresolved, for a runtime-owned worktree whose preview tab carries no runtime id of its own, and for a worktree that resolves no runtime owner while the tab still carries one, requiring the download route in each; and for an owner that cannot be resolved at all, and for an unknown workspace root while nothing names another host, requiring a refusal that neither opens nor downloads. Drive the headless backend with a page the document half already holds and require it to reject, destroy the window, and unregister nothing — then shut the backend down and require it still to have unregistered nothing. Navigate a bound preview guest at a second grant through both latch events and require it to stay on the grant it bound to. Mount a preview while a renderer drag is already in flight and require its guest to be click-through at the moment it is appended, not a turn later. Render the editor panel shell in each remaining tab mode and require the path header exactly where the surface does not already name itself. Drive the preview action and require a browser tab located by the document rather than an editor tab, require a second open of the same document to activate the tab it is already in, and require closing that tab to revoke its grant while a URL tab closed beside it revokes none. Publish a worktree holding a document tab and a URL tab and require only the URL tab to reach the mobile snapshot. Install the shared partition policies for a preview partition and for an ordinary browsing partition in the same run, fire each one's own will-download listener, and require the preview's to cancel while the browsing one still reaches the download router — then require the preview protocol installer to be what asks for that deny. In the same run, require the cancelled download to raise a reader-facing notice and the routed one to raise none. require the guest registry to name the bound grant for a live preview guest and nothing for a contents that is not one, has committed no document, or is gone. Drive the shell with a refusal and require one fixed sentence, still one row after three more refusals, standing beside an asset failure rather than being counted with it, gone behind the failure panel, and ignored when it names another preview's grant. Drive the main-side report gate directly for a sender that is no preview guest, a guest with no bound or a revoked grant, a genuine press Electron's webview focus flag misreports as unfocused, and non-web URLs; drive the reader-facing confirmation for accept, cancel, and a confirmed tab the browser refuses; and drive will-attach-webview in both preload directions. Run the per-owner reader, grant-containment, scheme-admission, guest-policy, and plan-routing contracts as unit oracles, including a host-reported truncation, an over-cap binary, and an out-of-worktree paired path. Drive the reader-facing component with the payloads the reader can actually produce — the entry document fails only as truncated or unreadable, a subresource additionally as a refused format — and require the asset case to leave the guest mounted. Drive the closed-tab cleanup hook, the window installer, and the grant IPC handlers directly, requiring the grant to be released when the preview tab closes, cleared at window creation and on a cross-document main-frame navigation, and refused to any sender that is not the trusted renderer. For the browser creations this gate still owns, run the unchanged contract oracle for direct create and side-preview callers with absent status, unknown capabilities, and a mixed-version host, requiring the original unsupported error or visible toast, zero RPCs, and no retained new split; hold a real navigation response beyond the 15-second client deadline after host creation and require the first RPC to return the exact host inventory page ID, one host page, and no retry; repeat reconciliation faults against headless serve and retain the separate exact-page reconciliation rollback oracle. Audit2452 removes the whole fake-effect browser-close routing suite. Active selectors and assertion references no longer select it. Its requested-worktree default close, sibling-page close and explicit missing-page typed reply alarms are intentionally retired without equivalent replacement. Prior dated receipts remain unchanged and scoped to their original sources; no fresh execution of the reduced gate, rendered browser, live remote, mobile or cross-platform validation is claimed.", + "oracle": "Audit3108: doc-preview-grants.test.ts now retains only the stale grant-rejection race: a late rejected grant request must not evict a newer grant registry entry, witnessed by later revocation of grant-2. Retire stable minted-location and outside-workspace POSIX/Windows request-projection alarms without replacement. The direct nonempty grant selector remains unchanged; no real grant-server/file authorization, SSH/HTML delivery or native-focus result is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2043: Remove the registration-wait, webview-security, preview-authorization, guest-lifecycle and grant-IPC unit suites and the sibling-directory assertion reference. Runtime and browser capability consumers also lose removed imported examples. Remaining document-policy, file-reader and grant-registry assertions do not replace those alarms. Preserve the 27 independent dated receipts at their original unchanged selectors; reduced prospective unit selectors have no fresh result or equivalent replacement claim. Historical prior account (preserved verbatim): Audit1973: Delete the browser RPC forwarding/schema/scalar suite and its prospective selector. Preserve all27 unrelated dated receipts; no actual browser operation alarm is replaced. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): The complete terminal-file-link-actions suite is removed. Lose supplied local/remote menu-row inventories, browser label/order/download/reveal callback forwarding, platform-copy and source-group pinning examples. No OS reveal/download, real remote preview or browser navigation was exercised; the other real document-preview sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Audit1687 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Audit1421 narrows renderer unit coverage as recorded in coverageNotes. Prior oracle descriptions are historical for the changed suite. The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Retained unchanged-selector receipts are the only current execution evidence. Reduced-source assertions await validation. Historical prior oracle: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): In paired Electron, write an HTML fixture that declares its own title on the host, invoke the Explorer preview action on the client, and require the document text to be readable out of the orca-preview guest before judging any absence. With that presence established, require the client to hold exactly one browser workspace more than its baseline and that workspace to be the document one: page and tab url blank, the document path mirrored onto both, the tab named by the document's title, the chip naming the file, no editor row of the retired preview species anywhere, and the guest URL carrying the orca-preview scheme. Ask the host through its own page registry as well as through the tab snapshot, and in the same run open an ordinary URL browser tab from the same client and require that one to arrive in both — the presence precondition without which “the host gained nothing” is satisfied just as well by an oracle that cannot see browser pages at all. Require the preview to sit in a group other than the source editor's while the active group and tab remain the source editor's. Then click away to the terminal, click the preview tab, require it to reactivate and still render, close it with its own X, and require the document tab to be gone while the host still holds only the URL tab and the source group, source editor and terminal survive. Quit the client with a document tab open and relaunch it on the same profile: require the same workspace row to come back, blank and named by the document, rendering the document again over a grant URL that differs from the one that was quit, with no preview-scheme or document-named page anywhere in what the host holds. Prove the halves are live by flipping one product property at a time and requiring the run to fail: publish document workspaces to the host like ordinary ones, and stop mirroring the document onto the workspace row. Have the fixture document attempt its own egress on every load — an unattended window.open and location.href to an off-machine URL, plus an inline ICE gathering probe — and require the same baseline counts and a candidate count of zero, so the document's own attempts are measured rather than assumed. Then, as a separate phase after the close oracle has already run, bring the client window to the front, press the document's heading with a real mouse event, and require the document to report that the same press drove it to attempt a second window.open and location.href while both browser counts stay at that phase's baseline and nothing routes — the case a recent-input gate cannot distinguish from the press's own effect. Only then press the target=_blank link with a real mouse event and require both a recorded routing call that returned success and a browser count above that baseline, with the preview tab still open. Drive the preload's click policy as a unit oracle over a real document: a dispatched click, a trusted press on an external anchor, an anchor reached through what it wraps, an SVG animated href, a sibling preview link, fragment and percent-encoded fragment targets, a bare hash, and a middle click. Create a browser page located by a workspace document, handing creation a live grant URL, and require its stored url, its mirrored tab url and the written session payload all to be blank with no orca-preview string anywhere in what was written, while an ordinary page created the same way keeps the URL it was given and asks for the address bar the document page never does. Parse the written page and tab through the session schema and require the document to survive both halves. Hydrate them back and require the document page to return blank and still named — including when its page row was salvaged away and only the tab's own copy remains, and when a foreign session carried a grant URL into both rows. Drive the mirror across a page switch out of the document and back, and across a repair in which the document is the only mirrored field that differs. Name a document page from its document and require the tab to take that name, name it with an empty title and require the file, name it with a live grant URL and require the file again with no preview scheme anywhere in the written session, and require an ordinary blank browser tab beside it to still be called New Tab. Dispatch a title update out of a rendered preview's own guest and require it to reach the page state while the identity chip still reads the document's workspace-relative path. Attach a browsing guest and a workspace-document guest through the same method in one run and require the browsing one to take clicked-link routing, popup handling and auth-identity detach tracking while the document guest takes none of them, stays inside the grant it is showing, denies every window it asks for, and is dropped from the page-keyed document registry by the same teardown that frees its id for a later attach. Register a browsing guest and attach a workspace-document guest in one run against the real manager, require the one door to answer each page with the guest of its own half, and require the document page to be absent from the browsing map and from its enumeration. Drive both browsing registration entry points with a page the document half already holds and require them to register nothing, and drive the mint channel with a page the browsing half already holds and require it to refuse; and drive the offscreen one with a guest that is missing and with one already destroyed, requiring the same refusal. Arm a grab on a live preview target, drive the unregister channel at that same target in the window before the queued operation runs, and require the grab to reach the guest anyway — then drive the same sequence for an ordinary browser page and require its grab state to be disposed after all. Hold one viewport-bridge op open, queue a second behind it, swap the page's guest while that second op waits, and require the injection to land in the guest the page has then. Revoke a grant after a tool has run against its page and require that page's grab state to be cancelled and disposed. Ask a tool for a document page whose guest has not attached, require the request to park in the registration wait, attach the guest, and require the same request to arm on it; require a page nothing ever renders to answer not-ready once that wait elapses. With a document open, ask a tool for a browsing page id and require it to be answered by the browsing half or not at all, with the same channel reaching the document guest under the page it really renders. Drive open-externally for a document whose per-file owner is remote while the workspace-scoped owner is unresolved, for a runtime-owned worktree whose preview tab carries no runtime id of its own, and for a worktree that resolves no runtime owner while the tab still carries one, requiring the download route in each; and for an owner that cannot be resolved at all, and for an unknown workspace root while nothing names another host, requiring a refusal that neither opens nor downloads. Drive the headless backend with a page the document half already holds and require it to reject, destroy the window, and unregister nothing — then shut the backend down and require it still to have unregistered nothing. Navigate a bound preview guest at a second grant through both latch events and require it to stay on the grant it bound to. Mount a preview while a renderer drag is already in flight and require its guest to be click-through at the moment it is appended, not a turn later. Render the editor panel shell in each remaining tab mode and require the path header exactly where the surface does not already name itself. Drive the preview action and require a browser tab located by the document rather than an editor tab, require a second open of the same document to activate the tab it is already in, and require closing that tab to revoke its grant while a URL tab closed beside it revokes none. Publish a worktree holding a document tab and a URL tab and require only the URL tab to reach the mobile snapshot. Install the shared partition policies for a preview partition and for an ordinary browsing partition in the same run, fire each one's own will-download listener, and require the preview's to cancel while the browsing one still reaches the download router — then require the preview protocol installer to be what asks for that deny. In the same run, require the cancelled download to raise a reader-facing notice and the routed one to raise none. require the guest registry to name the bound grant for a live preview guest and nothing for a contents that is not one, has committed no document, or is gone. Drive the shell with a refusal and require one fixed sentence, still one row after three more refusals, standing beside an asset failure rather than being counted with it, gone behind the failure panel, and ignored when it names another preview's grant. Drive the main-side report gate directly for a sender that is no preview guest, a guest with no bound or a revoked grant, a genuine press Electron's webview focus flag misreports as unfocused, and non-web URLs; drive the reader-facing confirmation for accept, cancel, and a confirmed tab the browser refuses; and drive will-attach-webview in both preload directions. Run the per-owner reader, grant-containment, scheme-admission, guest-policy, and plan-routing contracts as unit oracles, including a host-reported truncation, an over-cap binary, and an out-of-worktree paired path. Drive the reader-facing component with the payloads the reader can actually produce — the entry document fails only as truncated or unreadable, a subresource additionally as a refused format — and require the asset case to leave the guest mounted. Drive the closed-tab cleanup hook, the window installer, and the grant IPC handlers directly, requiring the grant to be released when the preview tab closes, cleared at window creation and on a cross-document main-frame navigation, and refused to any sender that is not the trusted renderer. For the browser creations this gate still owns, run the unchanged contract oracle for direct create and side-preview callers with absent status, unknown capabilities, and a mixed-version host, requiring the original unsupported error or visible toast, zero RPCs, and no retained new split; hold a real navigation response beyond the 15-second client deadline after host creation and require the first RPC to return the exact host inventory page ID, one host page, and no retry; repeat reconciliation faults against headless serve and retain the separate exact-page reconciliation rollback oracle. Audit2452 removes the whole fake-effect browser-close routing suite. Active selectors and assertion references no longer select it. Its requested-worktree default close, sibling-page close and explicit missing-page typed reply alarms are intentionally retired without equivalent replacement. Prior dated receipts remain unchanged and scoped to their original sources; no fresh execution of the reduced gate, rendered browser, live remote, mobile or cross-platform validation is claimed.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser/client-pages/orca-runtime-browser.test.ts src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts src/renderer/src/runtime/web-session-tabs-sync/placement/web-session-tabs-sync-browser-tabs.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/document-preview/doc-preview-grant-registry.test.ts src/main/browser/document-preview/doc-preview-file-reader.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/main/browser/document-preview/doc-preview-failure-notice.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/lib/browser/documents/doc-preview-grants.test.ts src/renderer/src/components/browser-pane/workspace-doc/doc-preview-external-link-confirmation.test.ts", @@ -4463,7 +4450,7 @@ "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/doc-preview-document-actions.test.ts src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/link-actions/LinkActionPopover.test.tsx src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-editor-diff-tabs.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx", - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/browser/pages/browser-page-conversion.test.ts src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-conversion-publish.test.ts src/renderer/src/lib/workspace-doc-address-input.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx", + "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/browser/pages/browser-page-conversion.test.ts src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-conversion-publish.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx", "SKIP_BUILD=1 ORCA_E2E_WEB_CLIENT=1 ORCA_E2E_FORCE_HEADFUL=1 pnpm exec playwright test tests/e2e/paired-preview-address-bar-convergence.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 --reporter=list", "SKIP_BUILD=1 ORCA_E2E_WEB_CLIENT=1 ORCA_E2E_FORCE_HEADFUL=1 pnpm exec playwright test tests/e2e/paired-remote-html-preview-local-render.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 --reporter=line", "SKIP_BUILD=1 ORCA_E2E_WEB_CLIENT=1 ORCA_E2E_FORCE_HEADFUL=1 pnpm exec playwright test tests/e2e/paired-remote-html-preview-local-render.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 --reporter=line --repeat-each=3", @@ -4496,7 +4483,6 @@ "src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-editor-diff-tabs.test.ts", "src/renderer/src/store/slices/browser/pages/browser-page-conversion.test.ts", "src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-conversion-publish.test.ts", - "src/renderer/src/lib/workspace-doc-address-input.test.ts", "tests/e2e/paired-remote-html-preview-local-render.spec.ts", "tests/e2e/paired-preview-address-bar-convergence.spec.ts", "tests/e2e/paired-browser-create-navigation-deadline.spec.ts", @@ -4949,7 +4935,9 @@ "D01 candidate audit retires this complete dated receipt because a named test source changes in the candidate overlay. It supplies no new execution or equivalent-coverage claim. Original receipt verbatim:\n{\n \"date\": \"2026-08-27\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.failure-message.test.tsx\",\n \"result\": \"failed\",\n \"durationSeconds\": 1.27,\n \"summary\": \"Candidate with the sole delta that every failure sets the blocking reason, asset or not, failed 4/14 on the asset-notice assertions — the same mutant the retired 2026-08-26 record measured at 3/10, re-run at the relocated path. A refused subresource must name itself over a document that stays mounted; only the entry document may take the page away.\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.failure-message.test.tsx\"\n }", "D01 candidate audit retires this complete dated receipt because a named test source changes in the candidate overlay. It supplies no new execution or equivalent-coverage claim. Original receipt verbatim:\n{\n \"date\": \"2026-08-27\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.failure-message.test.tsx\",\n \"result\": \"passed\",\n \"durationSeconds\": 1.54,\n \"summary\": \"14/14 on the reader-facing failure suite at its relocated path. This and the red run below replace the 2026-08-26 pair recorded against the pre-relocation path (10/10 green, 3/10 red), re-measured today so the entry/subresource split keeps a red half rather than only a green one.\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.failure-message.test.tsx\"\n }", "D01 final candidate whole-registration policy removes retired module selectors and obsolete assertion descriptions prospectively. Existing unaffected receipts retain their original scope; reduced selectors have no new execution or equivalent replacement claim. Retired named modules: [\"src/preload/doc-preview-link-interception.test.ts\",\"src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.failure-message.test.tsx\"]. Retired compound assertion refs, preserved as historical data: [{\"file\":\"src/renderer/src/components/browser-pane/workspace-doc/doc-preview-external-link-confirmation.test.ts\",\"assertions\":[\"an external preview link shows the reader its exact destination and becomes a browser tab only after confirmation\",\"a declined confirmation opens nothing, and a confirmed tab that is refused or fails outright surfaces instead of being dropped\"]}]", - "Audit2452 removes the whole fake-effect browser-close routing suite. Active selectors and assertion references no longer select it. Its requested-worktree default close, sibling-page close and explicit missing-page typed reply alarms are intentionally retired without equivalent replacement. Prior dated receipts remain unchanged and scoped to their original sources; no fresh execution of the reduced gate, rendered browser, live remote, mobile or cross-platform validation is claimed. Retired assertion reference: {\"file\":\"src/renderer/src/hooks/useIpcEvents-close-routing-browser-pages.test.ts\",\"assertions\":[\"closing an absent renderer page returns browser_tab_not_found instead of an untyped failure\"]}" + "Audit2452 removes the whole fake-effect browser-close routing suite. Active selectors and assertion references no longer select it. Its requested-worktree default close, sibling-page close and explicit missing-page typed reply alarms are intentionally retired without equivalent replacement. Prior dated receipts remain unchanged and scoped to their original sources; no fresh execution of the reduced gate, rendered browser, live remote, mobile or cross-platform validation is claimed. Retired assertion reference: {\"file\":\"src/renderer/src/hooks/useIpcEvents-close-routing-browser-pages.test.ts\",\"assertions\":[\"closing an absent renderer page returns browser_tab_not_found instead of an untyped failure\"]}", + "Audit3108: doc-preview-grants.test.ts now retains only the stale grant-rejection race: a late rejected grant request must not evict a newer grant registry entry, witnessed by later revocation of grant-2. Retire stable minted-location and outside-workspace POSIX/Windows request-projection alarms without replacement. The direct nonempty grant selector remains unchanged; no real grant-server/file authorization, SSH/HTML delivery or native-focus result is claimed.", + "File/document owner layout retires the complete workspace-doc-address-input unit suite because its sole mixed case asserts internal catalog-enumeration work. The current-workspace HTML-resolution alarm is lost; no equivalent replacement coverage or pass for the reduced unit selector is claimed. Historical receipts and all remaining selectors/assertions retain their original scope." ], "demotionRule": "Demote if a paired HTML preview creates a browser workspace on either side, renders from anything other than the orca-preview scheme, serves a read the host reported as truncated or over-cap, serves a document without the self-only content security policy, lets the preview session carry an off-machine request, reads an SSH path that canonicalizes outside its grant root, steals focus from the source editor when it opens, removes unrelated editor or terminal state on close, hides a document that rendered because one subresource was refused, leaves a grant readable after the tab or renderer that owns it is gone, mints one for a sender that is not the trusted renderer, opens a browser tab for a navigation the document started with no one at the keyboard, or lets the guest gather an ICE candidate; or if a paired browser creation this gate still owns produces duplicate client or host identities or loses its requested split." }, @@ -5847,14 +5835,12 @@ "invariant": "Append-only external file growth changes only Monaco's model suffix, retaining the viewport, selection, Find state, and renderer liveness above the append point; read-only live tails do not create undo history, while editable external updates remain undoable and arbitrary rewrites continue to replace the model content.", "oracle": "Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1709 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Focused tests assert one post-mount content owner and actual lifecycle remount ordering across retained path models. Real-Monaco tests cover undo behavior for read-only live tails versus editable files. Standalone Node timing and private undo-retention budgets at 9 and 50 MiB were retired by audit1677 and provide no current alarm. The Electron scenario compares legacy setValue with watcher appends, checking visible ranges, selection, Find state, scroll offset, non-undoability, renderer survival and memory budgets. Mock-only edit-shape assertions were retired during test-value audit.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/editor/EditorContent.monaco-lifecycle.test.tsx", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/editor/monaco-content-sync.undo-history.test.ts", "node --expose-gc ./node_modules/vitest/vitest.mjs bench --pool=threads", "pnpm run test:e2e -- tests/e2e/agent-session-log-tail-stability.spec.ts --workers=1" ], "testFiles": [ "src/renderer/src/components/editor/monaco-content-sync.undo-history.test.ts", - "src/renderer/src/components/editor/EditorContent.monaco-lifecycle.test.tsx", "tests/e2e/agent-session-log-tail-stability.spec.ts" ], "assertionRefs": [ @@ -5864,12 +5850,6 @@ "a real Monaco read-only live-tail append leaves canUndo false while an ordinary external update remains undoable" ] }, - { - "file": "src/renderer/src/components/editor/EditorContent.monaco-lifecycle.test.tsx", - "assertions": [ - "a same-pane path switch unmounts the prior outer Monaco before real mount reconciliation refreshes the stale target; the prior retained model content and undo sentinel remain untouched" - ] - }, { "file": "tests/e2e/agent-session-log-tail-stability.spec.ts", "assertions": [ @@ -5920,7 +5900,8 @@ "Audit1677 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded.", "No live Windows or Linux View Log evidence yet.", "Historical retired benchmark receipt (not active evidence): {\"date\":\"2026-07-12\",\"runner\":\"local\",\"platform\":\"macos\",\"command\":\"node --expose-gc ./node_modules/vitest/vitest.mjs bench src/renderer/src/components/editor/monaco-content-sync.bench.ts --pool=threads\",\"result\":\"passed\",\"durationSeconds\":75,\"summary\":\"Forced-GC, settled, alternating fresh-model Monaco p95: 9 MiB append 4.02-5.51ms versus replacement 81.42-83.76ms; 50 MiB append 22.72-26.60ms versus replacement 445.11-449.21ms.\"}", - "Historical retired benchmark receipt (not active evidence): {\"date\":\"2026-07-13\",\"runner\":\"local\",\"platform\":\"macos\",\"command\":\"node --expose-gc ./node_modules/vitest/vitest.mjs bench src/renderer/src/components/editor/monaco-content-sync.undo-retention.bench.ts --pool=threads\",\"result\":\"passed\",\"durationSeconds\":5,\"summary\":\"The undoable 50 MiB control retained 104,858,630 undo-service bytes and 104,857,790 ArrayBuffer bytes; the read-only live-tail arm retained zero of both and remained non-undoable.\"}" + "Historical retired benchmark receipt (not active evidence): {\"date\":\"2026-07-13\",\"runner\":\"local\",\"platform\":\"macos\",\"command\":\"node --expose-gc ./node_modules/vitest/vitest.mjs bench src/renderer/src/components/editor/monaco-content-sync.undo-retention.bench.ts --pool=threads\",\"result\":\"passed\",\"durationSeconds\":5,\"summary\":\"The undoable 50 MiB control retained 104,858,630 undo-service bytes and 104,857,790 ArrayBuffer bytes; the read-only live-tail arm retained zero of both and remained non-undoable.\"}", + "Module-layout wave1 intentionally retires complete prohibited owning registrations in src/renderer/src/components/editor/EditorContent.monaco-lifecycle.test.tsx. Lost alarms: unmounts the prior path before reconciling a stale retained target model; keeps the diff editor mounted when a save updates the modified content; still remounts the diff editor for an explicit reload request. No equivalent replacement coverage or pass for a reduced selector is claimed. All unrelated selectors and historical receipts retain their original scope." ], "demotionRule": "Quarantine the Electron scenario if it flakes without a product or harness bug; demote if viewport/Find drift, renderer loss, or Electron memory retention exceeds the registered budgets." }, @@ -6086,6 +6067,10 @@ "Keep missing-proof mixed-version behavior identical to the incumbent client path." ], "knownGaps": [ + "Audit3077 deletes the Kitty restore/reset integration suite and its registrar. The input-and-repaint driver remains populated; the retired emission/mirror/host-request alarms have no equivalent replacement.", + "Audit3061 retires the park-model supplied snapshot suite and nominal mode, cursor, focus, geometry and remote resume metadata variants. Their distinct alarms are intentionally lost; six retained mode/remote cases preserve selected tail-order, authority and parse-readiness boundaries without equivalent replacement. Existing selectors and dated evidence retain their original scope.", + "Audit3053 reduces hidden-replay coverage by retiring nominal overlap, resize, cursor metadata and standalone stalled-restore variants. Timeout, overflow, identity/generation fences and retained live-output coordination remain; the removed alarms are intentionally lost without equivalent replacement. Existing commands, assertion references and dated evidence retain their original scope.", + "Audit3037 removes seven supplied-input baseline cases from the terminal-input-gating registrar. Input-and-repaint wrapper selectors and unrelated assertions remain; historical receipts do not validate the reduced source bytes. Pane authority, acknowledgment refusal and quarantine recovery cases remain, without native or RPC execution claims.", "Audit2145 accepts removal of canned runtime metadata/guard/forwarding, fake in-memory persistence, private work-count and wrapper-duplication tests from the construction/orca-runtime.test.ts aggregate, plus the two automation run-context guards from runtime-workspace-launch-contracts.test.ts. Retained race, framing, physical completion and ownership callbacks remain byte-identical. Existing commands remain valid selectors; historical receipts stay unchanged and provide no fresh validation or replacement coverage for the reduced suites.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts: structural support changed only; no new authored removal credit. src/main/runtime/construction/orca-runtime.test.ts: remove only literal registration import/call pairs await import('../orca-runtime-tests/worktree-setup-and-startup.spec'), await import('../orca-runtime-tests/gitlab-and-pr-bases.spec'); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionFreshNativeFollowResetTests } from '../output/pty-connection-fresh-native-follow-reset.spec', registerPtyConnectionFreshNativeFollowResetTests(); no additional authored credit. src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts: routes tab switch and capture start by explicit page id; accepts focus on tab switch without altering bridge args (focus is main-side concern); keeps terminal cwd resolution fail-soft when the provider is unavailable. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts: drops the bounded scan cache when orphan-cleanup removal completes; clears optimistic reconcile tokens when a CLI worktree removal succeeds; emits drift without mutating when the fetched base fast-forwards created HEAD; emits base_changed without mutation when the fetched base rewrote history; skips stale-token reconciles without mutating or emitting stale status; emits unknown without mutation when fetch fails or the base ref is missing. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts: routes runtime preserved-branch force-delete through the selected WSL project runtime; replies to a waiting client with the error of a delete that fails after acceptance; treats forced runtime deletion of an already-missing unregistered worktree as cleanup; treats normal runtime deletion of an already-missing unregistered worktree as cleanup. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts: warns that a missing-repo removal only forgot the workspace; restores runtime watchers when CLI worktree deletion fails after teardown; does not re-spend the drain budget on a removal after a wedged install was abandoned; routes runtime worktree removal through the selected WSL project runtime; force-deletes a branch that was preserved by runtime worktree removal. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts: records GitLab pasted-project recents only after successful runtime lookup; threads explicit origin preference through runtime WSL PR base resolution; resolves local GitLab fork MR bases from the target project MR head ref; captures the fork MR head from a dedicated ref, not the shared FETCH_HEAD; keeps the durable MR head when the head fetch fails but the local ref resolves; routes runtime GitLab fork MR base git calls through the selected WSL project runtime. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts: passes SSH connection ids through GitLab task operations; routes runtime GitLab issue, MR, work-item, and todo actions through the selected WSL project runtime; routes runtime GitLab MR details, review-management, job, and pasted URL actions through the selected WSL project runtime; normalizes runtime GitLab issue list arguments like the desktop IPC path. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts: does not warn when setup is explicitly skipped for CLI-created worktrees; puts the agent a create starts in the first default tab, as the window does; keeps the 8s main-runtime startup readiness budget for agents without an override; gives OpenCode the 20s main-runtime startup readiness budget; launches explicit startup agents with prompts for CLI-created worktrees. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts: returns a setup launch payload for CLI-created worktrees when hooks are explicitly enabled; does not hand the window a setup main never tried to start; passes the selected Windows setup shell into runtime runner generation; follows normal setup policy for CLI-created worktrees without activating them; uses returned WSL setup shell metadata when runtime spawns setup; uses the shell-aware setup runner for windowless creates without a startup command; reports the in-process setup hook as running when nothing can launch the runner. src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts: coalesces two clients sleeping the same host worktree; stops exactly the expected live PTYs for a worktree; explains a refused workspace close instead of throwing the raw refusal enum. src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts: marks the desktop-active worktree as isActive; includes SSH-backed worktrees in the mobile worktree summary; caches repeated malformed path misses before normalizing them again. src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts: keeps title-only foreground work ahead of monitoring in another pane; keeps a local hook row while a connected PTY still backs its pane; keeps an OSC row via its connected PTY after the pane binding is cleared. src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts: resolves files through a source-visible linked-checkout worktree; marks saved session tabs with live PTYs as host sidebar activity; attributes live legacy PTYs from saved layout bindings when their panes are hidden; marks saved browser tabs as host sidebar activity like desktop; falls back to the path-keyed GitHub cache entry; includes folder workspaces in compact worktree summaries for mobile; attaches inline agent rows from the latest OSC 9999 status; projects monitoring over a title-derived working status. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts: pushes to an idle pane when the only live waiter filters out the message type; resolves a registered waiter without PTY-injecting when the leaf is already idle; keeps already-idle status after tui-idle wait for immediate message delivery; resolves message waiters when notifyMessageArrived is called; does not resolve type-filtered message waiters for unrelated message types; removes message waiter abort listeners after message arrival; resolves message waiters on timeout when no message arrives. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts: delivers pending mail via notifyMessageArrived when the recipient is already idle; does not keep retrying when every pending row was already pointed; repoints pending rows restored with a live-idle coordinator. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts: rolls back a half-created terminal whose surface never publishes. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts: rejects startup prompts for agents that require post-ready stdin; uses portable Unix quoting for mobile agent launch commands in WSL project runtimes; keeps PowerShell quoting for mobile agent launch commands in Windows host runtimes; uses cmd.exe quoting for mobile agent launch commands in local Windows host runtimes; publishes headless mobile session agent identity with synthesized PTY status; rejects disabled mobile session agent launches before spawning; validates mobile terminal insertion anchors before resolving agent launch commands. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts: coalesces a reconnect close burst onto one authoritative PTY inventory; keeps an explicit user close destructive while the PTY is live; builds mobile session agent launch commands on the runtime host; injects mobile quick-command prompts into the host-built agent startup command. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts: closes persisted headless terminal parents before any prior list call; tears down a serve-owned headless tab on close while a renderer is attached so it cannot resurrect; defers a renderer-published pending tab to the renderer instead of tearing it down; returns a delegated close outcome with no selection tombstone when the renderer owns the outcome; tears down a runtime pending shell the renderer never adopted on close. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts: materializes a plain shell when the pending tab has no launch agent; hydrates legacy persisted terminal tabs without layout entries; reads and indexes the full agent-status snapshot once per mobile projection; kills persisted SSH PTYs when closing hydrated headless tabs before pane metadata is restored; materializes hydrated pending headless terminals with the persisted session identity. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts: hydrates a persisted SSH-owned pane before an attached renderer publishes its graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts: publishes the desktop's tab name over the live agent title, and the live title without one; uses fresh neutral PTY titles over stale mobile snapshot and OSC titles; operates PTY-backed mobile session terminals without a renderer graph; reuses pane close for live PTYs that do not own a renderer tab; lists PTY-backed mobile session terminals without a renderer graph; shows and resolves active PTY-backed mobile session terminals without a renderer graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts: creates mobile session terminals for folder workspaces in a headless runtime server; spawns fresh headless SSH mobile session terminals instead of reattaching synthetic local ids; hydrates headless mobile session terminals from the host workspace session; keeps live headless mobile session terminals when a desktop renderer publishes without them; publishes laptop-created remote runtime split terminals to phone session tabs. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts: does not report headless wake degradation without sleeping records; does not wake slept agents for non-mobile session-only activation; does not rewrite unread metadata when a mobile activation finds the worktree already read; returns unread:false from worktree.ps after a mobile activation clears the flag; materializes pending mobile session terminals without focusing desktop clients; closes browser mobile session tabs when addressed by browser workspace id. src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: resolves mobile terminal surfaces by exact split leaf; closes the matching mobile terminal UUID leaf without closing the whole tab; closes the whole mobile terminal tab when addressed by parent tab id; activates the active split leaf when addressed by parent tab id; clears unread metadata on mobile worktree activation without focusing desktop clients; wakes slept agents on the host renderer when a phone activates a worktree. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts: publishes the hook provider session on a headless mobile tab so native chat can address the transcript; recovers the agent type from the hook row when the pane was launched without an agent hint; reads one agent-status snapshot per projection, not one per terminal tab; waits for unknown-launch foreground owner before publishing Pi-compatible mobile status; keeps Pi-compatible mobile session status as Pi for an unknown-launch foreground pi PTY; keeps renderer-vetted mobile agent status for custom-titled terminals. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts: publishes terminal surface agent status for paired web clients; preserves authoritative OMP identity for Pi-compatible remote terminal snapshots; normalizes a remote OMP title without republishing omitted launch identity; skips the foreground-process probe when the PTY launch agent is already known; probes the foreground process only on a status transition for unknown launch agents; passes the client signal and the slept-worktree refusal to the spawn. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts: does not use stale runtime-created PTY status when a neutral PTY title exists; recognizes runtime-created Codex PTY handles from the ready prompt; recognizes runtime-created Antigravity PTY handles from the ready prompt; recognizes live leaf Antigravity terminals from the ready prompt; recognizes a later Antigravity header with a prompt but no model line; keeps mobile terminal surfaces visible while their leaf handle is pending. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts: lets Claude agents management titles clear stale runtime-created title status; does not recognize live Claude agents panes from a Claude foreground process; does not let stale tab-level agent titles override current neutral pane titles; lists live terminals with fresh pane titles over stale tab titles; lets adopted neutral pane titles use non-shell foreground fallback; lets adopted neutral pane titles retry wrapper foregrounds until recognized; authorizes settled CLI prompts only after positive %s foreground identity; does not recognize arbitrary foreground TUIs as running agents; lets live neutral pane titles retry wrapper foregrounds until recognized; lets current Claude agents PTY titles override stale runtime-created OSC titles; does not let stale Claude agents OSC titles suppress current PTY title activity. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts: keeps preallocated terminal handles valid across renderer reloads; preserves runtime-created PTY process identity after graph unavailable; keeps prompt bindings fenced across runtime restarts without provider incarnation; recognizes runtime-created PTY handles with agent launch titles; does not treat a bare Cursor Agent native title as a running agent session; uses stale runtime-created PTY status when there is no title or foreground evidence. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts: keeps orphaned list and show writability aligned with the send gate. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts: cancels a coalesced SSH worker recovery retry when its provider disconnects. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts: retries renderer reveal before clearing an adopted legacy worker sleeping record. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts: recovers exported ORCA_TERMINAL_HANDLE from discovered live PTY sessions. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts: applies ANSI erase-from-start line controls in retained previews; applies ANSI stripping for private or intermediate CSI line controls; applies ANSI stripping for unsupported erase-line modes; reveals an agent terminal under the pane the caller reserved; keeps a fresh %s pane host-owned when a desktop window is available; keeps desktop publication %s separate from the reserved host spawn; mints its own pane when the reserved leaf is malformed, and reports the one it used; starts an agent terminal with the model the caller picked; starts an agent terminal without a model flag when no pick was made; attributes a startup-agent launch named %s as %s; attributes a fresh agent session the host builds as unknown; leaves a bare agent command the user typed out of launch attribution. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts: trims oversized terminal output bursts without per-line array shifts; builds terminal previews without mapping the full retained tail; keeps recent PTY replay output capped without needing previous data for large chunks; applies terminal redraw controls before retaining previews; applies ANSI terminal redraw controls before retaining previews; retains multi-line ANSI footer redraws instead of appending old frames; keeps the cursor column when erasing full lines in multi-line redraws; applies ANSI split redraw controls without leaking raw params. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts: returns renderer visible screen lines through terminal.read RPC JSON result; separates composer drafts from provider-owned terminal screens. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts: reports an in-flight PTY focus as not navigated when its notifier disappears; reports graph-leaf focus as not navigated without a host notifier; grounds the provider mode tracker before a later chunk, in the emulator order; grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen; waits for terminal exit and resolves with the exit status; keeps terminal read payloads bounded while retained output remains pageable; trims terminal read preview character budget without per-line array shifts. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts: submits a silent Claude composer once after the bounded render fallback; chunks large terminal.send text before provider writes; yields chunked terminal input through immediates between writes; yields while validating accepted large terminal.send text before provider writes; reveals a background terminal session when focusing its handle; replays captured launch config when focusing a background agent session; reveals background terminal sessions with the freshest PTY title; renames background terminal handles without requiring a visible tab; keeps a background terminal handle stable while reveal adoption is racing. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts: resolves tui-idle when a stale Codex prompt is followed by Antigravity readiness; returns an agent-neutral blocked wait result for update prompts; returns an agent-neutral blocked wait result for workspace trust prompts; returns an agent-neutral blocked wait result for cwd selection prompts; returns a blocked wait result for Codex model migration prompts; returns a blocked wait result for Codex startup hook review prompts; returns an agent-neutral blocked wait result for generic interactive prompts; splits text and enter writes for background terminal handles; types the lead line for %s: %s; submits through the agent-specific PTY timing policy for %s. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts: waits for exit on background terminal handles; keeps retained PTY transcript memory when controller refresh fails; resolves tui-idle from an Antigravity ready prompt preview; resolves Antigravity ready prompts with newline-heavy pasted tails without splitting; resolves live-leaf tui-idle from an Antigravity ready prompt preview. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts: spawns the available Qoder command for a captured same-session resume: %s; does not use the local Windows shell setting for remote Windows bare agent creates; matches canonical bare agent commands when a command override is configured; keeps non-bare agent command terminal creates unchanged; keeps disabled bare agent command terminal creates unchanged; injects runtime hook receiver env into terminal sessions; creates background terminal sessions for a $label; creates background terminal sessions for a $label; enables Claude Agent Teams only for direct Claude launches when configured in-process; reveals Claude Agent Teams launches with the rewritten launch config; preserves Claude Agent Teams for sequenced Claude launches. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts: creates visible terminal sessions without asking the renderer to focus a tab; asks the pty controller for the requested shell instead of a startup command; knows the agent a flagged launch command names before any process read; retires a flagged command pane identity when the command exits; retires only receipted restored PTY authority on command completion and exit; forgets synthetic handles when disconnected PTY records are pruned. src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts: returns OSC titles from headless main terminal snapshots; adopts renderer-seeded titles into headless main terminal snapshots; returns cwd metadata from seeded headless main terminal snapshots; adopts OSC7 host metadata from seeded headless terminal scrollback; falls back to the renderer snapshot for hidden-output recovery without headless state; keeps an empty headless snapshot authoritative for hidden-output recovery; advances the absolute output sequence across a daemon stream gap; emits explicit OSC 9999 agent status from runtime PTY data. src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts: falls back to the provider snapshot for a restored PTY with no mounted renderer; falls back to the available mirror when authoritative provider history is unavailable; keeps an empty renderer snapshot when the provider has no retained content; keeps restored provider history authoritative after later live output; uses provider alternate-screen state while a partial model is unsafe; prefers the tracked title over the headless emulator lastTitle; keeps the cursor-agent literal in record-fallback snapshots only without a tracker title; touches mobile snapshots once for decorative spinner ticks, again on idle. src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts: creates a same-repo PR branch override from a resolved head SHA and matching push target; skips broad remote fetch for an existing full-SHA PR base; creates a selected Bitbucket PR branch override from a matching remote branch; suffixes an existing PR when a matching push target lacks selected PR metadata; suffixes a matching push target branch when selected PR metadata has no PR number; suffixes a matching push target branch when the existing PR is different; suffixes a selected PR remote conflict when the PR lookup fails; checks out an unused runtime PR branch only when it is at the resolved head SHA; suffixes only the runtime worktree path when an exact PR branch checkout path exists. src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts: returns runtime local base update suggestions from addWorktree; creates a runtime local worktree from a usable persisted local branch base; does not create a runtime local worktree when the refresh fails and no local base ref exists; creates a branchNameOverride worktree from the selected matching remote base ref. src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts: repaints from the main-owned snapshot when main drops pending output at the cap. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts: records a mode 2031 subscribe from the raw chunk boundary without answering. src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts: retries a fresh-spawn native follow reset when renderer dimensions return. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/construction/orca-runtime.test.ts, src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts, src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts, src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts, src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts. Unresolved local/computed edges remain explicit debt.", "Audit2095 current-parent preparation2126 (approved2092/2093 removals; source refresh2109/independent2112): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts: rejects exact terminal stop for multiple expected PTYs before stopping anything; omits stale renderer leaves when fresh PTY liveness is required; omits unbound renderer placeholders when fresh PTY liveness is required; captures the event method before the nested sleep receipt changes it; returns the close receipt without requiring a PTY stop; uses the same stop result as an empty explicit stop. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts: builds a compact worktree summary from persisted and live runtime state; reads the linked-PR state from the renderer repoId-keyed GitHub cache; carries persisted worktree host ownership in mobile summaries; emits only instance- and boundary-validated lineage parents in mobile summaries; resolves WSL platforms only for repos represented in mobile summaries; omits worktrees hidden by the host visibility policy from mobile summaries; applies linked-checkout source visibility to mobile summaries. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts: routes runtime GitHub PR details and actions through the selected WSL project runtime; passes SSH connection context through hosted review creation flows; routes local WSL project hosted review flows through runtime git options; treats SSH worktree drift as unknown without local git probes. src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts: emits one mobile session terminal tab per live PTY even if two tabs resolve to it; resolves projected split authority from the parent layout PTY binding; keeps explicit-id terminal lists from resolving all worktrees; keeps explicit-id cold-cache terminal lists from classifying unrelated same-repo worktrees; keeps unknown bare terminal-list ids on the no-scan exact-id path; matches explicit-id cwd PTYs for folder workspace instance IDs; routes PTY output through the PTY leaf index in large terminal graphs. src/main/runtime/orca-runtime-tests/window-authority.spec.ts: claims the first window as authoritative and ignores later windows; transfers authority from the headless sentinel to the first real window; relays terminal browser launches only while headless owns the graph; marks live headless PTYs for renderer reattach before desktop promotion; reports the activation gate state while no desktop window is available; bumps the epoch and enters reloading when the authoritative window reloads; can mark the graph ready for the authoritative window; drops back to unavailable and clears authority when the window disappears; hands the graph back to headless when a promoted serve window closes (#27292); keeps a crashed promoted serve renderer on its own window while the window is open; stays unavailable during initial loads before a graph is published. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts, src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts, src/main/runtime/orca-runtime-tests/window-authority.spec.ts. Unresolved local/computed edges remain explicit debt.", @@ -6761,7 +6746,8 @@ "Module layout policy correction: retire the two remaining worktree-ps-agent-row-dismissal.spec.ts registrations. The remint/dismissal/exit case computed expected snapshotVersion increments from a production snapshot and used real-clock vi.waitFor; the legacy OSC case derived its expected paneKey from the production layout-owner switch. The runtime registrar no longer imports this file. These public projection scenarios have no replacement coverage or fresh execution claimed; all historical receipts and earlier loss notes retain their original source scope.", "Audit2153: Intentionally retire the ordinary fake-create event-forwarding registration from src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts. The two retained callbacks prove encrypted fanout/reconnect and physical connection multiplexing under a fake business runtime; neither establishes close-intent authorization, actual terminal sleep, or equivalent replacement for the removed forwarding smoke. Remove this unrelated current close-safety selector. Existing assertionRefs and dated evidenceRuns remain byte-identical and scoped to their own source/commands. No fresh execution or platform/provider coverage is claimed.", "Audit2153 historical original commands item, preserved verbatim; retired selector is not active execution evidence: \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts src/main/runtime/rpc/e2ee-channel.test.ts src/main/runtime/rpc/e2ee-channel-v2.test.ts src/main/runtime/rpc/mobile-socket-wiring.test.ts src/main/runtime/rpc/runtime-client-capabilities.test.ts src/shared/remote-runtime/remote-runtime-client.test.ts src/shared/remote-runtime/requests/remote-runtime-request-connection.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts src/cli/runtime/websocket-transport.test.ts src/renderer/src/web/web-runtime-client.test.ts src/renderer/src/components/terminal/terminal-tab-actions.test.ts src/renderer/src/components/terminal/terminal-close-incarnation.test.ts src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-tab-watchers.test.ts\"", - "Audit2153 historical original testFiles item, preserved verbatim; retired selector is not active execution evidence: \"src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts\"" + "Audit2153 historical original testFiles item, preserved verbatim; retired selector is not active execution evidence: \"src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts\"", + "Terminal/runtime defining-owner cleanup retires complete parking timer, lifecycle, mocked close/disposal and render/flip/mount work-count cases under repository test policy. The retained watcher source has only two literal-oracle coverage decisions; the retained cold-parking hook source has only the layout-PTY exemption invalidation case. Lost alarms include cooldown/measure/pin wakeups, split exit/close attribution and cancellation, watcher disposal/restart, flood timer rearm, worktree verdict damping, and destroyed-transport cold restore. No equivalent replacement coverage or execution pass for the reduced cases is claimed; prior dated receipts retain their original scope." ], "demotionRule": "Keep experimental or quarantine if reconnect emits session-killed for a live canary, an exact root/descendant dies, an old server receives fallback destructive close, cleanup leaks a fixture process/pipe, or the gate flakes without a proven harness defect." }, @@ -6769,7 +6755,7 @@ "id": "terminal-session.startup-cwd-missing-dir-recovery", "title": "Terminal working-directory recovery stays scoped and provider-safe", "maturity": "experimental", - "protection": "partial", + "protection": "none", "owner": "terminal-runtime", "layer": "shared-main-renderer-and-posix-shell-contract", "surfaces": [ @@ -6781,9 +6767,9 @@ ], "platforms": ["macos", "linux", "windows", "mobile"], "providers": ["local", "daemon", "ssh", "wsl", "remote-runtime"], - "coveredPlatforms": ["linux"], + "coveredPlatforms": [], "coveredProviders": [], - "coverageNotes": "Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1760 removes the standalone startup-cwd policy suite without equivalent replacement. One fresh Linux run passed21 retained IPC transport unit cases; cwd-specific coverage returns mocked fallback metadata only. Original receipts and scope are archived in knownGaps; current platform scope reflects this unit run, not a native provider. Historical coverage account (not current evidence): Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1396 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Local macOS evidence covers the shared missing-dir fallback policy, main pty:spawn recovery and metadata, no-flag and reattach strictness, renderer IPC flag routing, SSH-tagged and remote-runtime omission, and the visibility-gated terminal notice. Real Bash and Zsh node-pty tests replace the active cwd inode and exercise the shared POSIX OMP wrapper; audit829 removes generated-file snapshots and their current byte-parity claim. No equivalent replacement for generated-script byte checks is claimed. Daemon shares the same pre-provider main cwd decision but lacks a live daemon-provider run; WSL UNC paths are exempt from the spawn probe and lack a live run; native PowerShell is unaffected; Linux/Windows and mobile/API strictness remain gaps. Audit1396: src/renderer/src/components/terminal-pane/pty-connection-pending-spawn.spec.ts reduced. Lose standalone debug-state retention/log silence alarm. React StrictMode is not mounted; bindings manually simulate remount over mocked transport. No equivalent replacement coverage is claimed.", + "coverageNotes": "Audit3077 retires the sole active passed IPC receipt; no current execution evidence remains for this gate. Historical account (not current coverage): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1760 removes the standalone startup-cwd policy suite without equivalent replacement. One fresh Linux run passed21 retained IPC transport unit cases; cwd-specific coverage returns mocked fallback metadata only. Original receipts and scope are archived in knownGaps; current platform scope reflects this unit run, not a native provider. Historical coverage account (not current evidence): Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1396 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Local macOS evidence covers the shared missing-dir fallback policy, main pty:spawn recovery and metadata, no-flag and reattach strictness, renderer IPC flag routing, SSH-tagged and remote-runtime omission, and the visibility-gated terminal notice. Real Bash and Zsh node-pty tests replace the active cwd inode and exercise the shared POSIX OMP wrapper; audit829 removes generated-file snapshots and their current byte-parity claim. No equivalent replacement for generated-script byte checks is claimed. Daemon shares the same pre-provider main cwd decision but lacks a live daemon-provider run; WSL UNC paths are exempt from the spawn probe and lack a live run; native PowerShell is unaffected; Linux/Windows and mobile/API strictness remain gaps. Audit1396: src/renderer/src/components/terminal-pane/pty-connection-pending-spawn.spec.ts reduced. Lose standalone debug-state retention/log silence alarm. React StrictMode is not mounted; bindings manually simulate remount over mocked transport. No equivalent replacement coverage is claimed.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/7239", "https://github.com/stablyai/orca/pull/7750", @@ -6793,53 +6779,17 @@ ], "invariant": "A fresh local renderer terminal spawn may recover from a saved startup cwd whose directory no longer exists only by spawning at the selected workspace root and printing a generic in-terminal notice; existing directories — including ones outside the worktree (#7685) — spawn as requested, and reattach, SSH, remote-runtime, runtime/API, and mobile callers keep exact cwd semantics. A long-lived POSIX shell whose cwd inode was deleted and replaced may run a wrapped OMP command from the live path named by its logical PWD only in a subshell; the parent shell cwd, OMP argv, status extension, and exit status remain unchanged, while a genuinely unavailable path fails visibly without invoking OMP. A usable physical cwd remains authoritative when PWD is unset or names a removed logical symlink instead of being remapped to a workspace fallback.", "oracle": "Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1683 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The shared resolver falls back to the workspace root only when the injected existence probe reports the resolved cwd missing and the workspace root present, and never probes floating terminals or a cwd equal to the root. The renderer sends cwdFallback only for fresh local IPC spawns, main honors it only when connectionId and sessionId are absent, WSL UNC paths never engage the probe-based fallback, main returns fallback metadata only after an actual fallback, the IPC transport preserves that metadata, and the connection layer writes a generic notice that omits the missing path. In real interactive Bash and Zsh PTYs, unset PWD and remove a logical symlink while the physical cwd stays usable, requiring OMP to remain there; then delete and recreate the active project path, require extension-enabled and extension-skipping invocations to observe the replacement inode with byte-exact argv and nonzero status preserved, require the parent shell to remain on the stale inode, unset PWD and require recovery through ORCA_WORKTREE_PATH, clear every logical fallback and require an actionable failure without invoking OMP, and finally delete the replacement and require the same for the missing PWD path.", - "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-connect-spawn.test.ts --maxWorkers=2", - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/pty/shell-startup/omp-shell-wrapper.node-pty.test.ts src/main/pty/shell-startup/omp-shell-wrapper-alias-safety.test.ts" - ], - "testFiles": [ - "src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts", - "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-connect-spawn.test.ts", - "src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts", - "src/main/pty/shell-startup/omp-shell-wrapper.node-pty.test.ts", - "src/main/pty/shell-startup/omp-shell-wrapper-alias-safety.test.ts" - ], - "assertionRefs": [ - { - "file": "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-connect-spawn.test.ts", - "assertions": [ - "IPC transport returns startup cwd fallback metadata to the connection layer" - ] - }, - { - "file": "src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts", - "assertions": [ - "fresh local IPC worktree spawns are marked with cwdFallback worktree", - "startup cwd fallback metadata prints a generic in-terminal notice", - "remote-runtime worktree spawns are not marked with cwdFallback" - ] - } - ], - "evidenceRuns": [ - { - "date": "2026-11-07", - "runner": "local", - "platform": "linux", - "command": "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-connect-spawn.test.ts --maxWorkers=2", - "result": "passed", - "durationSeconds": 38.8, - "summary": "21 retained IPC transport unit cases passed on Linux, including return of mocked startupCwdFallback metadata. No live PTY, real missing directory, recovery notice, native shell, SSH/WSL, phone, p95 or soak evidence. Executed via pinned Node24 Vitest entry, same root config and selected file; no actual provider coverage claimed." - } - ], + "commands": [], + "testFiles": [], + "assertionRefs": [], + "evidenceRuns": [], "runtimeBudget": { "p95Seconds": 40, "scope": "Historical pre-audit selector budget; changed selectors have no new runtime measurement. Unchanged receipts remain scoped to their own commands." }, "flakeHistory": { "status": "unknown", - "evidence": "Audit1760: one Linux IPC transport unit run passed21 cases; no current soak evidence. Original flake history archived in knownGaps." + "evidence": "Audit3077: no current execution or soak result remains after retiring the reduced IPC source receipt. Historical account: Audit1760: one Linux IPC transport unit run passed21 cases; no current soak evidence. Original flake history archived in knownGaps." }, "redGreenEvidence": { "status": "missing", @@ -6856,6 +6806,12 @@ "Add WSL/mobile/API spawn provider-contract coverage or explicitly narrow their risk scope." ], "knownGaps": [ + "Audit3077 archives the remaining startup-CWD selectors and aliases because protection none permits no active selectors. These unchanged sources are unvalidated candidates, not current execution evidence. The worktree-marker alias remains mapping debt; this metadata retirement adds no test-removal credit. Original candidate fields verbatim:\ncommands: [\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/main/pty/shell-startup/omp-shell-wrapper.node-pty.test.ts src/main/pty/shell-startup/omp-shell-wrapper-alias-safety.test.ts\"\n ]\ntestFiles: [\n \"src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts\",\n \"src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts\",\n \"src/main/pty/shell-startup/omp-shell-wrapper.node-pty.test.ts\",\n \"src/main/pty/shell-startup/omp-shell-wrapper-alias-safety.test.ts\"\n ]\nassertionRefs: [\n {\n \"file\": \"src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts\",\n \"assertions\": [\"fresh local IPC worktree spawns are marked with cwdFallback worktree\"]\n }\n ]", + "Audit3077 retires the direct IPC startup-CWD metadata example, selector and alias. Other startup-CWD selectors and the existing worktree-marker mapping debt remain; no equivalent replacement is claimed.", + "Audit3077 retires this complete dated receipt because its selected source was reduced. It does not validate the reduced selector. Original receipt verbatim:\n{\n \"date\": \"2026-11-07\",\n \"runner\": \"local\",\n \"platform\": \"linux\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-connect-spawn.test.ts --maxWorkers=2\",\n \"result\": \"passed\",\n \"durationSeconds\": 38.8,\n \"summary\": \"21 retained IPC transport unit cases passed on Linux, including return of mocked startupCwdFallback metadata. No live PTY, real missing directory, recovery notice, native shell, SSH/WSL, phone, p95 or soak evidence. Executed via pinned Node24 Vitest entry, same root config and selected file; no actual provider coverage claimed.\"\n }", + "Audit3069 retires nominal spawn/resume/banner wiring, first-fit and lookup-budget variants, private pending-map checks, the split-CWD disposal suite and startup command/draft baseline variants. Distinct regression alarms are intentionally lost without equivalent replacement; retained ownership, cancellation and recovery cases remain. Existing selectors and dated evidence retain their original scope. The earlier generic-notice alias was already retired by audit3061; the remaining cwdFallback marker alias is unchanged mapping debt.", + "Audit3061 retires the park-model supplied snapshot suite and nominal mode, cursor, focus, geometry and remote resume metadata variants. Their distinct alarms are intentionally lost; six retained mode/remote cases preserve selected tail-order, authority and parse-readiness boundaries without equivalent replacement. Existing selectors and dated evidence retain their original scope. The generic startup-cwd notice alias was already stale and is removed as pre-existing metadata debt; this batch receives no new removal credit for that alias. The separate cwdFallback marker alias remains outside this bounded reconciliation.", + "Audit3037 retires the runtime-owner spawn-routing suite and its remote cwdFallback-absence assertion claim. Actual routing-composition alarms are intentionally lost; no replacement or renewed execution credit. Other historical claims and receipts retain their original scope.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionTerminalBellAttentionTests } from '../notifications/pty-connection-terminal-bell-attention.spec', registerPtyConnectionTerminalBellAttentionTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts: forwards onBell to pane attention and notification policy; hands the bell to the attention module with its pane even when pane attention is off. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts, src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts. Unresolved local/computed edges remain explicit debt.", "Audit2065 (sources2063/2064): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionStartupCwdFallbackNoticeTests } from '../startup/pty-connection-startup-cwd-fallback-notice.spec'; registerPtyConnectionStartupCwdFallbackNoticeTests(). src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-startup-cwd-fallback-notice.spec.ts: prints a terminal notice when the startup cwd fell back to the workspace root. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence.", "Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded.", @@ -7067,12 +7023,6 @@ "assertions": [ "the advertised Floating agent launches in a Floating tab with null runtime ownership and no paired-runtime create call" ] - }, - { - "file": "src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts", - "assertions": [ - "the Floating agent's actual PTY selects local IPC, carries executionHostId local, and omits the active project's WSL runtime" - ] } ], "evidenceRuns": [ @@ -7108,6 +7058,8 @@ "Keep disjoint provider inventories, refresh isolation, launch authority, and bounded in-flight state green." ], "knownGaps": [ + "Audit3069 retires nominal spawn/resume/banner wiring, first-fit and lookup-budget variants, private pending-map checks, the split-CWD disposal suite and startup command/draft baseline variants. Distinct regression alarms are intentionally lost without equivalent replacement; retained ownership, cancellation and recovery cases remain. Existing selectors and dated evidence retain their original scope. The retired Floating local IPC/WSL routing alias is removed; the separate StrictMode pending-spawn adoption alias remains.", + "Audit3061 retires the park-model supplied snapshot suite and nominal mode, cursor, focus, geometry and remote resume metadata variants. Their distinct alarms are intentionally lost; six retained mode/remote cases preserve selected tail-order, authority and parse-readiness boundaries without equivalent replacement. Existing selectors and dated evidence retain their original scope.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionTerminalBellAttentionTests } from '../notifications/pty-connection-terminal-bell-attention.spec', registerPtyConnectionTerminalBellAttentionTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts: forwards onBell to pane attention and notification policy; hands the bell to the attention module with its pane even when pane attention is off. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts, src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts. Unresolved local/computed edges remain explicit debt.", "Audit2065 (sources2063/2064): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionStartupCwdFallbackNoticeTests } from '../startup/pty-connection-startup-cwd-fallback-notice.spec'; registerPtyConnectionStartupCwdFallbackNoticeTests(). src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-startup-cwd-fallback-notice.spec.ts: prints a terminal notice when the startup cwd fell back to the workspace root. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence.", "Live SSH and paired-runtime launch journeys are covered by existing authority contracts rather than this focused oracle.", @@ -7120,7 +7072,8 @@ "Audit1396: src/renderer/src/components/terminal-pane/pty-connection-pending-spawn.spec.ts reduced. Lose standalone debug-state retention/log silence alarm. React StrictMode is not mounted; bindings manually simulate remount over mocked transport. No equivalent replacement coverage is claimed.", "Audit1396 retires this complete dated receipt because a source in its selector was deleted or reduced. It does not validate the reduced selector. Original receipt verbatim:\n{\n \"date\": \"2026-08-12\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection-fresh-spawn-guards.test.ts --reporter=dot\",\n \"result\": \"passed\",\n \"durationSeconds\": 20,\n \"summary\": \"The full PTY connection suite passed the independent Floating native-host transport oracle.\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection-spawn-and-startup.test.ts --reporter=dot\"\n }", "Audit1396 historical platform/provider scope before source changes: {\"coveredPlatforms\":[\"macos\",\"windows\"],\"coveredProviders\":[\"local\",\"wsl\"]}. Remaining provider scope applies only to unchanged-source receipts.", - "Audit2371 reduces repos-project-group-create-race.test.ts by removing the two-host generic failed-create-response/no-op example. Its alarm that a failed create reply leaves an intervening refreshed state untouched is intentionally lost. The surviving refreshed-field and original-owner races do not supply equivalent replacement coverage. No fresh execution or red/green evidence validates the reduced source; unrelated physical Windows/WSL receipt retains its original command and scope." + "Audit2371 reduces repos-project-group-create-race.test.ts by removing the two-host generic failed-create-response/no-op example. Its alarm that a failed create reply leaves an intervening refreshed state untouched is intentionally lost. The surviving refreshed-field and original-owner races do not supply equivalent replacement coverage. No fresh execution or red/green evidence validates the reduced source; unrelated physical Windows/WSL receipt retains its original command and scope.", + "Finite R02 ownership closure retires all three cases from pty-connection/spawn/pty-connection-fresh-spawn-guards.spec.ts and its empty aggregate registration. Intentionally lost alarms: deletion-phase fresh-spawn admission; wrapped worktree-removal fence error suppression; classified typing versus synthetic query/mouse/alternate-wheel replay input, normal-arrow preservation, deferred input provenance and post-replay restoration. No equivalent replacement coverage, new execution, real PTY delivery or CI claim. Historical receipts and their original commands/counts/results remain historical and do not validate the reduced selector." ], "demotionRule": "Demote if discovery and launch can resolve different authorities, a scoped Floating probe overwrites the active-project inventory, or local context selection adds recurring scans or retained in-flight entries." }, @@ -7213,7 +7166,7 @@ "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/agent-session/resume/resume-sleeping-agent-session.test.ts", "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/completed-worker-retirement-resume.unit.test.ts --reporter=verbose", - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/agent-session/resume/resume-sleeping-agent-session.test.ts src/main/providers/local-pty/local-pty-provider-spawn-session.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/ipc/pty/pty-pane-reservation-settlement.test.ts src/main/runtime/construction/orca-runtime.test.ts src/renderer/src/lib/pane-manager/pane-fit.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-session-launch.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/agent-session/resume/resume-sleeping-agent-session.test.ts src/main/providers/local-pty/local-pty-provider-spawn-session.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/ipc/pty/pty-pane-reservation-settlement.test.ts src/main/runtime/construction/orca-runtime.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-session-launch.test.ts", "pnpm exec electron-vite build --mode e2e && SKIP_BUILD=1 pnpm exec playwright test tests/e2e/live-background-terminal-mount-authority.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/agent-session/lifecycle/structured-agent-cli-writers.test.ts src/main/runtime/rpc/methods/structured-sessions/creation/structured-agent-session-adoption-replay.test.ts src/main/providers/agent-foreground-process-git-bash.win32.test.ts" ], @@ -7225,7 +7178,6 @@ "src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts", "src/main/ipc/pty/pty-pane-reservation-settlement.test.ts", "src/main/runtime/construction/orca-runtime.test.ts", - "src/renderer/src/lib/pane-manager/pane-fit.test.ts", "src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-session-launch.test.ts", "tests/e2e/live-background-terminal-mount-authority.spec.ts", @@ -7258,12 +7210,6 @@ "hibernated stable panes with cleared live PTY bindings are skipped" ] }, - { - "file": "src/renderer/src/lib/pane-manager/pane-fit.test.ts", - "assertions": [ - "withheld hidden-window animation frames exhaust the bounded fit retry and release its continuation" - ] - }, { "file": "src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts", "assertions": [ @@ -7322,6 +7268,7 @@ "Record byte-identical latest-main, candidate, and candidate-revert Electron results." ], "knownGaps": [ + "Audit3053 reduces hidden-replay coverage by retiring nominal overlap, resize, cursor metadata and standalone stalled-restore variants. Timeout, overflow, identity/generation fences and retained live-output coordination remain; the removed alarms are intentionally lost without equivalent replacement. Existing commands, assertion references and dated evidence retain their original scope.", "Audit2236: pane-fit.test.ts is reduced to terminal-identity reveal, stale-handle replacement ownership and withheld-animation-frame completion. The existing withheld-frame assertion remains exact; additional scheduling/breadcrumb, cancellation, display-none and synthetic metric examples are removed. No new execution or equivalent replacement coverage is claimed. Historical dated receipts and budgets are preserved verbatim and do not validate these reduced source bytes.", "Audit2145 accepts removal of canned runtime metadata/guard/forwarding, fake in-memory persistence, private work-count and wrapper-duplication tests from the construction/orca-runtime.test.ts aggregate, plus the two automation run-context guards from runtime-workspace-launch-contracts.test.ts. Retained race, framing, physical completion and ownership callbacks remain byte-identical. Existing commands remain valid selectors; historical receipts stay unchanged and provide no fresh validation or replacement coverage for the reduced suites.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts: structural support changed only; no new authored removal credit. src/main/runtime/construction/orca-runtime.test.ts: remove only literal registration import/call pairs await import('../orca-runtime-tests/worktree-setup-and-startup.spec'), await import('../orca-runtime-tests/gitlab-and-pr-bases.spec'); no additional authored credit. src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts: routes tab switch and capture start by explicit page id; accepts focus on tab switch without altering bridge args (focus is main-side concern); keeps terminal cwd resolution fail-soft when the provider is unavailable. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts: drops the bounded scan cache when orphan-cleanup removal completes; clears optimistic reconcile tokens when a CLI worktree removal succeeds; emits drift without mutating when the fetched base fast-forwards created HEAD; emits base_changed without mutation when the fetched base rewrote history; skips stale-token reconciles without mutating or emitting stale status; emits unknown without mutation when fetch fails or the base ref is missing. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts: routes runtime preserved-branch force-delete through the selected WSL project runtime; replies to a waiting client with the error of a delete that fails after acceptance; treats forced runtime deletion of an already-missing unregistered worktree as cleanup; treats normal runtime deletion of an already-missing unregistered worktree as cleanup. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts: warns that a missing-repo removal only forgot the workspace; restores runtime watchers when CLI worktree deletion fails after teardown; does not re-spend the drain budget on a removal after a wedged install was abandoned; routes runtime worktree removal through the selected WSL project runtime; force-deletes a branch that was preserved by runtime worktree removal. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts: records GitLab pasted-project recents only after successful runtime lookup; threads explicit origin preference through runtime WSL PR base resolution; resolves local GitLab fork MR bases from the target project MR head ref; captures the fork MR head from a dedicated ref, not the shared FETCH_HEAD; keeps the durable MR head when the head fetch fails but the local ref resolves; routes runtime GitLab fork MR base git calls through the selected WSL project runtime. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts: passes SSH connection ids through GitLab task operations; routes runtime GitLab issue, MR, work-item, and todo actions through the selected WSL project runtime; routes runtime GitLab MR details, review-management, job, and pasted URL actions through the selected WSL project runtime; normalizes runtime GitLab issue list arguments like the desktop IPC path. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts: does not warn when setup is explicitly skipped for CLI-created worktrees; puts the agent a create starts in the first default tab, as the window does; keeps the 8s main-runtime startup readiness budget for agents without an override; gives OpenCode the 20s main-runtime startup readiness budget; launches explicit startup agents with prompts for CLI-created worktrees. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts: returns a setup launch payload for CLI-created worktrees when hooks are explicitly enabled; does not hand the window a setup main never tried to start; passes the selected Windows setup shell into runtime runner generation; follows normal setup policy for CLI-created worktrees without activating them; uses returned WSL setup shell metadata when runtime spawns setup; uses the shell-aware setup runner for windowless creates without a startup command; reports the in-process setup hook as running when nothing can launch the runner. src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts: coalesces two clients sleeping the same host worktree; stops exactly the expected live PTYs for a worktree; explains a refused workspace close instead of throwing the raw refusal enum. src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts: marks the desktop-active worktree as isActive; includes SSH-backed worktrees in the mobile worktree summary; caches repeated malformed path misses before normalizing them again. src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts: keeps title-only foreground work ahead of monitoring in another pane; keeps a local hook row while a connected PTY still backs its pane; keeps an OSC row via its connected PTY after the pane binding is cleared. src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts: resolves files through a source-visible linked-checkout worktree; marks saved session tabs with live PTYs as host sidebar activity; attributes live legacy PTYs from saved layout bindings when their panes are hidden; marks saved browser tabs as host sidebar activity like desktop; falls back to the path-keyed GitHub cache entry; includes folder workspaces in compact worktree summaries for mobile; attaches inline agent rows from the latest OSC 9999 status; projects monitoring over a title-derived working status. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts: pushes to an idle pane when the only live waiter filters out the message type; resolves a registered waiter without PTY-injecting when the leaf is already idle; keeps already-idle status after tui-idle wait for immediate message delivery; resolves message waiters when notifyMessageArrived is called; does not resolve type-filtered message waiters for unrelated message types; removes message waiter abort listeners after message arrival; resolves message waiters on timeout when no message arrives. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts: delivers pending mail via notifyMessageArrived when the recipient is already idle; does not keep retrying when every pending row was already pointed; repoints pending rows restored with a live-idle coordinator. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts: rolls back a half-created terminal whose surface never publishes. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts: rejects startup prompts for agents that require post-ready stdin; uses portable Unix quoting for mobile agent launch commands in WSL project runtimes; keeps PowerShell quoting for mobile agent launch commands in Windows host runtimes; uses cmd.exe quoting for mobile agent launch commands in local Windows host runtimes; publishes headless mobile session agent identity with synthesized PTY status; rejects disabled mobile session agent launches before spawning; validates mobile terminal insertion anchors before resolving agent launch commands. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts: coalesces a reconnect close burst onto one authoritative PTY inventory; keeps an explicit user close destructive while the PTY is live; builds mobile session agent launch commands on the runtime host; injects mobile quick-command prompts into the host-built agent startup command. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts: closes persisted headless terminal parents before any prior list call; tears down a serve-owned headless tab on close while a renderer is attached so it cannot resurrect; defers a renderer-published pending tab to the renderer instead of tearing it down; returns a delegated close outcome with no selection tombstone when the renderer owns the outcome; tears down a runtime pending shell the renderer never adopted on close. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts: materializes a plain shell when the pending tab has no launch agent; hydrates legacy persisted terminal tabs without layout entries; reads and indexes the full agent-status snapshot once per mobile projection; kills persisted SSH PTYs when closing hydrated headless tabs before pane metadata is restored; materializes hydrated pending headless terminals with the persisted session identity. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts: hydrates a persisted SSH-owned pane before an attached renderer publishes its graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts: publishes the desktop's tab name over the live agent title, and the live title without one; uses fresh neutral PTY titles over stale mobile snapshot and OSC titles; operates PTY-backed mobile session terminals without a renderer graph; reuses pane close for live PTYs that do not own a renderer tab; lists PTY-backed mobile session terminals without a renderer graph; shows and resolves active PTY-backed mobile session terminals without a renderer graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts: creates mobile session terminals for folder workspaces in a headless runtime server; spawns fresh headless SSH mobile session terminals instead of reattaching synthetic local ids; hydrates headless mobile session terminals from the host workspace session; keeps live headless mobile session terminals when a desktop renderer publishes without them; publishes laptop-created remote runtime split terminals to phone session tabs. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts: does not report headless wake degradation without sleeping records; does not wake slept agents for non-mobile session-only activation; does not rewrite unread metadata when a mobile activation finds the worktree already read; returns unread:false from worktree.ps after a mobile activation clears the flag; materializes pending mobile session terminals without focusing desktop clients; closes browser mobile session tabs when addressed by browser workspace id. src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: resolves mobile terminal surfaces by exact split leaf; closes the matching mobile terminal UUID leaf without closing the whole tab; closes the whole mobile terminal tab when addressed by parent tab id; activates the active split leaf when addressed by parent tab id; clears unread metadata on mobile worktree activation without focusing desktop clients; wakes slept agents on the host renderer when a phone activates a worktree. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts: publishes the hook provider session on a headless mobile tab so native chat can address the transcript; recovers the agent type from the hook row when the pane was launched without an agent hint; reads one agent-status snapshot per projection, not one per terminal tab; waits for unknown-launch foreground owner before publishing Pi-compatible mobile status; keeps Pi-compatible mobile session status as Pi for an unknown-launch foreground pi PTY; keeps renderer-vetted mobile agent status for custom-titled terminals. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts: publishes terminal surface agent status for paired web clients; preserves authoritative OMP identity for Pi-compatible remote terminal snapshots; normalizes a remote OMP title without republishing omitted launch identity; skips the foreground-process probe when the PTY launch agent is already known; probes the foreground process only on a status transition for unknown launch agents; passes the client signal and the slept-worktree refusal to the spawn. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts: does not use stale runtime-created PTY status when a neutral PTY title exists; recognizes runtime-created Codex PTY handles from the ready prompt; recognizes runtime-created Antigravity PTY handles from the ready prompt; recognizes live leaf Antigravity terminals from the ready prompt; recognizes a later Antigravity header with a prompt but no model line; keeps mobile terminal surfaces visible while their leaf handle is pending. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts: lets Claude agents management titles clear stale runtime-created title status; does not recognize live Claude agents panes from a Claude foreground process; does not let stale tab-level agent titles override current neutral pane titles; lists live terminals with fresh pane titles over stale tab titles; lets adopted neutral pane titles use non-shell foreground fallback; lets adopted neutral pane titles retry wrapper foregrounds until recognized; authorizes settled CLI prompts only after positive %s foreground identity; does not recognize arbitrary foreground TUIs as running agents; lets live neutral pane titles retry wrapper foregrounds until recognized; lets current Claude agents PTY titles override stale runtime-created OSC titles; does not let stale Claude agents OSC titles suppress current PTY title activity. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts: keeps preallocated terminal handles valid across renderer reloads; preserves runtime-created PTY process identity after graph unavailable; keeps prompt bindings fenced across runtime restarts without provider incarnation; recognizes runtime-created PTY handles with agent launch titles; does not treat a bare Cursor Agent native title as a running agent session; uses stale runtime-created PTY status when there is no title or foreground evidence. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts: keeps orphaned list and show writability aligned with the send gate. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts: cancels a coalesced SSH worker recovery retry when its provider disconnects. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts: retries renderer reveal before clearing an adopted legacy worker sleeping record. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts: recovers exported ORCA_TERMINAL_HANDLE from discovered live PTY sessions. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts: applies ANSI erase-from-start line controls in retained previews; applies ANSI stripping for private or intermediate CSI line controls; applies ANSI stripping for unsupported erase-line modes; reveals an agent terminal under the pane the caller reserved; keeps a fresh %s pane host-owned when a desktop window is available; keeps desktop publication %s separate from the reserved host spawn; mints its own pane when the reserved leaf is malformed, and reports the one it used; starts an agent terminal with the model the caller picked; starts an agent terminal without a model flag when no pick was made; attributes a startup-agent launch named %s as %s; attributes a fresh agent session the host builds as unknown; leaves a bare agent command the user typed out of launch attribution. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts: trims oversized terminal output bursts without per-line array shifts; builds terminal previews without mapping the full retained tail; keeps recent PTY replay output capped without needing previous data for large chunks; applies terminal redraw controls before retaining previews; applies ANSI terminal redraw controls before retaining previews; retains multi-line ANSI footer redraws instead of appending old frames; keeps the cursor column when erasing full lines in multi-line redraws; applies ANSI split redraw controls without leaking raw params. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts: returns renderer visible screen lines through terminal.read RPC JSON result; separates composer drafts from provider-owned terminal screens. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts: reports an in-flight PTY focus as not navigated when its notifier disappears; reports graph-leaf focus as not navigated without a host notifier; grounds the provider mode tracker before a later chunk, in the emulator order; grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen; waits for terminal exit and resolves with the exit status; keeps terminal read payloads bounded while retained output remains pageable; trims terminal read preview character budget without per-line array shifts. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts: submits a silent Claude composer once after the bounded render fallback; chunks large terminal.send text before provider writes; yields chunked terminal input through immediates between writes; yields while validating accepted large terminal.send text before provider writes; reveals a background terminal session when focusing its handle; replays captured launch config when focusing a background agent session; reveals background terminal sessions with the freshest PTY title; renames background terminal handles without requiring a visible tab; keeps a background terminal handle stable while reveal adoption is racing. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts: resolves tui-idle when a stale Codex prompt is followed by Antigravity readiness; returns an agent-neutral blocked wait result for update prompts; returns an agent-neutral blocked wait result for workspace trust prompts; returns an agent-neutral blocked wait result for cwd selection prompts; returns a blocked wait result for Codex model migration prompts; returns a blocked wait result for Codex startup hook review prompts; returns an agent-neutral blocked wait result for generic interactive prompts; splits text and enter writes for background terminal handles; types the lead line for %s: %s; submits through the agent-specific PTY timing policy for %s. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts: waits for exit on background terminal handles; keeps retained PTY transcript memory when controller refresh fails; resolves tui-idle from an Antigravity ready prompt preview; resolves Antigravity ready prompts with newline-heavy pasted tails without splitting; resolves live-leaf tui-idle from an Antigravity ready prompt preview. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts: spawns the available Qoder command for a captured same-session resume: %s; does not use the local Windows shell setting for remote Windows bare agent creates; matches canonical bare agent commands when a command override is configured; keeps non-bare agent command terminal creates unchanged; keeps disabled bare agent command terminal creates unchanged; injects runtime hook receiver env into terminal sessions; creates background terminal sessions for a $label; creates background terminal sessions for a $label; enables Claude Agent Teams only for direct Claude launches when configured in-process; reveals Claude Agent Teams launches with the rewritten launch config; preserves Claude Agent Teams for sequenced Claude launches. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts: creates visible terminal sessions without asking the renderer to focus a tab; asks the pty controller for the requested shell instead of a startup command; knows the agent a flagged launch command names before any process read; retires a flagged command pane identity when the command exits; retires only receipted restored PTY authority on command completion and exit; forgets synthetic handles when disconnected PTY records are pruned. src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts: returns OSC titles from headless main terminal snapshots; adopts renderer-seeded titles into headless main terminal snapshots; returns cwd metadata from seeded headless main terminal snapshots; adopts OSC7 host metadata from seeded headless terminal scrollback; falls back to the renderer snapshot for hidden-output recovery without headless state; keeps an empty headless snapshot authoritative for hidden-output recovery; advances the absolute output sequence across a daemon stream gap; emits explicit OSC 9999 agent status from runtime PTY data. src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts: falls back to the provider snapshot for a restored PTY with no mounted renderer; falls back to the available mirror when authoritative provider history is unavailable; keeps an empty renderer snapshot when the provider has no retained content; keeps restored provider history authoritative after later live output; uses provider alternate-screen state while a partial model is unsafe; prefers the tracked title over the headless emulator lastTitle; keeps the cursor-agent literal in record-fallback snapshots only without a tracker title; touches mobile snapshots once for decorative spinner ticks, again on idle. src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts: creates a same-repo PR branch override from a resolved head SHA and matching push target; skips broad remote fetch for an existing full-SHA PR base; creates a selected Bitbucket PR branch override from a matching remote branch; suffixes an existing PR when a matching push target lacks selected PR metadata; suffixes a matching push target branch when selected PR metadata has no PR number; suffixes a matching push target branch when the existing PR is different; suffixes a selected PR remote conflict when the PR lookup fails; checks out an unused runtime PR branch only when it is at the resolved head SHA; suffixes only the runtime worktree path when an exact PR branch checkout path exists. src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts: returns runtime local base update suggestions from addWorktree; creates a runtime local worktree from a usable persisted local branch base; does not create a runtime local worktree when the refresh fails and no local base ref exists; creates a branchNameOverride worktree from the selected matching remote base ref. src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts: repaints from the main-owned snapshot when main drops pending output at the cap. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts: records a mode 2031 subscribe from the raw chunk boundary without answering. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/construction/orca-runtime.test.ts, src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts, src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts, src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts, src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts. Unresolved local/computed edges remain explicit debt.", @@ -7348,7 +7295,8 @@ "Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed.", "Audit2061 (sources2059/2060): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-headless-chat-rebuild.spec'); await import('./orca-runtime-tests/mobile-session-tabs-cold-serve-hydrate.spec'); await import('./orca-runtime-tests/worktree-removal-execution-host.spec'); await import('./orca-runtime-tests/terminal-spawn-dispatch.spec'). src/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts: replaces a cwd parsed before late WSL context with the provider cwd; keeps a live WSL cwd that arrives during late-context snapshot recovery; infers local reconstructed WSL context from a WSL UNC worktree; clears stale terminal file URI hostnames after empty-host OSC7 cwd updates; serializes SSH headless OSC7 cwd as POSIX when the desktop runtime is on Windows; keeps Windows SSH OSC7 cwd as a drive path when the desktop runtime is POSIX; serializes Windows SSH headless OSC7 cwd as a drive path on POSIX desktops; infers restored SSH connection identity from app-scoped PTY ids. src/main/runtime/orca-runtime-tests/mobile-session-tabs-headless-chat-rebuild.spec.ts: survives the rebuild that closing a saved editor tab forces; keeps its place in the tab order when the host lists the workspace again; lists tabs to phones in the order desktop clients draw after a rebuild; keeps the place a window gave a chat across a graph resend before the chat is restored. src/main/runtime/orca-runtime-tests/mobile-session-tabs-cold-serve-hydrate.spec.ts: lists every persisted terminal of a windowless host after a cold restart; lists every persisted terminal in the all-worktrees inventory after a cold restart; lists persisted editor tabs beside the terminals after a cold restart; restores a persisted split group layout on the cold rebuild; restores the saved active group of a split even when it is not the first group; falls back to the active tab group when the saved active group was not restored; keeps the headless group active when there is no persisted split; keeps phone and CLI creates in the group they joined across a cold restart. src/main/runtime/orca-runtime-tests/worktree-removal-failed-retry.spec.ts: lists the leftover with its error, though Git no longer does; takes the normal delete once Git registers a checkout at the path again; joins a retry another client started while this Delete listed Git; shows the failed row with its error, not the scan cached before the delete. src/main/runtime/orca-runtime-tests/worktree-removal-execution-host.spec.ts: refuses an SSH row whose host is unreachable instead of deleting here; refuses a runtime row with no nested SSH target rather than deleting locally; refuses a runtime row that also names a nested SSH target; retains runtime purge dispatch in a recovery job; uses the runtime helper override before resuming an interrupted removal; uses the runtime helper override before retrying a failed removal; captures the watcher callback and retains its job-host receiver; reads the current runtime removal queue. src/main/runtime/orca-runtime-tests/terminal-spawn-dispatch.spec.ts: reports the spawn request before it leaves for the pty controller; reports it even when the spawn itself then fails; does not report it when the create fails before any spawn request; captures the admission method before reading the incarnation; captures the record method before evaluating its state object; skips database payload serialization when no database exists; skips a throwing database payload when no database exists; keeps the database method and receiver captured before its payload; captures the canonical map method before a binding getter changes it; completes the captured replacement fence without another map lookup. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed.", "Module layout policy correction: retire the remaining program-status-osc.spec.ts event-projection case (production/mock-derived pane-key oracle) and sign-in timeout case (real setTimeout wait with Date-only fake clocks). The runtime test registrar no longer imports that file. No replacement coverage or fresh execution is claimed for these losses; historical receipts retain their original source scope.", - "Module layout policy correction: retire the two remaining worktree-ps-agent-row-dismissal.spec.ts registrations. The remint/dismissal/exit case computed expected snapshotVersion increments from a production snapshot and used real-clock vi.waitFor; the legacy OSC case derived its expected paneKey from the production layout-owner switch. The runtime registrar no longer imports this file. These public projection scenarios have no replacement coverage or fresh execution claimed; all historical receipts and earlier loss notes retain their original source scope." + "Module layout policy correction: retire the two remaining worktree-ps-agent-row-dismissal.spec.ts registrations. The remint/dismissal/exit case computed expected snapshotVersion increments from a production snapshot and used real-clock vi.waitFor; the legacy OSC case derived its expected paneKey from the production layout-owner switch. The runtime registrar no longer imports this file. These public projection scenarios have no replacement coverage or fresh execution claimed; all historical receipts and earlier loss notes retain their original source scope.", + "Module-layout wave1 intentionally retires complete prohibited owning registrations in src/renderer/src/lib/pane-manager/pane-fit.test.ts. Lost alarms: runs the continuation when the reveal fit arrives on a different pane object; does not let a stale handle cancel its deferred replacement; resolves failure when hidden-window animation frames are withheld. No equivalent replacement coverage or pass for a reduced selector is claimed. All unrelated selectors and historical receipts retain their original scope." ], "demotionRule": "Demote or quarantine if failures are non-actionable or if a duplicate resume escape occurs outside the modeled matrix." }, @@ -7386,8 +7334,8 @@ "invariant": "For every claim-capable execution route, one provider-session identity has at most one live PTY owner and one canonical host surface across concurrent clients, retries, reconnects, and stale publications. For paired structured fresh and resume requests, the authenticated owning runtime creates in background without a renderer window; activate=true focuses the exact requested leaf only on the requesting viewer, while activate=false changes no viewer focus. A live orphan may be adopted only when the controller proves its exact handle and incarnation, its worktree and host owner match, no competing visual owner exists, and a host topology CAS wins. A viewer may classify completion only from successful host/provider inspection or explicit lifecycle evidence; transport, handle, or provider unavailability remains unknown and breaks any consecutive-idle proof. A physical exit retires that exact incarnation durably so stale client state and host restart cannot recreate it. Mixed-version routes select the unchanged legacy request before any authority side effect or execution-owner-local filesystem access.", "oracle": "Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The existing command and testFiles selector retain tests/pty-connection-completion-and-notification.test.ts; no wrapper-specific assertionRef is removed. Historical selector results do not validate its changed reachable factories. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Delete the complete pure orphan-topology suite and its file membership; preserve the other selectors from its combined command after archiving the original command string. Lost alarms are synthetic current-layout preservation, one-anchor grafting and ambiguous-anchor appending examples. Do not transfer their ownership/topology scope to sibling suites. Preserve all5 independent historical receipts exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the mocked agent-session suite and its prospective selector and aliases. Retire all3 whole dated changed-selector receipts, preserving their original raw objects in historical gaps without transferring counts or durations. Preserve5 unrelated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial agent-operation service suite retains only concurrent retry joining with changed-fingerprint conflict. Retire its complete three-title assertion object: old-owner legacy fallback before side effects, nested SSH Pi transcript refusal and completed/ambiguous physical-commit replay fences are no longer backed. Other probe/launch option/ledger/failure/remote-inventory examples disappear as detailed below. No actual provider spawn, live SSH or physical commit proof is retained by this source. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1911: The complete provider PTY-inspection mock suite is removed: missing-provider rejection, stale-PTY renderer unverifiable mapping, preserved supplied renderer failures, and supplied transport-loss mapping alarms are intentionally lost. No actual terminal teardown, daemon error or remote transport was exercised. Only the deleted explicit source tokens, testFile and whole assertionRef are removed. Meaningful remaining source selectors/assertions and unaffected dated receipts retain their original scope. No equivalent replacement, fresh reduced-gate, native/platform/provider, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Race independent clients and repeated operation IDs, then assert one physical spawn and one canonical PTY/surface; inject exit-before-reply, provider disconnect, conflicting claim scope, old daemon/relay capabilities, reused handles, stale incarnations, owner mismatch, and topology revision conflict; assert safe adoption or explicit failure without a second spawn or wrong-process attachment. Run fresh/resume with activate true/false against an isolated headed desktop host and a separate paired client, then against isolated headless serve: assert host presentation stays background, only the requesting viewer focuses the exact leaf, inactive calls preserve client/DOM focus, a same-version publication replay cannot lose focus intent, and sibling-first split publication cannot consume exact-leaf intent. Restore legacy split panes and groups beside a newer host-owned tab, preserving exact predecessor/new/successor order, output, input, resize, titles, tab/leaf identity, active group, and multi-client convergence. For completion, drive a known running agent through outer transport loss, authoritative provider rejection, reconnect, explicit stop, real exit status, and successful hook completion; assert unavailable evidence never dispatches completion and two fresh authoritative idle samples are required after the gap. After exact exit, assert terminal and tab listings omit the surface, a stale publication cannot restore it, restart cannot resurrect it, exact tokened fixture PIDs are dead, and unrelated tabs/processes survive until scoped cleanup.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session.test.ts src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/shared/claimed-agent-pty-owner.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-session-launch.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/shared/claimed-agent-pty-owner.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-session-launch.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts", "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts", "pnpm run build:cli && pnpm run build:electron-vite && node config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs", "node --check config/scripts/development/remote-session-cleanup/remote-agent-session-process-cleanup.mjs && node config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs", @@ -7416,7 +7364,6 @@ "src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-session-launch.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts", - "src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session.test.ts", "tests/e2e/remote-agent-session-focus-authority.spec.ts", "config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs", "config/scripts/development/remote-session-cleanup/remote-agent-session-process-cleanup.mjs", @@ -7498,10 +7445,6 @@ "same-epoch stale publications cannot resurrect the retired surface after reconnect" ] }, - { - "file": "src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session.test.ts", - "assertions": ["confirms only the exact handoff after its post-create list completes"] - }, { "file": "src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts", "assertions": [ @@ -7647,7 +7590,8 @@ "Audit2061 (sources2059/2060): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-headless-chat-rebuild.spec'); await import('./orca-runtime-tests/mobile-session-tabs-cold-serve-hydrate.spec'); await import('./orca-runtime-tests/worktree-removal-execution-host.spec'); await import('./orca-runtime-tests/terminal-spawn-dispatch.spec'). src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-completion-and-notification.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionSshHookStatusAuthorityTests } from '../host-ownership/pty-connection-ssh-hook-status-authority.spec'; registerPtyConnectionSshHookStatusAuthorityTests(). src/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts: replaces a cwd parsed before late WSL context with the provider cwd; keeps a live WSL cwd that arrives during late-context snapshot recovery; infers local reconstructed WSL context from a WSL UNC worktree; clears stale terminal file URI hostnames after empty-host OSC7 cwd updates; serializes SSH headless OSC7 cwd as POSIX when the desktop runtime is on Windows; keeps Windows SSH OSC7 cwd as a drive path when the desktop runtime is POSIX; serializes Windows SSH headless OSC7 cwd as a drive path on POSIX desktops; infers restored SSH connection identity from app-scoped PTY ids. src/main/runtime/orca-runtime-tests/mobile-session-tabs-headless-chat-rebuild.spec.ts: survives the rebuild that closing a saved editor tab forces; keeps its place in the tab order when the host lists the workspace again; lists tabs to phones in the order desktop clients draw after a rebuild; keeps the place a window gave a chat across a graph resend before the chat is restored. src/main/runtime/orca-runtime-tests/mobile-session-tabs-cold-serve-hydrate.spec.ts: lists every persisted terminal of a windowless host after a cold restart; lists every persisted terminal in the all-worktrees inventory after a cold restart; lists persisted editor tabs beside the terminals after a cold restart; restores a persisted split group layout on the cold rebuild; restores the saved active group of a split even when it is not the first group; falls back to the active tab group when the saved active group was not restored; keeps the headless group active when there is no persisted split; keeps phone and CLI creates in the group they joined across a cold restart. src/main/runtime/orca-runtime-tests/worktree-removal-failed-retry.spec.ts: lists the leftover with its error, though Git no longer does; takes the normal delete once Git registers a checkout at the path again; joins a retry another client started while this Delete listed Git; shows the failed row with its error, not the scan cached before the delete. src/main/runtime/orca-runtime-tests/worktree-removal-execution-host.spec.ts: refuses an SSH row whose host is unreachable instead of deleting here; refuses a runtime row with no nested SSH target rather than deleting locally; refuses a runtime row that also names a nested SSH target; retains runtime purge dispatch in a recovery job; uses the runtime helper override before resuming an interrupted removal; uses the runtime helper override before retrying a failed removal; captures the watcher callback and retains its job-host receiver; reads the current runtime removal queue. src/main/runtime/orca-runtime-tests/terminal-spawn-dispatch.spec.ts: reports the spawn request before it leaves for the pty controller; reports it even when the spawn itself then fails; does not report it when the create fails before any spawn request; captures the admission method before reading the incarnation; captures the record method before evaluating its state object; skips database payload serialization when no database exists; skips a throwing database payload when no database exists; keeps the database method and receiver captured before its payload; captures the canonical map method before a binding getter changes it; completes the captured replacement fence without another map lookup. src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-ssh-hook-status-authority.spec.ts: leaves SSH IPC OSC 9999 status ownership in the main runtime. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed.", "Module layout policy correction: retire the remaining program-status-osc.spec.ts event-projection case (production/mock-derived pane-key oracle) and sign-in timeout case (real setTimeout wait with Date-only fake clocks). The runtime test registrar no longer imports that file. No replacement coverage or fresh execution is claimed for these losses; historical receipts retain their original source scope.", "Module layout policy correction: retire the two remaining worktree-ps-agent-row-dismissal.spec.ts registrations. The remint/dismissal/exit case computed expected snapshotVersion increments from a production snapshot and used real-clock vi.waitFor; the legacy OSC case derived its expected paneKey from the production layout-owner switch. The runtime registrar no longer imports this file. These public projection scenarios have no replacement coverage or fresh execution claimed; all historical receipts and earlier loss notes retain their original source scope.", - "Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Original prospective command before removal: pnpm exec vitest run --config config/vitest.config.ts src/shared/claimed-agent-pty-owner.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-session-launch.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session.test.ts" + "Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Original prospective command before removal: pnpm exec vitest run --config config/vitest.config.ts src/shared/claimed-agent-pty-owner.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-session-launch.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session.test.ts", + "Module-layout wave1 intentionally retires complete prohibited owning registrations in src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session.test.ts. Lost alarms: confirms only the exact handoff after its post-create list completes. No equivalent replacement coverage or pass for a reduced selector is claimed. All unrelated selectors and historical receipts retain their original scope." ], "demotionRule": "Keep experimental or demote if the focused gate flakes without a product or harness bug, if a retry can physically spawn twice, if a stale exit/publication can replace or resurrect a terminal, or if mixed-version fallback occurs after an authority side effect." }, @@ -8586,13 +8530,13 @@ "providers": ["paired-runtime", "ssh"], "coveredPlatforms": ["macos", "linux"], "coveredProviders": [], - "coverageNotes": "Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2162: Reduced inventory-authority source intentionally loses the examples recorded in knownGaps; historical execution is not validation of changed bytes. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Module ownership cleanup retires the modeled cold-park private watcher/render/work-count suites under the current test policy. Their assertions are no longer active evidence. Retained lifecycle tests and headed/headless journeys do not establish equivalent coverage for those removed harness alarms. Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. deletes src/renderer/src/components/terminal-pane/terminal-cold-park-verdict-loop.test.tsx: Loses modeled React oscillation alarm; real pane/watchers are not exercised. deletes src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts: Loses delayed credit until parsing, malformed frame/unknown stream handling, discarded transformed output recovery and failed ACK rearm alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1412 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): This audit removes the browser response-after-manual-disconnect example. Its distinct in-flight response fencing alarm is lost; retained queued-call disconnect tests are not an equivalent replacement. Historical commands and results remain historical. Deterministic headed macOS runs launch an isolated Orca desktop server and a separate paired web client. A byte-identical headless run uses an isolated `orca serve` host. Both create six real paired host PTYs with bounded high-output scrollback, prove sustained output while all six client xterms are warm-mounted but hidden causes zero renderer scheduler work, then drive 180 timed real-PTY spinner frames through a second production `session.tabs.subscribeAll` transport and the real Zustand store. Each worktree must publish and apply only its exact initial-working and final-idle titles. Both topologies ordinary-park five xterms without enabling the lossy retention budget, assert bounded cells/heap/timer lag, then restore the bounded authoritative tail exactly once on the original PTY including output produced while parked and continued input/output. The headed oracle additionally keeps every remote target workspace and terminal unmounted in the host renderer before and after client recovery. Production-parity React contracts reproduce and remove the independent cold-park watcher/title feedback loop, including memo-cache discard, StrictMode cleanup replay, detached split-PTY replacement, and the zero-park fast path. A deterministic cross-boundary contract drives 24 real PTY trackers in distinct worktrees through 2,880 decorative spinner and bare-native redraw chunks and counts host publications, serialized bytes, renderer apply calls, and store mutations while preserving exact per-PTY raw chunks and per-worktree semantic transitions. Fake-clock continuation beyond the 30-minute stale boundary requires one deduplicated refresh per worktree every 15 minutes, globally spaced by at least 50 ms, with every mirrored working status still fresh. Exact-identical Pi plus rotating normalized Pi/Grok frames renew coarse working/permission state; rich prompt/tool/question fields retain their original 30-minute lease, and `stateStartedAt`/acknowledgement identity remain stable across title/hook source swaps. A separate headed desktop-client journey relaunches the host main process while retaining the daemon and a daemon-backgrounded PTY, then requires first-observation foreground sync and continued input/output on the same PTY. Unit coverage keeps layout versions out of snapshot output high-waters when a restored snapshot has no output sequence and retries an existing subscriber only after authoritative provider inventory proves the retained PTY exists. Separate headed/headless ACK-starvation tests recover one stalled stream without replacing its PTY. A headed output-drop oracle proves a successful snapshot probe cannot certify a stale live stream when the authoritative PTY sequence advanced beyond the client high-water. Unit coverage requires an unsequenced client to establish a first-probe baseline, remain attached at the same sequence, and recover only after a later probe advances. A capability-disabled run proves legacy hosts retain the prior lossy limit/TTL fallback. Unit tests cover exact-owner capability routing, raw-stream release, singleton side-effect facts with timed handoff cleanup, 64 simultaneous synthetic-title sources with zero decorative client events after convergence, per-client late-subscribe recovery, semantic bell/title transitions, local animation-frame preservation, legacy no-output-pause delivery gating with exact snapshot restore, provider-authoritative snapshots, 128 active streams plus retry after a 129th-stream capacity rejection, capacity-pressure backoff, full split-leaf remint reconciliation, truncation, and manual-disconnect queue fencing. Linux, Windows, live SSH, and production-scale paired hosts remain gaps. The audit removed the E2E parking override/debug-handle suite. Override exposure guards, delay/retention independence, TTL filtering and debug-handle forwarding alarms are lost. Retained real parking journeys do not establish equivalent test-harness configuration coverage. The test-value audit removes separate responsive-stream, intervening-control-frame and capacity-error classification examples. Retained multiplexer checks use fake clocks and captured transport callbacks; their per-stream isolation, deadline and probe-baseline assertions do not prove an actual host restart or equivalent replacement coverage. Historical run commands and results remain historical. The test-value audit removes the standalone retained/live metadata projection and additive-preference negative example from runtime-client-events.test.ts. Its remaining case checks partial-authority event admission through a captured callback; it does not establish full-pair projection, actual peer delivery or equivalent replacement coverage. Historical commands and results remain historical. The isolated accepted-handle-events observer suite is removed. Its runtime/worktree/pane membership, once-only delivery and listener-release ledger alarms are lost. Live hidden-retention evidence does not establish equivalent observer coverage. Audit1292: The entire host-session mirror empty-inventory settle suite is removed. Live-unpublished versus genuinely-empty hydration, same-ID revision response/in-flight fencing and cleared-tracking pending-probe invalidation alarms are lost. The singleton store and inventories were mocked; no real host census or resume delivery or equivalent replacement coverage is claimed. Audit1302: src/main/runtime/session-tabs-inventory-publication.test.ts: Keep actual runtime public inventory authority across renderer epochs/resync, fallback, aborts and invalid graph publishers. Remove copied nonempty publication, private scan counters/collector and known-host replacement, fake refresh that performs the restoration itself, environment capability flag, and private resume-store characterization whose fixture supplies reservation/rollback ordering. Lose isolated refresh/churn/receiver/capability and copied-payload wiring alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1346 removes the entire private-state-injected session-tabs rich-status boundary suite. Its stale task/question, neutral-title preservation, owner-change and provider-generation alarms are intentionally lost. Retained real terminal journeys do not establish equivalent replacement coverage. The prior mixed 42-contract execution receipt is historical and must not validate the reduced current selector; fresh validation remains required. Audit1352: focused Linux unit selections validated on source head b638e07d395b76af3ba6b03761a1a0fe7e5e026e. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1360: focused Linux unit selections validated on source head 415c9cffc2d10024131ec4b6721767a22195de6d. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1396: src/renderer/src/components/terminal-pane/terminal-parked-watcher-reconciliation.test.ts reduced. Retire standalone reconcile set output and positive untouchedFreshSpawn/workspaceOwner copying alarms; no native watcher execution claim. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/runtime/mobile-session-tabs-agent-status-heartbeat.test.ts reduced. Loses FIFO fairness/spacing, semantic bypass/cancellation, delayed-boundary scheduling and teardown timer-cleanup alarms. Retained fixed emission cases do not replace those outcomes. No equivalent replacement coverage is claimed.", + "coverageNotes": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. The direct side-effect-facts selector retains six cases: replay exclusion, live sequence handling, stale disposer ownership, one handoff drain, drain-before-snapshot, and stale replacement-snapshot refusal. Successful current-entry snapshot application is not witnessed by the retained snapshot case. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2162: Reduced inventory-authority source intentionally loses the examples recorded in knownGaps; historical execution is not validation of changed bytes. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Module ownership cleanup retires the modeled cold-park private watcher/render/work-count suites under the current test policy. Their assertions are no longer active evidence. Retained lifecycle tests and headed/headless journeys do not establish equivalent coverage for those removed harness alarms. Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. deletes src/renderer/src/components/terminal-pane/terminal-cold-park-verdict-loop.test.tsx: Loses modeled React oscillation alarm; real pane/watchers are not exercised. deletes src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts: Loses delayed credit until parsing, malformed frame/unknown stream handling, discarded transformed output recovery and failed ACK rearm alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1412 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): This audit removes the browser response-after-manual-disconnect example. Its distinct in-flight response fencing alarm is lost; retained queued-call disconnect tests are not an equivalent replacement. Historical commands and results remain historical. Deterministic headed macOS runs launch an isolated Orca desktop server and a separate paired web client. A byte-identical headless run uses an isolated `orca serve` host. Both create six real paired host PTYs with bounded high-output scrollback, prove sustained output while all six client xterms are warm-mounted but hidden causes zero renderer scheduler work, then drive 180 timed real-PTY spinner frames through a second production `session.tabs.subscribeAll` transport and the real Zustand store. Each worktree must publish and apply only its exact initial-working and final-idle titles. Both topologies ordinary-park five xterms without enabling the lossy retention budget, assert bounded cells/heap/timer lag, then restore the bounded authoritative tail exactly once on the original PTY including output produced while parked and continued input/output. The headed oracle additionally keeps every remote target workspace and terminal unmounted in the host renderer before and after client recovery. Production-parity React contracts reproduce and remove the independent cold-park watcher/title feedback loop, including memo-cache discard, StrictMode cleanup replay, detached split-PTY replacement, and the zero-park fast path. A deterministic cross-boundary contract drives 24 real PTY trackers in distinct worktrees through 2,880 decorative spinner and bare-native redraw chunks and counts host publications, serialized bytes, renderer apply calls, and store mutations while preserving exact per-PTY raw chunks and per-worktree semantic transitions. Fake-clock continuation beyond the 30-minute stale boundary requires one deduplicated refresh per worktree every 15 minutes, globally spaced by at least 50 ms, with every mirrored working status still fresh. Exact-identical Pi plus rotating normalized Pi/Grok frames renew coarse working/permission state; rich prompt/tool/question fields retain their original 30-minute lease, and `stateStartedAt`/acknowledgement identity remain stable across title/hook source swaps. A separate headed desktop-client journey relaunches the host main process while retaining the daemon and a daemon-backgrounded PTY, then requires first-observation foreground sync and continued input/output on the same PTY. Unit coverage keeps layout versions out of snapshot output high-waters when a restored snapshot has no output sequence and retries an existing subscriber only after authoritative provider inventory proves the retained PTY exists. Separate headed/headless ACK-starvation tests recover one stalled stream without replacing its PTY. A headed output-drop oracle proves a successful snapshot probe cannot certify a stale live stream when the authoritative PTY sequence advanced beyond the client high-water. Unit coverage requires an unsequenced client to establish a first-probe baseline, remain attached at the same sequence, and recover only after a later probe advances. A capability-disabled run proves legacy hosts retain the prior lossy limit/TTL fallback. Unit tests cover exact-owner capability routing, raw-stream release, singleton side-effect facts with timed handoff cleanup, 64 simultaneous synthetic-title sources with zero decorative client events after convergence, per-client late-subscribe recovery, semantic bell/title transitions, local animation-frame preservation, legacy no-output-pause delivery gating with exact snapshot restore, provider-authoritative snapshots, 128 active streams plus retry after a 129th-stream capacity rejection, capacity-pressure backoff, full split-leaf remint reconciliation, truncation, and manual-disconnect queue fencing. Linux, Windows, live SSH, and production-scale paired hosts remain gaps. The audit removed the E2E parking override/debug-handle suite. Override exposure guards, delay/retention independence, TTL filtering and debug-handle forwarding alarms are lost. Retained real parking journeys do not establish equivalent test-harness configuration coverage. The test-value audit removes separate responsive-stream, intervening-control-frame and capacity-error classification examples. Retained multiplexer checks use fake clocks and captured transport callbacks; their per-stream isolation, deadline and probe-baseline assertions do not prove an actual host restart or equivalent replacement coverage. Historical run commands and results remain historical. The test-value audit removes the standalone retained/live metadata projection and additive-preference negative example from runtime-client-events.test.ts. Its remaining case checks partial-authority event admission through a captured callback; it does not establish full-pair projection, actual peer delivery or equivalent replacement coverage. Historical commands and results remain historical. The isolated accepted-handle-events observer suite is removed. Its runtime/worktree/pane membership, once-only delivery and listener-release ledger alarms are lost. Live hidden-retention evidence does not establish equivalent observer coverage. Audit1292: The entire host-session mirror empty-inventory settle suite is removed. Live-unpublished versus genuinely-empty hydration, same-ID revision response/in-flight fencing and cleared-tracking pending-probe invalidation alarms are lost. The singleton store and inventories were mocked; no real host census or resume delivery or equivalent replacement coverage is claimed. Audit1302: src/main/runtime/session-tabs-inventory-publication.test.ts: Keep actual runtime public inventory authority across renderer epochs/resync, fallback, aborts and invalid graph publishers. Remove copied nonempty publication, private scan counters/collector and known-host replacement, fake refresh that performs the restoration itself, environment capability flag, and private resume-store characterization whose fixture supplies reservation/rollback ordering. Lose isolated refresh/churn/receiver/capability and copied-payload wiring alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1346 removes the entire private-state-injected session-tabs rich-status boundary suite. Its stale task/question, neutral-title preservation, owner-change and provider-generation alarms are intentionally lost. Retained real terminal journeys do not establish equivalent replacement coverage. The prior mixed 42-contract execution receipt is historical and must not validate the reduced current selector; fresh validation remains required. Audit1352: focused Linux unit selections validated on source head b638e07d395b76af3ba6b03761a1a0fe7e5e026e. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1360: focused Linux unit selections validated on source head 415c9cffc2d10024131ec4b6721767a22195de6d. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1396: src/renderer/src/components/terminal-pane/terminal-parked-watcher-reconciliation.test.ts reduced. Retire standalone reconcile set output and positive untouchedFreshSpawn/workspaceOwner copying alarms; no native watcher execution claim. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/runtime/mobile-session-tabs-agent-status-heartbeat.test.ts reduced. Loses FIFO fairness/spacing, semantic bypass/cancellation, delayed-boundary scheduling and teardown timer-cleanup alarms. Retained fixed emission cases do not replace those outcomes. No equivalent replacement coverage is claimed.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/8652", "https://github.com/stablyai/orca/pull/10625" ], "invariant": "A host advertising terminal.paired-parking.v1 keeps the PTY and bounded authoritative history alive while an ordinary hidden-view park destroys the client xterm and releases its raw per-PTY stream. Reveal must restore up to the requested 5,000 rows, parked-time side effects/output, the same PTY identity, and continued input/output. Parked watcher synchronization compares parking semantics rather than fresh object identity, owns setup and cleanup across StrictMode replay, reconciles real PTY/layout changes, and performs no terminal-state scan when nothing is parked. After a host main-process relaunch, unknown local delivery-sync state must not be treated as proof that a surviving daemon PTY is already foregrounded. An empty headed session-tab inventory is authoritative only after the current renderer graph generation publishes a complete inventory and every execution host answers the PTY census; unpublished, resync-pending, transport-failed, and partially scoped inventories remain unverifiable, while genuinely authoritative empty and non-empty inventories settle and a scope-less legacy empty keeps its pre-authority best-effort settle so outdated hosts retain agent auto-resume. The unpublished-empty regression must keep the resume dispatch parked with exactly one daemon process/writer; restoring unconditional empty hydration must release one dispatch and create two live writers. If subscription precedes provider readiness, authoritative inventory must reconsider that existing subscriber without spawning, resizing, or changing reconnect state. A snapshot without an output high-water must keep it unknown rather than borrowing a layout version that can suppress newer live output. Hosts without the capability must gate hidden raw output before xterm scheduling and repaint from the authoritative snapshot on reveal while retaining the existing limit/TTL force-parking fallback. After the first semantic title state, decorative spinner frequency must add zero paired client-event frames and zero full session-tabs work between status-freshness leases regardless of hidden worktree count. Continuous working or permission evidence may refresh each affected worktree once per 15 minutes through one globally spaced FIFO so current and legacy viewers do not decay before 30 minutes; sibling PTYs share that worktree refresh, while local title animation, raw output, and semantic title, status, bell, completion, and query facts remain intact. A paired terminal stream whose delivery credits stop progressing must replace only that stream; command silence first probes authoritative state and replaces the stream if the probe times out or proves the PTY advanced beyond the client's delivered output sequence. When no comparable delivery high-water exists, the first sequenced probe establishes a baseline and only later advancement proves staleness. A same-sequence snapshot remains valid proof of a responsive silent command. A successful status probe may replace a pre-ready shared-control socket without rejecting or duplicating calls already waiting for that transport. Manual disconnect must retain pairing while preventing queued or passive calls and subscriptions from recreating transport until explicit Connect. A paired pane reconnecting to a relaunched host that has not yet published its window graph (an unpublished frame, bare or client-projected) must stay in recovery rather than retire, and the host's first published snapshot carrying the surface must reattach it; a published frame lacking the surface still retires it. The placeholder is only ever sent before the host's graph first publishes; afterwards a worktree with no tabs gets a real empty answer, pushed once to any client that asked during startup, so a paired client opening a never-opened host worktree still gets its first terminal.", - "oracle": "Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Run one byte-identical six-terminal oracle against an isolated headed desktop host and an isolated headless `orca serve` host. Stage at least 1,000,000 xterm cells, hide all six warm managers, emit an initial working title followed by 30 timed real-PTY spinner frames and a final idle title per worktree, and observe a second real session-tabs subscription plus the production renderer store. Require exactly two transport envelopes and two title mutations per worktree, no decorative title crossing either boundary, and positive decoded-envelope bytes. Enable ordinary parking with the lossy retention budget disabled, require exactly one mounted manager and five parked tabs, at most 45% retained cells, no more than 16 MiB heap growth, and under 500 ms timer drift. In headed mode, require the host renderer to remain on its original workspace with zero target terminal managers mounted throughout client park, reveal, and live I/O. While a tab is parked, require authoritative terminal.read to observe new PTY output; reveal it and require the original PTY, a marker within the requested 5,000-row history, the parked marker, and post-reveal input/output. Drive 24 real PTY title trackers in distinct worktrees through 40 decorative spinner frames each, then 40 spinner frames alternating with Cursor's bare native identity redraw, using fake clocks. Require all 2,880 raw chunks exactly and zero host session-tabs publications, serialized bytes, renderer apply calls, and renderer store mutations. Continue decorative evidence beyond 30 minutes, require exactly one refresh per worktree per 15-minute lease through a FIFO spaced by at least 50 ms, and require all 24 viewer statuses to remain working and fresh; then require one exact semantic idle transition and one visible-output chunk per PTY. Require ordinary and interior-Braille title changes to publish. Drive 64 host PTYs through ten 80 ms synthetic title frames, require zero paired client events after the first frame per PTY while all 640 local frames remain observable, attach a late client and require one current frame per PTY, then require semantic bell and idle transitions on both clients. Reconstruct a legacy subscribed stream with no outputPause capability, hide a chatty pane, require no hidden xterm writes, reveal it, and require one authoritative snapshot plus continued live output. Drop and acknowledge output only for one original paired-client stream, prove the fixture process consumed input while the host model advanced and the client stayed stale, then require the command snapshot probe to replace that stream, repaint exact fixture output, preserve authoritative PTY identity and target-tab cardinality, and resume live I/O. For a client without a delivered sequence, require the first numeric probe to establish a baseline without replacement, a same-sequence probe to remain attached, and a later advanced probe to replace only that stream. Withhold the first encrypted shared-control ready frame, start one RPC, trigger a status-probe refresh, and require two connections, one host delivery, successful response, and zero retained request bytes. Admit 128 active streams, reject the 129th as retryable, release one stream, then require the retry to attach and publish a snapshot without multiplying retained subscribers. Disable terminal.paired-parking.v1 and require the same oracle to fail before parking, while the legacy limit-one fallback separately passes. Also preserve truncated first paint, ACK-starved same-PTY recovery, responsive silent-command snapshot probes, dead-stream probe timeout recovery, and queued manual-disconnect fencing.", + "oracle": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. The direct side-effect-facts selector retains six cases: replay exclusion, live sequence handling, stale disposer ownership, one handoff drain, drain-before-snapshot, and stale replacement-snapshot refusal. Successful current-entry snapshot application is not witnessed by the retained snapshot case. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Run one byte-identical six-terminal oracle against an isolated headed desktop host and an isolated headless `orca serve` host. Stage at least 1,000,000 xterm cells, hide all six warm managers, emit an initial working title followed by 30 timed real-PTY spinner frames and a final idle title per worktree, and observe a second real session-tabs subscription plus the production renderer store. Require exactly two transport envelopes and two title mutations per worktree, no decorative title crossing either boundary, and positive decoded-envelope bytes. Enable ordinary parking with the lossy retention budget disabled, require exactly one mounted manager and five parked tabs, at most 45% retained cells, no more than 16 MiB heap growth, and under 500 ms timer drift. In headed mode, require the host renderer to remain on its original workspace with zero target terminal managers mounted throughout client park, reveal, and live I/O. While a tab is parked, require authoritative terminal.read to observe new PTY output; reveal it and require the original PTY, a marker within the requested 5,000-row history, the parked marker, and post-reveal input/output. Drive 24 real PTY title trackers in distinct worktrees through 40 decorative spinner frames each, then 40 spinner frames alternating with Cursor's bare native identity redraw, using fake clocks. Require all 2,880 raw chunks exactly and zero host session-tabs publications, serialized bytes, renderer apply calls, and renderer store mutations. Continue decorative evidence beyond 30 minutes, require exactly one refresh per worktree per 15-minute lease through a FIFO spaced by at least 50 ms, and require all 24 viewer statuses to remain working and fresh; then require one exact semantic idle transition and one visible-output chunk per PTY. Require ordinary and interior-Braille title changes to publish. Drive 64 host PTYs through ten 80 ms synthetic title frames, require zero paired client events after the first frame per PTY while all 640 local frames remain observable, attach a late client and require one current frame per PTY, then require semantic bell and idle transitions on both clients. Reconstruct a legacy subscribed stream with no outputPause capability, hide a chatty pane, require no hidden xterm writes, reveal it, and require one authoritative snapshot plus continued live output. Drop and acknowledge output only for one original paired-client stream, prove the fixture process consumed input while the host model advanced and the client stayed stale, then require the command snapshot probe to replace that stream, repaint exact fixture output, preserve authoritative PTY identity and target-tab cardinality, and resume live I/O. For a client without a delivered sequence, require the first numeric probe to establish a baseline without replacement, a same-sequence probe to remain attached, and a later advanced probe to replace only that stream. Withhold the first encrypted shared-control ready frame, start one RPC, trigger a status-probe refresh, and require two connections, one host delivery, successful response, and zero retained request bytes. Admit 128 active streams, reject the 129th as retryable, release one stream, then require the retry to attach and publish a snapshot without multiplying retained subscribers. Disable terminal.paired-parking.v1 and require the same oracle to fail before parking, while the legacy limit-one fallback separately passes. Also preserve truncated first paint, ACK-starved same-PTY recovery, responsive silent-command snapshot probes, dead-stream probe timeout recovery, and queued manual-disconnect fencing.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-unpublished-host-graph.test.ts", "ORCA_BACKGROUND_LAUNCH=1 pnpm exec playwright test tests/e2e/paired-remote-terminal-host-quit-reconnect-input.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", @@ -8774,10 +8718,6 @@ "locally gates hidden paired output when a legacy host cannot pause it" ] }, - { - "file": "src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts", - "assertions": ["restores configured paired scrollback after an ordinary park reveal"] - }, { "file": "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-activation-inventory-fallback.test.ts", "assertions": [ @@ -8988,6 +8928,8 @@ "Keep the budget-off control, exact manager count, final bounded-tail flood marker, parked-time output, and post-reveal PTY input in both topology runs." ], "knownGaps": [ + "Audit3061 retires the park-model supplied snapshot suite and nominal mode, cursor, focus, geometry and remote resume metadata variants. Their distinct alarms are intentionally lost; six retained mode/remote cases preserve selected tail-order, authority and parse-readiness boundaries without equivalent replacement. Existing selectors and dated evidence retain their original scope. The ordinary paired-scroll-back alias was already absent before this batch and is removed as stale metadata, separately from the newly retired floating-pane example.", + "Audit3053 reduces hidden-replay coverage by retiring nominal overlap, resize, cursor metadata and standalone stalled-restore variants. Timeout, overflow, identity/generation fences and retained live-output coordination remain; the removed alarms are intentionally lost without equivalent replacement. Existing commands, assertion references and dated evidence retain their original scope.", "Audit2145 accepts removal of canned runtime metadata/guard/forwarding, fake in-memory persistence, private work-count and wrapper-duplication tests from the construction/orca-runtime.test.ts aggregate, plus the two automation run-context guards from runtime-workspace-launch-contracts.test.ts. Retained race, framing, physical completion and ownership callbacks remain byte-identical. Existing commands remain valid selectors; historical receipts stay unchanged and provide no fresh validation or replacement coverage for the reduced suites.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts: bounds host publication and renderer application across remote worktrees; globally caps decorative freshness while every working status stays fresh. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts: structural support changed only; no new authored removal credit. src/main/runtime/construction/orca-runtime.test.ts: remove only literal registration import/call pairs await import('../orca-runtime-tests/worktree-setup-and-startup.spec'), await import('../orca-runtime-tests/gitlab-and-pr-bases.spec'); no additional authored credit. tests/e2e/terminal-parked-memory.spec.ts: releases renderer terminal memory when hidden tabs park. src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts: routes tab switch and capture start by explicit page id; accepts focus on tab switch without altering bridge args (focus is main-side concern); keeps terminal cwd resolution fail-soft when the provider is unavailable. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts: drops the bounded scan cache when orphan-cleanup removal completes; clears optimistic reconcile tokens when a CLI worktree removal succeeds; emits drift without mutating when the fetched base fast-forwards created HEAD; emits base_changed without mutation when the fetched base rewrote history; skips stale-token reconciles without mutating or emitting stale status; emits unknown without mutation when fetch fails or the base ref is missing. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts: routes runtime preserved-branch force-delete through the selected WSL project runtime; replies to a waiting client with the error of a delete that fails after acceptance; treats forced runtime deletion of an already-missing unregistered worktree as cleanup; treats normal runtime deletion of an already-missing unregistered worktree as cleanup. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts: warns that a missing-repo removal only forgot the workspace; restores runtime watchers when CLI worktree deletion fails after teardown; does not re-spend the drain budget on a removal after a wedged install was abandoned; routes runtime worktree removal through the selected WSL project runtime; force-deletes a branch that was preserved by runtime worktree removal. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts: records GitLab pasted-project recents only after successful runtime lookup; threads explicit origin preference through runtime WSL PR base resolution; resolves local GitLab fork MR bases from the target project MR head ref; captures the fork MR head from a dedicated ref, not the shared FETCH_HEAD; keeps the durable MR head when the head fetch fails but the local ref resolves; routes runtime GitLab fork MR base git calls through the selected WSL project runtime. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts: passes SSH connection ids through GitLab task operations; routes runtime GitLab issue, MR, work-item, and todo actions through the selected WSL project runtime; routes runtime GitLab MR details, review-management, job, and pasted URL actions through the selected WSL project runtime; normalizes runtime GitLab issue list arguments like the desktop IPC path. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts: does not warn when setup is explicitly skipped for CLI-created worktrees; puts the agent a create starts in the first default tab, as the window does; keeps the 8s main-runtime startup readiness budget for agents without an override; gives OpenCode the 20s main-runtime startup readiness budget; launches explicit startup agents with prompts for CLI-created worktrees. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts: returns a setup launch payload for CLI-created worktrees when hooks are explicitly enabled; does not hand the window a setup main never tried to start; passes the selected Windows setup shell into runtime runner generation; follows normal setup policy for CLI-created worktrees without activating them; uses returned WSL setup shell metadata when runtime spawns setup; uses the shell-aware setup runner for windowless creates without a startup command; reports the in-process setup hook as running when nothing can launch the runner. src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts: coalesces two clients sleeping the same host worktree; stops exactly the expected live PTYs for a worktree; explains a refused workspace close instead of throwing the raw refusal enum. src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts: marks the desktop-active worktree as isActive; includes SSH-backed worktrees in the mobile worktree summary; caches repeated malformed path misses before normalizing them again. src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts: keeps title-only foreground work ahead of monitoring in another pane; keeps a local hook row while a connected PTY still backs its pane; keeps an OSC row via its connected PTY after the pane binding is cleared. src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts: resolves files through a source-visible linked-checkout worktree; marks saved session tabs with live PTYs as host sidebar activity; attributes live legacy PTYs from saved layout bindings when their panes are hidden; marks saved browser tabs as host sidebar activity like desktop; falls back to the path-keyed GitHub cache entry; includes folder workspaces in compact worktree summaries for mobile; attaches inline agent rows from the latest OSC 9999 status; projects monitoring over a title-derived working status. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts: pushes to an idle pane when the only live waiter filters out the message type; resolves a registered waiter without PTY-injecting when the leaf is already idle; keeps already-idle status after tui-idle wait for immediate message delivery; resolves message waiters when notifyMessageArrived is called; does not resolve type-filtered message waiters for unrelated message types; removes message waiter abort listeners after message arrival; resolves message waiters on timeout when no message arrives. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts: delivers pending mail via notifyMessageArrived when the recipient is already idle; does not keep retrying when every pending row was already pointed; repoints pending rows restored with a live-idle coordinator. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts: rolls back a half-created terminal whose surface never publishes. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts: rejects startup prompts for agents that require post-ready stdin; uses portable Unix quoting for mobile agent launch commands in WSL project runtimes; keeps PowerShell quoting for mobile agent launch commands in Windows host runtimes; uses cmd.exe quoting for mobile agent launch commands in local Windows host runtimes; publishes headless mobile session agent identity with synthesized PTY status; rejects disabled mobile session agent launches before spawning; validates mobile terminal insertion anchors before resolving agent launch commands. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts: coalesces a reconnect close burst onto one authoritative PTY inventory; keeps an explicit user close destructive while the PTY is live; builds mobile session agent launch commands on the runtime host; injects mobile quick-command prompts into the host-built agent startup command. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts: closes persisted headless terminal parents before any prior list call; tears down a serve-owned headless tab on close while a renderer is attached so it cannot resurrect; defers a renderer-published pending tab to the renderer instead of tearing it down; returns a delegated close outcome with no selection tombstone when the renderer owns the outcome; tears down a runtime pending shell the renderer never adopted on close. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts: materializes a plain shell when the pending tab has no launch agent; hydrates legacy persisted terminal tabs without layout entries; reads and indexes the full agent-status snapshot once per mobile projection; kills persisted SSH PTYs when closing hydrated headless tabs before pane metadata is restored; materializes hydrated pending headless terminals with the persisted session identity. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts: hydrates a persisted SSH-owned pane before an attached renderer publishes its graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts: publishes the desktop's tab name over the live agent title, and the live title without one; uses fresh neutral PTY titles over stale mobile snapshot and OSC titles; operates PTY-backed mobile session terminals without a renderer graph; reuses pane close for live PTYs that do not own a renderer tab; lists PTY-backed mobile session terminals without a renderer graph; shows and resolves active PTY-backed mobile session terminals without a renderer graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts: creates mobile session terminals for folder workspaces in a headless runtime server; spawns fresh headless SSH mobile session terminals instead of reattaching synthetic local ids; hydrates headless mobile session terminals from the host workspace session; keeps live headless mobile session terminals when a desktop renderer publishes without them; publishes laptop-created remote runtime split terminals to phone session tabs. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts: does not report headless wake degradation without sleeping records; does not wake slept agents for non-mobile session-only activation; does not rewrite unread metadata when a mobile activation finds the worktree already read; returns unread:false from worktree.ps after a mobile activation clears the flag; materializes pending mobile session terminals without focusing desktop clients; closes browser mobile session tabs when addressed by browser workspace id. src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: resolves mobile terminal surfaces by exact split leaf; closes the matching mobile terminal UUID leaf without closing the whole tab; closes the whole mobile terminal tab when addressed by parent tab id; activates the active split leaf when addressed by parent tab id; clears unread metadata on mobile worktree activation without focusing desktop clients; wakes slept agents on the host renderer when a phone activates a worktree. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts: publishes the hook provider session on a headless mobile tab so native chat can address the transcript; recovers the agent type from the hook row when the pane was launched without an agent hint; reads one agent-status snapshot per projection, not one per terminal tab; waits for unknown-launch foreground owner before publishing Pi-compatible mobile status; keeps Pi-compatible mobile session status as Pi for an unknown-launch foreground pi PTY; keeps renderer-vetted mobile agent status for custom-titled terminals. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts: publishes terminal surface agent status for paired web clients; preserves authoritative OMP identity for Pi-compatible remote terminal snapshots; normalizes a remote OMP title without republishing omitted launch identity; skips the foreground-process probe when the PTY launch agent is already known; probes the foreground process only on a status transition for unknown launch agents; passes the client signal and the slept-worktree refusal to the spawn. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts: does not use stale runtime-created PTY status when a neutral PTY title exists; recognizes runtime-created Codex PTY handles from the ready prompt; recognizes runtime-created Antigravity PTY handles from the ready prompt; recognizes live leaf Antigravity terminals from the ready prompt; recognizes a later Antigravity header with a prompt but no model line; keeps mobile terminal surfaces visible while their leaf handle is pending. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts: lets Claude agents management titles clear stale runtime-created title status; does not recognize live Claude agents panes from a Claude foreground process; does not let stale tab-level agent titles override current neutral pane titles; lists live terminals with fresh pane titles over stale tab titles; lets adopted neutral pane titles use non-shell foreground fallback; lets adopted neutral pane titles retry wrapper foregrounds until recognized; authorizes settled CLI prompts only after positive %s foreground identity; does not recognize arbitrary foreground TUIs as running agents; lets live neutral pane titles retry wrapper foregrounds until recognized; lets current Claude agents PTY titles override stale runtime-created OSC titles; does not let stale Claude agents OSC titles suppress current PTY title activity. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts: keeps preallocated terminal handles valid across renderer reloads; preserves runtime-created PTY process identity after graph unavailable; keeps prompt bindings fenced across runtime restarts without provider incarnation; recognizes runtime-created PTY handles with agent launch titles; does not treat a bare Cursor Agent native title as a running agent session; uses stale runtime-created PTY status when there is no title or foreground evidence. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts: keeps orphaned list and show writability aligned with the send gate. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts: cancels a coalesced SSH worker recovery retry when its provider disconnects. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts: retries renderer reveal before clearing an adopted legacy worker sleeping record. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts: recovers exported ORCA_TERMINAL_HANDLE from discovered live PTY sessions. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts: applies ANSI erase-from-start line controls in retained previews; applies ANSI stripping for private or intermediate CSI line controls; applies ANSI stripping for unsupported erase-line modes; reveals an agent terminal under the pane the caller reserved; keeps a fresh %s pane host-owned when a desktop window is available; keeps desktop publication %s separate from the reserved host spawn; mints its own pane when the reserved leaf is malformed, and reports the one it used; starts an agent terminal with the model the caller picked; starts an agent terminal without a model flag when no pick was made; attributes a startup-agent launch named %s as %s; attributes a fresh agent session the host builds as unknown; leaves a bare agent command the user typed out of launch attribution. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts: trims oversized terminal output bursts without per-line array shifts; builds terminal previews without mapping the full retained tail; keeps recent PTY replay output capped without needing previous data for large chunks; applies terminal redraw controls before retaining previews; applies ANSI terminal redraw controls before retaining previews; retains multi-line ANSI footer redraws instead of appending old frames; keeps the cursor column when erasing full lines in multi-line redraws; applies ANSI split redraw controls without leaking raw params. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts: returns renderer visible screen lines through terminal.read RPC JSON result; separates composer drafts from provider-owned terminal screens. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts: reports an in-flight PTY focus as not navigated when its notifier disappears; reports graph-leaf focus as not navigated without a host notifier; grounds the provider mode tracker before a later chunk, in the emulator order; grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen; waits for terminal exit and resolves with the exit status; keeps terminal read payloads bounded while retained output remains pageable; trims terminal read preview character budget without per-line array shifts. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts: submits a silent Claude composer once after the bounded render fallback; chunks large terminal.send text before provider writes; yields chunked terminal input through immediates between writes; yields while validating accepted large terminal.send text before provider writes; reveals a background terminal session when focusing its handle; replays captured launch config when focusing a background agent session; reveals background terminal sessions with the freshest PTY title; renames background terminal handles without requiring a visible tab; keeps a background terminal handle stable while reveal adoption is racing. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts: resolves tui-idle when a stale Codex prompt is followed by Antigravity readiness; returns an agent-neutral blocked wait result for update prompts; returns an agent-neutral blocked wait result for workspace trust prompts; returns an agent-neutral blocked wait result for cwd selection prompts; returns a blocked wait result for Codex model migration prompts; returns a blocked wait result for Codex startup hook review prompts; returns an agent-neutral blocked wait result for generic interactive prompts; splits text and enter writes for background terminal handles; types the lead line for %s: %s; submits through the agent-specific PTY timing policy for %s. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts: waits for exit on background terminal handles; keeps retained PTY transcript memory when controller refresh fails; resolves tui-idle from an Antigravity ready prompt preview; resolves Antigravity ready prompts with newline-heavy pasted tails without splitting; resolves live-leaf tui-idle from an Antigravity ready prompt preview. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts: spawns the available Qoder command for a captured same-session resume: %s; does not use the local Windows shell setting for remote Windows bare agent creates; matches canonical bare agent commands when a command override is configured; keeps non-bare agent command terminal creates unchanged; keeps disabled bare agent command terminal creates unchanged; injects runtime hook receiver env into terminal sessions; creates background terminal sessions for a $label; creates background terminal sessions for a $label; enables Claude Agent Teams only for direct Claude launches when configured in-process; reveals Claude Agent Teams launches with the rewritten launch config; preserves Claude Agent Teams for sequenced Claude launches. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts: creates visible terminal sessions without asking the renderer to focus a tab; asks the pty controller for the requested shell instead of a startup command; knows the agent a flagged launch command names before any process read; retires a flagged command pane identity when the command exits; retires only receipted restored PTY authority on command completion and exit; forgets synthetic handles when disconnected PTY records are pruned. src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts: returns OSC titles from headless main terminal snapshots; adopts renderer-seeded titles into headless main terminal snapshots; returns cwd metadata from seeded headless main terminal snapshots; adopts OSC7 host metadata from seeded headless terminal scrollback; falls back to the renderer snapshot for hidden-output recovery without headless state; keeps an empty headless snapshot authoritative for hidden-output recovery; advances the absolute output sequence across a daemon stream gap; emits explicit OSC 9999 agent status from runtime PTY data. src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts: falls back to the provider snapshot for a restored PTY with no mounted renderer; falls back to the available mirror when authoritative provider history is unavailable; keeps an empty renderer snapshot when the provider has no retained content; keeps restored provider history authoritative after later live output; uses provider alternate-screen state while a partial model is unsafe; prefers the tracked title over the headless emulator lastTitle; keeps the cursor-agent literal in record-fallback snapshots only without a tracker title; touches mobile snapshots once for decorative spinner ticks, again on idle. src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts: creates a same-repo PR branch override from a resolved head SHA and matching push target; skips broad remote fetch for an existing full-SHA PR base; creates a selected Bitbucket PR branch override from a matching remote branch; suffixes an existing PR when a matching push target lacks selected PR metadata; suffixes a matching push target branch when selected PR metadata has no PR number; suffixes a matching push target branch when the existing PR is different; suffixes a selected PR remote conflict when the PR lookup fails; checks out an unused runtime PR branch only when it is at the resolved head SHA; suffixes only the runtime worktree path when an exact PR branch checkout path exists. src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts: returns runtime local base update suggestions from addWorktree; creates a runtime local worktree from a usable persisted local branch base; does not create a runtime local worktree when the refresh fails and no local base ref exists; creates a branchNameOverride worktree from the selected matching remote base ref. src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts: repaints from the main-owned snapshot when main drops pending output at the cap. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts: records a mode 2031 subscribe from the raw chunk boundary without answering. src/main/persistence/worktree-sort-order-write.test.ts: re-ranks every writable row when a blocked row sits in the requested order. src/main/runtime/integrations/skill/orca-runtime-skill-recovery.test.ts: continues skill management after startup recovery fails. src/main/runtime/orchestration/mailbox/routing/orchestration-mailbox-detached-routing.spec.ts: uses bounded ownership lookup for direct arrivals while the agent cannot take input; wakes a bound Run waiter when same-Run direct mail arrives; keeps an unowned detached-recipient message in its direct mailbox; uses primary-key lookups for bounded routing updates. src/main/runtime/orchestration/mailbox/terminal-pointer/orchestration-mailbox-delivery.test.ts: remove only literal registration import/call pairs import './orchestration-mailbox-pointer-cli-command.spec'; no additional authored credit. src/main/runtime/orchestration/mailbox/terminal-pointer/orchestration-mailbox-pointer-cli-command.spec.ts: renders the %s CLI command in a mailbox pointer. src/main/runtime/rpc/methods/terminal/terminal-multiplex-link-estimate.test.ts: sizes a slow high-latency link near twice its bandwidth-delay product; never paces a LAN, even when its client parses slowly; never paces a fast link; returns to legacy windows when the path RTT jumps. src/main/runtime/rpc/methods/terminal/terminal-snapshot-scrollback-rows.test.ts: steps down the row ladder when history is over the byte budget; tries the larger first row count, then the usual ladder within the same byte budget. src/main/runtime/rpc/server/pairing/network/windows-default-route-interfaces.test.ts: returns unknown when route inspection fails or emits malformed data; does not inspect routes outside Windows. src/main/runtime/rpc/server/pairing/pairing-offer-owner-cli.test.ts: is refused to a paired %s client; reports a failed widening instead of advertising an unreachable address. src/main/runtime/rpc/terminal-multiplex-end-verdict.test.ts: reports exited only when the owning runtime completes the exit waiter; reports unverifiable when the runtime cannot observe the exit waiter; reports unverifiable when a disconnected PTY resolves with unknown liveness. src/main/runtime/session-graph/headless-runtime-graph.spec.ts: lets a session tab inventory settle on a host no renderer publishes for. src/main/runtime/session-graph/runtime-graph-standing-contracts.test.ts: remove only literal registration import/call pairs import { registerHeadlessRuntimeGraphTests } from './headless-runtime-graph.spec', registerHeadlessRuntimeGraphTests(); no additional authored credit. src/main/runtime/session-tabs/structured-conversation-tab-title.test.ts: bumps the stored snapshot version only when the title changes. src/main/runtime/session-tabs/terminal-close-observed-exit.test.ts: keeps the healthy aggregate verification and delayed physical exit behavior; uses a stamped exit for the incarnation that was actually being closed. src/main/runtime/terminal/identity/terminal-identity-probe.test.ts: answers live for a structured worker without touching the PTY graph; answers live for a PTY handle the runtime still holds; runs the full leaf check for a handle with no live PTY; answers not-live for a stale handle; propagates \"could not look\" rather than reporting it as a dead handle. src/main/runtime/terminal/layout/paired-desktop-server-writes-layout-owner.test.ts: names the tab in main’s layout through terminal.rename; takes a window-style layout.apply close as already stopped, so the terminal runs on. src/main/runtime/terminal/lifecycle/pty-lifecycle-generation-retention.test.ts: retains no lifecycle generation after a spawn/exit cycle. src/main/runtime/terminal/lifecycle/run-terminal-user-open.test.ts: reads a freshly spawned terminal as used once a user opens its tab, not on a probe; keeps the open mark on the process a user open starts. src/main/runtime/terminal/surface/terminal-surface-replies-window.test.ts: from a desktop window that mounts both panes; from a server with no window. src/main/runtime/terminal/surface/workspace-layout-projection.test.ts: carries views for a partition that holds none yet. src/main/runtime/terminal/view/terminal-subscribe-exit-waiter-leak.test.ts: releases a signalled exit-waiter when the signal aborts. src/main/runtime/terminal/wait/orca-runtime-exact-worker-provider-session.test.ts: selects a local hook status for a local pane. src/main/runtime/terminal/wait/prime-agent-screen-readiness-transcripts.test.ts: keeps the footer and the bare caret on screen mid-turn; %s: the screen alone reads ready during %s. src/main/runtime/workspaces/startup/runtime-worktree-agent-startup.test.ts: uses per-launch arguments and preserves launch telemetry; attributes a startup agent whose caller named no surface as unknown; launches %s bare for an absent or blank prompt; attributes a %s draft launch named %s as %s; merges an automation's extras over the host defaults; threads worktree-create extras into the startup build; returns an enabled requested agent without detecting; returns the default when nothing was requested; detects instead of using the default when the requested agent is disabled; starts no agent when the default is blank; detects an enabled agent on this host when nothing usable was named; starts no agent when detection finds none. src/main/runtime/workspaces/startup/runtime-worktree-startup-readiness.test.ts: pastes and submits through composer readiness, never typing raw input; types the follow-up on WSL or SSH-to-Windows once the agent is in front, as before; cleans up the deadline when the composer was already captured; a draft that is not submitted is pasted on the box cursor, as before; takes the box after the grace when the row never comes, whatever repaints; takes the box at the deadline when the grace would outlast the budget; lets a dialog on screen veto a grace; refuses the deadline inside a pending grace while a shell is in front; takes the box at the deadline inside a pending grace with the agent in front; takes the box at the deadline after a refused grace once the agent is in front. src/main/skills/skill-install-transaction.test.ts: installs, previews unchanged bytes, and updates a clean receipt-owned skill; preserves the old version after a %s filesystem failure. src/main/speech/model-manager-download-resume.test.ts: requests the remaining bytes when a clean range response ends before the file total; bounds a server that advances by pathologically tiny segments forever. src/main/ssh/config/ssh-config-parser.test.ts: parses a basic host block; parses multiple host blocks; skips wildcard-only Host entries; skips Host entries with only pattern characters; parses IdentityFile with ~ expansion; parses Windows-style IdentityFile with ~ expansion; parses quoted scalar values like OpenSSH; parses equals-form scalar directives; parses IdentityAgent with ~ expansion; parses IdentitiesOnly; parses GSSAPIAuthentication; keeps the first GSSAPIAuthentication value like OpenSSH; parses ProxyCommand, ProxyUseFdpass, and ProxyJump; ignores comments and blank lines; handles case-insensitive keywords; stops current block on Match directive; returns empty array for empty input; creates one parsed host per concrete alias on a multi-pattern Host line; applies identity agent settings to every concrete alias on a multi-pattern Host line; defaults port to 22 for invalid port values; converts hosts to SshTarget objects; uses host alias as hostname when HostName is missing; skips hosts that are already imported; defaults username to empty string when not specified; carries through identityFile, identityAgent, identitiesOnly, proxyCommand, and jumpHost; carries through gssapiAuthentication; imports duplicate aliases only once and keeps the first concrete host; maps hosts for the picker and flags aliases already in Orca; de-dupes aliases and defaults missing fields; parses hostname, user, port from ssh -G output; collects multiple identity files; parses forwardagent yes; defaults port to 22 when missing; returns empty hostname when missing; returns undefined user when missing; handles empty output; skips lines without spaces; parses proxycommand and filters \"none\"; parses proxyusefdpass yes; parses proxyjump and filters \"none\"; handles ~ expansion in identity file paths; handles Windows-style ~ expansion in identity file paths; parses identityagent with ~ expansion; preserves identityagent none so auth can disable agent fallback; parses identitiesonly yes; parses gssapiauthentication; parses controlmaster options and filters controlpath none. src/main/ssh/config/ssh-known-hosts-source.test.ts: splits the space-separated list ssh -G prints on one line; expands ~ in a reported path; keeps a double-quoted path containing spaces whole; falls back to the default files when ssh -G reported nothing; drops an explicit none without falling back to the defaults; splits both known_hosts lists on one line each; reads StrictHostKeyChecking, including accept-new; reads HostKeyAlias and prefers it for the lookup; reads the non-default port; reports that the lookup came from an alias, so the port is not appended; reports no alias when the dialed host is used; unions the entries of every file; skips a path that is a directory; returns nothing when no file can be read; reports nothing unreadable when every file parses; does not count an empty file as unreadable; prefers HostKeyAlias over the resolved hostname; uses the dialed host, because a resolved hostname can just echo the label; still prefers an explicit HostKeyAlias over the dialed host; falls back to the dialed host when nothing was resolved; is rejoined when the split fragments resolve to nothing; leaves a single unresolvable path alone rather than inventing one; expands the __PROGRAMDATA__ token rather than passing it through as a path; does not rewrite a path that merely BEGINS with the token characters; keeps a drive-letter path with mixed separators intact; splits a spaced Windows home into the fragments the rejoin has to put back. src/main/ssh/config/ssh-known-hosts.test.ts: reads the algorithm from the blob rather than trusting the line; rejects %s; refuses a malformed blob: %s; uses the bare host on the default port; tries the bracketed form first and falls back to bare off-port; matches an exact line; matches case-insensitively; reports a changed key of the same type; reports unknown for %s; matches any host in a comma list; matches the bracketed form on its port; does not apply a bracketed entry to the default port; falls back to a bare line when off-port; never reports a change from the fallback pass; matches a bare literal on the default port; matches a bracketed literal on its port; reports a change for a literal; handles %s; still reports a change for a different key on a revoked host; skips a line carrying an unrecognised marker; does not report a change when only another key type is on file; matches within the same type; accepts CRLF terminators; skips blanks, comments and surrounding whitespace; accepts a hit regardless of which file holds it (%s); never brackets the alias, whatever the port; still brackets an ordinary host on a non-default port; matches a bare alias entry on a non-default port; still accepts the unmodified key field; accepts a hashed entry whose salt is a full SHA1 digest; still accepts the unmutated ssh-keygen -H vector; falls back to the bare host line on a non-default port, as ssh did; refuses a key type it has not seen for a host it knows, as ssh did. src/main/ssh/connection/ssh-connect-config.test.ts: returns undefined when no default keys exist; returns the first existing key file; probes regular and FIDO2 keys in stable default order; keeps a regular default ahead of a malformed FIDO2 default; uses target host/port/username; falls back to resolved config when target fields are empty; keeps imported endpoint fields as the fallback when ssh -G is unavailable; sets readyTimeout to CONNECT_TIMEOUT_MS; sets keepaliveInterval to 15s; enables keyboard-interactive auth so MFA challenges can be answered; uses agent auth when no explicit key and SSH_AUTH_SOCK is set; enables agent forwarding when OpenSSH config requests it and an agent is available; does not enable agent forwarding without a usable agent; resolves IdentityAgent SSH_AUTH_SOCK from the environment; uses the Windows OpenSSH agent pipe when no environment socket is available on Windows; wraps agent auth with IdentityFile filtering when IdentitiesOnly is enabled; applies a manual target IdentitiesOnly setting when ssh -G reports it off; includes unencrypted target.identityFile auth when an agent is available; defers encrypted target.identityFile auth when an agent is available; uses keyFile auth when target.identityFile is set and no agent is available; includes unencrypted resolved identityFile auth when an agent is available; defers a default-path resolved identityFile to the no-agent retry; offers the keyboard-interactive challenge when the agent defers no key; provides fallback key when no agent is available; can force private key inclusion for the post-agent fallback path; falls back to resolved proxyCommand; returns structured jump-host config for target.jumpHost; returns structured jump-host config for resolved proxyJump; returns undefined when no proxy is configured. src/main/ssh/connection/ssh-connection-auth-fallback.test.ts: resolves OpenSSH config using configHost when present; tries ssh-agent before reading an explicit private key; falls back to direct private key auth when agent auth fails; falls back to direct private key auth after too many agent authentication failures; answers bounded keyboard-interactive challenges such as Duo 2FA. src/main/ssh/connection/ssh-connection-store.test.ts: lists picker suppression aliases without consulting re-adoption tombstones; getTarget delegates to store; addTarget generates an id and persists; saves the CLI control switch as given, with no consent stamp; addTarget stamps source as manual by default; addTarget preserves an explicitly provided source; inserts a new config host stamped as ssh-config; asks the parser for all hosts — reconciliation happens in the store; updates an existing config-sourced target when the port changed; refreshes gssapiAuthentication on sync; never overwrites a manual target that owns the alias; does not rewrite an unchanged config-sourced target; returns empty array when nothing changed; tombstones a deleted config-sourced host so re-import skips it; suppresses a deleted manual target from config discovery; re-adding a deleted host reclaims its alias so sync stops suppressing it; editing a target reclaims its alias from the deleted set; records a tombstone when removing any user-facing target; re-adopts orphaned repos when the same host is re-added. src/main/ssh/connection/ssh-connection.test.ts: transitions to connected on successful connect; captures the negotiated SSH server key fingerprint; allows concurrent exec commands for ssh2 transport; removes startup listeners after ssh2 connect succeeds; scopes lifecycle events and pending handshake timers to one mock client; enables TCP_NODELAY on the new ssh2 client after a reconnect cycle; transitions through connecting → connected states; reports error state on connection failure; disconnect cleans up and sets state to disconnected; getTarget returns a copy of the target; getState returns a copy of the state; throws when connecting a disposed connection. src/main/ssh/orcad-migration-stuck-host-profiles.test.ts: never leaves a running terminal behind; is offered only when leaving saved state behind would clear the refusal. src/main/ssh/orcad-runtime-maintenance.test.ts: keeps a connect from retrying a build an explicit Update also failed; offers Force when Update was refused by policy; forwards anew after an activation, since the new slot may bind another port; passes a refusal through and leaves the server linked; forwards anew once a serving slot is restored, which may have bound another port. src/main/ssh/port-forwarding/ssh-port-forward.test.ts: reports the port the OS bound when an ssh2 forward asks for port 0; adds an ssh2 port forward and returns entry; adds a system SSH port forward when no ssh2 client is available; reports the port a system SSH forward resolved when asked for port 0; passes resolved OpenSSH config to system SSH port forwards; disposes a system SSH tunnel when removing the forward; lists forwards filtered by connectionId; removes a forward by id; awaits forward close when removing a forward for user actions; returns null when removing nonexistent forward; removes all forwards for a connection; dispose removes all forwards; stores label in the entry; preserves the existing id when updating a forward succeeds. src/main/ssh/ssh-channel-multiplexer.test.ts: sends a JSON-RPC request and resolves on response; assigns unique request IDs; sends notifications without expecting a response; dispatches incoming notifications to handler; sends one keepalive frame per cadence tick; drives keepalive sends AND dead-link detection from a single interval; resolves false immediately on a disposed mux; throws on request after dispose; reports isDisposed correctly; clears registered handlers on dispose; does not retain handlers registered after dispose. src/main/ssh/system-transport/system-ssh-forward-process.test.ts: spawns exactly the argv the orphan matcher is given, LogLevel=INFO included; runs port forwards unmultiplexed even when ssh_config disables muxing; preserves manual target port and identity options in the forwarded ssh command; does not spawn ssh when the requested local forward port is already in use; spawns ssh after the requested local forward port preflight succeeds; resolves startup after the grace period when ssh keeps running; sends SIGTERM then SIGKILL when the process does not exit; does not resolve stop until the process exits. src/main/ssh/system-transport/system-ssh-loopback-route.test.ts: dials the held forward ahead of the alias so OpenSSH keeps these over ssh_config; drops a manual target's own port and proxies, which would fight the route; never routes a forward, whose argv must stay stable for orphan recovery; %s → %s; opens the forward over the real proxy, then proves a login over the route; lands the forward on the sshd and known_hosts name the direct route resolved; holds the forward with server-alive probes; never lets the background forward or probe ask for credentials; starts no forward when admission refuses the route; stops the forward when sshd refuses logins over it; stops the whole forward process tree on Windows, once; reports a forward that already exited before anyone listened for it. src/main/startup/browser-process-user-agent-ordering.test.ts: explains admission refusal before a desktop launch exits; explains an orcad holding the profile instead of exiting silently; does not acquire profile admission for a duplicate launch; executes after the dev app name and before later preflight work; exits and releases admission after pending profile move recovery fails; keeps Linux background startup failures console-only and immediate; keeps Linux serve startup failures console-only and immediate. src/main/startup/quit/quit-path-durable-write-blocking.test.ts: store.flushAsync() issues no synchronous fs syscalls; store.flushAsync() also moves the active-view and github-cache sidecars off the thread; stats.flushAsync() issues no synchronous fs syscalls; Grok session cleanup issues no synchronous fs syscalls; stats.flushAsync() closes out live agents before it returns, not when its write lands; a stalled mount leaves the event loop live instead of parking it; store.flushAsync() is one idempotent final barrier; store.flushAsync() resolves instead of throwing when the profile mount rejects writes. src/main/stats/agent-session-transition-recorder.test.ts: counts a hook-only agent that never writes an agent-shaped terminal title; never opens a session from a replayed or disk-restored working status; still closes a live session when the terminating status arrives as a replay; counts one session per turn across repeated working/done cycles; closes an open session when its pane is torn down; bounds the mirror and closes what it evicts; stops the session when the main agent settles and only a watch loop holds the row working; keeps the session open while a subagent outlives the main agent, and closes it when the child settles; dates the stop by the evidence when a shell outlives the last subagent; opens a new session dated by the observation when the main agent resumes after monitoring; never dates a reopen before the close a fact-less OSC repaint caused; dates the first live row after a restored one by the evidence, not the restored clock; treats an unchanged answer as a snapshot, never a transition; opens only on a live working edge; closes only a session it opened. src/main/text-generation/commit-message-text-generation-model-discovery.test.ts: returns static catalog models without spawning for static agents; discovers dynamic models through the agent CLI; discovers dynamic models through the configured agent command override; falls back to static models when dynamic discovery returns no parseable models; falls back to the first discovered non-Pi model when its static default is unavailable. src/main/text-generation/pull-request-context.test.ts: does not fetch unrelated fork remotes before generating PR context; bounds exact remote-ref probe concurrency for a large remote list; reports no branch change because PR context preparation is read-only; keeps a remote-qualified base when the selected base includes the remote. src/main/text-generation/source-control-local-process.test.ts: asks the supervisor to stop and leaves its group to it; signals nothing once the supervisor has exited; stops an agent that ignores its stdin end through its supervisor. src/main/updater/linux-package/linux-package-update-recovery.test.ts: retains the downloaded package with the digest from the event metadata; requires a string downloaded path; accepts an uppercase extension; requires a non-empty string version; matches an absolute file URL by basename; accepts duplicate entries that agree on the digest; refuses an entry with a missing or non-string digest; refuses a digest that is not base64 at all; refuses a malformed percent-encoded URL; refuses a missing or non-array file list; tolerates a non-object event; replaces the retained artifact with a newer download; keeps the retained artifact when a new download has no usable digest; keeps the retained artifact when an unrelated download event arrives; clears the retained artifact; preserves the artifact across a recheck of the same version; clears the artifact when another version takes over; preserves the artifact for an unknown or empty version; is a no-op without a retained artifact; returns the built command and package file name for a verified package; reports missing without a retained artifact; propagates a package-manager discovery failure; rejects a well-formed digest that belongs to another file; never hashes a package that a malformed digest failed to arm; rejects a path outside the cache root; rejects the cache root itself; rejects a package in the updater directory itself; rejects a pending directory that is a symlink out of the cache; performs one hash pass for concurrent requests; revalidates once the in-flight pass settles; does not reuse an in-flight pass for a different artifact; starts a fresh proof when the same package is captured again; returns the verified package path; returns missing without a retained artifact. src/main/updater/releases/updater-prerelease-feed-readiness.test.ts: accepts a GitHub %s asset redirect as ready; reports a GitHub asset request error as unavailable; reports not-ready with a verified last-good tag when the newest assets are unavailable; does not classify a non-positive tag limit as feed unavailability; reproduces the v1.4.142 publishing incident as not-ready; reports transport failures as unavailable instead of not-ready; treats an explicit asset 404 as not-ready when another asset is unavailable; accepts absolute manifest asset URLs without rewriting them to release asset paths; returns not-ready with an older ready update as last-good while newest is publishing. src/main/updater/releases/updater-release-builds.test.ts: lists hourly builds from the dedicated repo, newest first; lists daily builds from the dedicated repo, newest first; separates stable from rc in the shared main repo; skips drafts and unparseable tags; keeps a composed release title and drops one that repeats the tag; hides builds that published no artifact for this platform; returns an empty list when no build has this platform artifact; keeps mac builds visible on macOS regardless of the Windows leg; resolves the platform installer download url; leaves the installer url null when the release published no installer; tolerates a release whose assets are missing or malformed; sends the local gh token as a bearer header when one is available; sends no authorization header when gh has no token; retries unauthenticated once when GitHub rejects the token; does not retry a 401 that was already unauthenticated; falls back to the per-IP bucket when the token is rate limited and tells the gh breaker; reports a secondary limit carrying retry-after without retrying or tripping the breaker; records a primary limit in the token scope %s; keeps %s authenticated when only %s is blocked; skips the token while its scope %s is blocked; surfaces a rate limit with its reset time and a sign-in hint when unauthenticated; omits the sign-in hint when the rate-limited request was authenticated; treats 429 as a rate limit; reports a 403 without rate-limit headers as a plain HTTP error; reports a missing hourly repo distinctly; is null when GitHub sent no reset; prefers retry-after over the primary reset epoch; falls back to the primary reset epoch when there is no retry-after; reads retry-after as seconds; reads retry-after as an HTTP date; pins an hourly tag at the hourly repo download path; pins a daily tag at the daily repo download path; pins a stable tag at the main repo download path; rejects a tag that is not a version. src/main/updater/updater.build-channel-selection.test.ts: uses the display label in the unsupported-platform %s pinned-build error; still pins %s from an unsigned Windows dev build; restores ordinary release checks after local build selection fails; opts into the RC channel when checkForUpdatesFromMenu is called with includePrerelease; pins the generic feed to a perf-tagged prerelease when requested; surfaces no-update feedback when no newer perf-tagged prerelease exists; keeps prerelease publishing-window misses on the generic retry path; leaves the feed URL alone for a normal user-initiated check. src/main/updater/updater.check-preflight.test.ts: ignores a stale update-not-available event after a new check starts preflight; deduplicates repeated manual checks while the immediate checking status is active. src/main/updater/updater.prerelease-fallback.test.ts: retries a prerelease check once against the previous feed tag when the manifest is missing; surfaces a promise-only prerelease fallback failure after the primary error event. src/main/updater/updater.publishing-window-feed.test.ts: repins the generic feed to the newest RC tag for a prerelease user; repins the generic feed to a newer stable tag for a prerelease user; pins a stable fallback when Atom has no newer prerelease; uses last-good concrete feed when a user-initiated check lands during publishing; can offer an older fully published update while the newest release is publishing; keeps background publishing-window fallback on the short retry cadence. src/main/updater/updater.quit-and-install.test.ts: surfaces an accepted retry before electron-updater emits download progress; defers quitAndInstall and runs its launcher within the launch PATH scope; runs pre-quit cleanup before local PTY cleanup during update install; keeps optional pre-quit cleanup fail-and-continue behavior by default; ignores duplicate quitAndInstall requests while the shared delay is pending; arms the forced-exit watchdog once the install commits; disarms the forced-exit watchdog when sync install error recovery keeps the app open. src/main/window/createMainWindow-markdown-editor-focus.test.ts: ignores traffic light sync IPC on non-macOS; still intercepts Cmd+Shift+B and Cmd+Alt+B when the markdown editor is focused; coerces non-boolean setMarkdownEditorFocused payloads to false; opens a table-aware context menu synchronously without a renderer query; builds the plain edit menu for the one right-click the renderer marks as plain text. src/main/window/createMainWindow-renderer-crash-recovery.test.ts: notifies the caller when the renderer process is gone; passes the renderer webContents id through crash recording and recovery callbacks; forwards expected renderer teardowns so the recorder can diagnose suppression; reloads the app shell after an unexpected renderer process loss; does not reload after renderer loss when recovery is disabled; stops auto-reloading after a rapid renderer crash loop trips the breaker. src/main/window/dashboard-popout-window.test.ts: updates the title after language initialization and unsubscribes when closed; lets its preload expose saved WSL hosts in serve-only, and passes nothing otherwise; creates a native-frame window with the shared preload and no webview surface; shows the window on ready-to-show; loads the prod file entry; loads the dev server URL when in dev; focuses the existing window instead of creating a second one; trusts only the live popout webContents; restores a minimized window when re-requested; restores valid persisted bounds; discards off-screen persisted bounds and falls back to defaults; persists bounds on resize after the debounce, guarding near-minimum sizes; keeps saving bounds after a vetoed quit and freezes them only on an allowed quit; closeDashboardPopout closes an open window; applies the persisted app zoom level on dom-ready; follows app zoom changes while open and unsubscribes on close; zoomDashboardPopoutIfFocused steps the popout zoom only while focused; handles the zoom-in chord via before-input-event and ignores other keys; handles mouse-wheel zoom requests outside before-input-event; respects zoom keybinding overrides for keyboard and mouse-wheel paths. src/main/window/dropped-path-preparation.test.ts: opens and stores each unique source once as drop size grows tenfold; passes ordinary paths without copying for %s; preserves ordinary successes and copied successes when another file fails; serializes copy requests from different owners; reports all lost paths without a shared reason when their failures differ. src/main/window/main-window-updater-deferred-setup.test.ts: releases all 64 completed fallback handles without repeating initialization; keeps setup after ready-to-show and releases its fallback afterward; preserves the 15-second fallback when first paint never arrives; preserves destroyed-window guard reads before and at the fallback deadline; keeps the exact %s error and releases its completed fallback; keeps the exact fallback %s error without retrying initialization; preserves pending manual setup after failed ready registration; keeps setup options, live store reads, nudge writes and required quit flush. src/main/worker-threads/worker-thread-request-queue.test.ts: posts one request at a time and in the order it was dispatched; fires a posted call at its own deadline; stops respawning and fails the rest of the queue once deaths hit the cap; clears the death count when a fresh burst starts from full idle. src/main/workspace-hooks/hooks-setup-runner-script.test.ts: builds Windows runners for newline-heavy scripts without line-array splitting; builds POSIX runners without regex-wide CRLF normalization; writes POSIX setup runners for shebang-declared scripts on native Windows paths; keeps batch setup scripts on cmd.exe when the terminal is Git Bash; hands a Git Bash pane a launch command MSYS cannot rewrite for a cmd runner; replays interpreter flags declared on the shebang line; preserves cmd.exe setup runner semantics for configured cmd users; keeps POSIX runner behavior on POSIX platforms; waits when either local or project policy requires completed setup; marks setup-runner terminals for the always-on credential guard; maps git-bash to POSIX setup launch metadata on Windows; falls back to the cmd runner when the git-bash setting has no installed Git Bash; keeps the cmd runner for a non-Git bash such as Cygwin; keeps the cmd runner for a bare bash whose flavor cannot be resolved; uses the POSIX runner for a bare bash that resolves to Git Bash; uses the POSIX runner for an extension-less Git Bash path; preserves the existing cmd runner for PowerShell terminals; preserves cmd setup compatibility when a Windows-host project has a WSL shell setting; classifies an installed explicit Git Bash executable as a POSIX runner; falls back to the cmd runner when the explicit Git Bash path no longer exists. src/main/workspaces/catalog/repo-git-remote-identity-enrichment.test.ts: schedules remote identity enrichment without blocking the caller; probes a drive project whose runtime is WSL %s; sweeps a local repo: %s; probes an SSH row that carries only executionHostId on its own host; keeps same-path rows on two different SSH hosts from sharing one backoff; coalesces concurrent probes for the same repo location; caches no-identity probes briefly so list calls do not retry every time; does not rewrite the no-remote marker on a later retry; resolves a settled no-remote repo once it gains a remote; does not re-probe a resolved identity before the refresh window elapses; re-probes a resolved identity after the refresh window elapses; bounds re-probes per sweep so a large repo list drains gradually; forgets a removed repo location so its deadline cannot outlive the repo; keeps a surviving repo backoff when a sibling repo is removed; probes again when the same location is re-added after its probe was retired; coalesces concurrent sweeps instead of running one pass per list call. src/main/workspaces/creation/preparation/worktree-create-preparation.test.ts: preserves create priority through claim probes on %s; starts the checkout only once the async workspace root resolves; still deduplicates when both callers await the same pending root lookup; namespaces native Windows preparation directories for long paths; deduplicates preparation for the same repo, base, runtime, and workspace root; does not spend a divergence walk when the base matches exactly; claims when the two sides spell the same ref differently; evicts a repo's own stale preparation before another repo's; still discards armed checkouts when the project runtime needs repair; routes preparation and finalization through the selected WSL runtime; retries stale cleanup after a transient listing failure; does not discard a detached worktree with caller-controlled preparation metadata; does not re-arm after an isolated create; re-arms a preparation once creates arrive in a burst; holds the re-arm checkout until the create runs the deferred thunk; starts one explicit prefetch after the create completes; does not re-arm when finalization failed; reports a pending create while a stale-cleanup scan is running. src/main/workspaces/removal/local-worktree-removal-recovery.test.ts: recovers Git for Windows partial filesystem deletion failures; finishes a clean non-force deletion after Git leaves a Windows directory behind; recovers localized Windows failures after Git already removed the registration; does not recover unrelated localized failures while Git still owns the row; finishes a macOS deletion Git deregistered before failing with Directory not empty; leaves an orphaned checkout to the orphan cleanup instead of deleting it; prunes and strictly verifies on the selected WSL host without deleting files or branches. src/main/workspaces/removal/worktree-removal-safety.test.ts: rejects deleting a worktree that contains another registered worktree; rejects POSIX home directories even when host homedir has a different path shape; refuses a home the host reported even when no path rule recognises it; refuses the Windows host's home directory from a POSIX client; refuses the Windows host's home directory even when the host reported nothing. src/main/wsl/discovery/distro-catalog.test.ts: retries asynchronous discovery after a transient wsl.exe failure; retries synchronous discovery after a transient wsl.exe failure; retries asynchronous discovery after wsl.exe reports no distros yet; retries synchronous discovery after wsl.exe reports no distros yet; bounds the wsl.exe spawn rate while no distros are installed; bounds the asynchronous spawn rate while no distros are installed; still caches a non-empty distro list for the process lifetime; re-probes a docker-desktop-only machine once a user distro can appear; backs off while the list keeps coming back empty; backs off after repeated distro-list failures; caps the empty-list backoff at five minutes; keeps reporting an empty result after it goes stale; keeps reporting a known distro list indefinitely; bounds cached homes while retaining the most recently used distros; still lists distros, and an excluded distro home probe fails like any other probe; gives the async home probe time for a cold boot instead of killing it at 5 s; retries availability after a probe timeout instead of latching false; bounds the probe rate while the failure window is open; caches a successful probe for the process lifetime; names an explicit spawn directory, so no deleted cwd can read as ENOENT; shares one wsl.exe spawn between concurrent probes; keeps reporting the last observed answer after it goes stale; holds a definitive failure far longer than a timeout when %s; backs off after repeated probe failures; re-probes a seeded retryable failure once its window lapses; re-probes availability once a distro list succeeds after %s; does not drop an availability failure for an empty distro list; keeps reporting unavailable off Windows without probing. src/main/wsl/discovery/wsl-distro-holder.test.ts: runs a busybox-safe loop through --exec and names the distro; spawns a detached-style holder, records it, and waits for the distro to run; a holder exiting with code 1 notes its distro may have stopped (E9); rejects a pid whose command line is not our holder for that distro; cleans up stale and corrupt records; keeps a holder and its record when release cannot verify it; reports unverifiable when the command line is unreadable even with a matching pid; release kills a verified holder and removes its record; release never kills a pid that is no longer our holder; reports a spawned holder exit so liveness can re-check. src/main/wsl/filesystem/wsl-guest-drive-mountinfo.test.ts: skips 9p shares that are not drvfs, and malformed lines. src/main/wsl/orcad/wsl-orcad-deploy-app-update.test.ts: plans the update on the census the running orcad reports, not an unknown one; forwards force to the update planner; does not serve the incumbent past a refusal that is not a wait; does not re-activate the build this host rolled back from; labels the launch with the build the adoption found serving, not the stale record; defers while another run holds the host fence; lets an explicit force deploy past both skips; names a newer host refusal apart from a rolled-back one, so only Force is offered; updates an older host as before, without asking to adopt it; never asks the incumbent when it already runs this build. src/renderer/src/components/agent/agent-launch-picker-acquisition.test.ts: keeps a completed listing usable when the host rejects the wait parameter. src/renderer/src/components/feature-tips/feature-tip-telemetry.test.ts: delivers to chat-default users in all targeting while holding out not-switched users. src/renderer/src/components/native-chat/composer/pickers/use-native-chat-side-chat-command.test.ts: completes the row on a pick, even when the command is already typed; ignores a pick of the row while side chats are unavailable. src/renderer/src/components/native-chat/media/images/native-chat-image-copy.test.ts: explains a too-large refusal that arrives through the IPC error prefix. src/renderer/src/components/native-chat/messages/actions/native-chat-fork-launch.test.ts: keeps the question with the caller and says once that it never went; tells the user to check the side chat when delivery is unconfirmed; reports a delivered question as sent, silently. src/renderer/src/components/native-chat/messages/actions/native-chat-side-chat-fork-point.test.ts: decides each of %i tool-only turns once per layout, and nothing without a listener. src/renderer/src/components/native-chat/messages/actions/use-native-chat-fork.test.tsx: places a side chat whose question was %s: %o. src/renderer/src/components/terminal-pane/provider-notices/agent-presence/agent-terminal-presence.test.ts: calls back once for %s; stops watching once unsubscribed. src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-deferred-input-forwarding.spec.ts: routes terminal input through deferPtyInput so the host can withhold it; forwards terminal input directly when the host supplies no deferPtyInput. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts: forwards onBell to pane attention and notification policy; hands the bell to the attention module with its pane even when pane attention is off. src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts: retries a fresh-spawn native follow reset when renderer dimensions return. src/renderer/src/components/terminal-pane/pty-connection/spawn/unbound-pane-spawn-recovery.test.ts: requests a tab remount for an unbound spawn; leaves recovery to a remote transport that armed its own retry; requests a remount when the transport reports no recovery of its own; settles the spawn as failed before requesting a remount; prefers the restored leaf id when reporting the anomaly; falls back to the pane leaf id when no restored leaf exists. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-foreground-agent.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionDeferredInputForwardingTests } from '../input/pty-connection-deferred-input-forwarding.spec', registerPtyConnectionDeferredInputForwardingTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionFreshNativeFollowResetTests } from '../output/pty-connection-fresh-native-follow-reset.spec', registerPtyConnectionFreshNativeFollowResetTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionTerminalBellAttentionTests } from '../notifications/pty-connection-terminal-bell-attention.spec', registerPtyConnectionTerminalBellAttentionTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-transport/delivery/pty-dispatcher-delivery-interest.test.ts: registers interest on the first sidecar and releases on the last unsubscribe; releases sidecar interest only once for repeated unsubscribes; does not let an eager pre-mount buffer defeat hidden delivery gating; keeps eager buffers outside delivery interest when the PTY exits before mount; lets a sidecar exclusively own interest while an eager buffer overlaps. src/renderer/src/components/terminal-pane/pty-transport/delivery/pty-dispatcher-push-reattach.test.ts: blackholed delivery reproduces the wedge: no handler dispatch, no ACK ever. src/renderer/src/components/terminal-pane/pty-transport/ipc/ipc-pty-opencode-model.test.ts: sends preferences to the execution host and attaches only to its returned PTY; preserves one operation ID across a lost reply and reconnect; preserves ordinary raw startup and captured-session attachment. src/renderer/src/components/terminal-pane/pty-transport/output/pty-side-effect-pending-census.test.ts: sums registered gauges and drops disposed ones; ignores a repeated dispose instead of dropping another gauge; stops tracking new gauges past the cap so a missed dispose cannot grow it; tracks a live output processor queue through enqueue, drain, and dispose; excludes cleared consumed entries from retention after a bounded drain. src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-prebind-discard-notice.test.ts: says nothing once the pane is closed. src/renderer/src/components/terminal-pane/render-health/terminal-webgl-atlas-recovery.test.ts: refreshes after each scheduled atlas reset; falls back to a timeout when animation frames are unavailable; continues recovery when a manager throws after scheduling. src/renderer/src/components/terminal-pane/snapshots/pty-buffer-serializer.test.ts: tracks a remounted quiet title source even when the stale owner unregisters later; preserves the renderer-parsed output sequence in the response; preserves a pending escape tail for snapshot replay; routes a host's Reset Terminal request to the pane that owns the PTY. src/renderer/src/components/terminal-pane/snapshots/saved-terminal-output-replay.test.ts: marks panes with restored scrollback for fresh-shell viewport blanking. src/renderer/src/components/terminal-pane/viewport/split-right-white-screen.test.ts: recovers a 0x0 spawn whose container is briefly unmeasurable then settles. src/renderer/src/components/terminal-pane/viewport/visibility/stale-document-visibility.test.ts: removes global listeners when the last pane unregisters. src/renderer/src/components/ui/security-surface-theme-contrast.test.tsx: keeps trust text readable on a host-owned dialog surface; applies the hostile surface to ordinary dialogs, so the case above is exercised. src/renderer/src/components/use-terminal-parking-pass.test.tsx: does not queue a render when a pass produces the same parking sets; keeps parking transitions working under StrictMode. src/renderer/src/hooks/client-workspace-view-report.test.ts: reports an away user’s screen with no presence, and renews as soon as input returns; retries a failed send, empty or not, no sooner than a refresh. src/renderer/src/hooks/ipc-events/terminal-request-ipc-bridge-placement.test.ts: is new work in a workspace with no live terminal: its first bind moves it up in Recent. src/renderer/src/hooks/use-bundled-skill-install.test.tsx: ignores a repeated click while the install runs; retries the last requested skills on this host. src/renderer/src/hooks/useGitHubSlugMetadata.assignee-reuse.test.tsx: adds seeds to a successful empty list but not to loading or failed results; retains seed projection after expiry and fetches fresh metadata for a new reader. src/renderer/src/hooks/useSettingsNavigationMetadata.language-switch.test.tsx: retranslates the settings nav labels when the UI language changes live. src/renderer/src/lib/codex-stale-pane-account-identity.test.ts: keeps the prompt when the roster read fails and every label collapses. src/renderer/src/lib/image-blob-png.test.ts: downscales a pasted image above the pixel cap; releases its temporary URL on a decode error; releases its temporary URL when PNG encoding fails or exceeds the byte cap. src/renderer/src/lib/react-commit-cascade-store-write-samples.test.ts: names callers above the frame the write came from; restores Error.stackTraceLimit when the capture throws; stops collecting after the sample cap when captureStackTrace is unavailable; caps reported changed keys from a single wide write. src/renderer/src/lib/work-items/linear/linear-issue-context-snapshot.test.ts: applies the rendered text hard cap last and reserves the final overflow marker. src/renderer/src/runtime/rpc/targets/use-worktree-runtime-target.test.ts: keeps the runtime target identity stable across unrelated store writes. src/renderer/src/runtime/source-control/git/runtime-git-branch-client.test.ts: keeps creation available on old hosts and explains the missing operation; preserves landed warnings and direct collision recovery data; propagates remote discovery failure instead of a false empty page. src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-key-reuse.test.ts: reuses unchanged worktree tab projections when one worktree title changes; bumps only the changed worktree version when a sibling stays byte-identical. src/renderer/src/store/repos/repos-catalog-request-coordination.test.ts: shares safe-auto fork sync cooldown attempts across store instances. src/renderer/src/store/slices/tabs/hydrated-workspace-reconciliation-batch.test.ts: collapses a 193-workspace hydration to one store write; leaves the store byte-identical to the per-workspace path; re-reconciling the batched result is a no-op, as it is for the per-workspace path. src/renderer/src/store/slices/tabs/hydrated-workspace-reconciliation-fixture.ts: dedicated zero-case helper retirement; no authored test credit. src/renderer/src/store/slices/worktrees/metadata/update-worktrees-meta.test.ts: persists each batch metadata update to its workspace owner. src/renderer/src/store/slices/worktrees/metadata/worktree-meta-rename.test.ts: dismisses a rename error on its capable remote owner; clears pending first-agent rename when the title is updated. src/renderer/src/store/terminals/store-sleep-shutdown-order.test.ts: orders capture, guards, handlers, main's stop, commit, cleanup, and exit settlement. src/renderer/src/store/terminals/terminal-first-tab-publication.test.ts: publishes the first terminal and root tab group atomically; publishes the first terminal and root tab group atomically, then marks it starting in main. src/renderer/src/store/terminals/workspace-terminal-reconnect-hydration.test.ts: restores daemon terminal wake hints before declaring the session ready. src/renderer/src/web/web-runtime-connection-auth-framing.test.ts: keeps legacy framing for sockets that cannot absorb a refused attempt. src/shared/terminal/appearance/terminal-font-weight-windows-regular.test.ts: moves the old Windows default to Regular once and queues the notice; keeps custom weights and fresh profiles without a notice; leaves macOS and Linux profiles untouched. tests/e2e/claude-agent-row-view.unit.test.ts: updates a mounted compact workflow description through the subscribed production parent; bounds upstream active-SSH visits for $population records, fallback=$fallback; derives %s destinations without requiring type or a workflow child ID; terminates a $path parent $status with no third request or intermediate toast; does not recover a first child %s. tests/e2e/cross-version-wire/agent-permission-legacy-spawn.unit.test.ts: keeps exact legacy ordering when structured creation cannot express afterTabId; can create a terminal without selecting the target worktree; preserves the legacy fresh-agent path when host authority is unavailable. tests/e2e/paired-instant-browser-tab.spec.ts: shows a paired browser tab before its create RPC resolves, then keeps it as one tab; adopts a paired browser tab without rebuilding its chrome. tests/e2e/session-tabs/mobile-session-active-performance.unit.test.ts: bounds saved-order publication selection at N and 10N without rematerializing navigation; bounds admitted placement reconciliation during supported reads at N and 10N; bounds selection input visits at 50 and 500 rows, including unavailable-target projection; keeps publication scoped to a changed worktree and shared by listeners at N and 10N; bounds preserved-chat merge and runtime-owned hydration at N and 10N (legacy=%s); bounds actual native retirement and shared delivery work at N and 10N. tests/e2e/session-tabs/mobile-session-active-publication.unit.test.ts: does not substitute a preserved row for an unavailable explicit legacy selection; resolves main-layout group selection %s (omitted group=%s). tests/e2e/structured-agent-session-launch-admission.unit.test.ts: opens a direct caller's terminal with the caller's own CLI arguments on a decline; opens the chat on the server that admitted it; opens only the terminal when this machine declines, without a notice; opens a new agent tab's terminal with the typed prompt when the caller names none; opens the chat, not a terminal, when this machine cannot resolve a new workspace yet; keeps its terminal fallback, as before. tests/e2e/structured-attention-prompt-relay.unit.test.ts: settles once per relayed prompt, not on every later status update. tests/e2e/structured-attention-read-retirement.unit.test.ts: Mark read on a chat never opened withdraws the prompt alert it surfaced; Mark read on a chat hidden since an earlier view covers the newer prompt it surfaced; reads a newly accepted visible prompt without sending an RPC for text-only updates. tests/e2e/structured-chat-tab-lifetime-cost.unit.test.ts: counts real raw stores, unrelated window publications and captured cleanup at %i chats; counts complete supplied-member sweep and separate final retirement at S=%i N=%i. tests/e2e/structured-session-workspace-authority.unit.test.ts: bounds actual target reveal across %i repo roots and metadata aliases. tests/e2e/terminal-agent-pane-launch.unit.test.ts: starts the host's planned command once, at the pane's size, and says it started; plans a pane whose prompt the window submits without the startup update prompt; preserves caller shell-ready delivery only for a connection-scoped adapter ($connectionId); starts no shell on plan failure (original failure: $returnLaunchFailure); cannot confirm a start whose provider answer was lost. tests/e2e/terminal-shortcuts.spec.ts: @headful Codex-like background output stays visible without disabling WebGL in auto mode; Shift with Russian layout text reaches the PTY as Cyrillic under kitty keyboard reporting. tests/e2e/terminal-split-activation-latency.spec.ts: records attributed CWD, spawn, bind, fixture-ready, input, and echo phases. tests/e2e/terminal-split-activation-latency-phases.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-split-activation-latency-main-probe.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-split-activation-latency-artifact.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-split-activation-latency-report.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-tab-switch-visual-restore.spec.ts: restores skipped hidden Grok output on light tab resume. tests/e2e/web-runtime-session-terminal-host-authority.unit.test.ts: delivers independent %s effort through the real prepared web callback; keeps same-ID local and runtime worktrees on the selected runtime owner; creates paired web agents through host authority so activation is mirrored; delivers generated continuation context after host-authoritative creation; seeds the chat composer for a draft that rode in on the launch command. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts, src/main/runtime/construction/orca-runtime.test.ts, src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts, src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts, src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts, src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts, src/main/persistence/worktree-sort-order-write.test.ts, src/main/runtime/integrations/skill/orca-runtime-skill-recovery.test.ts, src/main/runtime/orchestration/mailbox/routing/orchestration-mailbox-detached-routing.spec.ts, src/main/runtime/orchestration/mailbox/terminal-pointer/orchestration-mailbox-delivery.test.ts, src/main/runtime/orchestration/mailbox/terminal-pointer/orchestration-mailbox-pointer-cli-command.spec.ts, src/main/runtime/rpc/methods/terminal/terminal-multiplex-link-estimate.test.ts, src/main/runtime/rpc/methods/terminal/terminal-snapshot-scrollback-rows.test.ts, src/main/runtime/rpc/server/pairing/network/windows-default-route-interfaces.test.ts, src/main/runtime/rpc/server/pairing/pairing-offer-owner-cli.test.ts, src/main/runtime/rpc/terminal-multiplex-end-verdict.test.ts, src/main/runtime/session-graph/headless-runtime-graph.spec.ts, src/main/runtime/session-graph/runtime-graph-standing-contracts.test.ts, src/main/runtime/session-tabs/structured-conversation-tab-title.test.ts, src/main/runtime/session-tabs/terminal-close-observed-exit.test.ts, src/main/runtime/terminal/identity/terminal-identity-probe.test.ts, src/main/runtime/terminal/layout/paired-desktop-server-writes-layout-owner.test.ts, src/main/runtime/terminal/lifecycle/pty-lifecycle-generation-retention.test.ts, src/main/runtime/terminal/lifecycle/run-terminal-user-open.test.ts, src/main/runtime/terminal/surface/terminal-surface-replies-window.test.ts, src/main/runtime/terminal/surface/workspace-layout-projection.test.ts, src/main/runtime/terminal/view/terminal-subscribe-exit-waiter-leak.test.ts, src/main/runtime/terminal/wait/orca-runtime-exact-worker-provider-session.test.ts, src/main/runtime/terminal/wait/prime-agent-screen-readiness-transcripts.test.ts, src/main/runtime/workspaces/startup/runtime-worktree-agent-startup.test.ts, src/main/runtime/workspaces/startup/runtime-worktree-startup-readiness.test.ts, src/main/skills/skill-install-transaction.test.ts, src/main/speech/model-manager-download-resume.test.ts, src/main/ssh/config/ssh-config-parser.test.ts, src/main/ssh/config/ssh-known-hosts-source.test.ts, src/main/ssh/config/ssh-known-hosts.test.ts, src/main/ssh/connection/ssh-connect-config.test.ts, src/main/ssh/connection/ssh-connection-auth-fallback.test.ts, src/main/ssh/connection/ssh-connection-store.test.ts, src/main/ssh/connection/ssh-connection.test.ts, src/main/ssh/orcad-migration-stuck-host-profiles.test.ts, src/main/ssh/orcad-runtime-maintenance.test.ts, src/main/ssh/port-forwarding/ssh-port-forward.test.ts, src/main/ssh/ssh-channel-multiplexer.test.ts, src/main/ssh/system-transport/system-ssh-forward-process.test.ts, src/main/ssh/system-transport/system-ssh-loopback-route.test.ts, src/main/startup/browser-process-user-agent-ordering.test.ts, src/main/startup/quit/quit-path-durable-write-blocking.test.ts, src/main/stats/agent-session-transition-recorder.test.ts, src/main/text-generation/commit-message-text-generation-model-discovery.test.ts, src/main/text-generation/pull-request-context.test.ts, src/main/text-generation/source-control-local-process.test.ts, src/main/updater/linux-package/linux-package-update-recovery.test.ts, src/main/updater/releases/updater-prerelease-feed-readiness.test.ts, src/main/updater/releases/updater-release-builds.test.ts, src/main/updater/updater.build-channel-selection.test.ts, src/main/updater/updater.check-preflight.test.ts, src/main/updater/updater.prerelease-fallback.test.ts, src/main/updater/updater.publishing-window-feed.test.ts, src/main/updater/updater.quit-and-install.test.ts, src/main/window/createMainWindow-markdown-editor-focus.test.ts, src/main/window/createMainWindow-renderer-crash-recovery.test.ts, src/main/window/dashboard-popout-window.test.ts, src/main/window/dropped-path-preparation.test.ts, src/main/window/main-window-updater-deferred-setup.test.ts, src/main/worker-threads/worker-thread-request-queue.test.ts, src/main/workspace-hooks/hooks-setup-runner-script.test.ts, src/main/workspaces/catalog/repo-git-remote-identity-enrichment.test.ts, src/main/workspaces/creation/preparation/worktree-create-preparation.test.ts, src/main/workspaces/removal/local-worktree-removal-recovery.test.ts, src/main/workspaces/removal/worktree-removal-safety.test.ts, src/main/wsl/discovery/distro-catalog.test.ts, src/main/wsl/discovery/wsl-distro-holder.test.ts, src/main/wsl/filesystem/wsl-guest-drive-mountinfo.test.ts, src/main/wsl/orcad/wsl-orcad-deploy-app-update.test.ts, src/renderer/src/components/agent/agent-launch-picker-acquisition.test.ts, src/renderer/src/components/feature-tips/feature-tip-telemetry.test.ts, src/renderer/src/components/native-chat/composer/pickers/use-native-chat-side-chat-command.test.ts, src/renderer/src/components/native-chat/media/images/native-chat-image-copy.test.ts, src/renderer/src/components/native-chat/messages/actions/native-chat-fork-launch.test.ts, src/renderer/src/components/native-chat/messages/actions/native-chat-side-chat-fork-point.test.ts, src/renderer/src/components/native-chat/messages/actions/use-native-chat-fork.test.tsx, src/renderer/src/components/terminal-pane/provider-notices/agent-presence/agent-terminal-presence.test.ts, src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-deferred-input-forwarding.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/spawn/unbound-pane-spawn-recovery.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-foreground-agent.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts, src/renderer/src/components/terminal-pane/pty-transport/delivery/pty-dispatcher-delivery-interest.test.ts, src/renderer/src/components/terminal-pane/pty-transport/delivery/pty-dispatcher-push-reattach.test.ts, src/renderer/src/components/terminal-pane/pty-transport/ipc/ipc-pty-opencode-model.test.ts, src/renderer/src/components/terminal-pane/pty-transport/output/pty-side-effect-pending-census.test.ts, src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-prebind-discard-notice.test.ts, src/renderer/src/components/terminal-pane/render-health/terminal-webgl-atlas-recovery.test.ts, src/renderer/src/components/terminal-pane/snapshots/pty-buffer-serializer.test.ts, src/renderer/src/components/terminal-pane/snapshots/saved-terminal-output-replay.test.ts, src/renderer/src/components/terminal-pane/viewport/split-right-white-screen.test.ts, src/renderer/src/components/terminal-pane/viewport/visibility/stale-document-visibility.test.ts, src/renderer/src/components/ui/security-surface-theme-contrast.test.tsx, src/renderer/src/components/use-terminal-parking-pass.test.tsx, src/renderer/src/hooks/client-workspace-view-report.test.ts, src/renderer/src/hooks/ipc-events/terminal-request-ipc-bridge-placement.test.ts, src/renderer/src/hooks/use-bundled-skill-install.test.tsx, src/renderer/src/hooks/useGitHubSlugMetadata.assignee-reuse.test.tsx, src/renderer/src/hooks/useSettingsNavigationMetadata.language-switch.test.tsx, src/renderer/src/lib/codex-stale-pane-account-identity.test.ts, src/renderer/src/lib/image-blob-png.test.ts, src/renderer/src/lib/react-commit-cascade-store-write-samples.test.ts, src/renderer/src/lib/work-items/linear/linear-issue-context-snapshot.test.ts, src/renderer/src/runtime/rpc/targets/use-worktree-runtime-target.test.ts, src/renderer/src/runtime/source-control/git/runtime-git-branch-client.test.ts, src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-key-reuse.test.ts, src/renderer/src/store/repos/repos-catalog-request-coordination.test.ts, src/renderer/src/store/slices/tabs/hydrated-workspace-reconciliation-batch.test.ts, src/renderer/src/store/slices/tabs/hydrated-workspace-reconciliation-fixture.ts, src/renderer/src/store/slices/worktrees/metadata/update-worktrees-meta.test.ts, src/renderer/src/store/slices/worktrees/metadata/worktree-meta-rename.test.ts, src/renderer/src/store/terminals/store-sleep-shutdown-order.test.ts, src/renderer/src/store/terminals/terminal-first-tab-publication.test.ts, src/renderer/src/store/terminals/workspace-terminal-reconnect-hydration.test.ts, src/renderer/src/web/web-runtime-connection-auth-framing.test.ts, src/shared/terminal/appearance/terminal-font-weight-windows-regular.test.ts, tests/e2e/claude-agent-row-view.unit.test.ts, tests/e2e/cross-version-wire/agent-permission-legacy-spawn.unit.test.ts, tests/e2e/paired-instant-browser-tab.spec.ts, tests/e2e/session-tabs/mobile-session-active-performance.unit.test.ts, tests/e2e/session-tabs/mobile-session-active-publication.unit.test.ts, tests/e2e/structured-agent-session-launch-admission.unit.test.ts, tests/e2e/structured-attention-prompt-relay.unit.test.ts, tests/e2e/structured-attention-read-retirement.unit.test.ts, tests/e2e/structured-chat-tab-lifetime-cost.unit.test.ts, tests/e2e/structured-session-workspace-authority.unit.test.ts, tests/e2e/terminal-agent-pane-launch.unit.test.ts, tests/e2e/terminal-parked-memory.spec.ts, tests/e2e/terminal-shortcuts.spec.ts, tests/e2e/terminal-split-activation-latency.spec.ts, tests/e2e/terminal-split-activation-latency-phases.ts, tests/e2e/terminal-split-activation-latency-main-probe.ts, tests/e2e/terminal-split-activation-latency-artifact.ts, tests/e2e/terminal-split-activation-latency-report.ts, tests/e2e/terminal-tab-switch-visual-restore.spec.ts, tests/e2e/web-runtime-session-terminal-host-authority.unit.test.ts. Unresolved local/computed edges remain explicit debt.", "Audit2095 current-parent preparation2126 (approved2092/2093 removals; source refresh2109/independent2112): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts: rejects exact terminal stop for multiple expected PTYs before stopping anything; omits stale renderer leaves when fresh PTY liveness is required; omits unbound renderer placeholders when fresh PTY liveness is required; captures the event method before the nested sleep receipt changes it; returns the close receipt without requiring a PTY stop; uses the same stop result as an empty explicit stop. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts: builds a compact worktree summary from persisted and live runtime state; reads the linked-PR state from the renderer repoId-keyed GitHub cache; carries persisted worktree host ownership in mobile summaries; emits only instance- and boundary-validated lineage parents in mobile summaries; resolves WSL platforms only for repos represented in mobile summaries; omits worktrees hidden by the host visibility policy from mobile summaries; applies linked-checkout source visibility to mobile summaries. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts: routes runtime GitHub PR details and actions through the selected WSL project runtime; passes SSH connection context through hosted review creation flows; routes local WSL project hosted review flows through runtime git options; treats SSH worktree drift as unknown without local git probes. src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts: emits one mobile session terminal tab per live PTY even if two tabs resolve to it; resolves projected split authority from the parent layout PTY binding; keeps explicit-id terminal lists from resolving all worktrees; keeps explicit-id cold-cache terminal lists from classifying unrelated same-repo worktrees; keeps unknown bare terminal-list ids on the no-scan exact-id path; matches explicit-id cwd PTYs for folder workspace instance IDs; routes PTY output through the PTY leaf index in large terminal graphs. src/main/runtime/orca-runtime-tests/window-authority.spec.ts: claims the first window as authoritative and ignores later windows; transfers authority from the headless sentinel to the first real window; relays terminal browser launches only while headless owns the graph; marks live headless PTYs for renderer reattach before desktop promotion; reports the activation gate state while no desktop window is available; bumps the epoch and enters reloading when the authoritative window reloads; can mark the graph ready for the authoritative window; drops back to unavailable and clears authority when the window disappears; hands the graph back to headless when a promoted serve window closes (#27292); keeps a crashed promoted serve renderer on its own window while the window is open; stays unavailable during initial loads before a graph is published. src/main/runtime/orchestration/mailbox/routing/orchestration-mailbox-routing-races.spec.ts: stops paged routing when the check is cancelled; keeps an unfiltered redrive unrestricted when reservations merge; keeps an unfiltered parked delivery unrestricted when reservations merge; uses a bounded indexed pane lookup for reminted Dispatch identity. src/main/runtime/workspaces/removal/worktree-teardown-unstopped-pty.test.ts: removes the reported wedged automation workspace without --force; clears PTY state once a failed stop is proven to have exited; names only the PTYs that are actually live, not every failed stop; warns with the specific sweep failure, not the generic deadline; still fails closed on a sweep-level failure without force. src/main/skills/bundled-skill-install/layouts.test.ts: links into a project only where its agent folder already exists; reads a pending cloud transaction as busy and a cloud receipt as another skill. src/main/skills/skill-upload-session-service.test.ts: joins concurrent disposal callers through exact cleanup completion. src/main/source-control/hosted-review-creation.test.ts: creates the pull request after fresh main-process validation passes; routes local WSL git and GitHub review creation through the selected runtime; creates a pull request on a GitHub Enterprise Server remote (#8312); creates a GitLab merge request after fresh main-process validation passes; creates an Azure DevOps pull request after fresh main-process validation passes; creates a Gitea pull request after fresh main-process validation passes. src/main/source-control/hosted-review-execution-host-routing.test.ts: reads a GitHub review on the SSH host a row names only in executionHostId; reads a GitLab review on the executionHostId host when connectionId names a different one; does not dial this client for a runtime row whose nested target shares a local name; keeps a runtime row with no nested target on this process (self-addressed stamp); keeps a legacy connectionId-only SSH row on its target; does not share a cached answer between two rows at one path on different hosts; creates a Bitbucket review locally for a runtime row rather than dialing its nested target; reports creation eligibility from the executionHostId-only SSH host; resolves the GitHub slug for a repo listing on the row it is asked about; refuses to dial a runtime host from this process; answers with the SSH target for both spellings and local otherwise; reads a runtime stamp on a row in this store as self-addressing, not a second machine. src/main/source-control/hosted-review-inflight-invalidation.test.ts: keeps other hosts, paths and their pending promises isolated. src/main/speech/model-manager.test.ts: requires pinned, internally consistent metadata for every model file; verifies downloaded model file hashes before installation; rejects non-HTTPS model downloads; marks OpenAI transcription models ready only when an API key is configured. src/main/ssh/connection/ssh-connection-sftp-namespace.test.ts: writes to the SFTP namespace path discovered on the same session; uploads the bundle into the SFTP namespace directory; issues no discovery requests when the caller supplies no mapping; ignores a mapping on a Windows host; never resolves on the system-SSH transport; leaves writeBuffer and openFileUploadSession on the shell path; keeps the shell path when discovery is inconclusive; preserves a session-limit channel-open error unchanged. src/main/ssh/connection/ssh-connection-system-transport.test.ts: uses system SSH transport when ProxyUseFdpass is resolved by OpenSSH; allows concurrent exec commands for system SSH with an Orca ControlMaster socket; keeps concurrent exec commands disabled for system SSH without a reusable socket; uses system SSH transport for ProxyCommand targets before ssh2 auth; keeps the original ssh2 reachability error when the system SSH probe fails; reports the system SSH failure when ssh2 cannot negotiate with the host; uses system transport for target or resolved OpenSSH proxy directives; allows an environment override for e2e coverage; ignores stale imported proxy fields when fresh OpenSSH config has no proxy. src/main/ssh/orcad-migration-catalog-client.test.ts: keeps each server project’s execution host, so a nested SSH row is never read as local; reads the server’s folder workspaces and the groups that place them on a host; sends and validates the %s operation; validates an abort result without letting it erase committed state; validates a committed receipt against the requested manifest; rejects malformed stage timestamps and abort envelopes; fails closed for method absence, malformed identity, and invalid pairing; refuses a destination without the capability before sending any migration request; reads method-not-found as the same refusal, not as a lost answer. src/main/ssh/runtime-ssh-access.test.ts: persists intent then claim before connecting and publishes redacted authenticated access; names the saved dependency when dependent state blocks an SSH access link; handles lost link responses without connecting or verifying again; invalidates old transport only after authenticated access is published; rejects changed request tuple after a completed link; rejects provisioning and missing durable generations without connecting; treats a lost successful unlink response as an idempotent no-op; hashes connection identity, not display state or owner; strictly validates ports and request IDs. src/main/startup/cli-launch-redirect.test.ts: detects a launch that received the unpacked CLI entrypoint; ignores normal desktop launches; ignores the entrypoint when it is only the executable itself (argv[0]); applies on Linux too; strips injected Chromium switches before node-mode CLI arguments; keeps user flags after the command and malformed boolean assignments; does not treat a later positional entrypoint path as the launcher; redirects a direct binary launch with no AppImage env at all; strips Chromium switches node mode would reject; preserves desktop-shaped switches after the command; leaves direct serve in-process but redirects its help; treats help as a CLI launch even without a command; treats %s as a CLI launch even without a command; does not treat a value of %s as a CLI early-exit flag; does not treat a serve option value as a help request; does not reinterpret help after the argument terminator; leaves a plain desktop launch alone; skips flag values when looking for the command positional; preserves a project selector in %j; does not apply the command form on macOS or Windows; never redirects an unpackaged build; runs the in-package CLI in Electron node mode with sanitized env; refuses to redirect twice so a dropped ELECTRON_RUN_AS_NODE cannot loop; reports a missing CLI entrypoint instead of booting the desktop app; execs a direct serve into the CLI so it keeps its pid and honours profile and supervise; keeps ORCA_USER_DATA_PATH for a direct serve without --user-data-dir; serves in-process when this runtime cannot exec or the exec fails; never execs the --serve child the CLI itself spawns, or serve on other platforms; surfaces a spawn failure as a non-zero exit; re-execs a direct --serve onto X11 when Electron resolved Wayland; leaves $name alone. src/main/startup/main-process-runtime-launch-activation.test.ts: marks startup settled for the launch record only after the window has loaded and settled; loads SSH targets on a windowless serve before paired clients can connect (#25886); pins the serve listener to loopback only for orcad browser sidecars (sidecar=$sidecar, #31895); saves Codex auth before a headless serve update restart, like the desktop does. src/main/startup/run-electron-vite-dev.test.ts: forwards dev instance identity to electron-vite; prepares userData orca and orca-dev wrappers for dev terminals; consumes the stable-name flag before forwarding args to electron-vite. src/main/updater/releases/updater-prerelease-feed.test.ts: returns the newest stable tag when the user is on an RC and a newer stable exists; returns the newest RC tag when no stable is newer than the current RC; can exclude prerelease tags for stable-channel checks; probes the %s %s platform manifest; returns null for stable-channel checks when only prereleases are newer; returns null when nothing in the feed is newer than the current version; ignores entries with unparseable tags; returns null when the fetch is not ok; returns null when the fetch throws; picks semver-newest across a mixed-order feed; ignores perf-tagged prereleases for regular RC checks; reports no RC update when only perf-tagged prereleases are newer; picks the semver-newest perf-tagged prerelease; matches only literal rc.N.perf prerelease tags for perf checks; reports no perf update instead of falling back to stable or RC tags; returns a bounded fallback candidate after the newest newer tag; returns null when the only newer tag has a manifest but its asset still 404s; requires a known old timestamp for a stable-fallback tag. src/main/updater/updater-events.test.ts: hands the whole downloaded event to artifact capture; publishes manual-install recovery after a %s download; publishes the normal downloaded state for AppImage builds; blocks downloaded-state handling when the packaged marker is unusable; passes the actual updater error into the install-failure handler; keeps manual-install recovery when a later check finds only the installed release; drops the artifact when another version takes over the cycle; ignores a downloaded event for an older target; accepts a matching event when the pending cache target was cleared; drops the artifact when progress reports a different pending version. src/main/updater/updater-linux-package-recovery-actions.test.ts: rejects both actions while no package-install recovery is active; validates the retained package on every invocation; restores recovery after a recheck resolves without a terminal event; restores recovery after a recheck fails; restores recovery when a pinned check resolves to the current version; restores recovery when resolving a pinned check fails; clears recovery for both actions once the package is gone; resolves %s as a result and keeps the card usable instead of rejecting; keeps recovery available after a transient read failure. src/main/updater/updater.check-settlement.test.ts: leaves a dismissed release update on the release source; surfaces net::ERR_FAILED to user-initiated checks with a friendly message; shows checking immediately for a user-initiated check while feed pinning is pending; keeps background checks event-driven before checking-for-update fires. src/main/usage/usage-provider-store-lifecycle.test.ts: persists identities for a whole first scan with one write; skips disabled and fresh matching states; invalidates prior sources on fingerprint changes and reuses them for forced scans. src/main/window/createMainWindow-close-confirmation.test.ts: clears the quit latch when the renderer prevents unload; does not notify the crash recorder when renderer teardown follows a confirmed window close; allows close when Electron reports a crashed webContents; requests confirmation for a hung-but-alive renderer instead of bypassing. src/main/workspaces/catalog/worktree-identity-persistence.test.ts: stores independent metadata for colliding locators on two hosts; projects canonical-only metadata for exactly one host; keeps canonical metadata current for legacy writers on a known owner; removes only the selected legacy-owner metadata when locators collide; keeps the canonical identity stable when the locator changes; leaves other hosts at the old locator when one host renames its folder. src/main/wsl/filesystem/wsl-drive-unc-conversion-startup.test.ts: leaves a journaled conversion untouched with the gate closed, %s. src/main/wsl/orcad/wsl-orcad-deploy.test.ts: holds the distro before it deploys and launches, and reports what C5 dials; passes its connect-state read (%s) on as hints; applies the SSH census and downgrade admission to the first deploy; refuses a WSL 1 distro before holding it or touching its files; tells an unregistered distro how to find the installed ones, before holding anything; surfaces an unsupported libc as the SSH host refusal does; starts an already-active slot the distro stop ended, instead of reporting it ready; deploys over an adopted unrecorded orcad under the SSH terminal gate, never a fresh launch; reports the adopted instance once the same version is serving; returns a deferral rather than launching over live terminals; hands a failed first deploy to the fresh-install cleanup before reporting it. src/main/zcode/zcode-v2-plan-credentials.test.ts: prefers migrated credentials over a stale legacy account; keeps legacy support when no personal v2 file exists; honors the upstream personal config override independently of the credential directory; does not borrow credentials from another execution host; preserves the protected Orca key priority even if v2 is corrupt; rejects upstream-invalid selection %j without legacy fallback; accepts a valid optional reasoning level; rejects upstream-invalid rule containers %j without legacy fallback; accepts a valid selected-provider empty personal rule and smart model rule; cannot establish selected credentials from %s rules; leaves encrypted CLI files unchanged across repeated account reads. tests/e2e/automation-terminal-launch.unit.test.ts: launches explicit Chat for %s through the common entry and keeps its actual fallback; does not apply stored Terminal extras to Chat; forwards only complete Chat-consumed values, with no Terminal startup base; refuses an expired admission without minting another launch identity; records the actual chat identity and delegates new workspace setup and provenance. tests/e2e/github-project-provider-columns.unit.test.ts: renders %s through one bounded items request on a named cloud host; preserves zero and complete counters: %j; preserves populated and legacy rows through shared sorting, grouping and cells. tests/e2e/structured-agent-session-launch-continuation.unit.test.ts: carries renderer lifetime through host intent to the real %s provider builders. tests/e2e/terminal-account-restart.unit.test.ts: replaces a tombstoned owner while its persisted pane binding has not yet been cleared; paired restart retains the old owner (host authority: %s). tests/e2e/terminal-hidden-view-parking.spec.ts: does not park excluded tabs; reproduces a static frame byte-for-byte across 25 park/reveal cycles. tests/e2e/terminal-long-table-scroll-restore.spec.ts: reproduces long markdown table artifacts after workspace switch and scroll; keeps narrow wrapped signer markdown table coherent after restore and scroll; keeps real emoji markdown table right edge clean after restore and scroll. tests/e2e/terminal-long-table-fixtures.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-paste-ownership.spec.ts: Windows multiline keyboard paste normalizes terminal newlines with one PTY owner; right-click paste sends clipboard text to the focused terminal exactly once. tests/e2e/terminal-raw-emoji-table-scroll-restore.spec.ts: uses WebGL by default for ordinary terminal output when available @terminal-rendering-golden. tests/e2e/terminal-windows-shell-paste-ownership.spec.ts: cmd.exe default terminal keyboard paste preserves exact content with one PTY owner; Git Bash default terminal keyboard paste preserves POSIX-shaped content with one PTY owner; WSL terminal keyboard paste preserves Linux shell content with one PTY owner. tests/e2e/workspace-board-lane-virtualization.spec.ts: mounts a window of cards for a large lane and keeps lane indexes; renders later lane indexes after the lane scrolls. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts, src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts, src/main/runtime/orca-runtime-tests/window-authority.spec.ts, src/main/runtime/orchestration/mailbox/routing/orchestration-mailbox-routing-races.spec.ts, src/main/runtime/workspaces/removal/worktree-teardown-unstopped-pty.test.ts, src/main/skills/bundled-skill-install/layouts.test.ts, src/main/skills/skill-upload-session-service.test.ts, src/main/source-control/hosted-review-creation.test.ts, src/main/source-control/hosted-review-execution-host-routing.test.ts, src/main/source-control/hosted-review-inflight-invalidation.test.ts, src/main/speech/model-manager.test.ts, src/main/ssh/connection/ssh-connection-sftp-namespace.test.ts, src/main/ssh/connection/ssh-connection-system-transport.test.ts, src/main/ssh/orcad-migration-catalog-client.test.ts, src/main/ssh/runtime-ssh-access.test.ts, src/main/startup/cli-launch-redirect.test.ts, src/main/startup/main-process-runtime-launch-activation.test.ts, src/main/startup/run-electron-vite-dev.test.ts, src/main/updater/releases/updater-prerelease-feed.test.ts, src/main/updater/updater-events.test.ts, src/main/updater/updater-linux-package-recovery-actions.test.ts, src/main/updater/updater.check-settlement.test.ts, src/main/usage/usage-provider-store-lifecycle.test.ts, src/main/window/createMainWindow-close-confirmation.test.ts, src/main/workspaces/catalog/worktree-identity-persistence.test.ts, src/main/wsl/filesystem/wsl-drive-unc-conversion-startup.test.ts, src/main/wsl/orcad/wsl-orcad-deploy.test.ts, src/main/zcode/zcode-v2-plan-credentials.test.ts, tests/e2e/automation-terminal-launch.unit.test.ts, tests/e2e/github-project-provider-columns.unit.test.ts, tests/e2e/structured-agent-session-launch-continuation.unit.test.ts, tests/e2e/terminal-account-restart.unit.test.ts, tests/e2e/terminal-hidden-view-parking.spec.ts, tests/e2e/terminal-long-table-scroll-restore.spec.ts, tests/e2e/terminal-long-table-fixtures.ts, tests/e2e/terminal-paste-ownership.spec.ts, tests/e2e/terminal-raw-emoji-table-scroll-restore.spec.ts, tests/e2e/terminal-windows-shell-paste-ownership.spec.ts, tests/e2e/workspace-board-lane-virtualization.spec.ts. Unresolved local/computed edges remain explicit debt.", @@ -9063,7 +9005,25 @@ "Audit2412 removes whole useVirtualizedScrollAnchor.marks-restore-signal.test.ts (six fake-hook geometry/mark/convergence/user-takeover/clamp alarms), use-task-creation-draft-retention original3/4 (immediate discard mock-call count/unopened no-write), use-terminal-bulk-close-actions.placement original6/7 (absent new-agent append and one real history-publication count at consumed3/30 scale), PendingNativeChatCreation original6 (unmounted abort completion/timer cleanup), and wsl-move-dialog-store original1/9/13 (default whole-distro count/reference/reuse and rejected-preview/start refusal recovery). The history counter measures genuine publication work without entries/order/reopen assertions; its unique batching alarm is intentionally retired. Fake React scroll tests ignore dependency scheduling and cleanup; unique simulated arithmetic alarms are deliberately lost. Retained existing-terminal reorder is not new-agent append coverage; mounted handoff timeout is not abort coverage. No equivalent complete replacement or fresh validation is claimed.", "Audit2417 removes commit-actions-real-git original3/4 (ordinary clean cherry-pick and revert content, subject and current-branch samples), and pty-startup-ingress-exited-asker original8/12 (actual foreground-group read budget across100queued queries, and zero foreground reads across100normal chunks plus final emitted/accepted raw cursor equality). Counters measure actual callback work and scale is consumed; these internal-work alarms are deliberately retired. Retained unborn, conflict and sequencer cases are not equivalent ordinary-success coverage. No equivalent complete replacement or fresh validation is claimed.", "Audit2425 removes use-workspace-copy-status original5, which returns a fixture-supplied readError string through statusReadError. No consumer blocker or attempted branch switch established refusal; the unique error-forwarding sample is intentionally retired. Other copy ownership and stale-refresh cases are not equivalent error-path coverage. No equivalent replacement or fresh validation is claimed.", - "Audit2432 removes BranchPicker.test.tsx original3, which only asserted onOpenChange(true/false) with an always-mounted mocked Popover. It never reopened the picker or consumed the callback in the parent status-refresh owner, despite its title. Lose that unique open/close notification alarm. Retained blocker/collision recovery and asynchronous post-unmount outcome cases are not equivalent replacement coverage. No fresh validation of the reduced selector is claimed." + "Audit2432 removes BranchPicker.test.tsx original3, which only asserted onOpenChange(true/false) with an always-mounted mocked Popover. It never reopened the picker or consumed the callback in the parent status-refresh owner, despite its title. Lose that unique open/close notification alarm. Retained blocker/collision recovery and asynchronous post-unmount outcome cases are not equivalent replacement coverage. No fresh validation of the reduced selector is claimed.", + "Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. The direct side-effect-facts selector retains six cases: replay exclusion, live sequence handling, stale disposer ownership, one handoff drain, drain-before-snapshot, and stale replacement-snapshot refusal. Successful current-entry snapshot application is not witnessed by the retained snapshot case.", + "Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed.", + "Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed.", + "Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed.", + "Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation.", + "Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed.", + "Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked.", + "Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed.", + "Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms.", + "Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery.", + "Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction.", + "Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed.", + "Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed.", + "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed.", + "Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed.", + "Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed.", + "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired.", + "Terminal/runtime defining-owner cleanup retires complete parking timer, lifecycle, mocked close/disposal and render/flip/mount work-count cases under repository test policy. The retained watcher source has only two literal-oracle coverage decisions; the retained cold-parking hook source has only the layout-PTY exemption invalidation case. Lost alarms include cooldown/measure/pin wakeups, split exit/close attribution and cancellation, watcher disposal/restart, flood timer rearm, worktree verdict damping, and destroyed-transport cold restore. No equivalent replacement coverage or execution pass for the reduced cases is claimed; prior dated receipts retain their original scope." ], "demotionRule": "Keep experimental or demote to protection none if decorative title frequency changes paired client-event or session-tabs publication volume after convergence, a semantic fact is dropped, paired first paint is blank, passive work reconnects after manual disconnect, a capable hidden paired manager survives ordinary parking, a legacy hidden pane schedules raw xterm output or bypasses its fallback, reveal loses requested bounded history or live PTY identity, retained buffer cells do not fall, or either headed/headless scenario flakes." }, @@ -9157,36 +9117,34 @@ "providers": ["local", "daemon", "ssh", "wsl", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Renderer unit coverage proves replay-guard lost-completion and certified-wedge events carry correlatable tab, worktree, durable leaf, pane, and redacted PTY identity without exposing path-bearing values. Full provider lifecycle attribution and diagnostics-bundle artifact proof remain gaps.", + "coverageNotes": "Retained renderer unit cases exercise guard release after a silent stalled parse and hardcoded breadcrumb event/pane identity with a fake terminal and mocked recorder. The identity-rich hashing/redaction registration was retired whole. No hashed tab/worktree/leaf identity, path-redaction, diagnostics-bundle export, live provider or packaged runtime coverage is claimed.", "motivatingLinks": [ "https://github.com/stablyai/orca/pull/6800", "https://github.com/stablyai/orca/issues/6773" ], "invariant": "Terminal lifecycle anomalies around reattach, restore, replay wedges, provider ownership, stale liveness, and fallback routing must leave compact, deduped, privacy-safe breadcrumbs in crash diagnostics so future reports can be attributed from evidence. Replay anomalies must distinguish pane managers and PTYs without recording path-bearing worktree or session identities.", - "oracle": "Drop a replay write completion while allowing its FIFO probe to parse, then require the lost-completion breadcrumb to include pane ID, stable hashes for tab/worktree/leaf identity, and a path-redacted PTY ID. Existing wedge tests require both lost-completion and certified-dead paths to record their distinct event names. Full pane transition traces and diagnostics-bundle artifact proof remain follow-ups.", + "oracle": "Simulate replay and probe completions that never arrive, advance fake timers through both quiet windows, and require the real replay guard to transition from engaged to released while the mocked recorder receives terminal_replay_guard_wedged_release with paneId 1. This does not establish correlation hashing, path redaction or diagnostics-bundle export.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/snapshots/replay-guard.test.ts" + "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/snapshots/replay-guard.test.ts --maxWorkers=2" ], "testFiles": ["src/renderer/src/components/terminal-pane/snapshots/replay-guard.test.ts"], "assertionRefs": [ { "file": "src/renderer/src/components/terminal-pane/snapshots/replay-guard.test.ts", "assertions": [ - "records correlatable replay identity without exposing worktree or PTY paths", "releases after the probe itself never parses (wedged pipeline) and reports it" ] } ], "evidenceRuns": [ { - "date": "2026-07-29", + "date": "2026-11-10", "runner": "local", "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/replay-guard.test.ts", "result": "passed", - "durationSeconds": 0.201, - "summary": "The focused file passed 29 tests; replay anomaly breadcrumbs preserved event classification while adding hashed tab/worktree/leaf correlation and a path-redacted PTY identity.", - "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/snapshots/replay-guard.test.ts" + "command": "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/snapshots/replay-guard.test.ts --maxWorkers=2", + "durationSeconds": 1.52, + "summary": "Retained replay-guard suite passed 19 cases on the module-layout wave1 candidate. The named breadcrumb case preserves real replay guard release and the hardcoded wedged event/pane1 with a fake terminal and mocked recorder. No identity-hash/redaction, live provider, diagnostics-bundle, fresh red/green, performance or CI-soak claim." } ], "runtimeBudget": { @@ -9195,11 +9153,11 @@ }, "flakeHistory": { "status": "unknown", - "evidence": "The replay-guard unit slice passed locally once; no CI soak history yet." + "evidence": "Retained selector has no CI soak history; fresh focused execution is recorded separately." }, "redGreenEvidence": { - "status": "partial", - "evidence": "Tests fail if replay anomalies stop recording their event name, omit pane/terminal correlation, or expose the fixture's path-bearing worktree and PTY prefixes. Needs diagnostics-bundle artifact proof and full transition-trace evidence before promotion." + "status": "missing", + "evidence": "No fresh revert/fault control was run for the retained selector. Historical richer-oracle statement before retirement is preserved in knownGaps and is not current reduced-selector evidence." }, "performanceBudget": { "required": true, @@ -9214,7 +9172,10 @@ "The replay identity schema has not yet been exercised in a live Electron/provider failure.", "Current coverage records anomaly breadcrumbs only, not a full pane lifecycle state-machine trace.", "Current coverage does not prove crash/diagnostics bundle export includes the breadcrumb.", - "Current coverage does not assert forbidden transitions across live Electron/provider flows." + "Current coverage does not assert forbidden transitions across live Electron/provider flows.", + "Module-layout wave1 intentionally retires complete prohibited owning registrations in src/renderer/src/components/terminal-pane/snapshots/replay-guard.test.ts. Lost alarms: a wedged release hands the terminal to pane recovery; a healthy parse completion never notifies pane recovery; HOLDS the guard while a slow replay is still parsing — a probe is queued, never a blind release; records correlatable replay identity without exposing worktree or PTY paths; holds past the probe deadline while sibling completions prove the parser alive; settles guards on a disposed xterm without certifying a wedge. No equivalent replacement coverage or pass for a reduced selector is claimed. All unrelated selectors and historical receipts retain their original scope.", + "Module-layout wave1 retires this complete historical receipt because its explicit current selector was reduced. It does not validate the reduced suite. Original receipt verbatim:\n{\n \"date\": \"2026-07-29\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/replay-guard.test.ts\",\n \"result\": \"passed\",\n \"durationSeconds\": 0.201,\n \"summary\": \"The focused file passed 29 tests; replay anomaly breadcrumbs preserved event classification while adding hashed tab/worktree/leaf correlation and a path-redacted PTY identity.\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/snapshots/replay-guard.test.ts\"\n }", + "Module-layout wave1 historical richer-oracle metadata before identity-registration retirement, retained verbatim without current validation credit: {\"coverageNotes\":\"Renderer unit coverage proves replay-guard lost-completion and certified-wedge events carry correlatable tab, worktree, durable leaf, pane, and redacted PTY identity without exposing path-bearing values. Full provider lifecycle attribution and diagnostics-bundle artifact proof remain gaps.\",\"oracle\":\"Drop a replay write completion while allowing its FIFO probe to parse, then require the lost-completion breadcrumb to include pane ID, stable hashes for tab/worktree/leaf identity, and a path-redacted PTY ID. Existing wedge tests require both lost-completion and certified-dead paths to record their distinct event names. Full pane transition traces and diagnostics-bundle artifact proof remain follow-ups.\",\"redGreenEvidence\":{\"status\":\"partial\",\"evidence\":\"Tests fail if replay anomalies stop recording their event name, omit pane/terminal correlation, or expose the fixture's path-bearing worktree and PTY prefixes. Needs diagnostics-bundle artifact proof and full transition-trace evidence before promotion.\"}}" ], "demotionRule": "Cannot promote if diagnostics are console-only, unbounded, or missing from support artifacts." }, @@ -9241,7 +9202,7 @@ "providers": ["local", "daemon", "ssh", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Local macOS evidence covers main-process pending-output and projection-admission caps, saturated-tail wait detection, direct-SSH source retention/accounting, always-on V1 negotiation with legacy peer fallback, exact provider-generation pause ownership, renderer exit/data ordering, decoder input bounds, bounded reconnect scheduling, and WSL stdio transport settlement through deterministic unit contracts. A joined main/runtime oracle exercises renderer-sourced headed semantics and headless-model snapshot semantics without launching a live paired server. Separately, a macOS-hosted Docker OpenSSH run exercises only the deployed Linux relay and direct SSH provider with an exact 256 KiB source-credit plateau, concurrent PTY typing, fixed-size filesystem frames, Git churn, and owner-lease reconnect. Neither deterministic topology labels nor Docker SSH constitute live headed desktop, headless orca serve, or physical WSL evidence; local/daemon, prior-version daemons, Windows named pipes/ConPTY, folder workspaces, and mixed-version clients also remain uncovered. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Local macOS evidence covers main-process pending-output and projection-admission caps, saturated-tail wait detection, direct-SSH source retention/accounting, always-on V1 negotiation with legacy peer fallback, exact provider-generation pause ownership, renderer exit/data ordering, decoder input bounds, bounded reconnect scheduling, and WSL stdio transport settlement through deterministic unit contracts. A joined main/runtime oracle exercises renderer-sourced headed semantics and headless-model snapshot semantics without launching a live paired server. Separately, a macOS-hosted Docker OpenSSH run exercises only the deployed Linux relay and direct SSH provider with an exact 256 KiB source-credit plateau, concurrent PTY typing, fixed-size filesystem frames, Git churn, and owner-lease reconnect. Neither deterministic topology labels nor Docker SSH constitute live headed desktop, headless orca serve, or physical WSL evidence; local/daemon, prior-version daemons, Windows named pipes/ConPTY, folder workspaces, and mixed-version clients also remain uncovered. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", "motivatingLinks": [ "https://github.com/stablyai/orca/pull/6836", "https://github.com/stablyai/orca/pull/6858", @@ -9249,7 +9210,7 @@ "https://github.com/stablyai/orca/pull/7054" ], "invariant": "High-volume terminal output must stay bounded across daemon socket writes, SSH relay writer/decoder/source retention/reconnect, main model and projection admission, runtime metadata, detectors, and tail checks, main-to-renderer in-flight bytes, renderer scheduler queues, and hidden-output restore without starving focused input. Every new SSH session offers V1 and every same-build relay supports it; legacy delivery is reachable only when capability negotiation proves the peer cannot use V1. Negotiated SSH spans remain exact and contiguous through activation, exit, cancellation, recovery, desktop projection, and required remote replacement; provisional activation data cannot project, reconnect may release it only into the exact attempt's private recovery quarantine after contract validation, and exit seals that quarantine against later same-token frames until ordered admission or exact cancellation proof. Reconnect checkpoint capture freezes exact provider-generation/PTy admission, cancels queued old work, and waits for the running raw completion before exposing its accepted checkpoint; timeout or failure detaches only that PTy's old model, makes the checkpoint unavailable, and releases the bounded fence without closing the shared provider, while the same failure outside an active exact migration remains generation-fatal and overlapping reconnects preserve any earlier outstanding fence. Pending renderer projection IDs are capped and compacted across split remainders, exit preparation owns its renderer fence through finalization, exit-time cancellation transfers published projections before proof commit, generation close fences late proof while draining exact projection waiters, closed-generation identity compacts without weakening stale rejection, canceled source-delivery retirement retains at most one ordered token per PTY, and pause/resume targets only the exact provider generation. Additional subscribers cannot stall the owner, while the required legacy primary retains backpressure.", - "oracle": "Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The current executable slice injects main-process renderer backlog pressure, then asserts ordinary terminal-wait detection without a joined-tail allocation and with full prompt-family continuity, per-PTY and total pending-output caps, a 1,024-ID projection cap with split-remainder compaction, preserved sequenced-tail metadata, active-pending protection ahead of background trimming, exact provider-generation pause ownership, renderer exit/data ordering, and ACK-gated in-flight bounds. The negotiation seam proves every initial connection and reconnect offers V1, the same-build relay advertises V1 without launch flags, old clients remain token-free, and method-not-found peers fall back without installing source ACK publication. The joined source-intake/multiplex oracle blocks renderer or headless serialization, admits one snapshot-covered span and one trailing span, requires replacement reservation only after the authoritative sequence is known, advances upstream ACK eligibility exactly to the covered boundary after SnapshotEnd, and delivers then ACKs the trailing span through the ordinary live path without cancellation. Source-range ledger and multiplex seams additionally require cumulative byte ACK 40 then 100 for one 100-byte frame to release exact byte credit without early source settlement, admit a contiguous higher-generation recovered token while the prior token remains unsettled, and reject stale stream or source generations without releasing in-flight byte credit. Replacement reservation rolls back every earlier span on a later failure, commit requires the exact frozen transfer states, and an authoritatively reclaimed covered span rejects commit without local trim authority while rollback removes the reservation idempotently. The exit-deadline oracle publishes a source-backed desktop projection, advances a fake clock to cancellation, and requires one projection transfer, proof commit, preparation, and final exit with no provider close, retained obligation, duplicate finalization, or process-lifetime cancellation tombstone; a second controlled proof remains pending across generation close and must never publish final exit, while both paths release the renderer preparation lease exactly once. The model-migration oracle accepts span A, blocks span B's raw emulator completion, begins disconnect migration, and proves no checkpoint or reconnect attach can remain at A; releasing B advances the exact checkpoint to B and projects B once. Its fake-clock arm reaches the 10-second deadline, requires checkpoint-unavailable, one exact model reset, zero retained admission charge and timers, and no effect from late raw settlement. Its two-PTY failure arm rejects one running raw callback under an active exact migration and requires one checkpoint-unavailable result, one model reset, zero provider closes, retained sibling checkpoint and transport liveness, zero charges and timers, and an unaffected other generation; a non-migrating sibling oracle still requires generation close. The intake additionally closes 2,048 sequential provider generations into one exact range, rejects stale events across that range, and preserves an out-of-order live gap until its own close. Direct-SSH contracts additionally prove activation-response settlement before the first source frame, claim-gated projection under same-decoder-turn response/data delivery, exact early-ACK reservation through send settlement or same-token retry, recovery completion visible before lease-held frames transfers those frames only into the private quarantine and admits no output until exact checkpoint-to-recoveryEnd coverage, invalid-checkpoint restore retention through response settlement followed by fresh-token retry and one live source frame, isolated saturated-subscriber eviction with healthy owner liveness, preserved legacy-primary backpressure, one-write ownership across write(false)/drain, control selection ahead of queued ordinary PTY input with FIFO lanes and bounded fairness, liveness rebasing, failed-exit retention through late ACK or exact recovery, response-settlement cancellation authority, token-scoped exit cancellation, exact checkpoint-to-recoveryEnd continuity, stale-owner one-shot retry, no physical PTY teardown on recovery failure, exact provider-generation closure and once-only cleanup when recovery cancellation publication or proof rejects, 16 MiB-plus-1 MiB decoder caps, charged per-PTY/session retention budgets, and eight-wide isolated reattach. The live Electron perf oracle adds hidden-output floods, renderer scheduler queue depth, dropped-output-zero normal scenarios, and active key latency budgets before promotion.", + "oracle": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The current executable slice injects main-process renderer backlog pressure, then asserts ordinary terminal-wait detection without a joined-tail allocation and with full prompt-family continuity, per-PTY and total pending-output caps, a 1,024-ID projection cap with split-remainder compaction, preserved sequenced-tail metadata, active-pending protection ahead of background trimming, exact provider-generation pause ownership, renderer exit/data ordering, and ACK-gated in-flight bounds. The negotiation seam proves every initial connection and reconnect offers V1, the same-build relay advertises V1 without launch flags, old clients remain token-free, and method-not-found peers fall back without installing source ACK publication. The joined source-intake/multiplex oracle blocks renderer or headless serialization, admits one snapshot-covered span and one trailing span, requires replacement reservation only after the authoritative sequence is known, advances upstream ACK eligibility exactly to the covered boundary after SnapshotEnd, and delivers then ACKs the trailing span through the ordinary live path without cancellation. Source-range ledger and multiplex seams additionally require cumulative byte ACK 40 then 100 for one 100-byte frame to release exact byte credit without early source settlement, admit a contiguous higher-generation recovered token while the prior token remains unsettled, and reject stale stream or source generations without releasing in-flight byte credit. Replacement reservation rolls back every earlier span on a later failure, commit requires the exact frozen transfer states, and an authoritatively reclaimed covered span rejects commit without local trim authority while rollback removes the reservation idempotently. The exit-deadline oracle publishes a source-backed desktop projection, advances a fake clock to cancellation, and requires one projection transfer, proof commit, preparation, and final exit with no provider close, retained obligation, duplicate finalization, or process-lifetime cancellation tombstone; a second controlled proof remains pending across generation close and must never publish final exit, while both paths release the renderer preparation lease exactly once. The model-migration oracle accepts span A, blocks span B's raw emulator completion, begins disconnect migration, and proves no checkpoint or reconnect attach can remain at A; releasing B advances the exact checkpoint to B and projects B once. Its fake-clock arm reaches the 10-second deadline, requires checkpoint-unavailable, one exact model reset, zero retained admission charge and timers, and no effect from late raw settlement. Its two-PTY failure arm rejects one running raw callback under an active exact migration and requires one checkpoint-unavailable result, one model reset, zero provider closes, retained sibling checkpoint and transport liveness, zero charges and timers, and an unaffected other generation; a non-migrating sibling oracle still requires generation close. The intake additionally closes 2,048 sequential provider generations into one exact range, rejects stale events across that range, and preserves an out-of-order live gap until its own close. Direct-SSH contracts additionally prove activation-response settlement before the first source frame, claim-gated projection under same-decoder-turn response/data delivery, exact early-ACK reservation through send settlement or same-token retry, recovery completion visible before lease-held frames transfers those frames only into the private quarantine and admits no output until exact checkpoint-to-recoveryEnd coverage, invalid-checkpoint restore retention through response settlement followed by fresh-token retry and one live source frame, isolated saturated-subscriber eviction with healthy owner liveness, preserved legacy-primary backpressure, one-write ownership across write(false)/drain, control selection ahead of queued ordinary PTY input with FIFO lanes and bounded fairness, liveness rebasing, failed-exit retention through late ACK or exact recovery, response-settlement cancellation authority, token-scoped exit cancellation, exact checkpoint-to-recoveryEnd continuity, stale-owner one-shot retry, no physical PTY teardown on recovery failure, exact provider-generation closure and once-only cleanup when recovery cancellation publication or proof rejects, 16 MiB-plus-1 MiB decoder caps, charged per-PTY/session retention budgets, and eight-wide isolated reattach. The live Electron perf oracle adds hidden-output floods, renderer scheduler queue depth, dropped-output-zero normal scenarios, and active key latency budgets before promotion.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts", @@ -9390,7 +9351,24 @@ "Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope.", "Historical original SSH assertion metadata before policy cuts, preserved verbatim; removed assertions are not current coverage:\n{\n \"file\": \"src/main/ssh/protocol/ssh-multiplexer-transport-writer.test.ts\",\n \"assertions\": [\n \"write(false) owns one frame and later ordinary traffic waits for drain\",\n \"queued control is selected before ordinary PTY backlog at drain while each lane remains FIFO\",\n \"four-control fairness guarantees ordinary progress without starving control\",\n \"one coalesced liveness bypass is allowed per saturated epoch\",\n \"saturation and drain transitions are reported exactly once\"\n ]\n }\n{\n \"file\": \"src/main/ssh/protocol/ssh-channel-multiplexer.test.ts\",\n \"assertions\": [\n \"self-imposed writer saturation suppresses false death and rebases both health clocks on drain\"\n ]\n }", "Historical complete dated writer/backpressure receipt retired after its source changed, preserved verbatim including executed command and path-only currentCommand; not current validation:\n{\n \"date\": \"2026-07-29\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/ssh/ssh-multiplexer-transport-writer.test.ts src/main/ssh/ssh-channel-multiplexer-backpressure.test.ts --reporter=dot\",\n \"result\": \"passed\",\n \"durationSeconds\": 6.89,\n \"summary\": \"Thirteen current-head deterministic files passed 150 tests across exit-sealed private recovery, stale-transfer cancellation authority, bounded latest-token retirement, restore retirement, fail-closed recovery cancellation, partial ACK and token rotation, reclaimed-span replacement, mux lane fairness, provisional activation, and exit-proof ordering; no live topology was exercised.\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/ssh/protocol/ssh-multiplexer-transport-writer.test.ts src/main/ssh/protocol/ssh-channel-multiplexer-backpressure.test.ts --reporter=dot\"\n }", - "Historical provider scope before changed-source receipt retirement: [\"ssh\"]" + "Historical provider scope before changed-source receipt retirement: [\"ssh\"]", + "Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed.", + "Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed.", + "Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed.", + "Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed.", + "Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation.", + "Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed.", + "Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked.", + "Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed.", + "Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms.", + "Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery.", + "Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction.", + "Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed.", + "Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed.", + "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed.", + "Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed.", + "Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed.", + "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired." ], "demotionRule": "Cannot promote without metric artifacts and bounded-byte assertions." }, @@ -9626,7 +9604,7 @@ "providers": ["ssh", "remote-runtime", "wsl"], "coveredPlatforms": ["macos"], "coveredProviders": ["ssh", "remote-runtime"], - "coverageNotes": "Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/ssh/connection/ssh-connection-manager.test.ts: tears a failed startup down quietly, so its error is not replaced by a disconnect; marks a dial that never reached the host, so setup reports SSH’s reason; removes the registration when bulk teardown fails; leaves a connection whose own reconnect is asking the user alone; clears the pool entry when the closed connection is still the registered one; still reuses a connection that is already up; dials a user's connection test. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2052 (sources2049/2050/2051): Remove complete low-value restored-pane-title and pane-visibility-identity suites and their current selectors. Their supplied snapshot/title and nullable identity-comparison alarms are intentionally lost without replacement. Unrelated dated evidenceRuns remain unchanged and do not validate the reduced commands. No fresh gate execution, actual PTY/provider, rendered, remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the terminal-create idempotency forwarding suite and its prospective selector. Preserve2 unrelated receipts without claiming the lost forwarding alarm was replaced. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the sole supplied public-SSH-state spread/sanitized-error projection and its provider-authority-pair alias. Also delete the complete tiny one-shot split-startup wrapper suite: callback-visible temporary field/reset, sequential payload and thrown-sentinel reset alarms disappear. No SSH provider epoch handoff, connection, process startup or actual terminal split was performed by either deleted suite. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): Audit1645 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1342 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1301 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic renderer coverage proves retained native and runtime SSH payloads are admitted through production routes only with valid complete authority, stale cleanup cannot unregister a replacement runtime terminal, direct SSH Git and folder panes keep their PTY bindings through disconnect and reconnect, one authority chain stops after two automatic attempts even when each timeout exceeds the rolling window, rejected acknowledgements mutate no store maps, and one shared exact attempt admits every concurrent split-pane spawn and reattach while preserving the first PTY as the tab fallback. A later sibling failure rotates the tab once, stale callbacks from the prior attempt mutate no state, split remount activity suppression is counted per leaf, primary PTY exit promotes a bound survivor or preserves an empty continuation gap for a late sibling, and primary, non-primary, or null-PTY detach preserves exact authority on both resulting tabs. Intentional pane disposal cancels its settlement timer without breaking StrictMode remount timeout ownership. A mounted remote-runtime terminal survives repeated transport partitions without changing PTY identity. A real encrypted-WebSocket oracle proves a successful reachability probe can replace a pre-ready shared-control socket without rejecting or duplicating the waiting RPC. Direct SSH coordinator tests cover immediate terminal finalization, hydration correction, damping, bounded retry, and telemetry non-interference. Client/server heartbeat tests cover timer suspension, socket generations fence stale callbacks, cold restored-terminal attachment retries, cached pixels remain unhealthy until authoritative replay, automatic retries stop after one minute, manual reconnect preserves the PTY, and pane closure releases recovery UI state. Current-transport recovery clears every error that transport surfaced without clearing or displaying a sibling pane's errors, while transport suppression, pane retention, and the rendered surface are independently bounded. Current macOS Electron journeys against an ephemeral Linux Docker SSH target cover exact-authority repo/worktree hydration, live terminal recovery after disconnect/reconnect, and eager six-terminal remount after renderer reload. A Windows remote-runtime smoke covers reachability and PTY round-trip. Multi-target live fanout, paired-close, WSL, and patched live partition journeys remain gaps. The test-value audit narrowed resolved-worktree-execution-host.test.ts to cache reuse and invalidation. Its direct hydrated-worktree, missing-folder, restored-owner, host-stamp and empty-runtime selection alarms are lost. Other routing and recovery suites do not establish equivalent selector coverage; historical run commands and results remain historical. The test-value audit removes standalone unwritten/released renderer-authority and cross-scope request-count examples. The retained synthetic mirror/store/sidebar and pending-inventory checks do not establish real PTY byte ownership, SSH reconnection or equivalent replacement coverage; historical commands and results remain historical. The test-value audit removes direct join/label ledgers, immediate failure and negative-only stale/removal/partial-authority examples, plus the standalone retained/live event projection. Retained synthetic store/hydration compositions do not establish real SSH continuity, remote authority delivery or equivalent replacement alarms. Historical commands and results remain historical. The renderer scheduling fixture retains in-flight coalescing only. Its immediate publication and negative stale-SSH-cleanup call ledgers were removed; the retained SSH recovery evidence does not replace those alarms. The accepted-handle-events observer suite is removed, including its scoped listener and settlement-release assertions. These observer alarms are lost; retained SSH/transport journeys are not equivalent replacement coverage. The test-value audit removed repeated remote-handle rotation inventories and snapshot-first pending-restart migration examples from terminal-pty-identity-replacement.test.ts, plus direct foreground metadata setter, confirmation, evidence-enum, and prefix/worktree cleanup examples. Those rotation, pending-restart, snapshot-first migration, and foreground scalar-update alarms are lost. The retained replacement case observes pane and tab identities in one subscriber publication; it does not establish equivalent migration, process-evidence, or input-routing coverage. Historical commands and results remain historical. The test-value audit narrows terminals-hydration.test.ts to a real reconnect batch with one measured store publication and hydration-seeded history consumed by a subsequent visit/Back check. Direct split-layout, runtime/folder/floating restoration, dead-leaf focus, cold/known-absent SSH deferral, title, default-tab marker, navigation initialization, and hydrationSucceeded scalar examples are removed; those specific alarms are lost. No actual target-removal transition, live SSH connection, session writer, or persisted restart is exercised by the retained cases. The old target-scoped/snapshot assertion references are retired because the current file does not contain those oracles. Other suites and historical runs do not establish equivalent replacement coverage. Audit1299 removes tests/e2e/terminal-cold-activation-deferral.spec.ts. Private-state/work-budget/assembled-fixture alarms are intentionally lost; retained suites are not equivalent replacement coverage. No new runtime/platform evidence is claimed. Audit1301: src/renderer/src/runtime/remote-runtime-session-tabs-inflight.test.ts reduced. Direct dedupe eviction/count and equal receipt-position sample loses authored alarm. No equivalent replacement coverage is claimed. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1342: src/renderer/src/hooks/ipc-events/direct-ssh-connect-reply-routing.test.ts removed. Initial and event-triggered partial-authority hydration fixture alarms disappear. src/renderer/src/components/terminal-pane/terminal-error-accumulation.test.ts removed. Multiline dedup/storm bounds, resource classification/collision, scoped clear/reconnect strip and1000-pane map count alarms disappear. No equivalent replacement coverage is claimed. Audit1396: src/renderer/src/components/terminal-pane/pty-connection-pending-spawn.spec.ts reduced. Lose standalone debug-state retention/log silence alarm. React StrictMode is not mounted; bindings manually simulate remount over mocked transport. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1400: src/main/ipc/ssh/ssh.test.ts reduced. Lose trivial missing target and mocked publication inventory. Preexisting unresolved ../ssh/ssh-port-scanner mock is recorded, not fixed. src/renderer/src/runtime/sync-runtime-graph-scheduling.test.ts removed. Removes whole coalescing call-count suite; no newest-state delivery or replacement claim. src/renderer/src/store/slices/terminal-pty-identity-replacement.test.ts reduced. Removes three no-op/work-count registrations; retains externally observed ownership consistency. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1412: src/main/ssh/ssh-provider-authority.test.ts removed. Loses real AbortController revocation/target isolation/reentrancy outcomes, recreated-target generation-floor/session rollover behavior, stale mutation refusal and settled-registration cleanup alarms. These useful alarms are deliberately lost; no equivalent cancellation coverage is claimed. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1743 removes the standalone line-height clamp/default and pane cwd fallback helper tests (5 authored cases). These trivial-helper alarms are intentionally lost, with no equivalent replacement. Only current commands/testFiles lose the deleted selectors; historical receipts and evidenceRuns remain unchanged and do not validate the reduced commands.", + "coverageNotes": "Audit3096: remove the deleted reconnect-banner selector and its two UI aliases. The reduced recovery-state selector retains only the deadline cancelling pending backoff and explicit retry owning a new epoch alias; healthy-replacement stale-schedule and independent caller-cutoff cancellation aliases retire. Other retained state cases cover reentrant retry, owner settlement and same-epoch parked revival, without replacing those removed alarms. Prior admission-selector retirement, archived July 28 receipt, unrelated selectors/claims/receipts and old gaps remain unchanged; no fresh execution is claimed. Audit3086: retire the destroyed fresh-session fallback settlement/non-destructive reattach alias and its direct selector; retain the detach/attach selector and assertion unchanged. The retained admission cases cover adopt-before-data and explicitly buffered-death admission without a new spawn, without replacing fallback retirement. July 28 evidence was already archived by audit3077; no duplicate retirement or new execution is claimed. Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/ssh/connection/ssh-connection-manager.test.ts: tears a failed startup down quietly, so its error is not replaced by a disconnect; marks a dial that never reached the host, so setup reports SSH’s reason; removes the registration when bulk teardown fails; leaves a connection whose own reconnect is asking the user alone; clears the pool entry when the closed connection is still the registered one; still reuses a connection that is already up; dials a user's connection test. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2052 (sources2049/2050/2051): Remove complete low-value restored-pane-title and pane-visibility-identity suites and their current selectors. Their supplied snapshot/title and nullable identity-comparison alarms are intentionally lost without replacement. Unrelated dated evidenceRuns remain unchanged and do not validate the reduced commands. No fresh gate execution, actual PTY/provider, rendered, remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the terminal-create idempotency forwarding suite and its prospective selector. Preserve2 unrelated receipts without claiming the lost forwarding alarm was replaced. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the sole supplied public-SSH-state spread/sanitized-error projection and its provider-authority-pair alias. Also delete the complete tiny one-shot split-startup wrapper suite: callback-visible temporary field/reset, sequential payload and thrown-sentinel reset alarms disappear. No SSH provider epoch handoff, connection, process startup or actual terminal split was performed by either deleted suite. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): Audit1645 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1342 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1301 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic renderer coverage proves retained native and runtime SSH payloads are admitted through production routes only with valid complete authority, stale cleanup cannot unregister a replacement runtime terminal, direct SSH Git and folder panes keep their PTY bindings through disconnect and reconnect, one authority chain stops after two automatic attempts even when each timeout exceeds the rolling window, rejected acknowledgements mutate no store maps, and one shared exact attempt admits every concurrent split-pane spawn and reattach while preserving the first PTY as the tab fallback. A later sibling failure rotates the tab once, stale callbacks from the prior attempt mutate no state, split remount activity suppression is counted per leaf, primary PTY exit promotes a bound survivor or preserves an empty continuation gap for a late sibling, and primary, non-primary, or null-PTY detach preserves exact authority on both resulting tabs. Intentional pane disposal cancels its settlement timer without breaking StrictMode remount timeout ownership. A mounted remote-runtime terminal survives repeated transport partitions without changing PTY identity. A real encrypted-WebSocket oracle proves a successful reachability probe can replace a pre-ready shared-control socket without rejecting or duplicating the waiting RPC. Direct SSH coordinator tests cover immediate terminal finalization, hydration correction, damping, bounded retry, and telemetry non-interference. Client/server heartbeat tests cover timer suspension, socket generations fence stale callbacks, cold restored-terminal attachment retries, cached pixels remain unhealthy until authoritative replay, automatic retries stop after one minute, manual reconnect preserves the PTY, and pane closure releases recovery UI state. Current-transport recovery clears every error that transport surfaced without clearing or displaying a sibling pane's errors, while transport suppression, pane retention, and the rendered surface are independently bounded. Current macOS Electron journeys against an ephemeral Linux Docker SSH target cover exact-authority repo/worktree hydration, live terminal recovery after disconnect/reconnect, and eager six-terminal remount after renderer reload. A Windows remote-runtime smoke covers reachability and PTY round-trip. Multi-target live fanout, paired-close, WSL, and patched live partition journeys remain gaps. The test-value audit narrowed resolved-worktree-execution-host.test.ts to cache reuse and invalidation. Its direct hydrated-worktree, missing-folder, restored-owner, host-stamp and empty-runtime selection alarms are lost. Other routing and recovery suites do not establish equivalent selector coverage; historical run commands and results remain historical. The test-value audit removes standalone unwritten/released renderer-authority and cross-scope request-count examples. The retained synthetic mirror/store/sidebar and pending-inventory checks do not establish real PTY byte ownership, SSH reconnection or equivalent replacement coverage; historical commands and results remain historical. The test-value audit removes direct join/label ledgers, immediate failure and negative-only stale/removal/partial-authority examples, plus the standalone retained/live event projection. Retained synthetic store/hydration compositions do not establish real SSH continuity, remote authority delivery or equivalent replacement alarms. Historical commands and results remain historical. The renderer scheduling fixture retains in-flight coalescing only. Its immediate publication and negative stale-SSH-cleanup call ledgers were removed; the retained SSH recovery evidence does not replace those alarms. The accepted-handle-events observer suite is removed, including its scoped listener and settlement-release assertions. These observer alarms are lost; retained SSH/transport journeys are not equivalent replacement coverage. The test-value audit removed repeated remote-handle rotation inventories and snapshot-first pending-restart migration examples from terminal-pty-identity-replacement.test.ts, plus direct foreground metadata setter, confirmation, evidence-enum, and prefix/worktree cleanup examples. Those rotation, pending-restart, snapshot-first migration, and foreground scalar-update alarms are lost. The retained replacement case observes pane and tab identities in one subscriber publication; it does not establish equivalent migration, process-evidence, or input-routing coverage. Historical commands and results remain historical. The test-value audit narrows terminals-hydration.test.ts to a real reconnect batch with one measured store publication and hydration-seeded history consumed by a subsequent visit/Back check. Direct split-layout, runtime/folder/floating restoration, dead-leaf focus, cold/known-absent SSH deferral, title, default-tab marker, navigation initialization, and hydrationSucceeded scalar examples are removed; those specific alarms are lost. No actual target-removal transition, live SSH connection, session writer, or persisted restart is exercised by the retained cases. The old target-scoped/snapshot assertion references are retired because the current file does not contain those oracles. Other suites and historical runs do not establish equivalent replacement coverage. Audit1299 removes tests/e2e/terminal-cold-activation-deferral.spec.ts. Private-state/work-budget/assembled-fixture alarms are intentionally lost; retained suites are not equivalent replacement coverage. No new runtime/platform evidence is claimed. Audit1301: src/renderer/src/runtime/remote-runtime-session-tabs-inflight.test.ts reduced. Direct dedupe eviction/count and equal receipt-position sample loses authored alarm. No equivalent replacement coverage is claimed. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1342: src/renderer/src/hooks/ipc-events/direct-ssh-connect-reply-routing.test.ts removed. Initial and event-triggered partial-authority hydration fixture alarms disappear. src/renderer/src/components/terminal-pane/terminal-error-accumulation.test.ts removed. Multiline dedup/storm bounds, resource classification/collision, scoped clear/reconnect strip and1000-pane map count alarms disappear. No equivalent replacement coverage is claimed. Audit1396: src/renderer/src/components/terminal-pane/pty-connection-pending-spawn.spec.ts reduced. Lose standalone debug-state retention/log silence alarm. React StrictMode is not mounted; bindings manually simulate remount over mocked transport. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1400: src/main/ipc/ssh/ssh.test.ts reduced. Lose trivial missing target and mocked publication inventory. Preexisting unresolved ../ssh/ssh-port-scanner mock is recorded, not fixed. src/renderer/src/runtime/sync-runtime-graph-scheduling.test.ts removed. Removes whole coalescing call-count suite; no newest-state delivery or replacement claim. src/renderer/src/store/slices/terminal-pty-identity-replacement.test.ts reduced. Removes three no-op/work-count registrations; retains externally observed ownership consistency. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1412: src/main/ssh/ssh-provider-authority.test.ts removed. Loses real AbortController revocation/target isolation/reentrancy outcomes, recreated-target generation-floor/session rollover behavior, stale mutation refusal and settled-registration cleanup alarms. These useful alarms are deliberately lost; no equivalent cancellation coverage is claimed. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1743 removes the standalone line-height clamp/default and pane cwd fallback helper tests (5 authored cases). These trivial-helper alarms are intentionally lost, with no equivalent replacement. Only current commands/testFiles lose the deleted selectors; historical receipts and evidenceRuns remain unchanged and do not validate the reduced commands.", "motivatingLinks": [ "https://linear.app/stably/issue/STA-3107", "https://github.com/stablyai/orca/pull/12664", @@ -9641,13 +9619,12 @@ "https://github.com/stablyai/orca/issues/12902" ], "invariant": "SSH, WSL, and remote-runtime restore paths must treat provider listing failures and unknown liveness as unknown, not dead, while still avoiding duplicate spawn and clearing expired relay leases exactly once. Direct SSH disconnect, reconnect, and wake must keep PTY bindings and relay identity, and target snapshot hydration/reconnect cannot reset sibling SSH, local, WSL, or runtime-owned state. Every restored remote terminal must preserve its provider PTY identity, including the authoritative incarnation returned by a successful session-ID reattach. After a recoverable partition the same authenticated runtime must reattach the same PTY, reject detached input, apply the latest viewport, and report healthy only after authoritative replay. A successful one-shot reachability probe may replace a pre-ready shared-control socket, but waiting RPCs must continue onto the replacement under their original deadline without duplicate host delivery or retained request bytes. Automatic PTY recovery stops after one bounded minute without a fatal terminal error; a manual reconnect starts a newly fenced epoch against the same PTY, and closed panes retain no recovery UI state. Successful current-transport recovery must clear every stale error surfaced for that pane without clearing or displaying a sibling pane's error; a later genuine failure must remain visible. Each transport retains at most eight suppressed messages, each pane retains at most eight distinct messages, and the rendered surface retains at most 24 lines and 4,000 characters. One capability-gated terminal-create mutation must produce at most one host PTY across an unknown response outcome, remain manually retryable after cutoff, and never let a stale completion replace a newer pane lifecycle. Reconnect must alternate exact activation with authoritative inventory so neither a stale activation response nor an activation failure can strand or retire a pane, and activating a parked surface whose persisted binding was already retired must respawn it rather than report a changed owner after signalling its exit.", - "oracle": "Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/ssh/connection/ssh-connection-manager.test.ts: tears a failed startup down quietly, so its error is not replaced by a disconnect; marks a dial that never reached the host, so setup reports SSH’s reason; removes the registration when bulk teardown fails; leaves a connection whose own reconnect is asking the user alone; clears the pool entry when the closed connection is still the registered one; still reuses a connection that is already up; dials a user's connection test. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2052 (sources2049/2050/2051): Remove complete low-value restored-pane-title and pane-visibility-identity suites and their current selectors. Their supplied snapshot/title and nullable identity-comparison alarms are intentionally lost without replacement. Unrelated dated evidenceRuns remain unchanged and do not validate the reduced commands. No fresh gate execution, actual PTY/provider, rendered, remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the terminal-create idempotency forwarding suite and its prospective selector. Preserve2 unrelated receipts without claiming the lost forwarding alarm was replaced. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the sole supplied public-SSH-state spread/sanitized-error projection and its provider-authority-pair alias. Also delete the complete tiny one-shot split-startup wrapper suite: callback-visible temporary field/reset, sequential payload and thrown-sentinel reset alarms disappear. No SSH provider epoch handoff, connection, process startup or actual terminal split was performed by either deleted suite. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Deterministic tests cover bounded stale-handle replacement, suspended heartbeat clocks, cold and established subscription failure, ten partition/recovery cycles, automatic-recovery cutoff, manual reconnect, and direct SSH binding retention. They assert SSH state changes leave PTY bindings in place, relay identity survives, and another target/local/WSL/runtime panes remain byte-identical through target snapshot hydration and reconnect. Both remount callbacks consume split-count activity suppression, intentional dispose emits no failure/timeout, and a same-attempt StrictMode remount still owns one timeout. Hydration clears an untrusted PTY hint without clearing its current pending owner, healthy current-authority bindings suppress correction, hydration finalizes once, and reconnect emits no paired close lifecycle. A provider-level session-ID reattach returns an incarnation, then a legacy exit without an incarnation must resolve to that returned identity rather than minting a fallback identity. The shared-control oracle withholds the first encrypted ready frame, starts one RPC, triggers the successful-probe refresh, then requires exactly two client connections, one host request, a successful response, zero pending calls, and zero retained request bytes. Tests also assert one unsubscribe per remote-runtime epoch, observable recovery phases, stable PTY identity, resumed snapshot/output/input, no healthy state before replay, no retry or input after cutoff, a new manual epoch against the same PTY, quiet recovery UI with an explicit Reconnect action, pane-close state cleanup, one stable create mutation id, old-runtime no-retry behavior, cross-process PTY adoption, and bounded in-flight coordination. A focused recovery oracle surfaces two distinct failures through one transport, completes authoritative replay, and requires both matching clear callbacks; pane-state tests require only the active pane's error to render, matching-pane recovery to preserve sibling and unrelated errors, dismissal to re-admit later failures, and distinct storms to retain only the newest eight messages within 24 lines and 4,000 characters. The retained store replacement assertion observes one atomic pane/tab subscriber publication; repeated rotations and snapshot-first pending-restart migration no longer have their direct store examples.", + "oracle": "Audit3096: remove the deleted reconnect-banner selector and its two UI aliases. The reduced recovery-state selector retains only the deadline cancelling pending backoff and explicit retry owning a new epoch alias; healthy-replacement stale-schedule and independent caller-cutoff cancellation aliases retire. Other retained state cases cover reentrant retry, owner settlement and same-epoch parked revival, without replacing those removed alarms. Prior admission-selector retirement, archived July 28 receipt, unrelated selectors/claims/receipts and old gaps remain unchanged; no fresh execution is claimed. Audit3086: retire the destroyed fresh-session fallback settlement/non-destructive reattach alias and its direct selector; retain the detach/attach selector and assertion unchanged. The retained admission cases cover adopt-before-data and explicitly buffered-death admission without a new spawn, without replacing fallback retirement. July 28 evidence was already archived by audit3077; no duplicate retirement or new execution is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/ssh/connection/ssh-connection-manager.test.ts: tears a failed startup down quietly, so its error is not replaced by a disconnect; marks a dial that never reached the host, so setup reports SSH’s reason; removes the registration when bulk teardown fails; leaves a connection whose own reconnect is asking the user alone; clears the pool entry when the closed connection is still the registered one; still reuses a connection that is already up; dials a user's connection test. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2052 (sources2049/2050/2051): Remove complete low-value restored-pane-title and pane-visibility-identity suites and their current selectors. Their supplied snapshot/title and nullable identity-comparison alarms are intentionally lost without replacement. Unrelated dated evidenceRuns remain unchanged and do not validate the reduced commands. No fresh gate execution, actual PTY/provider, rendered, remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the terminal-create idempotency forwarding suite and its prospective selector. Preserve2 unrelated receipts without claiming the lost forwarding alarm was replaced. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the sole supplied public-SSH-state spread/sanitized-error projection and its provider-authority-pair alias. Also delete the complete tiny one-shot split-startup wrapper suite: callback-visible temporary field/reset, sequential payload and thrown-sentinel reset alarms disappear. No SSH provider epoch handoff, connection, process startup or actual terminal split was performed by either deleted suite. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Deterministic tests cover bounded stale-handle replacement, suspended heartbeat clocks, cold and established subscription failure, ten partition/recovery cycles, automatic-recovery cutoff, manual reconnect, and direct SSH binding retention. They assert SSH state changes leave PTY bindings in place, relay identity survives, and another target/local/WSL/runtime panes remain byte-identical through target snapshot hydration and reconnect. Both remount callbacks consume split-count activity suppression, intentional dispose emits no failure/timeout, and a same-attempt StrictMode remount still owns one timeout. Hydration clears an untrusted PTY hint without clearing its current pending owner, healthy current-authority bindings suppress correction, hydration finalizes once, and reconnect emits no paired close lifecycle. A provider-level session-ID reattach returns an incarnation, then a legacy exit without an incarnation must resolve to that returned identity rather than minting a fallback identity. The shared-control oracle withholds the first encrypted ready frame, starts one RPC, triggers the successful-probe refresh, then requires exactly two client connections, one host request, a successful response, zero pending calls, and zero retained request bytes. Tests also assert one unsubscribe per remote-runtime epoch, observable recovery phases, stable PTY identity, resumed snapshot/output/input, no healthy state before replay, no retry or input after cutoff, a new manual epoch against the same PTY, quiet recovery UI with an explicit Reconnect action, pane-close state cleanup, one stable create mutation id, old-runtime no-retry behavior, cross-process PTY adoption, and bounded in-flight coordination. A focused recovery oracle surfaces two distinct failures through one transport, completes authoritative replay, and requires both matching clear callbacks; pane-state tests require only the active pane's error to render, matching-pane recovery to preserve sibling and unrelated errors, dismissal to re-admit later failures, and distinct storms to retain only the newest eight messages within 24 lines and 4,000 characters. The retained store replacement assertion observes one atomic pane/tab subscriber publication; repeated rotations and snapshot-first pending-restart migration no longer have their direct store examples.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/paired-reconnect-multi-pane-materialization.test.ts src/renderer/src/runtime/web-session-tabs-sync/agent-status/paired-reconnect-sidebar-agent-count.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/resolved-worktree-execution-host.test.ts src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-surface-replacement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/store/terminals/terminal-pty-identity-replacement.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-reattach-admission.test.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-detach-attach-handoff.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-attach-subscription.test.ts --reporter=dot", - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-attach-subscription.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-surface-replacement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-expired-pane-recovery.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-outcome-recovery.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/remote-runtime-pty-recovery-state.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/TerminalRemoteRuntimeReconnectBanner.test.tsx src/shared/remote-runtime/remote-runtime-socket-liveness.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-socket-generation.test.ts src/shared/remote-runtime/remote-runtime-client-error-classification.test.ts src/main/runtime/rpc/remote-runtime-server-heartbeat.test.ts src/main/runtime/terminal/launch/orca-runtime-terminal-create-idempotency.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-detach-attach-handoff.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-surface-replacement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-expired-pane-recovery.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-outcome-recovery.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/remote-runtime-pty-recovery-state.test.ts src/shared/remote-runtime/remote-runtime-socket-liveness.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-socket-generation.test.ts src/shared/remote-runtime/remote-runtime-client-error-classification.test.ts src/main/runtime/rpc/remote-runtime-server-heartbeat.test.ts src/main/runtime/terminal/launch/orca-runtime-terminal-create-idempotency.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/ui/workspace-navigation-history-hydration.test.ts src/renderer/src/store/repos/repos-ssh-host-reconciliation.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/ssh/ssh.test.ts src/main/ipc/worktrees-ssh-repo-owner-resolution.test.ts src/main/ssh/connection/ssh-connection-manager.test.ts src/main/ssh/connection/ssh-connection.test.ts src/preload/ssh-authority-forwarding.test.ts src/renderer/src/runtime/rpc/subscriptions/runtime-client-events.test.ts src/renderer/src/runtime/hosts/ssh/runtime-environment-ssh-state.test.ts src/shared/ssh-retained-payload-admission.test.ts --reporter=dot", "pnpm exec electron-vite build --mode e2e", @@ -9662,16 +9639,13 @@ "src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts", "src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts", "src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts", - "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-reattach-admission.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-detach-attach-handoff.test.ts", - "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-attach-subscription.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-surface-replacement.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-expired-pane-recovery.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-outcome-recovery.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/remote-runtime-pty-recovery-state.test.ts", - "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/TerminalRemoteRuntimeReconnectBanner.test.tsx", "src/renderer/src/store/terminals/terminal-pty-identity-replacement.test.ts", "src/shared/remote-runtime/remote-runtime-socket-liveness.test.ts", "src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts", @@ -9713,15 +9687,6 @@ "replacement polling and each in-flight request share a 15-second deadline, then accepted snapshots own recovery without input re-arming polling" ] }, - { - "file": "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-attach-subscription.test.ts", - "assertions": [ - "cold restored-terminal subscription failure retries and resumes snapshot, output, and input without a fatal error", - "a canonical close before subscription readiness opens exactly one replacement stream without surfacing a fatal error", - "cached terminal pixels remain disconnected until authoritative replay completes", - "authoritative current-stream replay clears every distinct error surfaced by that transport" - ] - }, { "file": "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts", "assertions": [ @@ -9747,16 +9712,7 @@ { "file": "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/remote-runtime-pty-recovery-state.test.ts", "assertions": [ - "a healthy replacement invalidates the prior recovery epoch so a slower failure cannot re-arm retry", - "the automatic-recovery deadline cancels pending backoff and a manual retry owns a new epoch", - "a caller-owned recovery cutoff cancels scheduled work and remains disconnected" - ] - }, - { - "file": "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/TerminalRemoteRuntimeReconnectBanner.test.tsx", - "assertions": [ - "automatic recovery renders as a quiet bounded status without a button", - "the disconnected state exposes one explicit Reconnect action" + "the automatic-recovery deadline cancels pending backoff and a manual retry owns a new epoch" ] }, { @@ -9828,12 +9784,6 @@ "a StrictMode remount joins the pending spawn instead of starting a second one" ] }, - { - "file": "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-reattach-admission.test.ts", - "assertions": [ - "a destroyed fresh session fallback settles retirement before it can publish handlers, and reattach remains non-destructive" - ] - }, { "file": "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-detach-attach-handoff.test.ts", "assertions": [ @@ -9851,16 +9801,6 @@ "durationSeconds": 2.54, "summary": "Seven deterministic STA-3107 contracts passed across six-pane multiplex rematerialization and client-owned sidebar-row retention after sleep/wake.", "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/paired-reconnect-multi-pane-materialization.test.ts src/renderer/src/runtime/web-session-tabs-sync/agent-status/paired-reconnect-sidebar-agent-count.test.ts --reporter=dot" - }, - { - "date": "2026-07-28", - "runner": "local", - "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport-reattach-admission.test.ts src/renderer/src/components/terminal-pane/pty-transport-detach-attach-handoff.test.ts", - "result": "passed", - "durationSeconds": 1.48, - "summary": "All 90 transport tests passed, including pre-publication admission rejection, handler-complete non-destructive detach for obsolete SSH reattach transports, settled retirement of rejected or destroyed fresh fallbacks, and reported shutdown refusal.", - "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-reattach-admission.test.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-detach-attach-handoff.test.ts" } ], "runtimeBudget": { @@ -9885,6 +9825,10 @@ "Include reconnect/polling artifacts that identify provider, connection id, and lease state." ], "knownGaps": [ + "Audit3077 reduces the IPC handoff suite while retaining the obsolete-reattach detach observer case and its alias. Removed nominal no-kill and gauge-cleanup alarms have no equivalent replacement.", + "Audit3077 retires this complete dated receipt because its selected source was reduced. It does not validate the reduced selector. Original receipt verbatim:\n{\n \"date\": \"2026-07-28\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport-reattach-admission.test.ts src/renderer/src/components/terminal-pane/pty-transport-detach-attach-handoff.test.ts\",\n \"result\": \"passed\",\n \"durationSeconds\": 1.48,\n \"summary\": \"All 90 transport tests passed, including pre-publication admission rejection, handler-complete non-destructive detach for obsolete SSH reattach transports, settled retirement of rejected or destroyed fresh fallbacks, and reported shutdown refusal.\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-reattach-admission.test.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-detach-attach-handoff.test.ts\"\n }", + "Audit3069 retires nominal spawn/resume/banner wiring, first-fit and lookup-budget variants, private pending-map checks, the split-CWD disposal suite and startup command/draft baseline variants. Distinct regression alarms are intentionally lost without equivalent replacement; retained ownership, cancellation and recovery cases remain. Existing selectors and dated evidence retain their original scope.", + "Audit3061 retires the park-model supplied snapshot suite and nominal mode, cursor, focus, geometry and remote resume metadata variants. Their distinct alarms are intentionally lost; six retained mode/remote cases preserve selected tail-order, authority and parse-readiness boundaries without equivalent replacement. Existing selectors and dated evidence retain their original scope.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionTerminalBellAttentionTests } from '../notifications/pty-connection-terminal-bell-attention.spec', registerPtyConnectionTerminalBellAttentionTests(); no additional authored credit. src/renderer/src/store/terminals/workspace-terminal-reconnect-hydration.test.ts: restores daemon terminal wake hints before declaring the session ready. src/main/ssh/connection/ssh-connection.test.ts: transitions to connected on successful connect; captures the negotiated SSH server key fingerprint; allows concurrent exec commands for ssh2 transport; removes startup listeners after ssh2 connect succeeds; scopes lifecycle events and pending handshake timers to one mock client; enables TCP_NODELAY on the new ssh2 client after a reconnect cycle; transitions through connecting → connected states; reports error state on connection failure; disconnect cleans up and sets state to disconnected; getTarget returns a copy of the target; getState returns a copy of the state; throws when connecting a disposed connection. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts: forwards onBell to pane attention and notification policy; hands the bell to the attention module with its pane even when pane attention is off. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts, src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts, src/renderer/src/store/terminals/workspace-terminal-reconnect-hydration.test.ts, src/main/ssh/connection/ssh-connection.test.ts. Unresolved local/computed edges remain explicit debt. Retired active assertionRefs (raw original objects retained as historical only): {\n \"file\": \"src/renderer/src/store/terminals/workspace-terminal-reconnect-hydration.test.ts\",\n \"assertions\": [\"restores daemon terminal wake hints before declaring the session ready\"]\n }", "Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/ssh/connection/ssh-connection-manager.test.ts: tears a failed startup down quietly, so its error is not replaced by a disconnect; marks a dial that never reached the host, so setup reports SSH’s reason; removes the registration when bulk teardown fails; leaves a connection whose own reconnect is asking the user alone; clears the pool entry when the closed connection is still the registered one; still reuses a connection that is already up; dials a user's connection test. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence.", "Audit2065 (sources2063/2064): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionStartupCwdFallbackNoticeTests } from '../startup/pty-connection-startup-cwd-fallback-notice.spec'; registerPtyConnectionStartupCwdFallbackNoticeTests(). src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-startup-cwd-fallback-notice.spec.ts: prints a terminal notice when the startup cwd fell back to the workspace root. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence.", @@ -9931,7 +9875,10 @@ "Audit1983 historical original testFiles object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n\"src/main/runtime/rpc/methods/terminal/terminal-create-idempotency.test.ts\"", "Audit2052 (sources2049/2050/2051): Remove complete low-value restored-pane-title and pane-visibility-identity suites and their current selectors. Their supplied snapshot/title and nullable identity-comparison alarms are intentionally lost without replacement. Unrelated dated evidenceRuns remain unchanged and do not validate the reduced commands. No fresh gate execution, actual PTY/provider, rendered, remote/mobile or cross-platform result is claimed.", "Audit2195 removes the low-value startup admission boolean and host deferral predicate inventories from background-terminal-worktree-mount.test.ts. The reduced source retains concrete targeted mount, prune and reveal ownership transitions, not those oracle assertions. Existing selectors remain unexecuted here; no equivalent replacement or new runtime/provider/platform/budget result is claimed. Original retired assertion object verbatim:\n{\n \"file\": \"src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts\",\n \"assertions\": [\n \"startup waits for hydration before mounting terminal panes while degraded mode remains interactive\",\n \"only an explicit local execution host can defer cold activation\",\n \"SSH, remote-runtime, and unresolved owners remain eager\"\n ]\n }", - "Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Original prospective command before removal: pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/resolved-worktree-execution-host.test.ts src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-surface-replacement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts src/renderer/src/store/terminals/terminal-pty-identity-replacement.test.ts" + "Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Original prospective command before removal: pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/resolved-worktree-execution-host.test.ts src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-surface-replacement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts src/renderer/src/store/terminals/terminal-pty-identity-replacement.test.ts", + "Audit3086: retire the destroyed fresh-session fallback settlement/non-destructive reattach alias and its direct selector; retain the detach/attach selector and assertion unchanged. The retained admission cases cover adopt-before-data and explicitly buffered-death admission without a new spawn, without replacing fallback retirement. July 28 evidence was already archived by audit3077; no duplicate retirement or new execution is claimed.", + "Audit3096: remove the deleted reconnect-banner selector and its two UI aliases. The reduced recovery-state selector retains only the deadline cancelling pending backoff and explicit retry owning a new epoch alias; healthy-replacement stale-schedule and independent caller-cutoff cancellation aliases retire. Other retained state cases cover reentrant retry, owner settlement and same-epoch parked revival, without replacing those removed alarms. Prior admission-selector retirement, archived July 28 receipt, unrelated selectors/claims/receipts and old gaps remain unchanged; no fresh execution is claimed.", + "Module-layout wave1 intentionally retires complete prohibited owning registrations in src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-attach-subscription.test.ts. Lost alarms: attaches to an existing remote runtime terminal handle; reports a rejected multiplex write through the pane recovery callback; does not report a rejected write from a superseded multiplex stream; does not report attachment health until the authoritative PTY snapshot arrives; drops its side-effect gauge from the census on %s; recovers when the first restored-terminal subscription attempt is offline; recovers when the runtime closes before a restored subscription becomes ready; surfaces a fatal error during subscription setup exactly once; reports viewer disconnect as an unverifiable remote exit; clears every retained transport error when the current stream becomes healthy. No equivalent replacement coverage or pass for a reduced selector is claimed. All unrelated selectors and historical receipts retain their original scope." ], "demotionRule": "Cannot promote if provider failure can close panes or if the oracle is screenshot-only." }, @@ -11884,14 +11831,14 @@ "providers": ["local", "daemon", "ssh"], "coveredPlatforms": ["macos"], "coveredProviders": ["local"], - "coverageNotes": "Audit1878 retires the dated reduced-source unit receipt. Only the unchanged macOS local Electron receipts remain current, scoped to their exact commands; reduced unit selectors and SSH have no current execution receipt. Historical pre-audit coverageNotes: Deterministic renderer and IPC-transport tests prove count and text ceilings, oldest-reply shedding, explicit query-reply source routing, ordinary-input preservation, acknowledged-write FIFO barriers, single-worker drain reentrancy, one-reply-per-write delivery for OSC, DA1, and CPR replies, real xterm OSC reply generation, drain-failure containment, teardown settlement, and clear/reuse generation fencing. Remote-runtime tests preserve separate query-reply writes across pending input, async validation, and viewport-claim buffering. Host-contract tests prove a later DA1/CPR reply cannot overtake a deferred OSC reply, including a coalesced legacy-client payload. Live macOS Electron tests cover local PTY OSC replies and interactive typing; a macOS-hosted Docker OpenSSH test proves an upstream-node-pty Linux relay keeps OSC/DA1 replies out of the next fish child's stdin. No live daemon, paired-runtime, WSL, physical Linux/Windows client, or binary mixed-version run is registered.", + "coverageNotes": "Audit3086: retire the immediate-reply ceiling and thrown renderer-write recovery aliases. Narrow FIFO coverage to deferred preconnect validation and teardown coverage to natural-exit stale ordinary/accepted tails; live acknowledged barriers and disconnect/detach branches are intentionally retired. Prior queue cleanup and unchanged Electron receipts remain exact; no replacement or fresh execution is claimed. Audit1878 retires the dated reduced-source unit receipt. Only the unchanged macOS local Electron receipts remain current, scoped to their exact commands; reduced unit selectors and SSH have no current execution receipt. Historical pre-audit coverageNotes: Deterministic renderer and IPC-transport tests prove count and text ceilings, oldest-reply shedding, explicit query-reply source routing, ordinary-input preservation, acknowledged-write FIFO barriers, single-worker drain reentrancy, one-reply-per-write delivery for OSC, DA1, and CPR replies, real xterm OSC reply generation, drain-failure containment, teardown settlement, and clear/reuse generation fencing. Remote-runtime tests preserve separate query-reply writes across pending input, async validation, and viewport-claim buffering. Host-contract tests prove a later DA1/CPR reply cannot overtake a deferred OSC reply, including a coalesced legacy-client payload. Live macOS Electron tests cover local PTY OSC replies and interactive typing; a macOS-hosted Docker OpenSSH test proves an upstream-node-pty Linux relay keeps OSC/DA1 replies out of the next fish child's stdin. No live daemon, paired-runtime, WSL, physical Linux/Windows client, or binary mixed-version run is registered.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/13137", "https://github.com/stablyai/orca/issues/7329", "https://github.com/stablyai/orca/issues/13892" ], "invariant": "The desktop PTY input queue retains at most 64 explicitly sourced pending terminal query replies and 4096 UTF-16 code units. Every retained reply reaches the provider as one atomic write, and ordinary, acknowledged, and reply input share one invocation-ordered FIFO so no later write overtakes an acknowledged write. Reentrant write callbacks cannot start a second drain worker or strand input admitted after clear/reuse. A reply's own echo is contained on the output side by projecting its known echo shapes; the ESC-initial verbatim shape is matched only when complete, never held as a partial, so a query torn at its own ESC is still answered. Overflow removes only the oldest query replies, never ordinary input except the documented modified-F3/CPR byte collision, and failure or teardown cannot clear a newer queue generation or strand an acknowledged promise.", - "oracle": "Audit1878 retires the dated reduced-source unit receipt. Only the unchanged macOS local Electron receipts remain current, scoped to their exact commands; reduced unit selectors and SSH have no current execution receipt. Historical pre-audit oracle: Synchronously enqueue separate 10,000-entry OSC and DA1 reply floods before the scheduled drain and assert that only the initial immediate reply and newest 64 pending replies are written, each as one provider write, before a trailing keystroke. Stall an acknowledged write between earlier and later ordinary/reply input, then require teardown to settle it and same-id reuse to receive no stale tail. Reenter the queue synchronously from an acknowledged write with both enqueue and clear/reuse, requiring one drain and fresh input delivery only after the stale acknowledged write settles false. At the host boundary, defer an OSC reply and assert that separate or legacy-coalesced DA1/CPR replies flush after it in observed query order. At the remote-runtime boundary, preserve separate writes around pending ordinary input, async validation, and viewport-claim buffering. Repeat behind 10,000 ordinary inputs and exercise the text ceiling, real xterm generation, provider-write failure, rejected yield, and clear/reuse generation fencing.", + "oracle": "Audit3086: retire the immediate-reply ceiling and thrown renderer-write recovery aliases. Narrow FIFO coverage to deferred preconnect validation and teardown coverage to natural-exit stale ordinary/accepted tails; live acknowledged barriers and disconnect/detach branches are intentionally retired. Prior queue cleanup and unchanged Electron receipts remain exact; no replacement or fresh execution is claimed. Audit1878 retires the dated reduced-source unit receipt. Only the unchanged macOS local Electron receipts remain current, scoped to their exact commands; reduced unit selectors and SSH have no current execution receipt. Historical pre-audit oracle: Synchronously enqueue separate 10,000-entry OSC and DA1 reply floods before the scheduled drain and assert that only the initial immediate reply and newest 64 pending replies are written, each as one provider write, before a trailing keystroke. Stall an acknowledged write between earlier and later ordinary/reply input, then require teardown to settle it and same-id reuse to receive no stale tail. Reenter the queue synchronously from an acknowledged write with both enqueue and clear/reuse, requiring one drain and fresh input delivery only after the stale acknowledged write settles false. At the host boundary, defer an OSC reply and assert that separate or legacy-coalesced DA1/CPR replies flush after it in observed query order. At the remote-runtime boundary, preserve separate writes around pending ordinary input, async validation, and viewport-claim buffering. Repeat behind 10,000 ordinary inputs and exercise the text ceiling, real xterm generation, provider-write failure, rejected yield, and clear/reuse generation fencing.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/input/pty-input-write-queue.test.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-input-write.test.ts src/shared/terminal/protocol/queries/terminal-query-reply.test.ts src/shared/terminal/pty/ingress/pty-startup-ingress-live-query-reply.test.ts src/shared/terminal/pty/ingress/pty-startup-reply-echo-shapes.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/output/remote-runtime-pty-batching.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-query-reply-immediate.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-input-coalescing.test.ts", @@ -11914,14 +11861,8 @@ { "file": "src/renderer/src/components/terminal-pane/pty-transport/input/pty-input-write-queue.test.ts", "assertions": [ - "a synchronous 10,000-reply flood writes only the immediate first and newest 64 pending replies before a trailing keystroke", - "10,000 ordinary queued inputs survive a later reply flood while reply retention remains bounded", - "reply-shaped bytes from the ordinary input path never enter the shed-able reply budget", - "reply count and text overflow remove only the oldest pending replies", - "real xterm OSC 10/11 query handlers remain subject to the same retention ceiling", - "retained OSC, DA1, and CPR replies stay one provider write each and both OSC and DA1 floods remain bounded", "provider-write and yield failures settle without unhandled rejection, repeated same-generation admission, or stale-generation clearing", - "clear releases saturated reply accounting and fences in-flight validation before later input", + "clear fences in-flight validation before later input", "acknowledged input is serialized between earlier and later ordinary/reply writes", "clear settles active and pending acknowledged input before same-id queue reuse", "reentrant enqueue cannot start a second drain worker past an unacknowledged write", @@ -11931,10 +11872,8 @@ { "file": "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-input-write.test.ts", "assertions": [ - "sendInputImmediate applies the reply ceiling while sendInput preserves a reply-shaped ordinary payload in exact IPC write order", - "a thrown renderer write triggers one owning-transport recovery callback and rejects later input in that queue generation", - "live and preconnect acknowledged writes remain FIFO barriers for later ordinary and immediate input", - "disconnect, detach, and natural exit settle acknowledged writes and fence same-id stale chunks" + "deferred preconnect validation preserves queued bytes before later accepted, ordinary, and immediate input", + "natural exit settles active acknowledged input and fences ordinary and accepted stale chunks before same-id reuse" ] }, { @@ -12024,11 +11963,13 @@ "Accumulate the normal soak window with zero unexplained flakes." ], "knownGaps": [ + "Audit3077 deletes the delivery-watchdog suite and retires queue flood, conservation, atomicity, retention, echo and heap examples plus preconnect cap/seed/abandon examples. The remaining queue failure/FIFO/reentrancy/generation and preconnect lifetime cases are narrower; no equivalent replacement is claimed.", "No live daemon, paired-runtime, WSL, physical Linux/Windows client, mixed-version, or network-fault run is registered.", "Ordinary-input queue growth predates this change and is outside this reply-only gate.", "Reply overload intentionally sheds the oldest synthetic replies; the modified-F3/CPR byte collision shares that budget, and live application behavior under a pathological query flood is not measured.", "Audit1878 retires this complete dated receipt because a source in its selector was reduced. It does not validate the reduced selector. Original receipt verbatim:\n{\n \"date\": \"2026-08-30\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-input-write-queue.test.ts src/renderer/src/components/terminal-pane/pty-transport-input-write.test.ts src/shared/terminal-query-reply.test.ts src/shared/pty-startup-ingress-live-query-reply.test.ts src/shared/pty-startup-reply-echo-shapes.test.ts\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/input/pty-input-write-queue.test.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-input-write.test.ts src/shared/terminal/protocol/queries/terminal-query-reply.test.ts src/shared/terminal/pty/ingress/pty-startup-ingress-live-query-reply.test.ts src/shared/terminal/pty/ingress/pty-startup-reply-echo-shapes.test.ts\",\n \"result\": \"passed\",\n \"durationSeconds\": 15,\n \"summary\": \"Five files and 149 tests passed in 15.16 seconds, including explicit IPC reply-source routing, the 10,000-reply count and text ceilings, 10,000-entry ordinary backlog preservation, acknowledged-write FIFO barriers, synchronous reentrancy fencing, prompt teardown settlement, same-id generation fencing, real xterm OSC query floods, single-shot drain-failure recovery, and one-reply-per-write echo containment.\"\n }", - "Audit1878 removes standalone reply-classifier inventory, ordinary-keystroke helper/no-write checks and a latency-order title that never executes the host path from pty-startup-ingress-live-query-reply.test.ts. It also removes projection needle/refusal/holdPartial and ConPTY/WSL string/array inventories from pty-startup-reply-echo-shapes.test.ts, including the direct short-needle and ESC-hold guard alarms. Captured echo matching and actual ingress writes/output state remain, without equivalent replacement coverage. Only the two unchanged macOS local Electron receipts remain active; neither proves the reduced five-file unit selector, SSH, a new soak result, or a new measured budget." + "Audit1878 removes standalone reply-classifier inventory, ordinary-keystroke helper/no-write checks and a latency-order title that never executes the host path from pty-startup-ingress-live-query-reply.test.ts. It also removes projection needle/refusal/holdPartial and ConPTY/WSL string/array inventories from pty-startup-reply-echo-shapes.test.ts, including the direct short-needle and ESC-hold guard alarms. Captured echo matching and actual ingress writes/output state remain, without equivalent replacement coverage. Only the two unchanged macOS local Electron receipts remain active; neither proves the reduced five-file unit selector, SSH, a new soak result, or a new measured budget.", + "Audit3086: retire the immediate-reply ceiling and thrown renderer-write recovery aliases. Narrow FIFO coverage to deferred preconnect validation and teardown coverage to natural-exit stale ordinary/accepted tails; live acknowledged barriers and disconnect/detach branches are intentionally retired. Prior queue cleanup and unchanged Electron receipts remain exact; no replacement or fresh execution is claimed." ], "demotionRule": "Keep experimental or revert if ordinary input is evicted, pending replies exceed either ceiling, retained replies are coalesced, a trailing key sits behind more than the bounded reply window, or the gate develops unexplained flakes." }, @@ -12120,7 +12061,7 @@ "providers": ["remote-runtime", "ssh", "local", "daemon"], "coveredPlatforms": [], "coveredProviders": [], - "coverageNotes": "Audit1400 intentionally deletes or reduces the listed sources. No fresh execution result validates their reduced selectors. Historical coverage account: Local macOS evidence covers runtime-RPC stream budgets, paired-renderer parse/discard credit, and negotiated host-side suppression for hidden paired desktop panes. Deferred credit is shared by local and remote transports, batches ACKs at 192 KiB or 4 ms, grows per-stream windows from 512 KiB to 2 MiB and aggregate windows from 2 MiB to 8 MiB, bounds queued output to 256 KiB per stream, and caps each multiplex connection at 32 active or pending streams for an 8 MiB aggregate pending-output ceiling. Deterministic tests cover replay ordering, stale generations, malformed frames, hidden panes, queue eviction, disposal, send/recovery failure, repeated pending-slot replacement, reconnect, mixed-version pause negotiation, and round-robin fairness. The opt-in benchmark models 1/20/100 ms RTT and 1/4/8 viewers, throughput, window use, completion spread and protocol-frame counts. It measures model scheduler elapsed time separately from actual @xterm/headless parser CPU/retained heap; modeled credit and ACK results do not qualify production credit enforcement. Live Android restore evidence, browser/WebGL parser measurements, and legacy JSON subscribe parity remain required. The audit removed the PTY ACK wrapper suite, which replayed credit arithmetic with mocked IPC. Its isolated wrapper alarms are no longer registered here; generic credit and runtime stream tests do not establish equivalent PTY integration coverage. The audit removes the standalone auto-settle-before-deferred-claim example. Nested-owner and claimed-child completion tests remain; they do not establish that removed timing alarm. The test-value audit removes the bulk-ACK threshold, output-pause capability/paused-input, transformed-metadata disposal, late-parser and renderer-throw examples. The retained captured-parser, malformed-frame and failed-ACK timer checks do not exercise real xterm parsing or server credit enforcement and do not replace the removed alarms. Historical run commands and results remain historical. The test-value audit removes the pure mobile stream-decision suite: pause/resume/rearm/viewport branch inventories no longer have that isolated alarm. The surviving stream-hook tests do not establish equivalent WebView restore, PTY resize, input-lease or subscription delivery coverage. Historical run commands and counts are preserved as historical records; a narrowed selector is not a new passed run. Audit1302: src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts: Keep production RPC dispatcher/terminal framing with emitted binary bytes, UTF-8 reconstruction and client ACK releasing genuinely withheld output; also keep the direct binary-subscribe chunk boundary. Remove shared-budget fairness matrix that sleeps real time and relies on exact synthetic per-stream window scheduling. Lose that eight-stream fairness/call wiring alarm; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1341 scope1334 removes/narrows mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1400: src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts removed. Lose ORCA_TERMINAL_PERF_BENCH diagnostic report and local xterm parser measurements; this was not an ordinary CI assertion gate. No equivalent replacement coverage is claimed.", + "coverageNotes": "Audit1400 intentionally deletes or reduces the listed sources. No fresh execution result validates their reduced selectors. Historical coverage account: Local macOS evidence covers runtime-RPC stream budgets, paired-renderer parse/discard credit, and negotiated host-side suppression for hidden paired desktop panes. Deferred credit is shared by local and remote transports, batches ACKs at 192 KiB or 4 ms, grows per-stream windows from 512 KiB to 2 MiB and aggregate windows from 2 MiB to 8 MiB, bounds queued output to 256 KiB per stream, and caps each multiplex connection at 32 active or pending streams for an 8 MiB aggregate pending-output ceiling. Deterministic tests cover replay ordering, stale generations, malformed frames, hidden panes, queue eviction, disposal, send/recovery failure, repeated pending-slot replacement, reconnect, mixed-version pause negotiation, and round-robin fairness. The opt-in benchmark models 1/20/100 ms RTT and 1/4/8 viewers, throughput, window use, completion spread and protocol-frame counts. It measures model scheduler elapsed time separately from actual @xterm/headless parser CPU/retained heap; modeled credit and ACK results do not qualify production credit enforcement. Live Android restore evidence, browser/WebGL parser measurements, and legacy JSON subscribe parity remain required. The audit removed the PTY ACK wrapper suite, which replayed credit arithmetic with mocked IPC. Its isolated wrapper alarms are no longer registered here; generic credit and runtime stream tests do not establish equivalent PTY integration coverage. The audit removes the standalone auto-settle-before-deferred-claim example. Nested-owner and claimed-child completion tests remain; they do not establish that removed timing alarm. The test-value audit removes the bulk-ACK threshold, output-pause capability/paused-input, transformed-metadata disposal, late-parser and renderer-throw examples. The retained captured-parser, malformed-frame and failed-ACK timer checks do not exercise real xterm parsing or server credit enforcement and do not replace the removed alarms. Historical run commands and results remain historical. The test-value audit removes the pure mobile stream-decision suite: pause/resume/rearm/viewport branch inventories no longer have that isolated alarm. The surviving stream-hook tests do not establish equivalent WebView restore, PTY resize, input-lease or subscription delivery coverage. Historical run commands and counts are preserved as historical records; a narrowed selector is not a new passed run. Audit1302: src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts: Keep production RPC dispatcher/terminal framing with emitted binary bytes, UTF-8 reconstruction and client ACK releasing genuinely withheld output; also keep the direct binary-subscribe chunk boundary. Remove shared-budget fairness matrix that sleeps real time and relies on exact synthetic per-stream window scheduling. Lose that eight-stream fairness/call wiring alarm; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1341 scope1334 removes/narrows mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1400: src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts removed. Lose ORCA_TERMINAL_PERF_BENCH diagnostic report and local xterm parser measurements; this was not an ordinary CI assertion gate. No equivalent replacement coverage is claimed. Broader617 Mobile owner follow-up retires six whole work-count/timing registrations from mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts, retaining five functional handoff/readiness/absence/recovery registrations. Prior Audit1400 retained-but-unvalidated and archived inventories describe earlier source and remain historical after this follow-up. No equivalent replacement, fresh execution, timing measurement, physical phone, or deployed mixed-host validation is claimed by this source change. Current premerge review correction for the Broader617 Mobile owner follow-up: four additional whole mock-only/mock-produced-state stream registrations are retired, for ten total cuts and one unchanged retained registration, keeps asking until a tab snapshot replaces the exhausted handle. The preceding five-retained description records the superseded candidate, not current coverage. The retained case checks the real hook-owned recovery-needed result; handoff, readiness and absence-marker mock-delivery alarms are intentionally lost without equivalent replacement. Dead test render counting and unused handoff setup are removed. No new native, physical-phone, timing or deployed-host proof is implied.", "motivatingLinks": [ "https://github.com/stablyai/orca/pull/6951", "https://github.com/stablyai/orca/pull/6955", @@ -12177,7 +12118,9 @@ "Audit1400 retained but unvalidated assertion inventory pending a new run of the reduced command:\n[\n {\n \"file\": \"src/main/runtime/rpc/terminal-subscribe-buffer.test.ts\",\n \"assertions\": [\n \"legacy binary output queued during initial snapshot serialization stays bounded\",\n \"stale mobile resize re-stream completions are dropped for legacy binary streams\",\n \"aborted stream signals do not register stale listeners\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-output-batching.test.ts\",\n \"assertions\": [\n \"desktop output bursts coalesce before stream emission\",\n \"large binary output is encoded lazily before the first output frame\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts\",\n \"assertions\": [\n \"requested snapshots fall back smaller when serialized data exceeds the send budget\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts\",\n \"assertions\": [\n \"oversized live output frames are bounded for subscribed binary streams\",\n \"multibyte live output flushes when encoded bytes reach the batch budget\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts\",\n \"assertions\": [\n \"send and recovery serialization failures detach once instead of leaking credit or retrying forever\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts\",\n \"assertions\": [\n \"32 active or pending slots cap aggregate queued output and repeated pending-slot subscribe cancels its older waiter\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts\",\n \"assertions\": [\n \"three negotiated hidden desktop streams emit zero output frames under sustained load while an unpaused stream remains live\",\n \"an older client that omits pause negotiation continues receiving output\"\n ]\n },\n {\n \"file\": \"src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts\",\n \"assertions\": [\n \"a runtime-owned hidden pane pauses output, consumes status/title/theme facts, and keeps input writable\",\n \"reveal resumes before one authoritative snapshot and exact live output with no hidden raw write, loss, or duplication\",\n \"dispose releases pause and unregisters the fact consumer\"\n ]\n },\n {\n \"file\": \"src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-stream-reconnect.test.ts\",\n \"assertions\": [\n \"desired pause reapplies after either capability/snapshot ordering and across reconnect\",\n \"reconnect delivers each authoritative snapshot and post-resume live marker exactly once\"\n ]\n },\n {\n \"file\": \"src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts\",\n \"assertions\": [\n \"nested synchronous deliveries restore the outer credit owner\",\n \"every claimed scheduler child must settle before the parent credits\"\n ]\n },\n {\n \"file\": \"src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts\",\n \"assertions\": [\n \"paired renderer ACK waits for the output scheduler captured parse callback before releasing encoded-byte credit\",\n \"unknown stream output is unsubscribed and malformed framing closes the connection; malformed transformed data is discarded and credited before resync\",\n \"an ACK write failure tears down the stream with zero rearmed flush timers under fake time\"\n ]\n },\n {\n \"file\": \"mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts\",\n \"assertions\": [\n \"trades a lease-only stream for output when a chat tab hands off to a terminal tab\",\n \"repairs a lease-only stream once its WebView reports ready\",\n \"stops rearming a handle whose stream never comes back (covered: %s, #10681)\",\n \"does not charge the rearm budget for a subscribe its own gates turned away\",\n \"charges the rearm budget for a subscribe the bridge refused before returning\",\n \"refills the rearm budget when terminal.list reports the handle again (covered: %s, #10681)\",\n \"does not let a dead PTY buy a new budget with its own `subscribed` ack\",\n \"refills the budget for a rearmed stream that outlives the teardown window\",\n \"keeps an absence marker observed before the budget ran out\",\n \"keeps asking until a tab snapshot replaces the exhausted handle\",\n \"resumes a cold-start lease-only stream when WebView readiness arrives late\"\n ]\n }\n]", "Audit1400 historical assertion inventory for deleted/reduced sources; not current validated assertions:\n[\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts\",\n \"assertions\": [\n \"the opt-in benchmark reports modeled RTT throughput, window use, protocol-frame counts and completion spread, with model scheduler elapsed time and separately measured @xterm/headless parser CPU and retained heap\"\n ]\n }\n]", "Audit1400 archived original active assertionRefs verbatim after retirement of all passed receipts:\n[\n {\n \"file\": \"src/main/runtime/rpc/terminal-subscribe-buffer.test.ts\",\n \"assertions\": [\n \"legacy binary output queued during initial snapshot serialization stays bounded\",\n \"stale mobile resize re-stream completions are dropped for legacy binary streams\",\n \"aborted stream signals do not register stale listeners\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-output-batching.test.ts\",\n \"assertions\": [\n \"desktop output bursts coalesce before stream emission\",\n \"large binary output is encoded lazily before the first output frame\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts\",\n \"assertions\": [\n \"requested snapshots fall back smaller when serialized data exceeds the send budget\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts\",\n \"assertions\": [\n \"oversized live output frames are bounded for subscribed binary streams\",\n \"multibyte live output flushes when encoded bytes reach the batch budget\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts\",\n \"assertions\": [\n \"send and recovery serialization failures detach once instead of leaking credit or retrying forever\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts\",\n \"assertions\": [\n \"32 active or pending slots cap aggregate queued output and repeated pending-slot subscribe cancels its older waiter\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts\",\n \"assertions\": [\n \"three negotiated hidden desktop streams emit zero output frames under sustained load while an unpaused stream remains live\",\n \"an older client that omits pause negotiation continues receiving output\"\n ]\n },\n {\n \"file\": \"src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts\",\n \"assertions\": [\n \"a runtime-owned hidden pane pauses output, consumes status/title/theme facts, and keeps input writable\",\n \"reveal resumes before one authoritative snapshot and exact live output with no hidden raw write, loss, or duplication\",\n \"dispose releases pause and unregisters the fact consumer\"\n ]\n },\n {\n \"file\": \"src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-stream-reconnect.test.ts\",\n \"assertions\": [\n \"desired pause reapplies after either capability/snapshot ordering and across reconnect\",\n \"reconnect delivers each authoritative snapshot and post-resume live marker exactly once\"\n ]\n },\n {\n \"file\": \"src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts\",\n \"assertions\": [\n \"nested synchronous deliveries restore the outer credit owner\",\n \"every claimed scheduler child must settle before the parent credits\"\n ]\n },\n {\n \"file\": \"src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts\",\n \"assertions\": [\n \"paired renderer ACK waits for the output scheduler captured parse callback before releasing encoded-byte credit\",\n \"unknown stream output is unsubscribed and malformed framing closes the connection; malformed transformed data is discarded and credited before resync\",\n \"an ACK write failure tears down the stream with zero rearmed flush timers under fake time\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts\",\n \"assertions\": [\n \"the opt-in benchmark reports modeled RTT throughput, window use, protocol-frame counts and completion spread, with model scheduler elapsed time and separately measured @xterm/headless parser CPU and retained heap\"\n ]\n },\n {\n \"file\": \"mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts\",\n \"assertions\": [\n \"trades a lease-only stream for output when a chat tab hands off to a terminal tab\",\n \"repairs a lease-only stream once its WebView reports ready\",\n \"stops rearming a handle whose stream never comes back (covered: %s, #10681)\",\n \"does not charge the rearm budget for a subscribe its own gates turned away\",\n \"charges the rearm budget for a subscribe the bridge refused before returning\",\n \"refills the rearm budget when terminal.list reports the handle again (covered: %s, #10681)\",\n \"does not let a dead PTY buy a new budget with its own `subscribed` ack\",\n \"refills the budget for a rearmed stream that outlives the teardown window\",\n \"keeps an absence marker observed before the budget ran out\",\n \"keeps asking until a tab snapshot replaces the exhausted handle\",\n \"resumes a cold-start lease-only stream when WebView readiness arrives late\"\n ]\n }\n ]", - "Audit1400 archived active selectors after retirement of all passed receipts: {\"commands\":[\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts --maxWorkers=1\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-subscribe-buffer.test.ts src/main/runtime/rpc/terminal-output-batching.test.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-subscribe-buffer.test.ts src/main/runtime/rpc/terminal-output-batching.test.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts src/renderer/src/runtime/runtime-terminal-stream.test.ts --maxWorkers=1\",\"ORCA_TERMINAL_PERF_BENCH=1 pnpm exec vitest run --config config/vitest.config.ts --disableConsoleIntercept src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts\",\"pnpm --dir mobile exec vitest run --root .. mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts\"],\"testFiles\":[\"src/main/runtime/rpc/terminal-subscribe-buffer.test.ts\",\"src/main/runtime/rpc/terminal-output-batching.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts\",\"src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts\",\"src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-stream-reconnect.test.ts\",\"src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts\",\"src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts\",\"src/renderer/src/runtime/runtime-terminal-stream.test.ts\",\"mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts\"]}" + "Audit1400 archived active selectors after retirement of all passed receipts: {\"commands\":[\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts --maxWorkers=1\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-subscribe-buffer.test.ts src/main/runtime/rpc/terminal-output-batching.test.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-subscribe-buffer.test.ts src/main/runtime/rpc/terminal-output-batching.test.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts src/renderer/src/runtime/runtime-terminal-stream.test.ts --maxWorkers=1\",\"ORCA_TERMINAL_PERF_BENCH=1 pnpm exec vitest run --config config/vitest.config.ts --disableConsoleIntercept src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts\",\"pnpm --dir mobile exec vitest run --root .. mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts\"],\"testFiles\":[\"src/main/runtime/rpc/terminal-subscribe-buffer.test.ts\",\"src/main/runtime/rpc/terminal-output-batching.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts\",\"src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts\",\"src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-stream-reconnect.test.ts\",\"src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts\",\"src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts\",\"src/renderer/src/runtime/runtime-terminal-stream.test.ts\",\"mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts\"]}", + "Broader617 Mobile owner follow-up retires six whole work-count/timing registrations from mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts, retaining five functional handoff/readiness/absence/recovery registrations. Prior Audit1400 retained-but-unvalidated and archived inventories describe earlier source and remain historical after this follow-up. No equivalent replacement, fresh execution, timing measurement, physical phone, or deployed mixed-host validation is claimed by this source change.", + "Current premerge review correction for the Broader617 Mobile owner follow-up: four additional whole mock-only/mock-produced-state stream registrations are retired, for ten total cuts and one unchanged retained registration, keeps asking until a tab snapshot replaces the exhausted handle. The preceding five-retained description records the superseded candidate, not current coverage. The retained case checks the real hook-owned recovery-needed result; handoff, readiness and absence-marker mock-delivery alarms are intentionally lost without equivalent replacement. Dead test render counting and unused handoff setup are removed. No new native, physical-phone, timing or deployed-host proof is implied." ], "demotionRule": "Cannot promote while a supported stream path has uncapped snapshot or live-output buffering." }, @@ -12401,6 +12344,9 @@ "Add Linux and Windows WebGL visibility evidence before claiming cross-platform visual coverage." ], "knownGaps": [ + "Audit3061 retires the park-model supplied snapshot suite and nominal mode, cursor, focus, geometry and remote resume metadata variants. Their distinct alarms are intentionally lost; six retained mode/remote cases preserve selected tail-order, authority and parse-readiness boundaries without equivalent replacement. Existing selectors and dated evidence retain their original scope.", + "Audit3053 reduces hidden-replay coverage by retiring nominal overlap, resize, cursor metadata and standalone stalled-restore variants. Timeout, overflow, identity/generation fences and retained live-output coordination remain; the removed alarms are intentionally lost without equivalent replacement. Existing commands, assertion references and dated evidence retain their original scope.", + "Audit3037 removes seven supplied-input baseline cases from the terminal-input-gating registrar. Input-and-repaint wrapper selectors and unrelated assertions remain; historical receipts do not validate the reduced source bytes. No renewed atlas, renderer, native or performance evidence is claimed.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/render-health/terminal-webgl-atlas-recovery.test.ts: refreshes after each scheduled atlas reset; falls back to a timeout when animation frames are unavailable; continues recovery when a manager throws after scheduling. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts: structural support changed only; no new authored removal credit. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionFreshNativeFollowResetTests } from '../output/pty-connection-fresh-native-follow-reset.spec', registerPtyConnectionFreshNativeFollowResetTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts: repaints from the main-owned snapshot when main drops pending output at the cap. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts: records a mode 2031 subscribe from the raw chunk boundary without answering. src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts: retries a fresh-spawn native follow reset when renderer dimensions return. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts, src/renderer/src/components/terminal-pane/render-health/terminal-webgl-atlas-recovery.test.ts. Unresolved local/computed edges remain explicit debt. Retired active assertionRefs (raw original objects retained as historical only): {\n \"file\": \"src/renderer/src/components/terminal-pane/render-health/terminal-webgl-atlas-recovery.test.ts\",\n \"assertions\": [\"limits atlas recovery to explicit renderer lifecycle events\"]\n }", "The Electron harness used a deterministic visibility-event fallback because BrowserWindow.hide did not change document.visibilityState.", "No isolated live paired-server candidate run is recorded; remote-runtime coverage is a provider-agnostic renderer contract plus production incident evidence.", @@ -12684,7 +12630,7 @@ "https://github.com/stablyai/orca/pull/8034" ], "invariant": "After a renderer lifecycle reset (main-frame did-start-navigation / render-process-gone / destroyed), no surviving PTY remains delivery-gated by pre-reset unacked bytes: main's in-flight counters and pending backlog equal the true state of the new page (zero in-flight, zero pending). Delivery then resumes only once the reloaded page's pty:data dispatcher re-registers and signals pty:rendererDispatcherReady; during the boot window before that handshake main holds all sends (data accrues losslessly in the capped pending backlog) so bytes cannot be dropped into a listener-less page and re-pin the gate. The hold itself cannot become a permanent freeze: a one-shot ~10s watchdog armed on each reset force-opens the gate (incrementing rendererDispatcherReadyForcedCount) if the handshake is lost, and the real handshake or a re-registration cancels it. The reset fires only for a new-document main-frame navigation: did-start-navigation carries exact frame and same-document details, so overlapping subframe or in-page navigation never clears accounting or holds the gate on the still-alive page. If a renderer lifecycle edge is otherwise missed, a backstop still recovers: because the handshake is one-shot per page load, receiving pty:rendererDispatcherReady while the gate is already open proves a reset was missed (or the watchdog force-opened the gate), so the handler reconciles by clearing the stale accounting before re-opening. The renderer sends that handshake exactly once per page load, after its pty:data listener registers.", - "oracle": "Ingest more than 512 KB of PTY output with no renderer ACKs and assert the per-PTY gate closes (sends stop at the 512 KB high-water, remainder accrues as pending). Fire the registered main-frame did-start-navigation listener and assert rendererInFlightChars and pendingChars are zero and the new diagnostics record the reset (rendererLifecycleResetCount 1, lastLifecycleResetClearedChars 512 KB). Then, before any dispatcher-ready handshake, ingest another chunk and assert it is NOT sent and NOT counted in-flight (held for the boot window, accruing in pending). Finally fire the pty:rendererDispatcherReady handshake and assert the held chunk is delivered to the renderer. Counters-zero without proving both the boot-window hold and that delivery resumes is insufficient. Additional cases prove the boot-window hold also covers the interactive direct-send fast path (input-primed keystroke echo is held, not sent, until the handshake) and that the self-heal watchdog force-opens the gate (rendererDispatcherReadyForcedCount 1) when no handshake arrives, while a timely handshake cancels the watchdog and leaves no orphaned timer. A further case opens the new page with a main-frame navigation and dispatcher handshake, then fires an overlapping subframe navigation and asserts the gate stays ready, the reset count stays at exactly one, and fresh output delivers without the watchdog — proving an iframe cannot reclose the live page. A backstop case saturates the gate, then fires pty:rendererDispatcherReady while the gate is still open (ready true) with no preceding reset — modeling a missed lifecycle edge — and asserts the handler reconciles: in-flight and pending clear, rendererLifecycleResetCount increments, and fresh output flows immediately (a straggler ACK is clamped and cannot underflow). A renderer-side case (pty-dispatcher-pi-routing.test.ts) asserts ensurePtyDispatcher() sends pty:rendererDispatcherReady exactly once across two attach calls — proving the send fires (it is optional-chained) and the one-shot guard holds.", + "oracle": "Ingest more than 512 KB of PTY output with no renderer ACKs and assert the per-PTY gate closes (sends stop at the 512 KB high-water, remainder accrues as pending). Fire the registered main-frame did-start-navigation listener and assert rendererInFlightChars and pendingChars are zero and the new diagnostics record the reset (rendererLifecycleResetCount 1, lastLifecycleResetClearedChars 512 KB). Then, before any dispatcher-ready handshake, ingest another chunk and assert it is NOT sent and NOT counted in-flight (held for the boot window, accruing in pending). Finally fire the pty:rendererDispatcherReady handshake and assert the held chunk is delivered to the renderer. Counters-zero without proving both the boot-window hold and that delivery resumes is insufficient. Additional cases prove the boot-window hold also covers the interactive direct-send fast path (input-primed keystroke echo is held, not sent, until the handshake) and that the self-heal watchdog force-opens the gate (rendererDispatcherReadyForcedCount 1) when no handshake arrives, while a timely handshake cancels the watchdog and leaves no orphaned timer. A further case opens the new page with a main-frame navigation and dispatcher handshake, then fires an overlapping subframe navigation and asserts the gate stays ready, the reset count stays at exactly one, and fresh output delivers without the watchdog — proving an iframe cannot reclose the live page. A backstop case saturates the gate, then fires pty:rendererDispatcherReady while the gate is still open (ready true) with no preceding reset — modeling a missed lifecycle edge — and asserts the handler reconciles: in-flight and pending clear, rendererLifecycleResetCount increments, and fresh output flows immediately (a straggler ACK is clamped and cannot underflow).", "commands": [], "testFiles": [], "assertionRefs": [], @@ -12711,6 +12657,7 @@ "Add an Electron-level reload survival test that proves a saturated pane resumes rendering and input after Cmd+R / crash recovery." ], "knownGaps": [ + "Audit3077 retires the renderer once-per-page dispatcher-ready request example. It called ensurePtyDispatcher twice, without proving two attach calls or handshake ordering. Main-side lifecycle/hold/watchdog evidence and the desired invariant retain their original scope.", "Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded.", "The unit oracle drives a local mock PTY; daemon and WSL coverage rides the same pipeline but has no dedicated provider-contract test yet.", "The dev repro covers the output-delivery freeze only; the arrow-key input symptom and mouse-mode flood observed in the same incident are out of scope and need their own repros.", @@ -12789,14 +12736,14 @@ "providers": ["local", "remote-runtime", "ssh"], "coveredPlatforms": ["macos", "linux"], "coveredProviders": ["local", "remote-runtime", "ssh"], - "coverageNotes": "Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1645 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1516 removes package-electron-runtime-contract.test.mjs, a copied release-workflow platform and marker matrix. Its workflow wiring alarm is intentionally retired; no actual packaged watcher delivery was exercised and no equivalent replacement is claimed. Unaffected dated execution receipts retain their original scope; changed optional selectors have no fresh full-gate execution result. This audit removes the paired-web stopped-during-outage and late-ready direct-branch examples. The retained pre-ready cancellation, failed-unwatch retry and replay-continuity cases are not equivalent replacements for those ordering alarms. Current web-runtime-client.test.ts assertions below name only its retained pre-ready callback case; replay cases remain in their separate suite. Historical commands and results remain historical. Deterministic tests cover one shared healthy child per runtime process plus at most four bounded fault-quarantine children, native desktop, paired-runtime, and WSL snapshot processes sharing the same eight-physical-child reservation with typed serialized event-driven capacity recovery, including recursive re-wait when crash recovery reclaims an announced slot, one quarantine attempt per watch lifetime, generation-scoped cancellation, bounded termination with removable deadline waiters, replacement-crawl errors that cannot be blessed by a late readiness ack, pre-ready paired-web cancellation registered before an unbounded capacity wait, already-resolved and late physical-exit retry of a rejected paired-web teardown, physical desktop-install and local/SSH PTY teardown, stale-generation rejection, per-child stat bounds, final-overflow RPC delivery, and renderer eviction before terminal callbacks can retry. Destructive local and SSH removal fences both ID-derived and resolved-cwd terminal roots, including sibling-root/cwd combinations with reverse admission rollback, closes descendant relay watches before parent deletion, enumerates authoritative provider/cwd ownership, falls back to daemon spawn cwd before OSC 7, and keeps daemon/relay immediate shutdown pending until native exit or a bounded fail-closed error; a dead relay PID discovered during attach also settles concurrent shutdown before its stale entry is reaped, while Windows runtime watcher deadlines retain one removable physical-close waiter, treat Node's error-close path as positive physical-exit proof, and clear root ownership on late close. The relay policy test maps a standard repository's base, Git common directory, and worktree roots to one healthy supervisor, then proves a shared-child failure recovers those roots in separate quarantine supervisors with overflow and resumed events. Abortable capacity, quarantine, runtime-root, relay, SSH, and relay pre-install setup waits attach one reaction to each shared promise and explicitly remove 10,000 cancelled caller closures while one anchor remains. Built-entry macOS harnesses kill the desktop/runtime and SSH relay watcher children, then require automatic resubscription and later events while the host process and relay PTY survive. SSH bundles the child boundary beside relay.js, requires both artifacts for install completeness, and preserves registration-owned same-root cancellation. The test-value audit corrects the active renderer watch command/file reference to the existing runtime-file-client-watch.test.ts, whose three cases are retained unchanged. They observe synthetic subscription retry/fanout and unsubscribe/unwatch calls, not actual preload/main bookkeeping or physical watcher-process cleanup. The separate read/preview client suite loses forwarding, supplied-error and negative-only examples, retaining binary detection and Unicode SVG decoding. Historical evidence commands/results are unchanged. Test-value audit1293 removes src/main/providers/local-pty/local-pty-provider-session-inventory.test.ts (2 authored cases). Their isolated assertions no longer run; surviving tests are not claimed as equivalent coverage. Fresh execution against the candidate SHA is required. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1412: src/main/workspaces/removal/watcher-removal-gate.test.ts reduced. Loses exact removal-error compatibility with renderer predicate under shared message constants. Kept public refusal outcomes do not establish that renderer classification. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1645 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1516 removes package-electron-runtime-contract.test.mjs, a copied release-workflow platform and marker matrix. Its workflow wiring alarm is intentionally retired; no actual packaged watcher delivery was exercised and no equivalent replacement is claimed. Unaffected dated execution receipts retain their original scope; changed optional selectors have no fresh full-gate execution result. This audit removes the paired-web stopped-during-outage and late-ready direct-branch examples. The retained pre-ready cancellation, failed-unwatch retry and replay-continuity cases are not equivalent replacements for those ordering alarms. Current web-runtime-client.test.ts assertions below name only its retained pre-ready callback case; replay cases remain in their separate suite. Historical commands and results remain historical. Deterministic tests cover one shared healthy child per runtime process plus at most four bounded fault-quarantine children, native desktop, paired-runtime, and WSL snapshot processes sharing the same eight-physical-child reservation with typed serialized event-driven capacity recovery, including recursive re-wait when crash recovery reclaims an announced slot, one quarantine attempt per watch lifetime, generation-scoped cancellation, bounded termination with removable deadline waiters, replacement-crawl errors that cannot be blessed by a late readiness ack, pre-ready paired-web cancellation registered before an unbounded capacity wait, already-resolved and late physical-exit retry of a rejected paired-web teardown, physical desktop-install and local/SSH PTY teardown, stale-generation rejection, per-child stat bounds, final-overflow RPC delivery, and renderer eviction before terminal callbacks can retry. Destructive local and SSH removal fences both ID-derived and resolved-cwd terminal roots, including sibling-root/cwd combinations with reverse admission rollback, closes descendant relay watches before parent deletion, enumerates authoritative provider/cwd ownership, falls back to daemon spawn cwd before OSC 7, and keeps daemon/relay immediate shutdown pending until native exit or a bounded fail-closed error; a dead relay PID discovered during attach also settles concurrent shutdown before its stale entry is reaped, while Windows runtime watcher deadlines retain one removable physical-close waiter, treat Node's error-close path as positive physical-exit proof, and clear root ownership on late close. The relay policy test maps a standard repository's base, Git common directory, and worktree roots to one healthy supervisor, then proves a shared-child failure recovers those roots in separate quarantine supervisors with overflow and resumed events. Abortable capacity, quarantine, runtime-root, relay, SSH, and relay pre-install setup waits attach one reaction to each shared promise and explicitly remove 10,000 cancelled caller closures while one anchor remains. Built-entry macOS harnesses kill the desktop/runtime and SSH relay watcher children, then require automatic resubscription and later events while the host process and relay PTY survive. SSH bundles the child boundary beside relay.js, requires both artifacts for install completeness, and preserves registration-owned same-root cancellation. The test-value audit corrects the active renderer watch command/file reference to the existing runtime-file-client-watch.test.ts, whose three cases are retained unchanged. They observe synthetic subscription retry/fanout and unsubscribe/unwatch calls, not actual preload/main bookkeeping or physical watcher-process cleanup. The separate read/preview client suite loses forwarding, supplied-error and negative-only examples, retaining binary detection and Unicode SVG decoding. Historical evidence commands/results are unchanged. Test-value audit1293 removes src/main/providers/local-pty/local-pty-provider-session-inventory.test.ts (2 authored cases). Their isolated assertions no longer run; surviving tests are not claimed as equivalent coverage. Fresh execution against the candidate SHA is required. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1412: src/main/workspaces/removal/watcher-removal-gate.test.ts reduced. Loses exact removal-error compatibility with renderer predicate under shared message constants. Kept public refusal outcomes do not establish that renderer classification. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/5308", "https://github.com/stablyai/orca/issues/7547", "https://github.com/stablyai/orca/issues/8212" ], "invariant": "Local runtime and SSH relay roots share one watcher child per host process while healthy and use at most four quarantine children after shard failure; native desktop, paired-runtime, and direct WSL snapshot children consume the same process-wide eight-child reservation and retry transient exhaustion without permanently disabling a root. Cancellation remains owned by its child generation and settles only after acknowledgement or bounded physical exit; paired-web retains cleanup ownership and can cancel before readiness even while capacity is exhausted, retries a failed unwatch after already-resolved or late physical exit without duplicating stream termination, replacements never overlap a still-retiring generation, and aborted or timed-out callers detach immediately even while queued behind same-root relay teardown. Destructive local and SSH cleanup holds one containment-aware watcher/terminal removal fence through descendant watcher and PTY physical exit plus parent Git/filesystem deletion; daemon and relay kill requests retain ownership until the actual subprocess exit callback or an equivalent positive dead-PID proof and propagate rejected signals or a bounded failure otherwise. A crash-fused shared shard moves affected roots into the bounded quarantine pool, a second fused quarantine ends those watch lifetimes, interrupted setup emits overflow after recovery, metadata work stays bounded, and the SSH relay, PTYs, Git, and other filesystem operations never load the watcher native addon or share its fault boundary.", - "oracle": "Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1683 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Fill the global watcher-child reservation, require native desktop, paired-runtime, and WSL setup to retain typed transient capacity and retry after one serialized release, then cancel pending desktop and paired-client watches and require no retry. Hold one live anchor while aborting 10,000 callers at the capacity, quarantine-assignment, runtime-root, relay-setup, and SSH-registration layers; require exactly one explicit waiter and one base-promise reaction to remain, then zero after settlement. Hold an old relay unsubscribe, queue one same-root setup leader and one anchor, then abort 10,000 joiners; require every cancellation to settle before teardown releases, exactly one anchor waiter, and only one later physical install. Advance the former paired-web callback deadline while capacity remains full, require cancellation ownership to stay live, publish the server token before ready, and require files.unwatch to abort setup before a later slot release can install a native root. Reject the first ready-watch unwatch with a physical-exit promise, resolve that exit later, and require a fresh physical unwatch attempt, registry release, and exactly one stream end. Fill one healthy shared child with multiple roots, map a standard SSH repository's base, Git common directory, and worktree roots to one relay supervisor, then inject IPC disconnect-before-exit, queued and active cancellation, operations during termination, kill-without-exit, repeated unkillable generations, initial and recovery timeouts, and shard failure. During local and SSH deletion, attempt a late terminal spawn whose worktree identity and cwd name different roots, enumerate a non-prefix remote PTY by authoritative worktree ownership, withhold daemon/relay exit callbacks, make attach positively prove a concurrent-shutdown PID dead, and make the provider unavailable; require every acquired admission to roll back on rejection, dead-PID proof to settle physical exit before reaping, timeout to retain ownership, and Git/filesystem deletion never to start. Require bounded watcher process count, physical-exit settlement, healthy-root recovery, stale-generation rejection, overflow plus later events, and fail-closed destructive cleanup. Verify relay build hashes and remote install probes require both relay.js and relay-watcher.js. Launch the built relay with a real PTY and Parcel watch, kill only the watcher child, and require the same relay PID and PTY to answer before a replacement child delivers overflow and a post-crash event.", + "oracle": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1683 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Fill the global watcher-child reservation, require native desktop, paired-runtime, and WSL setup to retain typed transient capacity and retry after one serialized release, then cancel pending desktop and paired-client watches and require no retry. Hold one live anchor while aborting 10,000 callers at the capacity, quarantine-assignment, runtime-root, relay-setup, and SSH-registration layers; require exactly one explicit waiter and one base-promise reaction to remain, then zero after settlement. Hold an old relay unsubscribe, queue one same-root setup leader and one anchor, then abort 10,000 joiners; require every cancellation to settle before teardown releases, exactly one anchor waiter, and only one later physical install. Advance the former paired-web callback deadline while capacity remains full, require cancellation ownership to stay live, publish the server token before ready, and require files.unwatch to abort setup before a later slot release can install a native root. Reject the first ready-watch unwatch with a physical-exit promise, resolve that exit later, and require a fresh physical unwatch attempt, registry release, and exactly one stream end. Fill one healthy shared child with multiple roots, map a standard SSH repository's base, Git common directory, and worktree roots to one relay supervisor, then inject IPC disconnect-before-exit, queued and active cancellation, operations during termination, kill-without-exit, repeated unkillable generations, initial and recovery timeouts, and shard failure. During local and SSH deletion, attempt a late terminal spawn whose worktree identity and cwd name different roots, enumerate a non-prefix remote PTY by authoritative worktree ownership, withhold daemon/relay exit callbacks, make attach positively prove a concurrent-shutdown PID dead, and make the provider unavailable; require every acquired admission to roll back on rejection, dead-PID proof to settle physical exit before reaping, timeout to retain ownership, and Git/filesystem deletion never to start. Require bounded watcher process count, physical-exit settlement, healthy-root recovery, stale-generation rejection, overflow plus later events, and fail-closed destructive cleanup. Verify relay build hashes and remote install probes require both relay.js and relay-watcher.js. Launch the built relay with a real PTY and Parcel watch, kill only the watcher child, and require the same relay PID and PTY to answer before a replacement child delivers overflow and a post-crash event.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-unsubscribe-timeout.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/runtime-watcher-pending-assignment.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/main/runtime/rpc/methods/files/files-watch-cancellation.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess/testing/pty-subprocess.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts --reporter=dot", @@ -13213,7 +13160,24 @@ "Audit2412 removes whole useVirtualizedScrollAnchor.marks-restore-signal.test.ts (six fake-hook geometry/mark/convergence/user-takeover/clamp alarms), use-task-creation-draft-retention original3/4 (immediate discard mock-call count/unopened no-write), use-terminal-bulk-close-actions.placement original6/7 (absent new-agent append and one real history-publication count at consumed3/30 scale), PendingNativeChatCreation original6 (unmounted abort completion/timer cleanup), and wsl-move-dialog-store original1/9/13 (default whole-distro count/reference/reuse and rejected-preview/start refusal recovery). The history counter measures genuine publication work without entries/order/reopen assertions; its unique batching alarm is intentionally retired. Fake React scroll tests ignore dependency scheduling and cleanup; unique simulated arithmetic alarms are deliberately lost. Retained existing-terminal reorder is not new-agent append coverage; mounted handoff timeout is not abort coverage. No equivalent complete replacement or fresh validation is claimed.", "Audit2417 removes commit-actions-real-git original3/4 (ordinary clean cherry-pick and revert content, subject and current-branch samples), and pty-startup-ingress-exited-asker original8/12 (actual foreground-group read budget across100queued queries, and zero foreground reads across100normal chunks plus final emitted/accepted raw cursor equality). Counters measure actual callback work and scale is consumed; these internal-work alarms are deliberately retired. Retained unborn, conflict and sequencer cases are not equivalent ordinary-success coverage. No equivalent complete replacement or fresh validation is claimed.", "Audit2425 removes use-workspace-copy-status original5, which returns a fixture-supplied readError string through statusReadError. No consumer blocker or attempted branch switch established refusal; the unique error-forwarding sample is intentionally retired. Other copy ownership and stale-refresh cases are not equivalent error-path coverage. No equivalent replacement or fresh validation is claimed.", - "Audit2432 removes BranchPicker.test.tsx original3, which only asserted onOpenChange(true/false) with an always-mounted mocked Popover. It never reopened the picker or consumed the callback in the parent status-refresh owner, despite its title. Lose that unique open/close notification alarm. Retained blocker/collision recovery and asynchronous post-unmount outcome cases are not equivalent replacement coverage. No fresh validation of the reduced selector is claimed." + "Audit2432 removes BranchPicker.test.tsx original3, which only asserted onOpenChange(true/false) with an always-mounted mocked Popover. It never reopened the picker or consumed the callback in the parent status-refresh owner, despite its title. Lose that unique open/close notification alarm. Retained blocker/collision recovery and asynchronous post-unmount outcome cases are not equivalent replacement coverage. No fresh validation of the reduced selector is claimed.", + "Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed.", + "Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed.", + "Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed.", + "Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed.", + "Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation.", + "Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed.", + "Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked.", + "Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed.", + "Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms.", + "Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery.", + "Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction.", + "Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed.", + "Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed.", + "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed.", + "Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed.", + "Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed.", + "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired." ], "demotionRule": "Demote or quarantine if the fault harness flakes without a product or harness bug, if healthy operation exceeds one runtime watcher child, if total physical operation exceeds eight children including retiring generations, if quarantine children outlive their roots or repeat after fusing, if event delivery becomes unbounded, or if metadata/stat work returns to the serve process." }, @@ -13845,13 +13809,12 @@ "invariant": "A Quick Command selected for a new terminal remains owned by that tab through a recovery remount, executes exactly once only after the successor PTY binds, and never reaches an unrelated terminal.", "oracle": "Audit2052 (sources2049/2050/2051): Remove complete low-value restored-pane-title and pane-visibility-identity suites and their current selectors. Their supplied snapshot/title and nullable identity-comparison alarms are intentionally lost without replacement. Unrelated dated evidenceRuns remain unchanged and do not validate the reduced commands. No fresh gate execution, actual PTY/provider, rendered, remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the complete pane-split-startup wrapper suite and selector. Its temporary dependency-field exposure/reset, sequential payload isolation and thrown-sentinel cleanup alarms are lost; no quick command, process or PTY startup was exercised by those callbacks. Remaining queued-startup/ownership sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): Arm the E2E-only pre-spawn barrier, click the visible Quick Command, force one recovery generation while the original spawn is blocked, and release it. Require one exact semantic xterm marker, an independently written pane/tab identity file matching the bound live PTY, queue consumption only after bind, and a live interactive sibling canary.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-owner-hydration-backend-retention.test.ts src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-queued-startup-consume.test.ts src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-owner-hydration-backend-retention.test.ts src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts --reporter=dot", "pnpm exec playwright test tests/e2e/terminal-quick-command-pre-bind-recovery.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "ORCA_E2E_FORCE_HEADFUL=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/terminal-quick-command-pre-bind-recovery.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" ], "testFiles": [ "src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-owner-hydration-backend-retention.test.ts", - "src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-queued-startup-consume.test.ts", "src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts", "src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts", "tests/e2e/terminal-quick-command-pre-bind-recovery.spec.ts" @@ -13907,6 +13870,7 @@ "Collect Linux Electron evidence before promoting the focused lane to blocking." ], "knownGaps": [ + "Audit3045 proposes deleting the queued-startup callback-wiring suite and its current selector. Bind-before-consume, no-spawn callback and throwing-consumer alarms are intentionally retired; retained E2E assertionRefs and original dated receipts remain unchanged within their original scope. No fresh gate, native PTY or equivalent replacement coverage is claimed.", "Audit1743 removes the standalone line-height clamp/default and pane cwd fallback helper tests (5 authored cases). These trivial-helper alarms are intentionally lost, with no equivalent replacement. Only current commands/testFiles lose the deleted selectors; historical receipts and evidenceRuns remain unchanged and do not validate the reduced commands.", "Windows, Linux, SSH, WSL, and paired-runtime topologies are not covered because they were not causal to STA-4876.", "The sentinel remains advisory while the repository-wide E2E signal is red.", @@ -14155,7 +14119,8 @@ "Audit1342 retires this complete dated receipt because a source in its selector was deleted or reduced. It does not validate the reduced selector. Original receipt verbatim:\n{\n \"date\": \"2026-11-04\",\n \"runner\": \"local\",\n \"platform\": \"linux\",\n \"command\": \"ORCA_BACKGROUND_LAUNCH=1 pnpm --config.verifyDepsBeforeRun=false test src/renderer/src/components/terminal-pane/terminal-parked-tab-watchers.test.ts src/renderer/src/components/terminal-pane/terminal-pane-split-request-routing.test.ts src/renderer/src/components/terminal-pane/use-terminal-tab-cold-parking.test.ts src/renderer/src/hooks/ipc-events/terminal-ui-routing-ipc-bridge-split.test.ts src/main/runtime/orca-runtime-terminal-split-authority.test.ts src/renderer/src/runtime/sync-runtime-graph-parked-leaf.test.ts src/renderer/src/runtime/web-session-terminal-orphan-mixed-version.test.ts src/renderer/src/runtime/web-session-terminal-orphan-recovery.test.ts src/renderer/src/runtime/web-session-terminal-orphan-recovery-regressions.test.ts src/renderer/src/runtime/web-session-terminal-orphan-recovery-adoption-regressions.test.ts src/renderer/src/runtime/web-session-terminal-pending-handle-recovery.test.ts tests/e2e/host-cold-park-remote-subscriber.unit.test.ts --maxWorkers=2\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/terminal-parked-tab-watchers.test.ts src/renderer/src/components/terminal-pane/terminal-pane-split-request-routing.test.ts src/renderer/src/components/terminal-pane/use-terminal-tab-cold-parking.test.ts src/renderer/src/hooks/ipc-events/terminal-ui-routing-ipc-bridge-split.test.ts src/main/runtime/orca-runtime-terminal-split-authority.test.ts src/renderer/src/runtime/sync-runtime-graph-parked-leaf.test.ts src/renderer/src/runtime/web-session-terminal-orphan-mixed-version.test.ts src/renderer/src/runtime/web-session-terminal-orphan-recovery.test.ts src/renderer/src/runtime/web-session-terminal-orphan-recovery-regressions.test.ts src/renderer/src/runtime/web-session-terminal-orphan-recovery-adoption-regressions.test.ts src/renderer/src/runtime/web-session-terminal-pending-handle-recovery.test.ts tests/e2e/host-cold-park-remote-subscriber.unit.test.ts --reporter=dot\",\n \"result\": \"passed\",\n \"durationSeconds\": 14.82,\n \"summary\": \"Test Files 12 passed (12); Tests 86 passed (86). Deterministic fixtures; no physical phone or deployed mixed-host claim.\"\n }", "Audit1342 historical platform/provider scope before source changes: {\"coveredPlatforms\":[\"macos\",\"linux\"],\"coveredProviders\":[\"local-daemon\",\"paired-runtime\"]}. Remaining provider scope applies only to unchanged-source receipts.", "Audit1342 historical assertion inventory for deleted/reduced sources; not current validated assertions:\n[\n {\n \"file\": \"src/renderer/src/runtime/web-session-terminal-orphan-recovery-regressions.test.ts\",\n \"assertions\": [\n \"coalesces degraded frames to one active and one latest queued recovery\",\n \"lets a newer fully ready frame overtake an in-flight degraded recovery\",\n \"limits recovery RPC concurrency globally across worktrees\"\n ]\n }\n]", - "Audit1939 (sources1934/1935): Pruned cold-parking hook and parked-watcher suites retain local timer/selection/split and exit/cancel/disposal progression. Lose supplied capability/eligibility/topology/admission and duplicate state examples recorded below. No assertion objects map to these sources here; preserve independent actual E2E receipt scopes without transferring their results to reduced units. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Exact retired authored alarms: 'parks paired-runtime tabs only when their exact host advertises restore'; 'skips parking scans for capability-equivalent status writes and scans membership changes'; 'keeps eviction-exempt tabs mounted when the worktree is force-parked'; 'resolves eviction exemptions once per force-park input change'; 'does not exempt a tab from a truncated malformed pane key'; 'never starts a watcher for a PTY that exited into the park handoff gap'; 'collapses the exited leaf out of the stored layout when deferring'; 'retires launch/title hints when the launch-owning parked leaf exits'; 'keeps launch ownership when only a parked shell sibling exits'; 'rejects ordinary parking for a preserved daemon with a lossy snapshot'; 'rejects a capture containing a PTY without snapshot backing'; 'accepts layout-derived candidates when the capture is stale'; 'rejects layout-derived candidates missing a leaf PTY binding'." + "Audit1939 (sources1934/1935): Pruned cold-parking hook and parked-watcher suites retain local timer/selection/split and exit/cancel/disposal progression. Lose supplied capability/eligibility/topology/admission and duplicate state examples recorded below. No assertion objects map to these sources here; preserve independent actual E2E receipt scopes without transferring their results to reduced units. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Exact retired authored alarms: 'parks paired-runtime tabs only when their exact host advertises restore'; 'skips parking scans for capability-equivalent status writes and scans membership changes'; 'keeps eviction-exempt tabs mounted when the worktree is force-parked'; 'resolves eviction exemptions once per force-park input change'; 'does not exempt a tab from a truncated malformed pane key'; 'never starts a watcher for a PTY that exited into the park handoff gap'; 'collapses the exited leaf out of the stored layout when deferring'; 'retires launch/title hints when the launch-owning parked leaf exits'; 'keeps launch ownership when only a parked shell sibling exits'; 'rejects ordinary parking for a preserved daemon with a lossy snapshot'; 'rejects a capture containing a PTY without snapshot backing'; 'accepts layout-derived candidates when the capture is stale'; 'rejects layout-derived candidates missing a leaf PTY binding'.", + "Terminal/runtime defining-owner cleanup retires complete parking timer, lifecycle, mocked close/disposal and render/flip/mount work-count cases under repository test policy. The retained watcher source has only two literal-oracle coverage decisions; the retained cold-parking hook source has only the layout-PTY exemption invalidation case. Lost alarms include cooldown/measure/pin wakeups, split exit/close attribution and cancellation, watcher disposal/restart, flood timer rearm, worktree verdict damping, and destroyed-transport cold restore. No equivalent replacement coverage or execution pass for the reduced cases is claimed; prior dated receipts retain their original scope." ], "demotionRule": "Demote if a live parked/restarting PTY loses its exact graph leaf or verified viewer binding, a retired PTY remains published, multi-pane identity drifts, or either routed client round trip flakes without a diagnosed cause." }, @@ -14457,10 +14422,10 @@ "providers": ["paired-runtime"], "coveredPlatforms": ["linux"], "coveredProviders": ["paired-runtime"], - "coverageNotes": "Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1579 removes workflow/manifest/regex/private binary-header and diagnostic metric inventories, fixture selectors, injected forwarding/platform/signature/process examples, unproven overlap and internal churn counters without equivalent replacement coverage. Retains actual Git trust/diffs; filesystem hash/ELF-region/native discovery; child CLI module repair; compiler/lock/publication/rollback and synthetic Electron install/cache ownership; executable shell quoting/exit; controlled notary/timer cleanup; local patched extractor file/AST freshness; real Chromium/WebKit CSP/sandbox/HTTPS image/referrer/link/preservation controls under parsed Android headers. Five unchanged setup-pnpm/VM request-cleanup definitions reviewed and not rerun. GitHub, installer/archive, OS metric, client, native delegate, compressor, builder and Apple boundaries injected or absent where recorded. No actual native PTY, shipped full/native app, real Actions/cache/npm signature authority, downloaded Electron archive, real objdump/linker/native CLI/AppImage, signing/NSIS/notary/upload/updater or live freeze proof. Historical scope before this audit: Published Linux 1.4.188 desktop against current source in both directions; scheduled weekly and manually runnable. No required PR check.", + "coverageNotes": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit1579 removes workflow/manifest/regex/private binary-header and diagnostic metric inventories, fixture selectors, injected forwarding/platform/signature/process examples, unproven overlap and internal churn counters without equivalent replacement coverage. Retains actual Git trust/diffs; filesystem hash/ELF-region/native discovery; child CLI module repair; compiler/lock/publication/rollback and synthetic Electron install/cache ownership; executable shell quoting/exit; controlled notary/timer cleanup; local patched extractor file/AST freshness; real Chromium/WebKit CSP/sandbox/HTTPS image/referrer/link/preservation controls under parsed Android headers. Five unchanged setup-pnpm/VM request-cleanup definitions reviewed and not rerun. GitHub, installer/archive, OS metric, client, native delegate, compressor, builder and Apple boundaries injected or absent where recorded. No actual native PTY, shipped full/native app, real Actions/cache/npm signature authority, downloaded Electron archive, real objdump/linker/native CLI/AppImage, signing/NSIS/notary/upload/updater or live freeze proof. Historical scope before this audit: Published Linux 1.4.188 desktop against current source in both directions; scheduled weekly and manually runnable. No required PR check.", "motivatingLinks": ["https://github.com/stablyai/orca/actions/runs/34069063016"], "invariant": "A paired client and host without client-hosted browser capabilities retain server-hosted browser placement across supported version skew.", - "oracle": "Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Require both existing named browser placement scenarios to pass three times with one attempt, zero skips, zero failures, and no report errors.", + "oracle": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Require both existing named browser placement scenarios to pass three times with one attempt, zero skips, zero failures, and no report errors.", "commands": [ "gh workflow run packaged-browser-e2e.yml", "pnpm exec playwright test tests/e2e/packaged-mixed-version-browser-placement.spec.ts --config tests/playwright.config.ts --project=electron-headless --workers=1 --repeat-each=3 --retries=0", @@ -14525,7 +14490,24 @@ "Audit2412 removes whole useVirtualizedScrollAnchor.marks-restore-signal.test.ts (six fake-hook geometry/mark/convergence/user-takeover/clamp alarms), use-task-creation-draft-retention original3/4 (immediate discard mock-call count/unopened no-write), use-terminal-bulk-close-actions.placement original6/7 (absent new-agent append and one real history-publication count at consumed3/30 scale), PendingNativeChatCreation original6 (unmounted abort completion/timer cleanup), and wsl-move-dialog-store original1/9/13 (default whole-distro count/reference/reuse and rejected-preview/start refusal recovery). The history counter measures genuine publication work without entries/order/reopen assertions; its unique batching alarm is intentionally retired. Fake React scroll tests ignore dependency scheduling and cleanup; unique simulated arithmetic alarms are deliberately lost. Retained existing-terminal reorder is not new-agent append coverage; mounted handoff timeout is not abort coverage. No equivalent complete replacement or fresh validation is claimed.", "Audit2417 removes commit-actions-real-git original3/4 (ordinary clean cherry-pick and revert content, subject and current-branch samples), and pty-startup-ingress-exited-asker original8/12 (actual foreground-group read budget across100queued queries, and zero foreground reads across100normal chunks plus final emitted/accepted raw cursor equality). Counters measure actual callback work and scale is consumed; these internal-work alarms are deliberately retired. Retained unborn, conflict and sequencer cases are not equivalent ordinary-success coverage. No equivalent complete replacement or fresh validation is claimed.", "Audit2425 removes use-workspace-copy-status original5, which returns a fixture-supplied readError string through statusReadError. No consumer blocker or attempted branch switch established refusal; the unique error-forwarding sample is intentionally retired. Other copy ownership and stale-refresh cases are not equivalent error-path coverage. No equivalent replacement or fresh validation is claimed.", - "Audit2432 removes BranchPicker.test.tsx original3, which only asserted onOpenChange(true/false) with an always-mounted mocked Popover. It never reopened the picker or consumed the callback in the parent status-refresh owner, despite its title. Lose that unique open/close notification alarm. Retained blocker/collision recovery and asynchronous post-unmount outcome cases are not equivalent replacement coverage. No fresh validation of the reduced selector is claimed." + "Audit2432 removes BranchPicker.test.tsx original3, which only asserted onOpenChange(true/false) with an always-mounted mocked Popover. It never reopened the picker or consumed the callback in the parent status-refresh owner, despite its title. Lose that unique open/close notification alarm. Retained blocker/collision recovery and asynchronous post-unmount outcome cases are not equivalent replacement coverage. No fresh validation of the reduced selector is claimed.", + "Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed.", + "Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed.", + "Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed.", + "Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed.", + "Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation.", + "Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed.", + "Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked.", + "Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed.", + "Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms.", + "Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery.", + "Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction.", + "Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed.", + "Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed.", + "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed.", + "Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed.", + "Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed.", + "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired." ], "demotionRule": "Keep experimental if any direction skips or fails; do not extend timeouts or retry to green." }, diff --git a/config/render-path-translate-baseline.txt b/config/render-path-translate-baseline.txt index 0a7b19061a2..2da76433302 100644 --- a/config/render-path-translate-baseline.txt +++ b/config/render-path-translate-baseline.txt @@ -2,7 +2,7 @@ # This is a RATCHET: counts may only go DOWN. Use useTranslate()/useIntlLocale() from # @/i18n/use-translate. Prune after a fix: pnpm check:render-path-translate-ratchet --prune 2 src/renderer/src/components/agent/AgentLaunchPromptComposer.tsx -5 src/renderer/src/components/automations/use-external-automation-actions.ts +5 src/renderer/src/components/automations/external/use-external-automation-actions.ts 1 src/renderer/src/components/diff-comments/useDiffCommentDecorator.tsx 2 src/renderer/src/components/editor/markdown-preview/render-tree/use-markdown-preview-components.tsx 1 src/renderer/src/components/tab-group/useTabGroupCreationCommands.ts diff --git a/config/renderer-layout-writer-baseline.txt b/config/renderer-layout-writer-baseline.txt index 96f667bb196..750730bd624 100644 --- a/config/renderer-layout-writer-baseline.txt +++ b/config/renderer-layout-writer-baseline.txt @@ -17,7 +17,7 @@ 4 src/renderer/src/components/terminal-pane/render-health/recovery/terminal-recovery-ledger-test-store.ts 3 src/renderer/src/components/worktree-jump/worktree-jump-palette-status-inputs.ts 1 src/renderer/src/lib/agent-session/hibernation/agent-hibernation-coordinator.ts -4 src/renderer/src/lib/floating-workspace-terminal-actions.ts +4 src/renderer/src/components/floating-terminal/floating-workspace-terminal-actions.ts 1 src/renderer/src/lib/pane-manager/client-hosted-browser-row-state.ts 4 src/renderer/src/lib/workspace/persistence/session-write-subscriber.ts 1 src/renderer/src/lib/workspace/persistence/workspace-session-browser-tabs.ts @@ -27,6 +27,7 @@ 3 src/renderer/src/lib/workspace/persistence/workspace-session-staged-browser-tabs.ts 1 src/renderer/src/lib/workspace/persistence/workspace-session-unified-tabs.ts 17 src/renderer/src/lib/workspace/persistence/workspace-session.ts +13 src/renderer/src/runtime/browser/creation/testing/web-runtime-browser-creation-placement-test-rig.ts 3 src/renderer/src/runtime/hosted-terminals/recovery/adoption/web-session-terminal-recovery-snapshot-validation.ts 1 src/renderer/src/runtime/hosted-terminals/recovery/surfaces/web-session-terminal-orphan-recovery-surface.ts 2 src/renderer/src/runtime/hosted-terminals/recovery/surfaces/web-session-terminal-orphan-topology.ts @@ -35,15 +36,14 @@ 10 src/renderer/src/runtime/sync-runtime-graph/mobile-session-group-projection.ts 2 src/renderer/src/runtime/sync-runtime-graph/mobile-session-snapshots.ts 2 src/renderer/src/runtime/sync-runtime-graph/sync-key.ts -13 src/renderer/src/runtime/browser/creation/testing/web-runtime-browser-creation-placement-test-rig.ts -1 src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session-snapshot.ts -3 src/renderer/src/runtime/web-session-tabs-sync/placement/web-session-client-owned-tab-placement.ts 1 src/renderer/src/runtime/web-session-tabs-sync/agent-status-primitives.ts 8 src/renderer/src/runtime/web-session-tabs-sync/apply-active-state.ts 18 src/renderer/src/runtime/web-session-tabs-sync/apply-final-patch.ts 2 src/renderer/src/runtime/web-session-tabs-sync/apply-preparation-groups.ts 5 src/renderer/src/runtime/web-session-tabs-sync/apply-terminal-records.ts 4 src/renderer/src/runtime/web-session-tabs-sync/apply-worktree-records.ts +1 src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session-snapshot.ts +3 src/renderer/src/runtime/web-session-tabs-sync/placement/web-session-client-owned-tab-placement.ts 2 src/renderer/src/runtime/web-session-tabs-sync/session-tabs-inventory-absence.ts 10 src/renderer/src/store/slices/browser/cleanup/browser-close-actions.ts 2 src/renderer/src/store/slices/browser/create-browser-slice.ts @@ -57,7 +57,7 @@ 9 src/renderer/src/store/slices/editor/checks/check-run-details-actions.ts 6 src/renderer/src/store/slices/editor/closing/close-file-action.ts 10 src/renderer/src/store/slices/editor/closing/recently-closed-editor-tabs.ts -3 src/renderer/src/store/slices/editor/file-ids/hydrated-editor-file-ids.ts +1 src/renderer/src/store/slices/editor/file-ids/hydrated-editor-file-ids.ts 2 src/renderer/src/store/slices/editor/file-ids/hydrated-editor-file-selection.ts 1 src/renderer/src/store/slices/editor/file-ids/open-file-path-rekey.ts 2 src/renderer/src/store/slices/editor/file-ids/rekey-open-files-action.ts @@ -82,7 +82,7 @@ 4 src/renderer/src/store/slices/tabs/tab-group-state.ts 9 src/renderer/src/store/slices/tabs/tabs-close-actions.ts 14 src/renderer/src/store/slices/tabs/tabs-create-actions.ts -23 src/renderer/src/store/slices/tabs/tabs-drag-preview-actions.ts +22 src/renderer/src/store/slices/tabs/tabs-drag-preview-actions.ts 11 src/renderer/src/store/slices/tabs/tabs-drop-actions.ts 8 src/renderer/src/store/slices/tabs/tabs-empty-workspace.ts 4 src/renderer/src/store/slices/tabs/tabs-focus-actions.ts @@ -91,11 +91,13 @@ 1 src/renderer/src/store/slices/tabs/tabs-hydration.ts 8 src/renderer/src/store/slices/tabs/tabs-label-actions.ts 10 src/renderer/src/store/slices/tabs/tabs-move-actions.ts -9 src/renderer/src/store/slices/tabs/tabs-reconciliation.ts +4 src/renderer/src/store/slices/tabs/tabs-reconciliation-batch.ts # split from tabs-reconciliation.ts (9 -> 2 + 4) +2 src/renderer/src/store/slices/tabs/tabs-reconciliation.ts 4 src/renderer/src/store/slices/tabs/tabs-session-actions.ts 1 src/renderer/src/store/slices/tabs/tabs-split-ratio-actions.ts 5 src/renderer/src/store/slices/tabs/tabs-surface.ts -24 src/renderer/src/store/slices/tabs/worktree-layout-lifecycle.ts +19 src/renderer/src/store/slices/tabs/worktree-layout-lifecycle.ts +3 src/renderer/src/store/slices/tabs/worktree-terminal-tab-respawn.ts # moved unchanged out of worktree-layout-lifecycle.ts (24 -> 19 + 3) 5 src/renderer/src/store/slices/worktrees/session/set-active-worktree.ts 2 src/renderer/src/store/slices/worktrees/session/worktree-slice-lookups.ts 6 src/renderer/src/store/terminals/create-terminal-slice.ts @@ -112,7 +114,7 @@ 10 src/renderer/src/store/terminals/terminal-tab-creation.ts 7 src/renderer/src/store/terminals/terminal-tab-navigation.ts 3 src/renderer/src/store/terminals/terminal-tab-presentation.ts -4 src/renderer/src/store/terminals/terminal-tab-title-batch.ts +2 src/renderer/src/store/terminals/terminal-tab-title-batch.ts 5 src/renderer/src/store/terminals/workspace-terminal-hydration-patch.ts 2 src/renderer/src/store/terminals/workspace-terminal-hydration.ts 2 src/renderer/src/store/terminals/workspace-terminal-reconnect.ts diff --git a/config/scripts/build/mobile-web-app/build-mobile-web-app-bundle.mjs b/config/scripts/build/mobile-web-app/build-mobile-web-app-bundle.mjs index e8493443a50..4b1a1d008b8 100644 --- a/config/scripts/build/mobile-web-app/build-mobile-web-app-bundle.mjs +++ b/config/scripts/build/mobile-web-app/build-mobile-web-app-bundle.mjs @@ -1,4 +1,4 @@ -import { readFile } from 'node:fs/promises' +import { readFile, readdir } from 'node:fs/promises' import { readRouteSnapshot } from '../../mobile-web-app/mobile-web-app-route-snapshot.mjs' import { MOBILE_WEB_APP_DEPENDENCY_PATH } from '../../mobile-web-app/mobile-web-app-bundle-dependencies.mjs' import { existsSync, realpathSync } from 'node:fs' @@ -24,6 +24,13 @@ import { routePathnameFromKey } from '../../mobile-web-app/mobile-web-app-route-manifest.mjs' import { MOBILE_WEB_PAGE_ROUTES } from './mobile-web-page-routes.mjs' +import { + ROUTE_ENTRY_NAMESPACE, + entryStaticClosure, + isScriptOutput, + lazyModulesToAnchor, + sharedModulesToMerge +} from './mobile-web-app-chunk-grouping.mjs' const projectDir = fileURLToPath(new URL('../../../..', import.meta.url)) const mobileDir = join(projectDir, 'mobile') @@ -134,7 +141,7 @@ const HAIRLINE_PLUGIN_NAME = 'orca-hairline-device-pixel' const ENTRY_CHUNK_NAME = 'entry' const ROUTE_MANIFEST_MODULE = /web-entry[\\/]route-manifest(\.ts)?$/ -const ROUTE_ENTRY_NAMESPACE = 'orca-route-entry' +const LAZY_ENTRY_NAMESPACE = 'orca-lazy-entry' // The entry's static imports as written, minus the manifest: a route importing it would be an output cycle. async function entryImportAnchors() { @@ -160,8 +167,14 @@ const escapeRegExp = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') // Keep typed route-manifest file for TS/Metro resolution; replace only its body for web. // Routes import the entry's imports first, so esbuild keeps those modules in one chunk instead of one per route subset. // Routes also import every module in sharedModules, which esbuild then puts in one chunk all routes load. -function routeManifestPlugin(manifestSource, routes, sharedModules) { +// Lazy modules in anchoredLazyModules (path to export names) get the same imports, so they don't split those chunks either. +function routeManifestPlugin(manifestSource, routes, sharedModules, anchoredLazyModules) { let anchors + const anchoredImports = async () => { + anchors ??= entryImportAnchors() + const shared = sharedModules.map((module) => `import ${JSON.stringify(module)}\n`).join('') + return `${await anchors}${shared}` + } return { name: ROUTE_MANIFEST_PLUGIN_NAME, setup(build) { @@ -170,26 +183,43 @@ function routeManifestPlugin(manifestSource, routes, sharedModules) { loader: 'js', resolveDir: mobileDir })) - if (routes.length === 0) { - return - } - const routeImport = new RegExp( - `^(?:${routes.map(({ module }) => escapeRegExp(module)).join('|')})$` - ) - build.onResolve({ filter: routeImport }, (args) => - args.kind === 'dynamic-import' - ? { path: args.path, namespace: ROUTE_ENTRY_NAMESPACE } - : undefined - ) - build.onLoad({ filter: /.*/, namespace: ROUTE_ENTRY_NAMESPACE }, async (args) => { - anchors ??= entryImportAnchors() - const shared = sharedModules.map((module) => `import ${JSON.stringify(module)}\n`).join('') - return { - contents: `${await anchors}${shared}export { default } from ${JSON.stringify(args.path)}\n`, + if (routes.length > 0) { + const routeImport = new RegExp( + `^(?:${routes.map(({ module }) => escapeRegExp(module)).join('|')})$` + ) + build.onResolve({ filter: routeImport }, (args) => + args.kind === 'dynamic-import' + ? { path: args.path, namespace: ROUTE_ENTRY_NAMESPACE } + : undefined + ) + build.onLoad({ filter: /.*/, namespace: ROUTE_ENTRY_NAMESPACE }, async (args) => ({ + contents: `${await anchoredImports()}export { default } from ${JSON.stringify(args.path)}\n`, loader: 'js', resolveDir: dirname(entryPoint) + })) + } + if (anchoredLazyModules.size === 0) { + return + } + build.onResolve({ filter: /.*/ }, async (args) => { + if (args.kind !== 'dynamic-import' || args.pluginData === LAZY_ENTRY_NAMESPACE) { + return undefined } + const { path, errors } = await build.resolve(args.path, { + kind: args.kind, + importer: args.importer, + resolveDir: args.resolveDir, + pluginData: LAZY_ENTRY_NAMESPACE + }) + return errors.length === 0 && anchoredLazyModules.has(path) + ? { path, namespace: LAZY_ENTRY_NAMESPACE } + : undefined }) + build.onLoad({ filter: /.*/, namespace: LAZY_ENTRY_NAMESPACE }, async (args) => ({ + contents: `${await anchoredImports()}export { ${anchoredLazyModules.get(args.path).join(', ')} } from ${JSON.stringify(args.path)}\n`, + loader: 'js', + resolveDir: dirname(entryPoint) + })) } } } @@ -234,7 +264,11 @@ const hairlineDevicePixelPlugin = { } /** Split out so a test can read the options MOBILE_WEB_APP_SHIMS claims, without a build. */ -export function mobileWebAppBuildOptions(routes, sharedModules = []) { +export function mobileWebAppBuildOptions( + routes, + sharedModules = [], + anchoredLazyModules = new Map() +) { return { // Fixed so no absolute path of this checkout can reach the output. absWorkingDir: mobileDir, @@ -267,7 +301,12 @@ export function mobileWebAppBuildOptions(routes, sharedModules = []) { zod: MOBILE_ZOD_PACKAGE }, plugins: [ - routeManifestPlugin(renderMobileWebAppRouteManifest(routes), routes, sharedModules), + routeManifestPlugin( + renderMobileWebAppRouteManifest(routes), + routes, + sharedModules, + anchoredLazyModules + ), lucideBarrelPlugin, hairlineDevicePixelPlugin ], @@ -311,66 +350,6 @@ export function mobileWebAppBuildOptions(routes, sharedModules = []) { } } -// Budget entry plus transitive static imports, stopping at dynamic imports; entry-only limits let shared initial chunks grow unseen. -export function entryStaticClosure(metafile, entryOutputPath) { - const reached = new Set([entryOutputPath]) - for (const current of reached) { - for (const imported of metafile.outputs[current]?.imports ?? []) { - if (imported.kind !== 'import-statement' || reached.has(imported.path)) { - continue - } - reached.add(imported.path) - } - } - return reached -} - -// esbuild cuts a chunk per set of routes sharing a module; one this small costs more as a request than as code every route loads. -const MERGED_SHARED_CHUNK_MAX_BYTES = 16 * 1024 - -// Small route-shared chunks whose static imports already load at boot or merge too, so merging adds only their own bytes. -// ESM only: a bare import runs a CommonJS module's body at route load, not where its importer first needs it. -function sharedModulesToMerge(metafile, entryOutputPath) { - const { inputs, outputs } = metafile - const boot = entryStaticClosure(metafile, entryOutputPath) - const routeReached = new Set( - Object.entries(outputs) - .filter(([, output]) => output.entryPoint?.startsWith(`${ROUTE_ENTRY_NAMESPACE}:`)) - .flatMap(([path]) => [...entryStaticClosure(metafile, path)]) - ) - const merged = new Set( - Object.entries(outputs) - .filter( - ([path, output]) => - isScriptOutput(path) && - !output.entryPoint && - !boot.has(path) && - routeReached.has(path) && - output.bytes <= MERGED_SHARED_CHUNK_MAX_BYTES && - Object.keys(output.inputs).every((input) => inputs[input]?.format === 'esm') - ) - .map(([path]) => path) - ) - const importsUnmerged = (path) => - outputs[path].imports.some( - ({ kind, path: imported }) => - kind === 'import-statement' && !boot.has(imported) && !merged.has(imported) - ) - for (let dropped = true; dropped;) { - dropped = false - for (const path of merged) { - if (importsUnmerged(path)) { - merged.delete(path) - dropped = true - } - } - } - return [...merged] - .flatMap((path) => Object.keys(outputs[path].inputs)) - .sort() - .map((input) => resolve(mobileDir, input)) -} - // Hash final output bytes leaf-first, rewriting dependency names before hashing importers. // esbuild hashes checkout-dependent input paths; renaming makes manifest hashes/import URLs agree and avoids redownloading identical bundles across checkouts. export function renameOutputsByContent(metafile, outputFiles) { @@ -438,8 +417,6 @@ export function routeChunkNames(metafile, routes, renamed) { ) } -const isScriptOutput = (path) => path.endsWith('.js') - // appDir is a seam for the tests, which bundle a scratch route tree; production always uses mobile/app. // Page closure includes ancestor layouts as entry modules, not just route imports. export async function mobileWebAppRouteClosure(routeModule) { @@ -480,6 +457,32 @@ export async function mobileWebAppModuleClosure(entryModules, { absWorkingDir } // One lazily imported chunk per UI language; the page fetches only the active one after init. const LOCALE_CATALOG_INPUT = /(^|\/)src\/i18n\/locales\/[^/]+\.json$/ +const localeCatalogDir = join(mobileDir, 'src', 'i18n', 'locales') + +// The same catalogs as JSON for the host to serve one at a time, to shells that skip the chunks; +// English is the page's inline fallback, so it has none. +export async function readLocaleCatalogs(directory = localeCatalogDir) { + const names = (await readdir(directory)) + .filter((name) => name.endsWith('.json') && name !== 'en.json') + .sort() + return Promise.all( + names.map(async (name) => { + // Minify: the host sends and the phone keeps the parsed object, not the source layout. + const bytes = Buffer.from( + JSON.stringify(JSON.parse(await readFile(join(directory, name), 'utf8'))), + 'utf8' + ) + const sha256 = sha256Hex(bytes) + return { + locale: name.slice(0, -'.json'.length), + bytes, + path: `catalogs/${sha256}.json`, + sha256, + byteLength: bytes.byteLength + } + }) + ) +} function localeCatalogOutputs(metafile) { return new Set( @@ -532,10 +535,12 @@ function entryOutput(metafile) { // The page's scripts as shipped: a first build finds the small shared chunks, a second merges them. export async function buildMobileWebAppScripts(routes) { const split = await esbuild.build(mobileWebAppBuildOptions(routes)) - const sharedModules = sharedModulesToMerge(split.metafile, entryOutput(split.metafile)) - return sharedModules.length === 0 + const entryOutputPath = entryOutput(split.metafile) + const sharedModules = sharedModulesToMerge(split.metafile, entryOutputPath) + const anchoredLazyModules = lazyModulesToAnchor(split.metafile, entryOutputPath) + return sharedModules.length === 0 && anchoredLazyModules.size === 0 ? split - : esbuild.build(mobileWebAppBuildOptions(routes, sharedModules)) + : esbuild.build(mobileWebAppBuildOptions(routes, sharedModules, anchoredLazyModules)) } export async function bundleMobileWebApp({ appDir = defaultAppDir } = {}) { @@ -599,17 +604,21 @@ export function resolveMobileWebPageRoutes(routeKeys, declared = MOBILE_WEB_PAGE export async function buildMobileWebAppBundle({ appDir, outDir = defaultOutDir, - pageRoutes = MOBILE_WEB_PAGE_ROUTES + pageRoutes = MOBILE_WEB_PAGE_ROUTES, + // Only the shipped tree pays for brotli-11; tests and verify's scratch builds read raw assets. + brotli = false } = {}) { const [ desktopVersion, protocolWindow, { script, chunks, images, catalogChunks, entryStaticBytes, chunkCount, routeChunks, routeKeys }, + catalogs, scrollbarStyle ] = await Promise.all([ readDesktopVersion(), readProtocolWindow(), bundleMobileWebApp({ appDir }), + readLocaleCatalogs(), readFile(join(projectDir, 'src/shared/styles/scrollbar-sleek.css'), 'utf8').then((style) => // The shared desktop stylesheet can be checked out as CRLF on Windows. style.replace(/\r\n/g, '\n') @@ -617,9 +626,14 @@ export async function buildMobileWebAppBundle({ ]) // Names already hash final bytes, so hashedAsset must reproduce them. const scriptAsset = hashedAsset(script, 'js') + const catalogChunkSet = new Set(catalogChunks) const written = [ scriptAsset, - ...[...chunks, ...images].map(({ name, bytes }) => hashedAsset(bytes, extname(name).slice(1))) + ...[...chunks, ...images].map((output) => ({ + ...hashedAsset(output.bytes, extname(output.name).slice(1)), + // Shells that read catalogs from the host skip these; older shells download them as before. + ...(catalogChunkSet.has(output) ? { kind: 'catalog' } : {}) + })) ] // Root-absolute URLs survive nested routes; CSP allows only about: base. ESM entry/chunks load under existing self policy. @@ -643,9 +657,11 @@ export async function buildMobileWebAppBundle({ const { manifest } = await writeMobileWebBundleTree({ outDir, written: [indexAsset, ...written], + catalogs, desktopVersion, protocolWindow, - routes: resolveMobileWebPageRoutes(routeKeys, pageRoutes) + routes: resolveMobileWebPageRoutes(routeKeys, pageRoutes), + brotli }) return { manifest, @@ -670,7 +686,7 @@ if (isDirectInvocation(import.meta.url, process.argv[1])) { } try { const { manifest, outDir, routeKeys, entryStaticBytes, chunkCount } = - await buildMobileWebAppBundle() + await buildMobileWebAppBundle({ brotli: true }) console.log( `[build-mobile-web-app-bundle] OK — ${String(routeKeys.length)} route(s), ` + `${String(chunkCount)} chunk(s), ${String(entryStaticBytes)} bytes before the first route, ` + diff --git a/config/scripts/build/mobile-web-app/mobile-web-app-chunk-grouping.mjs b/config/scripts/build/mobile-web-app/mobile-web-app-chunk-grouping.mjs new file mode 100644 index 00000000000..cca3dda0d94 --- /dev/null +++ b/config/scripts/build/mobile-web-app/mobile-web-app-chunk-grouping.mjs @@ -0,0 +1,102 @@ +import { realpathSync } from 'node:fs' +import { resolve } from 'node:path' +import { fileURLToPath } from 'node:url' + +const mobileDir = fileURLToPath(new URL('../../../../mobile', import.meta.url)) + +export const ROUTE_ENTRY_NAMESPACE = 'orca-route-entry' + +export const isScriptOutput = (path) => path.endsWith('.js') + +// Budget entry plus transitive static imports, stopping at dynamic imports; entry-only limits let shared initial chunks grow unseen. +export function entryStaticClosure(metafile, entryOutputPath) { + const reached = new Set([entryOutputPath]) + for (const current of reached) { + for (const imported of metafile.outputs[current]?.imports ?? []) { + if (imported.kind !== 'import-statement' || reached.has(imported.path)) { + continue + } + reached.add(imported.path) + } + } + return reached +} + +// esbuild cuts a chunk per set of routes sharing a module; one this small costs more as a request than as code every route loads. +const MERGED_SHARED_CHUNK_MAX_BYTES = 16 * 1024 + +// Small route-shared chunks whose static imports already load at boot or merge too, so merging adds only their own bytes. +// ESM only: a bare import runs a CommonJS module's body at route load, not where its importer first needs it. +export function sharedModulesToMerge(metafile, entryOutputPath) { + const { inputs, outputs } = metafile + const boot = entryStaticClosure(metafile, entryOutputPath) + const routeReached = new Set( + Object.entries(outputs) + .filter(([, output]) => output.entryPoint?.startsWith(`${ROUTE_ENTRY_NAMESPACE}:`)) + .flatMap(([path]) => [...entryStaticClosure(metafile, path)]) + ) + const merged = new Set( + Object.entries(outputs) + .filter( + ([path, output]) => + isScriptOutput(path) && + !output.entryPoint && + !boot.has(path) && + routeReached.has(path) && + output.bytes <= MERGED_SHARED_CHUNK_MAX_BYTES && + Object.keys(output.inputs).every((input) => inputs[input]?.format === 'esm') + ) + .map(([path]) => path) + ) + const importsUnmerged = (path) => + outputs[path].imports.some( + ({ kind, path: imported }) => + kind === 'import-statement' && !boot.has(imported) && !merged.has(imported) + ) + for (let dropped = true; dropped;) { + dropped = false + for (const path of merged) { + if (importsUnmerged(path)) { + merged.delete(path) + dropped = true + } + } + } + return [...merged] + .flatMap((path) => Object.keys(outputs[path].inputs)) + .sort() + .map((input) => resolve(mobileDir, input)) +} + +// A lazy module sharing boot code gives those modules a new importer set, so esbuild would split the boot chunks; +// anchor it like a route. Modules boot imports lazily (routes, catalogs) stay as they are: anchoring them is an output cycle. +// esbuild's runtime helper chunk has no inputs and every chunk imports it, so self-contained engines (mermaid) keep their bytes. +export function lazyModulesToAnchor(metafile, entryOutputPath) { + const { outputs } = metafile + const boot = entryStaticClosure(metafile, entryOutputPath) + const bootLoadsLazily = new Set( + [...boot].flatMap((path) => + outputs[path].imports + .filter(({ kind }) => kind === 'dynamic-import') + .map(({ path: imported }) => imported) + ) + ) + const sharesBootModules = ({ imports }) => + imports.some( + ({ kind, path }) => + kind === 'import-statement' && + boot.has(path) && + Object.keys(outputs[path].inputs).length > 0 + ) + return new Map( + Object.entries(outputs) + .filter( + ([path, output]) => + output.entryPoint && + !boot.has(path) && + !bootLoadsLazily.has(path) && + sharesBootModules(output) + ) + .map(([, output]) => [realpathSync(resolve(mobileDir, output.entryPoint)), output.exports]) + ) +} diff --git a/config/scripts/build/mobile-web-app/mobile-web-bundle-fixture-tree.mjs b/config/scripts/build/mobile-web-app/mobile-web-bundle-fixture-tree.mjs index 18070c95660..71903291664 100644 --- a/config/scripts/build/mobile-web-app/mobile-web-bundle-fixture-tree.mjs +++ b/config/scripts/build/mobile-web-app/mobile-web-bundle-fixture-tree.mjs @@ -15,7 +15,11 @@ const PIXEL_PNG = Buffer.from( 'base64' ) -export async function writeMobileWebBundleFixtureTree({ outDir, body = 'fixture' }) { +export async function writeMobileWebBundleFixtureTree({ + outDir, + body = 'fixture', + brotli = false +}) { const [desktopVersion, protocolWindow] = await Promise.all([ readDesktopVersion(), readProtocolWindow() @@ -49,6 +53,7 @@ export async function writeMobileWebBundleFixtureTree({ outDir, body = 'fixture' image ], desktopVersion, - protocolWindow + protocolWindow, + brotli }) } diff --git a/config/scripts/build/mobile-web-app/mobile-web-bundle-manifest.mjs b/config/scripts/build/mobile-web-app/mobile-web-bundle-manifest.mjs index 60f9d55d091..ad84a39bd02 100644 --- a/config/scripts/build/mobile-web-app/mobile-web-bundle-manifest.mjs +++ b/config/scripts/build/mobile-web-app/mobile-web-bundle-manifest.mjs @@ -3,10 +3,13 @@ import { readFile, mkdir, rm, writeFile } from 'node:fs/promises' import { createRequire } from 'node:module' import { join } from 'node:path' import { fileURLToPath } from 'node:url' +import { promisify } from 'node:util' +import { brotliCompress, constants as zlibConstants } from 'node:zlib' const { darkBuildMarkers } = createRequire(import.meta.url)('../../../dark-build-switches.cjs') const projectDir = fileURLToPath(new URL('../../../..', import.meta.url)) +const brotliCompressAsync = promisify(brotliCompress) export const MOBILE_WEB_BUNDLE_SCHEMA_VERSION = 1 export const MOBILE_WEB_BUNDLE_ENTRYPOINT = 'index.html' @@ -101,18 +104,58 @@ export async function readDesktopVersion() { return packageJson.version } +// Mirrors mobileWebBundleBrotliPath in src/shared/mobile-web-bundle/manifest-contract.ts. +export function mobileWebBundleBrotliPath(assetPath) { + return `${assetPath}.br` +} + +// Largest first so the slowest file starts first on zlib's thread pool; keep only copies that shrink. +async function compressWithBrotli(written) { + const largestFirst = [...written].sort((left, right) => right.byteLength - left.byteLength) + const copies = await Promise.all( + largestFirst.map((asset) => + brotliCompressAsync(asset.bytes, { + params: { + [zlibConstants.BROTLI_PARAM_QUALITY]: zlibConstants.BROTLI_MAX_QUALITY, + [zlibConstants.BROTLI_PARAM_SIZE_HINT]: asset.byteLength + } + }) + ) + ) + return new Map( + largestFirst.flatMap((asset, index) => + copies[index].byteLength < asset.byteLength ? [[asset.path, copies[index]]] : [] + ) + ) +} + // Single manifest producer keeps builder/contract/packaging guard shape aligned. export async function writeMobileWebBundleTree({ outDir, written, + // Host-only JSON outside `assets` and buildId, served one at a time over RPC. + catalogs = [], desktopVersion, protocolWindow, // Empty route list makes shell render every screen natively. routes = [], + // Whole-file brotli copies for phones that inflate natively. + brotli = false, env = process.env }) { + const brotliCopies = brotli ? await compressWithBrotli(written) : new Map() const assets = written - .map(({ path, sha256, byteLength, contentType }) => ({ path, sha256, byteLength, contentType })) + .map(({ path, sha256, byteLength, contentType, kind }) => { + const copy = brotliCopies.get(path) + return { + path, + sha256, + byteLength, + contentType, + ...(copy === undefined ? {} : { brotliByteLength: copy.byteLength }), + ...(kind === undefined ? {} : { kind }) + } + }) .sort((left, right) => (left.path < right.path ? -1 : left.path > right.path ? 1 : 0)) const manifest = { schemaVersion: MOBILE_WEB_BUNDLE_SCHEMA_VERSION, @@ -124,14 +167,30 @@ export async function writeMobileWebBundleTree({ entrypoint: MOBILE_WEB_BUNDLE_ENTRYPOINT, totalBytes: assets.reduce((total, asset) => total + asset.byteLength, 0), assets, - routes + routes, + ...(catalogs.length === 0 + ? {} + : { + catalogs: catalogs.map(({ locale, path, sha256, byteLength }) => ({ + locale, + path, + sha256, + byteLength + })) + }) } // Clear entire output or stale unreferenced assets ship inside asar. await rm(outDir, { recursive: true, force: true }) await mkdir(join(outDir, 'assets'), { recursive: true }) - for (const asset of written) { - await writeFile(join(outDir, asset.path), asset.bytes) + if (catalogs.length > 0) { + await mkdir(join(outDir, 'catalogs'), { recursive: true }) + } + for (const file of [...written, ...catalogs]) { + await writeFile(join(outDir, file.path), file.bytes) + } + for (const [path, copy] of brotliCopies) { + await writeFile(join(outDir, mobileWebBundleBrotliPath(path)), copy) } await writeFile(join(outDir, 'manifest.json'), `${JSON.stringify(manifest, null, 2)}\n`, 'utf8') // Keep switch metadata outside manifest so compiled page bytes/buildId remain unchanged. diff --git a/config/scripts/build/mobile-web-app/mobile-web-page-routes.mjs b/config/scripts/build/mobile-web-app/mobile-web-page-routes.mjs index 1e391c41ccc..79d0482fb59 100644 --- a/config/scripts/build/mobile-web-app/mobile-web-page-routes.mjs +++ b/config/scripts/build/mobile-web-app/mobile-web-page-routes.mjs @@ -102,13 +102,14 @@ export const MOBILE_WEB_PAGE_ROUTES = [ 'native.audio.read', 'native.audio.stop' ], - // Optional media.name falls back to the file type; terminalKeyRail falls back to the page's row; the image viewer drops its actions without native.image.act; dictation uses the computer without native.speech.act. + // Optional media.name falls back to the file type; terminalKeyRail falls back to the page's row; the image viewer drops its actions without native.image.act; dictation uses the computer without native.speech.act; without native.a11y.announce only the page's live region speaks. optionalGrants: [ 'externalNavigation', 'native.media.name', 'native.pdf.view', 'native.image.act', 'native.speech.act', + 'native.a11y.announce', 'terminalKeyRail', DEVICE_STORE_GRANT ] diff --git a/config/scripts/build/mobile-web-app/verify-mobile-web-app-bundle.mjs b/config/scripts/build/mobile-web-app/verify-mobile-web-app-bundle.mjs index b853a7d7a88..b6832054702 100644 --- a/config/scripts/build/mobile-web-app/verify-mobile-web-app-bundle.mjs +++ b/config/scripts/build/mobile-web-app/verify-mobile-web-app-bundle.mjs @@ -29,6 +29,8 @@ export function mobileWebAppBundleMaxAssets(routeCount, imageCount, catalogChunk // fetched only for the active language, never before the first route. Code keeps its own fence. export const MOBILE_WEB_APP_BUNDLE_MAX_CATALOG_CHUNKS = 10 export const MOBILE_WEB_APP_BUNDLE_MAX_CATALOG_BYTES = 3 * 1024 * 1024 +// The host sends a catalog's JSON in one reply, which must fit a 1 MiB relay frame once encrypted. +export const MOBILE_WEB_APP_HOST_CATALOG_MAX_BYTES = 384 * 1024 // Our own fence on the page's code, well inside the phone contract (32 MiB total, 10 MiB per asset in // manifest-contract.ts); it fails the build before the code weighs more than any one asset may. @@ -185,6 +187,23 @@ export async function verifyMobileWebAppBundle({ bundleDir = defaultBundleDir } `${String(MOBILE_WEB_APP_BUNDLE_MAX_CATALOG_BYTES)} bytes` ) } + // buildId leaves the host's JSON catalogs out, so a stale copy shows only here. + const hostCatalogsOf = (built) => JSON.stringify(built.catalogs ?? []) + if (hostCatalogsOf(first.manifest) !== hostCatalogsOf(second.manifest)) { + fail('host language catalogs are not reproducible') + } + if (hostCatalogsOf(first.manifest) !== hostCatalogsOf(manifest)) { + fail(`${bundleDir} is stale: its host language catalogs differ from a fresh build's`) + } + const oversized = (manifest.catalogs ?? []).find( + (catalog) => catalog.byteLength > MOBILE_WEB_APP_HOST_CATALOG_MAX_BYTES + ) + if (oversized) { + fail( + `the ${oversized.locale} host catalog is ${String(oversized.byteLength)} bytes, over the ` + + `${String(MOBILE_WEB_APP_HOST_CATALOG_MAX_BYTES)} one reply carries` + ) + } const budgetBytes = mobileWebAppBundleBudgetBytes(manifest) - first.catalogBytes if (budgetBytes > MOBILE_WEB_APP_BUNDLE_MAX_TOTAL_BYTES) { fail( diff --git a/config/scripts/ci/sharding/ci-shard-timings.json b/config/scripts/ci/sharding/ci-shard-timings.json index afd1ef5bf40..9ed17e62079 100644 --- a/config/scripts/ci/sharding/ci-shard-timings.json +++ b/config/scripts/ci/sharding/ci-shard-timings.json @@ -4589,7 +4589,6 @@ "src/packages/process-host/src/run-process-windows-tree-kill.test.ts": 81, "src/packages/process-host/src/run-process.test.ts": 9406, "src/packages/process-host/src/spawn-observer.test.ts": 357, - "src/packages/process-host/src/spawn-process-stdio.test.ts": 311, "src/packages/process-host/src/windows-command-line.test.ts": 73, "src/packages/process-host/src/windows-tree-kill.test.ts": 81, "src/packages/process-host/src/wsl-distro-allowlist.test.ts": 55, @@ -4623,11 +4622,9 @@ "src/preload/usage-provider-api.test.ts": 46, "src/renderer/src/app-shell/app-command-handlers-tab-rename.test.ts": 1786, "src/renderer/src/app-shell/shutdown-checkpoint-persist.test.ts": 65, - "src/renderer/src/app-shell/shutdown-checkpoint-restart-lifecycle.test.ts": 210, "src/renderer/src/app-shell/startup-window-parity.test.ts": 2306, "src/renderer/src/app-shell/use-profile-state-save-delay-notice.sonner.test.tsx": 355, "src/renderer/src/app-shell/use-profile-state-save-delay-notice.test.tsx": 293, - "src/renderer/src/app-shell/use-visible-hosted-review-refresh.test.tsx": 572, "src/renderer/src/app-shell/visible-review-reporting.test.ts": 1872, "src/renderer/src/app-shell/workspace-view-cross-client-sync.test.tsx": 1170, "src/renderer/src/app-shell/worktree-creation-chat-handoff.test.tsx": 2824, @@ -4642,12 +4639,8 @@ "src/renderer/src/components/JiraIssueWorkspace.optimistic-edit.test.tsx": 2340, "src/renderer/src/components/JiraIssueWorkspace.status-queue.test.tsx": 1852, "src/renderer/src/components/JiraIssueWorkspace.transition-source.test.tsx": 1843, - "src/renderer/src/components/NativeChatRemoteResume.test.tsx": 8774, - "src/renderer/src/components/NativeChatResumeOnRestartGroups.selection.test.tsx": 2633, - "src/renderer/src/components/NativeChatResumeOnRestartGroups.test.tsx": 3472, "src/renderer/src/components/NewWorkspaceComposerCard.quick-file-drop.test.tsx": 4557, "src/renderer/src/components/NewWorkspaceComposerCard.set-location.test.tsx": 1301, - "src/renderer/src/components/QuickOpen.selection.test.tsx": 1046, "src/renderer/src/components/SelectedTextCopyMenu.test.tsx": 329, "src/renderer/src/components/TerminalSearch.test.tsx": 458, "src/renderer/src/components/UpdateCard.error-card.test.tsx": 2851, @@ -4676,56 +4669,46 @@ "src/renderer/src/components/artifacts/ArtifactPublishButton.test.tsx": 706, "src/renderer/src/components/artifacts/ArtifactsPage.test.tsx": 2052, "src/renderer/src/components/artifacts/artifact-publish-flow.test.ts": 114, - "src/renderer/src/components/automations/AutomationEditorPromptEditor.test.tsx": 396, + "src/renderer/src/components/automations/authoring/AutomationEditorPromptEditor.test.tsx": 396, "src/renderer/src/components/automations/AutomationPromptDisclosure.test.tsx": 893, "src/renderer/src/components/automations/AutomationRunsTable.test.tsx": 668, - "src/renderer/src/components/automations/AutomationSchedulePicker.test.ts": 431, - "src/renderer/src/components/automations/AutomationTimeField.test.tsx": 654, + "src/renderer/src/components/automations/authoring/AutomationSchedulePicker.test.ts": 431, + "src/renderer/src/components/automations/AutomationsPage.behavior.test.tsx": 3389, "src/renderer/src/components/automations/AutomationsPage.edit-destination.test.tsx": 2932, - "src/renderer/src/components/automations/AutomationsPage.run-navigation.test.tsx": 3056, + "src/renderer/src/components/automations/ExternalAutomationManagers.test.tsx": 852, - "src/renderer/src/components/automations/automation-captured-owner.test.ts": 379, - "src/renderer/src/components/automations/automation-create-projects.test.ts": 42, + "src/renderer/src/components/automations/hosts/automation-captured-owner.test.ts": 379, "src/renderer/src/components/automations/automation-host-cache-controller.test.ts": 411, - "src/renderer/src/components/automations/automation-host-cache-error.test.ts": 391, - "src/renderer/src/components/automations/automation-host-cache-health.test.ts": 52, - "src/renderer/src/components/automations/automation-host-cache.test.ts": 79, - "src/renderer/src/components/automations/automation-host-catalog-generation.test.ts": 258, - "src/renderer/src/components/automations/automation-host-client.test.ts": 374, + "src/renderer/src/components/automations/hosts/automation-host-cache.test.ts": 79, + "src/renderer/src/components/automations/automation-host-diagnostics.test.ts": 460, - "src/renderer/src/components/automations/automation-host-filter-resolution.test.ts": 256, - "src/renderer/src/components/automations/automation-host-health.test.ts": 47, + "src/renderer/src/components/automations/automation-host-invalidation-window-events.test.ts": 83, "src/renderer/src/components/automations/automation-host-invalidation.test.ts": 85, - "src/renderer/src/components/automations/automation-host-list-rows.test.ts": 419, - "src/renderer/src/components/automations/automation-host-recovery.test.ts": 51, + "src/renderer/src/components/automations/hosts/automation-host-list-rows.test.ts": 419, "src/renderer/src/components/automations/automation-host-scale-gates.test.ts": 638, - "src/renderer/src/components/automations/automation-host-scheduler.test.ts": 439, - "src/renderer/src/components/automations/automation-legacy-schedule-editing.test.ts": 449, - "src/renderer/src/components/automations/automation-list-focus-recovery.test.ts": 48, - "src/renderer/src/components/automations/automation-list-row-identity.test.ts": 626, - "src/renderer/src/components/automations/automation-list-search.test.ts": 75, + "src/renderer/src/components/automations/hosts/automation-host-scheduler.test.ts": 439, + "src/renderer/src/components/automations/authoring/automation-legacy-schedule-editing.test.ts": 449, + "src/renderer/src/components/automations/automation-list-view.test.ts": 257, - "src/renderer/src/components/automations/automation-run-context.test.ts": 58, - "src/renderer/src/components/automations/automation-run-history-keyboard-navigation.test.ts": 434, - "src/renderer/src/components/automations/automation-run-open-target.test.ts": 442, + "src/renderer/src/components/automations/runs/automation-run-history-keyboard-navigation.test.ts": 434, + "src/renderer/src/components/automations/runs/automation-run-open-target.test.ts": 442, "src/renderer/src/components/automations/automation-run-output-snapshot-equivalence.test.ts": 158, "src/renderer/src/components/automations/automation-run-output-snapshot.test.ts": 96, - "src/renderer/src/components/automations/automation-setup-decision.test.ts": 58, + "src/renderer/src/components/automations/authoring/automation-setup-decision.test.ts": 58, "src/renderer/src/components/automations/automation-usage-model.test.ts": 200, "src/renderer/src/components/automations/external-automation-list-entries.test.ts": 57, - "src/renderer/src/components/automations/external-automation-scope-gating.test.ts": 67, + "src/renderer/src/components/automations/external/external-automation-scope-gating.test.ts": 67, "src/renderer/src/components/automations/external-automation-scope-keys.test.ts": 53, - "src/renderer/src/components/automations/use-automation-host-catalog-readoption.test.tsx": 802, - "src/renderer/src/components/automations/use-automation-host-catalog.test.tsx": 920, - "src/renderer/src/components/automations/use-automation-list-focus-recovery.test.tsx": 229, - "src/renderer/src/components/automations/use-automation-list-search.test.tsx": 679, - "src/renderer/src/components/automations/use-automation-runs-dashboard-payload.test.tsx": 6692, - "src/renderer/src/components/automations/use-automation-runs-dashboard.test.tsx": 854, + "src/renderer/src/components/automations/hosts/use-automation-host-catalog-readoption.test.tsx": 802, + "src/renderer/src/components/automations/hosts/use-automation-host-catalog.test.tsx": 920, + + "src/renderer/src/components/automations/listing/use-automation-list-search.test.tsx": 679, + "src/renderer/src/components/automations/runs/use-automation-runs-dashboard-payload.test.tsx": 6692, + "src/renderer/src/components/automations/runs/use-automation-runs-dashboard.test.tsx": 854, "src/renderer/src/components/automations/use-selected-automation-run-history.test.tsx": 2104, "src/renderer/src/components/browser-favicon.test.tsx": 333, - "src/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.dead-guest.test.tsx": 6219, "src/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.drag-focus.test.tsx": 5826, "src/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.failure-remount.test.tsx": 3085, "src/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.markup.test.tsx": 4575, @@ -4822,7 +4805,6 @@ "src/renderer/src/components/dashboard-popout/preview-terminal-box-fit-lifecycle.test.ts": 192, "src/renderer/src/components/dashboard-popout/preview-terminal-ime-bridge-kitty-bytes.test.ts": 479, "src/renderer/src/components/dashboard-popout/remote-runtime-terminal-preview-api.test.ts": 81, - "src/renderer/src/components/dashboard-popout/use-agent-dashboard-telemetry.test.ts": 2108, "src/renderer/src/components/dashboard-popout/useDashboardSnapshot.test.tsx": 432, "src/renderer/src/components/dashboard/AgentDashboardDrawer.focus.test.tsx": 2567, "src/renderer/src/components/dashboard/AgentDashboardDrawer.test.tsx": 1981, @@ -4844,14 +4826,11 @@ "src/renderer/src/components/diff-comments/diff-comment-popover-outside-click.test.tsx": 1889, "src/renderer/src/components/diff-comments/useDiffCommentDecorator.lifecycle.test.tsx": 2669, "src/renderer/src/components/diff-comments/useDiffCommentDecorator.range-selection.test.tsx": 1782, - "src/renderer/src/components/editor/check-details/panel/CheckRunDetailsPanel.captured-failure.test.tsx": 2412, "src/renderer/src/components/editor/check-details/panel/CheckRunDetailsPanel.copy.test.tsx": 3108, - "src/renderer/src/components/editor/check-details/panel/CheckRunDetailsPanel.log-outcomes.test.tsx": 3230, "src/renderer/src/components/editor/DiagramViewerModal.test.tsx": 2539, "src/renderer/src/components/editor/diff/sections/DiffSectionBody.word-wrap-lifecycle.test.tsx": 3036, "src/renderer/src/components/editor/diff/monaco-view/DiffViewer.word-wrap-lifecycle.test.tsx": 2499, "src/renderer/src/components/editor/EditorConflictReviewSurface.live-record.test.tsx": 1193, - "src/renderer/src/components/editor/EditorContent.monaco-lifecycle.test.tsx": 3162, "src/renderer/src/components/editor/EditorEditFileSurface.monaco-containment.test.tsx": 2666, "src/renderer/src/components/editor/EditorFileLoadErrorView.test.tsx": 660, "src/renderer/src/components/editor/EditorFileLocationMenuItems.test.tsx": 846, @@ -4863,17 +4842,13 @@ "src/renderer/src/components/editor/notebook/document/IpynbRendering.test.tsx": 2143, "src/renderer/src/components/editor/markdown-preview/surface/MarkdownPreview.link-routing.interaction.test.tsx": 1127, "src/renderer/src/components/editor/MediaViewer.test.tsx": 308, - "src/renderer/src/components/editor/MermaidViewer.test.tsx": 3079, - "src/renderer/src/components/editor/MonacoEditor.owner-view-state.test.tsx": 7073, "src/renderer/src/components/editor/PdfFind.test.tsx": 581, "src/renderer/src/components/editor/PluginBytesCustomEditorSurface.test.tsx": 641, "src/renderer/src/components/editor/PluginEditorNeedsDesktopNotice.test.tsx": 2107, "src/renderer/src/components/editor/PluginFileTypeSuggestion.test.tsx": 2062, "src/renderer/src/components/editor/rich-markdown/instance/RichMarkdownEditor.focus-leave.test.tsx": 4927, - "src/renderer/src/components/editor/rich-markdown/instance/RichMarkdownErrorBoundary.lazy-chunk.test.tsx": 367, "src/renderer/src/components/editor/ai-vault-session-log-content.test.tsx": 1899, "src/renderer/src/components/editor/check-details/actions/check-annotation-path.test.ts": 53, - "src/renderer/src/components/editor/check-details/reading/check-details-reading-viewport.test.ts": 259, "src/renderer/src/components/editor/model-lifetime/retention/closed-editor-model-lifetime.test.ts": 7921, "src/renderer/src/components/editor/model-lifetime/retention/closed-editor-model-shell.test.tsx": 4492, "src/renderer/src/components/editor/model-lifetime/retention/closed-editor-tab-disposal.test.ts": 121, @@ -4977,7 +4952,6 @@ "src/renderer/src/components/editor/monaco-programmatic-sync.test.ts": 46, "src/renderer/src/components/editor/pdf-orca-media-range-transport.test.ts": 282, "src/renderer/src/components/editor/pdf-view-position.test.ts": 74, - "src/renderer/src/components/editor/pdf-viewer-failed-load-recovery.test.tsx": 2363, "src/renderer/src/components/editor/pdf-viewer-zoom-ownership.test.tsx": 789, "src/renderer/src/components/editor/plugin-custom-editor-host.test.ts": 480, "src/renderer/src/components/editor/rich-markdown/raw-source/raw-markdown-html-line-break.test.ts": 2188, @@ -5048,17 +5022,13 @@ "src/renderer/src/components/editor/use-monaco-editor-mount.cursor-owner.test.tsx": 1332, "src/renderer/src/components/editor/use-monaco-editor-mount.stale-cache.test.tsx": 877, "src/renderer/src/components/editor/use-monaco-reveal-scheduler.test.tsx": 273, - "src/renderer/src/components/editor/use-pdf-viewer-find-shortcut.test.tsx": 907, "src/renderer/src/components/editor/use-preserve-section-during-external-edit.test.tsx": 268, "src/renderer/src/components/editor/rich-markdown/tables/use-rich-markdown-table-context-menu.test.tsx": 2238, - "src/renderer/src/components/editor/useEditorPanelContentState.test.tsx": 3214, "src/renderer/src/components/editor/external-changes/useEditorPanelExternalContentEvents.test.tsx": 2018, "src/renderer/src/components/editor/useEditorPanelFloatingTabContentState.test.tsx": 889, "src/renderer/src/components/editor/useEditorPanelHostUnresolvedContentState.test.tsx": 1952, - "src/renderer/src/components/editor/useEditorPanelVisibilityContentState.test.tsx": 2006, "src/renderer/src/components/editor/notebook/kernel/useIpynbCellExecution.test.tsx": 695, "src/renderer/src/components/editor/notebook/document/useIpynbDocumentEditing.test.tsx": 2192, - "src/renderer/src/components/editor/notebook/document/useIpynbScrollRestoration.test.tsx": 323, "src/renderer/src/components/editor/rich-markdown/links/useLinkBubble.test.tsx": 493, "src/renderer/src/components/editor/rich-markdown/images/useLocalImagePick.test.tsx": 1319, "src/renderer/src/components/editor/document-images/useLocalImageSrc.test.ts": 736, @@ -5082,11 +5052,7 @@ "src/renderer/src/components/emulator-pane/emulator-screen-stream-content.test.tsx": 408, "src/renderer/src/components/emulator-pane/use-emulator-pane-session.test.tsx": 1968, "src/renderer/src/components/emulator-pane/use-mobile-emulator-tab-intro-actions.test.tsx": 1828, - "src/renderer/src/components/error-boundaries/RecoverableRenderErrorBoundary.lazy-chunk.test.tsx": 451, - "src/renderer/src/components/error-boundaries/RecoverableRenderErrorBoundary.never-landed-reload.test.tsx": 449, - "src/renderer/src/components/feature-tips/ChatUiHereCornerCard.test.tsx": 2798, "src/renderer/src/components/feature-tips/ChatUiHereFeatureTipVisual.test.tsx": 1093, - "src/renderer/src/components/feature-tips/ChatUiHereTip.test.tsx": 6788, "src/renderer/src/components/feature-tips/feature-tip-modal-state.test.ts": 244, "src/renderer/src/components/feature-wall/FeatureWallSetupWorkflowActions.test.tsx": 2028, "src/renderer/src/components/feature-wall/FullDiskAccessSetupPrompt.test.ts": 466, @@ -5136,15 +5102,9 @@ "src/renderer/src/components/mobile/WindowsFirewallNotice.test.tsx": 691, "src/renderer/src/components/mobile/paired-mobile-devices.test.ts": 192, "src/renderer/src/components/mobile/use-mobile-page-paired-devices.test.ts": 475, - "src/renderer/src/components/native-chat-launch-resume-decision.test.tsx": 1844, - "src/renderer/src/components/native-chat-resume-bulk-progress.test.tsx": 3261, - "src/renderer/src/components/native-chat-resume-failed-chat-watch.test.ts": 1954, - "src/renderer/src/components/native-chat-resume-failure-guidance.test.ts": 240, - "src/renderer/src/components/native-chat-resume-finished-run.test.tsx": 4173, - "src/renderer/src/components/native-chat-resume-on-restart-grouping.test.ts": 117, - "src/renderer/src/components/native-chat-resume-result-view.test.tsx": 2723, - "src/renderer/src/components/native-chat-resume-run.test.ts": 65, - "src/renderer/src/components/native-chat-resume-skipped-progress.test.tsx": 3009, + "src/renderer/src/components/native-chat-recovery/integration/native-chat-resume-bulk-progress.test.tsx": 3261, + "src/renderer/src/components/native-chat-recovery/offers/native-chat-resume-failed-chat-watch.test.ts": 1954, + "src/renderer/src/components/native-chat-recovery/integration/native-chat-resume-finished-run.test.tsx": 4173, "src/renderer/src/components/native-chat/messages/rows/NativeChatAgentMessageCard.test.tsx": 3700, "src/renderer/src/components/native-chat/tools/tasks/NativeChatBackgroundTaskRun.test.tsx": 242, "src/renderer/src/components/native-chat/tools/tasks/NativeChatBackgroundTasksStatus.test.tsx": 782, @@ -5156,7 +5116,7 @@ "src/renderer/src/components/native-chat/attachments/chips/NativeChatImageAttachmentPreview.test.tsx": 2818, "src/renderer/src/components/native-chat/media/visuals/NativeChatInlineVisual.link-placement.test.tsx": 2477, "src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx": 2881, - "src/renderer/src/components/native-chat/usage/NativeChatInterruptedContinue.test.tsx": 2719, + "src/renderer/src/components/native-chat/viewport/scroll/NativeChatJumpToLatest.test.tsx": 477, "src/renderer/src/components/native-chat/markdown/code/NativeChatMarkdown.code-wrap.test.tsx": 3123, "src/renderer/src/components/native-chat/media/images/NativeChatMarkdown.image-preview.test.tsx": 4346, @@ -5173,7 +5133,6 @@ "src/renderer/src/components/native-chat/surfaces/integration/NativeChatMessageList.test.tsx": 4252, "src/renderer/src/components/native-chat/conversation/turns/NativeChatMessageList.turn-indicator.test.tsx": 4070, "src/renderer/src/components/native-chat/conversation/slots/NativeChatMessageList.turn-membership.test.tsx": 3527, - "src/renderer/src/components/native-chat/conversation/turns/NativeChatMessageList.turn-status.test.tsx": 3370, "src/renderer/src/components/native-chat/session/structured/delivery/NativeChatMessageList.unsent-message.test.tsx": 3069, "src/renderer/src/components/native-chat/viewport/scroll/NativeChatMessageList.visual-scroll.test.tsx": 6691, "src/renderer/src/components/native-chat/viewport/virtualization/NativeChatMessageList.windowing.test.tsx": 20958, @@ -5197,13 +5156,9 @@ "src/renderer/src/components/native-chat/selection-quotes/NativeChatSelectionQuote.test.tsx": 2370, "src/renderer/src/components/native-chat/surfaces/integration/NativeChatStructuredSession.approval-and-start-failure.test.tsx": 2922, "src/renderer/src/components/native-chat/surfaces/integration/NativeChatStructuredSession.availability-notice.test.tsx": 2764, - "src/renderer/src/components/native-chat/surfaces/integration/NativeChatStructuredSession.history-read-state.test.tsx": 4919, "src/renderer/src/components/native-chat/surfaces/integration/NativeChatStructuredSession.host-outage.test.tsx": 3552, - "src/renderer/src/components/native-chat/surfaces/integration/NativeChatStructuredSession.notice-card.test.tsx": 2911, "src/renderer/src/components/native-chat/surfaces/integration/NativeChatStructuredSession.refusal-notices.test.tsx": 3014, - "src/renderer/src/components/native-chat/surfaces/integration/NativeChatStructuredSession.retained-draft.test.tsx": 3736, "src/renderer/src/components/native-chat/surfaces/integration/NativeChatStructuredSession.test.tsx": 4459, - "src/renderer/src/components/native-chat/surfaces/integration/NativeChatStructuredSession.wsl-host-stopped.test.tsx": 3657, "src/renderer/src/components/native-chat/tools/tasks/NativeChatStructuredSessionStatus.test.tsx": 583, "src/renderer/src/components/native-chat/tools/lines/NativeChatToolLine.test.tsx": 3544, "src/renderer/src/components/native-chat/tools/lines/NativeChatToolOutput.test.tsx": 410, @@ -5242,10 +5197,8 @@ "src/renderer/src/components/native-chat/attachments/intake/native-chat-composer-drop-scope.test.tsx": 1409, "src/renderer/src/components/native-chat/attachments/intake/native-chat-composer-ime-file-drop.test.tsx": 1326, "src/renderer/src/components/native-chat/drafts/native-chat-composer-prompt-recall.test.tsx": 1724, - "src/renderer/src/components/native-chat/composer/focus/native-chat-composer-reveal-focus.test.tsx": 526, "src/renderer/src/components/native-chat/attachments/intake/native-chat-composer-workspace-file-drop.test.tsx": 1166, "src/renderer/src/components/native-chat/drafts/native-chat-draft-retention.test.ts": 1415, - "src/renderer/src/components/native-chat/attachments/intake/native-chat-element-file-drop.test.tsx": 2057, "src/renderer/src/components/native-chat/attachments/intake/native-chat-external-attachments-destination.test.tsx": 951, "src/renderer/src/components/native-chat/links/actions/native-chat-file-link-existence.test.ts": 1937, "src/renderer/src/components/native-chat/pane/actions/native-chat-header-ownership.test.tsx": 2796, @@ -5260,7 +5213,6 @@ "src/renderer/src/components/native-chat/native-chat-new-rows-marker.test.tsx": 581, "src/renderer/src/components/native-chat/pane/routing/native-chat-open-wake.test.ts": 1807, "src/renderer/src/components/native-chat/pane/ownership/native-chat-owner-selectors.test.tsx": 525, - "src/renderer/src/components/native-chat/attachments/intake/native-chat-pane-file-drop.test.tsx": 439, "src/renderer/src/components/native-chat/paste/native-chat-paste-routing.test.tsx": 2417, "src/renderer/src/components/native-chat/session/terminal/delivery/native-chat-pending.test.ts": 273, "src/renderer/src/components/native-chat/composer/editor/native-chat-prompt-document-text.test.ts": 219, @@ -5268,7 +5220,6 @@ "src/renderer/src/components/native-chat/queue/editing/native-chat-queued-edit-draft.test.ts": 649, "src/renderer/src/components/native-chat/viewport/rail/native-chat-rail-outline-parity.test.ts": 497, "src/renderer/src/components/native-chat/viewport/scroll/native-chat-reader-scroll-input.test.tsx": 311, - "src/renderer/src/components/native-chat/paste/native-chat-remote-image-paste.test.tsx": 1834, "src/renderer/src/components/native-chat/attachments/uploads/native-chat-resolved-path-ownership.test.ts": 1749, "src/renderer/src/components/native-chat/viewport/virtualization/native-chat-row-height-estimate.test.ts": 293, "src/renderer/src/components/native-chat/drafts/native-chat-sent-prompt-history.test.ts": 217, @@ -5278,7 +5229,6 @@ "src/renderer/src/components/native-chat/pane/routing/native-chat-split-flow.test.ts": 1916, "src/renderer/src/components/native-chat/composer/submit/native-chat-structured-send-composition-clear.test.tsx": 2098, "src/renderer/src/components/native-chat/subagents/native-chat-subagent-handoff-copy-budget.test.ts": 362, - "src/renderer/src/components/native-chat/subagents/native-chat-subagent-section-work-runs.test.ts": 278, "src/renderer/src/components/native-chat/pane/routing/native-chat-tab-directory.test.ts": 304, "src/renderer/src/components/native-chat/native-chat-task-list-state.test.ts": 62, "src/renderer/src/components/native-chat/native-chat-thread-goal-rows.test.ts": 50, @@ -5310,7 +5260,6 @@ "src/renderer/src/components/native-chat/conversation/projection/use-native-chat-context-clear-floor.test.tsx": 271, "src/renderer/src/components/native-chat/pane/actions/use-native-chat-context-menu.targets.test.tsx": 3071, "src/renderer/src/components/native-chat/attachments/intake/use-native-chat-external-attachments.test.tsx": 797, - "src/renderer/src/components/native-chat/viewport/find/use-native-chat-find.test.tsx": 1458, "src/renderer/src/components/native-chat/session/status/use-native-chat-hook-status.test.ts": 1927, "src/renderer/src/components/native-chat/host-access/use-native-chat-host-outage.test.tsx": 2131, "src/renderer/src/components/native-chat/drafts/use-native-chat-launch-draft-adoption.test.tsx": 319, @@ -5346,8 +5295,6 @@ "src/renderer/src/components/new-workspace/DirectWorkItemSetupDialog.test.tsx": 5296, "src/renderer/src/components/new-workspace/NewWorkspaceComposerNameSection.test.tsx": 2493, "src/renderer/src/components/new-workspace/ProjectCombobox.dialog-handoff.test.tsx": 1043, - "src/renderer/src/components/new-workspace/ProjectCombobox.test.tsx": 848, - "src/renderer/src/components/new-workspace/ProjectComboboxRow.test.tsx": 415, "src/renderer/src/components/new-workspace/RunTargetCombobox.host-identity.test.tsx": 856, "src/renderer/src/components/new-workspace/SetProjectLocationDialog.host-identity.test.tsx": 1094, "src/renderer/src/components/new-workspace/SetProjectLocationDialog.test.tsx": 1387, @@ -5361,7 +5308,6 @@ "src/renderer/src/components/new-workspace/use-recent-project-ids.test.ts": 1730, "src/renderer/src/components/new-workspace/use-smart-workspace-name-field-foundation.source.test.tsx": 2290, "src/renderer/src/components/new-workspace/work-item-source-selection.test.ts": 1736, - "src/renderer/src/components/onboarding/OnboardingInlineCommandTerminal.command-finished.test.tsx": 681, "src/renderer/src/components/onboarding/OnboardingLanguageLoading.test.tsx": 2167, "src/renderer/src/components/onboarding/onboarding-feature-setup.test.ts": 76, "src/renderer/src/components/pet/pet-blob-cache.test.ts": 64, @@ -5425,7 +5371,6 @@ "src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-panel-session-list-request.test.tsx": 3044, "src/renderer/src/components/right-sidebar/ai-vault/search/ai-vault-search-session.test.ts": 201, "src/renderer/src/components/right-sidebar/ai-vault/accounts/ai-vault-session-account-render.test.tsx": 2885, - "src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-conditional-refresh-hook.test.tsx": 2370, "src/renderer/src/components/right-sidebar/ai-vault/session-list/ai-vault-session-filters.test.ts": 105, "src/renderer/src/components/right-sidebar/ai-vault/scope/ai-vault-session-projects.test.ts": 117, "src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.test.ts": 2034, @@ -5441,7 +5386,6 @@ "src/renderer/src/components/right-sidebar/checks-panel/gitlab-review-client.test.ts": 321, "src/renderer/src/components/right-sidebar/checks-panel/comments/review-comment-markdown.test.tsx": 2171, "src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-manual-refresh-recovery.test.tsx": 2909, - "src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-polling.test.tsx": 2189, "src/renderer/src/lib/repository-refresh/coalesced-poll-runner.test.ts": 61, "src/renderer/src/components/right-sidebar/file-explorer/mutations/file-explorer-delete-undo-precondition.test.tsx": 2023, "src/renderer/src/components/right-sidebar/file-explorer/tree/file-explorer-dir-pages.test.ts": 1767, @@ -5463,7 +5407,6 @@ "src/renderer/src/components/right-sidebar/plugin-panels/health/plugin-panel-watchdog.test.ts": 116, "src/renderer/src/components/right-sidebar/checks-panel/comments/pr-comments-ai-launch-ack.test.ts": 118, "src/renderer/src/components/right-sidebar/checks-panel/comments/pr-comments-list-selection.test.tsx": 3290, - "src/renderer/src/components/right-sidebar/right-sidebar-titlebar-drag-regions.render.test.tsx": 1044, "src/renderer/src/components/right-sidebar/source-control/ai/runSourceControlAgentActionStart.test.ts": 1917, "src/renderer/src/components/right-sidebar/source-control/review/source-control-create-pr-intent-flow.test.ts": 71, "src/renderer/src/components/right-sidebar/source-control/review/source-control-manual-review-url.test.ts": 77, @@ -5491,7 +5434,6 @@ "src/renderer/src/components/right-sidebar/file-explorer/mutations/useFileDeletion.save-refusal.test.tsx": 840, "src/renderer/src/components/right-sidebar/file-explorer/mutations/useFileDeletion.trash-failure.test.tsx": 774, "src/renderer/src/components/right-sidebar/file-explorer/mutations/useFileExplorerImport.committed-scope.test.tsx": 588, - "src/renderer/src/components/right-sidebar/file-explorer/mutations/useFileExplorerImport.remote.test.tsx": 2054, "src/renderer/src/components/right-sidebar/file-explorer/tree/useFileExplorerTree.lifecycle.test.tsx": 1925, "src/renderer/src/components/right-sidebar/file-explorer/tree/useFileExplorerTree.paged-dirs.test.tsx": 2484, "src/renderer/src/components/right-sidebar/file-explorer/tree/useFileExplorerTree.scoped-root.test.tsx": 2131, @@ -5501,10 +5443,7 @@ "src/renderer/src/components/right-sidebar/hosted-review/provider-actions/useHostedReviewStackParent.test.tsx": 288, "src/renderer/src/components/right-sidebar/source-control/listing/useSourceControlSubmoduleStatus.test.tsx": 2076, "src/renderer/src/components/settings/accounts/AccountsPane.owner-scope.test.tsx": 4057, - "src/renderer/src/components/skills/setup/AgentSkillSetupPanel.freshness.test.tsx": 15418, - "src/renderer/src/components/skills/setup/AgentSkillSetupPanel.plan-status.test.tsx": 23334, - "src/renderer/src/components/skills/setup/AgentSkillSetupPanel.remote-availability.test.tsx": 5937, - "src/renderer/src/components/skills/setup/AgentSkillSetupPanel.test.tsx": 2315, + "src/renderer/src/components/settings/agents/AgentsPane.test.tsx": 3230, "src/renderer/src/components/settings/accounts/providers/AntigravityAccountsSection.test.tsx": 2722, "src/renderer/src/components/settings/appearance/chat/AppearanceChatContrastControls.draft.test.tsx": 795, @@ -5512,10 +5451,8 @@ "src/renderer/src/components/settings/browser/BrowserSitePermissionsSetting.test.tsx": 739, "src/renderer/src/components/settings/browser/BrowserUserAgentSetting.test.tsx": 2325, "src/renderer/src/components/settings/chat/ChatNamingSetting.test.tsx": 2454, - "src/renderer/src/components/settings/chat/ChatPermissionSetting.test.tsx": 834, - "src/renderer/src/components/settings/chat/ChatSettingsSection.navigation.test.tsx": 2540, "src/renderer/src/components/settings/chat/ChatSettingsSection.test.tsx": 2718, - "src/renderer/src/lib/skill-runtime-command.test.ts": 1670, + "src/renderer/src/lib/skills/runtime/skill-runtime-command.test.ts": 1670, "src/renderer/src/components/settings/virtual-machines/recipes/EphemeralVmsPane.test.tsx": 1025, "src/renderer/src/components/settings/accounts/sign-in/HostAccountSignInPrompt.test.tsx": 309, "src/renderer/src/components/settings/agents/launch/HostAgentLaunchSettings.test.tsx": 7498, @@ -5526,7 +5463,6 @@ "src/renderer/src/components/settings/advanced/network/NodeDistMirrorDialog.test.tsx": 2412, "src/renderer/src/components/plugins/list/PluginsSettingsSection.lifecycle.test.tsx": 5402, "src/renderer/src/components/settings/runtime-environments/pairing/RuntimePairingGeneratorForm.test.tsx": 461, - "src/renderer/src/components/settings/session-history/SessionHistorySettingsPane.test.tsx": 1474, "src/renderer/src/components/settings/appearance/fonts/FontAutocomplete.test.tsx": 1202, "src/renderer/src/components/settings/form-controls/SettingsFormControls.segmented-control.test.tsx": 730, "src/renderer/src/components/settings/shortcuts/ShortcutFilterRail.test.ts": 273, @@ -5541,12 +5477,9 @@ "src/renderer/src/components/settings/TerminalAppearanceSection.ghostty.test.ts": 549, "src/renderer/src/components/settings/terminal/appearance/TerminalContrastSetting.test.tsx": 798, "src/renderer/src/components/settings/terminal/session-management/TerminalLimitSetting.test.tsx": 1015, - "src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx": 1237, - "src/renderer/src/components/settings/terminal/appearance/TerminalSettingsPreview.lifecycle.test.tsx": 595, "src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.test.tsx": 401, "src/renderer/src/components/settings/voice/VoiceMicrophoneSetting.test.tsx": 957, "src/renderer/src/components/settings/voice/VoicePane.test.tsx": 1042, - "src/renderer/src/components/settings/voice/VoiceSpeechModelSection.test.tsx": 503, "src/renderer/src/components/settings/accounts/sign-in/account-add-cancel-target.test.ts": 217, "src/renderer/src/components/settings/accounts/usage/accounts-pane-opencode-credentials.test.ts": 519, "src/renderer/src/lib/agent-session/launch/agent-settings-update-queue.test.ts": 249, @@ -5556,7 +5489,6 @@ "src/renderer/src/components/settings/developer-permissions/developer-permissions-search.test.ts": 308, "src/renderer/src/components/settings/shortcuts/keybinding-diagnostic-text.test.ts": 522, "src/renderer/src/components/settings/shortcuts/keybinding-title-copy.test.ts": 227, - "src/renderer/src/lib/agent-session/launch/native-chat-provider-choice.test.tsx": 3738, "src/renderer/src/components/settings/notifications/notification-host-pending-save.test.tsx": 2029, "src/renderer/src/components/settings/repository/RepositoryJiraProjectSection.test.tsx": 463, "src/renderer/src/components/settings/repository/RepositoryPaneDraftInput.test.tsx": 314, @@ -5578,10 +5510,7 @@ "src/renderer/src/components/settings/runtime-environments/catalog/use-runtime-environment-mutation-actions.test.tsx": 2069, "src/renderer/src/components/session-search/use-session-search-status.test.tsx": 477, "src/renderer/src/components/settings/accounts/usage/use-zcode-plan-credentials.test.tsx": 880, - "src/renderer/src/lib/directory-path-suggestion-filter.scan-budget.test.ts": 68, - "src/renderer/src/lib/directory-path-suggestion-filter.test.ts": 51, "src/renderer/src/components/setup-guide/SetupGuideModal.mount-gating.test.tsx": 2348, - "src/renderer/src/components/shared/MacFolderAccessFixDialog.test.tsx": 1356, "src/renderer/src/components/shared/kill-all-terminal-surfaces.test.ts": 1925, "src/renderer/src/components/shared/useDaemonActions.test.tsx": 332, "src/renderer/src/components/sidebar/host-admission/ssh/AddRemoteHostDialog.config-picker.test.tsx": 1178, @@ -5603,7 +5532,6 @@ "src/renderer/src/components/sidebar/SeveredTerminalDaemonBanner.test.tsx": 574, "src/renderer/src/components/sidebar/Sidebar.test.tsx": 833, "src/renderer/src/components/sidebar/SidebarAgentsList.test.tsx": 2985, - "src/renderer/src/components/sidebar/sidebar-feedback/SidebarFeedbackDialog.test.tsx": 2529, "src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.test.tsx": 320, "src/renderer/src/components/sidebar/workspace-board/viewport/WorkspaceKanbanLaneGrid.test.tsx": 360, "src/renderer/src/components/sidebar/workspace-card/surface/WorktreeCard.single-reference-details.test.tsx": 2032, @@ -5689,7 +5617,6 @@ "src/renderer/src/components/sidebar/worktree-list/rows/repo-header-ssh-isolation.test.tsx": 2945, "src/renderer/src/components/sidebar/worktree-list/rows/section-header-create-host.test.tsx": 2393, "src/renderer/src/components/sidebar/worktree-list/viewport/hard-scroll-up.test.ts": 66, - "src/renderer/src/components/sidebar/worktree-list/viewport/header-folder-composition.test.tsx": 3725, "src/renderer/src/components/sidebar/worktree-list/viewport/use-scroll-to-top.test.ts": 293, "src/renderer/src/components/sidebar/worktree-list/viewport/use-scroll-to-top.test.tsx": 269, "src/renderer/src/components/sidebar/worktree-list/drag/worktree-manual-order-store-write.test.ts": 2144, @@ -5697,22 +5624,17 @@ "src/renderer/src/components/sidebar/workspace-actions/parenting/worktree-parent-eligibility.test.ts": 68, "src/renderer/src/components/sidebar/worktree-list/listing/worktree-sort-label-ordering.test.ts": 114, "src/renderer/src/components/sidebar/wsl-host-offer-move.test.ts": 227, - "src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx": 913, - "src/renderer/src/components/skills/SkillInstallDialog.test.tsx": 4429, - "src/renderer/src/components/skills/SkillInstallManagementDialog.test.tsx": 3300, - "src/renderer/src/components/skills/SkillSharedLinkRow.test.tsx": 817, + + "src/renderer/src/components/skills/installation/SkillInstallManagementDialog.test.tsx": 3300, + "src/renderer/src/components/skills/sharing/SkillSharedLinkRow.test.tsx": 817, "src/renderer/src/components/skills/SkillsPage.test.tsx": 3822, - "src/renderer/src/components/skills/skill-agent-filter.test.ts": 274, - "src/renderer/src/components/skills/skill-share-link.test.ts": 55, - "src/renderer/src/components/skills/skill-share-package-selection.test.ts": 49, - "src/renderer/src/components/skills/skills-filter.test.ts": 204, + "src/renderer/src/components/skills/catalog/skill-agent-filter.test.ts": 274, + "src/renderer/src/components/sparse/sparse-directory-entry-input.test.ts": 207, "src/renderer/src/components/stats/usage-daily-chart.test.tsx": 333, "src/renderer/src/components/stats/usage-overview-model.test.ts": 364, "src/renderer/src/components/status-bar/ClaudeSwitcherMenu.owner-lifetime.test.tsx": 2317, - "src/renderer/src/components/status-bar/NativeChatResumeStatusSegment.test.tsx": 2452, - "src/renderer/src/components/status-bar/PortsStatusSegment.render-stability.test.tsx": 2161, - "src/renderer/src/components/status-bar/SkillUpdateStatusSegment.test.tsx": 594, + "src/renderer/src/components/status-bar/SshStatusSegment.large-host-list.test.tsx": 1838, "src/renderer/src/components/status-bar/StatusBarUsageChangeNotices.test.tsx": 785, "src/renderer/src/components/status-bar/UpdateStatusSegment.test.tsx": 2484, @@ -5733,7 +5655,6 @@ "src/renderer/src/components/status-bar/use-resource-pty-actions.test.tsx": 879, "src/renderer/src/components/status-bar/use-resource-usage-derived-model.test.tsx": 742, "src/renderer/src/components/tab-bar/CopyTabIdMenuItem.test.tsx": 428, - "src/renderer/src/components/tab-bar/NativeChatNamingFailure.test.tsx": 1062, "src/renderer/src/components/tab-bar/TabBarCreateEntry.search.test.tsx": 3224, "src/renderer/src/components/tab-bar/TabBarItemRow.test.tsx": 2116, "src/renderer/src/components/tab-bar/TabBarQuickCommandItem.test.tsx": 384, @@ -5752,7 +5673,6 @@ "src/renderer/src/components/tab-bar/tab-context-menu.test.tsx": 5620, "src/renderer/src/components/tab-bar/tab-create-entry-classifier.test.ts": 510, "src/renderer/src/components/tab-bar/tab-create-entry-local-path.test.ts": 2614, - "src/renderer/src/components/tab-bar/tab-create-entry-preview.test.ts": 882, "src/renderer/src/components/tab-bar/tab-session-history-switch.test.ts": 2348, "src/renderer/src/components/tab-bar/tab-strip-growth-scroll.test.tsx": 2164, "src/renderer/src/components/tab-bar/tab-strip-pointer-activation.test.tsx": 2047, @@ -5808,10 +5728,6 @@ "src/renderer/src/components/task-page/use-task-page-source-display.test.tsx": 5228, "src/renderer/src/components/terminal-pane/layout/close/RunningTerminalCloseDialog.test.tsx": 2303, "src/renderer/src/components/terminal-pane/session-fork/TerminalAgentSessionForkDialog.test.tsx": 266, - "src/renderer/src/components/terminal-pane/titles/TerminalPaneHeaderOverlay.test.tsx": 1104, - "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/TerminalPaneRecoveryPortals.test.tsx": 670, - "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/TerminalRemoteRuntimeReconnectBanner.test.tsx": 812, - "src/renderer/src/components/terminal-pane/pty-transport/recovery/ssh/TerminalSshReconnectOverlay.test.tsx": 2354, "src/renderer/src/components/terminal-pane/account-restart/detached/account-restart-queue-progress.test.ts": 1988, "src/renderer/src/components/terminal-pane/agent-completion/agent-completion-coordinator-attention-dispatch.test.ts": 301, "src/renderer/src/components/terminal-pane/agent-completion/agent-completion-coordinator-completion-replay-guard.test.ts": 318, @@ -5861,7 +5777,6 @@ "src/renderer/src/components/terminal-pane/layout/close/pending-pane-close-confirmation.test.ts": 4695, "src/renderer/src/components/terminal-pane/layout/close/pending-runtime-pane-close.test.ts": 3487, "src/renderer/src/components/terminal-pane/layout/close/pending-split-close.test.ts": 4680, - "tests/e2e/terminal-agent-pane-launch.unit.test.ts": 8045, "src/renderer/src/components/terminal-pane/snapshots/pty-buffer-serializer.test.ts": 53, "src/renderer/src/components/terminal-pane/pty-connection/agent-identity/pty-connection-command-finished-late-done.test.ts": 10940, "src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-completion-and-notification.test.ts": 18380, @@ -5885,7 +5800,6 @@ "src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-post-dispose-restore-termination.test.ts": 1215, "src/renderer/src/components/terminal-pane/pty-connection/agent-identity/pty-connection-process-exit-row-retire.test.ts": 10626, "src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-owner-hydration-backend-retention.test.ts": 4181, - "src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-queued-startup-consume.test.ts": 4181, "src/renderer/src/components/terminal-pane/pty-connection/reattach/pty-connection-reattach-binding.test.ts": 5240, "src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-remote-new-terminal-typeahead.test.ts": 1864, "src/renderer/src/components/terminal-pane/pty-connection/reattach/pty-connection-remote-snapshot-image-title.test.ts": 1754, @@ -5893,7 +5807,6 @@ "src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-restored-baseline-shortfall.test.ts": 1902, "src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts": 19652, "src/renderer/src/components/terminal-pane/pty-connection/spawn/pty-connection-spawn-deferred-sleep.test.ts": 6918, - "src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-split-cwd-resolution.test.ts": 2139, "src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts": 18950, "src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-visible-pane-output-pause-latch.test.ts": 1639, "src/renderer/src/components/terminal-pane/pty-connection/reattach/deferred-session-reattach-newer-daemon-hold.test.ts": 2570, @@ -5902,18 +5815,15 @@ "src/shared/terminal/protocol/escape/terminal-synchronized-output-socket-splits.test.ts": 92, "src/renderer/src/components/terminal-pane/pty-connection/output/foreground-renderer-risk-scan-tail.test.ts": 111, "src/renderer/src/components/terminal-pane/pty-connection/spawn/hidden-agent-resume-deferral.test.ts": 55, - "src/renderer/src/components/terminal-pane/pty-connection/startup/in-place-resume-hold-wiring.test.ts": 2484, "src/renderer/src/components/terminal-pane/pty-connection/startup/main-pane-resume-banner.test.ts": 59, "src/renderer/src/components/terminal-pane/pty-connection/spawn/main-pane-start-wait.test.ts": 76, "src/renderer/src/components/terminal-pane/pty-connection/serialization/pane-serializer-register.test.ts": 123, "src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-kitty-file-reader.test.ts": 297, - "src/renderer/src/components/terminal-pane/pty-connection/startup/saved-resume-cancellation.test.ts": 1882, "src/renderer/src/components/terminal-pane/pty-connection/output-restore/snapshot-covered-terminal-queries.test.ts": 150, "src/renderer/src/components/terminal-pane/pty-connection/output/terminal-input-echo-delay.test.ts": 132, "src/renderer/src/components/terminal-pane/pty-connection/host-ownership/unserved-ssh-pane-bridge.test.ts": 70, "src/renderer/src/components/terminal-pane/pty-transport/delivery/pty-dispatcher-delivery-resync.test.ts": 85, "src/renderer/src/components/terminal-pane/pty-transport/delivery/pty-dispatcher-pi-routing.test.ts": 1362, - "src/renderer/src/components/terminal-pane/pty-transport/delivery/pty-dispatcher-push-reattach.test.ts": 108, "src/renderer/src/components/terminal-pane/pty-transport/input/pty-input-write-queue.test.ts": 787, "src/renderer/src/components/terminal-pane/pty-transport/delivery/pty-model-restore-channel.test.ts": 44, "src/renderer/src/components/terminal-pane/pty-transport/output/pty-output-processor-program-activity.test.ts": 160, @@ -5926,7 +5836,6 @@ "src/renderer/src/components/terminal-pane/pty-transport/shutdown/pty-shutdown-exit-deferral.test.ts": 121, "src/renderer/src/components/terminal-pane/viewport/pty-size-reassertion.test.ts": 58, "src/renderer/src/components/terminal-pane/viewport/pty-size-reconcile.test.ts": 68, - "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-connect-spawn.test.ts": 3186, "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-detach-attach-handoff.test.ts": 1199, "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-eager-buffer-replay.test.ts": 1636, "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-handler-suspension.test.ts": 1243, @@ -5935,7 +5844,6 @@ "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-pi-coalesce.test.ts": 683, "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-reattach-admission.test.ts": 1636, "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-recycled-pty-incarnation.test.ts": 787, - "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-spawn-errors.test.ts": 1218, "src/renderer/src/components/terminal-pane/input/focus/regular-terminal-focus-ownership.test.ts": 208, "src/renderer/src/components/terminal-pane/pty-connection/output-restore/remote-hidden-output-restore-outcomes.test.ts": 2794, "src/renderer/src/components/terminal-pane/pty-connection/output-restore/remote-hidden-output-restore-unavailable-banner.repro.test.ts": 2355, @@ -5952,7 +5860,6 @@ "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-query-reply-immediate.test.ts": 1556, "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/remote-runtime-pty-recovery-state.test.ts": 85, "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-activation-inventory-fallback.test.ts": 1311, - "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-attach-subscription.test.ts": 2346, "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts": 14353, "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-outcome-recovery.test.ts": 2041, "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-empty-initial-snapshot.test.ts": 1491, @@ -6001,14 +5908,9 @@ "src/renderer/src/components/terminal-pane/input/paste/terminal-bracketed-paste.test.ts": 57, "src/renderer/src/components/terminal-pane/emulation/terminal-capability-replies.test.ts": 131, "src/renderer/src/components/terminal-pane/clipboard/terminal-clipboard-paste.test.ts": 76, - "src/renderer/src/components/terminal-pane/parking/retention/terminal-cold-park-timer-rearm.test.tsx": 701, - "src/renderer/src/components/terminal-pane/pty-transport/delivery/terminal-delivery-watchdog.test.ts": 111, - "src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-handler.test.ts": 638, "src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-image-path.test.ts": 61, - "src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-internal-handler.test.ts": 800, "src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-path-writer.test.ts": 245, "src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-runtime-catalog-owner.test.ts": 872, - "src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-source-owner.test.ts": 622, "src/renderer/src/components/terminal-pane/viewport/terminal-fit-restore.test.ts": 59, "src/renderer/src/components/terminal-pane/links/handles/terminal-handle-links.test.ts": 527, "src/renderer/src/components/terminal-pane/parking/retention/terminal-hidden-view-parking.test.ts": 325, @@ -6041,7 +5943,6 @@ "src/shared/workspace-layout/terminal-layout-pty-ownership-depth.test.ts": 82, "src/renderer/src/components/terminal-pane/layout/terminal-layout-pty-ownership.test.ts": 99, "src/renderer/src/components/terminal-pane/links/terminal-link-click-fallback.test.ts": 985, - "src/renderer/src/components/terminal-pane/links/files/terminal-link-file-open-routing.test.ts": 970, "src/renderer/src/components/terminal-pane/links/terminal-link-open-beside-source.test.ts": 947, "src/renderer/src/components/terminal-pane/links/http/terminal-link-osc-url-routing.test.ts": 986, "src/renderer/src/components/terminal-pane/links/terminal-link-paired-click-fallback.test.ts": 989, @@ -6059,14 +5960,11 @@ "src/renderer/src/components/terminal-pane/layout/reconciliation/terminal-pane-frame-reconciliation.test.ts": 903, "src/renderer/src/components/terminal-pane/host-state/terminal-pane-host-state-memo.test.ts": 4534, "src/renderer/src/components/terminal-pane/mounting/terminal-pane-mount-bootstrap.test.ts": 1723, - "src/renderer/src/components/terminal-pane/render-health/recovery/terminal-pane-recovery-unsettled-fallback.test.ts": 831, "src/renderer/src/components/terminal-pane/render-health/recovery/terminal-pane-recovery.test.ts": 949, "src/renderer/src/components/terminal-pane/layout/split/terminal-pane-split-request-routing.test.ts": 2015, - "src/renderer/src/components/terminal-pane/pty-transport/recovery/terminal-pane-surface-ownership.test.ts": 426, "src/renderer/src/components/terminal-pane/layout/detach/terminal-pane-tab-detach-main-commit.test.ts": 2090, "src/renderer/src/components/terminal-pane/layout/detach/terminal-pane-tab-detach-main-move.test.ts": 2147, "src/renderer/src/components/terminal-pane/parking/verdict/terminal-park-verdict-flip-telemetry.test.ts": 123, - "src/renderer/src/components/terminal-pane/parking/verdict/terminal-park-verdict-worktree-driver-loop.test.tsx": 735, "src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-tab-watchers.test.ts": 473, "src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-watcher-reconciliation.test.ts": 243, "src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-watcher-registry.test.ts": 245, @@ -6188,8 +6086,7 @@ "src/renderer/src/hooks/editor-external-watch-overflow.test.ts": 1023, "src/renderer/src/hooks/editor-external-watch-selected-host.test.ts": 1988, "src/renderer/src/hooks/editor-runtime-file-watch.test.ts": 58, - "src/renderer/src/hooks/installed-agent-skill-discovery-cache.test.ts": 53, - "src/renderer/src/hooks/installed-agent-skill-discovery.test.ts": 74, + "src/renderer/src/hooks/ipc-events/agent-status-pane-routing-index-retention.test.ts": 4878, "src/renderer/src/hooks/ipc-events/agent-status-pending-retry-gate.test.ts": 466, "src/renderer/src/hooks/ipc-events/agent-status-terminal-title-tab-write.test.ts": 2247, @@ -6226,7 +6123,7 @@ "src/renderer/src/hooks/runtime-project-refresh-scheduler.test.ts": 65, "src/renderer/src/hooks/shortcut-label-cache.test.tsx": 2021, "src/renderer/src/hooks/unpaired-device-auth-notification.test.ts": 41, - "src/renderer/src/hooks/use-bundled-skill-install.test.tsx": 553, + "src/renderer/src/hooks/use-document-dark-theme.test.tsx": 350, "src/renderer/src/hooks/use-list-multi-selection.test.tsx": 545, "src/renderer/src/hooks/use-monaco-theme.test.tsx": 323, @@ -6252,9 +6149,8 @@ "src/renderer/src/hooks/useEphemeralVmRecipeOptions.test.tsx": 415, "src/renderer/src/hooks/useGitHubSlugMetadata.assignee-reuse.test.tsx": 233, "src/renderer/src/hooks/useImmediateMutation.test.ts": 618, - "src/renderer/src/hooks/useInstalledAgentSkills.react.test.tsx": 2093, + "src/renderer/src/hooks/skills/discovery/useInstalledAgentSkills.react.test.tsx": 2093, "src/renderer/src/hooks/useIpcEvents-agent-status-connection-attribution.test.ts": 5510, - "src/renderer/src/hooks/useIpcEvents-agent-status-hook-titles.test.ts": 5621, "src/renderer/src/hooks/useIpcEvents-agent-status-pane-teardown.test.ts": 5268, "src/renderer/src/hooks/useIpcEvents-agent-status-queue-ordering.test.ts": 3680, "src/renderer/src/hooks/useIpcEvents-agent-status-snapshot-hydration.test.ts": 7403, @@ -6268,15 +6164,13 @@ "src/renderer/src/hooks/useIpcEvents-cmd-j-digit-chord.test.ts": 2703, "src/renderer/src/hooks/useIpcEvents-lifecycle.test.ts": 2326, "src/renderer/src/hooks/useIpcEvents-new-workspace-shortcut.test.ts": 72, - "src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts": 1597, "src/renderer/src/hooks/useIpcEvents-runtime-environment-selectors.test.ts": 530, "src/renderer/src/hooks/useIpcEvents-session-tab-close-request.test.ts": 2252, "src/renderer/src/hooks/useIssueMetadata.test.tsx": 344, - "src/renderer/src/hooks/useMacTccAttributionSeveredNotice.test.tsx": 2358, "src/renderer/src/hooks/useMetadataListRequest.test.tsx": 266, "src/renderer/src/hooks/useModalReturnFocus.test.tsx": 1938, - "src/renderer/src/hooks/usePrimarySelectionPaste.terminal-native-paste.test.tsx": 388, - "src/renderer/src/hooks/usePrimarySelectionPaste.test.tsx": 411, + "src/renderer/src/hooks/clipboard/primary-selection/usePrimarySelectionPaste.terminal-native-paste.test.tsx": 388, + "src/renderer/src/hooks/clipboard/primary-selection/usePrimarySelectionPaste.test.tsx": 411, "src/renderer/src/hooks/useReadOnScreenAttention.away.test.ts": 2420, "src/renderer/src/hooks/useReadOnScreenAttention.clock-skew.test.ts": 2093, "src/renderer/src/hooks/useReadOnScreenAttention.floating-panel.test.ts": 2157, @@ -6284,7 +6178,7 @@ "src/renderer/src/hooks/useReadOnScreenAttention.mixed-workspace.test.ts": 1725, "src/renderer/src/hooks/useReadOnScreenAttention.test.ts": 1915, "src/renderer/src/hooks/useRetiredWorktreeNames.test.ts": 593, - "src/renderer/src/hooks/useSkillFreshness.test.tsx": 554, + "src/renderer/src/hooks/useUnreadDockBadge.test.ts": 2126, "src/renderer/src/hooks/virtualized-hidden-row-measurement.test.ts": 199, "src/renderer/src/hooks/worktree-change-refresh-queue.test.ts": 59, @@ -6308,8 +6202,6 @@ "src/renderer/src/lib/agent-session/hibernation/agent-hibernation-pane-age.test.ts": 41, "src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.test.ts": 341, "src/renderer/src/lib/agent-session/hibernation/agent-hibernation-runtime-liveness-race.test.ts": 1914, - "src/renderer/src/lib/agent-session/launch/new-tab/agent-launch-caller-prompt-transport.test.ts": 1326, - "src/renderer/src/lib/agent-session/launch/new-tab/agent-launch-caller-routing.test.ts": 1266, "src/renderer/src/lib/agent-session/launch/pane/agent-launch-pane-verdict-application.test.ts": 1869, "src/renderer/src/lib/agent-session/launch/routing/agent-launch-route-input.test.ts": 1659, "src/renderer/src/lib/agent-session/launch/routing/agent-launch-route-registered-agents.test.ts": 1749, @@ -6350,9 +6242,9 @@ "src/renderer/src/lib/agent-session/resume/history/ai-vault-session-resume-preparation.test.ts": 408, "src/renderer/src/lib/agent-session/history/title-sync/ai-vault-tab-title-sync-inputs.test.ts": 476, "src/renderer/src/lib/agent-session/history/title-sync/ai-vault-tab-title-sync.test.ts": 925, - "src/renderer/src/lib/app-command-dispatch.test.ts": 64, - "src/renderer/src/lib/app-keyboard-router.test.ts": 187, - "src/renderer/src/lib/app-menu-paste.test.ts": 229, + "src/renderer/src/lib/app-commands/app-command-dispatch.test.ts": 64, + "src/renderer/src/lib/keyboard/app-keyboard-router.test.ts": 187, + "src/renderer/src/lib/clipboard/menu/app-menu-paste.test.ts": 229, "src/renderer/src/lib/automation-session-reuse.test.ts": 70, "src/renderer/src/lib/automation-terminal-ownership.test.ts": 1795, "src/renderer/src/lib/bounded-generation-map.test.ts": 35, @@ -6363,12 +6255,12 @@ "src/renderer/src/lib/browser/navigation/browser-link-profile-isolation.test.ts": 2511, "src/renderer/src/lib/browser/palette/browser-page-palette-activation.test.ts": 1983, "src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts": 480, - "src/renderer/src/lib/bundled-skill-target.test.ts": 54, + "src/renderer/src/lib/skills/runtime/bundled-skill-target.test.ts": 54, "src/renderer/src/lib/source-control/checks/check-run-details-log-normalization-performance.test.ts": 846, "src/renderer/src/lib/source-control/checks/check-run-details-log-normalization.test.ts": 75, "src/renderer/src/lib/claude-account-switch-sessions.test.ts": 782, "src/renderer/src/lib/claude-session-account-move.test.ts": 1816, - "src/renderer/src/lib/clipboard-image-copy.test.ts": 243, + "src/renderer/src/lib/clipboard/images/clipboard-image-copy.test.ts": 243, "src/renderer/src/lib/cmd-j-host-qualified-candidate-ownership.test.ts": 526, "src/renderer/src/lib/cmd-j-linear-issue-intent.test.ts": 42, "src/renderer/src/lib/code-host-error-copy.test.ts": 297, @@ -6377,11 +6269,9 @@ "src/renderer/src/lib/agent-session/accounts/codex/codex-session-restart.test.ts": 2039, "src/renderer/src/lib/codex-stale-pane-account-identity.test.ts": 1823, "src/renderer/src/lib/codex-stale-pane-sweep.test.ts": 1817, - "src/renderer/src/lib/comment-body-line-count.test.ts": 84, - "src/renderer/src/lib/comment-body-submit-state.test.ts": 55, + "src/renderer/src/lib/source-control/review/comments/comment-body-submit-state.test.ts": 55, "src/renderer/src/lib/composer-submit-cancellation.test.ts": 41, "src/renderer/src/lib/workspace/ownership/connection-context.test.ts": 1817, - "src/renderer/src/lib/crash-diagnostics.test.ts": 176, "src/renderer/src/lib/create-untitled-markdown.test.ts": 566, "src/renderer/src/lib/desktop-created-server-tabs.test.ts": 1933, "src/renderer/src/lib/workspace/ownership/direct-ssh-target-scope.test.ts": 48, @@ -6390,32 +6280,23 @@ "src/renderer/src/lib/browser/documents/doc-preview-grants.test.ts": 2094, "src/renderer/src/lib/editor/file-operations/editor-file-operation-owner.test.ts": 2848, "src/renderer/src/lib/emulator-error-copy.test.ts": 415, - "src/renderer/src/lib/ensure-hooks-confirmed.test.ts": 799, + "src/renderer/src/runtime/repo-hooks/ensure-hooks-confirmed.test.ts": 799, "src/renderer/src/lib/simulator/tabs/ensure-simulator-tab-behavior.test.ts": 3601, "src/renderer/src/runtime/hosts/platform/execution-host-facts.test.ts": 1796, - "src/renderer/src/lib/feature-education-telemetry.test.ts": 52, - "src/renderer/src/lib/feedback-image-attachments.test.ts": 557, - "src/renderer/src/lib/browser/documents/file-preview-link-open.test.ts": 2311, - "src/renderer/src/lib/file-search-selection.test.ts": 51, - "src/renderer/src/lib/find-query-bounds.test.ts": 45, + "src/renderer/src/components/sidebar/sidebar-feedback/feedback-image-attachments.test.ts": 557, + "src/renderer/src/lib/files/search/file-search-selection.test.ts": 51, "src/renderer/src/lib/finished-agent-resume-resurrection.test.ts": 1872, - "src/renderer/src/lib/focus-terminal-tab-surface.split-focus.test.ts": 331, - "src/renderer/src/lib/foreground-terminal-tabs.test.ts": 55, - "src/renderer/src/lib/github-links.test.ts": 76, - "src/renderer/src/lib/github-source-runtime-context.test.ts": 62, - "src/renderer/src/lib/gitlab-links.test.ts": 56, - "src/renderer/src/lib/hook-command-delayed-delivery.test.ts": 1904, - "src/renderer/src/lib/host-chat-program.test.ts": 2419, + "src/renderer/src/components/terminal-pane/parking/retention/foreground-terminal-tabs.test.ts": 55, + "src/renderer/src/lib/work-items/github/github-source-runtime-context.test.ts": 62, "src/renderer/src/lib/host-mirror-handle-gap-drain.test.ts": 1706, "src/renderer/src/lib/host-mirror-handle-gap-resume.test.ts": 1811, "src/renderer/src/lib/host-mirrored-pane-resume-replay.test.ts": 1814, "src/renderer/src/lib/browser/navigation/http-link-completion.test.ts": 1760, "src/renderer/src/lib/browser/navigation/http-link-routing-store.test.ts": 2211, - "src/renderer/src/lib/image-blob-png.test.ts": 253, - "src/renderer/src/lib/ime-composition-keyboard-event.test.ts": 274, - "src/renderer/src/lib/ime-text-field.test.tsx": 739, + "src/renderer/src/lib/text-input/ime/ime-composition-keyboard-event.test.ts": 274, + "src/renderer/src/lib/text-input/ime/ime-text-field.test.tsx": 739, "src/renderer/src/lib/keyboard-layout/layout-base-character.test.ts": 48, - "src/renderer/src/lib/large-text-control-paste.test.ts": 220, + "src/renderer/src/lib/text-input/paste/large-text-control-paste.test.ts": 220, "src/renderer/src/lib/agent-session/launch/background/launch-agent-background-session-launch-parity.test.ts": 2792, "src/renderer/src/lib/agent-session/launch/background/launch-agent-background-session.test.ts": 1040, "src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-in-new-tab-main-surface.test.ts": 1821, @@ -6428,15 +6309,11 @@ "src/renderer/src/lib/workspace/creation/work-item/launch-work-item-direct-accepted.test.tsx": 2754, "src/renderer/src/lib/workspace/creation/work-item/launch-work-item-direct-defaults.test.ts": 1594, "src/renderer/src/lib/workspace/creation/work-item/launch-work-item-direct-setup.test.tsx": 3435, - "src/renderer/src/lib/lazy-chunk-recovery-reload.test.ts": 246, - "src/renderer/src/lib/lazy-with-retry.never-landed-reload.test.ts": 194, - "src/renderer/src/lib/lazy-with-retry.preload.test.tsx": 208, - "src/renderer/src/lib/lazy-with-retry.test.ts": 282, - "src/renderer/src/lib/linear-board-drag-payload.test.ts": 58, - "src/renderer/src/lib/work-items/linear/linear-issue-context-snapshot.test.ts": 55, + "src/renderer/src/app-shell/startup/lazy-with-retry.never-landed-reload.test.ts": 194, + "src/renderer/src/lib/work-items/linear/linear-board-drag-payload.test.ts": 58, "src/renderer/src/lib/work-items/linear/linear-issue-workspace-attachment.test.ts": 99, "src/renderer/src/lib/link-source-local-open-owner.test.ts": 433, - "src/renderer/src/lib/linked-work-item-context.test.ts": 64, + "src/renderer/src/lib/work-items/linked-work-item-context.test.ts": 64, "src/renderer/src/lib/editor/monaco/monaco-editor-gutter-disposal.test.ts": 295, "src/renderer/src/lib/monaco-languages/markdown-heading-outline.test.ts": 70, "src/renderer/src/lib/monaco-languages/monarch-embed-entry-recursion.test.ts": 697, @@ -6452,37 +6329,25 @@ "src/renderer/src/lib/monaco-languages/textmate-token-provider.test.ts": 245, "src/renderer/src/lib/monaco-languages/zig-highlighting.test.ts": 7984, "src/renderer/src/lib/agent-session/resume/cli-fork/native-chat-cli-fork-preparation.test.ts": 2773, - "src/renderer/src/lib/new-workspace.test.ts": 4534, - "src/renderer/src/lib/non-secure-context-crypto.repro.test.ts": 1691, - "src/renderer/src/lib/onboarding-folder-cancellation.test.ts": 2486, "src/renderer/src/lib/open-agent-message-sender.test.ts": 1497, "src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.test.ts": 545, - "src/renderer/src/lib/orca-yaml-trust-prompt-slot-eviction.test.ts": 884, "src/renderer/src/lib/order-empty-query-worktrees.test.ts": 62, - "src/renderer/src/lib/os-file-drop-cancellation-guard.test.ts": 204, - "src/renderer/src/lib/os-file-drop-preload-integration.test.tsx": 353, + "src/renderer/src/lib/files/drop/os-file-drop-cancellation-guard.test.ts": 204, "src/renderer/src/lib/paired-runtime-closed-tab-resume.test.ts": 2008, "src/renderer/src/lib/pane-manager/pane-close-focus-successor.test.ts": 1123, "src/renderer/src/lib/pane-manager/pane-container-listener-lifecycle.test.ts": 312, "src/renderer/src/lib/pane-manager/pane-cursor-blink-suspension.test.ts": 429, "src/renderer/src/lib/pane-manager/pane-drag-window-blur.test.ts": 618, "src/renderer/src/lib/pane-manager/pane-fit-resize-observer.test.ts": 94, - "src/renderer/src/lib/pane-manager/pane-fit.test.ts": 166, "src/renderer/src/lib/pane-manager/pane-inline-image-recovery.test.ts": 61, "src/renderer/src/lib/pane-manager/pane-inline-images.test.ts": 74, "src/renderer/src/lib/pane-manager/pane-layout-geometry-apply.test.ts": 897, "src/renderer/src/lib/pane-manager/pane-manager-registry.test.ts": 69, "src/renderer/src/lib/pane-manager/pane-manager-spawn-placement.test.ts": 766, - "src/renderer/src/lib/pane-manager/pane-overlay-focus.test.ts": 622, "src/renderer/src/lib/pane-manager/pane-scroll.test.ts": 153, "src/renderer/src/lib/pane-manager/pane-terminal-foreground-render-settle.test.ts": 43, "src/renderer/src/lib/pane-manager/pane-terminal-mouse-wheel.test.ts": 88, "src/renderer/src/lib/pane-manager/pane-terminal-output-queue-chunks.test.ts": 44, - "src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler-ack-credit.test.ts": 173, - "src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler-disposed-writes.test.ts": 121, - "src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler-queue-retention.test.ts": 301, - "src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler-synchronized-frames.test.ts": 213, - "src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler.test.ts": 236, "src/renderer/src/lib/pane-manager/pane-tree-equalization-parity.test.ts": 182, "src/renderer/src/lib/pane-manager/pane-tree-equalization-scaling.test.ts": 239, "src/renderer/src/lib/pane-manager/pane-tree-match-moves.test.ts": 662, @@ -6499,7 +6364,6 @@ "src/renderer/src/lib/pane-manager/terminal-indic-cluster-ranges.test.ts": 50, "src/renderer/src/lib/pane-manager/terminal-kitty-file-reader.test.ts": 83, "src/renderer/src/lib/pane-manager/terminal-ligatures-addon.test.ts": 59, - "src/renderer/src/lib/pane-manager/terminal-link-provider-guard.test.ts": 48, "src/renderer/src/lib/pane-manager/terminal-linkifier-hover-reset-on-write.test.ts": 59, "src/renderer/src/lib/pane-manager/terminal-mouse-encoding-tracker.test.ts": 95, "src/renderer/src/lib/pane-manager/terminal-mouse-report-finite-coordinates.test.ts": 272, @@ -6517,30 +6381,24 @@ "src/renderer/src/lib/pane-manager/xterm-instance-disposed.test.ts": 57, "src/renderer/src/lib/pane-manager/xterm-parse-barrier.test.ts": 154, "src/renderer/src/lib/pane-manager/xterm-user-scrolling-contract.test.ts": 1266, - "src/renderer/src/lib/pane-manager/xterm-write-callback-guard.test.ts": 53, - "src/renderer/src/lib/pane-spawn-deferral-drain.test.ts": 61, - "src/renderer/src/lib/parked-terminal-host-hydration.test.ts": 274, - "src/renderer/src/lib/paste-payload-metadata.test.ts": 53, - "src/renderer/src/lib/path-head-elision.test.ts": 53, + "src/renderer/src/components/terminal-pane/session-restore/spawn-deferral/pane-spawn-deferral-drain.test.ts": 61, + "src/renderer/src/components/terminal-pane/mounting/parked-terminal-host-hydration.test.ts": 274, + "src/renderer/src/lib/text-input/paste/paste-payload-metadata.test.ts": 53, + "src/renderer/src/lib/path-display/path-head-elision.test.ts": 53, "src/renderer/src/lib/path.test.ts": 55, "src/renderer/src/lib/plugin-command-keybindings.test.ts": 1909, "src/renderer/src/lib/plugin-command-replacements.test.ts": 95, "src/renderer/src/lib/plugin-icons/plugin-icon-svg.test.ts": 231, - "src/renderer/src/lib/plugin-monaco-token-rules.test.ts": 51, - "src/renderer/src/lib/pr-bot-author-overrides.test.ts": 349, + "src/renderer/src/lib/editor/appearance/plugin-monaco-token-rules.test.ts": 51, + "src/renderer/src/lib/source-control/review/pr-bot-author-overrides.test.ts": 349, "src/renderer/src/lib/source-control/review/comments/pr-comment-thread-resolution.test.ts": 48, - "src/renderer/src/lib/project-clone-url-prefill.test.ts": 61, - "src/renderer/src/lib/project-host-workspace-target.jira-mapping.test.ts": 76, - "src/renderer/src/lib/project-host-workspace-target.test.ts": 92, - "src/renderer/src/lib/react-commit-cascade-observer.react185.test.tsx": 285, - "src/renderer/src/lib/react-commit-cascade-observer.test.ts": 189, - "src/renderer/src/lib/react-commit-cascade-telemetry.test.ts": 159, - "src/renderer/src/lib/react-error-boundary-reporting.test.ts": 55, + "src/renderer/src/lib/workspace/creation/project-clone-url-prefill.test.ts": 61, + "src/renderer/src/lib/workspace/creation/project-host-workspace-target.jira-mapping.test.ts": 76, + "src/renderer/src/lib/workspace/creation/project-host-workspace-target.test.ts": 92, "src/renderer/src/lib/editor/file-operations/remap-open-editor-tabs-for-path-change.test.ts": 2178, "src/renderer/src/lib/rename-user-named-tab-access.test.ts": 2804, "src/renderer/src/lib/renderer-agent-status-observation-ingress.test.ts": 81, - "src/renderer/src/lib/renderer-app-platform.test.ts": 197, - "src/renderer/src/lib/renderer-memory-profile.test.ts": 70, + "src/renderer/src/diagnostics/memory/renderer-memory-profile.test.ts": 70, "src/renderer/src/lib/repo-search.test.ts": 54, "src/renderer/src/lib/repo-slug-cache.test.ts": 52, "src/renderer/src/lib/repo-slug-index.test.ts": 2240, @@ -6563,7 +6421,6 @@ "src/renderer/src/lib/script-textarea-rows.test.ts": 93, "src/renderer/src/lib/session-write-subscriber-acknowledgment.test.ts": 1823, "src/renderer/src/lib/session-write-subscriber.test.ts": 1882, - "src/renderer/src/lib/shutdown-checkpoint-guard.test.ts": 209, "src/renderer/src/lib/sidebar-ended-creations.test.ts": 1889, "src/renderer/src/lib/sidebar-pending-layer.test.ts": 338, "src/renderer/src/lib/sidebar-shadow/workspace-activity-shadow.test.ts": 1728, @@ -6572,10 +6429,9 @@ "src/renderer/src/lib/simulator/tabs/simulator-pane-shutdown-scheduler.test.ts": 1679, "src/renderer/src/lib/simulator/tabs/simulator-tab-layout-owner.test.ts": 2398, "src/renderer/src/lib/simulator/tabs/simulator-tab-palette-activation.test.ts": 1903, - "src/renderer/src/lib/sleeping-agent-session-launch-windows-quoting.test.ts": 547, "src/renderer/src/lib/source-control/remote/source-control-remote-error.test.ts": 340, "src/renderer/src/lib/ssh-config-passive-sync.test.ts": 1513, - "src/renderer/src/lib/state-collection-byte-estimate.test.ts": 86, + "src/renderer/src/diagnostics/memory/state-collection-byte-estimate.test.ts": 86, "src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-draft.test.ts": 1042, "src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-prerequisites.test.ts": 2427, "src/renderer/src/lib/agent-session/options/structured-agent-session-selection-lifetime.test.tsx": 2947, @@ -6587,10 +6443,10 @@ "src/renderer/src/lib/syntax-highlighting/textmate-core.test.ts": 60, "src/renderer/src/lib/tab-agent-status-index.test.ts": 210, "src/renderer/src/lib/task-provider-error-copy.test.ts": 363, - "src/renderer/src/lib/terminal-app-theme.test.ts": 301, + "src/renderer/src/app-shell/appearance/terminal-app-theme.test.ts": 301, "src/renderer/src/lib/terminal-input-activity-coalescing.test.ts": 43, - "src/renderer/src/lib/text-control-paste-ownership.test.ts": 217, - "src/renderer/src/lib/text-control-paste.test.ts": 222, + "src/renderer/src/lib/text-input/paste/text-control-paste-ownership.test.ts": 217, + "src/renderer/src/lib/text-input/paste/text-control-paste.test.ts": 222, "src/renderer/src/lib/text-generation-error-copy.test.ts": 466, "src/renderer/src/lib/typing-latency/echo-instrumentation.test.ts": 145, "src/renderer/src/lib/typing-latency/renderer-long-tasks.test.ts": 75, @@ -6599,17 +6455,10 @@ "src/renderer/src/lib/use-tab-agent-observed-signal-dispatch.test.tsx": 1971, "src/renderer/src/lib/use-tab-agent-opencode-native-title.test.ts": 2093, "src/renderer/src/lib/use-tab-agent.test.ts": 1961, - "src/renderer/src/lib/user-opened-local-path.test.ts": 325, "src/renderer/src/lib/wake-sleeping-agents-live-unmounted-pane.test.ts": 2432, - "src/renderer/src/lib/window-visibility-interval.test.ts": 48, - "src/renderer/src/lib/window-visibility-timeout-poller.test.ts": 207, - "src/renderer/src/lib/windows-terminal-capabilities-race.test.ts": 450, - "src/renderer/src/lib/windows-terminal-capabilities.test.ts": 585, - "src/renderer/src/lib/windows-terminal-capability-reprobe.test.ts": 198, + "src/renderer/src/runtime/hosts/capabilities/windows-terminal-capabilities-race.test.ts": 450, "src/renderer/src/lib/workspace/activation/workspace-activation-path-gate.test.ts": 2107, "src/renderer/src/lib/browser/workspace/workspace-browser-tab-open-placement.test.ts": 1996, - "src/renderer/src/lib/workspace-doc-address-input.test.ts": 470, - "src/renderer/src/lib/workspace-file-drag.test.ts": 70, "src/renderer/src/lib/workspace-ports/workspace-port-scan-debounce.test.ts": 57, "src/renderer/src/lib/workspace/persistence/workspace-session-host-contention.test.ts": 265, "src/renderer/src/lib/workspace/persistence/workspace-session-host-emptied-fields.test.ts": 279, @@ -6699,7 +6548,6 @@ "src/renderer/src/runtime/workspace-layout/server/server-layout-frames.test.ts": 2053, "src/renderer/src/runtime/native-chat/status/structured-agent-session-status-feed-lifecycle.test.ts": 62, "src/renderer/src/runtime/native-chat/status/structured-agent-session-status-feed.test.ts": 82, - "src/renderer/src/runtime/native-chat/tab-retirement/structured-agent-session-tab-retirement.test.ts": 2115, "src/renderer/src/runtime/native-chat/status/structured-agent-session-turn-completion-feed.test.ts": 118, "src/renderer/src/runtime/native-chat/host-capabilities/structured-chat-host-permission.test.ts": 523, "src/renderer/src/runtime/web-session-tabs-sync/placement/structured-conversation-tab-replacement.test.ts": 2029, @@ -6716,11 +6564,6 @@ "src/renderer/src/runtime/browser/creation/web-runtime-browser-creation-placement.test.ts": 1927, "src/renderer/src/runtime/browser/creation/web-runtime-browser-link-open.test.ts": 2217, "src/renderer/src/runtime/browser/creation/web-runtime-browser-link-session.test.ts": 1964, - "src/renderer/src/runtime/browser/creation/web-runtime-session-browser-create-split-placement.test.ts": 949, - "src/renderer/src/runtime/web-session-tabs-sync/closing/web-runtime-session-tab-activate-close.test.ts": 1426, - "src/renderer/src/runtime/hosted-terminals/actions/web-runtime-session-terminal-pane-delegation.test.ts": 1341, - "src/renderer/src/runtime/hosted-terminals/creation/web-runtime-session-terminal-workspace-routing.test.ts": 768, - "src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session.test.ts": 743, "src/renderer/src/runtime/web-session-tabs-sync/closing/web-session-close-replay.test.ts": 1119, "src/renderer/src/runtime/web-session-tabs-sync/placement/web-session-open-files-batch-equivalence.test.ts": 1478, "src/renderer/src/runtime/web-session-tabs-sync/identity/web-session-restored-placeholder-identity.test.ts": 985, @@ -6729,7 +6572,6 @@ "src/renderer/src/runtime/web-session-tabs-sync/subscriptions/web-session-tabs-stream-end-resubscribe.test.tsx": 2282, "src/renderer/src/runtime/web-session-tabs-sync/agent-status/web-session-tabs-sync-agent-status.test.ts": 987, "src/renderer/src/runtime/web-session-tabs-sync/placement/web-session-tabs-sync-browser-tabs.test.ts": 925, - "src/renderer/src/runtime/web-session-tabs-sync/subscriptions/web-session-tabs-sync-completion-on-reveal.test.tsx": 2249, "src/renderer/src/runtime/web-session-tabs-sync/identity/web-session-tabs-sync-cross-runtime-worktree.test.ts": 964, "src/renderer/src/runtime/web-session-tabs-sync/placement/web-session-tabs-sync-editor-ownership.test.ts": 1902, "src/renderer/src/runtime/web-session-tabs-sync/placement/web-session-tabs-sync-editor-tabs.test.ts": 1073, @@ -6823,7 +6665,6 @@ "src/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts": 2007, "src/renderer/src/store/slices/browser/browser.test.ts": 2001, "src/renderer/src/store/slices/worktrees/teardown/bulk-worktree-purge-terminal-maps-leak.test.ts": 1727, - "src/renderer/src/store/workspaces/creation/active-workspace-create-actions.test.ts": 1879, "src/renderer/src/store/terminals/codex-restart-notice-lifecycle.test.ts": 1685, "src/renderer/src/store/slices/tabs/content-tabs-from-main-frames.test.ts": 2025, "src/renderer/src/store/slices/tabs/content-tabs-paired-server-workspace.test.ts": 1923, @@ -6846,7 +6687,6 @@ "src/renderer/src/store/slices/editor/git/editor-git-status-reconciliation.test.ts": 870, "src/renderer/src/store/slices/editor/tabs/editor-layout-owner-records.test.ts": 2006, "src/renderer/src/store/slices/editor/markdown/editor-markdown-link-activation.test.ts": 953, - "src/renderer/src/store/slices/editor/markdown/editor-markdown-view-state.test.ts": 801, "src/renderer/src/store/slices/editor/git/editor-open-diff.test.ts": 1987, "src/renderer/src/store/slices/editor/tabs/editor-open-link-placement.test.ts": 1987, "src/renderer/src/store/slices/editor/tabs/editor-preview-tab-setting.test.ts": 1952, @@ -8015,7 +7855,7 @@ "tests/e2e/ai-vault-account-stream.unit.test.ts": 4506, "tests/e2e/ai-vault-manual-name-clear.unit.test.ts": 21206, "tests/e2e/automation-chat-reopen.unit.test.ts": 6262, - "tests/e2e/automation-save-fallback.unit.test.ts": 9065, + "tests/e2e/claude-agent-row-view.unit.test.ts": 1491, "tests/e2e/codex-child-approval-activity-row.unit.test.ts": 14886, "tests/e2e/completed-worker-retirement-resume.unit.test.ts": 38857, @@ -8051,7 +7891,7 @@ "tests/e2e/host-agent-launch-preferences-work.unit.test.ts": 3882, "tests/e2e/host-agent-launch-settings-hook-bookkeeping.unit.test.ts": 21972, "tests/e2e/host-cold-park-remote-subscriber.unit.test.ts": 5314, - "tests/e2e/journal-restored-consumers.unit.test.ts": 33933, + "tests/e2e/launch-agent-background-session-remote.unit.test.ts": 1016, "tests/e2e/launch-agent-in-new-tab-web-runtime.unit.test.ts": 14288, "tests/e2e/linear-cli-recovery.unit.test.ts": 7592, @@ -8063,7 +7903,7 @@ "tests/e2e/native-chat-rewind-boundary.unit.test.ts": 2977, "tests/e2e/native-chat-ssh-transcript.unit.test.ts": 1166, "tests/e2e/native-chat-startup-option-pickers.unit.test.ts": 9377, - "tests/e2e/native-chat-transcript-file-order.unit.test.ts": 1066, + "tests/e2e/native-chat-transcript-reasoning.unit.test.ts": 3341, "tests/e2e/nested-agent-idle-owner.unit.test.ts": 2469, "tests/e2e/omp-child-session-recovery.unit.test.ts": 2205, @@ -8098,12 +7938,9 @@ "tests/e2e/structured-session-tab-close-regressions.unit.test.ts": 32432, "tests/e2e/sustained-agent-typing-load-scripts.unit.test.ts": 2169, "tests/e2e/task-page-linear-refresh-authority.unit.test.ts": 5548, - "tests/e2e/task-page-linear-refresh-transport.unit.test.ts": 2019, - "tests/e2e/terminal-agent-fork-draft-ownership.unit.test.ts": 30195, "tests/e2e/terminal-binding-crash-hydration.unit.test.ts": 1769, "tests/e2e/terminal-foreground-confirmation.unit.test.ts": 644, "tests/e2e/terminal-perf-presentation.unit.test.ts": 60, - "tests/e2e/web-runtime-session-terminal-host-authority.unit.test.ts": 1061, "tests/e2e/worktree-status-warning.unit.test.ts": 2331, "tests/tools/branch-line-total-renderer.test.mjs": 1222, "tests/tools/omp-close-lifecycle.test.mjs": 403, diff --git a/config/scripts/desktop-distribution/runtime-verification/verify-packaged-mobile-web-bundle.cjs b/config/scripts/desktop-distribution/runtime-verification/verify-packaged-mobile-web-bundle.cjs index fb2a9b14615..46370dc1d46 100644 --- a/config/scripts/desktop-distribution/runtime-verification/verify-packaged-mobile-web-bundle.cjs +++ b/config/scripts/desktop-distribution/runtime-verification/verify-packaged-mobile-web-bundle.cjs @@ -1,6 +1,7 @@ const { createHash } = require('node:crypto') const { readFileSync, readdirSync, statSync } = require('node:fs') const { join, resolve } = require('node:path') +const { brotliDecompressSync } = require('node:zlib') const { darkBuildMarkerFileNames } = require('../../../dark-build-switches.cjs') @@ -98,6 +99,25 @@ function parseManifest(bundleDir) { if (typeof asset.contentType !== 'string' || asset.contentType.length === 0) { throw failure(`manifest asset ${asset.path} has no contentType`) } + if (asset.brotliByteLength !== undefined) { + assertInteger(asset.brotliByteLength, `assets[${asset.path}].brotliByteLength`) + if (asset.brotliByteLength >= asset.byteLength) { + throw failure(`manifest asset ${asset.path} declares a brotli copy no smaller than itself`) + } + } + } + if (manifest.catalogs !== undefined && !Array.isArray(manifest.catalogs)) { + throw failure('manifest catalogs is not a list') + } + for (const catalog of manifest.catalogs ?? []) { + if (typeof catalog !== 'object' || catalog === null || typeof catalog.locale !== 'string') { + throw failure('manifest catalog entry has no locale') + } + assertSafeRelativePath(catalog.path) + if (typeof catalog.sha256 !== 'string' || !SHA256_PATTERN.test(catalog.sha256)) { + throw failure(`manifest catalog ${catalog.path} has no sha256 digest`) + } + assertInteger(catalog.byteLength, `catalogs[${catalog.path}].byteLength`) } if (!manifest.assets.some((asset) => asset.path === manifest.entrypoint)) { throw failure(`manifest entrypoint ${manifest.entrypoint} is not one of its assets`) @@ -119,6 +139,11 @@ function parseManifest(bundleDir) { return manifest } +// Assets go to the phone; catalogs stay on the host, which serves one on request. +function servedFiles(manifest) { + return [...manifest.assets, ...(manifest.catalogs ?? [])] +} + function listBundleFiles(directory, prefix = '') { const found = [] for (const entry of readdirSync(directory, { withFileTypes: true })) { @@ -132,13 +157,33 @@ function listBundleFiles(directory, prefix = '') { return found } +// Mirrors mobileWebBundleBrotliPath in src/shared/mobile-web-bundle/manifest-contract.ts. +function brotliPath(asset) { + return `${asset.path}.br` +} + +function brotliCopies(manifest) { + return manifest.assets.filter((asset) => asset.brotliByteLength !== undefined) +} + +function statSize(bundleDir, path) { + try { + return statSync(join(bundleDir, path)).size + } catch (error) { + throw failure( + `manifest lists ${path}, which is missing from ${bundleDir} (${error.code ?? error.message}). ${REMEDY}` + ) + } +} + // Reject unlisted on-disk assets: content-addressed stale files survive interrupted builds and would ship unreachable/unverified in asar. function assertNoUnlistedFiles(bundleDir, manifest) { // A dark build's marker is accounted for here; packaging refuses it through assertNotDarkBuild. const listed = new Set([ 'manifest.json', ...darkBuildMarkerFileNames(), - ...manifest.assets.map((asset) => asset.path) + ...servedFiles(manifest).map((file) => file.path), + ...brotliCopies(manifest).map((asset) => brotliPath(asset)) ]) const strays = listBundleFiles(bundleDir).filter((path) => !listed.has(path)) if (strays.length > 0) { @@ -153,16 +198,9 @@ function assertNoUnlistedFiles(bundleDir, manifest) { function assertMobileWebBundleBuilt(bundleDir = MOBILE_WEB_BUNDLE_DIR) { const manifest = parseManifest(bundleDir) assertNoUnlistedFiles(bundleDir, manifest) - for (const asset of manifest.assets) { + for (const asset of servedFiles(manifest)) { const assetPath = join(bundleDir, asset.path) - let size - try { - size = statSync(assetPath).size - } catch (error) { - throw failure( - `manifest lists ${asset.path}, which is missing from ${bundleDir} (${error.code ?? error.message}). ${REMEDY}` - ) - } + const size = statSize(bundleDir, asset.path) if (size !== asset.byteLength) { throw failure( `${asset.path} is ${String(size)} bytes on disk, manifest says ${String(asset.byteLength)}. ${REMEDY}` @@ -175,6 +213,20 @@ function assertMobileWebBundleBuilt(bundleDir = MOBILE_WEB_BUNDLE_DIR) { ) } } + // Phones verify only the inflated bytes, so a copy that inflates to anything else fails every download. + for (const asset of brotliCopies(manifest)) { + const path = brotliPath(asset) + const size = statSize(bundleDir, path) + if (size !== asset.brotliByteLength) { + throw failure( + `${path} is ${String(size)} bytes on disk, manifest says ${String(asset.brotliByteLength)}. ${REMEDY}` + ) + } + const inflated = brotliDecompressSync(readFileSync(join(bundleDir, path))) + if (createHash('sha256').update(inflated).digest('hex') !== asset.sha256) { + throw failure(`${path} does not inflate to ${asset.path}. ${REMEDY}`) + } + } console.log( `[verify-packaged-mobile-web-bundle] OK — buildId ${manifest.buildId}, ` + `${String(manifest.assets.length)} asset(s), ${String(manifest.totalBytes)} bytes` diff --git a/config/scripts/desktop-distribution/runtime-verification/verify-packaged-mobile-web-bundle.test.mjs b/config/scripts/desktop-distribution/runtime-verification/verify-packaged-mobile-web-bundle.test.mjs index b745dff2402..e916dfc216a 100644 --- a/config/scripts/desktop-distribution/runtime-verification/verify-packaged-mobile-web-bundle.test.mjs +++ b/config/scripts/desktop-distribution/runtime-verification/verify-packaged-mobile-web-bundle.test.mjs @@ -2,6 +2,7 @@ import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises' import { createRequire } from 'node:module' import { tmpdir } from 'node:os' import { join } from 'node:path' +import { brotliCompressSync } from 'node:zlib' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { writeMobileWebBundleFixtureTree } from '../../build/mobile-web-app/mobile-web-bundle-fixture-tree.mjs' @@ -10,11 +11,11 @@ const { assertMobileWebBundleBuilt } = require('./verify-packaged-mobile-web-bun const electronBuilderConfig = require('../../../electron-builder.config.cjs') const { darkBuildMarkers } = require('../../../dark-build-switches.cjs') -async function withBundle(run) { +async function withBundle(run, { brotli = false } = {}) { const scratch = await mkdtemp(join(tmpdir(), 'orca-mobile-web-guard-')) const bundleDir = join(scratch, 'mobile-web') try { - const { manifest } = await writeMobileWebBundleFixtureTree({ outDir: bundleDir }) + const { manifest } = await writeMobileWebBundleFixtureTree({ outDir: bundleDir, brotli }) await run({ bundleDir, manifest }) } finally { await rm(scratch, { recursive: true, force: true }) @@ -65,6 +66,25 @@ describe('assertMobileWebBundleBuilt', () => { }) }) + it('accepts the brotli copies the manifest lists, and fails one that inflates to other bytes', async () => { + await withBundle( + async ({ bundleDir, manifest }) => { + const asset = manifest.assets.find((entry) => entry.brotliByteLength !== undefined) + expect(() => assertMobileWebBundleBuilt(bundleDir)).not.toThrow() + const forged = brotliCompressSync(Buffer.from('not the asset')) + await writeFile(join(bundleDir, `${asset.path}.br`), forged) + await rewriteManifest(bundleDir, (rewritten) => { + rewritten.assets.find((entry) => entry.path === asset.path).brotliByteLength = + forged.byteLength + }) + expect(() => assertMobileWebBundleBuilt(bundleDir)).toThrow( + `${asset.path}.br does not inflate to ${asset.path}` + ) + }, + { brotli: true } + ) + }) + it('refuses an asset path that escapes the bundle directory', async () => { await withBundle(async ({ bundleDir }) => { await rewriteManifest(bundleDir, (manifest) => { diff --git a/config/scripts/localization/source-extraction/audit-localization-coverage.mjs b/config/scripts/localization/source-extraction/audit-localization-coverage.mjs index 6eaef1bb1b0..cd7cf997a7b 100644 --- a/config/scripts/localization/source-extraction/audit-localization-coverage.mjs +++ b/config/scripts/localization/source-extraction/audit-localization-coverage.mjs @@ -6,10 +6,11 @@ import process from 'node:process' // TypeScript 7 is a native CLI; AST consumers still need the legacy JavaScript API. import ts from 'typescript-api' import { isTestOnlySourcePath } from '../../static-analysis/process-boundaries/test-only-source-path.mjs' +import { isVisibleObjectKey } from './localization-visible-object-keys.mjs' const SOURCE_EXTENSIONS = new Set(['.ts', '.tsx', '.js', '.jsx', '.mts', '.cts']) const SKIP_PATH_PARTS = new Set(['.git', 'dist', 'node_modules', 'out', '__snapshots__', 'assets']) -const LOCALIZATION_CALL_NAMES = new Set(['t', 'translate']) +const LOCALIZATION_CALL_NAMES = new Set(['t', 'translate', 'translateMain']) const CLASS_PROPERTY_NAMES = new Set(['className', 'classNames']) // Why: the children of these elements are CSS or code, never copy a translator should see. const NON_COPY_JSX_ELEMENTS = new Set(['style', 'script']) @@ -35,25 +36,6 @@ const USER_VISIBLE_JSX_ATTRIBUTES = new Set([ 'toggleDescription', 'tooltip' ]) -const USER_VISIBLE_OBJECT_KEYS = new Set([ - 'accessibilityHint', - 'accessibilityLabel', - 'ariaLabel', - 'badge', - 'description', - 'emptyText', - 'error', - 'headerTitle', - 'helperText', - 'keywords', - 'label', - 'message', - 'placeholder', - 'subtitle', - 'title', - 'toggleDescription', - 'tooltip' -]) const USER_VISIBLE_FUNCTION_NAMES = new Set([ 'alert', 'confirm', @@ -331,7 +313,7 @@ function isInsideNonCopyJsxElement(node) { return Boolean(element && NON_COPY_JSX_ELEMENTS.has(element.openingElement.tagName.getText())) } -function classifyStringNode(node) { +function classifyStringNode(node, includeNativeDialogFields = false) { if ( hasAncestorObjectPropertyName(node, CLASS_PROPERTY_NAMES) || isInsideNonCopyJsxElement(node) @@ -369,12 +351,15 @@ function classifyStringNode(node) { } const objectPropertyName = nearestObjectPropertyName(node) - if (objectPropertyName && !USER_VISIBLE_OBJECT_KEYS.has(objectPropertyName)) { + if (objectPropertyName && !isVisibleObjectKey(objectPropertyName, includeNativeDialogFields)) { return undefined } const ancestorObjectPropertyName = nearestAncestorObjectPropertyName(node) - if (ancestorObjectPropertyName && !USER_VISIBLE_OBJECT_KEYS.has(ancestorObjectPropertyName)) { + if ( + ancestorObjectPropertyName && + !isVisibleObjectKey(ancestorObjectPropertyName, includeNativeDialogFields) + ) { return undefined } @@ -407,7 +392,12 @@ function areaForFile(relativePath) { return `renderer/${parts[0] ?? 'root'}` } -export function collectLocalizationCandidates(filePath, sourceText, root = process.cwd()) { +export function collectLocalizationCandidates( + filePath, + sourceText, + root = process.cwd(), + options = {} +) { const sourceKind = filePath.endsWith('.tsx') || filePath.endsWith('.jsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS const sourceFile = ts.createSourceFile( @@ -450,7 +440,7 @@ export function collectLocalizationCandidates(filePath, sourceText, root = proce ts.isNoSubstitutionTemplateLiteral(node) || ts.isTemplateExpression(node) ) { - const kind = classifyStringNode(node) + const kind = classifyStringNode(node, options.includeNativeDialogFields) if (kind) { for (const part of stringParts(node)) { pushReport(node, kind, part.text, part.dynamic) @@ -521,6 +511,7 @@ function parseArgs(argv) { allowlistPath: path.join('config', 'localization-coverage-allowlist.json'), check: false, format: 'summary', + includeNativeDialogFields: false, outputPath: null, sourceRoots: [] } @@ -531,6 +522,8 @@ function parseArgs(argv) { options.format = 'json' } else if (arg === '--markdown') { options.format = 'markdown' + } else if (arg === '--native-dialog-fields') { + options.includeNativeDialogFields = true } else if (arg === '--check') { options.check = true } else if (arg === '--allowlist') { @@ -616,7 +609,7 @@ export async function main(root = process.cwd(), argv = process.argv.slice(2)) { for (const filePath of files) { const sourceText = await fs.readFile(filePath, 'utf8') - reports.push(...collectLocalizationCandidates(filePath, sourceText, root)) + reports.push(...collectLocalizationCandidates(filePath, sourceText, root, options)) } if (options.check) { diff --git a/config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs b/config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs new file mode 100644 index 00000000000..be3dd5d8541 --- /dev/null +++ b/config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs @@ -0,0 +1,59 @@ +import { describe, expect, it, vi } from 'vitest' +import { mkdtemp, mkdir, rm, writeFile } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { collectLocalizationCandidates, main } from './audit-localization-coverage.mjs' + +const path = '/repo/src/main/startup/dialog.ts' +const source = ` + const options = { + message: translateMain('message', 'Translated message'), + detail: 'Untranslated detail', + buttons: ['Proceed', translateMain('cancel', 'Cancel')], + body: 'Untranslated body', + buttonLabel: 'Retry', + checkboxLabel: 'Remember choice' + } +` + +describe('native dialog localization coverage', () => { + it('finds untranslated native dialog fields while ignoring translated copy', () => { + const candidates = collectLocalizationCandidates(path, source, '/repo', { + includeNativeDialogFields: true + }) + expect(candidates.map(({ kind, text }) => [kind, text])).toEqual([ + ['object-property:detail', 'Untranslated detail'], + ['object-property:buttons', 'Proceed'], + ['object-property:body', 'Untranslated body'], + ['object-property:buttonLabel', 'Retry'], + ['object-property:checkboxLabel', 'Remember choice'] + ]) + }) + + it('does not change the existing renderer scan by default', () => { + expect(collectLocalizationCandidates(path, source, '/repo')).toEqual([]) + }) + + it('fails the opt-in check for a new native dialog literal', async () => { + const root = await mkdtemp(join(tmpdir(), 'orca-native-localization-')) + const report = vi.spyOn(console, 'error').mockImplementation(() => {}) + try { + await mkdir(join(root, 'src')) + await writeFile(join(root, 'src', 'dialog.ts'), "const options = { detail: 'Raw detail' }") + await writeFile(join(root, 'allowlist.json'), '[]') + await expect( + main(root, [ + '--check', + '--native-dialog-fields', + '--source-root', + 'src', + '--allowlist', + 'allowlist.json' + ]) + ).resolves.toBe(1) + } finally { + report.mockRestore() + await rm(root, { recursive: true, force: true }) + } + }) +}) diff --git a/config/scripts/localization/source-extraction/localization-visible-object-keys.mjs b/config/scripts/localization/source-extraction/localization-visible-object-keys.mjs new file mode 100644 index 00000000000..0e5b73ec6a9 --- /dev/null +++ b/config/scripts/localization/source-extraction/localization-visible-object-keys.mjs @@ -0,0 +1,33 @@ +const USER_VISIBLE_OBJECT_KEYS = new Set([ + 'accessibilityHint', + 'accessibilityLabel', + 'ariaLabel', + 'badge', + 'description', + 'emptyText', + 'error', + 'headerTitle', + 'helperText', + 'keywords', + 'label', + 'message', + 'placeholder', + 'subtitle', + 'title', + 'toggleDescription', + 'tooltip' +]) +const NATIVE_DIALOG_OBJECT_KEYS = new Set([ + 'detail', + 'buttons', + 'body', + 'buttonLabel', + 'checkboxLabel' +]) + +export function isVisibleObjectKey(name, includeNativeDialogFields) { + return ( + USER_VISIBLE_OBJECT_KEYS.has(name) || + (includeNativeDialogFields && NATIVE_DIALOG_OBJECT_KEYS.has(name)) + ) +} diff --git a/config/scripts/mobile-web-app/session/mobile-web-app-queued-messages-render.test.mjs b/config/scripts/mobile-web-app/session/mobile-web-app-queued-messages-render.test.mjs index caca85ce51a..864d07093c3 100644 --- a/config/scripts/mobile-web-app/session/mobile-web-app-queued-messages-render.test.mjs +++ b/config/scripts/mobile-web-app/session/mobile-web-app-queued-messages-render.test.mjs @@ -32,7 +32,7 @@ import { View } from 'react-native' import { GestureHandlerRootView } from 'react-native-gesture-handler' import { MobileNativeChatQueuedMessages } from './src/session/native-chat/input/MobileNativeChatQueuedMessages' import { MobileNativeChatComposer } from './src/session/native-chat/composer/MobileNativeChatComposer' -import { mobileQueuedMessageCards } from './src/session/mobile-structured-queued-message-cards' +import { mobileQueuedMessageCards } from './src/session/native-chat/input/mobile-structured-queued-message-cards' import { activateMobileUiLocale, translate } from './src/i18n/mobile-i18n' const [mode, locale] = location.hash.slice(1).split(':') diff --git a/config/scripts/orcad-distribution/server-bundle/orcad-mobile-web-bundle.mjs b/config/scripts/orcad-distribution/server-bundle/orcad-mobile-web-bundle.mjs index dd94c56f62e..7fa363a1907 100644 --- a/config/scripts/orcad-distribution/server-bundle/orcad-mobile-web-bundle.mjs +++ b/config/scripts/orcad-distribution/server-bundle/orcad-mobile-web-bundle.mjs @@ -19,7 +19,7 @@ export function stageOrcadMobileWebBundle(outputDir, bundleDir = MOBILE_WEB_BUND // The release template refuses the variable itself. assertNoDarkOutputOfOffSwitches([bundleDir]) assertMobileWebBundleBuilt(bundleDir) - // The guard refuses unlisted files, so the tree is the manifest, its assets and a dark marker. + // The guard refuses unlisted files, so the tree is the manifest, its assets and catalogs, and a dark marker. cpSync(bundleDir, join(outputDir, ...ORCAD_MOBILE_WEB_DIR.split('/')), { recursive: true }) } diff --git a/config/scripts/performance/renderer-projection/locale-collator-sort-benchmark.mjs b/config/scripts/performance/renderer-projection/locale-collator-sort-benchmark.mjs index 7253d22afb5..073a78ffaa5 100644 --- a/config/scripts/performance/renderer-projection/locale-collator-sort-benchmark.mjs +++ b/config/scripts/performance/renderer-projection/locale-collator-sort-benchmark.mjs @@ -18,7 +18,7 @@ const { sortJiraIssues } = await jiti.import( '../../../../src/renderer/src/components/jira-issue-sorter.ts' ) const { sortAutomationListViewItems } = await jiti.import( - '../../../../src/renderer/src/components/automations/automation-list-view.ts' + '../../../../src/renderer/src/components/automations/listing/automation-list-view.ts' ) const automationLocale = 'en-US' diff --git a/config/scripts/performance/skills-plugins/skill-source-inventory-benchmark.mjs b/config/scripts/performance/skills-plugins/skill-source-inventory-benchmark.mjs index d774eb03fe0..64b69c9a1e7 100644 --- a/config/scripts/performance/skills-plugins/skill-source-inventory-benchmark.mjs +++ b/config/scripts/performance/skills-plugins/skill-source-inventory-benchmark.mjs @@ -4,7 +4,7 @@ import { performance } from 'node:perf_hooks' import { transform } from 'esbuild' import { buildCounterbalancedSchedule } from '../measurement/counterbalanced-benchmark-schedule.mjs' -const path = 'src/renderer/src/components/skills/skill-source-inventory.ts' +const path = 'src/renderer/src/components/skills/catalog/skill-source-inventory.ts' const arms = {} for (const [name, source] of [ ['baseline', readFileSync(0, 'utf8')], diff --git a/config/scripts/preflight/changed-checks/check-changed-selection.mjs b/config/scripts/preflight/changed-checks/check-changed-selection.mjs index 99d3c46bff0..a8dddc16970 100644 --- a/config/scripts/preflight/changed-checks/check-changed-selection.mjs +++ b/config/scripts/preflight/changed-checks/check-changed-selection.mjs @@ -47,6 +47,8 @@ const RATCHET_INPUTS = { 'check-render-path-translate-ratchet.mjs': ['src/renderer/src/'], 'check-repo-host-read-ratchet.mjs': ['src/cli/', 'src/main/', 'src/shared/'], 'check-runtime-electron-ratchet.mjs': ['src/main/', 'src/cli/', 'src/shared/'], + 'check-tab-map-seam-ratchet.mjs': ['src/renderer/src/'], + 'check-terminal-parking-ownership-ratchet.mjs': ['src/renderer/src/'], 'check-unproven-pty-retirement-ratchet.mjs': ['src/main/'], 'check-workspace-record-read-ratchet.mjs': ['src/renderer/src/'], 'check-worktree-id-composer-ratchet.mjs': ['src/', 'mobile/src/'] @@ -101,7 +103,33 @@ export const VERIFY_CHECKS = [ 'config/scripts/localization/source-extraction/audit-localization-coverage.mjs', '--check' ], - inputs: ['src/renderer/src/', LOCALES] + inputs: [ + 'src/renderer/src/', + LOCALES, + 'config/scripts/localization/source-extraction/audit-localization-coverage', + 'config/scripts/localization/source-extraction/localization-visible-object-keys' + ] + }, + { + name: 'startup and worktree localization coverage', + args: [ + 'config/scripts/localization/source-extraction/audit-localization-coverage.mjs', + '--check', + '--native-dialog-fields', + '--source-root', + 'src/main/startup', + '--source-root', + 'src/shared/worktree', + '--allowlist', + 'config/startup-worktree-localization-allowlist.json' + ], + inputs: [ + 'src/main/startup/', + 'src/shared/worktree/', + 'config/scripts/localization/source-extraction/audit-localization-coverage', + 'config/scripts/localization/source-extraction/localization-visible-object-keys', + 'config/startup-worktree-localization-allowlist.json' + ] }, { name: 'mobile localization', @@ -144,7 +172,8 @@ export const VERIFY_CHECKS = [ 'mobile/web-entry/', 'config/mobile-localization-coverage-allowlist.json', 'config/scripts/audit-localization-coverage', - 'config/scripts/localization/source-extraction/audit-localization-coverage' + 'config/scripts/localization/source-extraction/audit-localization-coverage', + 'config/scripts/localization/source-extraction/localization-visible-object-keys' ] }, { diff --git a/config/scripts/preflight/changed-checks/run-lint.mjs b/config/scripts/preflight/changed-checks/run-lint.mjs index 0a2bbe3c723..2e4afe7b826 100644 --- a/config/scripts/preflight/changed-checks/run-lint.mjs +++ b/config/scripts/preflight/changed-checks/run-lint.mjs @@ -18,6 +18,7 @@ export const LINT_STEPS = [ 'check:test-file-runners', 'verify:localization-catalogs', 'verify:localization-coverage', + 'verify:startup-worktree-localization-coverage', 'verify:mobile-localization', 'verify:mobile-localization-coverage', 'lint:ast-grep-gates', @@ -39,6 +40,8 @@ export const LINT_STEPS = [ 'check:mobile-shared-dependency-versions', 'check:ts-nocheck-ratchet', 'check:workspace-record-read-ratchet', + 'check:tab-map-seam-ratchet', + 'check:terminal-parking-ownership-ratchet', 'check:unproven-pty-retirement-ratchet', 'check:daemon-blocking-call-ratchet', 'check:main-sync-fs-ratchet', diff --git a/config/scripts/runtime-verification/desktop-transport/verify-computer-native.mjs b/config/scripts/runtime-verification/desktop-transport/verify-computer-native.mjs index f0c1e76f622..4c8e6a3ecbb 100644 --- a/config/scripts/runtime-verification/desktop-transport/verify-computer-native.mjs +++ b/config/scripts/runtime-verification/desktop-transport/verify-computer-native.mjs @@ -13,20 +13,6 @@ const checks = [ args: ['test', '--package-path', 'native/computer-use-macos'], enabled: process.platform === 'darwin' }, - { - name: 'Linux provider Python syntax', - command: 'python3', - args: [ - '-c', - [ - 'import ast, pathlib', - 'source=pathlib.Path("native/computer-use-linux/runtime.py").read_text(encoding="utf-8")', - 'ast.parse(source)', - 'print("syntax-ok")' - ].join(';') - ], - enabled: true - }, { name: 'Linux snapshot renderer tests', command: 'python3', diff --git a/config/scripts/skills/bundle-generation/generate-plugin-authoring-skill-references.mjs b/config/scripts/skills/bundle-generation/generate-plugin-authoring-skill-references.mjs index 1efc10e312c..3c656d5530b 100644 --- a/config/scripts/skills/bundle-generation/generate-plugin-authoring-skill-references.mjs +++ b/config/scripts/skills/bundle-generation/generate-plugin-authoring-skill-references.mjs @@ -299,7 +299,7 @@ function renderEvents({ events, eventContribution, typeText }, { services, frame const { REFERENCE_TYPE_TEXT, zodTypeText } = typeText const workerEvents = eventContribution.PLUGIN_EVENT_NAMES.map( (name) => - `- ${code(name)} (capability ${code(eventContribution.PLUGIN_EVENT_CAPABILITY[name])}; since ${eventContribution.PLUGIN_EVENT_SINCE[name]}): ${events.PLUGIN_EVENT_SUMMARIES[name]}\n ${code(zodTypeText(events.PLUGIN_EVENT_PAYLOAD_SCHEMAS[name], 'output', REFERENCE_TYPE_TEXT))}` + `- ${code(name)} (${eventContribution.PLUGIN_EVENT_CAPABILITY[name] ? `capability ${code(eventContribution.PLUGIN_EVENT_CAPABILITY[name])}` : 'no capability'}; since ${eventContribution.PLUGIN_EVENT_SINCE[name]}): ${events.PLUGIN_EVENT_SUMMARIES[name]}\n ${code(zodTypeText(events.PLUGIN_EVENT_PAYLOAD_SCHEMAS[name], 'output', REFERENCE_TYPE_TEXT))}` ) return document( 'Events', diff --git a/config/scripts/static-analysis/ratchets/react-compiler/check-react-compiler-compat-ratchet.mjs b/config/scripts/static-analysis/ratchets/react-compiler/check-react-compiler-compat-ratchet.mjs index 714acf736a6..e4205589eba 100644 --- a/config/scripts/static-analysis/ratchets/react-compiler/check-react-compiler-compat-ratchet.mjs +++ b/config/scripts/static-analysis/ratchets/react-compiler/check-react-compiler-compat-ratchet.mjs @@ -27,6 +27,10 @@ import { renderLiveReadLines, renderStoreReadLines } from './react-compiler-hazards.mjs' +import { + UNCOMPILED_LIST, + readListedFiles +} from '../../../../build-plugins/react-compiler-uncompiled-files.mjs' // Runs React Compiler (analysis only, nothing is written) over the renderer so code that compiles // today keeps compiling, and code that would change behavior once compiled can't be added. @@ -34,8 +38,6 @@ import { const SCAN_ROOT = 'src/renderer/src' const BAILOUT_BASELINE = 'config/react-compiler-bailout-baseline.txt' const HAZARD_BASELINE = 'config/react-compiler-hazard-baseline.txt' -// The build leaves these files uncompiled, so their hazards cannot run. -const UNCOMPILED_LIST = 'config/react-compiler-uncompiled-files.txt' const COMMAND = 'pnpm check:react-compiler-compat-ratchet' const NOT_SHIPPED = /(?:^|\/)__(?:mocks|fixtures|tests)__\/|\.(?:test|spec|bench)\.[cm]?tsx?$|[.-]test-|[.-]fixtures?\.tsx?$/ @@ -101,18 +103,31 @@ function addTo(map, key, value) { map.set(key, [...(map.get(key) ?? []), value]) } +// The build leaves these files uncompiled, so their hazards cannot run. function readUncompiledFiles(root) { - const file = path.join(root, UNCOMPILED_LIST) - if (!fs.existsSync(file)) { - return new Set() + return fs.existsSync(path.join(root, UNCOMPILED_LIST)) + ? new Set(readListedFiles(UNCOMPILED_LIST, root)) + : new Set() +} + +// Why: the build matches the exact id, so `\`, `../`, a directory or another case would silently compile. +function isCanonicalFile(root, rel) { + try { + const file = path.join(root, rel) + return ( + !rel.includes('\\') && + path.posix.normalize(rel) === rel && + fs.statSync(file).isFile() && + fs.realpathSync.native(file) === path.join(fs.realpathSync.native(root), rel) + ) + } catch { + return false } - return new Set( - fs - .readFileSync(file, 'utf8') - .split('\n') - .map((line) => line.trim()) - .filter((line) => line && !line.startsWith('#')) - ) +} + +/** Listed paths that name no renderer file; a renamed file would silently compile. */ +export function findStaleUncompiledFiles(uncompiled, exists) { + return [...uncompiled].filter((rel) => !rel.startsWith(`${SCAN_ROOT}/`) || !exists(rel)) } /** Virtualizer hooks plus every hook that returns one, followed through wrappers of wrappers. */ @@ -210,12 +225,14 @@ async function scanFile(rel, text, result) { export async function scanRenderer(root = process.cwd()) { const sources = [...readTrackedSources(root, [SCAN_ROOT], isScannedPath)] + const uncompiled = readUncompiledFiles(root) const result = { files: 0, compiled: 0, diagnostics: new Map(), hazards: new Map(), - uncompiled: readUncompiledFiles(root), + uncompiled, + staleUncompiled: findStaleUncompiledFiles(uncompiled, (rel) => isCanonicalFile(root, rel)), virtualizerHooks: collectVirtualizerHooks(sources), liveReaders: collectLiveReaders(sources) } @@ -341,8 +358,15 @@ export async function main(root = process.cwd(), arg = undefined) { ) return 0 } + for (const rel of scan.staleUncompiled) { + console.error( + `::error::${UNCOMPILED_LIST}: ${rel} is not a renderer file. ` + + 'Point it at the renamed file, or remove it once the file is gone.' + ) + } const touched = listTouchedFiles(root) const ok = [ + scan.staleUncompiled.length === 0, check(root, 'bailout(s)', BAILOUT_BASELINE, bailouts, scan.diagnostics, touched), check(root, 'hazard(s)', HAZARD_BASELINE, hazards, scan.hazards, touched) ].every(Boolean) diff --git a/config/scripts/static-analysis/ratchets/renderer-state/check-layout-writer-ratchets.mjs b/config/scripts/static-analysis/ratchets/renderer-state/check-layout-writer-ratchets.mjs index 29b0247827e..009f48c981c 100644 --- a/config/scripts/static-analysis/ratchets/renderer-state/check-layout-writer-ratchets.mjs +++ b/config/scripts/static-analysis/ratchets/renderer-state/check-layout-writer-ratchets.mjs @@ -320,6 +320,24 @@ function isSameNameCopy(property, name) { return ts.isPropertyAccessExpression(value) && value.name.text === name } +// The transition seam names the fields it tracks in `const SEAM_*_FIELDS = [...] as const` lists; names, not writes. +function isSeamFieldNameConstant(literal) { + let list = literal.parent + if (!ts.isArrayLiteralExpression(list)) { + return false + } + let declaration = list.parent + while (ts.isAsExpression(declaration) || ts.isSatisfiesExpression(declaration)) { + declaration = declaration.parent + } + return ( + ts.isVariableDeclaration(declaration) && + ts.isIdentifier(declaration.name) && + /^SEAM_[A-Z_]+_FIELDS$/.test(declaration.name.text) && + (declaration.parent.flags & ts.NodeFlags.Const) !== 0 + ) +} + /** Layout writes in one file under one ratchet's rules. */ export function countLayoutWrites(sourceText, ratchet, fileName = 'file.tsx') { const names = [...ratchet.writerNames, ...ratchet.assignedFields] @@ -392,7 +410,8 @@ export function countLayoutWrites(sourceText, ratchet, fileName = 'file.tsx') { node.parent.expression.expression.text === 'Object' && node.parent.expression.name.text === 'hasOwn' ) && - !ts.isLiteralTypeNode(node.parent) + !ts.isLiteralTypeNode(node.parent) && + !isSeamFieldNameConstant(node) ) { count += 1 } diff --git a/config/scripts/static-analysis/ratchets/renderer-state/check-tab-map-seam-ratchet.mjs b/config/scripts/static-analysis/ratchets/renderer-state/check-tab-map-seam-ratchet.mjs new file mode 100644 index 00000000000..c6743a1ae76 --- /dev/null +++ b/config/scripts/static-analysis/ratchets/renderer-state/check-tab-map-seam-ratchet.mjs @@ -0,0 +1,380 @@ +import fs from 'node:fs' +import path from 'node:path' +import process from 'node:process' +import { pathToFileURL } from 'node:url' +import ts from 'typescript-api' + +// The tab-map transition seam (store/keyed-record-transitions.ts) only works if its writers annotate and its +// consumers enumerate whole maps only on named cold paths; this pins both for the repaired modules, nothing wider. + +const R = 'src/renderer/src/' +const STATUS = `${R}components/native-chat/session/status/` + +/** + * Repaired consumers: the only functions allowed to walk a whole map (`coldPaths`), which callers + * may reach a cold helper (`helpers`), and the only values they may import, so a new walking helper + * can't arrive through an import unreviewed. + */ +export const CONSUMERS = new Map([ + [ + `${STATUS}structured-agent-session-tabs.ts`, + { + coldPaths: new Set(['rebuildFromSnapshot']), + helpers: { rebuildFromSnapshot: ['advance'] }, + imports: new Set(['structuredAgentSessionPaneKey', 'isStructuredTab', 'readTabMapChanges']) + } + ], + [ + `${STATUS}StructuredAgentSessionStatusBridge.tsx`, + { + coldPaths: new Set(['reconcileFromSnapshot']), + helpers: { + getStructuredAgentSessionTabs: ['reconcileFromSnapshot'], + reconcileFromSnapshot: ['reconcile'] + }, + imports: new Set([ + 'useEffect', + 'projectStatus', + 'getStructuredAgentSessionLaunchLifecycle', + 'subscribeStructuredAgentLaunchStatus', + 'getStructuredAgentSessionLaunchFailedAt', + 'useAppStore', + 'structuredAgentSessionTargetForHost', + 'getStructuredAgentSessionStatusFeed', + 'structuredAgentSessionStatusFeedKey', + 'getStructuredAgentSessionTabs', + 'getStructuredAgentSessionTabsInWorkspace', + 'readTabMapChanges', + 'createTabOwnerCache', + 'ownerInputChanged', + 'ownerInputs', + 'createStructuredSessionMembership', + 'sameSemanticTab' + ]) + } + ], + [ + `${STATUS}structured-agent-session-status-membership.ts`, + { + coldPaths: new Set(), + helpers: { getStructuredAgentSessionTabs: [] }, + imports: new Set(['structuredAgentSessionPaneKey']) + } + ] +]) +const ENUMERATING_CALLS = new Set(['keys', 'values', 'entries']) + +/** Shared tab-map writers wired to the seam: a raw record literal for these fields bypasses provenance. */ +export const WRITERS = [ + 'src/renderer/src/runtime/web-session-tabs-sync/scoped-patch-annotation.ts', + 'src/renderer/src/runtime/web-session-tabs-sync/store-patch.ts', + 'src/renderer/src/runtime/workspace-layout/frames/workspace-layout-frame-sync.ts', + 'src/renderer/src/store/slices/browser/pages/browser-page-state-actions.ts', + 'src/renderer/src/store/slices/editor/file-ids/hydrated-editor-file-ids.ts', + 'src/renderer/src/store/slices/editor/hydration/restored-editor-owner-in-place.ts', + 'src/renderer/src/store/slices/editor/hydration/restored-editor-owner-transition.ts', + 'src/renderer/src/store/slices/editor/markdown/markdown-preview-actions.ts', + 'src/renderer/src/store/slices/editor/opening/open-file-mutations.ts', + 'src/renderer/src/store/slices/ssh/ssh-target-cleanup.ts', + 'src/renderer/src/store/slices/tabs/rename-worktree-layout.ts', + 'src/renderer/src/store/slices/tabs/tab-group-state.ts', + 'src/renderer/src/store/slices/tabs/tabs-close-actions.ts', + 'src/renderer/src/store/slices/tabs/tabs-create-actions.ts', + 'src/renderer/src/store/slices/tabs/tabs-drag-preview-actions.ts', + 'src/renderer/src/store/slices/tabs/tabs-drop-actions.ts', + 'src/renderer/src/store/slices/tabs/tabs-focus-actions.ts', + 'src/renderer/src/store/slices/tabs/tabs-group-actions.ts', + 'src/renderer/src/store/slices/tabs/tabs-host-mirroring.ts', + 'src/renderer/src/store/slices/tabs/tabs-label-actions.ts', + 'src/renderer/src/store/slices/tabs/tabs-move-actions.ts', + 'src/renderer/src/store/slices/tabs/tabs-reconciliation.ts', + 'src/renderer/src/store/slices/tabs/tabs-session-actions.ts', + 'src/renderer/src/store/slices/tabs/tabs-split-ratio-actions.ts', + 'src/renderer/src/store/slices/tabs/worktree-layout-lifecycle.ts', + 'src/renderer/src/store/slices/tabs/worktree-terminal-tab-respawn.ts', + 'src/renderer/src/store/slices/worktrees/session/set-active-worktree.ts', + 'src/renderer/src/store/slices/worktrees/session/worktree-identity-rename-state.ts', + 'src/renderer/src/store/slices/worktrees/session/worktree-slice-lookups.ts', + 'src/renderer/src/store/slices/worktrees/teardown/record-key-omission.ts', + 'src/renderer/src/store/terminals/terminal-tab-close.ts', + 'src/renderer/src/store/terminals/terminal-tab-creation.ts', + 'src/renderer/src/store/terminals/terminal-tab-navigation.ts', + 'src/renderer/src/store/terminals/terminal-tab-title-batch.ts', + 'src/renderer/src/store/terminals/workspace-terminal-hydration-patch.ts', + 'src/renderer/src/store/terminals/workspace-terminal-hydration.ts', + 'src/renderer/src/store/terminals/workspace-terminal-reconnect.ts', + 'src/renderer/src/store/workspace-layout/frames/workspace-layout-frame-store-patch.ts' +] +export const SEAM_FIELDS = new Set([ + 'tabsByWorktree', + 'unifiedTabsByWorktree', + 'terminalLayoutsByTabId', + 'ptyIdsByTabId', + 'lastKnownRelayPtyIdByTabId', + 'runtimePaneTitlesByTabId', + 'pendingStartupByTabId', + 'pendingReconnectPtyIdByTabId', + 'sleepingAgentSessionsByPaneKey', + 'layoutByWorktree', + 'groupsByWorktree', + 'activeGroupIdByWorktree' +]) + +function parse(file, text) { + return ts.createSourceFile(file, text, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX) +} + +function line(source, node) { + return source.getLineAndCharacterOfPosition(node.getStart(source)).line + 1 +} + +function enclosingFunctionNames(node) { + const names = [] + for (let current = node.parent; current; current = current.parent) { + if (ts.isFunctionDeclaration(current) && current.name) { + names.push(current.name.text) + } else if ( + (ts.isArrowFunction(current) || ts.isFunctionExpression(current)) && + ts.isVariableDeclaration(current.parent) && + ts.isIdentifier(current.parent.name) + ) { + names.push(current.parent.name.text) + } + } + return names +} + +function valueImports(source) { + const imported = [] + for (const statement of source.statements) { + const clause = ts.isImportDeclaration(statement) ? statement.importClause : null + if (!clause || clause.isTypeOnly) { + continue + } + if (clause.name) { + imported.push(clause.name) + } + const bindings = clause.namedBindings + if (bindings && ts.isNamespaceImport(bindings)) { + imported.push(bindings.name) + } else if (bindings) { + imported.push( + ...bindings.elements.filter((element) => !element.isTypeOnly).map((e) => e.name) + ) + } + } + return imported +} + +function isHelperReference(node, helpers) { + if (!ts.isIdentifier(node) || !Object.hasOwn(helpers, node.text)) { + return false + } + const parent = node.parent + const declares = + ((ts.isVariableDeclaration(parent) || ts.isFunctionDeclaration(parent)) && + parent.name === node) || + (ts.isPropertyAccessExpression(parent) && parent.name === node) || + (ts.isPropertyAssignment(parent) && parent.name === node) || + ts.isImportSpecifier(parent) + return !declares +} + +export function consumerViolations(file, text, { coldPaths, helpers, imports }) { + const source = parse(file, text) + const violations = [] + for (const name of valueImports(source)) { + if (!imports.has(name.text)) { + violations.push( + `${file}:${line(source, name)} imports ${name.text}; repaired consumers import only reviewed helpers` + ) + } + } + const visit = (node) => { + let what = null + let allowed = coldPaths + if ( + ts.isPropertyAccessExpression(node) && + ts.isIdentifier(node.expression) && + node.expression.text === 'Object' && + ENUMERATING_CALLS.has(node.name.text) + ) { + // Any reference, called or aliased (`const keys = Object.keys`). + what = `Object.${node.name.text}` + } else if (isHelperReference(node, helpers)) { + // Calls, aliases (`const resync = reconcileFromSnapshot`) and callbacks alike. + what = `${node.text}()` + allowed = new Set(helpers[node.text]) + } else if (ts.isForInStatement(node)) { + what = 'for…in' + } + if (what && !enclosingFunctionNames(node).some((name) => allowed.has(name))) { + violations.push(`${file}:${line(source, node)} ${what} outside a named cold path`) + } + if ( + ts.isFunctionDeclaration(node) && + node.name?.text === 'rebuildFromSnapshot' && + node.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) + ) { + violations.push(`${file}:${line(source, node)} rebuildFromSnapshot must stay module-private`) + } + ts.forEachChild(node, visit) + } + visit(source) + return violations +} + +function isRawRecord(expression) { + if (ts.isObjectLiteralExpression(expression)) { + return expression.properties.some((property) => ts.isSpreadAssignment(property)) + } + return ( + ts.isCallExpression(expression) && + ts.isPropertyAccessExpression(expression.expression) && + ts.isIdentifier(expression.expression.expression) && + expression.expression.expression.text === 'Object' && + ['fromEntries', 'assign'].includes(expression.expression.name.text) + ) +} + +// Only an explicit cold-path mark certifies a record built outside a construction helper or draft. +const ANNOTATED_ARGUMENT = { + markFullResync: 0 +} + +function enclosingScope(node) { + let current = node.parent + while (current && !ts.isFunctionLike(current) && !ts.isSourceFile(current)) { + current = current.parent + } + return current +} + +/** The value a local name holds at `use`: its declaration's initializer, followed through aliases. */ +function bindingSource(name, scope, use, seen = new Set()) { + if (seen.has(name)) { + return null + } + seen.add(name) + let found = null + const visit = (node) => { + if (node.pos >= use.pos) { + return + } + if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.name.text === name) { + found = node.initializer ?? null + } else if ( + ts.isBinaryExpression(node) && + node.operatorToken.kind === ts.SyntaxKind.EqualsToken && + ts.isIdentifier(node.left) && + node.left.text === name + ) { + found = node.right + } + ts.forEachChild(node, visit) + } + visit(scope) + if (found && ts.isIdentifier(found)) { + const aliased = bindingSource(found.text, scope, use, seen) + return aliased && { ...aliased, names: [name, ...aliased.names] } + } + return found && { value: found, names: [name] } +} + +/** Whether a seam helper annotates one of `names` in place before `use` publishes it. */ +function annotatedBefore(names, scope, use) { + let annotated = false + const visit = (node) => { + if (node.pos >= use.pos) { + return + } + if ( + node.end <= use.pos && + ts.isCallExpression(node) && + ts.isIdentifier(node.expression) && + Object.hasOwn(ANNOTATED_ARGUMENT, node.expression.text) + ) { + const argument = node.arguments[ANNOTATED_ARGUMENT[node.expression.text]] + annotated ||= + argument !== undefined && ts.isIdentifier(argument) && names.includes(argument.text) + } + ts.forEachChild(node, visit) + } + visit(scope) + return annotated +} + +function rawValue(node) { + const initializer = ts.isShorthandPropertyAssignment(node) ? node.name : node.initializer + if (isRawRecord(initializer)) { + return true + } + if (!ts.isIdentifier(initializer)) { + return false + } + // Follow the local binding and its aliases; the record must be annotated before it is published. + for (let scope = enclosingScope(node); scope; scope = scope.parent && enclosingScope(scope)) { + const binding = bindingSource(initializer.text, scope, node) + if (binding) { + return isRawRecord(binding.value) && !annotatedBefore(binding.names, scope, node) + } + if (ts.isSourceFile(scope)) { + break + } + } + return false +} + +export function writerViolations(file, text) { + const source = parse(file, text) + const violations = [] + const visit = (node) => { + if ( + (ts.isPropertyAssignment(node) || ts.isShorthandPropertyAssignment(node)) && + (ts.isIdentifier(node.name) || ts.isStringLiteral(node.name)) && + SEAM_FIELDS.has(node.name.text) && + rawValue(node) + ) { + violations.push( + `${file}:${line(source, node)} raw ${node.name.text} record; build it with a replace helper or draft, or mark it full resync` + ) + } + ts.forEachChild(node, visit) + } + visit(source) + return violations +} + +export function collect(root = process.cwd()) { + const violations = [] + for (const [file, rules] of CONSUMERS) { + violations.push( + ...consumerViolations(file, fs.readFileSync(path.join(root, file), 'utf8'), rules) + ) + } + for (const file of WRITERS) { + violations.push(...writerViolations(file, fs.readFileSync(path.join(root, file), 'utf8'))) + } + return violations +} + +export function main(root = process.cwd()) { + const violations = collect(root) + if (violations.length) { + for (const violation of violations) { + console.error(violation) + } + console.error( + 'Tab-map seam: ordinary handlers use addressed deltas (readTabMapChanges); whole-map walks belong only in the named cold paths.' + ) + return 1 + } + console.log( + `tab-map-seam ratchet OK — ${CONSUMERS.size} consumer and ${WRITERS.length} writer modules pinned.` + ) + return 0 +} + +if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { + process.exit(main(process.cwd())) +} diff --git a/config/scripts/static-analysis/ratchets/renderer-state/check-terminal-parking-ownership-ratchet.mjs b/config/scripts/static-analysis/ratchets/renderer-state/check-terminal-parking-ownership-ratchet.mjs new file mode 100644 index 00000000000..112b837bbb7 --- /dev/null +++ b/config/scripts/static-analysis/ratchets/renderer-state/check-terminal-parking-ownership-ratchet.mjs @@ -0,0 +1,475 @@ +import fs from 'node:fs' +import path from 'node:path' +import process from 'node:process' +import { pathToFileURL } from 'node:url' +import ts from 'typescript-api' + +const RENDERER = 'src/renderer/src/' +const WATCHERS = `${RENDERER}components/terminal-pane/parking/output-watchers/` +const ROOTS = new Map([ + [ + `${RENDERER}components/terminal/terminal-provider-snapshot-bound-pty-ids.ts`, + ['createTerminalProviderSnapshotBoundPtyIdsSelector'] + ], + [`${RENDERER}components/use-terminal-watcher-effects.ts`, ['useTerminalWatcherEffects']], + [`${RENDERER}components/use-terminal-parking-pass.ts`, ['useTerminalParkingPass']], + [ + `${RENDERER}components/terminal-parking-pass-candidates.ts`, + ['collectTerminalParkingPassCandidates'] + ], + [`${RENDERER}components/terminal/split-group-mount.ts`, ['anyMountedWorktreeHasLayout']], + [ + `${RENDERER}components/terminal-pane/parking/lifecycle/use-parked-terminal-watcher-synchronization.ts`, + ['useParkedTerminalWatcherSynchronization'] + ], + [ + `${RENDERER}components/terminal-pane/parking/lifecycle/use-terminal-tab-cold-parking.ts`, + ['useTerminalTabColdParking'] + ], + [`${WATCHERS}terminal-parked-tab-watchers.ts`, ['syncParkedTerminalTabWatchers']], + [`${WATCHERS}parked-terminal-tab-coverage.ts`, ['canWatcherCoverParkedTerminalTab']], + [ + `${RENDERER}lib/agent-session/resume/resume-sleeping-agent-session.ts`, + ['resumeSleepingAgentSessionsForWorktree'] + ] +]) +const HOT_MAPS = new Set([ + 'tabsByWorktree', + 'unifiedTabsByWorktree', + 'terminalLayoutsByTabId', + 'sleepingAgentSessionsByPaneKey' +]) +const OWNER_ROOTS = [ + { + rel: 'store/terminals/terminal-parking-input-owner.ts', + name: 'acceptTerminalParkingInputs', + inputs: [] + }, + { + rel: 'store/terminals/terminal-parking-input-owner.ts', + name: 'publishAcceptedTerminalParkingInputs', + inputs: [] + }, + { + rel: 'store/terminals/terminal-parking-input-owner.ts', + name: 'invalidateTerminalParkingPtyInputs', + inputs: [] + }, + { + rel: 'store/terminals/terminal-tab-owner-index.ts', + name: 'update', + inputs: ['tabsByWorktree'] + }, + { rel: 'store/terminals/sleeping-agent-record-index.ts', name: 'update', inputs: ['records'] }, + { + rel: 'store/terminals/sleeping-agent-record-index.ts', + name: 'acceptTransition', + inputs: ['previous', 'next'] + }, + { + rel: 'lib/workspace/tabs/worktree-tab-bucket-projection.ts', + name: 'project', + inputs: ['source'] + } +] +const KEY_DIFFS = new Set([ + `${RENDERER}store/terminals/terminal-parking-input-owner.ts#diffUnknownParkingRecordKeys`, + `${RENDERER}store/terminals/terminal-tab-owner-index.ts#diffUnknownTabOwnerKeys`, + `${RENDERER}store/terminals/sleeping-agent-record-index.ts#diffUnknownSleepingRecordKeys`, + `${RENDERER}lib/workspace/tabs/worktree-tab-bucket-projection.ts#diffUnknownProjectionKeys` +]) +const COLD_RESYNCS = new Set([ + `${RENDERER}store/terminals/terminal-parking-input-owner.ts#resyncTerminalParkingWorkspaceIds`, + `${RENDERER}store/terminals/sleeping-agent-record-index.ts#resyncSleepingAgentRecordKeys` +]) + +function isColdResyncCall(node, source) { + for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) { + if ( + ts.isConditionalExpression(ancestor) && + ancestor.condition.getText(source) === 'previous' && + node.pos >= ancestor.whenFalse.pos + ) { + return true + } + if ( + ts.isBinaryExpression(ancestor) && + ancestor.operatorToken.kind === ts.SyntaxKind.QuestionQuestionToken && + ancestor.left.getText(source) === 'keys' + ) { + return true + } + if ( + ts.isIfStatement(ancestor) && + node.pos >= ancestor.thenStatement.pos && + node.end <= ancestor.thenStatement.end + ) { + const condition = ancestor.expression.getText(source).replace(/\s+/g, ' ') + if ( + condition === 'ptyIds === undefined' || + condition.includes( + 'previous.settings?.terminalSshViewParking !== state.settings?.terminalSshViewParking' + ) + ) { + return true + } + } + } + return false +} +const STORE_BOUNDARIES = new Set([`${RENDERER}store/index.ts`, `${RENDERER}store.ts`]) +// Resource delivery and startup recovery are separate entry points, not parking input discovery. +const EFFECT_BOUNDARIES = new Set([ + `${RENDERER}components/terminal/terminal-provider-snapshot-bound-pty-ids.ts#resyncUnknownSnapshot`, + `${RENDERER}components/terminal/use-terminal-startup-activation.ts#useTerminalStartupActivation`, + `${WATCHERS}terminal-parked-pty-watcher.ts#startParkedPtyWatcher`, + `${RENDERER}components/terminal-pane/parking/capture/parked-terminal-buffer-capture.ts#captureParkedTerminalBuffers`, + `${RENDERER}lib/agent-session/resume/sleeping-agent-session-launch.ts#launchSleepingAgentSession`, + `${RENDERER}lib/host-mirror-handle-gap-wait.ts#parkUntilHostMirrorHandleLands`, + `${RENDERER}runtime/web-session-tabs-sync/hydration/host-session-mirror-hydration.ts#parkUntilHostSessionMirrorHydrates` +]) +const ENUMERATORS = new Set(['entries', 'values', 'keys', 'assign']) + +const ADDRESSED_FIELDS = new Set([ + 'terminalLayoutsByTabId', + 'ptyIdsByTabId', + 'lastKnownRelayPtyIdByTabId', + 'runtimePaneTitlesByTabId', + 'pendingStartupByTabId', + 'sleepingAgentSessionsByPaneKey' +]) +const ORDINARY_WRITERS = [ + 'store/terminals/terminal-layout-state.ts', + 'store/terminals/terminal-pane-hibernation.ts', + 'store/terminals/terminal-pty-bindings.ts', + 'store/terminals/terminal-pty-release.ts', + 'store/terminals/terminal-orphan-cleanup.ts', + 'store/terminals/terminal-startup-queues.ts', + 'store/terminals/terminal-tab-presentation.ts', + 'store/terminals/terminal-shutdown-state.ts', + 'store/terminals/window-tab-start-in-main.ts', + 'store/slices/agent-status/agent-status-live-reducer.ts', + 'store/slices/agent-status/agent-status-launch-actions.ts', + 'store/slices/agent-status/agent-status-provider-session-actions.ts', + 'store/slices/agent-status/agent-status-recovery-actions.ts', + 'store/slices/agent-status/agent-status-authority-actions.ts' +].map((rel) => RENDERER + rel) +const RECORD_TRANSITIONS = new Set([ + 'replaceRecordEntries', + 'removePaneKeys', + 'removePaneKeysByTabPrefix' +]) + +function collectUnaddressedWrites(root) { + const violations = [] + for (const rel of ORDINARY_WRITERS) { + const { source, aliases, assignments } = readModule(root, rel) + function addressed(value, field, seen = new Set()) { + if (ts.isCallExpression(value) && ts.isIdentifier(value.expression)) { + return RECORD_TRANSITIONS.has(value.expression.text) + } + if (ts.isPropertyAccessExpression(value)) { + return value.name.text === field + } + if (ts.isConditionalExpression(value)) { + return addressed(value.whenTrue, field, seen) && addressed(value.whenFalse, field, seen) + } + if (ts.isIdentifier(value)) { + if (seen.has(value.text)) { + return false + } + seen.add(value.text) + const alias = aliases.get(value.text) + return ( + alias !== undefined && + [alias, ...(assignments.get(value.text) ?? [])].every((replacement) => + addressed(replacement, field, new Set(seen)) + ) + ) + } + return false + } + function visit(node) { + if (ts.isPropertyAssignment(node) || ts.isShorthandPropertyAssignment(node)) { + const field = + ts.isIdentifier(node.name) || ts.isStringLiteral(node.name) ? node.name.text : null + const value = ts.isPropertyAssignment(node) ? node.initializer : node.name + if (ADDRESSED_FIELDS.has(field) && !addressed(value, field)) { + const line = source.getLineAndCharacterOfPosition(node.getStart(source)).line + 1 + violations.push(`${rel}:${line}: ${field} write needs complete record-key provenance.`) + } + } + ts.forEachChild(node, visit) + } + visit(source) + } + return violations +} + +function resolveImport(root, from, specifier) { + const base = specifier.startsWith('@/') + ? RENDERER + specifier.slice(2) + : specifier.startsWith('.') + ? path.posix.join(path.posix.dirname(from), specifier) + : null + if (!base) { + return null + } + return ( + [base, `${base}.ts`, `${base}.tsx`, `${base}/index.ts`].find( + (candidate) => + fs.existsSync(path.join(root, candidate)) && + fs.statSync(path.join(root, candidate)).isFile() + ) ?? null + ) +} + +function readModule(root, rel) { + const source = ts.createSourceFile( + rel, + fs.readFileSync(path.join(root, rel), 'utf8'), + ts.ScriptTarget.Latest, + true + ) + const imports = new Map() + const functions = new Map() + const aliases = new Map() + const assignments = new Map() + function visit(node) { + if ( + ts.isBinaryExpression(node) && + ts.isIdentifier(node.left) && + node.operatorToken.kind >= ts.SyntaxKind.FirstAssignment && + node.operatorToken.kind <= ts.SyntaxKind.LastAssignment + ) { + const values = assignments.get(node.left.text) ?? [] + values.push(node.right) + assignments.set(node.left.text, values) + } + if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) { + const target = resolveImport(root, rel, node.moduleSpecifier.text) + const bindings = node.importClause?.namedBindings + if (target && bindings && ts.isNamedImports(bindings)) { + for (const binding of bindings.elements) { + imports.set(binding.name.text, { + rel: target, + name: binding.propertyName?.text ?? binding.name.text + }) + } + } + } + if ( + (ts.isFunctionDeclaration(node) || ts.isMethodDeclaration(node)) && + node.name && + node.body + ) { + functions.set(node.name.text, node) + } + if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) { + aliases.set(node.name.text, node.initializer) + if (ts.isArrowFunction(node.initializer) || ts.isFunctionExpression(node.initializer)) { + functions.set(node.name.text, node.initializer) + } + } + ts.forEachChild(node, visit) + } + visit(source) + return { source, imports, functions, aliases, assignments } +} + +export function collectParkingOwnershipViolations(root = process.cwd()) { + const modules = new Map() + const pending = [...ROOTS].flatMap(([rel, names]) => + names.map((name) => ({ rel, name, tainted: new Set() })) + ) + for (const { rel, name, inputs } of OWNER_ROOTS) { + pending.push({ rel: RENDERER + rel, name, tainted: new Set(inputs) }) + } + const visited = new Set() + const violations = new Set() + while (pending.length) { + const { rel, name, tainted } = pending.pop() + if (STORE_BOUNDARIES.has(rel) || EFFECT_BOUNDARIES.has(`${rel}#${name}`)) { + continue + } + const identity = `${rel}#${name}#${[...tainted].sort().join(',')}` + if (visited.has(identity)) { + continue + } + visited.add(identity) + let mod = modules.get(rel) + if (!mod) { + modules.set(rel, (mod = readModule(root, rel))) + } + const fn = mod.functions.get(name) + if (!fn) { + continue + } + function hotMap(node, seen = new Set()) { + if (ts.isPropertyAccessExpression(node)) { + if (HOT_MAPS.has(node.name.text)) { + return true + } + if (ts.isIdentifier(node.expression)) { + const value = mod.aliases.get(node.expression.text) + if (value && ts.isObjectLiteralExpression(value)) { + const property = value.properties.find( + (candidate) => + ts.isPropertyAssignment(candidate) && + candidate.name.getText(mod.source) === node.name.text + ) + if (property && ts.isPropertyAssignment(property)) { + return hotMap(property.initializer, seen) + } + } + } + return false + } + if (ts.isElementAccessExpression(node)) { + return ( + ts.isStringLiteral(node.argumentExpression) && HOT_MAPS.has(node.argumentExpression.text) + ) + } + if (ts.isIdentifier(node)) { + if (HOT_MAPS.has(node.text) || tainted.has(node.text)) { + return true + } + if (seen.has(node.text)) { + return false + } + seen.add(node.text) + const alias = mod.aliases.get(node.text) + return alias ? hotMap(alias, seen) : false + } + if ( + ts.isParenthesizedExpression(node) || + ts.isAsExpression(node) || + ts.isNonNullExpression(node) + ) { + return hotMap(node.expression, seen) + } + if ( + ts.isBinaryExpression(node) && + node.operatorToken.kind === ts.SyntaxKind.QuestionQuestionToken + ) { + return hotMap(node.left, seen) + } + return false + } + function report(node) { + const line = mod.source.getLineAndCharacterOfPosition(node.getStart(mod.source)).line + 1 + violations.add( + `${rel}:${line}: ${name} enumerates a whole parking input; use the addressed owner or a named source resync.` + ) + } + function visit(node) { + if ( + ts.isFunctionDeclaration(node) && + node.name && + EFFECT_BOUNDARIES.has(`${rel}#${node.name.text}`) + ) { + return + } + if (ts.isForInStatement(node) && hotMap(node.expression)) { + report(node) + } + if (ts.isCallExpression(node)) { + const callee = node.expression + if ( + ts.isPropertyAccessExpression(callee) && + ts.isIdentifier(callee.expression) && + callee.expression.text === 'Object' && + ENUMERATORS.has(callee.name.text) && + node.arguments.some((arg) => hotMap(arg)) && + !(callee.name.text === 'keys' && KEY_DIFFS.has(`${rel}#${name}`)) && + !COLD_RESYNCS.has(`${rel}#${name}`) + ) { + report(node) + } + if (ts.isIdentifier(callee)) { + const target = mod.imports.get(callee.text) ?? { rel, name: callee.text } + if ( + COLD_RESYNCS.has(`${target.rel}#${target.name}`) && + !isColdResyncCall(node, mod.source) + ) { + report(node) + } + if (!STORE_BOUNDARIES.has(target.rel)) { + let targetModule = modules.get(target.rel) + if (!targetModule) { + modules.set(target.rel, (targetModule = readModule(root, target.rel))) + } + const called = targetModule.functions.get(target.name) + const parameters = new Set() + called?.parameters.forEach((parameter, index) => { + if ( + ts.isIdentifier(parameter.name) && + node.arguments[index] && + hotMap(node.arguments[index]) + ) { + parameters.add(parameter.name.text) + } + }) + if (called) { + pending.push({ ...target, tainted: parameters }) + } + } + } + } + ts.forEachChild(node, visit) + } + visit(fn.body) + } + return [...violations].sort() +} + +function collectPublicCoverageViolations(root) { + const rel = `${WATCHERS}parked-terminal-tab-coverage.ts` + const { source } = readModule(root, rel) + const privateNames = new Set([ + 'fallbackParkedPaneCandidates', + 'resolveParkedTerminalPaneCandidates', + 'capturedCoversFallback' + ]) + const violations = [] + for (const statement of source.statements) { + const exported = + ts.canHaveModifiers(statement) && + ts.getModifiers(statement)?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) + const leaksDeclaration = + exported && ts.isFunctionDeclaration(statement) && privateNames.has(statement.name?.text) + const leaksNamedExport = + ts.isExportDeclaration(statement) && + statement.exportClause && + ts.isNamedExports(statement.exportClause) && + statement.exportClause.elements.some((element) => + privateNames.has(element.propertyName?.text ?? element.name.text) + ) + if (leaksDeclaration || leaksNamedExport) { + violations.push(`${rel}: raw coverage derivation must stay private to its owner.`) + } + } + return violations +} + +export function main(root = process.cwd()) { + const violations = [ + ...collectParkingOwnershipViolations(root), + ...collectUnaddressedWrites(root), + ...collectPublicCoverageViolations(root) + ] + for (const violation of violations) { + console.error(violation) + } + if (violations.length) { + return 1 + } + console.log( + 'terminal-parking-ownership: addressed consumer paths contain no whole input enumeration' + ) + return 0 +} + +if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { + process.exitCode = main() +} diff --git a/config/scripts/test-runtime/execution-policy/vitest-shared-worker-setup-runner.mjs b/config/scripts/test-runtime/execution-policy/vitest-shared-worker-setup-runner.mjs new file mode 100644 index 00000000000..1b41d2349cc --- /dev/null +++ b/config/scripts/test-runtime/execution-policy/vitest-shared-worker-setup-runner.mjs @@ -0,0 +1,16 @@ +import { TestRunner } from 'vitest' + +export default class SharedWorkerSetupRunner extends TestRunner { + importFile(filepath, source) { + if (source === 'setup') { + // Warm transforms can key setup roots by a different URL than Vitest invalidates. + const modules = this.moduleRunner.evaluatedModules + for (const node of modules.getModulesByFile(filepath) ?? []) { + if (node.evaluated) { + modules.invalidateModule(node) + } + } + } + return super.importFile(filepath, source) + } +} diff --git a/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs b/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs index 7f9ba3b8138..d7542ed8616 100644 --- a/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs +++ b/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs @@ -27,8 +27,6 @@ const NODE_RUNTIME_INCLUDE = [ 'src/main/browser/extensions/native-messaging/browser-extension-native-host-process-backpressure.test.ts', 'src/main/daemon/providers/lifecycle/testing/daemon-init-provider-installation.test.ts', 'src/renderer/src/components/terminal-pane/pty-transport/input/pty-input-write-queue.test.ts', - 'src/renderer/src/lib/react-commit-cascade-observer.test.ts', - 'src/renderer/src/lib/react-commit-cascade-telemetry.test.ts', // Asserts payloads are collected; Bun's GC scans the stack conservatively and may keep one alive. 'src/shared/ws-inbound-message-queue.test.ts', 'src/renderer/src/lib/agent-session/history/title-sync/ai-vault-tab-title-sync-inputs.test.ts', @@ -36,6 +34,7 @@ const NODE_RUNTIME_INCLUDE = [ // Asserts an observer survives a forced collection; conservative retention would hide a lost one. 'config/scripts/test-runtime/dom/happy-dom-mutation-observer-retention.test.ts', // These reach Node SQLite through a shared helper or a dynamic import, which the scan skips. + 'src/main/agent-hooks/server/testing/providers/codex/server-codex-session-start.test.ts', 'src/main/claude/claude-transcript-catch-up.test.ts', 'src/main/claude/claude-transcript-duration.test.ts', 'tests/e2e/native-chat-startup-option-pickers.unit.test.ts', @@ -136,7 +135,7 @@ const NODE_RUNTIME_INCLUDE = [ 'src/main/gitlab/gitlab-known-host-retirement.test.ts', 'src/main/window/main-window-updater-deferred-setup.test.ts', 'src/renderer/src/components/terminal-pane/host-state/terminal-pane-host-state-memo.test.ts', - 'src/renderer/src/components/automations/use-automation-runs-dashboard-payload.test.tsx', + 'src/renderer/src/components/automations/runs/use-automation-runs-dashboard-payload.test.tsx', 'src/main/native-chat/agent-session-journal/**/*.test.ts', 'src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-terminal-writer-acquire.test.ts', 'src/main/runtime/agent-session/records/agent-session-conversation-name-store.test.ts', @@ -168,7 +167,14 @@ const NODE_RUNTIME_INCLUDE = [ 'src/main/claude/claude-agent-sdk-contract-pins.test.ts', 'config/scripts/orcad-distribution/server-bundle/profile-state-worker-smoke.test.mjs', 'config/scripts/desktop-distribution/runtime-verification/process-host-dev-rebuild.test.ts', - 'config/scripts/test-runtime/node-worker/vitest-node-runtime-pool.test.ts' + 'config/scripts/test-runtime/node-worker/vitest-node-runtime-pool.test.ts', + // Reopen WAL-backed row caches read-only, which Bun on macOS cannot. + 'src/main/agent-hooks/server/testing/identity/server-hook-session-binding.test.ts', + 'tests/e2e/helpers/persisted-profile-state.unit.test.ts', + 'src/main/runtime/push/notifications/mobile-notification-dismissal-store.test.ts', + 'src/main/runtime/push/notifications/mobile-notification-dismissal-read-failure.test.ts', + 'src/main/ipc/notifications-subject-retirement.test.ts', + 'src/main/ipc/notifications-external-acknowledgement.test.ts' ] /** `filters` limits the SQLite import scan to the tests a filtered CLI run can select. */ diff --git a/config/scripts/workflow/source-routing/pr-layout-oracle-route.mjs b/config/scripts/workflow/source-routing/pr-layout-oracle-route.mjs index ac16f8b4df8..62e6e863cec 100644 --- a/config/scripts/workflow/source-routing/pr-layout-oracle-route.mjs +++ b/config/scripts/workflow/source-routing/pr-layout-oracle-route.mjs @@ -25,7 +25,7 @@ const LAYOUT_ORACLE_PREFIXES = [ 'src/renderer/src/store/workspace-layout/workspace-layout-cache', 'src/renderer/src/components/terminal-pane/', 'src/renderer/src/components/agent-session-continuation/AgentSessionContinuationMenuItem.tsx', - 'src/renderer/src/components/orchestration-crew/WorkerAutoCloseBanner.tsx', + 'src/renderer/src/components/terminal-pane/worker-lifetime/WorkerAutoCloseBanner.tsx', 'src/renderer/src/attention/orca-window-foreground-focus.ts', 'src/renderer/src/attention/notification-workspace-labels.ts', 'src/renderer/src/lib/agent-session/identity/pane-agent-session-id.ts', diff --git a/config/startup-worktree-localization-allowlist.json b/config/startup-worktree-localization-allowlist.json new file mode 100644 index 00000000000..57d98c87207 --- /dev/null +++ b/config/startup-worktree-localization-allowlist.json @@ -0,0 +1,26 @@ +[ + { + "filePath": "src/main/startup/main-process-quit.ts", + "kind": "object-property:message", + "text": "before-quit allowed for update install", + "dynamic": false, + "count": 1, + "reason": "Updater lifecycle diagnostics are not displayed as UI copy." + }, + { + "filePath": "src/main/startup/main-process-quit.ts", + "kind": "object-property:message", + "text": "will-quit cleanup for update install; daemonTeardown=disconnect", + "dynamic": false, + "count": 1, + "reason": "Updater lifecycle diagnostics are not displayed as UI copy." + }, + { + "filePath": "src/main/startup/profile-state-recovery-preflight.ts", + "kind": "object-property:message", + "text": "Invalid profile-state recovery launch.", + "dynamic": false, + "count": 1, + "reason": "Existing recovery detail is user-visible and remains untranslated; tracked in issue 32207." + } +] diff --git a/config/tsconfig.node.json b/config/tsconfig.node.json index 563748d8a33..f68039491a0 100644 --- a/config/tsconfig.node.json +++ b/config/tsconfig.node.json @@ -23,8 +23,7 @@ "../src/cli/runtime/runtime-access-denied.ts", "../src/cli/runtime/runtime-pid-liveness.ts", "../src/renderer/src/store/slices/worktrees/create/worktree-create-payload.ts", - "../src/renderer/src/lib/orca-hook-trust.ts", - "../src/renderer/src/lib/sha256.ts", + "../src/renderer/src/runtime/repo-hooks/orca-hook-trust.ts", "../src/renderer/src/components/native-chat/native-chat-resolution-receipt.ts", "../src/renderer/src/components/native-chat/structured-agent-question-projection.ts", "../src/renderer/src/components/native-chat/subagents/native-chat-subagent-delegation.ts", diff --git a/config/tsconfig.tc.web.json b/config/tsconfig.tc.web.json index d7542c5e628..a8d6f7c30cb 100644 --- a/config/tsconfig.tc.web.json +++ b/config/tsconfig.tc.web.json @@ -3,7 +3,6 @@ "exclude": [ "../src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-in-new-tab-main-surface.test.ts", "../src/renderer/src/components/task-page/linear/task-page-linear-detail-query.test.tsx", - "../tests/e2e/terminal-agent-pane-launch.unit.test.ts", "../src/renderer/src/runtime/provider-accounts/observations/provider-account-observation.test-fixture.ts", "../src/shared/**/*.test.ts", "../src/shared/**/*.test.tsx", diff --git a/config/tsconfig.test.pane-launch.json b/config/tsconfig.test.pane-launch.json index 63896e6d839..0885af36f1d 100644 --- a/config/tsconfig.test.pane-launch.json +++ b/config/tsconfig.test.pane-launch.json @@ -5,7 +5,6 @@ "../src/main/runtime/orchestration/terminal-authority/structured-sessions/structured-chat-coordinator-mail.test.ts", "../src/main/runtime/rpc/methods/orchestration/orchestration-check-ambiguous-caller.test.ts", "../src/renderer/src/components/task-page/linear/task-page-linear-detail-query.test.tsx", - "../tests/e2e/terminal-agent-pane-launch.unit.test.ts", "../src/renderer/src/runtime/observed-provider-accounts.test.tsx", "../src/renderer/src/components/status-bar/ClaudeSwitcherMenu.observation.test.tsx", "../src/renderer/src/runtime/provider-accounts/observations/provider-account-observation.test-fixture.ts", diff --git a/config/tsconfig.web.json b/config/tsconfig.web.json index 02a420684d3..8b5c4e283c7 100644 --- a/config/tsconfig.web.json +++ b/config/tsconfig.web.json @@ -13,7 +13,6 @@ "exclude": [ "../src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-in-new-tab-main-surface.test.ts", "../src/renderer/src/components/task-page/linear/task-page-linear-detail-query.test.tsx", - "../tests/e2e/terminal-agent-pane-launch.unit.test.ts", "../src/renderer/src/runtime/provider-accounts/observations/provider-account-observation.test-fixture.ts" ], "compilerOptions": { diff --git a/config/vitest.config.ts b/config/vitest.config.ts index 7dc0f04c525..bfed0dadfdd 100644 --- a/config/vitest.config.ts +++ b/config/vitest.config.ts @@ -126,10 +126,12 @@ const bunProject = { } // Files whose state the per-file reset can undo share one worker's module cache instead of // re-importing thousands of modules each. ORCA_VITEST_ISOLATE_EVERY_FILE=1 turns it off. +// Windows workers that keep native addons (process tree, ConPTY) across files die of heap +// corruption (0xC0000374); production code loads them lazily, so the file scan can't see them. const runtimeProject = process.versions.bun ? bunProject : nodeProject const nodeRuntimeFiles = new Set(nodeRuntimeInclude.map((file) => file.replaceAll('\\', '/'))) const sharedWorkerFiles = - process.env.ORCA_VITEST_ISOLATE_EVERY_FILE === '1' + process.env.ORCA_VITEST_ISOLATE_EVERY_FILE === '1' || process.platform === 'win32' ? [] : filesSafeToShareWorker( process.cwd(), @@ -151,6 +153,9 @@ const sharedProjects = name: `${runtimeProject.test.name}-shared`, include: sharedWorkerFiles, isolate: false, + runner: resolve( + 'config/scripts/test-runtime/execution-policy/vitest-shared-worker-setup-runner.mjs' + ), setupFiles: [ ...runtimeProject.test.setupFiles, resolve('config/scripts/test-runtime/environment/vitest-shared-worker-file-reset.mjs') diff --git a/config/vitest.performance.config.ts b/config/vitest.performance.config.ts index a29424675e5..a068105564d 100644 --- a/config/vitest.performance.config.ts +++ b/config/vitest.performance.config.ts @@ -6,7 +6,6 @@ import { nodeRuntimePool } from './scripts/test-runtime/node-worker/vitest-node- const contracts = [ 'src/main/runtime/session-tabs/session-tabs-phone-layout-moves.test.ts', - 'src/renderer/src/components/terminal-pane/pty-connection/startup/saved-resume-cancellation.test.ts', 'src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-terminal-writer-acquire.test.ts', 'src/shared/agent-launch/permissions/tui-agent-permission-choice.test.ts', 'src/main/runtime/rpc/methods/projects/repo.test.ts', @@ -18,12 +17,10 @@ const contracts = [ 'src/main/codex-usage/scanner-incremental-append.test.ts', 'src/main/usage/jsonl-file-reader.test.ts', 'src/main/usage/jsonl-file-snapshot.test.ts', - 'src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler-queue-retention.test.ts', 'config/scripts/static-analysis/oxlint-contracts/app-store-performance-plugin.test.mjs', 'config/scripts/static-analysis/oxlint-contracts/quadratic-buffer-concat-plugin.test.mjs', 'src/main/claude-usage/scanner-incremental-append.test.ts', - 'src/main/claude-usage/store-checkpoint-persistence.test.ts', - 'src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.streaming-input.test.tsx' + 'src/main/claude-usage/store-checkpoint-persistence.test.ts' ] for (const contract of contracts) { if (!existsSync(resolve(contract))) { diff --git a/config/workspace-record-read-baseline.txt b/config/workspace-record-read-baseline.txt index ca14f9bf2ad..418a6c1e1ad 100644 --- a/config/workspace-record-read-baseline.txt +++ b/config/workspace-record-read-baseline.txt @@ -8,7 +8,6 @@ 4 src/renderer/src/components/dashboard/build-dashboard-bucket-counts.ts # P5b-2 must clear: optional state fields; memo compare goes stale when absent 3 src/renderer/src/components/dashboard/dashboard-card-terminal-input.ts # P5b-2 must clear: optional state fields default to empty 1 src/renderer/src/components/dashboard/dashboard-snapshot-workspaces.ts # P5b-2 must clear: optional state field defaults to empty -1 src/renderer/src/components/dashboard/dashboard-worktree-launch-options.ts # P5b-2 must clear: optional state field defaults to empty 4 src/renderer/src/components/dashboard/useDashboardPopoutBridge.ts # P5b-2 must clear: change detection on optional fields never fires when absent 2 src/renderer/src/components/dashboard/useRetainedAgents.ts # reads a passed-in copy 1 src/renderer/src/components/editor/markdown/documents/markdown-document-worktree-path-selector.ts # P5b-2 must clear: optional state field @@ -22,7 +21,7 @@ 1 src/renderer/src/components/sidebar/worktree-list/navigation/pending-reveal-inputs.ts # reads a passed-in copy 1 src/renderer/src/components/sidebar/worktree-list/navigation/use-pending-reveal.ts # reads a passed-in copy 2 src/renderer/src/components/sidebar/worktree-list/viewport/VirtualizedWorktreeViewport.tsx # reads a passed-in copy -2 src/renderer/src/components/skills/skill-install-workspace-choices.ts # reads a passed-in copy +2 src/renderer/src/components/skills/installation/skill-install-workspace-choices.ts # reads a passed-in copy 1 src/renderer/src/components/terminal-pane/links/files/terminal-worktree-path-link.ts # P5b-2 must clear: loosely typed state param 1 src/renderer/src/components/workspace-space/space-window-state.ts # reads a passed-in copy 1 src/renderer/src/hooks/composer-state/composer-source-state.ts # P5b-2 must clear: composer store snapshot @@ -36,10 +35,10 @@ 1 src/renderer/src/runtime/hosts/wsl/local-project-runtime-workspace.ts # P5b-2 must clear: optional state field defaults to empty 1 src/renderer/src/lib/resolved-worktree-execution-host.ts # P5b-2 must clear: loosely typed state param 2 src/renderer/src/lib/workspace/ownership/runtime-session-mirror-owners.ts # P5b-2 must clear: optional state fields default to empty -2 src/renderer/src/lib/terminal-worktree-route.ts # P5b-2 must clear: the unattributed-twin check reads both catalogs directly +2 src/renderer/src/lib/workspace/ownership/terminal-worktree-route.ts # P5b-2 must clear: the unattributed-twin check reads both catalogs directly 3 src/renderer/src/lib/typing-latency/diagnostic-summary.ts # P5b-2 must clear: optional state field 2 src/renderer/src/lib/unread-badge-count.ts # reads a passed-in copy -1 src/renderer/src/lib/workspace-directory.ts # P5b-2 must clear: optional state field defaults to empty +1 src/renderer/src/lib/workspace/paths/workspace-directory.ts # P5b-2 must clear: optional state field defaults to empty 2 src/renderer/src/lib/workspace/ownership/workspace-terminal-host-authority.ts # P5b-2 must clear: optional state fields 1 src/renderer/src/lib/workspace/activation/initial-surface/worktree-initial-terminal-seeding.ts # P5b-2 must clear: treats an undefined field as a narrow adapter 1 src/renderer/src/lib/workspace/activation/worktree-activation-pty-inventory.ts # P5b-2 must clear: loosely typed state param diff --git a/docs/STYLEGUIDE.md b/docs/STYLEGUIDE.md index 8befb02e39a..ee8a8c1e177 100644 --- a/docs/STYLEGUIDE.md +++ b/docs/STYLEGUIDE.md @@ -44,7 +44,7 @@ Tokens pair a **surface** with a **foreground** that meets contrast on it; alway - Body letter-spacing is set globally on `body`; don't override per component. - Use Tailwind's scale. Common: 14px body/default buttons, 13px sidebar items and dense rows, 12px sub-text and paths, 11px uppercase meta/captions. - Use `text-2xs` (11px) and `text-3xs` (10px), not `text-[11px]` / `text-[10px]`. -- Category labels: 11px, `font-semibold`, `uppercase`, `tracking-wider` (0.05em). +- Category labels: 11px, `font-semibold`, `uppercase`, `tracking-wider` (0.05em). Settings content uses sentence case without tracking: 14px row labels, `text-settings-detail` (12.5px) help, and `text-settings-heading` (15px) semibold section headings. Settings form rows use about 9px vertical padding (44px minimum), selects are 28px, and the centered content column is at most 720px with at least 32px side gutters. These density rules are scoped to `.settings-view-shell`; shared primitives retain their defaults elsewhere. - Native chat has its own lint-enforced scale and colours: see [native-chat.md](./styleguide/native-chat.md). ## Radius and elevation diff --git a/docs/assets/readme-downloads.svg b/docs/assets/readme-downloads.svg index 968f6560164..25b9a04169b 100644 --- a/docs/assets/readme-downloads.svg +++ b/docs/assets/readme-downloads.svg @@ -1,5 +1,5 @@ - - downloads: 162m + + downloads: 168m @@ -15,7 +15,7 @@ downloads downloads - 162m - 162m + 168m + 168m diff --git a/docs/assets/star-history.png b/docs/assets/star-history.png index 27a763163ca..04839af4982 100644 Binary files a/docs/assets/star-history.png and b/docs/assets/star-history.png differ diff --git a/docs/assets/wechat-qr-group12.jpg b/docs/assets/wechat-qr-group12.jpg deleted file mode 100644 index 475c483ca76..00000000000 Binary files a/docs/assets/wechat-qr-group12.jpg and /dev/null differ diff --git a/docs/assets/wechat-qr-group13.jpg b/docs/assets/wechat-qr-group13.jpg deleted file mode 100644 index 48c67e4031b..00000000000 Binary files a/docs/assets/wechat-qr-group13.jpg and /dev/null differ diff --git a/docs/assets/wechat-qr-group14.jpg b/docs/assets/wechat-qr-group14.jpg deleted file mode 100644 index 76745e168d5..00000000000 Binary files a/docs/assets/wechat-qr-group14.jpg and /dev/null differ diff --git a/docs/assets/wechat-qr-group15.jpg b/docs/assets/wechat-qr-group15.jpg deleted file mode 100644 index 97ca38eb20b..00000000000 Binary files a/docs/assets/wechat-qr-group15.jpg and /dev/null differ diff --git a/docs/assets/wechat-qr-group16.jpg b/docs/assets/wechat-qr-group16.jpg deleted file mode 100644 index 158a50794cc..00000000000 Binary files a/docs/assets/wechat-qr-group16.jpg and /dev/null differ diff --git a/docs/assets/wechat-qr.jpg b/docs/assets/wechat-qr.jpg index 4b4f61e17f5..ecc8de57c7b 100644 Binary files a/docs/assets/wechat-qr.jpg and b/docs/assets/wechat-qr.jpg differ diff --git a/docs/development.md b/docs/development.md new file mode 100644 index 00000000000..56656dfe72e --- /dev/null +++ b/docs/development.md @@ -0,0 +1,57 @@ +# Orca Development Environment + +Setup details beyond [`CONTRIBUTING.md`](../.github/CONTRIBUTING.md). + +## Prerequisites + +Install Node 24, the pnpm version in `packageManager` in [`package.json`](../package.json), and the Bun version in [`config/.bun-version`](../config/.bun-version). + +The server, its workers, and its packaged dependencies target Node 24. The compatibility launcher and CLI still target Node 18; the launcher hands off to bundled Node 24 before loading server code. WSL guest programs and host discovery retain their Node 18 minimum. Keep Node 24 APIs and server imports out of these host compatibility paths. Running an unpackaged server directly requires Node 24 or newer. + +`corepack enable` needs Corepack 0.34.5 or newer (`npm install -g corepack@latest`). On Windows it fails with `EPERM` outside an elevated shell when Node is in `C:\Program Files\nodejs`; run `npm install -g pnpm@` instead. + +`pnpm install` compiles native modules such as `node-pty`, so a fresh machine also needs: + +- **macOS**: Xcode Command Line Tools (`xcode-select --install`). +- **Windows**: Python 3 and Visual Studio Build Tools with the "Desktop development with C++" workload. +- **Linux**: a C++ toolchain, Python 3, Electron's libraries, and `xvfb` (used by `*.electron.test.ts` when `DISPLAY` is unset). On Ubuntu 24.04+ and Debian 13+ (older releases name the last package `libasound2`): + + ```bash + sudo apt-get update && sudo apt-get install -y build-essential python3 xvfb libgtk-3-0 libnss3 libgbm1 libasound2t64 + ``` + +Re-run `pnpm -C mobile install --frozen-lockfile` whenever `mobile/pnpm-lock.yaml` changes. + +## Dev Profiles and Parallel Instances + +`pnpm dev` in a linked Git worktree uses its own profile, renderer port (from 15200), and CDP port (from 9333), so worktrees run side by side. The main checkout uses the shared `orca-dev` profile. The chosen profile and ports are printed on an `ORCA_DEV_INSTANCE` line and written to `out/dev-instance.json`. + +| Option | Effect | +| ----------------------------------------------------------------------- | ---------------------------------------------------------- | +| `pnpm dev --shared-profile` or `ORCA_DEV_PROFILE=shared` | Use the shared `orca-dev` profile | +| `pnpm dev --worktree-profile` or `ORCA_DEV_PROFILE=worktree` | Use a per-worktree profile, including in the main checkout | +| `ORCA_DEV_USER_DATA_PATH=` | Use an explicit profile directory | +| `REMOTE_DEBUGGING_PORT=`, `ORCA_DEV_RENDERER_PORT=` | Pin a port | +| `pnpm dev --seed-profile[=]` or `ORCA_DEV_SEED_PROFILE=` | Seed an empty profile on first launch | + +After a worktree is removed and no process still uses its profile, a later `pnpm dev` can automatically delete that profile and its saved state. Back up any state you need before removing the worktree; the `userData` field in `ORCA_DEV_INSTANCE` or `out/dev-instance.json` gives the profile directory. + +Seeding copies projects, workspaces, settings, SSH targets, and the Orca account session from another profile (default `orca-dev`, else the installed app's). Seed from `orca-dev` if you need to stay signed in: dev builds cannot decrypt secrets the installed app encrypted. + +```bash +pnpm dev:seed-profile [--from=] [--to=] [--reset] +pnpm dev:fresh [--keep] [--seed-from[=]] # temporary profile, removed on exit +``` + +## Installs and Builds + +- Local installs use pnpm's global virtual store (`~/pnpm/store`) shared by all worktrees. Do not keep a `node_modules` in your home directory: it hides missing-dependency bugs. Set `ORCA_PNPM_GLOBAL_VIRTUAL_STORE=0` in your shell to opt out. +- Before a cross-architecture build (including `pnpm build:mac`, which builds x64 and arm64), run `pnpm install:release`. +- On Linux, `pnpm build`, `pnpm build:native`, and packaging need a running Docker daemon for the clipboard helper. For native Wayland development, run `pnpm build:native` before `pnpm dev`. See the [clipboard build guide](../native/wayland-clipboard/README.md#building-and-testing). + +## Troubleshooting + +- Slow main-process rebuilds: set `ORCA_DEV_MAIN_SOURCEMAPS=0` before `pnpm dev` when you don't need main-process source maps. +- Renderer misbehaving in dev: set `ORCA_DEV_BUNDLED=0` to turn off bundled dev mode, and report it. +- Test passes alone but fails after others: add `// @orca-isolated-worker` to the file; `ORCA_VITEST_ISOLATE_EVERY_FILE=1` isolates every file to confirm a leak. Windows always isolates every file, because native addons kept across files corrupt the heap. +- Slow typechecks: where supported, `pnpm tc` keeps incremental caches in `.cache/typecheck/`; delete it to force a fresh check. diff --git a/docs/readme/README.fr.md b/docs/readme/README.fr.md index 67a9b140ecb..67025f76663 100644 --- a/docs/readme/README.fr.md +++ b/docs/readme/README.fr.md @@ -249,11 +249,9 @@ Associez-la à l'app de bureau pour surveiller et piloter vos agents depuis votr - **Discord :** Rejoignez la communauté sur **[Discord](https://discord.gg/fzjDKHxv8Q)**. - **Twitter / X :** Suivez **[@orca_build](https://x.com/orca_build)** pour les news et annonces. -- **WeChat :** Scannez pour rejoindre un groupe WeChat de la communauté Orca. Si un groupe est complet, rejoignez-en un autre. +- **WeChat :** Scannez pour rejoindre un groupe WeChat de la communauté Orca. - QR code du groupe WeChat de la communauté Orca - QR code du groupe WeChat de la communauté Orca - QR code du groupe WeChat de la communauté Orca + QR code du groupe WeChat de la communauté Orca - **Feedback & idées :** On ship vite. Il manque quelque chose ? [Demandez une feature](https://github.com/stablyai/orca/issues). - **Confidentialité :** Voir la [doc confidentialité & télémétrie](https://www.onorca.dev/docs/telemetry) pour ce qu'Orca collecte en anonyme et comment désactiver la télémétrie. diff --git a/docs/readme/README.ko.md b/docs/readme/README.ko.md index 02ceb179d9c..d44ef909489 100644 --- a/docs/readme/README.ko.md +++ b/docs/readme/README.ko.md @@ -244,11 +244,9 @@ yay -S stably-orca-bin - **Discord:** **[Discord](https://discord.gg/fzjDKHxv8Q)** 커뮤니티에 참여하세요. - **Twitter / X:** 업데이트와 공지는 **[@orca_build](https://x.com/orca_build)** 를 팔로우하세요. -- **WeChat:** QR 코드를 스캔해 Orca 커뮤니티 WeChat 그룹에 참여하세요. 한 그룹이 가득 찼다면 다른 그룹에 참여하세요. +- **WeChat:** QR 코드를 스캔해 Orca 커뮤니티 WeChat 그룹에 참여하세요. - Orca 커뮤니티 WeChat 그룹 QR 코드 - Orca 커뮤니티 WeChat 그룹 QR 코드 - Orca 커뮤니티 WeChat 그룹 QR 코드 + Orca 커뮤니티 WeChat 그룹 QR 코드 - **피드백과 아이디어:** 우리는 빠르게 출시합니다. 필요한 기능이 있나요? [새 기능을 요청](https://github.com/stablyai/orca/issues)하세요. - **개인정보 보호:** Orca가 수집하는 익명 사용 데이터와 수집 거부 방법은 [개인정보 및 텔레메트리 문서](https://www.onorca.dev/docs/telemetry)를 참고하세요. diff --git a/docs/readme/README.ru.md b/docs/readme/README.ru.md index b9f35580121..576d8250409 100644 --- a/docs/readme/README.ru.md +++ b/docs/readme/README.ru.md @@ -245,11 +245,9 @@ yay -S stably-orca-bin - **Discord:** Присоединяйтесь к сообществу в **[Discord](https://discord.gg/fzjDKHxv8Q)**. - **Twitter / X:** Подпишитесь на **[@orca_build](https://x.com/orca_build)**, чтобы узнавать об обновлениях и анонсах. -- **WeChat:** Отсканируйте QR-код, чтобы присоединиться к группе сообщества Orca в WeChat. Если одна группа заполнена, присоединяйтесь к другой. +- **WeChat:** Отсканируйте QR-код, чтобы присоединиться к группе сообщества Orca в WeChat. - QR-код группы сообщества Orca в WeChat - QR-код группы сообщества Orca в WeChat - QR-код группы сообщества Orca в WeChat + QR-код группы сообщества Orca в WeChat - **Отзывы и идеи:** Мы быстро выпускаем обновления. Чего-то не хватает? [Предложите новую возможность](https://github.com/stablyai/orca/issues). - **Конфиденциальность:** В [документации о конфиденциальности и телеметрии](https://www.onorca.dev/docs/telemetry) описано, какие анонимные данные об использовании собирает Orca и как отказаться от их сбора. diff --git a/docs/readme/README.tr.md b/docs/readme/README.tr.md index de57ef3c8a4..c3952fa63b8 100644 --- a/docs/readme/README.tr.md +++ b/docs/readme/README.tr.md @@ -242,11 +242,9 @@ Ajanlarınızı telefonunuzdan izlemek ve yönlendirmek için masaüstü uygulam - **Discord:** Topluluğa **[Discord](https://discord.gg/fzjDKHxv8Q)** üzerinden katılın. - **Twitter / X:** Güncellemeler ve duyurular için **[@orca_build](https://x.com/orca_build)** hesabını takip edin. -- **WeChat:** Orca topluluğunun bir WeChat grubuna katılmak için karekodu okutun. Bir grup doluysa başka bir gruba katılabilirsiniz. +- **WeChat:** Orca topluluğunun bir WeChat grubuna katılmak için karekodu okutun. - Orca topluluğunun WeChat grubu karekodu - Orca topluluğunun WeChat grubu karekodu - Orca topluluğunun WeChat grubu karekodu + Orca topluluğunun WeChat grubu karekodu - **Geri bildirim ve fikirler:** Hızlı sürüm çıkarıyoruz. Eksik bulduğunuz bir şey mi var? [Yeni bir özellik isteyin](https://github.com/stablyai/orca/issues). - **Gizlilik:** Orca'nın hangi anonim kullanım verisini topladığını ve bunu nasıl kapatacağınızı [gizlilik ve telemetri dokümanlarında](https://www.onorca.dev/docs/telemetry) bulabilirsiniz. diff --git a/docs/readme/README.zh-CN.md b/docs/readme/README.zh-CN.md index 4d9dea01319..20cfaae5e8d 100644 --- a/docs/readme/README.zh-CN.md +++ b/docs/readme/README.zh-CN.md @@ -242,11 +242,9 @@ yay -S stably-orca-bin - **Discord:** 加入 **[Discord](https://discord.gg/fzjDKHxv8Q)** 社区。 - **Twitter / X:** 关注 **[@orca_build](https://x.com/orca_build)** 获取更新和公告。 -- **微信:** 扫码加入 Orca 社区微信群。如果一个群已满,可以加入其他群。 +- **微信:** 扫码加入 Orca 社区微信群。 - Orca 社区微信群二维码 - Orca 社区微信群二维码 - Orca 社区微信群二维码 + Orca 社区微信群二维码 - **反馈与想法:** 我们发布很快。缺少什么功能?[提交功能请求](https://github.com/stablyai/orca/issues)。 - **隐私:** 查看[隐私与遥测文档](https://www.onorca.dev/docs/telemetry),了解 Orca 收集哪些匿名使用数据以及如何退出。 diff --git a/docs/reference/plugin-host-api.md b/docs/reference/plugin-host-api.md index 87dee966b62..b0f38a0930d 100644 --- a/docs/reference/plugin-host-api.md +++ b/docs/reference/plugin-host-api.md @@ -2,7 +2,7 @@ -Host API 1.5 (`"pluginApi": 1`). Workers call a method with `await orca.host.call(name, params)`; panels and custom editors call the same methods through `window.orca.host.call(name, params)`. Each method lists the surfaces allowed to call it; any other surface gets `not_permitted`. `orca.host.has(name)` answers synchronously whether this Orca offers a method on the current surface, and `orca.api` is `{ major, minor }`. See [Plugin authoring](./plugin-authoring.md) for the frame API. +Host API 1.6 (`"pluginApi": 1`). Workers call a method with `await orca.host.call(name, params)`; panels and custom editors call the same methods through `window.orca.host.call(name, params)`. Each method lists the surfaces allowed to call it; any other surface gets `not_permitted`. `orca.host.has(name)` answers synchronously whether this Orca offers a method on the current surface, and `orca.api` is `{ major, minor }`. See [Plugin authoring](./plugin-authoring.md) for the frame API. Every call is checked against the capabilities the user approved, and params are validated before Orca runs anything: params are strict, so a field this Orca does not know is refused with `invalid_params` instead of being dropped. Mutations are recorded in the audit log as `plugin:.`. @@ -29,7 +29,7 @@ Methods whose capability is `none` need no capability but still need the plugin | [`files.saveAs`](#filessaveas) | none | panel, editor | yes | 1.1 | Offers data (a string or ArrayBuffer, up to 64 MiB) in Orca's save dialog; the plugin never learns the path. Needs a click or key press in the frame; desktop app only. | | [`plugin.request`](#pluginrequest) | none | panel, editor | no | 1.2 | Asks the plugin's own worker to run the handler it registered with `orca.panels.handle(name)`, starting the worker if needed; resolves with what the handler returned. `unknown_method` when no handler has that name. | | [`agents.list`](#agentslist) | `agent:read` | worker, panel, editor | no | 1.2 | The agents in the focused workspace: their terminal, title, agent kind and status. `agent.status.changed` reports each change after. | -| [`events.subscribe`](#eventssubscribe) | none | panel, editor | no | 1.2 | Delivers a workspace or agent event to this panel as `orca.on(event)`; needs the event's read capability. The frame APIs call it for you. | +| [`events.subscribe`](#eventssubscribe) | none | panel, editor | no | 1.2 | Delivers a workspace, agent or editor event to this panel as `orca.on(event)`; needs the event's read capability, when it has one. The frame APIs call it for you. | | [`statusBar.update`](#statusbarupdate) | none | worker | no | 1.2 | Changes one of the plugin's `contributes.statusBarItems` (named by `id`): fields given replace their current value, `visible: false` hides it. Desktop app only; lasts until Orca restarts, and is hidden while the plugin is disabled. A plugin with `main` and status bar items has its worker started when it is enabled and kept running while it stays enabled, so a worker can poll and update its items without an event or a hook. | | [`appearance.read`](#appearanceread) | `appearance:write` | worker | no | 1.4 | Reads the current desktop appearance revision for a conditional update. | | [`appearance.apply`](#appearanceapply) | `appearance:write` | worker | yes | 1.4 | Publishes owned app/editor and terminal colors and selects them in the desktop. Returns publication, not renderer acknowledgement. | @@ -41,6 +41,7 @@ Methods whose capability is `none` need no capability but still need the plugin | [`agent.launch`](#agentlaunch) | `agent:launch` | worker | yes | 1.3 | Starts an agent's CLI in a new terminal of a workspace, in the background, and returns as soon as it starts; a `prompt` is sent once the agent is ready. | | [`editor.open`](#editoropen) | `workspace:write` | worker | yes | 1.3 | Opens a file of a workspace in an editor tab of Orca's window; desktop app only. `workspace.open` shows the workspace. | | [`commands.run`](#commandsrun) | `workspace:write` | worker | yes | 1.3 | Runs one of Orca's built-in actions in its window, never a plugin's replacement of it; desktop app only. | +| [`editor.readTypography`](#editorreadtypography) | none | worker, panel, editor | no | 1.6 | The font family, size, weight, line height, ligatures, word wrap and minimap Orca's file editor uses now, editor zoom included. `editor.typography.changed` reports each change after. | ### `workspace.readContext` @@ -180,10 +181,10 @@ The agents in the focused workspace: their terminal, title, agent kind and statu ### `events.subscribe` -Delivers a workspace or agent event to this panel as `orca.on(event)`; needs the event's read capability. The frame APIs call it for you. +Delivers a workspace, agent or editor event to this panel as `orca.on(event)`; needs the event's read capability, when it has one. The frame APIs call it for you. ```ts -(params: { event: "workspace.created" | "workspace.removed" | "agent.status.changed" | "workspace.changed" }) => { ok: true } +(params: { event: "workspace.created" | "workspace.removed" | "agent.status.changed" | "workspace.changed" | "editor.typography.changed" }) => { ok: true } ``` ### `statusBar.update` @@ -274,9 +275,17 @@ Runs one of Orca's built-in actions in its window, never a plugin's replacement (params: { action: "worktree.history.back" | "worktree.history.forward" | "sidebar.left.toggle" | "sidebar.sleepingWorkspaces.toggle" | "floatingWorkspace.maximize" | "tab.rename" | "workspace.rename" | "workspace.openBoard" | "view.tasks" | "sidebar.right.toggle" | "sidebar.explorer.toggle" | "sidebar.search.toggle" | "sidebar.sourceControl.toggle" | "sidebar.checks.toggle" | "sidebar.ports.toggle" }) => { ran: true } ``` +### `editor.readTypography` + +The font family, size, weight, line height, ligatures, word wrap and minimap Orca's file editor uses now, editor zoom included. `editor.typography.changed` reports each change after. + +```ts +(params?: {}) => { fontFamily: string; cssFontFamily: string; fontSize: number; fontWeight: string; lineHeight: number; fontLigatures: boolean; wordWrap: "on" | "off"; minimap: boolean } +``` + ## Events -A worker receives the events its manifest lists in `contributes.events` through `orca.events.on(event, handler)`, which returns `{ dispose() }`. Each needs `main`, the `trusted-worker` profile and its domain's capability (`workspace:read` or `agent:read`). `orca plugin types` writes the payloads as `PluginEvents` in `orca/host`. +A worker receives the events its manifest lists in `contributes.events` through `orca.events.on(event, handler)`, which returns `{ dispose() }`. Each needs `main`, the `trusted-worker` profile and its domain's capability (`workspace:read` or `agent:read`; editor events need none). `orca plugin types` writes the payloads as `PluginEvents` in `orca/host`. | Event | Payload | Summary | | --- | --- | --- | @@ -284,6 +293,7 @@ A worker receives the events its manifest lists in `contributes.events` through | `workspace.removed` | `{ workspaceId: string; kind: "worktree" \| "folder"; path: string }` | A worktree workspace was removed. | | `agent.status.changed` | `{ workspaceId: string \| null; paneKey: string; terminalId?: string; title?: string; state: "working" \| "blocked" \| "waiting" \| "done"; receivedAt: number; mainAgent?: { state: "working" \| "blocked" \| "waiting" \| "done"; outcome?: "success" \| "failure" \| "cancellation" \| "superseded" \| "interruption" \| "unconfirmed"; stateStartedAt: number } }` | An agent in a terminal pane changed status; `workspaceId` is null when Orca cannot tie the pane to a workspace, and `terminalId` names its terminal when Orca lists it. | | `workspace.changed` | `{ context: { branch: string; displayName: string; terminals: { id: string; title?: string }[] } \| null }` | The focused workspace changed, or its terminals were opened, closed or renamed; `context` is what `workspace.readContext` now answers. Each new subscriber first gets the current context. | +| `editor.typography.changed` | `{ fontFamily: string; cssFontFamily: string; fontSize: number; fontWeight: string; lineHeight: number; fontLigatures: boolean; wordWrap: "on" \| "off"; minimap: boolean }` | What Orca's file editor uses changed (a setting or the editor zoom); the payload is what `editor.readTypography` now answers. Needs no capability. | ## Hooks diff --git a/docs/reference/plugin-manifest.md b/docs/reference/plugin-manifest.md index dd085638f00..a257a924c7c 100644 --- a/docs/reference/plugin-manifest.md +++ b/docs/reference/plugin-manifest.md @@ -32,7 +32,7 @@ Add `"$schema": "https://raw.githubusercontent.com/stablyai/orca/main/docs/schem | `contributes` | object | no | 1.4.160 | What the plugin adds to Orca. Every point defaults to empty. | | `contributes.panels` | [PanelContribution](#panelcontribution)[] | no | 1.4.160 | Sidebar panels. At most 64. | | `contributes.commands` | [CommandContribution](#commandcontribution)[] | no | 1.4.160 | Command palette entries. At most 256. | -| `contributes.events` | [EventContribution](#eventcontribution)[] | no | 1.4.160 | Events delivered to the plugin worker. At most 4. | +| `contributes.events` | [EventContribution](#eventcontribution)[] | no | 1.4.160 | Events delivered to the plugin worker. At most 5. | | `contributes.hooks` | [HookContribution](#hookcontribution)[] | no | 1.4.248 | Hooks the worker runs before or after Orca acts; Orca waits only on plugins that list one. At most 8. | | `contributes.languagePacks` | [LanguagePackContribution](#languagepackcontribution)[] | no | 1.4.160 | Interface translations. At most 16. | | `contributes.keybindings` | [KeybindingContribution](#keybindingcontribution)[] | no | 1.4.160 | Keyboard shortcuts for contributed commands. At most 256. | @@ -85,11 +85,11 @@ A command palette entry. Requires the `declarative` execution profile or higher. ## EventContribution -An event subscription. Requires `main`, the `trusted-worker` execution profile and the capability of the event's domain: `workspace:read` for workspace events, `agent:read` for agent events. +An event subscription. Requires `main`, the `trusted-worker` execution profile and the capability of the event's domain: `workspace:read` for workspace events, `agent:read` for agent events. Editor events need no capability. | Field | Type | Required | Since | Description | | --- | --- | --- | --- | --- | -| `on` | `"workspace.created"` \| `"workspace.removed"` \| `"agent.status.changed"` \| `"workspace.changed"` | yes | 1.4.160 | Event delivered to the plugin worker. | +| `on` | `"workspace.created"` \| `"workspace.removed"` \| `"agent.status.changed"` \| `"workspace.changed"` \| `"editor.typography.changed"` | yes | 1.4.160 | Event delivered to the plugin worker. | ## HookContribution diff --git a/docs/schemas/plugins/orca-plugin.v2.schema.json b/docs/schemas/plugins/orca-plugin.v2.schema.json index 28b4a822243..665f0887bee 100644 --- a/docs/schemas/plugins/orca-plugin.v2.schema.json +++ b/docs/schemas/plugins/orca-plugin.v2.schema.json @@ -208,9 +208,9 @@ }, "events": { "default": [], - "description": "Events delivered to the plugin worker. At most 4.", + "description": "Events delivered to the plugin worker. At most 5.", "x-orca-since": "1.4.160", - "maxItems": 4, + "maxItems": 5, "type": "array", "items": { "$ref": "#/$defs/EventContribution" @@ -736,7 +736,8 @@ "workspace.created", "workspace.removed", "agent.status.changed", - "workspace.changed" + "workspace.changed", + "editor.typography.changed" ], "description": "Event delivered to the plugin worker.", "x-orca-since": "1.4.160", @@ -744,7 +745,8 @@ "workspace.created": "1.4.245", "workspace.removed": "1.4.245", "agent.status.changed": "1.4.160", - "workspace.changed": "1.4.246" + "workspace.changed": "1.4.246", + "editor.typography.changed": "1.4.256" } } }, @@ -752,7 +754,7 @@ "on" ], "additionalProperties": false, - "description": "An event subscription. Requires `main`, the `trusted-worker` execution profile and the capability of the event's domain: `workspace:read` for workspace events, `agent:read` for agent events." + "description": "An event subscription. Requires `main`, the `trusted-worker` execution profile and the capability of the event's domain: `workspace:read` for workspace events, `agent:read` for agent events. Editor events need no capability." }, "HookContribution": { "type": "object", diff --git a/docs/styleguide/native-chat.md b/docs/styleguide/native-chat.md index 69600d8d006..4d367ca879e 100644 --- a/docs/styleguide/native-chat.md +++ b/docs/styleguide/native-chat.md @@ -27,4 +27,4 @@ The chat root (`.native-chat-appearance`) redefines these steps as ratios of the - **Focus rings:** full-width transcript rows use the inset ring (`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`) so it isn't clipped by the scroll container; standalone controls use `focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`. Inside the chat `--ring` is `--chat-focus-ring`, which clears 3:1 on the canvas; don't lower its opacity. - **Theme overrides:** plugin themes can set `--chat-bold-foreground`, `--chat-muted-foreground`, `--chat-inline-code`, `--chat-inline-code-foreground`, `--chat-code-block`, `--chat-selection` and `--chat-selection-foreground`. They feed `text-chat-foreground-faint`, `bg-chat-inline-code-surface`, `bg-chat-code-surface` and the chat root's `::selection`, so use those rather than reading the theme tokens directly. - **Selection** inside the chat is the link hue mixed into the canvas (close to the system highlight), with selected text in the full foreground so every role stays 4.5:1. Don't add per-component `selection:` colors in transcript text. -- **State colours:** warnings use `text-chat-warning`; diff lines use `text-chat-diff-added` / `text-chat-diff-removed`. They are mixed toward the foreground so they pass text contrast in light and dark. Don't use raw palette colours (`text-yellow-500`) or the git decoration tokens for text on a tinted row. +- **State colours:** warnings use `text-chat-warning`; diff lines use `text-chat-diff-added` / `text-chat-diff-removed`; what the reader has not seen yet uses `text-chat-unread`. They are mixed toward the foreground so they pass text contrast in light and dark. Don't use raw palette colours (`text-yellow-500`) or the git decoration tokens for text on a tinted row. diff --git a/mobile/app.json b/mobile/app.json index 8158d4193f5..af0c265fad7 100644 --- a/mobile/app.json +++ b/mobile/app.json @@ -114,6 +114,7 @@ "./plugins/android-window-density.js", "./plugins/android-release-signing.js", "./plugins/android-navigation-bar-theme.js", + "./plugins/android-device-transfer-rules.js", "./plugins/ios-pod-deployment-target-floor.js", "./plugins/ios-scene-lifecycle.js", "./plugins/ios-bundle-phase-quoted-script-path.js", diff --git a/mobile/app/_layout.tsx b/mobile/app/_layout.tsx index ba532452c05..4ac8bba5cdb 100644 --- a/mobile/app/_layout.tsx +++ b/mobile/app/_layout.tsx @@ -27,7 +27,7 @@ import { } from '../src/notifications/push-receive' import { startPushTokenSync } from '../src/notifications/push-registration' import { ensureDesktopNotificationChannel } from '../src/notifications/desktop-notification-channel' -import { loadHostCatalog } from '../src/transport/hosts/host-store' +import { loadHostCatalog } from '../src/host-catalog/host-store' import { usePairingLinks } from '../src/navigation/use-pairing-links' import { consumeInitialLaunchIntent } from '../src/navigation/initial-launch-intent' import { recoverMobileRelayPairing } from '../src/pairing/mobile-relay-pairing-recovery' diff --git a/mobile/app/connection-log.tsx b/mobile/app/connection-log.tsx index 8fbcd0057fa..addd3b182b5 100644 --- a/mobile/app/connection-log.tsx +++ b/mobile/app/connection-log.tsx @@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useState, useSyncExternalStore } from import { View, Text, Pressable } from 'react-native' import { useLocalSearchParams, useRouter } from 'expo-router' import * as Clipboard from 'expo-clipboard' -import { loadHosts } from '../src/transport/hosts/host-store' +import { loadHosts } from '../src/host-catalog/host-store' import { connectionLogStore } from '../src/diagnostics/connection/persisted-connection-log-store' import { useRpcClientContext } from '../src/transport/connection/client-context' import { useHostClient } from '../src/transport/connection/host-client-hooks' @@ -22,7 +22,7 @@ import { connectionDiagnosticsScreenStyles as styles } from '../src/diagnostics/ import { useMobileColorScheme } from '../src/theme/use-mobile-color-scheme' import { NATIVE_APP_LOG_ID } from '../src/diagnostics/native-render-log' import type { ConnectionLogEntry } from '../src/diagnostics/connection/connection-log-types' -import type { HostProfile } from '../src/transport/hosts/host-profile' +import type { HostProfile } from '../src/host-catalog/host-profile' import { pressedStyle } from '../src/theme/mobile-theme' // Keep empty snapshot identity stable or useSyncExternalStore rerenders forever. diff --git a/mobile/app/h/[hostId]/edit.tsx b/mobile/app/h/[hostId]/edit.tsx index 38dc364e575..acd13c84186 100644 --- a/mobile/app/h/[hostId]/edit.tsx +++ b/mobile/app/h/[hostId]/edit.tsx @@ -18,7 +18,7 @@ import { NavBar } from '../../../src/components/nav-bar/NavBar' import { NavBarButton } from '../../../src/components/nav-bar/NavBarButton' import { themedStyleSheet } from '../../../src/theme/themed-styles' import { useMobileColorScheme } from '../../../src/theme/use-mobile-color-scheme' -import { loadHosts, updateHostNameAndEndpoint } from '../../../src/transport/hosts/host-store' +import { loadHosts, updateHostNameAndEndpoint } from '../../../src/host-catalog/host-store' import { displayHostEndpoint } from '../../../src/transport/hosts/host-endpoint' import { resolveHostEndpointEdit } from '../../../src/transport/hosts/host-endpoint-edit' import { @@ -26,12 +26,12 @@ import { usePrimeHosts, useRefreshHostClient } from '../../../src/transport/connection/host-client-hooks' -import { removeHostAndCloseClient } from '../../../src/transport/hosts/host-removal-lifecycle' -import { useHostDisplay } from '../../../src/transport/hosts/use-host-display' +import { removeHostAndCloseClient } from '../../../src/host-catalog/host-removal-lifecycle' +import { useHostDisplay } from '../../../src/host-descriptors/use-host-display' import { leaveHostRoute } from '../../../src/host-route-exit' import { ConfirmModal } from '../../../src/components/ConfirmModal' import { ListGroup, ListRow } from '../../../src/components/list/ListGroup' -import type { HostProfile } from '../../../src/transport/hosts/host-profile' +import type { HostProfile } from '../../../src/host-catalog/host-profile' import { hostOs } from '../../../src/platform/host-os' import { translate } from '../../../src/i18n/mobile-i18n' import { useMobileTranslation } from '../../../src/i18n/use-mobile-translation' diff --git a/mobile/app/terminal-settings.tsx b/mobile/app/terminal-settings.tsx index fbd32b1b284..ef85607d591 100644 --- a/mobile/app/terminal-settings.tsx +++ b/mobile/app/terminal-settings.tsx @@ -12,8 +12,8 @@ import { colors, spacing } from '../src/theme/mobile-theme' import { useMobileColorScheme } from '../src/theme/use-mobile-color-scheme' import type { Translate } from '../src/i18n/mobile-i18n' import { useMobileTranslation } from '../src/i18n/use-mobile-translation' -import { loadHosts, peekHosts } from '../src/transport/hosts/host-store' -import type { HostProfile } from '../src/transport/hosts/host-profile' +import { loadHosts, peekHosts } from '../src/host-catalog/host-store' +import type { HostProfile } from '../src/host-catalog/host-profile' import { useFocusedSettingsHostClients } from '../src/settings/settings-host-client-connections' import type { RpcClient } from '../src/transport/rpc/rpc-client-contract' import { LIST_LEADING_INSET, ListRow } from '../src/components/list/ListGroup' diff --git a/mobile/app/voice-settings.tsx b/mobile/app/voice-settings.tsx index ef3a48ea832..3bdb0a66df0 100644 --- a/mobile/app/voice-settings.tsx +++ b/mobile/app/voice-settings.tsx @@ -1,7 +1,7 @@ import { useEffect, useMemo, useState } from 'react' import { useRouter } from 'expo-router' -import { loadHosts, peekHosts } from '../src/transport/hosts/host-store' -import type { HostProfile } from '../src/transport/hosts/host-profile' +import { loadHosts, peekHosts } from '../src/host-catalog/host-store' +import type { HostProfile } from '../src/host-catalog/host-profile' import { useFocusedSettingsHostClients } from '../src/settings/settings-host-client-connections' import VoiceSettingsScreen from '../src/settings/voice-settings-screen' import { nativeVoiceSettingsOperations } from '../src/settings/native-voice-settings-operations' diff --git a/mobile/modules/orca-gzip-utf8-codec/android/build.gradle b/mobile/modules/orca-gzip-utf8-codec/android/build.gradle index 35667d48346..59674abee85 100644 --- a/mobile/modules/orca-gzip-utf8-codec/android/build.gradle +++ b/mobile/modules/orca-gzip-utf8-codec/android/build.gradle @@ -15,6 +15,8 @@ android { } dependencies { + // Android ships no brotli decoder; Google's pure-Java one, as okhttp-brotli uses. + implementation 'org.brotli:dec:0.1.2' testImplementation 'junit:junit:4.13.2' // The android.jar used by JVM unit tests stubs org.json; the shared vectors are JSON. testImplementation 'org.json:json:20240303' diff --git a/mobile/modules/orca-gzip-utf8-codec/android/src/main/java/expo/modules/orcagziputf8codec/BoundedBrotli.kt b/mobile/modules/orca-gzip-utf8-codec/android/src/main/java/expo/modules/orcagziputf8codec/BoundedBrotli.kt new file mode 100644 index 00000000000..ea7ace90661 --- /dev/null +++ b/mobile/modules/orca-gzip-utf8-codec/android/src/main/java/expo/modules/orcagziputf8codec/BoundedBrotli.kt @@ -0,0 +1,31 @@ +package expo.modules.orcagziputf8codec + +import java.io.ByteArrayInputStream +import java.io.IOException +import org.brotli.dec.BrotliInputStream + +class BoundedBrotliException(message: String) : Exception(message) + +/** Inflate one brotli stream into at most outputLimit bytes; callers pass one byte beyond the length they + * accept and check the result's length and hash, so truncated or overlong input fails there. */ +fun brotliDecompressBounded(input: ByteArray, outputLimit: Int): ByteArray { + if (outputLimit <= 0 || input.isEmpty()) { + throw BoundedBrotliException("nothing to inflate") + } + val output = ByteArray(outputLimit) + var produced = 0 + try { + BrotliInputStream(ByteArrayInputStream(input)).use { stream -> + while (produced < outputLimit) { + val count = stream.read(output, produced, outputLimit - produced) + if (count < 0) { + break + } + produced += count + } + } + } catch (error: IOException) { + throw BoundedBrotliException(error.message ?: "invalid brotli data") + } + return if (produced == outputLimit) output else output.copyOf(produced) +} diff --git a/mobile/modules/orca-gzip-utf8-codec/android/src/main/java/expo/modules/orcagziputf8codec/OrcaGzipUtf8CodecModule.kt b/mobile/modules/orca-gzip-utf8-codec/android/src/main/java/expo/modules/orcagziputf8codec/OrcaGzipUtf8CodecModule.kt index f46cd77562e..e9f8edf4a4c 100644 --- a/mobile/modules/orca-gzip-utf8-codec/android/src/main/java/expo/modules/orcagziputf8codec/OrcaGzipUtf8CodecModule.kt +++ b/mobile/modules/orca-gzip-utf8-codec/android/src/main/java/expo/modules/orcagziputf8codec/OrcaGzipUtf8CodecModule.kt @@ -15,5 +15,10 @@ class OrcaGzipUtf8CodecModule : Module() { Function("decodeUtf8") { input: ByteArray -> decodeStrictUtf8(input) } + + // Async: a whole bundle asset can take tens of ms, too long to hold the JS thread. + AsyncFunction("brotliDecompress") { input: ByteArray, outputLimit: Int -> + brotliDecompressBounded(input, outputLimit) + } } } diff --git a/mobile/modules/orca-gzip-utf8-codec/ios/BoundedBrotli.swift b/mobile/modules/orca-gzip-utf8-codec/ios/BoundedBrotli.swift new file mode 100644 index 00000000000..3e7c3c359e9 --- /dev/null +++ b/mobile/modules/orca-gzip-utf8-codec/ios/BoundedBrotli.swift @@ -0,0 +1,28 @@ +import Compression +import Foundation + +struct BoundedBrotliError: Error, CustomStringConvertible { + let description: String +} + +/// Inflate one brotli stream into at most outputLimit bytes; callers pass one byte beyond the length they +/// accept and check the result's length and hash. Compression returns nothing for a stream that is invalid, +/// truncated or longer than the buffer, so all three throw here. +func brotliDecompressBounded(_ input: Data, outputLimit: Int) throws -> Data { + guard outputLimit > 0, !input.isEmpty else { + throw BoundedBrotliError(description: "nothing to inflate") + } + var output = Data(count: outputLimit) + let produced = input.withUnsafeBytes { (inBytes: UnsafeRawBufferPointer) -> Int in + output.withUnsafeMutableBytes { (outBytes: UnsafeMutableRawBufferPointer) -> Int in + compression_decode_buffer( + outBytes.bindMemory(to: UInt8.self).baseAddress!, outputLimit, + inBytes.bindMemory(to: UInt8.self).baseAddress!, inBytes.count, + nil, COMPRESSION_BROTLI) + } + } + guard produced > 0 else { + throw BoundedBrotliError(description: "not a whole brotli stream within the output limit") + } + return produced == outputLimit ? output : output.prefix(produced) +} diff --git a/mobile/modules/orca-gzip-utf8-codec/ios/OrcaGzipUtf8Codec.podspec b/mobile/modules/orca-gzip-utf8-codec/ios/OrcaGzipUtf8Codec.podspec index 747a17b46d5..61ddefce0c5 100644 --- a/mobile/modules/orca-gzip-utf8-codec/ios/OrcaGzipUtf8Codec.podspec +++ b/mobile/modules/orca-gzip-utf8-codec/ios/OrcaGzipUtf8Codec.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'OrcaGzipUtf8Codec' s.version = '0.0.1' - s.summary = 'Bounded gunzip and strict UTF-8 decode' + s.summary = 'Bounded gunzip and brotli inflate, and strict UTF-8 decode' s.description = s.summary s.license = { :type => 'MIT' } s.author = 'Orca' @@ -11,6 +11,6 @@ Pod::Spec.new do |s| s.swift_version = '5.9' s.static_framework = true s.dependency 'ExpoModulesCore' - s.libraries = 'z' + s.libraries = 'z', 'compression' s.source_files = '**/*.swift' end diff --git a/mobile/modules/orca-gzip-utf8-codec/ios/OrcaGzipUtf8CodecModule.swift b/mobile/modules/orca-gzip-utf8-codec/ios/OrcaGzipUtf8CodecModule.swift index a3d5c24c168..d13edb8135a 100644 --- a/mobile/modules/orca-gzip-utf8-codec/ios/OrcaGzipUtf8CodecModule.swift +++ b/mobile/modules/orca-gzip-utf8-codec/ios/OrcaGzipUtf8CodecModule.swift @@ -12,5 +12,10 @@ public class OrcaGzipUtf8CodecModule: Module { Function("decodeUtf8") { (input: Data) -> String? in decodeStrictUtf8(input) } + + // Async: a whole bundle asset can take tens of ms, too long to hold the JS thread. + AsyncFunction("brotliDecompress") { (input: Data, outputLimit: Int) throws -> Data in + try brotliDecompressBounded(input, outputLimit: outputLimit) + } } } diff --git a/mobile/modules/orca-gzip-utf8-codec/src/index.ts b/mobile/modules/orca-gzip-utf8-codec/src/index.ts index 7eea6332bbc..e97477f6637 100644 --- a/mobile/modules/orca-gzip-utf8-codec/src/index.ts +++ b/mobile/modules/orca-gzip-utf8-codec/src/index.ts @@ -5,6 +5,8 @@ export type OrcaGzipUtf8CodecModule = { gunzip(input: Uint8Array, outputLimit: number): Uint8Array /** Well-formed UTF-8 with no leading BOM, decoded; null otherwise. */ decodeUtf8(input: Uint8Array): string | null + /** Inflate one brotli stream into at most outputLimit bytes, off the JS thread; throws on bad input. */ + brotliDecompress(input: Uint8Array, outputLimit: number): Promise> } /** Null in a binary built before the module existed. */ diff --git a/mobile/modules/orca-mobile-web-shell/android/src/main/java/expo/modules/orcamobilewebshell/OrcaMobileWebShellModule.kt b/mobile/modules/orca-mobile-web-shell/android/src/main/java/expo/modules/orcamobilewebshell/OrcaMobileWebShellModule.kt index 81e5a16133a..abba9fd7675 100644 --- a/mobile/modules/orca-mobile-web-shell/android/src/main/java/expo/modules/orcamobilewebshell/OrcaMobileWebShellModule.kt +++ b/mobile/modules/orca-mobile-web-shell/android/src/main/java/expo/modules/orcamobilewebshell/OrcaMobileWebShellModule.kt @@ -13,6 +13,7 @@ import expo.modules.kotlin.exception.Exceptions import expo.modules.kotlin.functions.Queues import expo.modules.kotlin.modules.Module import expo.modules.kotlin.modules.ModuleDefinition +import java.io.File class OrcaMobileWebShellModule : Module() { private val main = Handler(Looper.getMainLooper()) @@ -57,6 +58,16 @@ class OrcaMobileWebShellModule : Module() { discardSpare() } + // Page builds live in filesDir: "Clear cache", cleaner apps and low storage empty cacheDir, which cost a full + // download on the next open. allowBackup false and the device-transfer rules keep them on this phone. + Function("generationStoreDirectory") { name: String -> + val filesDir = appContext.reactContext?.filesDir ?: throw Exceptions.ReactContextLost() + val directory = File(filesDir, name) + // A full disk can refuse the folder; the caller then keeps the old root. + if (!directory.mkdirs() && !directory.isDirectory) throw UnableToCreateGenerationStoreException() + Uri.fromFile(directory).toString() + } + AsyncFunction("prepareSpareDocument") { directory: String, sessionId: String -> val activity = appContext.currentActivity ?: return@AsyncFunction false MobileWebShellSparePool.prepare(activity, directory, sessionId) @@ -124,3 +135,6 @@ class OrcaMobileWebShellModule : Module() { } } } + +private class UnableToCreateGenerationStoreException : + CodedException("The page build folder could not be created") diff --git a/mobile/modules/orca-mobile-web-shell/ios/MobileWebShellGenerationStoreDirectory.swift b/mobile/modules/orca-mobile-web-shell/ios/MobileWebShellGenerationStoreDirectory.swift new file mode 100644 index 00000000000..c99bd8c73e2 --- /dev/null +++ b/mobile/modules/orca-mobile-web-shell/ios/MobileWebShellGenerationStoreDirectory.swift @@ -0,0 +1,15 @@ +import Foundation + +/// Application Support, which iOS never purges; the builds can be downloaded again, so backups skip them. +enum MobileWebShellGenerationStoreDirectory { + static func prepare(name: String) throws -> String { + var directory = try FileManager.default + .url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true) + .appendingPathComponent(name, isDirectory: true) + try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true) + var values = URLResourceValues() + values.isExcludedFromBackup = true + try directory.setResourceValues(values) + return directory.absoluteString + } +} diff --git a/mobile/modules/orca-mobile-web-shell/ios/OrcaMobileWebShellModule.swift b/mobile/modules/orca-mobile-web-shell/ios/OrcaMobileWebShellModule.swift index ba18966b711..fe4a3d22551 100644 --- a/mobile/modules/orca-mobile-web-shell/ios/OrcaMobileWebShellModule.swift +++ b/mobile/modules/orca-mobile-web-shell/ios/OrcaMobileWebShellModule.swift @@ -47,6 +47,11 @@ public class OrcaMobileWebShellModule: Module { MobileWebShellSparePool.shared.discardAll() }.runOnQueue(.main) + // The generation store's root as a file URL, created and excluded from backups. + Function("generationStoreDirectory") { (name: String) throws -> String in + try MobileWebShellGenerationStoreDirectory.prepare(name: name) + } + // Home calls this once it has a paired host, so a user with nothing to open pays nothing. Function("warmUp") { // A second's delay keeps the warm-up off the launch's first frames. diff --git a/mobile/modules/orca-mobile-web-shell/src/generation-store-directory.ts b/mobile/modules/orca-mobile-web-shell/src/generation-store-directory.ts new file mode 100644 index 00000000000..20530259298 --- /dev/null +++ b/mobile/modules/orca-mobile-web-shell/src/generation-store-directory.ts @@ -0,0 +1,14 @@ +import { requireOptionalNativeModule } from 'expo-modules-core' + +// under the app's durable storage (iOS Application Support, outside backups; Android filesDir) as a file URL. +// Null from a binary built before the function existed, or when the directory can't be made. +export function generationStoreDirectory(name: string): string | null { + const shell = requireOptionalNativeModule<{ + generationStoreDirectory?: (name: string) => string + }>('OrcaMobileWebShell') + try { + return shell?.generationStoreDirectory?.(name) ?? null + } catch { + return null + } +} diff --git a/mobile/package.json b/mobile/package.json index 7fbcd30f8b7..9e9d0097727 100644 --- a/mobile/package.json +++ b/mobile/package.json @@ -33,6 +33,7 @@ "@xterm/addon-webgl": "0.20.0-beta.329", "@xterm/xterm": "6.1.0-beta.336", "buffer": "^6.0.3", + "diff": "8.0.4", "expo": "^55.0.31", "expo-build-properties": "^55.0.18", "expo-camera": "^55.0.23", diff --git a/mobile/plugins/android-device-transfer-rules.js b/mobile/plugins/android-device-transfer-rules.js new file mode 100644 index 00000000000..48fe30fa877 --- /dev/null +++ b/mobile/plugins/android-device-transfer-rules.js @@ -0,0 +1,33 @@ +const fs = require('node:fs') +const path = require('node:path') +const { withAndroidManifest, withDangerousMod, AndroidConfig } = require('expo/config-plugins') + +// allowBackup="false" stops cloud backup but not Android 12+ device-to-device transfer, which copies filesDir. +// Page builds are re-downloadable and belong to this phone's pairings, so a new phone starts without them. +module.exports = function withAndroidDeviceTransferRules(config) { + config = withDangerousMod(config, [ + 'android', + (cfg) => { + const folder = path.join(cfg.modRequest.platformProjectRoot, 'app/src/main/res/xml') + fs.mkdirSync(folder, { recursive: true }) + fs.writeFileSync( + path.join(folder, 'data_extraction_rules.xml'), + [ + '', + '', + ' ', + ' ', + ' ', + '', + '' + ].join('\n') + ) + return cfg + } + ]) + return withAndroidManifest(config, (cfg) => { + const application = AndroidConfig.Manifest.getMainApplicationOrThrow(cfg.modResults) + application.$['android:dataExtractionRules'] = '@xml/data_extraction_rules' + return cfg + }) +} diff --git a/mobile/pnpm-lock.yaml b/mobile/pnpm-lock.yaml index fffdc5f0a6a..b4a2078a022 100644 --- a/mobile/pnpm-lock.yaml +++ b/mobile/pnpm-lock.yaml @@ -221,6 +221,9 @@ importers: buffer: specifier: ^6.0.3 version: 6.0.3 + diff: + specifier: 8.0.4 + version: 8.0.4 expo: specifier: ^55.0.31 version: 55.0.31(0def556739f9e1a9e497ee4bc3b81b41) @@ -4089,6 +4092,10 @@ packages: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + diff@8.0.4: + resolution: {integrity: sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==} + engines: {node: '>=0.3.1'} + dnssd-advertise@1.1.6: resolution: {integrity: sha512-Ndrrf6BMPalkQPd/zubL+4YghH2J9NspapQ09uDXwYbvOPkP0oaqf5CkcwJ0b50kS2O3ul6yVu+jz+RY62Cejg==} @@ -11728,6 +11735,8 @@ snapshots: diff-sequences@29.6.3: {} + diff@8.0.4: {} + dnssd-advertise@1.1.6: {} doctrine@2.1.0: diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listaccessible-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listaccessible-1.json index 1d4cbac096d..572def72fab 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listaccessible-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listaccessible-1.json @@ -4,55 +4,16 @@ "family": "tasks.project-board-load", "namedDeltas": [], "values": { - "00ef2dbe5026": { - "name": "github.project.resolveRef#1", - "ordinal": 21, - "args": [ - { - "name": "method", - "value": "github.project.resolveRef" - }, - { - "name": "params", - "value": { - "host": "github.com", - "input": "https://github.com/orgs/owner/projects/3" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-4", - "ok": true, - "result": { - "host": "github.com", - "number": 3, - "ok": true, - "owner": "owner", - "ownerType": "organization", - "title": "Board", - "viewNumber": 1 - } - } + "0056704adc0b": { + "name": "githubProjectTable", + "ordinal": 31, + "value": { + "$rpc": "null" } }, - "0388fa155721": { + "060dcedb3fdb": { "name": "githubProjectError", - "ordinal": 11, - "value": "" - }, - "03fc33b06333": { - "name": "githubProjectPasteError", - "ordinal": 17, + "ordinal": 10, "value": "" }, "0a7f23c13d0c": { @@ -90,6 +51,13 @@ } } }, + "0af48d475813": { + "name": "appliedGithubProjectSearch", + "ordinal": 29, + "value": { + "$rpc": "undefined" + } + }, "0e76d492b4f4": { "error": "", "loading": false, @@ -107,306 +75,14 @@ } ] }, - "147d0c98fb46": { - "error": "", - "loading": false, - "pasteError": "", - "projects": [], - "table": { - "$rpc": "null" - }, - "views": [] - }, - "15cb97c93333": { - "name": "github.project.listViews#1", - "ordinal": 8, - "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3}}" - }, - "170fad8cb36b": { - "name": "githubProjectPartialFailures", - "ordinal": 6, - "value": [] - }, - "1cb3b185586b": { - "name": "githubProjectLoading", - "ordinal": 31, + "0e8b33b2854d": { + "name": "showGitHubProjectPicker", + "ordinal": 21, "value": false }, - "2085118de92f": { - "name": "githubProjectError", - "ordinal": 1, - "value": "" - }, - "223225c09f07": { - "name": "githubProjectSearch", - "ordinal": 29, - "value": "" - }, - "2423ca7008fd": { + "0f1aa264f581": { "name": "github.project.viewTable#1", "ordinal": 11, - "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.viewTable\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3,\"viewId\":\"view-1\"}}" - }, - "2ab1b35ff194": { - "error": "", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "321983341043": { - "name": "github.project.listAccessible#1", - "ordinal": 3, - "args": [ - { - "name": "method", - "value": "github.project.listAccessible" - }, - { - "name": "params", - "value": { - "host": "github.com" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-1", - "ok": true, - "result": { - "error": "refused" - } - } - } - }, - "32a7c0ae7918": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "outer refused", - "isRpcDeliveryUnknown": false - } - }, - "32e88f5c4657": { - "name": "githubProjectPasteInput", - "ordinal": 21, - "value": "" - }, - "34de2d655a0a": { - "name": "githubProjectTable", - "ordinal": 32, - "value": { - "$rpc": "null" - } - }, - "376c9e8bd72a": { - "error": "", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "$rpc": "null" - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "39b306a93afc": { - "name": "githubProjectSearch", - "ordinal": 13, - "value": "is:open" - }, - "43352776b1e1": { - "name": "githubProjectTable", - "ordinal": 14, - "value": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - } - }, - "4607a82f1dd3": { - "error": "", - "loading": false, - "pasteError": "", - "projects": [], - "table": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "47507819e28a": { - "name": "githubProjectPasteInput", - "ordinal": 23, - "value": "" - }, - "4dd8cc8f777d": { - "name": "appliedGithubProjectSearch", - "ordinal": 28, - "value": { - "$rpc": "undefined" - } - }, - "4dff29ea88de": { - "name": "github.project.resolveRef#1", - "ordinal": 20, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" - }, - "4eb521bbefdd": { - "name": "githubProjectSearch", - "ordinal": 15, - "value": "is:open" - }, - "5033e4410561": { - "name": "github.project.listAccessible#1", - "ordinal": 3, - "args": [ - { - "name": "method", - "value": "github.project.listAccessible" - }, - { - "name": "params", - "value": { - "host": "github.com" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "", - "isRpcDeliveryUnknown": true - } - } - }, - "528af16518e6": { - "name": "githubProjectViews", - "ordinal": 16, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "5a4fc5c86d0c": { - "name": "githubProjectPasteBusy", - "ordinal": 34, - "value": false - }, - "5a7676ce26d6": { - "name": "githubProjectPasteBusy", - "ordinal": 32, - "value": false - }, - "5c93fbf94a2d": { - "name": "githubProjectTable", - "ordinal": 30, - "value": { - "$rpc": "null" - } - }, - "5f5f56db9d64": { - "name": "github.project.viewTable#1", - "ordinal": 12, "args": [ { "name": "method", @@ -458,15 +134,295 @@ } } }, - "61ce1ab88e79": { + "147d0c98fb46": { + "error": "", + "loading": false, + "pasteError": "", + "projects": [], + "table": { + "$rpc": "null" + }, + "views": [] + }, + "15cb97c93333": { + "name": "github.project.listViews#1", + "ordinal": 8, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3}}" + }, + "170fad8cb36b": { + "name": "githubProjectPartialFailures", + "ordinal": 6, + "value": [] + }, + "1742a082916c": { + "name": "githubProjectLoading", + "ordinal": 7, + "value": true + }, + "1b3350f71e56": { + "name": "githubProjectError", + "ordinal": 19, + "value": "" + }, + "1f4f9fd563d9": { + "name": "githubProjectError", + "ordinal": 17, + "value": "" + }, + "2085118de92f": { + "name": "githubProjectError", + "ordinal": 1, + "value": "" + }, + "26921f3a7c09": { + "name": "githubProjectPasteError", + "ordinal": 18, + "value": "" + }, + "29c85aeaeafe": { + "name": "githubProjectError", + "ordinal": 8, + "value": "" + }, + "2ab1b35ff194": { + "error": "", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "2f290fa2acf5": { + "name": "githubProjectLoading", + "ordinal": 9, + "value": true + }, + "309bbebe1e4b": { + "name": "githubProjectTable", + "ordinal": 29, + "value": { + "$rpc": "null" + } + }, + "321983341043": { + "name": "github.project.listAccessible#1", + "ordinal": 3, + "args": [ + { + "name": "method", + "value": "github.project.listAccessible" + }, + { + "name": "params", + "value": { + "host": "github.com" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-1", + "ok": true, + "result": { + "error": "refused" + } + } + } + }, + "32a7c0ae7918": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "outer refused", + "isRpcDeliveryUnknown": false + } + }, + "3493818a7239": { + "name": "githubProjectPasteBusy", + "ordinal": 33, + "value": false + }, + "358856006a81": { + "name": "githubProjectPasteError", + "ordinal": 16, + "value": "" + }, + "376c9e8bd72a": { + "error": "", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "$rpc": "null" + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "3985399034a2": { + "name": "githubProjectPasteBusy", + "ordinal": 17, + "value": true + }, + "3a8617cc8fd8": { + "name": "githubProjectSearch", + "ordinal": 14, + "value": "is:open" + }, + "43846f79098a": { + "name": "githubProjectSearch", + "ordinal": 28, + "value": "" + }, + "4607a82f1dd3": { + "error": "", + "loading": false, + "pasteError": "", + "projects": [], + "table": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "47b4a4ed1197": { + "name": "appliedGithubProjectSearch", + "ordinal": 27, + "value": { + "$rpc": "undefined" + } + }, + "4809ea7ad5b0": { "name": "github.project.viewTable#1", - "ordinal": 13, + "ordinal": 12, "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.viewTable\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3,\"viewId\":\"view-1\"}}" }, - "654693493b51": { - "name": "githubProjectLoading", - "ordinal": 10, - "value": true + "4c9b1e4ad1f5": { + "name": "githubProjectViews", + "ordinal": 28, + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "4db99cb82cd3": { + "name": "githubProjectError", + "ordinal": 23, + "value": "" + }, + "5033e4410561": { + "name": "github.project.listAccessible#1", + "ordinal": 3, + "args": [ + { + "name": "method", + "value": "github.project.listAccessible" + }, + { + "name": "params", + "value": { + "host": "github.com" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "", + "isRpcDeliveryUnknown": true + } + } + }, + "53954ecf4db4": { + "name": "githubProjectPasteBusy", + "ordinal": 31, + "value": false }, "685bc2bda05d": { "name": "githubProjects", @@ -481,9 +437,14 @@ } ] }, - "6d7ebc9b7830": { - "name": "github.project.listViews#2", + "6b03ace1146a": { + "name": "githubProjectError", "ordinal": 25, + "value": "" + }, + "6c265f3eef22": { + "name": "github.project.listViews#2", + "ordinal": 24, "args": [ { "name": "method", @@ -526,6 +487,23 @@ } } }, + "6d4c77a759a1": { + "name": "githubProjectSearch", + "ordinal": 12, + "value": "is:open" + }, + "736562ff5594": { + "name": "githubProjectViews", + "ordinal": 26, + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, "75c11cbc10c6": { "name": "github.project.listAccessible#1", "ordinal": 3, @@ -561,109 +539,9 @@ } } }, - "7a9df0d1a484": { - "name": "githubProjectLoading", - "ordinal": 25, - "value": true - }, - "7b9d3b33c08b": { - "name": "githubProjectPasteError", - "ordinal": 19, - "value": "" - }, - "7d7e6f5ce421": { - "name": "github.project.resolveRef#1", - "ordinal": 19, - "args": [ - { - "name": "method", - "value": "github.project.resolveRef" - }, - { - "name": "params", - "value": { - "host": "github.com", - "input": "https://github.com/orgs/owner/projects/3" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-4", - "ok": true, - "result": { - "host": "github.com", - "number": 3, - "ok": true, - "owner": "owner", - "ownerType": "organization", - "title": "Board", - "viewNumber": 1 - } - } - } - }, - "853d951cf70a": { - "name": "githubProjectError", - "ordinal": 18, - "value": "" - }, - "8792541c60ad": { - "name": "githubProjectError", - "ordinal": 26, - "value": "" - }, - "8c0c8b07aa3b": { - "name": "githubProjectLoading", - "ordinal": 8, - "value": true - }, - "8e4dec1aad1f": { - "name": "github.project.listViews#2", - "ordinal": 28, - "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" - }, - "8f3ee6c510b1": { - "name": "github.project.resolveRef#1", - "ordinal": 22, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" - }, - "9b9f8dd75514": { - "name": "githubProjectViews", - "ordinal": 9, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "9eb658057bc2": { - "name": "githubProjectViews", - "ordinal": 7, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "a012d9c70804": { + "7a60e3d689a2": { "name": "githubProjectTable", - "ordinal": 12, + "ordinal": 11, "value": { "fields": [], "project": { @@ -681,6 +559,112 @@ } } }, + "7d488eda1d1c": { + "name": "githubProjectViews", + "ordinal": 15, + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "819f4dade400": { + "name": "github.project.listViews#2", + "ordinal": 25, + "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" + }, + "842c950ee7cc": { + "name": "githubProjectLoading", + "ordinal": 16, + "value": false + }, + "88787b083c0a": { + "name": "githubProjectLoading", + "ordinal": 22, + "value": true + }, + "88db645d6267": { + "name": "githubProjectLoading", + "ordinal": 30, + "value": false + }, + "8a0577280bad": { + "name": "showGitHubProjectPicker", + "ordinal": 23, + "value": false + }, + "8b535c841be8": { + "name": "githubProjectPasteBusy", + "ordinal": 15, + "value": true + }, + "97bc7dc12b92": { + "name": "githubProjectLoading", + "ordinal": 32, + "value": false + }, + "999ec0e10c42": { + "name": "github.project.viewTable#1", + "ordinal": 9, + "args": [ + { + "name": "method", + "value": "github.project.viewTable" + }, + { + "name": "params", + "value": { + "host": "github.enterprise.test", + "owner": "owner", + "ownerType": "organization", + "projectNumber": 3, + "viewId": "view-1" + } + }, + { + "name": "options", + "value": { + "timeoutMs": 60000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "data": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + }, + "ok": true + } + } + } + }, + "9f9a21ac7b9e": { + "name": "github.project.listViews#2", + "ordinal": 27, + "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" + }, "a0b318040dbf": { "name": "github.project.listAccessible#1", "ordinal": 3, @@ -766,21 +750,23 @@ "ordinal": 6, "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3}}" }, - "a4635ab3551f": { - "name": "githubProjectLoading", - "ordinal": 15, - "value": false - }, - "a4a1ff5df287": { - "name": "githubProjectPasteBusy", - "ordinal": 18, - "value": true - }, "a5a3530ec11c": { "name": "githubProjectPartialFailures", "ordinal": 2, "value": [] }, + "a87b90bd0eb2": { + "name": "githubProjectViews", + "ordinal": 13, + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, "a947768bc0ed": { "status": "rejected", "startedAt": 0, @@ -802,31 +788,14 @@ "code": "incompatible_reply" } }, - "b0c25dac9d8e": { + "ab1b10183665": { + "name": "githubProjectLoading", + "ordinal": 24, + "value": true + }, + "ae89e058b351": { "name": "github.project.listViews#2", "ordinal": 26, - "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" - }, - "b42c8edc0d53": { - "name": "github.project.listAccessible#1", - "ordinal": 4, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listAccessible\",\"params\":{\"host\":\"github.com\"}}" - }, - "b495d30b1ee0": { - "name": "githubProjectViews", - "ordinal": 14, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "b49ff9f109a5": { - "name": "github.project.listViews#2", - "ordinal": 27, "args": [ { "name": "method", @@ -869,27 +838,15 @@ } } }, - "b5e354ed6023": { - "name": "githubProjectLoading", - "ordinal": 17, - "value": false + "b42c8edc0d53": { + "name": "github.project.listAccessible#1", + "ordinal": 4, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listAccessible\",\"params\":{\"host\":\"github.com\"}}" }, - "b5f49e20fef1": { - "name": "showGitHubProjectPicker", - "ordinal": 22, - "value": false - }, - "b66c4f75c9ae": { - "name": "githubProjectViews", - "ordinal": 29, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] + "b4a1f05e33c8": { + "name": "github.project.resolveRef#1", + "ordinal": 19, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" }, "b948e8307e81": { "status": "rejected", @@ -951,15 +908,30 @@ } ] }, - "c453f220a7e2": { - "name": "githubProjectLoading", - "ordinal": 33, - "value": false + "be93253869e6": { + "name": "github.project.resolveRef#1", + "ordinal": 21, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" }, - "c4c4250b0567": { - "name": "showGitHubProjectPicker", - "ordinal": 24, - "value": false + "c5c018cf9a70": { + "name": "githubProjectTable", + "ordinal": 13, + "value": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + } }, "c668b7f0ba25": { "name": "github.project.listAccessible#1", @@ -1003,18 +975,6 @@ "isRpcDeliveryUnknown": true } }, - "d0248d16609f": { - "name": "githubProjectViews", - "ordinal": 27, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, "d05b2d417b9c": { "status": "rejected", "startedAt": 0, @@ -1070,11 +1030,62 @@ } } }, - "d494afc83352": { - "name": "githubProjectError", - "ordinal": 24, + "d7783b65acee": { + "name": "github.project.resolveRef#1", + "ordinal": 18, + "args": [ + { + "name": "method", + "value": "github.project.resolveRef" + }, + { + "name": "params", + "value": { + "host": "github.com", + "input": "https://github.com/orgs/owner/projects/3" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "host": "github.com", + "number": 3, + "ok": true, + "owner": "owner", + "ownerType": "organization", + "title": "Board", + "viewNumber": 1 + } + } + } + }, + "d9ca148637c0": { + "name": "github.project.viewTable#1", + "ordinal": 10, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.viewTable\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3,\"viewId\":\"view-1\"}}" + }, + "dc8dd7739c49": { + "name": "githubProjectPasteInput", + "ordinal": 22, "value": "" }, + "df8adf9c824e": { + "name": "githubProjectLoading", + "ordinal": 14, + "value": false + }, "dfe16215433b": { "name": "github.project.listAccessible#1", "ordinal": 3, @@ -1119,60 +1130,6 @@ } } }, - "e2cc9a61876c": { - "name": "github.project.viewTable#1", - "ordinal": 10, - "args": [ - { - "name": "method", - "value": "github.project.viewTable" - }, - { - "name": "params", - "value": { - "host": "github.enterprise.test", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3, - "viewId": "view-1" - } - }, - { - "name": "options", - "value": { - "timeoutMs": 60000 - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true, - "result": { - "data": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - }, - "ok": true - } - } - } - }, "e538f46c1fc2": { "name": "github.project.listAccessible#1", "ordinal": 3, @@ -1207,10 +1164,10 @@ } } }, - "ea8f8a6f07b1": { - "name": "githubProjectPasteBusy", - "ordinal": 16, - "value": true + "e87bea4bcd3c": { + "name": "githubProjectSearch", + "ordinal": 30, + "value": "" }, "eb79a9b3682a": { "status": "fulfilled", @@ -1286,11 +1243,6 @@ } } }, - "f163a8ea1a7f": { - "name": "githubProjectError", - "ordinal": 9, - "value": "" - }, "f3b516f62081": { "status": "rejected", "startedAt": 0, @@ -1301,27 +1253,51 @@ "isRpcDeliveryUnknown": false } }, - "f79f5682a27b": { - "name": "githubProjectLoading", - "ordinal": 23, - "value": true - }, - "fa1d1b339394": { - "name": "appliedGithubProjectSearch", - "ordinal": 30, - "value": { - "$rpc": "undefined" - } - }, - "fb9764680a74": { - "name": "githubProjectError", + "f4530e110d4d": { + "name": "githubProjectPasteInput", "ordinal": 20, "value": "" }, - "fe075936e563": { - "name": "githubProjectSearch", - "ordinal": 31, - "value": "" + "f6003aed2098": { + "name": "github.project.resolveRef#1", + "ordinal": 20, + "args": [ + { + "name": "method", + "value": "github.project.resolveRef" + }, + { + "name": "params", + "value": { + "host": "github.com", + "input": "https://github.com/orgs/owner/projects/3" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "host": "github.com", + "number": 3, + "ok": true, + "owner": "owner", + "ownerType": "organization", + "title": "Board", + "viewNumber": 1 + } + } + } }, "ff43b5ec92a9": { "error": "", @@ -1368,21 +1344,15 @@ "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb" }, - "state": "376c9e8bd72a", - "effects": [ - "2085118de92f", - "a5a3530ec11c", - "685bc2bda05d", - "170fad8cb36b", - "9b9f8dd75514" - ] + "state": "ff43b5ec92a9", + "effects": ["2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b"] } }, { "id": "tk-project-board-load.normal:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1395,13 +1365,12 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc" ] } }, @@ -1411,16 +1380,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "b49ff9f109a5" + "0f1aa264f581", + "f6003aed2098", + "ae89e058b351" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1435,26 +1404,25 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "b66c4f75c9ae", - "fa1d1b339394", - "fe075936e563", - "34de2d655a0a", - "c453f220a7e2", - "5a4fc5c86d0c" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "4c9b1e4ad1f5", + "0af48d475813", + "e87bea4bcd3c", + "0056704adc0b", + "97bc7dc12b92", + "3493818a7239" ] } }, @@ -1481,15 +1449,15 @@ "projects-0": "aaf09e2731f5", "views-1": "be0da5b53ffb" }, - "state": "0e76d492b4f4", - "effects": ["2085118de92f", "a5a3530ec11c", "9eb658057bc2"] + "state": "147d0c98fb46", + "effects": ["2085118de92f", "a5a3530ec11c"] } }, { "id": "tk-project-board-load.result-absent:table-settled", "observation": { - "sender": ["ee8fc5edb754", "a125bd681d4a", "e2cc9a61876c"], - "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "2423ca7008fd"], + "sender": ["ee8fc5edb754", "a125bd681d4a", "999ec0e10c42"], + "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "d9ca148637c0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "aaf09e2731f5", @@ -1500,13 +1468,12 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e" ] } }, @@ -1516,16 +1483,16 @@ "sender": [ "ee8fc5edb754", "a125bd681d4a", - "e2cc9a61876c", - "7d7e6f5ce421", - "6d7ebc9b7830" + "999ec0e10c42", + "d7783b65acee", + "6c265f3eef22" ], "payloads": [ "b42c8edc0d53", "a2a600cf1ed6", - "2423ca7008fd", - "4dff29ea88de", - "b0c25dac9d8e" + "d9ca148637c0", + "b4a1f05e33c8", + "819f4dade400" ], "settlements": { "mount": "eb79a9b3682a", @@ -1538,26 +1505,25 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f", - "ea8f8a6f07b1", - "03fc33b06333", - "853d951cf70a", - "32e88f5c4657", - "b5f49e20fef1", - "f79f5682a27b", - "d494afc83352", - "d0248d16609f", - "4dd8cc8f777d", - "223225c09f07", - "5c93fbf94a2d", - "1cb3b185586b", - "5a7676ce26d6" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e", + "8b535c841be8", + "358856006a81", + "1f4f9fd563d9", + "f4530e110d4d", + "0e8b33b2854d", + "88787b083c0a", + "4db99cb82cd3", + "736562ff5594", + "47b4a4ed1197", + "43846f79098a", + "309bbebe1e4b", + "88db645d6267", + "53954ecf4db4" ] } }, @@ -1584,15 +1550,15 @@ "projects-0": "aaf09e2731f5", "views-1": "be0da5b53ffb" }, - "state": "0e76d492b4f4", - "effects": ["2085118de92f", "a5a3530ec11c", "9eb658057bc2"] + "state": "147d0c98fb46", + "effects": ["2085118de92f", "a5a3530ec11c"] } }, { "id": "tk-project-board-load.result-null:table-settled", "observation": { - "sender": ["e538f46c1fc2", "a125bd681d4a", "e2cc9a61876c"], - "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "2423ca7008fd"], + "sender": ["e538f46c1fc2", "a125bd681d4a", "999ec0e10c42"], + "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "d9ca148637c0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "aaf09e2731f5", @@ -1603,13 +1569,12 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e" ] } }, @@ -1619,16 +1584,16 @@ "sender": [ "e538f46c1fc2", "a125bd681d4a", - "e2cc9a61876c", - "7d7e6f5ce421", - "6d7ebc9b7830" + "999ec0e10c42", + "d7783b65acee", + "6c265f3eef22" ], "payloads": [ "b42c8edc0d53", "a2a600cf1ed6", - "2423ca7008fd", - "4dff29ea88de", - "b0c25dac9d8e" + "d9ca148637c0", + "b4a1f05e33c8", + "819f4dade400" ], "settlements": { "mount": "eb79a9b3682a", @@ -1641,26 +1606,25 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f", - "ea8f8a6f07b1", - "03fc33b06333", - "853d951cf70a", - "32e88f5c4657", - "b5f49e20fef1", - "f79f5682a27b", - "d494afc83352", - "d0248d16609f", - "4dd8cc8f777d", - "223225c09f07", - "5c93fbf94a2d", - "1cb3b185586b", - "5a7676ce26d6" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e", + "8b535c841be8", + "358856006a81", + "1f4f9fd563d9", + "f4530e110d4d", + "0e8b33b2854d", + "88787b083c0a", + "4db99cb82cd3", + "736562ff5594", + "47b4a4ed1197", + "43846f79098a", + "309bbebe1e4b", + "88db645d6267", + "53954ecf4db4" ] } }, @@ -1687,15 +1651,15 @@ "projects-0": "aaf09e2731f5", "views-1": "be0da5b53ffb" }, - "state": "0e76d492b4f4", - "effects": ["2085118de92f", "a5a3530ec11c", "9eb658057bc2"] + "state": "147d0c98fb46", + "effects": ["2085118de92f", "a5a3530ec11c"] } }, { "id": "tk-project-board-load.inner-ok-missing:table-settled", "observation": { - "sender": ["321983341043", "a125bd681d4a", "e2cc9a61876c"], - "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "2423ca7008fd"], + "sender": ["321983341043", "a125bd681d4a", "999ec0e10c42"], + "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "d9ca148637c0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "aaf09e2731f5", @@ -1706,13 +1670,12 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e" ] } }, @@ -1722,16 +1685,16 @@ "sender": [ "321983341043", "a125bd681d4a", - "e2cc9a61876c", - "7d7e6f5ce421", - "6d7ebc9b7830" + "999ec0e10c42", + "d7783b65acee", + "6c265f3eef22" ], "payloads": [ "b42c8edc0d53", "a2a600cf1ed6", - "2423ca7008fd", - "4dff29ea88de", - "b0c25dac9d8e" + "d9ca148637c0", + "b4a1f05e33c8", + "819f4dade400" ], "settlements": { "mount": "eb79a9b3682a", @@ -1744,26 +1707,25 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f", - "ea8f8a6f07b1", - "03fc33b06333", - "853d951cf70a", - "32e88f5c4657", - "b5f49e20fef1", - "f79f5682a27b", - "d494afc83352", - "d0248d16609f", - "4dd8cc8f777d", - "223225c09f07", - "5c93fbf94a2d", - "1cb3b185586b", - "5a7676ce26d6" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e", + "8b535c841be8", + "358856006a81", + "1f4f9fd563d9", + "f4530e110d4d", + "0e8b33b2854d", + "88787b083c0a", + "4db99cb82cd3", + "736562ff5594", + "47b4a4ed1197", + "43846f79098a", + "309bbebe1e4b", + "88db645d6267", + "53954ecf4db4" ] } }, @@ -1790,15 +1752,15 @@ "projects-0": "aaf09e2731f5", "views-1": "be0da5b53ffb" }, - "state": "0e76d492b4f4", - "effects": ["2085118de92f", "a5a3530ec11c", "9eb658057bc2"] + "state": "147d0c98fb46", + "effects": ["2085118de92f", "a5a3530ec11c"] } }, { "id": "tk-project-board-load.inner-false-string-error:table-settled", "observation": { - "sender": ["75c11cbc10c6", "a125bd681d4a", "e2cc9a61876c"], - "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "2423ca7008fd"], + "sender": ["75c11cbc10c6", "a125bd681d4a", "999ec0e10c42"], + "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "d9ca148637c0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "aaf09e2731f5", @@ -1809,13 +1771,12 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e" ] } }, @@ -1825,16 +1786,16 @@ "sender": [ "75c11cbc10c6", "a125bd681d4a", - "e2cc9a61876c", - "7d7e6f5ce421", - "6d7ebc9b7830" + "999ec0e10c42", + "d7783b65acee", + "6c265f3eef22" ], "payloads": [ "b42c8edc0d53", "a2a600cf1ed6", - "2423ca7008fd", - "4dff29ea88de", - "b0c25dac9d8e" + "d9ca148637c0", + "b4a1f05e33c8", + "819f4dade400" ], "settlements": { "mount": "eb79a9b3682a", @@ -1847,26 +1808,25 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f", - "ea8f8a6f07b1", - "03fc33b06333", - "853d951cf70a", - "32e88f5c4657", - "b5f49e20fef1", - "f79f5682a27b", - "d494afc83352", - "d0248d16609f", - "4dd8cc8f777d", - "223225c09f07", - "5c93fbf94a2d", - "1cb3b185586b", - "5a7676ce26d6" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e", + "8b535c841be8", + "358856006a81", + "1f4f9fd563d9", + "f4530e110d4d", + "0e8b33b2854d", + "88787b083c0a", + "4db99cb82cd3", + "736562ff5594", + "47b4a4ed1197", + "43846f79098a", + "309bbebe1e4b", + "88db645d6267", + "53954ecf4db4" ] } }, @@ -1893,15 +1853,15 @@ "projects-0": "d05b2d417b9c", "views-1": "be0da5b53ffb" }, - "state": "0e76d492b4f4", - "effects": ["2085118de92f", "a5a3530ec11c", "9eb658057bc2"] + "state": "147d0c98fb46", + "effects": ["2085118de92f", "a5a3530ec11c"] } }, { "id": "tk-project-board-load.inner-false-object-error:table-settled", "observation": { - "sender": ["bdbcea6d9879", "a125bd681d4a", "e2cc9a61876c"], - "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "2423ca7008fd"], + "sender": ["bdbcea6d9879", "a125bd681d4a", "999ec0e10c42"], + "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "d9ca148637c0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "d05b2d417b9c", @@ -1912,13 +1872,12 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e" ] } }, @@ -1928,16 +1887,16 @@ "sender": [ "bdbcea6d9879", "a125bd681d4a", - "e2cc9a61876c", - "7d7e6f5ce421", - "6d7ebc9b7830" + "999ec0e10c42", + "d7783b65acee", + "6c265f3eef22" ], "payloads": [ "b42c8edc0d53", "a2a600cf1ed6", - "2423ca7008fd", - "4dff29ea88de", - "b0c25dac9d8e" + "d9ca148637c0", + "b4a1f05e33c8", + "819f4dade400" ], "settlements": { "mount": "eb79a9b3682a", @@ -1950,26 +1909,25 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f", - "ea8f8a6f07b1", - "03fc33b06333", - "853d951cf70a", - "32e88f5c4657", - "b5f49e20fef1", - "f79f5682a27b", - "d494afc83352", - "d0248d16609f", - "4dd8cc8f777d", - "223225c09f07", - "5c93fbf94a2d", - "1cb3b185586b", - "5a7676ce26d6" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e", + "8b535c841be8", + "358856006a81", + "1f4f9fd563d9", + "f4530e110d4d", + "0e8b33b2854d", + "88787b083c0a", + "4db99cb82cd3", + "736562ff5594", + "47b4a4ed1197", + "43846f79098a", + "309bbebe1e4b", + "88db645d6267", + "53954ecf4db4" ] } }, @@ -1996,15 +1954,15 @@ "projects-0": "32a7c0ae7918", "views-1": "be0da5b53ffb" }, - "state": "0e76d492b4f4", - "effects": ["2085118de92f", "a5a3530ec11c", "9eb658057bc2"] + "state": "147d0c98fb46", + "effects": ["2085118de92f", "a5a3530ec11c"] } }, { "id": "tk-project-board-load.outer-refused:table-settled", "observation": { - "sender": ["0a7f23c13d0c", "a125bd681d4a", "e2cc9a61876c"], - "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "2423ca7008fd"], + "sender": ["0a7f23c13d0c", "a125bd681d4a", "999ec0e10c42"], + "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "d9ca148637c0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "32a7c0ae7918", @@ -2015,13 +1973,12 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e" ] } }, @@ -2031,16 +1988,16 @@ "sender": [ "0a7f23c13d0c", "a125bd681d4a", - "e2cc9a61876c", - "7d7e6f5ce421", - "6d7ebc9b7830" + "999ec0e10c42", + "d7783b65acee", + "6c265f3eef22" ], "payloads": [ "b42c8edc0d53", "a2a600cf1ed6", - "2423ca7008fd", - "4dff29ea88de", - "b0c25dac9d8e" + "d9ca148637c0", + "b4a1f05e33c8", + "819f4dade400" ], "settlements": { "mount": "eb79a9b3682a", @@ -2053,26 +2010,25 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f", - "ea8f8a6f07b1", - "03fc33b06333", - "853d951cf70a", - "32e88f5c4657", - "b5f49e20fef1", - "f79f5682a27b", - "d494afc83352", - "d0248d16609f", - "4dd8cc8f777d", - "223225c09f07", - "5c93fbf94a2d", - "1cb3b185586b", - "5a7676ce26d6" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e", + "8b535c841be8", + "358856006a81", + "1f4f9fd563d9", + "f4530e110d4d", + "0e8b33b2854d", + "88787b083c0a", + "4db99cb82cd3", + "736562ff5594", + "47b4a4ed1197", + "43846f79098a", + "309bbebe1e4b", + "88db645d6267", + "53954ecf4db4" ] } }, @@ -2099,15 +2055,15 @@ "projects-0": "f3b516f62081", "views-1": "be0da5b53ffb" }, - "state": "0e76d492b4f4", - "effects": ["2085118de92f", "a5a3530ec11c", "9eb658057bc2"] + "state": "147d0c98fb46", + "effects": ["2085118de92f", "a5a3530ec11c"] } }, { "id": "tk-project-board-load.outer-refused-no-message:table-settled", "observation": { - "sender": ["ed0115da9c46", "a125bd681d4a", "e2cc9a61876c"], - "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "2423ca7008fd"], + "sender": ["ed0115da9c46", "a125bd681d4a", "999ec0e10c42"], + "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "d9ca148637c0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "f3b516f62081", @@ -2118,13 +2074,12 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e" ] } }, @@ -2134,16 +2089,16 @@ "sender": [ "ed0115da9c46", "a125bd681d4a", - "e2cc9a61876c", - "7d7e6f5ce421", - "6d7ebc9b7830" + "999ec0e10c42", + "d7783b65acee", + "6c265f3eef22" ], "payloads": [ "b42c8edc0d53", "a2a600cf1ed6", - "2423ca7008fd", - "4dff29ea88de", - "b0c25dac9d8e" + "d9ca148637c0", + "b4a1f05e33c8", + "819f4dade400" ], "settlements": { "mount": "eb79a9b3682a", @@ -2156,26 +2111,25 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f", - "ea8f8a6f07b1", - "03fc33b06333", - "853d951cf70a", - "32e88f5c4657", - "b5f49e20fef1", - "f79f5682a27b", - "d494afc83352", - "d0248d16609f", - "4dd8cc8f777d", - "223225c09f07", - "5c93fbf94a2d", - "1cb3b185586b", - "5a7676ce26d6" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e", + "8b535c841be8", + "358856006a81", + "1f4f9fd563d9", + "f4530e110d4d", + "0e8b33b2854d", + "88787b083c0a", + "4db99cb82cd3", + "736562ff5594", + "47b4a4ed1197", + "43846f79098a", + "309bbebe1e4b", + "88db645d6267", + "53954ecf4db4" ] } }, @@ -2202,15 +2156,15 @@ "projects-0": "b948e8307e81", "views-1": "be0da5b53ffb" }, - "state": "0e76d492b4f4", - "effects": ["2085118de92f", "a5a3530ec11c", "9eb658057bc2"] + "state": "147d0c98fb46", + "effects": ["2085118de92f", "a5a3530ec11c"] } }, { "id": "tk-project-board-load.method-not-found:table-settled", "observation": { - "sender": ["a0b318040dbf", "a125bd681d4a", "e2cc9a61876c"], - "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "2423ca7008fd"], + "sender": ["a0b318040dbf", "a125bd681d4a", "999ec0e10c42"], + "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "d9ca148637c0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "b948e8307e81", @@ -2221,13 +2175,12 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e" ] } }, @@ -2237,16 +2190,16 @@ "sender": [ "a0b318040dbf", "a125bd681d4a", - "e2cc9a61876c", - "7d7e6f5ce421", - "6d7ebc9b7830" + "999ec0e10c42", + "d7783b65acee", + "6c265f3eef22" ], "payloads": [ "b42c8edc0d53", "a2a600cf1ed6", - "2423ca7008fd", - "4dff29ea88de", - "b0c25dac9d8e" + "d9ca148637c0", + "b4a1f05e33c8", + "819f4dade400" ], "settlements": { "mount": "eb79a9b3682a", @@ -2259,26 +2212,25 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f", - "ea8f8a6f07b1", - "03fc33b06333", - "853d951cf70a", - "32e88f5c4657", - "b5f49e20fef1", - "f79f5682a27b", - "d494afc83352", - "d0248d16609f", - "4dd8cc8f777d", - "223225c09f07", - "5c93fbf94a2d", - "1cb3b185586b", - "5a7676ce26d6" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e", + "8b535c841be8", + "358856006a81", + "1f4f9fd563d9", + "f4530e110d4d", + "0e8b33b2854d", + "88787b083c0a", + "4db99cb82cd3", + "736562ff5594", + "47b4a4ed1197", + "43846f79098a", + "309bbebe1e4b", + "88db645d6267", + "53954ecf4db4" ] } }, @@ -2305,15 +2257,15 @@ "projects-0": "a947768bc0ed", "views-1": "be0da5b53ffb" }, - "state": "0e76d492b4f4", - "effects": ["2085118de92f", "a5a3530ec11c", "9eb658057bc2"] + "state": "147d0c98fb46", + "effects": ["2085118de92f", "a5a3530ec11c"] } }, { "id": "tk-project-board-load.transport-rejection:table-settled", "observation": { - "sender": ["c668b7f0ba25", "a125bd681d4a", "e2cc9a61876c"], - "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "2423ca7008fd"], + "sender": ["c668b7f0ba25", "a125bd681d4a", "999ec0e10c42"], + "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "d9ca148637c0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "a947768bc0ed", @@ -2324,13 +2276,12 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e" ] } }, @@ -2340,16 +2291,16 @@ "sender": [ "c668b7f0ba25", "a125bd681d4a", - "e2cc9a61876c", - "7d7e6f5ce421", - "6d7ebc9b7830" + "999ec0e10c42", + "d7783b65acee", + "6c265f3eef22" ], "payloads": [ "b42c8edc0d53", "a2a600cf1ed6", - "2423ca7008fd", - "4dff29ea88de", - "b0c25dac9d8e" + "d9ca148637c0", + "b4a1f05e33c8", + "819f4dade400" ], "settlements": { "mount": "eb79a9b3682a", @@ -2362,26 +2313,25 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f", - "ea8f8a6f07b1", - "03fc33b06333", - "853d951cf70a", - "32e88f5c4657", - "b5f49e20fef1", - "f79f5682a27b", - "d494afc83352", - "d0248d16609f", - "4dd8cc8f777d", - "223225c09f07", - "5c93fbf94a2d", - "1cb3b185586b", - "5a7676ce26d6" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e", + "8b535c841be8", + "358856006a81", + "1f4f9fd563d9", + "f4530e110d4d", + "0e8b33b2854d", + "88787b083c0a", + "4db99cb82cd3", + "736562ff5594", + "47b4a4ed1197", + "43846f79098a", + "309bbebe1e4b", + "88db645d6267", + "53954ecf4db4" ] } }, @@ -2408,15 +2358,15 @@ "projects-0": "c7584e82c72f", "views-1": "be0da5b53ffb" }, - "state": "0e76d492b4f4", - "effects": ["2085118de92f", "a5a3530ec11c", "9eb658057bc2"] + "state": "147d0c98fb46", + "effects": ["2085118de92f", "a5a3530ec11c"] } }, { "id": "tk-project-board-load.transport-rejection-no-message:table-settled", "observation": { - "sender": ["5033e4410561", "a125bd681d4a", "e2cc9a61876c"], - "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "2423ca7008fd"], + "sender": ["5033e4410561", "a125bd681d4a", "999ec0e10c42"], + "payloads": ["b42c8edc0d53", "a2a600cf1ed6", "d9ca148637c0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "c7584e82c72f", @@ -2427,13 +2377,12 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e" ] } }, @@ -2443,16 +2392,16 @@ "sender": [ "5033e4410561", "a125bd681d4a", - "e2cc9a61876c", - "7d7e6f5ce421", - "6d7ebc9b7830" + "999ec0e10c42", + "d7783b65acee", + "6c265f3eef22" ], "payloads": [ "b42c8edc0d53", "a2a600cf1ed6", - "2423ca7008fd", - "4dff29ea88de", - "b0c25dac9d8e" + "d9ca148637c0", + "b4a1f05e33c8", + "819f4dade400" ], "settlements": { "mount": "eb79a9b3682a", @@ -2465,26 +2414,25 @@ "effects": [ "2085118de92f", "a5a3530ec11c", - "9eb658057bc2", - "8c0c8b07aa3b", - "f163a8ea1a7f", - "a012d9c70804", - "39b306a93afc", - "b495d30b1ee0", - "a4635ab3551f", - "ea8f8a6f07b1", - "03fc33b06333", - "853d951cf70a", - "32e88f5c4657", - "b5f49e20fef1", - "f79f5682a27b", - "d494afc83352", - "d0248d16609f", - "4dd8cc8f777d", - "223225c09f07", - "5c93fbf94a2d", - "1cb3b185586b", - "5a7676ce26d6" + "1742a082916c", + "29c85aeaeafe", + "7a60e3d689a2", + "6d4c77a759a1", + "a87b90bd0eb2", + "df8adf9c824e", + "8b535c841be8", + "358856006a81", + "1f4f9fd563d9", + "f4530e110d4d", + "0e8b33b2854d", + "88787b083c0a", + "4db99cb82cd3", + "736562ff5594", + "47b4a4ed1197", + "43846f79098a", + "309bbebe1e4b", + "88db645d6267", + "53954ecf4db4" ] } } diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-1.json index 983cae9af5c..2e366826ec6 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-1.json @@ -11,52 +11,6 @@ "$rpc": "null" } }, - "00ef2dbe5026": { - "name": "github.project.resolveRef#1", - "ordinal": 21, - "args": [ - { - "name": "method", - "value": "github.project.resolveRef" - }, - { - "name": "params", - "value": { - "host": "github.com", - "input": "https://github.com/orgs/owner/projects/3" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-4", - "ok": true, - "result": { - "host": "github.com", - "number": 3, - "ok": true, - "owner": "owner", - "ownerType": "organization", - "title": "Board", - "viewNumber": 1 - } - } - } - }, - "0388fa155721": { - "name": "githubProjectError", - "ordinal": 11, - "value": "" - }, "060dcedb3fdb": { "name": "githubProjectError", "ordinal": 10, @@ -331,13 +285,6 @@ "ordinal": 33, "value": false }, - "34de2d655a0a": { - "name": "githubProjectTable", - "ordinal": 32, - "value": { - "$rpc": "null" - } - }, "376c9e8bd72a": { "error": "", "loading": false, @@ -407,31 +354,6 @@ "ordinal": 14, "value": "is:open" }, - "43352776b1e1": { - "name": "githubProjectTable", - "ordinal": 14, - "value": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - } - }, - "47507819e28a": { - "name": "githubProjectPasteInput", - "ordinal": 23, - "value": "" - }, "4809ea7ad5b0": { "name": "github.project.viewTable#1", "ordinal": 12, @@ -449,87 +371,6 @@ } ] }, - "4eb521bbefdd": { - "name": "githubProjectSearch", - "ordinal": 15, - "value": "is:open" - }, - "528af16518e6": { - "name": "githubProjectViews", - "ordinal": 16, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "5a4fc5c86d0c": { - "name": "githubProjectPasteBusy", - "ordinal": 34, - "value": false - }, - "5f5f56db9d64": { - "name": "github.project.viewTable#1", - "ordinal": 12, - "args": [ - { - "name": "method", - "value": "github.project.viewTable" - }, - { - "name": "params", - "value": { - "host": "github.enterprise.test", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3, - "viewId": "view-1" - } - }, - { - "name": "options", - "value": { - "timeoutMs": 60000 - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true, - "result": { - "data": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - }, - "ok": true - } - } - } - }, - "61ce1ab88e79": { - "name": "github.project.viewTable#1", - "ordinal": 13, - "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.viewTable\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3,\"viewId\":\"view-1\"}}" - }, "621b6b7b4159": { "name": "github.project.listViews#1", "ordinal": 7, @@ -565,11 +406,6 @@ } } }, - "654693493b51": { - "name": "githubProjectLoading", - "ordinal": 10, - "value": true - }, "685bc2bda05d": { "name": "githubProjects", "ordinal": 5, @@ -623,16 +459,6 @@ "ordinal": 25, "value": "" }, - "7a9df0d1a484": { - "name": "githubProjectLoading", - "ordinal": 25, - "value": true - }, - "7b9d3b33c08b": { - "name": "githubProjectPasteError", - "ordinal": 19, - "value": "" - }, "7d488eda1d1c": { "name": "githubProjectViews", "ordinal": 15, @@ -650,43 +476,16 @@ "ordinal": 16, "value": false }, - "8792541c60ad": { - "name": "githubProjectError", - "ordinal": 26, - "value": "" - }, "8a0577280bad": { "name": "showGitHubProjectPicker", "ordinal": 23, "value": false }, - "8e4dec1aad1f": { - "name": "github.project.listViews#2", - "ordinal": 28, - "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" - }, - "8f3ee6c510b1": { - "name": "github.project.resolveRef#1", - "ordinal": 22, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" - }, "97bc7dc12b92": { "name": "githubProjectLoading", "ordinal": 32, "value": false }, - "9b9f8dd75514": { - "name": "githubProjectViews", - "ordinal": 9, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, "9f9a21ac7b9e": { "name": "github.project.listViews#2", "ordinal": 27, @@ -732,11 +531,6 @@ } } }, - "a4a1ff5df287": { - "name": "githubProjectPasteBusy", - "ordinal": 18, - "value": true - }, "a5a3530ec11c": { "name": "githubProjectPartialFailures", "ordinal": 2, @@ -807,68 +601,6 @@ "ordinal": 4, "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listAccessible\",\"params\":{\"host\":\"github.com\"}}" }, - "b49ff9f109a5": { - "name": "github.project.listViews#2", - "ordinal": 27, - "args": [ - { - "name": "method", - "value": "github.project.listViews" - }, - { - "name": "params", - "value": { - "host": "github.com", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3 - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-5", - "ok": true, - "result": { - "ok": true, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - } - } - } - }, - "b5e354ed6023": { - "name": "githubProjectLoading", - "ordinal": 17, - "value": false - }, - "b66c4f75c9ae": { - "name": "githubProjectViews", - "ordinal": 29, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, "b948e8307e81": { "status": "rejected", "startedAt": 0, @@ -972,16 +704,6 @@ } } }, - "c453f220a7e2": { - "name": "githubProjectLoading", - "ordinal": 33, - "value": false - }, - "c4c4250b0567": { - "name": "showGitHubProjectPicker", - "ordinal": 24, - "value": false - }, "c5c018cf9a70": { "name": "githubProjectTable", "ordinal": 13, @@ -1180,18 +902,6 @@ } } }, - "fa1d1b339394": { - "name": "appliedGithubProjectSearch", - "ordinal": 30, - "value": { - "$rpc": "undefined" - } - }, - "fb9764680a74": { - "name": "githubProjectError", - "ordinal": 20, - "value": "" - }, "fc799562716c": { "name": "github.project.listViews#1", "ordinal": 7, @@ -1229,11 +939,6 @@ } } }, - "fe075936e563": { - "name": "githubProjectSearch", - "ordinal": 31, - "value": "" - }, "ff43b5ec92a9": { "error": "", "loading": false, @@ -1279,21 +984,15 @@ "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb" }, - "state": "376c9e8bd72a", - "effects": [ - "2085118de92f", - "a5a3530ec11c", - "685bc2bda05d", - "170fad8cb36b", - "9b9f8dd75514" - ] + "state": "ff43b5ec92a9", + "effects": ["2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b"] } }, { "id": "tk-project-board-load.normal:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1306,13 +1005,12 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc" ] } }, @@ -1322,16 +1020,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "b49ff9f109a5" + "0f1aa264f581", + "f6003aed2098", + "ae89e058b351" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1346,26 +1044,25 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "b66c4f75c9ae", - "fa1d1b339394", - "fe075936e563", - "34de2d655a0a", - "c453f220a7e2", - "5a4fc5c86d0c" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "4c9b1e4ad1f5", + "0af48d475813", + "e87bea4bcd3c", + "0056704adc0b", + "97bc7dc12b92", + "3493818a7239" ] } }, diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-2.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-2.json index df7cdf99d9f..7e0dd9c98ad 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-2.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-2.json @@ -4,253 +4,28 @@ "family": "tasks.project-board-load", "namedDeltas": [], "values": { - "00ef2dbe5026": { - "name": "github.project.resolveRef#1", - "ordinal": 21, - "args": [ - { - "name": "method", - "value": "github.project.resolveRef" - }, - { - "name": "params", - "value": { - "host": "github.com", - "input": "https://github.com/orgs/owner/projects/3" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-4", - "ok": true, - "result": { - "host": "github.com", - "number": 3, - "ok": true, - "owner": "owner", - "ownerType": "organization", - "title": "Board", - "viewNumber": 1 - } - } - } - }, - "0388fa155721": { - "name": "githubProjectError", - "ordinal": 11, - "value": "" - }, - "15cb97c93333": { - "name": "github.project.listViews#1", - "ordinal": 8, - "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3}}" - }, - "170fad8cb36b": { - "name": "githubProjectPartialFailures", - "ordinal": 6, - "value": [] - }, - "1b7a7437b046": { - "error": "", - "loading": true, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "2085118de92f": { - "name": "githubProjectError", - "ordinal": 1, - "value": "" - }, - "2ab1b35ff194": { - "error": "", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "30e01816f729": { - "name": "githubProjectError", - "ordinal": 29, - "value": "Unknown method" - }, - "34de2d655a0a": { + "0056704adc0b": { "name": "githubProjectTable", - "ordinal": 32, + "ordinal": 31, "value": { "$rpc": "null" } }, - "3647b0f3edc5": { + "060dcedb3fdb": { "name": "githubProjectError", - "ordinal": 29, - "value": "transport failure" - }, - "376c9e8bd72a": { - "error": "", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "$rpc": "null" - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "424eb405bbce": { - "name": "github.project.listViews#2", - "ordinal": 27, - "args": [ - { - "name": "method", - "value": "github.project.listViews" - }, - { - "name": "params", - "value": { - "host": "github.com", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3 - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-5", - "ok": true, - "result": { - "error": { - "message": "inner refused" - }, - "ok": false - } - } - } - }, - "43352776b1e1": { - "name": "githubProjectTable", - "ordinal": 14, - "value": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - } - }, - "47507819e28a": { - "name": "githubProjectPasteInput", - "ordinal": 23, + "ordinal": 10, "value": "" }, - "4c85a08be215": { + "0af48d475813": { + "name": "appliedGithubProjectSearch", + "ordinal": 29, + "value": { + "$rpc": "undefined" + } + }, + "0b0789528a70": { "name": "github.project.listViews#2", - "ordinal": 27, + "ordinal": 26, "args": [ { "name": "method", @@ -278,164 +53,22 @@ "settledAt": 0, "value": { "error": { - "code": "refused", - "message": "" + "code": "method_not_found", + "message": "Unknown method" }, "id": "frame-5", "ok": false } } }, - "4cf1a3bc4178": { - "error": "inner refused", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "4eb521bbefdd": { - "name": "githubProjectSearch", - "ordinal": 15, - "value": "is:open" - }, - "4f71c65408bc": { + "0e83c4f2d85c": { "name": "githubProjectError", - "ordinal": 29, - "value": "Connection closed" + "ordinal": 28, + "value": "The host sent a reply this app could not read (github.project.listViews)" }, - "50c2d0683abb": { - "error": "The host sent a reply this app could not read (github.project.listViews)", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "512d99654670": { - "name": "githubProjectError", - "ordinal": 29, - "value": "" - }, - "528af16518e6": { - "name": "githubProjectViews", - "ordinal": 16, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "53954ecf4db4": { - "name": "githubProjectPasteBusy", - "ordinal": 31, - "value": false - }, - "5a4fc5c86d0c": { - "name": "githubProjectPasteBusy", - "ordinal": 34, - "value": false - }, - "5d14c0c6aafb": { - "name": "github.project.listViews#2", - "ordinal": 27, - "args": [ - { - "name": "method", - "value": "github.project.listViews" - }, - { - "name": "params", - "value": { - "host": "github.com", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3 - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-5", - "ok": true - } - } - }, - "5f5f56db9d64": { + "0f1aa264f581": { "name": "github.project.viewTable#1", - "ordinal": 12, + "ordinal": 11, "args": [ { "name": "method", @@ -487,20 +120,31 @@ } } }, - "61ce1ab88e79": { - "name": "github.project.viewTable#1", - "ordinal": 13, - "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.viewTable\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3,\"viewId\":\"view-1\"}}" + "0f65a65096ff": { + "name": "githubProjectPasteBusy", + "ordinal": 30, + "value": false }, - "654693493b51": { - "name": "githubProjectLoading", - "ordinal": 10, - "value": true + "15cb97c93333": { + "name": "github.project.listViews#1", + "ordinal": 8, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3}}" }, - "685bc2bda05d": { - "name": "githubProjects", - "ordinal": 5, - "value": [ + "170fad8cb36b": { + "name": "githubProjectPartialFailures", + "ordinal": 6, + "value": [] + }, + "1b3350f71e56": { + "name": "githubProjectError", + "ordinal": 19, + "value": "" + }, + "1b7a7437b046": { + "error": "", + "loading": true, + "pasteError": "", + "projects": [ { "host": "github.com", "number": 3, @@ -508,96 +152,35 @@ "ownerType": "organization", "title": "Board" } + ], + "table": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } ] }, - "74ace6b26c7d": { + "1c37f311588f": { "name": "github.project.listViews#2", - "ordinal": 27, - "args": [ - { - "name": "method", - "value": "github.project.listViews" - }, - { - "name": "params", - "value": { - "host": "github.com", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3 - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-5", - "ok": true, - "result": { - "$rpc": "null" - } - } - } - }, - "7a9df0d1a484": { - "name": "githubProjectLoading", - "ordinal": 25, - "value": true - }, - "7b9d3b33c08b": { - "name": "githubProjectPasteError", - "ordinal": 19, - "value": "" - }, - "840773c717c8": { - "name": "github.project.listViews#2", - "ordinal": 27, - "args": [ - { - "name": "method", - "value": "github.project.listViews" - }, - { - "name": "params", - "value": { - "host": "github.com", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3 - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "error": { - "code": "method_not_found", - "message": "Unknown method" - }, - "id": "frame-5", - "ok": false - } - } - }, - "84a370049c5f": { - "name": "github.project.listViews#2", - "ordinal": 27, + "ordinal": 26, "args": [ { "name": "method", @@ -632,34 +215,274 @@ } } }, - "8792541c60ad": { + "2085118de92f": { "name": "githubProjectError", - "ordinal": 26, + "ordinal": 1, "value": "" }, - "88db645d6267": { + "26921f3a7c09": { + "name": "githubProjectPasteError", + "ordinal": 18, + "value": "" + }, + "2ab1b35ff194": { + "error": "", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "2f290fa2acf5": { "name": "githubProjectLoading", - "ordinal": 30, + "ordinal": 9, + "value": true + }, + "3493818a7239": { + "name": "githubProjectPasteBusy", + "ordinal": 33, "value": false }, - "8e4dec1aad1f": { - "name": "github.project.listViews#2", - "ordinal": 28, - "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" + "376c9e8bd72a": { + "error": "", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "$rpc": "null" + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] }, - "8f3ee6c510b1": { - "name": "github.project.resolveRef#1", - "ordinal": 22, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" + "3985399034a2": { + "name": "githubProjectPasteBusy", + "ordinal": 17, + "value": true }, - "9361b1a34966": { + "3a358ec06a2e": { "name": "githubProjectError", - "ordinal": 29, - "value": "inner refused" + "ordinal": 28, + "value": "Unknown method" }, - "98c724fa87df": { + "3a8617cc8fd8": { + "name": "githubProjectSearch", + "ordinal": 14, + "value": "is:open" + }, + "4809ea7ad5b0": { + "name": "github.project.viewTable#1", + "ordinal": 12, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.viewTable\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3,\"viewId\":\"view-1\"}}" + }, + "4c9b1e4ad1f5": { + "name": "githubProjectViews", + "ordinal": 28, + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "4cf1a3bc4178": { + "error": "inner refused", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "4eec12580715": { + "name": "githubProjectError", + "ordinal": 28, + "value": "Connection closed" + }, + "50c2d0683abb": { + "error": "The host sent a reply this app could not read (github.project.listViews)", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "5f39ee0a111a": { "name": "github.project.listViews#2", - "ordinal": 27, + "ordinal": 26, + "args": [ + { + "name": "method", + "value": "github.project.listViews" + }, + { + "name": "params", + "value": { + "host": "github.com", + "owner": "owner", + "ownerType": "organization", + "projectNumber": 3 + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-5", + "ok": true + } + } + }, + "685bc2bda05d": { + "name": "githubProjects", + "ordinal": 5, + "value": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ] + }, + "6b03ace1146a": { + "name": "githubProjectError", + "ordinal": 25, + "value": "" + }, + "751553d01f74": { + "name": "githubProjectError", + "ordinal": 28, + "value": "outer refused" + }, + "7d488eda1d1c": { + "name": "githubProjectViews", + "ordinal": 15, + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "7f4d6b5a4c99": { + "name": "github.project.listViews#2", + "ordinal": 26, "args": [ { "name": "method", @@ -695,17 +518,30 @@ } } }, - "9b9f8dd75514": { - "name": "githubProjectViews", - "ordinal": 9, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] + "842c950ee7cc": { + "name": "githubProjectLoading", + "ordinal": 16, + "value": false + }, + "8a0577280bad": { + "name": "showGitHubProjectPicker", + "ordinal": 23, + "value": false + }, + "8d098092a97f": { + "name": "githubProjectLoading", + "ordinal": 29, + "value": false + }, + "97bc7dc12b92": { + "name": "githubProjectLoading", + "ordinal": 32, + "value": false + }, + "9f9a21ac7b9e": { + "name": "github.project.listViews#2", + "ordinal": 27, + "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" }, "9fb985a7d8f6": { "error": "transport failure", @@ -745,16 +581,51 @@ } ] }, - "a4a1ff5df287": { - "name": "githubProjectPasteBusy", - "ordinal": 18, - "value": true - }, "a5a3530ec11c": { "name": "githubProjectPartialFailures", "ordinal": 2, "value": [] }, + "a6a517418ed9": { + "name": "github.project.listViews#2", + "ordinal": 26, + "args": [ + { + "name": "method", + "value": "github.project.listViews" + }, + { + "name": "params", + "value": { + "host": "github.com", + "owner": "owner", + "ownerType": "organization", + "projectNumber": 3 + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "transport failure", + "isRpcDeliveryUnknown": true + } + } + }, + "ab1b10183665": { + "name": "githubProjectLoading", + "ordinal": 24, + "value": true + }, "abb28d0939d9": { "error": "Unknown method", "loading": false, @@ -793,47 +664,9 @@ } ] }, - "b1b0d0b13d2e": { - "error": "outer refused", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "b1f9e7039553": { + "ad1c64ff938a": { "name": "github.project.listViews#2", - "ordinal": 27, + "ordinal": 26, "args": [ { "name": "method", @@ -856,24 +689,24 @@ } ], "settlement": { - "status": "rejected", + "status": "fulfilled", "startedAt": 0, "settledAt": 0, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true + "value": { + "id": "frame-5", + "ok": true, + "result": { + "error": { + "message": "inner refused" + }, + "ok": false + } } } }, - "b42c8edc0d53": { - "name": "github.project.listAccessible#1", - "ordinal": 4, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listAccessible\",\"params\":{\"host\":\"github.com\"}}" - }, - "b49ff9f109a5": { + "ae89e058b351": { "name": "github.project.listViews#2", - "ordinal": 27, + "ordinal": 26, "args": [ { "name": "method", @@ -916,15 +749,36 @@ } } }, - "b5e354ed6023": { - "name": "githubProjectLoading", - "ordinal": 17, - "value": false - }, - "b66c4f75c9ae": { - "name": "githubProjectViews", - "ordinal": 29, - "value": [ + "b1b0d0b13d2e": { + "error": "outer refused", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + }, + "views": [ { "id": "view-1", "layout": "TABLE_LAYOUT", @@ -933,42 +787,14 @@ } ] }, - "be0da5b53ffb": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] + "b42c8edc0d53": { + "name": "github.project.listAccessible#1", + "ordinal": 4, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listAccessible\",\"params\":{\"host\":\"github.com\"}}" }, - "bff57ba49c8b": { - "name": "githubProjectError", - "ordinal": 29, - "value": "The host sent a reply this app could not read (github.project.listViews)" - }, - "c180286bc513": { - "name": "githubProjectError", - "ordinal": 29, - "value": "outer refused" - }, - "c453f220a7e2": { - "name": "githubProjectLoading", - "ordinal": 33, - "value": false - }, - "c4c4250b0567": { - "name": "showGitHubProjectPicker", - "ordinal": 24, - "value": false - }, - "c977f7f00437": { + "b61805111271": { "name": "github.project.listViews#2", - "ordinal": 27, + "ordinal": 26, "args": [ { "name": "method", @@ -1001,6 +827,162 @@ } } }, + "be0da5b53ffb": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "be93253869e6": { + "name": "github.project.resolveRef#1", + "ordinal": 21, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" + }, + "c26d1df91c18": { + "name": "github.project.listViews#2", + "ordinal": 26, + "args": [ + { + "name": "method", + "value": "github.project.listViews" + }, + { + "name": "params", + "value": { + "host": "github.com", + "owner": "owner", + "ownerType": "organization", + "projectNumber": 3 + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "error": { + "code": "refused", + "message": "" + }, + "id": "frame-5", + "ok": false + } + } + }, + "c5c018cf9a70": { + "name": "githubProjectTable", + "ordinal": 13, + "value": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + } + }, + "c9b343e9992b": { + "name": "github.project.listViews#2", + "ordinal": 26, + "args": [ + { + "name": "method", + "value": "github.project.listViews" + }, + { + "name": "params", + "value": { + "host": "github.com", + "owner": "owner", + "ownerType": "organization", + "projectNumber": 3 + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "error": { + "code": "refused", + "message": "outer refused" + }, + "id": "frame-5", + "ok": false + } + } + }, + "c9ee089860fc": { + "name": "githubProjectError", + "ordinal": 28, + "value": "" + }, + "cc9ab010bdff": { + "name": "github.project.listViews#2", + "ordinal": 26, + "args": [ + { + "name": "method", + "value": "github.project.listViews" + }, + { + "name": "params", + "value": { + "host": "github.com", + "owner": "owner", + "ownerType": "organization", + "projectNumber": 3 + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-5", + "ok": true, + "result": { + "$rpc": "null" + } + } + } + }, "d254913957c1": { "name": "github.project.listViews#1", "ordinal": 7, @@ -1046,40 +1028,10 @@ } } }, - "d9169f17f695": { - "name": "github.project.listViews#2", - "ordinal": 27, - "args": [ - { - "name": "method", - "value": "github.project.listViews" - }, - { - "name": "params", - "value": { - "host": "github.com", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3 - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "transport failure", - "isRpcDeliveryUnknown": true - } - } + "dc8dd7739c49": { + "name": "githubProjectPasteInput", + "ordinal": 22, + "value": "" }, "dfe16215433b": { "name": "github.project.listAccessible#1", @@ -1125,6 +1077,11 @@ } } }, + "e87bea4bcd3c": { + "name": "githubProjectSearch", + "ordinal": 30, + "value": "" + }, "eb79a9b3682a": { "status": "fulfilled", "startedAt": 0, @@ -1133,9 +1090,9 @@ "$rpc": "undefined" } }, - "ec5b32385042": { + "ef0715ff99c1": { "name": "github.project.listViews#2", - "ordinal": 27, + "ordinal": 26, "args": [ { "name": "method", @@ -1157,36 +1114,67 @@ } } ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } + }, + "f6003aed2098": { + "name": "github.project.resolveRef#1", + "ordinal": 20, + "args": [ + { + "name": "method", + "value": "github.project.resolveRef" + }, + { + "name": "params", + "value": { + "host": "github.com", + "input": "https://github.com/orgs/owner/projects/3" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], "settlement": { "status": "fulfilled", "startedAt": 0, "settledAt": 0, "value": { - "error": { - "code": "refused", - "message": "outer refused" - }, - "id": "frame-5", - "ok": false + "id": "frame-4", + "ok": true, + "result": { + "host": "github.com", + "number": 3, + "ok": true, + "owner": "owner", + "ownerType": "organization", + "title": "Board", + "viewNumber": 1 + } } } }, - "fa1d1b339394": { - "name": "appliedGithubProjectSearch", - "ordinal": 30, - "value": { - "$rpc": "undefined" - } - }, - "fb9764680a74": { + "fafc5b2f8260": { "name": "githubProjectError", - "ordinal": 20, - "value": "" + "ordinal": 28, + "value": "inner refused" }, - "fe075936e563": { - "name": "githubProjectSearch", - "ordinal": 31, - "value": "" + "fd895f7d7a4a": { + "name": "githubProjectError", + "ordinal": 28, + "value": "transport failure" }, "ff43b5ec92a9": { "error": "", @@ -1233,21 +1221,15 @@ "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb" }, - "state": "376c9e8bd72a", - "effects": [ - "2085118de92f", - "a5a3530ec11c", - "685bc2bda05d", - "170fad8cb36b", - "9b9f8dd75514" - ] + "state": "ff43b5ec92a9", + "effects": ["2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b"] } }, { "id": "tk-project-board-load.prelude:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1260,13 +1242,12 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc" ] } }, @@ -1276,16 +1257,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "b1f9e7039553" + "0f1aa264f581", + "f6003aed2098", + "ef0715ff99c1" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1300,23 +1281,22 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "4f71c65408bc", - "88db645d6267", - "53954ecf4db4" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "4eec12580715", + "8d098092a97f", + "0f65a65096ff" ] } }, @@ -1326,16 +1306,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "b49ff9f109a5" + "0f1aa264f581", + "f6003aed2098", + "ae89e058b351" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1350,26 +1330,25 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "b66c4f75c9ae", - "fa1d1b339394", - "fe075936e563", - "34de2d655a0a", - "c453f220a7e2", - "5a4fc5c86d0c" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "4c9b1e4ad1f5", + "0af48d475813", + "e87bea4bcd3c", + "0056704adc0b", + "97bc7dc12b92", + "3493818a7239" ] } }, @@ -1379,16 +1358,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "5d14c0c6aafb" + "0f1aa264f581", + "f6003aed2098", + "5f39ee0a111a" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1403,23 +1382,22 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "bff57ba49c8b", - "88db645d6267", - "53954ecf4db4" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "0e83c4f2d85c", + "8d098092a97f", + "0f65a65096ff" ] } }, @@ -1429,16 +1407,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "74ace6b26c7d" + "0f1aa264f581", + "f6003aed2098", + "cc9ab010bdff" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1453,23 +1431,22 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "bff57ba49c8b", - "88db645d6267", - "53954ecf4db4" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "0e83c4f2d85c", + "8d098092a97f", + "0f65a65096ff" ] } }, @@ -1479,16 +1456,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "84a370049c5f" + "0f1aa264f581", + "f6003aed2098", + "1c37f311588f" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1503,23 +1480,22 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "bff57ba49c8b", - "88db645d6267", - "53954ecf4db4" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "0e83c4f2d85c", + "8d098092a97f", + "0f65a65096ff" ] } }, @@ -1529,16 +1505,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "98c724fa87df" + "0f1aa264f581", + "f6003aed2098", + "7f4d6b5a4c99" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1553,23 +1529,22 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "bff57ba49c8b", - "88db645d6267", - "53954ecf4db4" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "0e83c4f2d85c", + "8d098092a97f", + "0f65a65096ff" ] } }, @@ -1579,16 +1554,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "424eb405bbce" + "0f1aa264f581", + "f6003aed2098", + "ad1c64ff938a" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1603,23 +1578,22 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "9361b1a34966", - "88db645d6267", - "53954ecf4db4" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "fafc5b2f8260", + "8d098092a97f", + "0f65a65096ff" ] } }, @@ -1629,16 +1603,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "ec5b32385042" + "0f1aa264f581", + "f6003aed2098", + "c9b343e9992b" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1653,23 +1627,22 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "c180286bc513", - "88db645d6267", - "53954ecf4db4" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "751553d01f74", + "8d098092a97f", + "0f65a65096ff" ] } }, @@ -1679,16 +1652,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "4c85a08be215" + "0f1aa264f581", + "f6003aed2098", + "c26d1df91c18" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1703,23 +1676,22 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "512d99654670", - "88db645d6267", - "53954ecf4db4" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "c9ee089860fc", + "8d098092a97f", + "0f65a65096ff" ] } }, @@ -1729,16 +1701,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "840773c717c8" + "0f1aa264f581", + "f6003aed2098", + "0b0789528a70" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1753,23 +1725,22 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "30e01816f729", - "88db645d6267", - "53954ecf4db4" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "3a358ec06a2e", + "8d098092a97f", + "0f65a65096ff" ] } }, @@ -1779,16 +1750,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "d9169f17f695" + "0f1aa264f581", + "f6003aed2098", + "a6a517418ed9" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1803,23 +1774,22 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "3647b0f3edc5", - "88db645d6267", - "53954ecf4db4" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "fd895f7d7a4a", + "8d098092a97f", + "0f65a65096ff" ] } }, @@ -1829,16 +1799,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "c977f7f00437" + "0f1aa264f581", + "f6003aed2098", + "b61805111271" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1853,23 +1823,22 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "512d99654670", - "88db645d6267", - "53954ecf4db4" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "c9ee089860fc", + "8d098092a97f", + "0f65a65096ff" ] } } diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.resolveref-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.resolveref-1.json index 58cde3365b9..5e8553f5f4c 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.resolveref-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.resolveref-1.json @@ -4,337 +4,28 @@ "family": "tasks.project-board-load", "namedDeltas": [], "values": { - "00ef2dbe5026": { - "name": "github.project.resolveRef#1", - "ordinal": 21, - "args": [ - { - "name": "method", - "value": "github.project.resolveRef" - }, - { - "name": "params", - "value": { - "host": "github.com", - "input": "https://github.com/orgs/owner/projects/3" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-4", - "ok": true, - "result": { - "host": "github.com", - "number": 3, - "ok": true, - "owner": "owner", - "ownerType": "organization", - "title": "Board", - "viewNumber": 1 - } - } - } - }, - "0388fa155721": { - "name": "githubProjectError", - "ordinal": 11, - "value": "" - }, - "15cb97c93333": { - "name": "github.project.listViews#1", - "ordinal": 8, - "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3}}" - }, - "170fad8cb36b": { - "name": "githubProjectPartialFailures", - "ordinal": 6, - "value": [] - }, - "18730c72400e": { - "name": "githubProjectPasteError", - "ordinal": 23, - "value": "transport failure" - }, - "2085118de92f": { - "name": "githubProjectError", - "ordinal": 1, - "value": "" - }, - "2a8155b82ef9": { - "name": "githubProjectPasteError", - "ordinal": 23, - "value": "" - }, - "2ab1b35ff194": { - "error": "", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "34de2d655a0a": { + "0056704adc0b": { "name": "githubProjectTable", - "ordinal": 32, + "ordinal": 31, "value": { "$rpc": "null" } }, - "376c9e8bd72a": { - "error": "", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "$rpc": "null" - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "43352776b1e1": { - "name": "githubProjectTable", - "ordinal": 14, - "value": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - } - }, - "465d38db6be4": { - "name": "github.project.resolveRef#1", - "ordinal": 21, - "args": [ - { - "name": "method", - "value": "github.project.resolveRef" - }, - { - "name": "params", - "value": { - "host": "github.com", - "input": "https://github.com/orgs/owner/projects/3" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "error": { - "code": "method_not_found", - "message": "Unknown method" - }, - "id": "frame-4", - "ok": false - } - } - }, - "46c31323dfa8": { - "name": "github.project.resolveRef#1", - "ordinal": 21, - "args": [ - { - "name": "method", - "value": "github.project.resolveRef" - }, - { - "name": "params", - "value": { - "host": "github.com", - "input": "https://github.com/orgs/owner/projects/3" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-4", - "ok": true, - "result": { - "$rpc": "null" - } - } - } - }, - "47507819e28a": { - "name": "githubProjectPasteInput", - "ordinal": 23, + "060dcedb3fdb": { + "name": "githubProjectError", + "ordinal": 10, "value": "" }, - "4eb521bbefdd": { - "name": "githubProjectSearch", - "ordinal": 15, - "value": "is:open" - }, - "5024dbdf5e74": { - "name": "github.project.resolveRef#1", - "ordinal": 21, - "args": [ - { - "name": "method", - "value": "github.project.resolveRef" - }, - { - "name": "params", - "value": { - "host": "github.com", - "input": "https://github.com/orgs/owner/projects/3" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "error": { - "code": "refused", - "message": "outer refused" - }, - "id": "frame-4", - "ok": false - } + "0af48d475813": { + "name": "appliedGithubProjectSearch", + "ordinal": 29, + "value": { + "$rpc": "undefined" } }, - "528af16518e6": { - "name": "githubProjectViews", - "ordinal": 16, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "542d281c736b": { - "error": "", - "loading": false, - "pasteError": "inner refused", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "5951b5b05f73": { + "0ca4eea3be22": { "name": "github.project.resolveRef#1", - "ordinal": 21, + "ordinal": 20, "args": [ { "name": "method", @@ -365,19 +56,9 @@ } } }, - "5a4fc5c86d0c": { - "name": "githubProjectPasteBusy", - "ordinal": 34, - "value": false - }, - "5d6bee5dd65e": { - "name": "githubProjectPasteError", - "ordinal": 23, - "value": "inner refused" - }, - "5f5f56db9d64": { + "0f1aa264f581": { "name": "github.project.viewTable#1", - "ordinal": 12, + "ordinal": 11, "args": [ { "name": "method", @@ -429,20 +110,36 @@ } } }, - "61ce1ab88e79": { - "name": "github.project.viewTable#1", - "ordinal": 13, - "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.viewTable\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3,\"viewId\":\"view-1\"}}" + "15cb97c93333": { + "name": "github.project.listViews#1", + "ordinal": 8, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3}}" }, - "654693493b51": { - "name": "githubProjectLoading", - "ordinal": 10, - "value": true + "170fad8cb36b": { + "name": "githubProjectPartialFailures", + "ordinal": 6, + "value": [] }, - "685bc2bda05d": { - "name": "githubProjects", - "ordinal": 5, - "value": [ + "1b3350f71e56": { + "name": "githubProjectError", + "ordinal": 19, + "value": "" + }, + "2085118de92f": { + "name": "githubProjectError", + "ordinal": 1, + "value": "" + }, + "26921f3a7c09": { + "name": "githubProjectPasteError", + "ordinal": 18, + "value": "" + }, + "2ab1b35ff194": { + "error": "", + "loading": false, + "pasteError": "", + "projects": [ { "host": "github.com", "number": 3, @@ -450,26 +147,113 @@ "ownerType": "organization", "title": "Board" } + ], + "table": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } ] }, - "7a9df0d1a484": { + "2f290fa2acf5": { "name": "githubProjectLoading", - "ordinal": 25, + "ordinal": 9, "value": true }, - "7b9d3b33c08b": { - "name": "githubProjectPasteError", - "ordinal": 19, - "value": "" - }, - "8792541c60ad": { - "name": "githubProjectError", - "ordinal": 26, - "value": "" - }, - "8a72ceddc317": { + "31ab0657cc7f": { "name": "github.project.resolveRef#1", - "ordinal": 21, + "ordinal": 20, + "args": [ + { + "name": "method", + "value": "github.project.resolveRef" + }, + { + "name": "params", + "value": { + "host": "github.com", + "input": "https://github.com/orgs/owner/projects/3" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "", + "isRpcDeliveryUnknown": true + } + } + }, + "3493818a7239": { + "name": "githubProjectPasteBusy", + "ordinal": 33, + "value": false + }, + "376c9e8bd72a": { + "error": "", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "$rpc": "null" + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "391bce43fe1e": { + "name": "githubProjectPasteError", + "ordinal": 22, + "value": "outer refused" + }, + "3985399034a2": { + "name": "githubProjectPasteBusy", + "ordinal": 17, + "value": true + }, + "3a7b38a0c9ac": { + "name": "github.project.resolveRef#1", + "ordinal": 20, "args": [ { "name": "method", @@ -494,29 +278,106 @@ "startedAt": 0, "settledAt": 0, "value": { + "error": { + "code": "method_not_found", + "message": "Unknown method" + }, "id": "frame-4", - "ok": true + "ok": false } } }, - "8adfaab42f53": { - "name": "githubProjectPasteError", + "3a8617cc8fd8": { + "name": "githubProjectSearch", + "ordinal": 14, + "value": "is:open" + }, + "443c462833d9": { + "name": "githubProjectPasteBusy", "ordinal": 23, - "value": "The host sent a reply this app could not read (github.project.resolveRef)" + "value": false }, - "8e4dec1aad1f": { - "name": "github.project.listViews#2", + "4809ea7ad5b0": { + "name": "github.project.viewTable#1", + "ordinal": 12, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.viewTable\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3,\"viewId\":\"view-1\"}}" + }, + "4c9b1e4ad1f5": { + "name": "githubProjectViews", "ordinal": 28, - "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] }, - "8f3ee6c510b1": { - "name": "github.project.resolveRef#1", + "542d281c736b": { + "error": "", + "loading": false, + "pasteError": "inner refused", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "685bc2bda05d": { + "name": "githubProjects", + "ordinal": 5, + "value": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ] + }, + "6b03ace1146a": { + "name": "githubProjectError", + "ordinal": 25, + "value": "" + }, + "7077303e9304": { + "name": "githubProjectPasteError", "ordinal": 22, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" + "value": "" }, - "8fde76b45dd3": { + "739b3c66b6a2": { "name": "github.project.resolveRef#1", - "ordinal": 21, + "ordinal": 20, "args": [ { "name": "method", @@ -549,6 +410,69 @@ } } }, + "788e250ac87a": { + "name": "githubProjectPasteError", + "ordinal": 22, + "value": "transport failure" + }, + "7aa0558cb955": { + "name": "github.project.resolveRef#1", + "ordinal": 20, + "args": [ + { + "name": "method", + "value": "github.project.resolveRef" + }, + { + "name": "params", + "value": { + "host": "github.com", + "input": "https://github.com/orgs/owner/projects/3" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "error": { + "code": "refused", + "message": "outer refused" + }, + "id": "frame-4", + "ok": false + } + } + }, + "7d488eda1d1c": { + "name": "githubProjectViews", + "ordinal": 15, + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "842c950ee7cc": { + "name": "githubProjectLoading", + "ordinal": 16, + "value": false + }, + "8a0577280bad": { + "name": "showGitHubProjectPicker", + "ordinal": 23, + "value": false + }, "933fa40d28dd": { "error": "", "loading": false, @@ -587,17 +511,15 @@ } ] }, - "9b9f8dd75514": { - "name": "githubProjectViews", - "ordinal": 9, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] + "97bc7dc12b92": { + "name": "githubProjectLoading", + "ordinal": 32, + "value": false + }, + "9f9a21ac7b9e": { + "name": "github.project.listViews#2", + "ordinal": 27, + "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" }, "9fa2b69acf20": { "error": "", @@ -637,16 +559,61 @@ } ] }, - "a4a1ff5df287": { - "name": "githubProjectPasteBusy", - "ordinal": 18, - "value": true - }, "a5a3530ec11c": { "name": "githubProjectPartialFailures", "ordinal": 2, "value": [] }, + "ab1b10183665": { + "name": "githubProjectLoading", + "ordinal": 24, + "value": true + }, + "ae89e058b351": { + "name": "github.project.listViews#2", + "ordinal": 26, + "args": [ + { + "name": "method", + "value": "github.project.listViews" + }, + { + "name": "params", + "value": { + "host": "github.com", + "owner": "owner", + "ownerType": "organization", + "projectNumber": 3 + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-5", + "ok": true, + "result": { + "ok": true, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + } + } + } + }, "afec7622eabf": { "error": "", "loading": false, @@ -690,21 +657,19 @@ "ordinal": 4, "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listAccessible\",\"params\":{\"host\":\"github.com\"}}" }, - "b49ff9f109a5": { - "name": "github.project.listViews#2", - "ordinal": 27, + "b9a0bb850981": { + "name": "github.project.resolveRef#1", + "ordinal": 20, "args": [ { "name": "method", - "value": "github.project.listViews" + "value": "github.project.resolveRef" }, { "name": "params", "value": { "host": "github.com", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3 + "input": "https://github.com/orgs/owner/projects/3" } }, { @@ -719,48 +684,47 @@ "startedAt": 0, "settledAt": 0, "value": { - "id": "frame-5", - "ok": true, - "result": { - "ok": true, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - } + "error": { + "code": "refused", + "message": "" + }, + "id": "frame-4", + "ok": false } } }, - "b5e354ed6023": { - "name": "githubProjectLoading", - "ordinal": 17, - "value": false - }, - "b66c4f75c9ae": { - "name": "githubProjectViews", - "ordinal": 29, - "value": [ + "bafe760119a6": { + "name": "github.project.resolveRef#1", + "ordinal": 20, + "args": [ { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 + "name": "method", + "value": "github.project.resolveRef" + }, + { + "name": "params", + "value": { + "host": "github.com", + "input": "https://github.com/orgs/owner/projects/3" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } } - ] - }, - "b6df36be8f90": { - "name": "githubProjectPasteError", - "ordinal": 23, - "value": "outer refused" - }, - "bc2bd1d942ef": { - "name": "githubProjectPasteError", - "ordinal": 23, - "value": "Connection closed" + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } }, "be0da5b53ffb": { "status": "fulfilled", @@ -775,24 +739,14 @@ } ] }, - "c453f220a7e2": { - "name": "githubProjectLoading", - "ordinal": 33, - "value": false - }, - "c4c4250b0567": { - "name": "showGitHubProjectPicker", - "ordinal": 24, - "value": false - }, - "c515348730c9": { - "name": "githubProjectPasteBusy", - "ordinal": 24, - "value": false - }, - "cc98f00a21a3": { + "be93253869e6": { "name": "github.project.resolveRef#1", "ordinal": 21, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" + }, + "c14b88cb8a3c": { + "name": "github.project.resolveRef#1", + "ordinal": 20, "args": [ { "name": "method", @@ -818,16 +772,40 @@ "settledAt": 0, "value": { "id": "frame-4", - "ok": true, - "result": { - "error": { - "message": "inner refused" - }, - "ok": false - } + "ok": true } } }, + "c5c018cf9a70": { + "name": "githubProjectTable", + "ordinal": 13, + "value": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + } + }, + "cb9760e05f8b": { + "name": "githubProjectPasteError", + "ordinal": 22, + "value": "inner refused" + }, + "cdbe61ef88d1": { + "name": "githubProjectPasteError", + "ordinal": 22, + "value": "Unknown method" + }, "d254913957c1": { "name": "github.project.listViews#1", "ordinal": 7, @@ -873,39 +851,6 @@ } } }, - "d4d16c7bdef6": { - "name": "github.project.resolveRef#1", - "ordinal": 21, - "args": [ - { - "name": "method", - "value": "github.project.resolveRef" - }, - { - "name": "params", - "value": { - "host": "github.com", - "input": "https://github.com/orgs/owner/projects/3" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true - } - } - }, "d76c24e12352": { "error": "", "loading": false, @@ -944,9 +889,14 @@ } ] }, - "df21422c7f88": { + "da1ff0cf92cb": { + "name": "githubProjectPasteError", + "ordinal": 22, + "value": "Connection closed" + }, + "dbfc3ca85bba": { "name": "github.project.resolveRef#1", - "ordinal": 21, + "ordinal": 20, "args": [ { "name": "method", @@ -980,6 +930,46 @@ } } }, + "dc8dd7739c49": { + "name": "githubProjectPasteInput", + "ordinal": 22, + "value": "" + }, + "df1869ad0832": { + "name": "github.project.resolveRef#1", + "ordinal": 20, + "args": [ + { + "name": "method", + "value": "github.project.resolveRef" + }, + { + "name": "params", + "value": { + "host": "github.com", + "input": "https://github.com/orgs/owner/projects/3" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "$rpc": "null" + } + } + } + }, "dfe16215433b": { "name": "github.project.listAccessible#1", "ordinal": 3, @@ -1024,9 +1014,9 @@ } } }, - "e30593392371": { + "e0b72749150e": { "name": "github.project.resolveRef#1", - "ordinal": 21, + "ordinal": 20, "args": [ { "name": "method", @@ -1051,19 +1041,26 @@ "startedAt": 0, "settledAt": 0, "value": { - "error": { - "code": "refused", - "message": "" - }, "id": "frame-4", - "ok": false + "ok": true, + "result": { + "error": { + "message": "inner refused" + }, + "ok": false + } } } }, - "e44d2225bc12": { + "e5561b967e66": { "name": "githubProjectPasteError", - "ordinal": 23, - "value": "Unknown method" + "ordinal": 22, + "value": "The host sent a reply this app could not read (github.project.resolveRef)" + }, + "e87bea4bcd3c": { + "name": "githubProjectSearch", + "ordinal": 30, + "value": "" }, "eb79a9b3682a": { "status": "fulfilled", @@ -1073,9 +1070,9 @@ "$rpc": "undefined" } }, - "f938107bbefd": { + "f6003aed2098": { "name": "github.project.resolveRef#1", - "ordinal": 21, + "ordinal": 20, "args": [ { "name": "method", @@ -1096,33 +1093,24 @@ } ], "settlement": { - "status": "rejected", + "status": "fulfilled", "startedAt": 0, "settledAt": 0, - "error": { - "category": "Error", - "message": "", - "isRpcDeliveryUnknown": true + "value": { + "id": "frame-4", + "ok": true, + "result": { + "host": "github.com", + "number": 3, + "ok": true, + "owner": "owner", + "ownerType": "organization", + "title": "Board", + "viewNumber": 1 + } } } }, - "fa1d1b339394": { - "name": "appliedGithubProjectSearch", - "ordinal": 30, - "value": { - "$rpc": "undefined" - } - }, - "fb9764680a74": { - "name": "githubProjectError", - "ordinal": 20, - "value": "" - }, - "fe075936e563": { - "name": "githubProjectSearch", - "ordinal": 31, - "value": "" - }, "ff43b5ec92a9": { "error": "", "loading": false, @@ -1168,21 +1156,15 @@ "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb" }, - "state": "376c9e8bd72a", - "effects": [ - "2085118de92f", - "a5a3530ec11c", - "685bc2bda05d", - "170fad8cb36b", - "9b9f8dd75514" - ] + "state": "ff43b5ec92a9", + "effects": ["2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b"] } }, { "id": "tk-project-board-load.prelude:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1195,21 +1177,20 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc" ] } }, { "id": "tk-project-board-load.prelude:cleanup", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64", "d4d16c7bdef6"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79", "8f3ee6c510b1"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581", "bafe760119a6"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0", "be93253869e6"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1223,18 +1204,17 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "bc2bd1d942ef", - "c515348730c9" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "da1ff0cf92cb", + "443c462833d9" ] } }, @@ -1244,16 +1224,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "b49ff9f109a5" + "0f1aa264f581", + "f6003aed2098", + "ae89e058b351" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1268,34 +1248,33 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "b66c4f75c9ae", - "fa1d1b339394", - "fe075936e563", - "34de2d655a0a", - "c453f220a7e2", - "5a4fc5c86d0c" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "4c9b1e4ad1f5", + "0af48d475813", + "e87bea4bcd3c", + "0056704adc0b", + "97bc7dc12b92", + "3493818a7239" ] } }, { "id": "tk-project-board-load.result-absent:paste-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64", "8a72ceddc317"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79", "8f3ee6c510b1"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581", "c14b88cb8a3c"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0", "be93253869e6"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1309,26 +1288,25 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "8adfaab42f53", - "c515348730c9" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "e5561b967e66", + "443c462833d9" ] } }, { "id": "tk-project-board-load.result-null:paste-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64", "46c31323dfa8"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79", "8f3ee6c510b1"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581", "df1869ad0832"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0", "be93253869e6"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1342,26 +1320,25 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "8adfaab42f53", - "c515348730c9" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "e5561b967e66", + "443c462833d9" ] } }, { "id": "tk-project-board-load.inner-ok-missing:paste-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64", "8fde76b45dd3"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79", "8f3ee6c510b1"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581", "739b3c66b6a2"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0", "be93253869e6"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1375,26 +1352,25 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "8adfaab42f53", - "c515348730c9" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "e5561b967e66", + "443c462833d9" ] } }, { "id": "tk-project-board-load.inner-false-string-error:paste-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64", "df21422c7f88"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79", "8f3ee6c510b1"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581", "dbfc3ca85bba"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0", "be93253869e6"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1408,26 +1384,25 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "8adfaab42f53", - "c515348730c9" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "e5561b967e66", + "443c462833d9" ] } }, { "id": "tk-project-board-load.inner-false-object-error:paste-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64", "cc98f00a21a3"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79", "8f3ee6c510b1"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581", "e0b72749150e"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0", "be93253869e6"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1441,26 +1416,25 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "5d6bee5dd65e", - "c515348730c9" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "cb9760e05f8b", + "443c462833d9" ] } }, { "id": "tk-project-board-load.outer-refused:paste-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64", "5024dbdf5e74"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79", "8f3ee6c510b1"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581", "7aa0558cb955"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0", "be93253869e6"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1474,26 +1448,25 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "b6df36be8f90", - "c515348730c9" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "391bce43fe1e", + "443c462833d9" ] } }, { "id": "tk-project-board-load.outer-refused-no-message:paste-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64", "e30593392371"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79", "8f3ee6c510b1"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581", "b9a0bb850981"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0", "be93253869e6"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1507,26 +1480,25 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "2a8155b82ef9", - "c515348730c9" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "7077303e9304", + "443c462833d9" ] } }, { "id": "tk-project-board-load.method-not-found:paste-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64", "465d38db6be4"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79", "8f3ee6c510b1"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581", "3a7b38a0c9ac"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0", "be93253869e6"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1540,26 +1512,25 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "e44d2225bc12", - "c515348730c9" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "cdbe61ef88d1", + "443c462833d9" ] } }, { "id": "tk-project-board-load.transport-rejection:paste-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64", "5951b5b05f73"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79", "8f3ee6c510b1"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581", "0ca4eea3be22"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0", "be93253869e6"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1573,26 +1544,25 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "18730c72400e", - "c515348730c9" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "788e250ac87a", + "443c462833d9" ] } }, { "id": "tk-project-board-load.transport-rejection-no-message:paste-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64", "f938107bbefd"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79", "8f3ee6c510b1"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581", "31ab0657cc7f"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0", "be93253869e6"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1606,18 +1576,17 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "2a8155b82ef9", - "c515348730c9" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "7077303e9304", + "443c462833d9" ] } } diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.viewtable-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.viewtable-1.json index d70e7f92067..3a719362572 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.viewtable-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.viewtable-1.json @@ -11,90 +11,26 @@ "$rpc": "null" } }, - "00ef2dbe5026": { - "name": "github.project.resolveRef#1", - "ordinal": 21, - "args": [ - { - "name": "method", - "value": "github.project.resolveRef" - }, - { - "name": "params", - "value": { - "host": "github.com", - "input": "https://github.com/orgs/owner/projects/3" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-4", - "ok": true, - "result": { - "host": "github.com", - "number": 3, - "ok": true, - "owner": "owner", - "ownerType": "organization", - "title": "Board", - "viewNumber": 1 - } - } - } - }, - "0388fa155721": { - "name": "githubProjectError", - "ordinal": 11, + "03fc33b06333": { + "name": "githubProjectPasteError", + "ordinal": 17, "value": "" }, - "044db2a7250c": { - "name": "github.project.viewTable#1", - "ordinal": 12, - "args": [ - { - "name": "method", - "value": "github.project.viewTable" - }, - { - "name": "params", - "value": { - "host": "github.enterprise.test", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3, - "viewId": "view-1" - } - }, - { - "name": "options", - "value": { - "timeoutMs": 60000 - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true - } + "060dcedb3fdb": { + "name": "githubProjectError", + "ordinal": 10, + "value": "" + }, + "0af48d475813": { + "name": "appliedGithubProjectSearch", + "ordinal": 29, + "value": { + "$rpc": "undefined" } }, - "08b8713b9aa5": { + "0d97c3fd4fe1": { "name": "github.project.viewTable#1", - "ordinal": 12, + "ordinal": 11, "args": [ { "name": "method", @@ -131,308 +67,9 @@ } } }, - "0af48d475813": { - "name": "appliedGithubProjectSearch", - "ordinal": 29, - "value": { - "$rpc": "undefined" - } - }, - "0efd754f1a5c": { - "name": "githubProjectError", - "ordinal": 15, - "value": "The host sent a reply this app could not read (github.project.viewTable)" - }, - "15cb97c93333": { - "name": "github.project.listViews#1", - "ordinal": 8, - "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3}}" - }, - "170fad8cb36b": { - "name": "githubProjectPartialFailures", - "ordinal": 6, - "value": [] - }, - "1b3350f71e56": { - "name": "githubProjectError", - "ordinal": 19, - "value": "" - }, - "1da3c3839c7a": { - "name": "githubProjectError", - "ordinal": 15, - "value": "transport failure" - }, - "2085118de92f": { - "name": "githubProjectError", - "ordinal": 1, - "value": "" - }, - "26921f3a7c09": { - "name": "githubProjectPasteError", - "ordinal": 18, - "value": "" - }, - "273acec61723": { + "0f1aa264f581": { "name": "github.project.viewTable#1", - "ordinal": 12, - "args": [ - { - "name": "method", - "value": "github.project.viewTable" - }, - { - "name": "params", - "value": { - "host": "github.enterprise.test", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3, - "viewId": "view-1" - } - }, - { - "name": "options", - "value": { - "timeoutMs": 60000 - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true, - "result": { - "$rpc": "null" - } - } - } - }, - "2a4866c4dda3": { - "error": "outer refused", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "$rpc": "null" - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "2ab1b35ff194": { - "error": "", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "2fc294f6693b": { - "error": "The host sent a reply this app could not read (github.project.viewTable)", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "$rpc": "null" - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "3493818a7239": { - "name": "githubProjectPasteBusy", - "ordinal": 33, - "value": false - }, - "34de2d655a0a": { - "name": "githubProjectTable", - "ordinal": 32, - "value": { - "$rpc": "null" - } - }, - "376c9e8bd72a": { - "error": "", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "$rpc": "null" - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "3985399034a2": { - "name": "githubProjectPasteBusy", - "ordinal": 17, - "value": true - }, - "43352776b1e1": { - "name": "githubProjectTable", - "ordinal": 14, - "value": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - } - }, - "47507819e28a": { - "name": "githubProjectPasteInput", - "ordinal": 23, - "value": "" - }, - "4c9b1e4ad1f5": { - "name": "githubProjectViews", - "ordinal": 28, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "4eb521bbefdd": { - "name": "githubProjectSearch", - "ordinal": 15, - "value": "is:open" - }, - "528af16518e6": { - "name": "githubProjectViews", - "ordinal": 16, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "56f0120745a9": { - "error": "inner refused", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "$rpc": "null" - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "5a4fc5c86d0c": { - "name": "githubProjectPasteBusy", - "ordinal": 34, - "value": false - }, - "5abab014ad66": { - "name": "githubProjectError", - "ordinal": 15, - "value": "" - }, - "5f5f56db9d64": { - "name": "github.project.viewTable#1", - "ordinal": 12, + "ordinal": 11, "args": [ { "name": "method", @@ -484,37 +121,34 @@ } } }, - "61ce1ab88e79": { - "name": "github.project.viewTable#1", - "ordinal": 13, - "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.viewTable\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3,\"viewId\":\"view-1\"}}" + "15cb97c93333": { + "name": "github.project.listViews#1", + "ordinal": 8, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3}}" }, - "654693493b51": { - "name": "githubProjectLoading", - "ordinal": 10, - "value": true + "170fad8cb36b": { + "name": "githubProjectPartialFailures", + "ordinal": 6, + "value": [] }, - "685bc2bda05d": { - "name": "githubProjects", - "ordinal": 5, - "value": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ] - }, - "6b03ace1146a": { + "1b3350f71e56": { "name": "githubProjectError", - "ordinal": 25, + "ordinal": 19, "value": "" }, - "712a0bd65cc5": { + "1cb3b185586b": { + "name": "githubProjectLoading", + "ordinal": 31, + "value": false + }, + "2085118de92f": { + "name": "githubProjectError", + "ordinal": 1, + "value": "" + }, + "20a31104f552": { "name": "github.project.viewTable#1", - "ordinal": 12, + "ordinal": 11, "args": [ { "name": "method", @@ -538,67 +172,34 @@ } ], "settlement": { - "status": "fulfilled", + "status": "rejected", "startedAt": 0, "settledAt": 0, - "value": { - "error": { - "code": "refused", - "message": "outer refused" - }, - "id": "frame-3", - "ok": false + "error": { + "category": "Error", + "message": "", + "isRpcDeliveryUnknown": true } } }, - "74f8ab788f2e": { - "error": "", - "loading": true, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "$rpc": "null" - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "7a9df0d1a484": { - "name": "githubProjectLoading", - "ordinal": 25, - "value": true - }, - "7b9d3b33c08b": { - "name": "githubProjectPasteError", - "ordinal": 19, + "223225c09f07": { + "name": "githubProjectSearch", + "ordinal": 29, "value": "" }, - "842c950ee7cc": { - "name": "githubProjectLoading", - "ordinal": 16, - "value": false - }, - "8792541c60ad": { + "225520fed6bc": { "name": "githubProjectError", - "ordinal": 26, + "ordinal": 14, + "value": "Unknown method" + }, + "24c9c9ebd660": { + "name": "githubProjectError", + "ordinal": 14, "value": "" }, - "882fad444878": { + "255654e42ca3": { "name": "github.project.viewTable#1", - "ordinal": 12, + "ordinal": 11, "args": [ { "name": "method", @@ -629,34 +230,201 @@ "id": "frame-3", "ok": true, "result": { - "error": "refused" + "error": "inner refused", + "ok": false } } } }, - "8a0577280bad": { - "name": "showGitHubProjectPicker", - "ordinal": 23, - "value": false + "26921f3a7c09": { + "name": "githubProjectPasteError", + "ordinal": 18, + "value": "" }, - "8e4dec1aad1f": { - "name": "github.project.listViews#2", - "ordinal": 28, - "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" + "2ab1b35ff194": { + "error": "", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] }, - "8f3ee6c510b1": { - "name": "github.project.resolveRef#1", - "ordinal": 22, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" - }, - "97bc7dc12b92": { + "2f290fa2acf5": { "name": "githubProjectLoading", - "ordinal": 32, + "ordinal": 9, + "value": true + }, + "314fcc8d93cf": { + "name": "githubProjectError", + "ordinal": 14, + "value": "inner refused" + }, + "32e88f5c4657": { + "name": "githubProjectPasteInput", + "ordinal": 21, + "value": "" + }, + "3493818a7239": { + "name": "githubProjectPasteBusy", + "ordinal": 33, "value": false }, - "9883026698a2": { + "376c9e8bd72a": { + "error": "", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "$rpc": "null" + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "386bb2eaf03b": { + "name": "githubProjectError", + "ordinal": 14, + "value": "transport failure" + }, + "3985399034a2": { + "name": "githubProjectPasteBusy", + "ordinal": 17, + "value": true + }, + "3a8617cc8fd8": { + "name": "githubProjectSearch", + "ordinal": 14, + "value": "is:open" + }, + "3b234269eaf1": { + "error": "inner refused", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "$rpc": "null" + }, + "views": [] + }, + "40f6e42cd4ab": { + "name": "github.project.viewTable#1", + "ordinal": 11, + "args": [ + { + "name": "method", + "value": "github.project.viewTable" + }, + { + "name": "params", + "value": { + "host": "github.enterprise.test", + "owner": "owner", + "ownerType": "organization", + "projectNumber": 3, + "viewId": "view-1" + } + }, + { + "name": "options", + "value": { + "timeoutMs": 60000 + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } + }, + "4809ea7ad5b0": { "name": "github.project.viewTable#1", "ordinal": 12, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.viewTable\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3,\"viewId\":\"view-1\"}}" + }, + "4c9b1e4ad1f5": { + "name": "githubProjectViews", + "ordinal": 28, + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "4dd8cc8f777d": { + "name": "appliedGithubProjectSearch", + "ordinal": 28, + "value": { + "$rpc": "undefined" + } + }, + "4dff29ea88de": { + "name": "github.project.resolveRef#1", + "ordinal": 20, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" + }, + "557d7f2cc92b": { + "name": "github.project.viewTable#1", + "ordinal": 11, "args": [ { "name": "method", @@ -684,55 +452,26 @@ "startedAt": 0, "settledAt": 0, "value": { - "error": { - "code": "refused", - "message": "" - }, "id": "frame-3", - "ok": false + "ok": true } } }, - "9b9f8dd75514": { - "name": "githubProjectViews", - "ordinal": 9, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "9bdd7e2522fe": { - "name": "githubProjectError", - "ordinal": 15, - "value": "inner refused" - }, - "9f9a21ac7b9e": { - "name": "github.project.listViews#2", - "ordinal": 27, - "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" - }, - "a093143e7c52": { - "name": "githubProjectError", - "ordinal": 15, - "value": "Unknown method" - }, - "a4a1ff5df287": { + "5a7676ce26d6": { "name": "githubProjectPasteBusy", - "ordinal": 18, - "value": true + "ordinal": 32, + "value": false }, - "a5a3530ec11c": { - "name": "githubProjectPartialFailures", - "ordinal": 2, - "value": [] + "5c93fbf94a2d": { + "name": "githubProjectTable", + "ordinal": 30, + "value": { + "$rpc": "null" + } }, - "a8981fbe7e87": { + "684390d0103b": { "name": "github.project.viewTable#1", - "ordinal": 12, + "ordinal": 11, "args": [ { "name": "method", @@ -766,11 +505,269 @@ } } }, + "685bc2bda05d": { + "name": "githubProjects", + "ordinal": 5, + "value": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ] + }, + "6b03ace1146a": { + "name": "githubProjectError", + "ordinal": 25, + "value": "" + }, + "6d7ebc9b7830": { + "name": "github.project.listViews#2", + "ordinal": 25, + "args": [ + { + "name": "method", + "value": "github.project.listViews" + }, + { + "name": "params", + "value": { + "host": "github.com", + "owner": "owner", + "ownerType": "organization", + "projectNumber": 3 + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-5", + "ok": true, + "result": { + "ok": true, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + } + } + } + }, + "76df36bab005": { + "error": "The host sent a reply this app could not read (github.project.viewTable)", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "$rpc": "null" + }, + "views": [] + }, + "7733d6566538": { + "name": "githubProjectError", + "ordinal": 14, + "value": "outer refused" + }, + "79fdb5f09c0a": { + "name": "github.project.viewTable#1", + "ordinal": 11, + "args": [ + { + "name": "method", + "value": "github.project.viewTable" + }, + { + "name": "params", + "value": { + "host": "github.enterprise.test", + "owner": "owner", + "ownerType": "organization", + "projectNumber": 3, + "viewId": "view-1" + } + }, + { + "name": "options", + "value": { + "timeoutMs": 60000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "$rpc": "null" + } + } + } + }, + "7d488eda1d1c": { + "name": "githubProjectViews", + "ordinal": 15, + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "7d7e6f5ce421": { + "name": "github.project.resolveRef#1", + "ordinal": 19, + "args": [ + { + "name": "method", + "value": "github.project.resolveRef" + }, + { + "name": "params", + "value": { + "host": "github.com", + "input": "https://github.com/orgs/owner/projects/3" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "host": "github.com", + "number": 3, + "ok": true, + "owner": "owner", + "ownerType": "organization", + "title": "Board", + "viewNumber": 1 + } + } + } + }, + "842c950ee7cc": { + "name": "githubProjectLoading", + "ordinal": 16, + "value": false + }, + "853d951cf70a": { + "name": "githubProjectError", + "ordinal": 18, + "value": "" + }, + "8a0577280bad": { + "name": "showGitHubProjectPicker", + "ordinal": 23, + "value": false + }, + "8dd2b5b6a8af": { + "name": "githubProjectError", + "ordinal": 14, + "value": "Connection closed" + }, + "97bc7dc12b92": { + "name": "githubProjectLoading", + "ordinal": 32, + "value": false + }, + "9ac407eccd6f": { + "error": "", + "loading": true, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "$rpc": "null" + }, + "views": [] + }, + "9f9a21ac7b9e": { + "name": "github.project.listViews#2", + "ordinal": 27, + "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" + }, + "9fca7187b60f": { + "name": "githubProjectError", + "ordinal": 14, + "value": "The host sent a reply this app could not read (github.project.viewTable)" + }, + "a4635ab3551f": { + "name": "githubProjectLoading", + "ordinal": 15, + "value": false + }, + "a5a3530ec11c": { + "name": "githubProjectPartialFailures", + "ordinal": 2, + "value": [] + }, "ab1b10183665": { "name": "githubProjectLoading", "ordinal": 24, "value": true }, + "ac891a7d42d5": { + "error": "transport failure", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "$rpc": "null" + }, + "views": [] + }, "ae89e058b351": { "name": "github.project.listViews#2", "ordinal": 26, @@ -816,109 +813,9 @@ } } }, - "b42c8edc0d53": { - "name": "github.project.listAccessible#1", - "ordinal": 4, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listAccessible\",\"params\":{\"host\":\"github.com\"}}" - }, - "b49ff9f109a5": { - "name": "github.project.listViews#2", - "ordinal": 27, - "args": [ - { - "name": "method", - "value": "github.project.listViews" - }, - { - "name": "params", - "value": { - "host": "github.com", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3 - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-5", - "ok": true, - "result": { - "ok": true, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - } - } - } - }, - "b5e354ed6023": { - "name": "githubProjectLoading", - "ordinal": 17, - "value": false - }, - "b66c4f75c9ae": { - "name": "githubProjectViews", - "ordinal": 29, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "bb54b9df1041": { - "name": "githubProjectError", - "ordinal": 15, - "value": "Connection closed" - }, - "be0da5b53ffb": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "be93253869e6": { - "name": "github.project.resolveRef#1", - "ordinal": 21, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" - }, - "c453f220a7e2": { - "name": "githubProjectLoading", - "ordinal": 33, - "value": false - }, - "c4c4250b0567": { - "name": "showGitHubProjectPicker", - "ordinal": 24, - "value": false - }, - "c95a406e53e5": { + "aefed6d1365a": { "name": "github.project.viewTable#1", - "ordinal": 12, + "ordinal": 11, "args": [ { "name": "method", @@ -942,16 +839,140 @@ } ], "settlement": { - "status": "rejected", + "status": "fulfilled", "startedAt": 0, "settledAt": 0, - "error": { - "category": "Error", - "message": "", - "isRpcDeliveryUnknown": true + "value": { + "error": { + "code": "refused", + "message": "" + }, + "id": "frame-3", + "ok": false } } }, + "b0c25dac9d8e": { + "name": "github.project.listViews#2", + "ordinal": 26, + "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" + }, + "b42c8edc0d53": { + "name": "github.project.listAccessible#1", + "ordinal": 4, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listAccessible\",\"params\":{\"host\":\"github.com\"}}" + }, + "b5f49e20fef1": { + "name": "showGitHubProjectPicker", + "ordinal": 22, + "value": false + }, + "be0da5b53ffb": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "be93253869e6": { + "name": "github.project.resolveRef#1", + "ordinal": 21, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" + }, + "c5c018cf9a70": { + "name": "githubProjectTable", + "ordinal": 13, + "value": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + } + }, + "c930bdc29ecd": { + "error": "Unknown method", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "$rpc": "null" + }, + "views": [] + }, + "cf71fba0b2df": { + "name": "github.project.viewTable#1", + "ordinal": 11, + "args": [ + { + "name": "method", + "value": "github.project.viewTable" + }, + { + "name": "params", + "value": { + "host": "github.enterprise.test", + "owner": "owner", + "ownerType": "organization", + "projectNumber": 3, + "viewId": "view-1" + } + }, + { + "name": "options", + "value": { + "timeoutMs": 60000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "error": "refused" + } + } + } + }, + "d0248d16609f": { + "name": "githubProjectViews", + "ordinal": 27, + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, "d254913957c1": { "name": "github.project.listViews#1", "ordinal": 7, @@ -997,120 +1018,16 @@ } } }, - "da50b440ea30": { - "name": "githubProjectTable", - "ordinal": 14, - "value": { - "$rpc": "null" - } - }, - "dc231c7924ca": { - "name": "github.project.viewTable#1", - "ordinal": 12, - "args": [ - { - "name": "method", - "value": "github.project.viewTable" - }, - { - "name": "params", - "value": { - "host": "github.enterprise.test", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3, - "viewId": "view-1" - } - }, - { - "name": "options", - "value": { - "timeoutMs": 60000 - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true, - "result": { - "error": { - "message": "inner refused" - }, - "ok": false - } - } - } + "d494afc83352": { + "name": "githubProjectError", + "ordinal": 24, + "value": "" }, "dc8dd7739c49": { "name": "githubProjectPasteInput", "ordinal": 22, "value": "" }, - "de19f9b2e75a": { - "error": "transport failure", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "$rpc": "null" - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "df77a1fd9072": { - "name": "github.project.viewTable#1", - "ordinal": 12, - "args": [ - { - "name": "method", - "value": "github.project.viewTable" - }, - { - "name": "params", - "value": { - "host": "github.enterprise.test", - "owner": "owner", - "ownerType": "organization", - "projectNumber": 3, - "viewId": "view-1" - } - }, - { - "name": "options", - "value": { - "timeoutMs": 60000 - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true - } - } - }, "dfe16215433b": { "name": "github.project.listAccessible#1", "ordinal": 3, @@ -1155,16 +1072,75 @@ } } }, - "e3836d43e8f9": { - "name": "githubProjectError", - "ordinal": 15, - "value": "outer refused" + "e585e7eb63ee": { + "name": "github.project.viewTable#1", + "ordinal": 11, + "args": [ + { + "name": "method", + "value": "github.project.viewTable" + }, + { + "name": "params", + "value": { + "host": "github.enterprise.test", + "owner": "owner", + "ownerType": "organization", + "projectNumber": 3, + "viewId": "view-1" + } + }, + { + "name": "options", + "value": { + "timeoutMs": 60000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "error": { + "message": "inner refused" + }, + "ok": false + } + } + } }, "e87bea4bcd3c": { "name": "githubProjectSearch", "ordinal": 30, "value": "" }, + "ea31cb0db515": { + "error": "outer refused", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "$rpc": "null" + }, + "views": [] + }, + "ea8f8a6f07b1": { + "name": "githubProjectPasteBusy", + "ordinal": 16, + "value": true + }, "eb79a9b3682a": { "status": "fulfilled", "startedAt": 0, @@ -1214,9 +1190,21 @@ } } }, - "f63257cab3e5": { + "f79f5682a27b": { + "name": "githubProjectLoading", + "ordinal": 23, + "value": true + }, + "fcd647d64faf": { + "name": "githubProjectTable", + "ordinal": 13, + "value": { + "$rpc": "null" + } + }, + "fe7fc1853f9e": { "name": "github.project.viewTable#1", - "ordinal": 12, + "ordinal": 11, "args": [ { "name": "method", @@ -1244,57 +1232,15 @@ "startedAt": 0, "settledAt": 0, "value": { + "error": { + "code": "refused", + "message": "outer refused" + }, "id": "frame-3", - "ok": true, - "result": { - "error": "inner refused", - "ok": false - } + "ok": false } } }, - "fa1d1b339394": { - "name": "appliedGithubProjectSearch", - "ordinal": 30, - "value": { - "$rpc": "undefined" - } - }, - "fb9764680a74": { - "name": "githubProjectError", - "ordinal": 20, - "value": "" - }, - "fd9fcbd54752": { - "error": "Unknown method", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "$rpc": "null" - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "fe075936e563": { - "name": "githubProjectSearch", - "ordinal": 31, - "value": "" - }, "ff43b5ec92a9": { "error": "", "loading": false, @@ -1340,47 +1286,40 @@ "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb" }, - "state": "376c9e8bd72a", - "effects": [ - "2085118de92f", - "a5a3530ec11c", - "685bc2bda05d", - "170fad8cb36b", - "9b9f8dd75514" - ] + "state": "ff43b5ec92a9", + "effects": ["2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b"] } }, { "id": "tk-project-board-load.prelude:cleanup", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "df77a1fd9072"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "40f6e42cd4ab"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb", "table-2": "eb79a9b3682a" }, - "state": "74f8ab788f2e", + "state": "9ac407eccd6f", "effects": [ "2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "bb54b9df1041", - "842c950ee7cc" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "8dd2b5b6a8af", + "a4635ab3551f" ] } }, { "id": "tk-project-board-load.normal:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -1393,13 +1332,12 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc" ] } }, @@ -1409,16 +1347,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "b49ff9f109a5" + "0f1aa264f581", + "f6003aed2098", + "ae89e058b351" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1433,52 +1371,50 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "b66c4f75c9ae", - "fa1d1b339394", - "fe075936e563", - "34de2d655a0a", - "c453f220a7e2", - "5a4fc5c86d0c" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "4c9b1e4ad1f5", + "0af48d475813", + "e87bea4bcd3c", + "0056704adc0b", + "97bc7dc12b92", + "3493818a7239" ] } }, { "id": "tk-project-board-load.result-absent:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "044db2a7250c"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "557d7f2cc92b"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb", "table-2": "eb79a9b3682a" }, - "state": "2fc294f6693b", + "state": "76df36bab005", "effects": [ "2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "0efd754f1a5c", - "842c950ee7cc" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "9fca7187b60f", + "a4635ab3551f" ] } }, @@ -1488,16 +1424,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "044db2a7250c", - "f6003aed2098", - "ae89e058b351" + "557d7f2cc92b", + "7d7e6f5ce421", + "6d7ebc9b7830" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "be93253869e6", - "9f9a21ac7b9e" + "4809ea7ad5b0", + "4dff29ea88de", + "b0c25dac9d8e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1512,51 +1448,49 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "0efd754f1a5c", - "842c950ee7cc", - "3985399034a2", - "26921f3a7c09", - "1b3350f71e56", - "dc8dd7739c49", - "8a0577280bad", - "ab1b10183665", - "6b03ace1146a", - "4c9b1e4ad1f5", - "0af48d475813", - "e87bea4bcd3c", - "0056704adc0b", - "97bc7dc12b92", - "3493818a7239" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "9fca7187b60f", + "a4635ab3551f", + "ea8f8a6f07b1", + "03fc33b06333", + "853d951cf70a", + "32e88f5c4657", + "b5f49e20fef1", + "f79f5682a27b", + "d494afc83352", + "d0248d16609f", + "4dd8cc8f777d", + "223225c09f07", + "5c93fbf94a2d", + "1cb3b185586b", + "5a7676ce26d6" ] } }, { "id": "tk-project-board-load.result-null:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "273acec61723"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "79fdb5f09c0a"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb", "table-2": "eb79a9b3682a" }, - "state": "2fc294f6693b", + "state": "76df36bab005", "effects": [ "2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "0efd754f1a5c", - "842c950ee7cc" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "9fca7187b60f", + "a4635ab3551f" ] } }, @@ -1566,16 +1500,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "273acec61723", - "f6003aed2098", - "ae89e058b351" + "79fdb5f09c0a", + "7d7e6f5ce421", + "6d7ebc9b7830" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "be93253869e6", - "9f9a21ac7b9e" + "4809ea7ad5b0", + "4dff29ea88de", + "b0c25dac9d8e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1590,51 +1524,49 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "0efd754f1a5c", - "842c950ee7cc", - "3985399034a2", - "26921f3a7c09", - "1b3350f71e56", - "dc8dd7739c49", - "8a0577280bad", - "ab1b10183665", - "6b03ace1146a", - "4c9b1e4ad1f5", - "0af48d475813", - "e87bea4bcd3c", - "0056704adc0b", - "97bc7dc12b92", - "3493818a7239" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "9fca7187b60f", + "a4635ab3551f", + "ea8f8a6f07b1", + "03fc33b06333", + "853d951cf70a", + "32e88f5c4657", + "b5f49e20fef1", + "f79f5682a27b", + "d494afc83352", + "d0248d16609f", + "4dd8cc8f777d", + "223225c09f07", + "5c93fbf94a2d", + "1cb3b185586b", + "5a7676ce26d6" ] } }, { "id": "tk-project-board-load.inner-ok-missing:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "882fad444878"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "cf71fba0b2df"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb", "table-2": "eb79a9b3682a" }, - "state": "2fc294f6693b", + "state": "76df36bab005", "effects": [ "2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "0efd754f1a5c", - "842c950ee7cc" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "9fca7187b60f", + "a4635ab3551f" ] } }, @@ -1644,16 +1576,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "882fad444878", - "f6003aed2098", - "ae89e058b351" + "cf71fba0b2df", + "7d7e6f5ce421", + "6d7ebc9b7830" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "be93253869e6", - "9f9a21ac7b9e" + "4809ea7ad5b0", + "4dff29ea88de", + "b0c25dac9d8e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1668,51 +1600,49 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "0efd754f1a5c", - "842c950ee7cc", - "3985399034a2", - "26921f3a7c09", - "1b3350f71e56", - "dc8dd7739c49", - "8a0577280bad", - "ab1b10183665", - "6b03ace1146a", - "4c9b1e4ad1f5", - "0af48d475813", - "e87bea4bcd3c", - "0056704adc0b", - "97bc7dc12b92", - "3493818a7239" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "9fca7187b60f", + "a4635ab3551f", + "ea8f8a6f07b1", + "03fc33b06333", + "853d951cf70a", + "32e88f5c4657", + "b5f49e20fef1", + "f79f5682a27b", + "d494afc83352", + "d0248d16609f", + "4dd8cc8f777d", + "223225c09f07", + "5c93fbf94a2d", + "1cb3b185586b", + "5a7676ce26d6" ] } }, { "id": "tk-project-board-load.inner-false-string-error:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "f63257cab3e5"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "255654e42ca3"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb", "table-2": "eb79a9b3682a" }, - "state": "2fc294f6693b", + "state": "76df36bab005", "effects": [ "2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "0efd754f1a5c", - "842c950ee7cc" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "9fca7187b60f", + "a4635ab3551f" ] } }, @@ -1722,16 +1652,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "f63257cab3e5", - "f6003aed2098", - "ae89e058b351" + "255654e42ca3", + "7d7e6f5ce421", + "6d7ebc9b7830" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "be93253869e6", - "9f9a21ac7b9e" + "4809ea7ad5b0", + "4dff29ea88de", + "b0c25dac9d8e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1746,51 +1676,49 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "0efd754f1a5c", - "842c950ee7cc", - "3985399034a2", - "26921f3a7c09", - "1b3350f71e56", - "dc8dd7739c49", - "8a0577280bad", - "ab1b10183665", - "6b03ace1146a", - "4c9b1e4ad1f5", - "0af48d475813", - "e87bea4bcd3c", - "0056704adc0b", - "97bc7dc12b92", - "3493818a7239" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "9fca7187b60f", + "a4635ab3551f", + "ea8f8a6f07b1", + "03fc33b06333", + "853d951cf70a", + "32e88f5c4657", + "b5f49e20fef1", + "f79f5682a27b", + "d494afc83352", + "d0248d16609f", + "4dd8cc8f777d", + "223225c09f07", + "5c93fbf94a2d", + "1cb3b185586b", + "5a7676ce26d6" ] } }, { "id": "tk-project-board-load.inner-false-object-error:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "dc231c7924ca"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "e585e7eb63ee"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb", "table-2": "eb79a9b3682a" }, - "state": "56f0120745a9", + "state": "3b234269eaf1", "effects": [ "2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "9bdd7e2522fe", - "842c950ee7cc" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "314fcc8d93cf", + "a4635ab3551f" ] } }, @@ -1800,16 +1728,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "dc231c7924ca", - "f6003aed2098", - "ae89e058b351" + "e585e7eb63ee", + "7d7e6f5ce421", + "6d7ebc9b7830" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "be93253869e6", - "9f9a21ac7b9e" + "4809ea7ad5b0", + "4dff29ea88de", + "b0c25dac9d8e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1824,51 +1752,49 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "9bdd7e2522fe", - "842c950ee7cc", - "3985399034a2", - "26921f3a7c09", - "1b3350f71e56", - "dc8dd7739c49", - "8a0577280bad", - "ab1b10183665", - "6b03ace1146a", - "4c9b1e4ad1f5", - "0af48d475813", - "e87bea4bcd3c", - "0056704adc0b", - "97bc7dc12b92", - "3493818a7239" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "314fcc8d93cf", + "a4635ab3551f", + "ea8f8a6f07b1", + "03fc33b06333", + "853d951cf70a", + "32e88f5c4657", + "b5f49e20fef1", + "f79f5682a27b", + "d494afc83352", + "d0248d16609f", + "4dd8cc8f777d", + "223225c09f07", + "5c93fbf94a2d", + "1cb3b185586b", + "5a7676ce26d6" ] } }, { "id": "tk-project-board-load.outer-refused:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "712a0bd65cc5"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "fe7fc1853f9e"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb", "table-2": "eb79a9b3682a" }, - "state": "2a4866c4dda3", + "state": "ea31cb0db515", "effects": [ "2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "e3836d43e8f9", - "842c950ee7cc" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "7733d6566538", + "a4635ab3551f" ] } }, @@ -1878,16 +1804,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "712a0bd65cc5", - "f6003aed2098", - "ae89e058b351" + "fe7fc1853f9e", + "7d7e6f5ce421", + "6d7ebc9b7830" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "be93253869e6", - "9f9a21ac7b9e" + "4809ea7ad5b0", + "4dff29ea88de", + "b0c25dac9d8e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1902,51 +1828,49 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "e3836d43e8f9", - "842c950ee7cc", - "3985399034a2", - "26921f3a7c09", - "1b3350f71e56", - "dc8dd7739c49", - "8a0577280bad", - "ab1b10183665", - "6b03ace1146a", - "4c9b1e4ad1f5", - "0af48d475813", - "e87bea4bcd3c", - "0056704adc0b", - "97bc7dc12b92", - "3493818a7239" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "7733d6566538", + "a4635ab3551f", + "ea8f8a6f07b1", + "03fc33b06333", + "853d951cf70a", + "32e88f5c4657", + "b5f49e20fef1", + "f79f5682a27b", + "d494afc83352", + "d0248d16609f", + "4dd8cc8f777d", + "223225c09f07", + "5c93fbf94a2d", + "1cb3b185586b", + "5a7676ce26d6" ] } }, { "id": "tk-project-board-load.outer-refused-no-message:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "9883026698a2"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "aefed6d1365a"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb", "table-2": "eb79a9b3682a" }, - "state": "376c9e8bd72a", + "state": "ff43b5ec92a9", "effects": [ "2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "5abab014ad66", - "842c950ee7cc" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "24c9c9ebd660", + "a4635ab3551f" ] } }, @@ -1956,16 +1880,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "9883026698a2", - "f6003aed2098", - "ae89e058b351" + "aefed6d1365a", + "7d7e6f5ce421", + "6d7ebc9b7830" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "be93253869e6", - "9f9a21ac7b9e" + "4809ea7ad5b0", + "4dff29ea88de", + "b0c25dac9d8e" ], "settlements": { "mount": "eb79a9b3682a", @@ -1980,51 +1904,49 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "5abab014ad66", - "842c950ee7cc", - "3985399034a2", - "26921f3a7c09", - "1b3350f71e56", - "dc8dd7739c49", - "8a0577280bad", - "ab1b10183665", - "6b03ace1146a", - "4c9b1e4ad1f5", - "0af48d475813", - "e87bea4bcd3c", - "0056704adc0b", - "97bc7dc12b92", - "3493818a7239" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "24c9c9ebd660", + "a4635ab3551f", + "ea8f8a6f07b1", + "03fc33b06333", + "853d951cf70a", + "32e88f5c4657", + "b5f49e20fef1", + "f79f5682a27b", + "d494afc83352", + "d0248d16609f", + "4dd8cc8f777d", + "223225c09f07", + "5c93fbf94a2d", + "1cb3b185586b", + "5a7676ce26d6" ] } }, { "id": "tk-project-board-load.method-not-found:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "08b8713b9aa5"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "0d97c3fd4fe1"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb", "table-2": "eb79a9b3682a" }, - "state": "fd9fcbd54752", + "state": "c930bdc29ecd", "effects": [ "2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "a093143e7c52", - "842c950ee7cc" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "225520fed6bc", + "a4635ab3551f" ] } }, @@ -2034,16 +1956,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "08b8713b9aa5", - "f6003aed2098", - "ae89e058b351" + "0d97c3fd4fe1", + "7d7e6f5ce421", + "6d7ebc9b7830" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "be93253869e6", - "9f9a21ac7b9e" + "4809ea7ad5b0", + "4dff29ea88de", + "b0c25dac9d8e" ], "settlements": { "mount": "eb79a9b3682a", @@ -2058,51 +1980,49 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "a093143e7c52", - "842c950ee7cc", - "3985399034a2", - "26921f3a7c09", - "1b3350f71e56", - "dc8dd7739c49", - "8a0577280bad", - "ab1b10183665", - "6b03ace1146a", - "4c9b1e4ad1f5", - "0af48d475813", - "e87bea4bcd3c", - "0056704adc0b", - "97bc7dc12b92", - "3493818a7239" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "225520fed6bc", + "a4635ab3551f", + "ea8f8a6f07b1", + "03fc33b06333", + "853d951cf70a", + "32e88f5c4657", + "b5f49e20fef1", + "f79f5682a27b", + "d494afc83352", + "d0248d16609f", + "4dd8cc8f777d", + "223225c09f07", + "5c93fbf94a2d", + "1cb3b185586b", + "5a7676ce26d6" ] } }, { "id": "tk-project-board-load.transport-rejection:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "a8981fbe7e87"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "684390d0103b"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb", "table-2": "eb79a9b3682a" }, - "state": "de19f9b2e75a", + "state": "ac891a7d42d5", "effects": [ "2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "1da3c3839c7a", - "842c950ee7cc" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "386bb2eaf03b", + "a4635ab3551f" ] } }, @@ -2112,16 +2032,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "a8981fbe7e87", - "f6003aed2098", - "ae89e058b351" + "684390d0103b", + "7d7e6f5ce421", + "6d7ebc9b7830" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "be93253869e6", - "9f9a21ac7b9e" + "4809ea7ad5b0", + "4dff29ea88de", + "b0c25dac9d8e" ], "settlements": { "mount": "eb79a9b3682a", @@ -2136,51 +2056,49 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "1da3c3839c7a", - "842c950ee7cc", - "3985399034a2", - "26921f3a7c09", - "1b3350f71e56", - "dc8dd7739c49", - "8a0577280bad", - "ab1b10183665", - "6b03ace1146a", - "4c9b1e4ad1f5", - "0af48d475813", - "e87bea4bcd3c", - "0056704adc0b", - "97bc7dc12b92", - "3493818a7239" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "386bb2eaf03b", + "a4635ab3551f", + "ea8f8a6f07b1", + "03fc33b06333", + "853d951cf70a", + "32e88f5c4657", + "b5f49e20fef1", + "f79f5682a27b", + "d494afc83352", + "d0248d16609f", + "4dd8cc8f777d", + "223225c09f07", + "5c93fbf94a2d", + "1cb3b185586b", + "5a7676ce26d6" ] } }, { "id": "tk-project-board-load.transport-rejection-no-message:table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "c95a406e53e5"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "20a31104f552"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb", "table-2": "eb79a9b3682a" }, - "state": "376c9e8bd72a", + "state": "ff43b5ec92a9", "effects": [ "2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "5abab014ad66", - "842c950ee7cc" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "24c9c9ebd660", + "a4635ab3551f" ] } }, @@ -2190,16 +2108,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "c95a406e53e5", - "f6003aed2098", - "ae89e058b351" + "20a31104f552", + "7d7e6f5ce421", + "6d7ebc9b7830" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "be93253869e6", - "9f9a21ac7b9e" + "4809ea7ad5b0", + "4dff29ea88de", + "b0c25dac9d8e" ], "settlements": { "mount": "eb79a9b3682a", @@ -2214,25 +2132,24 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "da50b440ea30", - "5abab014ad66", - "842c950ee7cc", - "3985399034a2", - "26921f3a7c09", - "1b3350f71e56", - "dc8dd7739c49", - "8a0577280bad", - "ab1b10183665", - "6b03ace1146a", - "4c9b1e4ad1f5", - "0af48d475813", - "e87bea4bcd3c", - "0056704adc0b", - "97bc7dc12b92", - "3493818a7239" + "2f290fa2acf5", + "060dcedb3fdb", + "fcd647d64faf", + "24c9c9ebd660", + "a4635ab3551f", + "ea8f8a6f07b1", + "03fc33b06333", + "853d951cf70a", + "32e88f5c4657", + "b5f49e20fef1", + "f79f5682a27b", + "d494afc83352", + "d0248d16609f", + "4dd8cc8f777d", + "223225c09f07", + "5c93fbf94a2d", + "1cb3b185586b", + "5a7676ce26d6" ] } } diff --git a/mobile/rpc-foundation/goldens/tk-project-board-load.json b/mobile/rpc-foundation/goldens/tk-project-board-load.json index 8b3955f1b9d..d0d996e81c1 100644 --- a/mobile/rpc-foundation/goldens/tk-project-board-load.json +++ b/mobile/rpc-foundation/goldens/tk-project-board-load.json @@ -4,187 +4,28 @@ "family": "tasks.project-board-load", "namedDeltas": [], "values": { - "00ef2dbe5026": { - "name": "github.project.resolveRef#1", - "ordinal": 21, - "args": [ - { - "name": "method", - "value": "github.project.resolveRef" - }, - { - "name": "params", - "value": { - "host": "github.com", - "input": "https://github.com/orgs/owner/projects/3" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-4", - "ok": true, - "result": { - "host": "github.com", - "number": 3, - "ok": true, - "owner": "owner", - "ownerType": "organization", - "title": "Board", - "viewNumber": 1 - } - } - } - }, - "0388fa155721": { - "name": "githubProjectError", - "ordinal": 11, - "value": "" - }, - "15cb97c93333": { - "name": "github.project.listViews#1", - "ordinal": 8, - "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3}}" - }, - "170fad8cb36b": { - "name": "githubProjectPartialFailures", - "ordinal": 6, - "value": [] - }, - "2085118de92f": { - "name": "githubProjectError", - "ordinal": 1, - "value": "" - }, - "2ab1b35ff194": { - "error": "", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "34de2d655a0a": { + "0056704adc0b": { "name": "githubProjectTable", - "ordinal": 32, + "ordinal": 31, "value": { "$rpc": "null" } }, - "376c9e8bd72a": { - "error": "", - "loading": false, - "pasteError": "", - "projects": [ - { - "host": "github.com", - "number": 3, - "owner": "owner", - "ownerType": "organization", - "title": "Board" - } - ], - "table": { - "$rpc": "null" - }, - "views": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "43352776b1e1": { - "name": "githubProjectTable", - "ordinal": 14, - "value": { - "fields": [], - "project": { - "id": "project-1", - "number": 3, - "title": "Board" - }, - "rows": [], - "selectedView": { - "filter": "is:open", - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - } - }, - "47507819e28a": { - "name": "githubProjectPasteInput", - "ordinal": 23, + "060dcedb3fdb": { + "name": "githubProjectError", + "ordinal": 10, "value": "" }, - "4eb521bbefdd": { - "name": "githubProjectSearch", - "ordinal": 15, - "value": "is:open" + "0af48d475813": { + "name": "appliedGithubProjectSearch", + "ordinal": 29, + "value": { + "$rpc": "undefined" + } }, - "528af16518e6": { - "name": "githubProjectViews", - "ordinal": 16, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] - }, - "5a4fc5c86d0c": { - "name": "githubProjectPasteBusy", - "ordinal": 34, - "value": false - }, - "5f5f56db9d64": { + "0f1aa264f581": { "name": "github.project.viewTable#1", - "ordinal": 12, + "ordinal": 11, "args": [ { "name": "method", @@ -236,15 +77,130 @@ } } }, - "61ce1ab88e79": { + "15cb97c93333": { + "name": "github.project.listViews#1", + "ordinal": 8, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3}}" + }, + "170fad8cb36b": { + "name": "githubProjectPartialFailures", + "ordinal": 6, + "value": [] + }, + "1b3350f71e56": { + "name": "githubProjectError", + "ordinal": 19, + "value": "" + }, + "2085118de92f": { + "name": "githubProjectError", + "ordinal": 1, + "value": "" + }, + "26921f3a7c09": { + "name": "githubProjectPasteError", + "ordinal": 18, + "value": "" + }, + "2ab1b35ff194": { + "error": "", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "2f290fa2acf5": { + "name": "githubProjectLoading", + "ordinal": 9, + "value": true + }, + "3493818a7239": { + "name": "githubProjectPasteBusy", + "ordinal": 33, + "value": false + }, + "376c9e8bd72a": { + "error": "", + "loading": false, + "pasteError": "", + "projects": [ + { + "host": "github.com", + "number": 3, + "owner": "owner", + "ownerType": "organization", + "title": "Board" + } + ], + "table": { + "$rpc": "null" + }, + "views": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] + }, + "3985399034a2": { + "name": "githubProjectPasteBusy", + "ordinal": 17, + "value": true + }, + "3a8617cc8fd8": { + "name": "githubProjectSearch", + "ordinal": 14, + "value": "is:open" + }, + "4809ea7ad5b0": { "name": "github.project.viewTable#1", - "ordinal": 13, + "ordinal": 12, "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.viewTable\",\"params\":{\"owner\":\"owner\",\"host\":\"github.enterprise.test\",\"ownerType\":\"organization\",\"projectNumber\":3,\"viewId\":\"view-1\"}}" }, - "654693493b51": { - "name": "githubProjectLoading", - "ordinal": 10, - "value": true + "4c9b1e4ad1f5": { + "name": "githubProjectViews", + "ordinal": 28, + "value": [ + { + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + ] }, "685bc2bda05d": { "name": "githubProjects", @@ -259,34 +215,14 @@ } ] }, - "7a9df0d1a484": { - "name": "githubProjectLoading", - "ordinal": 25, - "value": true - }, - "7b9d3b33c08b": { - "name": "githubProjectPasteError", - "ordinal": 19, - "value": "" - }, - "8792541c60ad": { + "6b03ace1146a": { "name": "githubProjectError", - "ordinal": 26, + "ordinal": 25, "value": "" }, - "8e4dec1aad1f": { - "name": "github.project.listViews#2", - "ordinal": 28, - "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" - }, - "8f3ee6c510b1": { - "name": "github.project.resolveRef#1", - "ordinal": 22, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" - }, - "9b9f8dd75514": { + "7d488eda1d1c": { "name": "githubProjectViews", - "ordinal": 9, + "ordinal": 15, "value": [ { "id": "view-1", @@ -296,24 +232,39 @@ } ] }, - "a4a1ff5df287": { - "name": "githubProjectPasteBusy", - "ordinal": 18, - "value": true + "842c950ee7cc": { + "name": "githubProjectLoading", + "ordinal": 16, + "value": false + }, + "8a0577280bad": { + "name": "showGitHubProjectPicker", + "ordinal": 23, + "value": false + }, + "97bc7dc12b92": { + "name": "githubProjectLoading", + "ordinal": 32, + "value": false + }, + "9f9a21ac7b9e": { + "name": "github.project.listViews#2", + "ordinal": 27, + "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listViews\",\"params\":{\"owner\":\"owner\",\"host\":\"github.com\",\"ownerType\":\"organization\",\"projectNumber\":3}}" }, "a5a3530ec11c": { "name": "githubProjectPartialFailures", "ordinal": 2, "value": [] }, - "b42c8edc0d53": { - "name": "github.project.listAccessible#1", - "ordinal": 4, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listAccessible\",\"params\":{\"host\":\"github.com\"}}" + "ab1b10183665": { + "name": "githubProjectLoading", + "ordinal": 24, + "value": true }, - "b49ff9f109a5": { + "ae89e058b351": { "name": "github.project.listViews#2", - "ordinal": 27, + "ordinal": 26, "args": [ { "name": "method", @@ -356,22 +307,10 @@ } } }, - "b5e354ed6023": { - "name": "githubProjectLoading", - "ordinal": 17, - "value": false - }, - "b66c4f75c9ae": { - "name": "githubProjectViews", - "ordinal": 29, - "value": [ - { - "id": "view-1", - "layout": "TABLE_LAYOUT", - "name": "Table", - "number": 1 - } - ] + "b42c8edc0d53": { + "name": "github.project.listAccessible#1", + "ordinal": 4, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.listAccessible\",\"params\":{\"host\":\"github.com\"}}" }, "be0da5b53ffb": { "status": "fulfilled", @@ -386,15 +325,30 @@ } ] }, - "c453f220a7e2": { - "name": "githubProjectLoading", - "ordinal": 33, - "value": false + "be93253869e6": { + "name": "github.project.resolveRef#1", + "ordinal": 21, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"github.project.resolveRef\",\"params\":{\"input\":\"https://github.com/orgs/owner/projects/3\",\"host\":\"github.com\"}}" }, - "c4c4250b0567": { - "name": "showGitHubProjectPicker", - "ordinal": 24, - "value": false + "c5c018cf9a70": { + "name": "githubProjectTable", + "ordinal": 13, + "value": { + "fields": [], + "project": { + "id": "project-1", + "number": 3, + "title": "Board" + }, + "rows": [], + "selectedView": { + "filter": "is:open", + "id": "view-1", + "layout": "TABLE_LAYOUT", + "name": "Table", + "number": 1 + } + } }, "d254913957c1": { "name": "github.project.listViews#1", @@ -441,6 +395,11 @@ } } }, + "dc8dd7739c49": { + "name": "githubProjectPasteInput", + "ordinal": 22, + "value": "" + }, "dfe16215433b": { "name": "github.project.listAccessible#1", "ordinal": 3, @@ -485,6 +444,11 @@ } } }, + "e87bea4bcd3c": { + "name": "githubProjectSearch", + "ordinal": 30, + "value": "" + }, "eb79a9b3682a": { "status": "fulfilled", "startedAt": 0, @@ -493,22 +457,46 @@ "$rpc": "undefined" } }, - "fa1d1b339394": { - "name": "appliedGithubProjectSearch", - "ordinal": 30, - "value": { - "$rpc": "undefined" - } - }, - "fb9764680a74": { - "name": "githubProjectError", + "f6003aed2098": { + "name": "github.project.resolveRef#1", "ordinal": 20, - "value": "" - }, - "fe075936e563": { - "name": "githubProjectSearch", - "ordinal": 31, - "value": "" + "args": [ + { + "name": "method", + "value": "github.project.resolveRef" + }, + { + "name": "params", + "value": { + "host": "github.com", + "input": "https://github.com/orgs/owner/projects/3" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "host": "github.com", + "number": 3, + "ok": true, + "owner": "owner", + "ownerType": "organization", + "title": "Board", + "viewNumber": 1 + } + } + } }, "ff43b5ec92a9": { "error": "", @@ -555,21 +543,15 @@ "projects-0": "eb79a9b3682a", "views-1": "be0da5b53ffb" }, - "state": "376c9e8bd72a", - "effects": [ - "2085118de92f", - "a5a3530ec11c", - "685bc2bda05d", - "170fad8cb36b", - "9b9f8dd75514" - ] + "state": "ff43b5ec92a9", + "effects": ["2085118de92f", "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b"] } }, { "id": "table-settled", "observation": { - "sender": ["dfe16215433b", "d254913957c1", "5f5f56db9d64"], - "payloads": ["b42c8edc0d53", "15cb97c93333", "61ce1ab88e79"], + "sender": ["dfe16215433b", "d254913957c1", "0f1aa264f581"], + "payloads": ["b42c8edc0d53", "15cb97c93333", "4809ea7ad5b0"], "settlements": { "mount": "eb79a9b3682a", "projects-0": "eb79a9b3682a", @@ -582,13 +564,12 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc" ] } }, @@ -598,16 +579,16 @@ "sender": [ "dfe16215433b", "d254913957c1", - "5f5f56db9d64", - "00ef2dbe5026", - "b49ff9f109a5" + "0f1aa264f581", + "f6003aed2098", + "ae89e058b351" ], "payloads": [ "b42c8edc0d53", "15cb97c93333", - "61ce1ab88e79", - "8f3ee6c510b1", - "8e4dec1aad1f" + "4809ea7ad5b0", + "be93253869e6", + "9f9a21ac7b9e" ], "settlements": { "mount": "eb79a9b3682a", @@ -622,26 +603,25 @@ "a5a3530ec11c", "685bc2bda05d", "170fad8cb36b", - "9b9f8dd75514", - "654693493b51", - "0388fa155721", - "43352776b1e1", - "4eb521bbefdd", - "528af16518e6", - "b5e354ed6023", - "a4a1ff5df287", - "7b9d3b33c08b", - "fb9764680a74", - "47507819e28a", - "c4c4250b0567", - "7a9df0d1a484", - "8792541c60ad", - "b66c4f75c9ae", - "fa1d1b339394", - "fe075936e563", - "34de2d655a0a", - "c453f220a7e2", - "5a4fc5c86d0c" + "2f290fa2acf5", + "060dcedb3fdb", + "c5c018cf9a70", + "3a8617cc8fd8", + "7d488eda1d1c", + "842c950ee7cc", + "3985399034a2", + "26921f3a7c09", + "1b3350f71e56", + "dc8dd7739c49", + "8a0577280bad", + "ab1b10183665", + "6b03ace1146a", + "4c9b1e4ad1f5", + "0af48d475813", + "e87bea4bcd3c", + "0056704adc0b", + "97bc7dc12b92", + "3493818a7239" ] } } diff --git a/mobile/rpc-foundation/pilot-scenarios.json b/mobile/rpc-foundation/pilot-scenarios.json index eeb45a4f5ee..dfd3079e39d 100644 --- a/mobile/rpc-foundation/pilot-scenarios.json +++ b/mobile/rpc-foundation/pilot-scenarios.json @@ -16601,7 +16601,7 @@ "id": "notifications-push-registered", "operation": "notifications.push-registration", "family": "notifications.push-registration", - "sites": ["mobile/src/notifications/push-registration.ts"], + "sites": ["mobile/src/notifications/mobile-push-registration-operations.ts"], "schedules": [], "steps": [ { @@ -16650,7 +16650,7 @@ "id": "notifications-push-gateway-rejected", "operation": "notifications.push-registration", "family": "notifications.push-registration", - "sites": ["mobile/src/notifications/push-registration.ts"], + "sites": ["mobile/src/notifications/mobile-push-registration-operations.ts"], "schedules": [], "steps": [ { @@ -18029,7 +18029,7 @@ "id": "native-chat-write-accepted", "operation": "nativeChat.terminal-write", "family": "nativeChat.terminal-write", - "sites": ["mobile/src/session/native-chat/mobile-native-chat-send.ts"], + "sites": ["mobile/src/session/native-chat/composer/mobile-native-chat-send.ts"], "schedules": [], "steps": [ { @@ -18065,7 +18065,7 @@ "id": "native-chat-write-rejected", "operation": "nativeChat.terminal-write", "family": "nativeChat.terminal-write", - "sites": ["mobile/src/session/native-chat/mobile-native-chat-send.ts"], + "sites": ["mobile/src/session/native-chat/composer/mobile-native-chat-send.ts"], "schedules": [], "steps": [ { @@ -18101,7 +18101,7 @@ "id": "native-chat-write-delivery-unknown", "operation": "nativeChat.terminal-write", "family": "nativeChat.terminal-write", - "sites": ["mobile/src/session/native-chat/mobile-native-chat-send.ts"], + "sites": ["mobile/src/session/native-chat/composer/mobile-native-chat-send.ts"], "schedules": [], "steps": [ { @@ -18133,7 +18133,7 @@ "id": "native-chat-write-clear-line", "operation": "nativeChat.terminal-write", "family": "nativeChat.terminal-write", - "sites": ["mobile/src/session/native-chat/mobile-native-chat-send.ts"], + "sites": ["mobile/src/session/native-chat/composer/mobile-native-chat-send.ts"], "schedules": [], "steps": [ { @@ -18169,7 +18169,7 @@ "id": "native-chat-write-typed-command", "operation": "nativeChat.terminal-write", "family": "nativeChat.terminal-write", - "sites": ["mobile/src/session/native-chat/mobile-native-chat-send.ts"], + "sites": ["mobile/src/session/native-chat/composer/mobile-native-chat-send.ts"], "schedules": [], "steps": [ { @@ -18840,7 +18840,9 @@ "id": "structured-launch-unsupported", "operation": "agentSession.structured-launch", "family": "agentSession.structured-launch", - "sites": ["mobile/src/session/mobile-structured-agent-session-launch.ts"], + "sites": [ + "mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts" + ], "schedules": [], "steps": [ { @@ -18870,7 +18872,9 @@ "id": "structured-launch-support-refused", "operation": "agentSession.structured-launch", "family": "agentSession.structured-launch", - "sites": ["mobile/src/session/mobile-structured-agent-session-launch.ts"], + "sites": [ + "mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts" + ], "schedules": [], "steps": [ { @@ -18900,7 +18904,9 @@ "id": "structured-launch-created", "operation": "agentSession.structured-launch", "family": "agentSession.structured-launch", - "sites": ["mobile/src/session/mobile-structured-agent-session-launch.ts"], + "sites": [ + "mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts" + ], "schedules": [], "steps": [ { @@ -18951,7 +18957,9 @@ "id": "structured-launch-definitive-refusal", "operation": "agentSession.structured-launch", "family": "agentSession.structured-launch", - "sites": ["mobile/src/session/mobile-structured-agent-session-launch.ts"], + "sites": [ + "mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts" + ], "schedules": [], "steps": [ { @@ -19003,7 +19011,9 @@ "id": "structured-launch-replays-dropped-create", "operation": "agentSession.structured-launch", "family": "agentSession.structured-launch", - "sites": ["mobile/src/session/mobile-structured-agent-session-launch.ts"], + "sites": [ + "mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts" + ], "schedules": [], "steps": [ { @@ -19443,7 +19453,7 @@ "id": "native-chat-stop-accepted", "operation": "session.native-chat-stop", "family": "session.native-chat-stop", - "sites": ["mobile/src/session/native-chat/use-mobile-native-chat-stop.ts"], + "sites": ["mobile/src/session/native-chat/composer/use-mobile-native-chat-stop.ts"], "schedules": [], "steps": [ { @@ -19504,7 +19514,7 @@ "id": "native-chat-stop-both-rejected", "operation": "session.native-chat-stop", "family": "session.native-chat-stop", - "sites": ["mobile/src/session/native-chat/use-mobile-native-chat-stop.ts"], + "sites": ["mobile/src/session/native-chat/composer/use-mobile-native-chat-stop.ts"], "schedules": [], "steps": [ { @@ -19562,7 +19572,7 @@ "id": "native-chat-stop-delivery-unknown", "operation": "session.native-chat-stop", "family": "session.native-chat-stop", - "sites": ["mobile/src/session/native-chat/use-mobile-native-chat-stop.ts"], + "sites": ["mobile/src/session/native-chat/composer/use-mobile-native-chat-stop.ts"], "schedules": [], "steps": [ { @@ -19962,7 +19972,7 @@ "mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts", - "mobile/src/session/native-chat/mobile-native-chat-stale-input.ts" + "mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts" ], "schedules": [], "steps": [ @@ -20039,7 +20049,7 @@ "mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts", - "mobile/src/session/native-chat/mobile-native-chat-stale-input.ts" + "mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts" ], "schedules": [], "steps": [ @@ -20117,7 +20127,7 @@ "mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts", - "mobile/src/session/native-chat/mobile-native-chat-stale-input.ts" + "mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts" ], "schedules": [], "steps": [ @@ -20152,7 +20162,7 @@ "mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts", - "mobile/src/session/native-chat/mobile-native-chat-stale-input.ts" + "mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts" ], "schedules": [], "steps": [ @@ -20188,7 +20198,7 @@ "mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts", - "mobile/src/session/native-chat/mobile-native-chat-stale-input.ts" + "mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts" ], "schedules": [], "steps": [ @@ -20224,7 +20234,7 @@ "mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts", - "mobile/src/session/native-chat/mobile-native-chat-stale-input.ts" + "mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts" ], "schedules": [], "steps": [ @@ -20280,7 +20290,7 @@ "mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts", - "mobile/src/session/native-chat/mobile-native-chat-stale-input.ts" + "mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts" ], "schedules": [], "steps": [ @@ -24889,7 +24899,7 @@ "mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts", - "mobile/src/session/native-chat/mobile-native-chat-stale-input.ts" + "mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts" ], "schedules": [], "steps": [ @@ -24944,7 +24954,7 @@ "mobile/src/source-control/review/use-mobile-diff-review-comment-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-git-actions.ts", "mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts", - "mobile/src/session/native-chat/mobile-native-chat-stale-input.ts" + "mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts" ], "schedules": [], "steps": [ @@ -25018,7 +25028,9 @@ "id": "structured-agent-session-created", "operation": "agentSession.structured-launch", "family": "agentSession.structured-create", - "sites": ["mobile/src/session/mobile-structured-agent-session-launch.ts"], + "sites": [ + "mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts" + ], "schedules": [], "steps": [ { diff --git a/mobile/src/accounts/MobileAccountsScreen.tsx b/mobile/src/accounts/MobileAccountsScreen.tsx index 2ea1d8b0c18..a76da2ffa62 100644 --- a/mobile/src/accounts/MobileAccountsScreen.tsx +++ b/mobile/src/accounts/MobileAccountsScreen.tsx @@ -3,7 +3,7 @@ import { View, Text, ScrollView, ActivityIndicator } from 'react-native' import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context' import { useFocusEffect, useLocalSearchParams } from 'expo-router' import { ChevronLeft, RefreshCw, User } from 'lucide-react-native' -import { loadHosts, peekHosts } from '../transport/hosts/host-store' +import { loadHosts, peekHosts } from '../host-catalog/host-store' import { useForceReconnect, useHostClient } from '../transport/connection/host-client-hooks' import { useHostConnectionInputs } from '../transport/connection/client-context-connection-metrics' import { classifyConnection, isConnectionOutage } from '../transport/connection/connection-health' diff --git a/mobile/src/accounts/use-mobile-accounts-snapshot.test.tsx b/mobile/src/accounts/use-mobile-accounts-snapshot.test.tsx index 56c8d293793..a64c3166b1b 100644 --- a/mobile/src/accounts/use-mobile-accounts-snapshot.test.tsx +++ b/mobile/src/accounts/use-mobile-accounts-snapshot.test.tsx @@ -5,15 +5,9 @@ import { afterEach, describe, expect, it, vi } from 'vitest' // Also tells TanStack observers on a microtask, so act() sees replies. import '../test-support/query-client-test-renderer' import { settleQueryNotifications } from '../test-support/rpc-recording/hook-mount' -import type { OrcaQueryStoreBackend } from '../device-store/query-storage' import { createOrcaQueryClient } from '../query/orca-query-client' -import { createHostQueryPersistence, persistedHostQueryKey } from '../query/host-query-persistence' import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import { - accountsSnapshotFamily, - accountsSnapshotKey, - accountsSnapshotOptions -} from './accounts-snapshot-stream' +import { accountsSnapshotKey } from './accounts-snapshot-stream' import { useMobileAccountsSnapshot } from './use-mobile-accounts-snapshot' const HOST = 'host-1' @@ -89,24 +83,6 @@ async function mountAccounts(queryClient: QueryClient, client: RpcClient) { } } -function memoryStore(): OrcaQueryStoreBackend { - const rows = new Map() - return { - hostId: HOST, - read: async (keys) => ({ status: 'ok', values: keys.map((key) => rows.get(key) ?? null) }), - write: async (ops) => { - for (const op of ops) { - if (op.value === null) { - rows.delete(op.key) - } else { - rows.set(op.key, op.value) - } - } - return { written: true } - } - } -} - describe('accounts snapshot', () => { it('still shows usage when the stream fails and accounts.list answers', async () => { const port = accountsClient(SNAPSHOT) @@ -128,24 +104,4 @@ describe('accounts snapshot', () => { 'claude@example.test' ]) }) - - it('never counts a stored snapshot as live, even one written after the connect', async () => { - const store = memoryStore() - // Native Home's own stream stores the snapshot after the connect the page then reads. - const home = createOrcaQueryClient() - const homePersistence = createHostQueryPersistence(home, store) - home.getQueryCache().build(home, accountsSnapshotOptions(HOST)) - home.setQueryData(accountsSnapshotKey(HOST), SNAPSHOT, { updatedAt: CONNECTED_AT + 1 }) - await settleQueryNotifications() - await homePersistence.flush() - home.clear() - - const page = createOrcaQueryClient() - await createHostQueryPersistence(page, store).restore([ - persistedHostQueryKey(accountsSnapshotFamily, accountsSnapshotKey(HOST))! - ]) - const read = await mountAccounts(page, accountsClient(SNAPSHOT).client) - expect(read().snapshot?.claude.accounts.map((account) => account.id)).toEqual(['claude-1']) - expect(read().live).toBe(false) - }) }) diff --git a/mobile/src/agent-history/MobileAgentSessionHistoryPanel.tsx b/mobile/src/agent-history/MobileAgentSessionHistoryPanel.tsx index fdbd7fc5ff8..08a2d65d451 100644 --- a/mobile/src/agent-history/MobileAgentSessionHistoryPanel.tsx +++ b/mobile/src/agent-history/MobileAgentSessionHistoryPanel.tsx @@ -1,5 +1,5 @@ import { openMobileAgentHistoryChat } from './open-mobile-agent-history-chat' -import { mobileStructuredSessionOpenMessage } from '../session/mobile-structured-session-open-message' +import { mobileStructuredSessionOpenMessage } from '../session/native-chat/agent-session/mobile-structured-session-open-message' import { prepareMobileHistoryResumeTarget } from './mobile-history-resume-target-preparation' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { View } from 'react-native' diff --git a/mobile/src/agent-history/ai-vault-resume-launch.ts b/mobile/src/agent-history/ai-vault-resume-launch.ts index 1926ddaa787..33594d0b2a3 100644 --- a/mobile/src/agent-history/ai-vault-resume-launch.ts +++ b/mobile/src/agent-history/ai-vault-resume-launch.ts @@ -16,7 +16,7 @@ import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agen import { parseWslUncPath } from '../../../src/shared/wsl-paths' import { resolveWindowsShellStartupFamily } from '../../../src/shared/windows-terminal-shell' import { RESUME_RPC_TIMEOUT_MS } from './ai-vault-resume-preparation' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import { interpretOrThrowRefusalMessage } from '../transport/rpc/rpc-refusal-message' import { reviewTerminalCreateRun, @@ -78,7 +78,7 @@ export function buildMobileAiVaultResumeLaunch(args: { } export async function resumeAiVaultSessionInTerminal( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, launch: MobileAiVaultResumeLaunch & { clientMutationId?: string diff --git a/mobile/src/agent-history/ai-vault-resume-preparation.ts b/mobile/src/agent-history/ai-vault-resume-preparation.ts index ef8194abb8c..f35d5609657 100644 --- a/mobile/src/agent-history/ai-vault-resume-preparation.ts +++ b/mobile/src/agent-history/ai-vault-resume-preparation.ts @@ -6,7 +6,7 @@ import { } from '../../../src/shared/ai-vault/resume/ai-vault-resume-preparation' import { LOCAL_EXECUTION_HOST_ID } from '../../../src/shared/execution-host' import { aiVaultResumePreparationRun } from './mobile-ai-vault-resume-operations' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import { translate } from '../i18n/mobile-i18n' // Why: without an explicit timeout, a socket drop mid-resume parks the request @@ -14,7 +14,7 @@ import { translate } from '../i18n/mobile-i18n' export const RESUME_RPC_TIMEOUT_MS = 30_000 export async function prepareMobileAiVaultSessionResume( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, session: AiVaultSession ): Promise { // Why: per-account repinning runs on the serving host, whose account diff --git a/mobile/src/agent-history/mobile-ai-vault-resume-operations.ts b/mobile/src/agent-history/mobile-ai-vault-resume-operations.ts index e3a0dbc0ef2..879c6fde5e3 100644 --- a/mobile/src/agent-history/mobile-ai-vault-resume-operations.ts +++ b/mobile/src/agent-history/mobile-ai-vault-resume-operations.ts @@ -4,7 +4,6 @@ import '../files/mobile-file-preview-operations' import { aiVaultResumePreparationSchema } from './mobile-ai-vault-resume-reply-schema' import '../browser/mobile-session-browser-reply-schema' import '../files/session-documents/mobile-file-tap-reply-schema' -import '../transport/rpc/rpc-uninterpreted-reply-schemas' // Legacy resume reads unsupported-method refusals raw to fall back to shared home. export const aiVaultResumePreparationRun = bindDeferredRpcOperation( diff --git a/mobile/src/agent-history/open-mobile-agent-history-chat.ts b/mobile/src/agent-history/open-mobile-agent-history-chat.ts index e435509888e..46705610706 100644 --- a/mobile/src/agent-history/open-mobile-agent-history-chat.ts +++ b/mobile/src/agent-history/open-mobile-agent-history-chat.ts @@ -4,7 +4,7 @@ import type { RpcClient } from '../transport/rpc/rpc-client-contract' import { openMobileStructuredSession, mobileStructuredSessionHref -} from '../session/open-mobile-structured-session' +} from '../session/native-chat/agent-session/open-mobile-structured-session' /** Consume native opens and ambiguous failures; only an explicit pre-effect refusal resumes in a terminal. */ export async function openMobileAgentHistoryChat(args: { diff --git a/mobile/src/agent-history/use-mobile-agent-history-state.ts b/mobile/src/agent-history/use-mobile-agent-history-state.ts index 5b8ebe2e2bc..122708bdeef 100644 --- a/mobile/src/agent-history/use-mobile-agent-history-state.ts +++ b/mobile/src/agent-history/use-mobile-agent-history-state.ts @@ -1,6 +1,6 @@ import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react' import { useQueryClient } from '@tanstack/react-query' -import { mobileStructuredSessionStatusFeed } from '../session/mobile-structured-session-status-feed' +import { mobileStructuredSessionStatusFeed } from '../session/native-chat/agent-session/mobile-structured-session-status-feed' import type { AgentSessionConversationNames } from '../../../src/shared/agent-session/agent-session-conversation-names' import { useForceReconnect } from '../transport/connection/host-client-hooks' import { useWorkspaceClient } from '../worktree/use-workspace-client' diff --git a/mobile/src/agents/MobileAgentListRows.tsx b/mobile/src/agents/MobileAgentListRows.tsx index 0f5f5b7908b..b564b7d4bdf 100644 --- a/mobile/src/agents/MobileAgentListRows.tsx +++ b/mobile/src/agents/MobileAgentListRows.tsx @@ -12,8 +12,8 @@ import { triggerMediumImpact } from '../platform/haptics' import { colors, spacing } from '../theme/mobile-theme' import { themedStyleSheet } from '../theme/themed-styles' import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' -import type { HostProfile } from '../transport/hosts/host-profile' -import { useHostDisplay } from '../transport/hosts/use-host-display' +import type { HostProfile } from '../host-catalog/host-profile' +import { useHostDisplay } from '../host-descriptors/use-host-display' import { agentStateLabel, formatTimeAgo, type AgentDotState } from '../worktree/agent-row-display' import { isDisclosureOpen, toggleDisclosure } from '../worktree/agent-child-disclosure' import { areStructurallyEqual } from '../worktree/structural-equality' diff --git a/mobile/src/agents/agent-list-model.test.ts b/mobile/src/agents/agent-list-model.test.ts index 1b8ccb3bc2d..0af7468eaaa 100644 --- a/mobile/src/agents/agent-list-model.test.ts +++ b/mobile/src/agents/agent-list-model.test.ts @@ -4,6 +4,7 @@ import type { ConnectionState } from '../transport/connection/connection-state' import type { HostWorktreeInfo } from '../worktree/home-worktree-info' import { buildAgentList, type AgentListSection } from './agent-list-model' import { + selectActiveAgents, selectAgentsNeedingYou, type AgentListInput, type AgentListRow, @@ -79,24 +80,22 @@ const statusView = (showWorkers: boolean, unreadOnly = false) => ({ describe('buildAgentList by status', () => { it('buckets agents by what they ask of the user, newest first, and folds idle ones', () => { - const list = buildAgentList( - input({ - mac: { - state: 'connected', - info: { - agents: entries([ - agent('asking', 'waiting'), - agent('older-run', 'working', { stateStartedAt: NOW - 5 * MINUTE }), - agent('newer-run', 'working', { stateStartedAt: NOW - 2 * MINUTE }), - agent('finished', 'done'), - // Silent past the 30-minute freshness window. - agent('quiet', 'working', { updatedAt: NOW - 31 * MINUTE }) - ]) - } + const host = input({ + mac: { + state: 'connected', + info: { + agents: entries([ + agent('asking', 'waiting'), + agent('older-run', 'working', { stateStartedAt: NOW - 5 * MINUTE }), + agent('newer-run', 'working', { stateStartedAt: NOW - 2 * MINUTE }), + agent('finished', 'done'), + // Silent past the 30-minute freshness window. + agent('quiet', 'working', { updatedAt: NOW - 31 * MINUTE }) + ]) } - }), - statusView(true) - ) + } + }) + const list = buildAgentList(host, statusView(true)) expect(shape(list.sections)).toEqual([ { kind: 'needs-you', rows: ['asking'], workers: [[]], idle: undefined }, { @@ -107,6 +106,7 @@ describe('buildAgentList by status', () => { }, { kind: 'done', rows: ['finished'], workers: [[]], idle: ['quiet'] } ]) + expect(panes(selectActiveAgents(host))).toEqual(['asking', 'newer-run', 'older-run']) }) it('nests workers under their coordinator and still lists the one that needs the user', () => { diff --git a/mobile/src/agents/agent-list-row-text.ts b/mobile/src/agents/agent-list-row-text.ts index c3e9d8ef8b7..194a77e7616 100644 --- a/mobile/src/agents/agent-list-row-text.ts +++ b/mobile/src/agents/agent-list-row-text.ts @@ -21,7 +21,14 @@ function oneLine(text: string | null | undefined): string { return text?.replace(/\s+/g, ' ').trim() ?? '' } -function lastMessage(agent: RuntimeWorktreeAgentRow): string { +// A worktree agent row or a session tab's AgentStatusEntry, which leaves these optional. +type AgentPreviewSource = Pick & { + lastAssistantMessage?: string | null + toolName?: string | null + toolInput?: string | null +} + +function lastMessage(agent: AgentPreviewSource): string { const message = agent.lastAssistantMessage return message ? oneLine(withoutNativeChatVisualDirectiveLines(message)) : '' } @@ -31,7 +38,7 @@ function lastMessage(agent: RuntimeWorktreeAgentRow): string { * (`group` null) shows no tool, since the tool call is long over. */ export function agentListPreview( - agent: RuntimeWorktreeAgentRow, + agent: AgentPreviewSource, group: AgentStatusGroup | null, title: string ): string { diff --git a/mobile/src/agents/agent-list-rows.ts b/mobile/src/agents/agent-list-rows.ts index a9490a5929b..fc44c14f64b 100644 --- a/mobile/src/agents/agent-list-rows.ts +++ b/mobile/src/agents/agent-list-rows.ts @@ -159,6 +159,18 @@ export function selectAgentsNeedingYou(input: AgentListInput): AgentListRow[] { .sort(byStatusThenRecent) } +/** Live agents that need the user or are working, workers included: Feed's Active rows. */ +export function selectActiveAgents(input: AgentListInput): AgentListRow[] { + return input.hosts + .flatMap((host) => everyRow(hostAgents(input, host.id).roots)) + .filter((row) => { + const group = agentStatusGroup(row.dotState) + return !row.stale && (group === 'needs-you' || group === 'working') + }) + .map(asTopLevel) + .sort(byStatusThenRecent) +} + export function countAgentsNeedingYouByHost( rows: readonly AgentListRow[] ): Readonly> { diff --git a/mobile/src/agents/use-agent-list-row-actions.tsx b/mobile/src/agents/use-agent-list-row-actions.tsx index dcd191a4b6c..f5b45eda889 100644 --- a/mobile/src/agents/use-agent-list-row-actions.tsx +++ b/mobile/src/agents/use-agent-list-row-actions.tsx @@ -6,7 +6,7 @@ import { TransientToast, useTransientToast } from '../components/TransientToast' import { useMobileTranslation } from '../i18n/use-mobile-translation' import { useClipboardWriter } from '../platform/clipboard' import { useOpenMobileSession } from '../session/use-open-mobile-session' -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' import type { AgentActivityChange, AgentListRow } from './agent-list-rows' import type { AgentListRowHandlers } from './MobileAgentListRows' import type { AgentActivityFailure } from './use-agent-activity-writes' diff --git a/mobile/src/automations/MobileAutomationsScreen.tsx b/mobile/src/automations/MobileAutomationsScreen.tsx index 9cb62a41d91..b9efea06339 100644 --- a/mobile/src/automations/MobileAutomationsScreen.tsx +++ b/mobile/src/automations/MobileAutomationsScreen.tsx @@ -9,8 +9,8 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context' import { firstParam } from '../navigation/route-param-reader' import { useRouteHandoff } from '../navigation/route-handoff' import { useHostClient } from '../transport/connection/host-client-hooks' -import { useHostDisplay } from '../transport/hosts/use-host-display' -import { useHostProfile } from '../transport/hosts/use-host-profile' +import { useHostDisplay } from '../host-descriptors/use-host-display' +import { useHostProfile } from '../host-catalog/use-host-profile' import { useHostProtocolGates } from '../components/host-protocol-gates-context' import { NavBar, NavBarTitleButton } from '../components/nav-bar/NavBar' import { NavBarButton } from '../components/nav-bar/NavBarButton' diff --git a/mobile/src/automations/use-automation-catalog.ts b/mobile/src/automations/use-automation-catalog.ts index e51cf5190fa..18bc9e31df7 100644 --- a/mobile/src/automations/use-automation-catalog.ts +++ b/mobile/src/automations/use-automation-catalog.ts @@ -12,7 +12,8 @@ import type { ExecutionHostId } from '../../../src/shared/execution-host' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import { hostStatusProbe } from '../transport/connection/host-status-probe-operations' import { hostConnectionEpoch, readHostStatusReply } from '../query/host-status-query' -import { defineHostQuery, useHostEventRouter, useHostQuery } from '../query/host-query' +import { defineHostQuery, useHostQuery } from '../query/host-query' +import { useHostEventRouter } from '../query/host-event-router' import { hostQueryKey, type HostQueryTarget } from '../query/host-query-key' import { isHostNotConnectedError } from '../query/host-query-errors' import { readViewBase } from '../query/host-read-client' diff --git a/mobile/src/browser/mobile-session-browser-operations.ts b/mobile/src/browser/mobile-session-browser-operations.ts index 597ef6fac7a..2dee93227b4 100644 --- a/mobile/src/browser/mobile-session-browser-operations.ts +++ b/mobile/src/browser/mobile-session-browser-operations.ts @@ -4,7 +4,6 @@ import '../files/mobile-file-preview-operations' import { browserTabCreatedSchema } from './mobile-session-browser-reply-schema' import '../agent-history/mobile-ai-vault-resume-reply-schema' import '../files/session-documents/mobile-file-tap-reply-schema' -import '../transport/rpc/rpc-uninterpreted-reply-schemas' export const sessionBrowserTabCreate = bindDeferredRpcOperation( defineRpcOperation({ diff --git a/mobile/src/components/CustomKeyModal.styles.ts b/mobile/src/components/CustomKeyModal.styles.ts index a95b5abe3be..2921025e632 100644 --- a/mobile/src/components/CustomKeyModal.styles.ts +++ b/mobile/src/components/CustomKeyModal.styles.ts @@ -41,6 +41,9 @@ export const customKeyModalStyles = themedStyleSheet(() => ({ borderRadius: radii.surface, overflow: 'hidden' }, + smartRailGroup: { + marginTop: spacing.md + }, shortcutForm: { paddingTop: spacing.sm }, diff --git a/mobile/src/components/CustomKeyModal.tsx b/mobile/src/components/CustomKeyModal.tsx index b6dfac3cdc6..42afc17fd3c 100644 --- a/mobile/src/components/CustomKeyModal.tsx +++ b/mobile/src/components/CustomKeyModal.tsx @@ -19,6 +19,7 @@ import { useMobileTranslation } from '../i18n/use-mobile-translation' import { MobileSwitch } from './MobileSwitch' import { ListGroup, ListRow } from './list/ListGroup' import { FieldTextInput } from './composer-input/FieldTextInput' +import { SmartRailRow } from './SmartRailRow' type Step = 'choose-type' | 'shortcut-combo' | 'special-keys' | 'text-macro' @@ -62,9 +63,11 @@ type Props = { onClose: () => void onKeysChanged: (keys: CustomKey[]) => void onManageShortcuts?: () => void + smartRail?: { enabled: boolean; onChange: (enabled: boolean) => void } } -export function CustomKeyModal({ visible, onClose, onKeysChanged, onManageShortcuts }: Props) { +export function CustomKeyModal(props: Props) { + const { visible, onClose, onKeysChanged, onManageShortcuts, smartRail } = props useMobileColorScheme() const t = useMobileTranslation() const [step, setStep] = useState('choose-type') @@ -235,6 +238,11 @@ export function CustomKeyModal({ visible, onClose, onKeysChanged, onManageShortc ) : null} )} + {step === 'choose-type' && smartRail ? ( + + + + ) : null} {step === 'shortcut-combo' && ( diff --git a/mobile/src/components/DragReorderList.test.tsx b/mobile/src/components/DragReorderList.test.tsx index defe697b10a..e70e5fecf88 100644 --- a/mobile/src/components/DragReorderList.test.tsx +++ b/mobile/src/components/DragReorderList.test.tsx @@ -1,13 +1,6 @@ -import { probe, publishLayout, mounted, positions } from './drag-reorder-test-harness.test-fixture' -import { createElement } from 'react' -import { act, create } from 'react-test-renderer' -import Animated, { useAnimatedRef, useSharedValue } from 'react-native-reanimated' +import { probe, mounted, positions } from './drag-reorder-test-harness.test-fixture' +import { act } from 'react-test-renderer' import { describe, expect, it, vi } from 'vitest' -import { DragReorderList } from './DragReorderList' -import { GripVertical } from 'lucide-react-native' - -import { queuedMessageStyles } from '../session/native-chat/input/mobile-native-chat-queued-message-styles' -import { spacing } from '../theme/mobile-theme' describe('drag completion and cancellation', () => { it('restores original positions and writes nothing when an active drag is cancelled', async () => { @@ -204,74 +197,3 @@ describe('late gesture callbacks', () => { expect(fixture.onReorder).not.toHaveBeenCalled() }) }) - -it('stops scrolling at the viewport edge when rows are replaced', async () => { - const fixture = await mounted() - probe.viewport = { pageY: 0, height: 100 } - await act(async () => { - fixture.gesture.start!({ absoluteY: 90, translationY: 0 }, true) - probe.frame!({ timeSincePreviousFrame: 16 }) - }) - expect(probe.scroll).toHaveBeenCalledTimes(1) - await fixture.updateItems(['b', 'c']) - await act(async () => probe.frame!({ timeSincePreviousFrame: 16 })) - expect(probe.scroll).toHaveBeenCalledTimes(1) - expect(probe.frameActive).toHaveBeenLastCalledWith(false) - await act(async () => fixture.root.unmount()) -}) - -it('keeps measured rows still on hold, restores cancellation, and drops by moved ID plus neighbor', async () => { - const move = vi.fn() - function Harness() { - return createElement(DragReorderList, { - items: ['a', 'b', 'c'], - itemKey: (item) => item, - rowPresentation: 'plain', - renderRow: (item, handle) => createElement('Text', null, item, handle), - onMove: move, - scrollRef: useAnimatedRef(), - scrollOffsetY: useSharedValue(0), - scrollContentHeight: useSharedValue(140) - }) - } - let root: ReturnType - await act(async () => { - root = create(createElement(Harness)) - }) - const handle = root!.root.findAllByType(Animated.View).find((node) => node.props.hitSlop)! - const handleStyle = Object.assign({}, ...handle.props.style) - const gripWidth = handle.findByType(GripVertical).props.size - const width = gripWidth + 2 * handleStyle.paddingHorizontal - const left = queuedMessageStyles.row.paddingLeft - handle.props.hitSlop.left - const right = queuedMessageStyles.row.paddingLeft + width + handle.props.hitSlop.right - expect(handleStyle.paddingHorizontal).toBe(spacing.xs) - expect([left, right]).toEqual([4, 62]) - expect(right - Math.max(0, left)).toBe(58) - const rows = root!.root.findAll( - (node) => node.type === Animated.View && typeof node.props.onLayout === 'function' - ) - await act(async () => - rows.forEach((row, index) => - row.props.onLayout({ nativeEvent: { layout: { height: index === 0 ? 100 : 20 } } }) - ) - ) - await publishLayout() - const gesture = probe.gestures.at(-3)! - const at = (translationY: number) => ({ absoluteY: 100 + translationY, translationY }) - await act(async () => { - gesture.start!(at(0), true) - gesture.update!(at(0), true) - gesture.finalize!(at(0), true) - gesture.start!(at(0), true) - gesture.update!(at(35), true) - gesture.finalize!(at(35), false) - }) - expect(move).not.toHaveBeenCalled() - await act(async () => { - gesture.start!(at(0), true) - gesture.update!(at(35), true) - gesture.finalize!(at(35), true) - }) - expect(move).toHaveBeenCalledExactlyOnceWith({ movedId: 'a', afterId: 'c' }) - await act(async () => root!.unmount()) -}) diff --git a/mobile/src/components/MobileStateView.tsx b/mobile/src/components/MobileStateView.tsx index ef692756a90..791e43c4789 100644 --- a/mobile/src/components/MobileStateView.tsx +++ b/mobile/src/components/MobileStateView.tsx @@ -22,6 +22,8 @@ type MobileStateViewProps = { loading?: boolean /** Keeps the content centred above a floating bottom bar. */ bottomInset?: number + /** Full-width content under the message, such as a list of choices. */ + children?: ReactNode } /** Every screen's loading, empty, no-match, error and offline state: icon, title, one sentence, one action. */ @@ -33,7 +35,8 @@ export function MobileStateView({ details, action, loading = false, - bottomInset = 0 + bottomInset = 0, + children }: MobileStateViewProps) { useMobileColorScheme() return ( @@ -49,6 +52,7 @@ export function MobileStateView({ {message ? {message} : null} {details ? : null} {action ? : null} + {children ? {children} : null} ) } @@ -187,6 +191,10 @@ export function MobileNoMatchState({ } const styles = themedStyleSheet(() => ({ + children: { + alignSelf: 'stretch', + marginTop: spacing.md + }, state: { flex: 1, alignItems: 'center', diff --git a/mobile/src/components/NewWorktreeModal.test.tsx b/mobile/src/components/NewWorktreeModal.test.tsx index b44507b5157..439e4f2014e 100644 --- a/mobile/src/components/NewWorktreeModal.test.tsx +++ b/mobile/src/components/NewWorktreeModal.test.tsx @@ -62,8 +62,9 @@ vi.mock('../host-screen/host-list-queries', () => ({ (hostId && cachedRepos.get(hostId)) || null })) -import '../transport/hosts/host-descriptor-store' +import '../host-descriptors/host-descriptor-store' import { FakeSession } from '../transport/connection/mobile-endpoint-supervisor-test-fakes' + import '../../../src/shared/execution-host' import type { ExecutionHostId } from '../../../src/shared/execution-host' @@ -194,6 +195,42 @@ describe('NewWorktreeModal project targets', () => { ).toBe('/srv/orca') }) + it("offers only the folder host's copy of a repo when opened from a folder", async () => { + const serverRepo = { ...repos[0]!, path: '/srv/orca' } + const listing = (listed: unknown[]) => + vi.fn((method: string) => + method === 'repo.list' ? replied({ repos: listed }) : new Promise(() => {}) + ) + + await act(async () => { + renderer = create( + createElement(NewWorktreeModal, { + visible: true, + client: requestsOnly(listing(repos)), + serverClients: new Map([ + ['runtime:env-1', requestsOnly(listing([serverRepo]))] + ]), + hostId: 'host-1', + onCreated: () => {}, + onClose: () => {}, + openExternalUrl: () => {}, + folderLaunch: { + repoId: 'repo-1', + executionHostId: 'runtime:env-1', + name: 'payments', + parentWorkspace: 'folder:f-1', + submit: { begin: () => null, presenting: () => true } + } + }) + ) + }) + await flushUpdates() + + // The desktop's same-id repo is not offered: its store doesn't hold this folder. + expect(pickerItems(renderer, 'Run on').map((item) => item.detail)).toEqual(['/srv/orca']) + expect(runTargetPicker(renderer).props.selectedId).toBe('runtime:env-1') + }) + it('ignores a stale repo list after the client changes', async () => { let resolveOldList: ((value: unknown) => void) | undefined const oldList = new Promise((resolve) => { diff --git a/mobile/src/components/NewWorktreeModal.tsx b/mobile/src/components/NewWorktreeModal.tsx index 11bf01b970f..801655b778c 100644 --- a/mobile/src/components/NewWorktreeModal.tsx +++ b/mobile/src/components/NewWorktreeModal.tsx @@ -1,4 +1,4 @@ -import { useMemo, useState } from 'react' +import { useEffect, useMemo, useRef, useState } from 'react' import { Keyboard } from 'react-native' import { getComposerRepoWorktreeBranches } from '../../../src/shared/composer-branch-selection' import { getRepoExecutionHostId, parseExecutionHostId } from '../../../src/shared/execution-host' @@ -10,7 +10,7 @@ import { deriveRepoSlug, type PasteRepoCandidate } from '../tasks/smart-source-p import { useMobileComposerSource } from '../tasks/use-mobile-composer-source' import { useNewWorktreeRuntimeCapabilities } from '../tasks/worktree-create-capability' import { useWorktreeCreateBasePrefetch } from '../tasks/use-worktree-create-base-prefetch' -import { useHostDescriptor } from '../transport/hosts/host-descriptor-store' +import { useHostDescriptor } from '../host-descriptors/host-descriptor-store' import { isSameMobileWorkspaceRepo } from '../worktree/new-workspace-dialog-repo-selection' import { buildRetiredWorktreeNamesRefreshKey, @@ -71,14 +71,20 @@ function NewWorktreeModalContent(props: NewWorktreeModalProps) { existingWorktrees, openExternalUrl, onCreated, - onClose + onClose, + folderLaunch } = props const { repos, allRepos, selectedRepo, setSelectedRepo, loading, loadError, retryLoad } = useNewWorkspaceRepositories({ client: desktopClient, serverClients, hostId, - visible + visible, + ...(folderLaunch + ? { + initialRepo: { id: folderLaunch.repoId, executionHostId: folderLaunch.executionHostId } + } + : {}) }) // Route picked-repo operations to its host; desktop settings/accounts stay on desktop. const repoServer = selectedRepo ? serverOf(selectedRepo) : undefined @@ -126,6 +132,14 @@ function NewWorktreeModalContent(props: NewWorktreeModalProps) { worktreeBranches: selectedRepoWorktreeBranches, onError: setError }) + // The folder's name, seeded once per opening; the user's edits stand. + const seededFolderName = useRef(false) + useEffect(() => { + if (folderLaunch && !seededFolderName.current) { + seededFolderName.current = true + composer.setName(folderLaunch.name) + } + }, [composer, folderLaunch]) const selectedRepoIsGit = selectedRepo ? selectedRepo.kind !== 'folder' : true useWorktreeCreateBasePrefetch({ client: visible ? client : null, @@ -179,7 +193,19 @@ function NewWorktreeModalContent(props: NewWorktreeModalProps) { setNote((current) => (current === note ? '' : current)) onCreated(worktreeId, name, warning, repoServer) }, - onClose + onClose, + ...(folderLaunch + ? { + folderLaunch: { + ...folderLaunch.submit, + executionHostId: folderLaunch.executionHostId, + parent: { + parentWorkspace: folderLaunch.parentWorkspace, + parentWorkspaceOrigin: 'manual' as const + } + } + } + : {}) }) const sourceAvailability: SmartModeAvailabilityInput = { diff --git a/mobile/src/components/SmartRailRow.tsx b/mobile/src/components/SmartRailRow.tsx new file mode 100644 index 00000000000..8789fcd0f42 --- /dev/null +++ b/mobile/src/components/SmartRailRow.tsx @@ -0,0 +1,24 @@ +import { ListRow } from './list/ListGroup' +import { MobileSwitch } from './MobileSwitch' +import { useMobileTranslation } from '../i18n/use-mobile-translation' + +/** The Smart rail setting: keys for what the terminal's agent is doing, at the front of the key row. */ +export function SmartRailRow({ + enabled, + onChange +}: { + enabled: boolean + onChange: (enabled: boolean) => void +}): React.JSX.Element { + const t = useMobileTranslation() + const title = t('components.smartRailRow.title', 'Smart rail') + return ( + + } + /> + ) +} diff --git a/mobile/src/components/SwipeRowActions.tsx b/mobile/src/components/SwipeRowActions.tsx index 704077f636d..b070de4ff38 100644 --- a/mobile/src/components/SwipeRowActions.tsx +++ b/mobile/src/components/SwipeRowActions.tsx @@ -84,6 +84,8 @@ export function SwipeRowActions({ }) // Web has no worklet plugin; mapper hooks need this explicit dependency list. const rowStyle = useAnimatedStyle(() => ({ transform: [{ translateX: offset.value }] }), [offset]) + // Hidden at rest, so the action can't show through a rounded group's antialiased corners. + const actionsStyle = useAnimatedStyle(() => ({ opacity: offset.value === 0 ? 0 : 1 }), [offset]) // A tap on an open row closes it rather than pressing the row. const guardPress = (onPress: () => void) => () => { // The click a drag release produces belongs to the drag, not to the row. @@ -124,8 +126,10 @@ export function SwipeRowActions({ } return ( - {leading ? renderAction(leading, 'leading') : null} - {trailing ? renderAction(trailing, 'trailing') : null} + + {leading ? renderAction(leading, 'leading') : null} + {trailing ? renderAction(trailing, 'trailing') : null} + {/* pan-y keeps the page scrolling vertically over the row on the web. */} {children(guardPress)} @@ -144,6 +148,7 @@ const styles = themedStyleSheet(() => ({ justifyContent: 'center', gap: 2 }, + actions: { position: 'absolute', top: 0, right: 0, bottom: 0, left: 0 }, leading: { left: 0 }, trailing: { right: 0 }, actionPressed: { opacity: feedback.pressedOpacity }, diff --git a/mobile/src/components/TerminalShortcutSettings.tsx b/mobile/src/components/TerminalShortcutSettings.tsx index db5bfe5b64e..37e14d0620f 100644 --- a/mobile/src/components/TerminalShortcutSettings.tsx +++ b/mobile/src/components/TerminalShortcutSettings.tsx @@ -27,6 +27,7 @@ import { setTerminalAccessoryBuiltInVisible } from '../terminal/terminal-accessory-layout' import { MobileSwitch } from './MobileSwitch' +import { SmartRailRow } from './SmartRailRow' // Absolutely positioned DragReorderList rows require one fixed height per section. const REORDER_ROW_HEIGHT = 56 @@ -148,10 +149,13 @@ export function TerminalShortcutSettings({ [persistLayout] ) + // Resetting the keys leaves the Smart rail setting alone. const resetBuiltInKeys = useCallback(() => { - const next = defaultLayout() - setShortcutLayout(next) - persistLayout(next) + setShortcutLayout((current) => { + const next = { ...defaultLayout(), smartRail: current.smartRail } + persistLayout(next) + return next + }) }, [defaultLayout, persistLayout]) const reorderCustomKeys = useCallback( @@ -182,6 +186,18 @@ export function TerminalShortcutSettings({ return ( <> + + + setShortcutLayout((current) => { + const next = { ...current, smartRail: enabled } + persistLayout(next) + return next + }) + } + /> + {hasPad ? ( > +/** Opened from a folder's empty state: that repo and name, created attached to the folder. */ +export type NewWorktreeFolderLaunch = { + repoId: string + /** The repo's host, so a same-id copy on another host isn't picked. */ + executionHostId: ExecutionHostId + name: string + /** The folder's workspace key, `folder:`. */ + parentWorkspace: string + submit: NewWorktreeFolderSubmit +} + +/** A folder's create, kept from admission until its outcome is known. */ +export type NewWorktreeFolderSubmission = { + settle: (outcome: 'created' | 'uncertain' | 'failed' | 'cancelled') => void +} + +/** How the folder screen owns its composer's creates. */ +export type NewWorktreeFolderSubmit = { + /** Admits a create for the picked repo before anything is sent; null while another is out for it. */ + begin: (repo: MobileWorkspaceRepo) => NewWorktreeFolderSubmission | null + /** False once the folder screen is left: the create runs on, without haptics. */ + presenting: () => boolean +} + export type NewWorktreeModalProps = { visible: boolean client: RpcClient | null @@ -37,6 +61,7 @@ export type NewWorktreeModalProps = { executionHost?: ExecutionHostId ) => void onClose: () => void + folderLaunch?: NewWorktreeFolderLaunch } export type SetupRunPolicy = 'ask' | 'run-by-default' | 'skip-by-default' diff --git a/mobile/src/components/use-connected-host-picker.test.ts b/mobile/src/components/use-connected-host-picker.test.ts index 052c1b4a5f2..d986ef795cb 100644 --- a/mobile/src/components/use-connected-host-picker.test.ts +++ b/mobile/src/components/use-connected-host-picker.test.ts @@ -1,7 +1,7 @@ import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' import { useConnectedHostPicker } from './use-connected-host-picker' function host(id: string, name: string, endpoint: string): HostProfile { diff --git a/mobile/src/components/use-connected-host-picker.ts b/mobile/src/components/use-connected-host-picker.ts index e6eec0b1e13..2697c9d18b9 100644 --- a/mobile/src/components/use-connected-host-picker.ts +++ b/mobile/src/components/use-connected-host-picker.ts @@ -1,6 +1,6 @@ import { useRef, useState } from 'react' import { hostEndpointLabel } from '../transport/hosts/host-endpoint-label' -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' /** Picker rows for desktops, telling apart two that share a name and endpoint. */ export function hostPickerOptions(hosts: HostProfile[]) { diff --git a/mobile/src/components/use-new-workspace-create-submit.ts b/mobile/src/components/use-new-workspace-create-submit.ts index 13f5d3cd165..3ee45a87b10 100644 --- a/mobile/src/components/use-new-workspace-create-submit.ts +++ b/mobile/src/components/use-new-workspace-create-submit.ts @@ -3,7 +3,9 @@ import { useRef, useState, type Dispatch, type SetStateAction } from 'react' import type { PersistedTrustedOrcaHooks } from '../../../src/shared/orca-yaml-hook-types' import type { RetiredNameRegistry } from '../../../src/shared/worktree/retired-name-registry' import type { RpcClient } from '../transport/rpc/rpc-client-contract' +import { folderCreateBusyMessage, uncertainCreateMessage } from './new-workspace-create-copy' import { triggerError, triggerSuccess } from '../platform/haptics' +import type { WorktreeCreateParent } from '../tasks/worktree-create-retry' import { createBlankWorkspace } from '../tasks/blank-workspace-create' import { isMobileTuiAgentEnabled } from '../tasks/mobile-tui-agents' import { @@ -24,7 +26,14 @@ import { type NewWorktreeAgentOption, type NewWorktreeRuntimeSettings } from './new-worktree-agent-selection' -import type { MobileWorkspaceRepo, SetupRunPolicy } from './new-worktree-modal-types' +import type { + MobileWorkspaceRepo, + NewWorktreeFolderSubmission, + NewWorktreeFolderSubmit, + SetupRunPolicy +} from './new-worktree-modal-types' +import { getRepoExecutionHostId, type ExecutionHostId } from '../../../src/shared/execution-host' +import { isRpcDeliveryUnknown } from '../transport/rpc/rpc-delivery-ambiguity' import type { OrcaHookTrustPrompt } from './OrcaHookTrustDrawer' import type { NewWorktreeDrawerView } from './use-new-worktree-drawer-navigation' import { getSuggestedCreatureName } from './worktree-name-suggestion' @@ -65,6 +74,11 @@ export function useNewWorkspaceCreateSubmit(args: { setError: Dispatch> onCreated: (worktreeId: string, name: string, warning?: string) => void onClose: () => void + /** Opened from a folder: creates on that folder's host, attached to it, owned by the folder screen. */ + folderLaunch?: NewWorktreeFolderSubmit & { + executionHostId: ExecutionHostId + parent: WorktreeCreateParent + } }): { creating: boolean setupTrustPrompt: OrcaHookTrustPrompt | null @@ -86,7 +100,20 @@ export function useNewWorkspaceCreateSubmit(args: { createInFlightRef.current = true setCreating(true) args.setError('') + const folder = args.folderLaunch + // Admitted for the repo actually picked, before anything is sent; the folder screen owns it until it settles. + const admission = folder + ? getRepoExecutionHostId(selectedRepo) === folder.executionHostId + ? folder.begin(selectedRepo) + : null + : undefined + const presenting = (): boolean => folder?.presenting() ?? true + let outcome: Parameters[0] = 'cancelled' try { + if (admission === null) { + args.setError(folderCreateBusyMessage()) + return + } if (args.sshGate.requiresConnection) { args.setError(`Connect ${selectedRepo.displayName} before creating a workspace.`) return @@ -178,7 +205,8 @@ export function useNewWorkspaceCreateSubmit(args: { agentLaunchSupported: args.getAgentLaunchSupport(), branchIntentSupported: args.getBranchIntentSupport( selection.kind === 'branch' && selection.reuse ? 'open-existing-v2' : 'create-new' - ) + ), + parent: folder?.parent }) : await createBlankWorkspace({ client, @@ -189,20 +217,43 @@ export function useNewWorkspaceCreateSubmit(args: { comment: trimmedNote, setupDecision, worktreeCreateIdempotency: args.getWorktreeCreateCutoverSupport(), - agentLaunchSupported: args.getAgentLaunchSupport() + agentLaunchSupported: args.getAgentLaunchSupport(), + parent: folder?.parent }) if ('error' in result) { - triggerError() + // Refused on a resend after a lost reply: the first send may have created it. + outcome = result.replayed ? 'uncertain' : 'failed' + if (outcome === 'uncertain') { + // Not a failure to retry: creating again could make a second one. + args.setError(uncertainCreateMessage(folder !== undefined)) + return + } + if (presenting()) { + triggerError() + } args.setError(result.error) return } - triggerSuccess() + outcome = 'created' + if (presenting()) { + triggerSuccess() + } args.onClose() args.onCreated(result.worktreeId, result.name, result.warning) } catch (error) { - triggerError() + // A lost reply may still have created it. + outcome = isRpcDeliveryUnknown(error) ? 'uncertain' : 'failed' + if (folder && outcome === 'uncertain') { + // The folder screen refreshes and holds it until its list shows it; sending again could create a second one. + args.setError(uncertainCreateMessage(true)) + return + } + if (presenting()) { + triggerError() + } args.setError(error instanceof Error ? error.message : 'Failed to create workspace') } finally { + admission?.settle(outcome) createInFlightRef.current = false setCreating(false) } diff --git a/mobile/src/components/use-new-workspace-repositories.test.ts b/mobile/src/components/use-new-workspace-repositories.test.ts new file mode 100644 index 00000000000..09ada54c9cf --- /dev/null +++ b/mobile/src/components/use-new-workspace-repositories.test.ts @@ -0,0 +1,68 @@ +import { act } from 'react-test-renderer' +import { afterEach, describe, expect, it, vi } from 'vitest' +import type { ExecutionHostId } from '../../../src/shared/execution-host' +import { FakeSession } from '../transport/connection/mobile-endpoint-supervisor-test-fakes' +import { hookMount, settleQueryNotifications } from '../test-support/rpc-recording/hook-mount' +import type { MobileWorkspaceRepo } from './new-worktree-modal-types' +import { useNewWorkspaceRepositories } from './use-new-workspace-repositories' + +vi.mock('react-native', () => ({ AppState: {} })) +const servers = vi.hoisted(() => { + const state: { repos: ReadonlyMap } = { repos: new Map() } + return state +}) +vi.mock('../worktree/use-server-repos', () => ({ useServerRepos: () => servers.repos })) +vi.mock('../worktree/use-last-visited-worktree-repo', () => ({ + useLastVisitedWorktreeRepoId: () => ({ loaded: true, repoId: 'api' }) +})) + +const SERVER: ExecutionHostId = 'runtime:env-1' +const repo = (executionHostId?: ExecutionHostId): MobileWorkspaceRepo => ({ + id: 'api', + displayName: 'api', + path: '/src/api', + kind: 'git', + ...(executionHostId ? { executionHostId } : {}) +}) + +function desktopListing(repos: MobileWorkspaceRepo[]) { + const client = new FakeSession('connected') + client.sendRequest.mockResolvedValue({ + id: '1', + ok: true, + result: { repos }, + _meta: { runtimeId: 'r' } + }) + return client +} + +let mounted: ReturnType | null = null +afterEach(async () => { + await mounted?.unmount() + mounted = null + servers.repos = new Map() +}) + +describe('useNewWorkspaceRepositories initial repo', () => { + it('picks the named host’s copy of a repo id two hosts share', async () => { + const client = desktopListing([repo()]) + let picked: MobileWorkspaceRepo | null = null + mounted = hookMount(() => { + picked = useNewWorkspaceRepositories({ + client, + hostId: 'host-1', + visible: true, + initialRepo: { id: 'api', executionHostId: SERVER } + }).selectedRepo + }) + mounted.mount() + await settleQueryNotifications() + // The desktop's same-id repo must not stand in while the server's listing is on its way. + expect(picked).toBeNull() + + servers.repos = new Map([[SERVER, [repo(SERVER)]]]) + act(() => mounted?.update()) + await settleQueryNotifications() + expect(picked).toMatchObject({ id: 'api', executionHostId: SERVER }) + }) +}) diff --git a/mobile/src/components/use-new-workspace-repositories.ts b/mobile/src/components/use-new-workspace-repositories.ts index 4961b186ed2..15a0c14e57e 100644 --- a/mobile/src/components/use-new-workspace-repositories.ts +++ b/mobile/src/components/use-new-workspace-repositories.ts @@ -1,6 +1,6 @@ import { useEffect, useMemo, useState } from 'react' import { useQueryClient } from '@tanstack/react-query' -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import { getRepoExecutionHostId, type ExecutionHostId } from '../../../src/shared/execution-host' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import { cachedHostRepos } from '../host-screen/host-list-queries' import { listHostRepos } from '../worktree/server-repos' @@ -21,6 +21,8 @@ export function useNewWorkspaceRepositories(args: { serverClients?: ReadonlyMap hostId?: string visible: boolean + /** Picked once it is listed, in place of the last visited repo. */ + initialRepo?: { id: string; executionHostId: ExecutionHostId } }): { repos: MobileWorkspaceRepo[] allRepos: MobileWorkspaceRepo[] @@ -31,7 +33,7 @@ export function useNewWorkspaceRepositories(args: { loadError: string | null retryLoad: () => void } { - const { client, serverClients = NO_SERVER_CLIENTS, hostId, visible } = args + const { client, serverClients = NO_SERVER_CLIENTS, hostId, visible, initialRepo } = args const queryClient = useQueryClient() // The host list's repos, so the form opens with them while repo.list answers. const [initialRepos] = useState(() => cachedHostRepos(queryClient, hostId)) @@ -51,7 +53,15 @@ export function useNewWorkspaceRepositories(args: { : [...desktopRepos, ...[...serverRepos.values()].flat()], [desktopRepos, serverRepos] ) - const repos = useMemo(() => getNewWorkspaceDialogEligibleRepos(allRepos), [allRepos]) + const initialRepoId = initialRepo?.id + const initialRepoHost = initialRepo?.executionHostId + // Opened for one host's folder: every picker offers only that host, whose store holds the folder. + const repos = useMemo(() => { + const eligible = getNewWorkspaceDialogEligibleRepos(allRepos) + return initialRepoHost + ? eligible.filter((repo) => getRepoExecutionHostId(repo) === initialRepoHost) + : eligible + }, [allRepos, initialRepoHost]) // Derive the pick so it follows updated listings and disappears when its host stops listing it. const selectedRepo = useMemo( () => refreshMobileNewWorkspaceDialogSelectedRepo(repos, pickedRepo), @@ -59,7 +69,26 @@ export function useNewWorkspaceRepositories(args: { ) useEffect(() => { - if (!visible || !lastVisitedRepo.loaded || selectedRepo || repos.length === 0) { + if (!visible || selectedRepo || !initialRepoId) { + return + } + // Waits for its host's listing: a same-id repo on another host is a different repo. + const initial = repos.find( + (repo) => repo.id === initialRepoId && getRepoExecutionHostId(repo) === initialRepoHost + ) + if (initial) { + setSelectedRepo(initial) + } + }, [initialRepoHost, initialRepoId, repos, selectedRepo, visible]) + + useEffect(() => { + if ( + !visible || + initialRepoId || + !lastVisitedRepo.loaded || + selectedRepo || + repos.length === 0 + ) { return } const preferredRepoId = resolveNewWorkspaceDialogRepoId({ @@ -70,7 +99,7 @@ export function useNewWorkspaceRepositories(args: { if (preferredRepo) { setSelectedRepo(preferredRepo) } - }, [lastVisitedRepo.loaded, lastVisitedRepo.repoId, repos, selectedRepo, visible]) + }, [initialRepoId, lastVisitedRepo.loaded, lastVisitedRepo.repoId, repos, selectedRepo, visible]) useEffect(() => { if (!visible || !client) { diff --git a/mobile/src/device-store/device-store.ts b/mobile/src/device-store/device-store.ts index c1ea8d9cf81..adbb20ff677 100644 --- a/mobile/src/device-store/device-store.ts +++ b/mobile/src/device-store/device-store.ts @@ -7,11 +7,11 @@ import type { AESEncryptionKey } from 'expo-crypto' import { Directory, Paths } from 'expo-file-system' import { AppState } from 'react-native' import { createExpoGenerationFileSystem } from '../mobile-web-shell/generation-store-file-system' -import { loadStoredHostProfiles } from '../transport/hosts/host-metadata-store' +import { loadStoredHostProfiles } from '../host-catalog/host-metadata-store' import { readPairingKeychainItem, writePairingKeychainItem -} from '../transport/hosts/pairing-keychain' +} from '../host-credentials/pairing-keychain' import { createRootIndex, DEVICE_STORE_CAPS, @@ -260,18 +260,22 @@ let processStore: DeviceStore | null = null let started = false export function processDeviceStore(): DeviceStore { - processStore ??= createDeviceStore({ - fileSystem: createExpoGenerationFileSystem(), - roots: { + if (processStore === null) { + const roots = { cache: new Directory(Paths.cache, 'orca-store', 'v1').uri, draft: new Directory(Paths.document, 'orca-drafts', 'v1').uri - }, - keychain: { - read: () => readPairingKeychainItem(DEVICE_STORE_KEY_ITEM), - write: (hexKey) => writePairingKeychainItem(DEVICE_STORE_KEY_ITEM, hexKey) - }, - loadPairedHostIds: async () => (await loadStoredHostProfiles())?.map((host) => host.id) ?? null - }) + } + processStore = createDeviceStore({ + fileSystem: createExpoGenerationFileSystem(roots.cache), + roots, + keychain: { + read: () => readPairingKeychainItem(DEVICE_STORE_KEY_ITEM), + write: (hexKey) => writePairingKeychainItem(DEVICE_STORE_KEY_ITEM, hexKey) + }, + loadPairedHostIds: async () => + (await loadStoredHostProfiles())?.map((host) => host.id) ?? null + }) + } return processStore } diff --git a/mobile/src/diagnostics/connection-diagnostics-report.ts b/mobile/src/diagnostics/connection-diagnostics-report.ts index 3a6dd9728bf..42a9581cb3b 100644 --- a/mobile/src/diagnostics/connection-diagnostics-report.ts +++ b/mobile/src/diagnostics/connection-diagnostics-report.ts @@ -5,7 +5,7 @@ import type { MobileConnectionDiagnosticPath } from './connection/connection-log-types' import type { ConnectionState } from '../transport/connection/connection-state' -import { normalizeHostAppVersion } from '../transport/hosts/host-app-version' +import { normalizeHostAppVersion } from '../host-descriptors/host-app-version' import { formatEndpoint } from './host-reachability' import { diagnoseConnection } from './connection-diagnostics-analysis' import { redactConnectionLogEntry, redactConnectionLogText } from './connection-log-redaction' diff --git a/mobile/src/diagnostics/connection-diagnostics-screen-data.test.ts b/mobile/src/diagnostics/connection-diagnostics-screen-data.test.ts index 3a895518657..fa859474b28 100644 --- a/mobile/src/diagnostics/connection-diagnostics-screen-data.test.ts +++ b/mobile/src/diagnostics/connection-diagnostics-screen-data.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { resolveDiagnosticsHostId } from './connection-diagnostics-screen-data' -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' const host = (id: string): HostProfile => ({ id, diff --git a/mobile/src/diagnostics/connection-diagnostics-screen-data.ts b/mobile/src/diagnostics/connection-diagnostics-screen-data.ts index 341044db3da..360b1e437ae 100644 --- a/mobile/src/diagnostics/connection-diagnostics-screen-data.ts +++ b/mobile/src/diagnostics/connection-diagnostics-screen-data.ts @@ -1,6 +1,6 @@ import type { ConnectionLogStore } from './connection/connection-log-buffer' import type { ConnectionLogEntry } from './connection/connection-log-types' -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' import type { RpcClientContextValue } from '../transport/connection/rpc-client-context-contract' /** Route identity token: compared by reference to detect navigating away and back, never read. */ diff --git a/mobile/src/diagnostics/mobile-web-bundle-probe-row.tsx b/mobile/src/diagnostics/mobile-web-bundle-probe-row.tsx index 038c7f04810..37ab11331b1 100644 --- a/mobile/src/diagnostics/mobile-web-bundle-probe-row.tsx +++ b/mobile/src/diagnostics/mobile-web-bundle-probe-row.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react' import { View, Text, Pressable, ActivityIndicator } from 'react-native' import { Package } from 'lucide-react-native' -import { loadHosts } from '../transport/hosts/host-store' +import { loadHosts } from '../host-catalog/host-store' import { colors } from '../theme/mobile-theme' import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' import { troubleshootScreenStyles as styles } from './troubleshoot-screen-styles' @@ -9,7 +9,7 @@ import { useMobileWebBundleProbe, type MobileWebBundleProbeState } from './use-mobile-web-bundle-probe' -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' import type { Translate } from '../i18n/mobile-i18n' import { useMobileTranslation } from '../i18n/use-mobile-translation' import { ListGroup, ListRow } from '../components/list/ListGroup' diff --git a/mobile/src/diagnostics/mobile-web-shell-update-failure-row.tsx b/mobile/src/diagnostics/mobile-web-shell-update-failure-row.tsx index 526bec82310..78889ea5e51 100644 --- a/mobile/src/diagnostics/mobile-web-shell-update-failure-row.tsx +++ b/mobile/src/diagnostics/mobile-web-shell-update-failure-row.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' import { Text, View } from 'react-native' import type { MobileWebShellUpdateFailure } from '../mobile-web-shell/mobile-web-shell-update-failure' import { processGenerationStore } from '../mobile-web-shell/process-generation-store' -import { loadHosts } from '../transport/hosts/host-store' +import { loadHosts } from '../host-catalog/host-store' import { formatUpdateFailure } from './mobile-web-shell-update-failure-copy' import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' import { troubleshootScreenStyles as styles } from './troubleshoot-screen-styles' diff --git a/mobile/src/diagnostics/native-diagnostics-operations.test.ts b/mobile/src/diagnostics/native-diagnostics-operations.test.ts index 38cbb6e3ab2..8f57d41ce43 100644 --- a/mobile/src/diagnostics/native-diagnostics-operations.test.ts +++ b/mobile/src/diagnostics/native-diagnostics-operations.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import type { ConnectionState } from '../transport/connection/connection-state' -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' import { createNativeDiagnosticsOperations } from './native-diagnostics-operations' const logStore = vi.hoisted(() => ({ diff --git a/mobile/src/diagnostics/native-diagnostics-operations.ts b/mobile/src/diagnostics/native-diagnostics-operations.ts index 0b26bc5f912..5192c6d962d 100644 --- a/mobile/src/diagnostics/native-diagnostics-operations.ts +++ b/mobile/src/diagnostics/native-diagnostics-operations.ts @@ -1,6 +1,6 @@ import { Platform } from 'react-native' import Constants from 'expo-constants' -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' import type { RpcClientContextValue } from '../transport/connection/rpc-client-context-contract' import { connectionLogStore } from './connection/persisted-connection-log-store' import { diff --git a/mobile/src/diagnostics/use-troubleshoot-diagnostics.ts b/mobile/src/diagnostics/use-troubleshoot-diagnostics.ts index 2eee9847c73..297addc4ed5 100644 --- a/mobile/src/diagnostics/use-troubleshoot-diagnostics.ts +++ b/mobile/src/diagnostics/use-troubleshoot-diagnostics.ts @@ -2,7 +2,7 @@ import { useCallback, useEffect, useRef, useState } from 'react' import type { View } from 'react-native' import { Platform } from 'react-native' import { useMobileTranslation } from '../i18n/use-mobile-translation' -import { loadHostCatalog, loadHosts } from '../transport/hosts/host-store' +import { loadHostCatalog, loadHosts } from '../host-catalog/host-store' import { startDiagnosticFetchTimeout, type DiagnosticFetchTimeout diff --git a/mobile/src/dictation/MobileDictationPill.tsx b/mobile/src/dictation/MobileDictationPill.tsx index 56f33ae8c50..e257844d486 100644 --- a/mobile/src/dictation/MobileDictationPill.tsx +++ b/mobile/src/dictation/MobileDictationPill.tsx @@ -24,6 +24,7 @@ import { } from './mobile-dictation-controls-copy' import { dictationAwayCopy } from './mobile-dictation-away-copy' import { composerInputStyles } from '../components/composer-input/composer-input-styles' +import { MobileDictationStatusAnnouncement } from './MobileDictationStatusAnnouncement' import { useMobileDictationHost, useMobileDictationHostLive, @@ -163,13 +164,9 @@ function MobileDictationToast({ const timer = setTimeout(onDone, toast.open ? TOAST_WITH_OPEN_MS : TOAST_MS) return () => clearTimeout(timer) }, [onDone, toast]) - // The live region stays mounted so a screen reader hears the message appear. + // The host's announcer reads the message (shell or live region), so the toast itself stays quiet. return ( - + {toast ? ( @@ -212,6 +209,7 @@ export function MobileDictationPillLayer(): React.JSX.Element | null { ) : null} + - {mobileDictationStatusTitle(dictation) ?? ''} + {liveText.text} ) } diff --git a/mobile/src/dictation/dictation-reply-schema.ts b/mobile/src/dictation/dictation-reply-schema.ts index 23a738977ac..9d2bd752fcc 100644 --- a/mobile/src/dictation/dictation-reply-schema.ts +++ b/mobile/src/dictation/dictation-reply-schema.ts @@ -37,6 +37,8 @@ export const dictationSetupSchema = z.looseObject({ dictationHoldToRecord: salvagedOptional('dictationHoldToRecord', z.boolean()), // Absent from older hosts, which remove no fillers either; the phone then keeps them on, the host default. removeFillerWords: salvagedOptional('removeFillerWords', z.boolean()), + // Absent from older hosts, which stop after a minute; the shared reader maps absent and unknown to that. + stopAfterSilenceSeconds: salvagedOptional('stopAfterSilenceSeconds', z.number().nullable()), // Absent from older hosts, which spell nothing; malformed entries are dropped. dictationTerms: salvagedOptional( 'dictationTerms', diff --git a/mobile/src/dictation/mobile-dictation-announce-copy.ts b/mobile/src/dictation/mobile-dictation-announce-copy.ts new file mode 100644 index 00000000000..6295ce5f853 --- /dev/null +++ b/mobile/src/dictation/mobile-dictation-announce-copy.ts @@ -0,0 +1,42 @@ +import { translate } from '../i18n/mobile-i18n' + +// What a screen reader hears as a dictation moves along; nothing while you talk, so it never talks over you. +export const dictationAnnounceCopy = { + listening: (engine: 'phone' | 'computer', computer: string | null) => + engine === 'phone' + ? translate('dictation.announce.listeningOnPhone', 'Listening. Transcribing on this phone.') + : computer + ? translate('dictation.announce.listeningOn', 'Listening. Transcribing on {{computer}}.', { + computer + }) + : translate( + 'dictation.announce.listeningOnComputer', + 'Listening. Transcribing on the computer.' + ), + stillListening: () => translate('dictation.announce.stillListening', 'Still listening.'), + finishing: () => translate('dictation.announce.finishing', 'Finishing.'), + inserted: () => translate('dictation.announce.inserted', 'Inserted.'), + cancelled: () => translate('dictation.announce.cancelled', 'Dictation cancelled.'), + movedToComputer: (computer: string | null) => + computer + ? translate( + 'dictation.announce.movedTo', + 'This phone stopped transcribing. Continuing on {{computer}}.', + { computer } + ) + : translate( + 'dictation.announce.movedToComputer', + 'This phone stopped transcribing. Continuing on the computer.' + ), + stoppedKept: (reason: string | null) => + reason + ? translate( + 'dictation.announce.stoppedKept', + 'Dictation stopped. {{reason}}. Your recording is kept.', + { reason } + ) + : translate( + 'dictation.announce.stoppedKeptGeneric', + 'Dictation stopped. Your recording is kept.' + ) +} diff --git a/mobile/src/dictation/mobile-dictation-controls-copy.ts b/mobile/src/dictation/mobile-dictation-controls-copy.ts index 4de0e3c46c2..ea61b1db472 100644 --- a/mobile/src/dictation/mobile-dictation-controls-copy.ts +++ b/mobile/src/dictation/mobile-dictation-controls-copy.ts @@ -91,7 +91,18 @@ export function dictationMeterLabel( } // The few words a kept failure shows in the composer row; the full message is too long for it. -export function dictationFailureReason({ message, offline }: MobileDictationKeptFailure): string { +export function dictationFailureReason(failure: MobileDictationKeptFailure): string { + return ( + dictationKeptFailureCause(failure) ?? + translate('dictation.failure.stopped', 'Dictation stopped') + ) +} + +// Why a kept failure stopped, when it is known; null for the generic stop. +export function dictationKeptFailureCause({ + message, + offline +}: MobileDictationKeptFailure): string | null { if (offline || dictationFailureMessage(message) === dictationSessionLostMessage()) { return translate('dictation.failure.connectionLost', 'Connection lost') } @@ -101,5 +112,5 @@ export function dictationFailureReason({ message, offline }: MobileDictationKept if (message === phoneDictationFailedMessage()) { return translate('dictation.failure.phoneStopped', 'Stopped on this phone') } - return translate('dictation.failure.stopped', 'Dictation stopped') + return null } diff --git a/mobile/src/dictation/mobile-dictation-host-context.ts b/mobile/src/dictation/mobile-dictation-host-context.ts index 240a31f50b2..f9acb271e93 100644 --- a/mobile/src/dictation/mobile-dictation-host-context.ts +++ b/mobile/src/dictation/mobile-dictation-host-context.ts @@ -2,7 +2,9 @@ import { createContext, useContext, useEffect, useState, useSyncExternalStore } import type { UseMobileDictationResult } from '../hooks/mobile-dictation-session-state' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import type { MobileDictationAwayTarget } from './mobile-dictation-away-insert' +import type { MobileDictationLiveText } from './use-mobile-dictation-announcements' import type { DictationTerm } from '../../../src/shared/dictation-dictionary' +import type { StopAfterSilenceSeconds } from '../../../src/shared/dictation-silence-stop' export type MobileDictationHostToast = { message: string; open?: () => void } @@ -20,11 +22,14 @@ export type MobileDictationOwner = { // The target tab's pane key, for a screen still in the stack to switch back to it. readonly paneKey: string | undefined readonly dictationMode: string | undefined + readonly silenceSeconds: StopAfterSilenceSeconds readonly removeFillerWords: boolean // The computer's terms for this worktree, for words the phone recognizes itself. readonly dictationTerms: readonly DictationTerm[] | undefined // The computer spells its own words with this worktree's repo terms. readonly worktreeId: string + // The computer that would transcribe it, for what a screen reader hears; null when the phone lacks its name. + readonly computerName: string | null } // A mounted session screen, as the dictation host sees it. @@ -48,6 +53,8 @@ export type MobileDictationHost = { readonly start: (owner: MobileDictationOwner) => Promise // Stop with the selection tick, as every stop button does. readonly stop: () => void + // Say something to the screen reader; a screen's own toast is not read on the page. + readonly announce: (message: string) => void readonly attach: (screen: MobileDictationScreen) => () => void // A screen's shown() answer changed; the pill reads it on render. readonly refresh: () => void @@ -69,6 +76,8 @@ export type MobileDictationPill = { readonly clearToast: () => void // The tallest bottom bar a screen reported, so the pill floats above it. readonly clearance: number + // Announcements the shell could not speak, for the page's live region (TalkBack, older shells). + readonly liveText: MobileDictationLiveText } export const MobileDictationHostContext = createContext(null) diff --git a/mobile/src/dictation/mobile-dictation-host.tsx b/mobile/src/dictation/mobile-dictation-host.tsx index c4960704a7a..37daa11a247 100644 --- a/mobile/src/dictation/mobile-dictation-host.tsx +++ b/mobile/src/dictation/mobile-dictation-host.tsx @@ -4,12 +4,17 @@ import type { UseMobileDictationResult } from '../hooks/mobile-dictation-session import { useRouteHandoff } from '../navigation/route-handoff' import { triggerError } from '../platform/haptics' import { useClipboardWriter } from '../platform/clipboard' -import { dictationFailureMessage } from './mobile-dictation-setup' +import { dictationFailureMessage, isDictationSetupRequiredError } from './mobile-dictation-setup' import { useMobileDictationHaptics } from './use-mobile-dictation-haptics' import { useMobileDictationSilenceStop } from './use-mobile-dictation-silence-stop' +import { DEFAULT_STOP_AFTER_SILENCE_SECONDS } from '../../../src/shared/dictation-silence-stop' import { insertMobileDictationAway } from './mobile-dictation-away-insert' import { nativeChatDictationCopy } from './mobile-session-native-chat-dictation-copy' import { dictationAwayCopy } from './mobile-dictation-away-copy' +import { + useMobileDictationAnnouncements, + useMobileDictationSpeech +} from './use-mobile-dictation-announcements' import { MobileDictationClearanceContext, MobileDictationHostContext, @@ -58,6 +63,8 @@ export function MobileDictationHostProvider({ children }: { children: ReactNode const clearToast = useCallback(() => setToast(null), []) const [clearances, setClearances] = useState>(new Map()) const clipboard = useClipboardWriter() + const speech = useMobileDictationSpeech() + const { say: speak } = speech // Bring a dictation's target back: its screen if one is still mounted, otherwise open the session again. const openOwner = useCallback( @@ -78,10 +85,12 @@ export function MobileDictationHostProvider({ children }: { children: ReactNode }, [openOwner]) // Say it on the screen that shows the dictation, else in the host's toast (with Open for the dictation it is about). + // A screen's toast is not read by VoiceOver on the page, so it is spoken too; the host's toast is spoken when it shows. const say = (message: string, about?: MobileDictationOwner) => { const screen = screenFor(screensRef.current, ownerRef.current, false) if (screen?.shown()) { screen.toast(message) + speak(message) } else { setToast(about ? { message, open: () => openOwner(about) } : { message }) } @@ -90,6 +99,10 @@ export function MobileDictationHostProvider({ children }: { children: ReactNode const screen = screenFor(screensRef.current, ownerRef.current, false) if (screen?.shown()) { screen.reportFailure(err) + // A setup refusal opens the setup sheet, which is read on its own. + if (!isDictationSetupRequiredError(err.message)) { + speak(dictationFailureMessage(err.message)) + } return } triggerError() @@ -133,12 +146,40 @@ export function MobileDictationHostProvider({ children }: { children: ReactNode onAudioLimitReached: () => say(nativeChatDictationCopy.stoppedAtCloudLimit()) }) const stop = useMobileDictationHaptics(dictation) - useMobileDictationSilenceStop(dictation, owner?.dictationMode, stop, (message) => say(message)) + useMobileDictationSilenceStop( + dictation, + owner?.dictationMode, + // Off is null, so only a missing owner takes the default. + owner ? owner.silenceSeconds : DEFAULT_STOP_AFTER_SILENCE_SECONDS, + stop, + (message) => say(message) + ) // Screens subscribe to the live dictation; the host's context only changes when its owner or pill does. - const liveRef = useRef(dictation) + const liveRef = useRef(dictation) const listenersRef = useRef(new Set<() => void>()) - const { meter, start: startDictation, stop: stopDictation, cancel, retry } = dictation + const { + meter, + start: startDictation, + stop: stopDictation, + cancel: cancelDictation, + retry + } = dictation + const away = + owner !== null && + isUnderway(dictation) && + screenFor(screensRef.current, owner, false)?.shown() !== true + const { noteCancel } = useMobileDictationAnnouncements( + dictation, + { computerName: owner?.computerName ?? null, away, toast: toast?.message ?? null }, + speak + ) + // Every ✕ (in place, the pill, the terminal's long press) ends here, so a cancel is never read as "Inserted." + const cancel = useCallback(() => { + noteCancel() + return cancelDictation() + }, [cancelDictation, noteCancel]) + const published = useMemo(() => ({ ...dictation, cancel }), [cancel, dictation]) const idle = useMemo( () => ({ status: 'idle', @@ -159,7 +200,7 @@ export function MobileDictationHostProvider({ children }: { children: ReactNode ) const idleRef = useRef(idle) useLayoutEffect(() => { - liveRef.current = dictation + liveRef.current = published idleRef.current = idle for (const listener of listenersRef.current) { listener() @@ -215,19 +256,18 @@ export function MobileDictationHostProvider({ children }: { children: ReactNode }) }, []) - const away = - owner !== null && isUnderway(dictation) && !screenFor(screensRef.current, owner, false)?.shown() const title = owner?.title ?? '' const clearance = Math.max(0, ...clearances.values()) const pill = useMemo( - () => ({ away, title, open, toast, clearToast, clearance }), - [away, clearToast, clearance, open, title, toast] + () => ({ away, title, open, toast, clearToast, clearance, liveText: speech.liveText }), + [speech.liveText, away, clearToast, clearance, open, title, toast] ) const value = useMemo( () => ({ owner, start, stop, + announce: speak, attach, refresh, subscribe, @@ -235,7 +275,18 @@ export function MobileDictationHostProvider({ children }: { children: ReactNode getIdleDictation, getUnderway }), - [attach, getDictation, getIdleDictation, getUnderway, owner, refresh, start, stop, subscribe] + [ + attach, + getDictation, + getIdleDictation, + getUnderway, + owner, + refresh, + speak, + start, + stop, + subscribe + ] ) return ( diff --git a/mobile/src/dictation/mobile-dictation-setup.ts b/mobile/src/dictation/mobile-dictation-setup.ts index 61e607ca7a4..9ddcee87e81 100644 --- a/mobile/src/dictation/mobile-dictation-setup.ts +++ b/mobile/src/dictation/mobile-dictation-setup.ts @@ -3,7 +3,7 @@ import { hostDictationErrorMessage } from '../../../src/shared/host-dictation-error-messages' import { translate } from '../i18n/mobile-i18n' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import type { RpcResponse } from '../transport/rpc/rpc-wire-types' import { interpretOrThrowRefusalMessage } from '../transport/rpc/rpc-refusal-message' import '../transport/connection/stable-logical-rpc-client' @@ -128,7 +128,7 @@ export function isDictationSetupRequiredError(message: string): boolean { /** `worktreeId` asks for that repo's dictionary terms too. */ export async function fetchDictationSetup( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId?: string ): Promise { const reply = await requestDictationSetupReply(client, worktreeId ? { worktreeId } : null) @@ -150,7 +150,7 @@ export async function fetchDictationSetup( } async function requestDictationSetupReply( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, params: { worktreeId: string } | null ): Promise { try { @@ -165,7 +165,7 @@ async function requestDictationSetupReply( } export async function downloadDictationModel( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, modelId: string ): Promise { const reply = await dictationModelDownload.request(client, { modelId }) @@ -176,7 +176,7 @@ export async function downloadDictationModel( } export async function deleteDictationModel( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, modelId: string ): Promise { const reply = await dictationModelDelete.request(client, { modelId }) @@ -187,7 +187,7 @@ export async function deleteDictationModel( } export async function setDictationConfig( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, params: { enabled?: boolean modelId?: string diff --git a/mobile/src/dictation/mobile-session-native-chat-dictation-copy.ts b/mobile/src/dictation/mobile-session-native-chat-dictation-copy.ts index f7ea2f1ee2e..74babf880fa 100644 --- a/mobile/src/dictation/mobile-session-native-chat-dictation-copy.ts +++ b/mobile/src/dictation/mobile-session-native-chat-dictation-copy.ts @@ -14,9 +14,10 @@ export const nativeChatDictationCopy = { 'session.useNativeChatDictation.stoppedAtCloudLimit', 'Dictation stopped at the 10-minute cloud limit.' ), - stoppedAfterSilence: () => + stoppedAfterSilence: (seconds: number) => translate( - 'session.useNativeChatDictation.stoppedAfterSilence', - 'Stopped after a minute of silence' + 'session.useNativeChatDictation.stoppedAfterSilenceSeconds', + 'Stopped after {{seconds}} seconds of silence', + { seconds } ) } diff --git a/mobile/src/dictation/use-mobile-dictation-announcements.ts b/mobile/src/dictation/use-mobile-dictation-announcements.ts new file mode 100644 index 00000000000..0dd2d729a4c --- /dev/null +++ b/mobile/src/dictation/use-mobile-dictation-announcements.ts @@ -0,0 +1,113 @@ +import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react' +import type { UseMobileDictationResult } from '../hooks/mobile-dictation-session-state' +import { useAccessibilityAnnouncer } from '../platform/accessibility-announcer' +import { dictationAnnounceCopy } from './mobile-dictation-announce-copy' +import { dictationKeptFailureCause } from './mobile-dictation-controls-copy' + +// Finishing is said only when it is slow. +const FINISHING_ANNOUNCE_DELAY_MS = 1000 + +// What the shell could not speak, for the page's live region; the id changes on every message so a repeat is read again. +export type MobileDictationLiveText = { readonly text: string; readonly id: number } + +// Speak to the screen reader through the shell where it can, else into the live region. say keeps its identity. +export function useMobileDictationSpeech(): { + say: (message: string) => void + liveText: MobileDictationLiveText +} { + const announce = useAccessibilityAnnouncer() + const announceRef = useRef(announce) + useLayoutEffect(() => { + announceRef.current = announce + }) + const [liveText, setLiveText] = useState({ text: '', id: 0 }) + const say = useCallback((message: string) => { + void announceRef.current(message).then((spoken) => { + if (!spoken) { + setLiveText((current) => ({ text: message, id: current.id + 1 })) + } + }) + }, []) + return { say, liveText } +} + +// The dictation's own spoken moments: start, leaving its screen, a move to the computer, a slow finish, a cancel, a kept failure, the host's toasts. +// Outcomes (inserted, failed) are said by whoever knows them: the screen that inserted, or the host's failure report. +export function useMobileDictationAnnouncements( + dictation: Pick, + { + computerName, + away, + toast + }: { computerName: string | null; away: boolean; toast: string | null }, + say: (message: string) => void +): { noteCancel: () => void } { + const { status, engine, failure } = dictation + const previousStatus = useRef(status) + const cancelled = useRef(false) + const listeningSaid = useRef(false) + const movedAtSaid = useRef(null) + const statusRef = useRef(status) + + useEffect(() => { + const previous = previousStatus.current + previousStatus.current = status + statusRef.current = status + if (status === 'starting') { + cancelled.current = false + listeningSaid.current = false + } + // Only a ✕ (including Discard on a kept failure); a refused start's reason is said where it is reported. + if (status === 'idle' && previous !== 'idle' && cancelled.current) { + say(dictationAnnounceCopy.cancelled()) + } + if (status === 'idle') { + cancelled.current = false + } + }, [say, status]) + + // Leaving the screen keeps it going; say so once, then the next screen reads as usual. + useEffect(() => { + if (away && statusRef.current === 'recording') { + say(dictationAnnounceCopy.stillListening()) + } + }, [away, say]) + useEffect(() => { + if (toast) { + say(toast) + } + }, [say, toast]) + + useEffect(() => { + if (status === 'recording' && engine && !listeningSaid.current) { + listeningSaid.current = true + say(dictationAnnounceCopy.listening(engine.kind, computerName)) + } + if (engine?.movedAt != null && engine.movedAt !== movedAtSaid.current) { + movedAtSaid.current = engine.movedAt + say(dictationAnnounceCopy.movedToComputer(computerName)) + } + }, [computerName, engine, say, status]) + + useEffect(() => { + if (status !== 'processing') { + return + } + const timer = setTimeout( + () => say(dictationAnnounceCopy.finishing()), + FINISHING_ANNOUNCE_DELAY_MS + ) + return () => clearTimeout(timer) + }, [say, status]) + + useEffect(() => { + if (failure) { + say(dictationAnnounceCopy.stoppedKept(dictationKeptFailureCause(failure))) + } + }, [failure, say]) + + const noteCancel = useCallback(() => { + cancelled.current = true + }, []) + return { noteCancel } +} diff --git a/mobile/src/dictation/use-mobile-dictation-live.ts b/mobile/src/dictation/use-mobile-dictation-live.ts index 37528abb0cb..b5b89eff6f0 100644 --- a/mobile/src/dictation/use-mobile-dictation-live.ts +++ b/mobile/src/dictation/use-mobile-dictation-live.ts @@ -1,8 +1,8 @@ import { useCallback, useLayoutEffect, useMemo, useRef } from 'react' import type { UseMobileDictationResult } from '../hooks/mobile-dictation-session-state' import { useWorkspaceExecutionHost } from '../navigation/workspace-execution-host' -import { useHostDisplay } from '../transport/hosts/use-host-display' -import { useHostProfile } from '../transport/hosts/use-host-profile' +import { useHostDisplay } from '../host-descriptors/use-host-display' +import { useHostProfile } from '../host-catalog/use-host-profile' import type { MobileDictationLive } from './mobile-dictation-live-context' import { dictationFailureReason } from './mobile-dictation-controls-copy' @@ -17,10 +17,7 @@ export function useMobileDictationLive( cancelLatest.current = cancel }, [cancel]) const stableCancel = useCallback(() => cancelLatest.current(), []) - const hostProfile = useHostProfile(hostId) - const hostTitle = useHostDisplay(hostProfile).title - // A workspace routed to another server transcribes there, and the phone lacks that server's name. - const computerName = useWorkspaceExecutionHost() === undefined && hostProfile ? hostTitle : null + const computerName = useDictationComputerName(hostId) const { meter, engine, failure, retry } = dictation const failureReason = failure === null ? null : dictationFailureReason(failure) return useMemo( @@ -35,3 +32,10 @@ export function useMobileDictationLive( [meter, engine, computerName, stableCancel, failureReason, retry] ) } + +// The computer that transcribes a session's dictation; null when another server runs the workspace and the phone lacks its name. +export function useDictationComputerName(hostId: string): string | null { + const hostProfile = useHostProfile(hostId) + const hostTitle = useHostDisplay(hostProfile).title + return useWorkspaceExecutionHost() === undefined && hostProfile ? hostTitle : null +} diff --git a/mobile/src/dictation/use-mobile-dictation-silence-stop.ts b/mobile/src/dictation/use-mobile-dictation-silence-stop.ts index 11cc537bccc..e9a6baf5a31 100644 --- a/mobile/src/dictation/use-mobile-dictation-silence-stop.ts +++ b/mobile/src/dictation/use-mobile-dictation-silence-stop.ts @@ -1,5 +1,8 @@ import { useEffect, useEffectEvent } from 'react' -import { watchDictationSilence } from '../../../src/shared/dictation-silence-stop' +import { + watchDictationSilence, + type StopAfterSilenceSeconds +} from '../../../src/shared/dictation-silence-stop' import type { UseMobileDictationResult } from '../hooks/mobile-dictation-session-state' import { nativeChatDictationCopy } from './mobile-session-native-chat-dictation-copy' @@ -7,20 +10,23 @@ import { nativeChatDictationCopy } from './mobile-session-native-chat-dictation- export function useMobileDictationSilenceStop( dictation: Pick, dictationMode: string | undefined, + silenceSeconds: StopAfterSilenceSeconds, stop: () => void, showToast: (message: string) => void ): void { const { meter } = dictation - const watching = dictation.isRecording && dictationMode !== 'hold' + const watching = dictation.isRecording && dictationMode !== 'hold' && silenceSeconds !== null const stopForSilence = useEffectEvent(() => { - showToast(nativeChatDictationCopy.stoppedAfterSilence()) + showToast(nativeChatDictationCopy.stoppedAfterSilence(silenceSeconds ?? 0)) stop() }) useEffect(() => { - if (!watching) { + if (!watching || silenceSeconds === null) { return } - return watchDictationSilence(meter.lastSpeechAt, Date.now, () => stopForSilence()) - }, [meter, watching]) + return watchDictationSilence(meter.lastSpeechAt, Date.now, silenceSeconds * 1000, () => + stopForSilence() + ) + }, [meter, watching, silenceSeconds]) } diff --git a/mobile/src/files/attachments/use-mobile-session-image-attachments.ts b/mobile/src/files/attachments/use-mobile-session-image-attachments.ts index b4ccc6417d4..00af1d341b1 100644 --- a/mobile/src/files/attachments/use-mobile-session-image-attachments.ts +++ b/mobile/src/files/attachments/use-mobile-session-image-attachments.ts @@ -4,8 +4,8 @@ import type { MobileImageSource } from '../../platform/media-picker-contract' import type { MobileNativeChatSendIntent, MobileNativeChatSendOutcome -} from '../../session/native-chat/mobile-native-chat-send' -import type { StructuredMobileSendAttachment } from '../../session/use-mobile-structured-send-with-outcome' +} from '../../session/native-chat/composer/mobile-native-chat-send' +import type { StructuredMobileSendAttachment } from '../../session/native-chat/composer/use-mobile-structured-send-with-outcome' import { useMobileImageAttachment } from './use-mobile-image-attachment' import { useMobileNativeChatImageAttachments, diff --git a/mobile/src/files/mobile-chat-attachment-read.ts b/mobile/src/files/mobile-chat-attachment-read.ts index 5a68f6cc431..c3f2953ff98 100644 --- a/mobile/src/files/mobile-chat-attachment-read.ts +++ b/mobile/src/files/mobile-chat-attachment-read.ts @@ -8,7 +8,7 @@ import { type AttachmentTextRead } from '../../../src/shared/attachment-text/attachment-text-source' import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' // Match the shared wire identifier without importing the host capability aggregate into this route. const AGENT_SESSION_TEXT_ATTACHMENT_READ_CAPABILITY = 'native-chat.text-attachment-read.v1' @@ -23,7 +23,7 @@ const textRead = bindDeferredRpcOperation( }) ) -type AttachmentReaderClient = RpcOperationSender & +type AttachmentReaderClient = UnvalidatedRpcRequestPort & Pick export function createMobileChatAttachmentReader( diff --git a/mobile/src/files/native-chat-file-search-operations.ts b/mobile/src/files/native-chat-file-search-operations.ts index 44192e60de9..8f39e7d5873 100644 --- a/mobile/src/files/native-chat-file-search-operations.ts +++ b/mobile/src/files/native-chat-file-search-operations.ts @@ -2,13 +2,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc/r import { rpcResultVariant } from '../transport/rpc/rpc-operation-result-reader' import '../terminal/terminal-reply-schema' import { workspaceFilePathsSchema } from './workspace-file-paths-reply-schema' -import '../session/agent-launch/mobile-agent-detection-reply-schema' -import './session-documents/mobile-markdown-tab-reply-schema' -import '../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../terminal/session/mobile-session-terminal-reply-schema' -import '../worktree/session-worktree-record-reply-schema' -import '../session/native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../terminal/quick-commands/mobile-quick-command-reply-schema' // Skip refusals to retain suggestions; inspect method_not_found first to fall back from search to inventory. export const nativeChatFileSearchRead = bindDeferredRpcOperation( diff --git a/mobile/src/files/session-documents/mobile-file-tap-open.ts b/mobile/src/files/session-documents/mobile-file-tap-open.ts index 67a654ee852..cabeebe5a3d 100644 --- a/mobile/src/files/session-documents/mobile-file-tap-open.ts +++ b/mobile/src/files/session-documents/mobile-file-tap-open.ts @@ -12,7 +12,7 @@ import { type OpenedMobileSessionTabActivationState } from '../../session/tabs/opened-mobile-session-tab' import { isRendererUnavailableReply } from '../../transport/rpc/renderer-unavailable-reply' -import type { RpcOperationSender } from '../../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../../transport/rpc/unvalidated-rpc-request-port' import type { RpcResponse } from '../../transport/rpc/rpc-wire-types' // Hard-wrap guesses can number in the hundreds; stay far below the page bridge's 64 pending requests. @@ -30,7 +30,7 @@ export type MobileFileTapFailure = { } export type OpenMobileFileTapOptions = { - client: RpcOperationSender + client: UnvalidatedRpcRequestPort hostId: string worktreeId: string worktreeName?: string diff --git a/mobile/src/files/session-documents/mobile-file-tap-operations.ts b/mobile/src/files/session-documents/mobile-file-tap-operations.ts index ce347a864c1..d4da628703a 100644 --- a/mobile/src/files/session-documents/mobile-file-tap-operations.ts +++ b/mobile/src/files/session-documents/mobile-file-tap-operations.ts @@ -4,7 +4,6 @@ import '../mobile-file-preview-operations' import { fileTapOpenedSchema } from './mobile-file-tap-reply-schema' import '../../agent-history/mobile-ai-vault-resume-reply-schema' import '../../browser/mobile-session-browser-reply-schema' -import '../../transport/rpc/rpc-uninterpreted-reply-schemas' // Best-effort taps skip refused opens; explicit Changes-screen opens instead show the host error. export const fileTapOpenRun = bindDeferredRpcOperation( diff --git a/mobile/src/files/session-documents/mobile-markdown-tab-operations.ts b/mobile/src/files/session-documents/mobile-markdown-tab-operations.ts index 6978b9515cf..2d3d4a336d6 100644 --- a/mobile/src/files/session-documents/mobile-markdown-tab-operations.ts +++ b/mobile/src/files/session-documents/mobile-markdown-tab-operations.ts @@ -19,13 +19,6 @@ export const sessionMarkdownNoteCreate = bindDeferredRpcOperation( import '../../terminal/terminal-reply-schema' import { markdownTabDocumentSchema } from './mobile-markdown-tab-reply-schema' -import '../../session/agent-launch/mobile-agent-detection-reply-schema' - -import '../../terminal/session/mobile-session-terminal-reply-schema' -import '../../worktree/session-worktree-record-reply-schema' -import '../../session/native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../../terminal/quick-commands/mobile-quick-command-reply-schema' -import '../workspace-file-paths-reply-schema' // Inspect renderer_unavailable before interpretation so headless hosts can fall back to disk. export const markdownTabRead = bindDeferredRpcOperation( @@ -38,8 +31,6 @@ export const markdownTabRead = bindDeferredRpcOperation( }) ) -import '../../session/tabs/mobile-session-tab-write-reply-schema' - import '../../terminal/quick-commands/mobile-quick-command-operations' export const markdownTabSave = bindDeferredRpcOperation( diff --git a/mobile/src/files/session-documents/use-mobile-file-tap-handlers.ts b/mobile/src/files/session-documents/use-mobile-file-tap-handlers.ts index ff6dfc7ddfd..31752b15f51 100644 --- a/mobile/src/files/session-documents/use-mobile-file-tap-handlers.ts +++ b/mobile/src/files/session-documents/use-mobile-file-tap-handlers.ts @@ -6,10 +6,10 @@ import { useWorkspaceRouteHandoff } from '../../navigation/workspace-route-hando import { triggerSelection } from '../../platform/haptics' import { openMobileFileTap, type FileTapSessionTab } from './mobile-file-tap-open' import { openMobileNativeChatFileTap } from '../../session/native-chat/visual/mobile-native-chat-open-file' -import type { RpcOperationSender } from '../../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../../transport/rpc/unvalidated-rpc-request-port' type MobileFileTapHandlerOptions = { - client: RpcOperationSender | null + client: UnvalidatedRpcRequestPort | null hostId: string worktreeId: string worktreeName?: string diff --git a/mobile/src/home/MobileHomeNeedsYou.tsx b/mobile/src/home/MobileHomeActiveAgents.tsx similarity index 70% rename from mobile/src/home/MobileHomeNeedsYou.tsx rename to mobile/src/home/MobileHomeActiveAgents.tsx index e31ca0db5c1..a8f41a222b0 100644 --- a/mobile/src/home/MobileHomeNeedsYou.tsx +++ b/mobile/src/home/MobileHomeActiveAgents.tsx @@ -2,15 +2,15 @@ import { memo } from 'react' import type { AgentListRow } from '../agents/agent-list-rows' import { MobileAgentListRows, type AgentListRowHandlers } from '../agents/MobileAgentListRows' import { useMobileTranslation } from '../i18n/use-mobile-translation' -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' import { areStructurallyEqual } from '../worktree/structural-equality' import { MobileHomeSectionHeading } from './MobileHomeSectionHeading' // Enough to act on without pushing Desktops off the first screen; the Agents tab has the rest. -const NEEDS_YOU_ROWS_SHOWN = 3 +const ACTIVE_ROWS_SHOWN = 3 -/** Feed's short list of agents waiting on the user; hidden when none are. */ -export const MobileHomeNeedsYou = memo(function MobileHomeNeedsYou(props: { +/** Feed's short list of agents waiting on the user or working, those waiting first; hidden when none are. */ +export const MobileHomeActiveAgents = memo(function MobileHomeActiveAgents(props: { handlers: AgentListRowHandlers rows: readonly AgentListRow[] hosts: readonly HostProfile[] @@ -24,14 +24,14 @@ export const MobileHomeNeedsYou = memo(function MobileHomeNeedsYou(props: { return ( <> 1} hosts={props.hosts} diff --git a/mobile/src/home/MobileHomeDesktopRow.tsx b/mobile/src/home/MobileHomeDesktopRow.tsx index 2d8786ddb8a..71fb2e14a4a 100644 --- a/mobile/src/home/MobileHomeDesktopRow.tsx +++ b/mobile/src/home/MobileHomeDesktopRow.tsx @@ -6,10 +6,10 @@ import { statusDotColor } from '../components/StatusDot' import type { ConnectionVerdict } from '../transport/connection/connection-health' import { verdictDisplayLabel } from '../transport/connection/connection-health' import { mobileConnectionPathAccessibilityLabel } from '../transport/connection/mobile-connection-path-label' -import { useHostDisplay } from '../transport/hosts/use-host-display' +import { useHostDisplay } from '../host-descriptors/use-host-display' import type { MobileConnectionPath } from '../transport/connection/stable-logical-rpc-client' import type { ConnectionState } from '../transport/connection/connection-state' -import type { HostCatalogEntry, HostProfile } from '../transport/hosts/host-profile' +import type { HostCatalogEntry, HostProfile } from '../host-catalog/host-profile' import { colors } from '../theme/mobile-theme' import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' import { homeHostWorktreeSummary, type HostWorktreeInfo } from '../worktree/home-worktree-info' diff --git a/mobile/src/home/MobileHomeHostList.tsx b/mobile/src/home/MobileHomeHostList.tsx index ad442bc3472..f336850241d 100644 --- a/mobile/src/home/MobileHomeHostList.tsx +++ b/mobile/src/home/MobileHomeHostList.tsx @@ -7,7 +7,7 @@ import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' import { classifyConnection } from '../transport/connection/connection-health' import { resolveHomeHostConnectionState } from '../transport/hosts/home-host-auto-connect' import type { ConnectionState } from '../transport/connection/connection-state' -import type { HostCatalogEntry } from '../transport/hosts/host-profile' +import type { HostCatalogEntry } from '../host-catalog/host-profile' import type { HostWorktreeInfo } from '../worktree/home-worktree-info' import type { HomeHostConnections } from './home-host-connection-projection' import { homeListStyles } from './home-list-styles' diff --git a/mobile/src/home/MobileHomeScreen.tsx b/mobile/src/home/MobileHomeScreen.tsx index b54010f1322..048b43c3ee9 100644 --- a/mobile/src/home/MobileHomeScreen.tsx +++ b/mobile/src/home/MobileHomeScreen.tsx @@ -23,9 +23,9 @@ import { } from '../transport/connection/host-client-hooks' import { hostEndpointLabel } from '../transport/hosts/host-endpoint-label' import { resolveHomeHostConnectionState } from '../transport/hosts/home-host-auto-connect' -import { removeHostAndCloseClient } from '../transport/hosts/host-removal-lifecycle' -import { loadHostCatalog } from '../transport/hosts/host-store' -import type { HostCatalogEntry, HostProfile } from '../transport/hosts/host-profile' +import { removeHostAndCloseClient } from '../host-catalog/host-removal-lifecycle' +import { loadHostCatalog } from '../host-catalog/host-store' +import type { HostCatalogEntry, HostProfile } from '../host-catalog/host-profile' import { useOpenMobileHostEdit } from '../host-screen/use-open-mobile-host-edit' import { mobileConnectionPathLabel } from '../transport/connection/mobile-connection-path-label' import { newWorkspaceOverlayHref } from '../new-workspace/new-workspace-overlay-route' diff --git a/mobile/src/home/MobileHomeTasksSection.tsx b/mobile/src/home/MobileHomeTasksSection.tsx index 8df195fc8b7..cb695351164 100644 --- a/mobile/src/home/MobileHomeTasksSection.tsx +++ b/mobile/src/home/MobileHomeTasksSection.tsx @@ -6,7 +6,7 @@ import { PickerModal } from '../components/PickerModal' import { useConnectedHostPicker } from '../components/use-connected-host-picker' import { colors } from '../theme/mobile-theme' import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' import { homeListStyles as styles } from './home-list-styles' type HomeHostSectionProps = { diff --git a/mobile/src/home/mobile-home-connection-state.ts b/mobile/src/home/mobile-home-connection-state.ts index 39353be62dd..03e3b95cf9e 100644 --- a/mobile/src/home/mobile-home-connection-state.ts +++ b/mobile/src/home/mobile-home-connection-state.ts @@ -1,6 +1,6 @@ import type { RpcClient } from '../transport/rpc/rpc-client-contract' import type { ConnectionState } from '../transport/connection/connection-state' -import type { HostCatalogEntry } from '../transport/hosts/host-profile' +import type { HostCatalogEntry } from '../host-catalog/host-profile' export type MobileHomeClientEntry = { hostId: string diff --git a/mobile/src/home/tabs/MobileHomeAgentsDesktopFilter.tsx b/mobile/src/home/tabs/MobileHomeAgentsDesktopFilter.tsx index 04b40720156..778dcb1a621 100644 --- a/mobile/src/home/tabs/MobileHomeAgentsDesktopFilter.tsx +++ b/mobile/src/home/tabs/MobileHomeAgentsDesktopFilter.tsx @@ -7,8 +7,8 @@ import type { Translate } from '../../i18n/mobile-i18n' import { useMobileTranslation } from '../../i18n/use-mobile-translation' import { colors } from '../../theme/mobile-theme' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' -import type { HostProfile } from '../../transport/hosts/host-profile' -import { useHostDisplay } from '../../transport/hosts/use-host-display' +import type { HostProfile } from '../../host-catalog/host-profile' +import { useHostDisplay } from '../../host-descriptors/use-host-display' import { MobileHomePill } from './MobileHomeHostPill' const ALL_DESKTOPS = '__all__' diff --git a/mobile/src/home/tabs/MobileHomeAgentsTab.tsx b/mobile/src/home/tabs/MobileHomeAgentsTab.tsx index c31b8a37079..e1029611889 100644 --- a/mobile/src/home/tabs/MobileHomeAgentsTab.tsx +++ b/mobile/src/home/tabs/MobileHomeAgentsTab.tsx @@ -29,8 +29,8 @@ import { useSerializedStoredState } from '../../storage/use-serialized-stored-st import { colors, spacing } from '../../theme/mobile-theme' import { themedStyleSheet } from '../../theme/themed-styles' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' -import type { HostProfile } from '../../transport/hosts/host-profile' -import { useHostDisplay } from '../../transport/hosts/use-host-display' +import type { HostProfile } from '../../host-catalog/host-profile' +import { useHostDisplay } from '../../host-descriptors/use-host-display' import { formatTimeAgo } from '../../worktree/agent-row-display' import { homeListStyles } from '../home-list-styles' import { MobileHomeSectionHeading } from '../MobileHomeSectionHeading' diff --git a/mobile/src/home/tabs/MobileHomeAutomationsTab.tsx b/mobile/src/home/tabs/MobileHomeAutomationsTab.tsx index b385ac496eb..eeda1071407 100644 --- a/mobile/src/home/tabs/MobileHomeAutomationsTab.tsx +++ b/mobile/src/home/tabs/MobileHomeAutomationsTab.tsx @@ -20,8 +20,8 @@ import { themedStyleSheet } from '../../theme/themed-styles' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' import { useHostClient } from '../../transport/connection/host-client-hooks' import type { ConnectionState } from '../../transport/connection/connection-state' -import type { HostProfile } from '../../transport/hosts/host-profile' -import { useHostDisplay } from '../../transport/hosts/use-host-display' +import type { HostProfile } from '../../host-catalog/host-profile' +import { useHostDisplay } from '../../host-descriptors/use-host-display' import { homeListStyles as list } from '../home-list-styles' import { MobileHomeSectionHeading } from '../MobileHomeSectionHeading' import { MobileHomeAutomationRow, MobileHomeAutomationRunRow } from './MobileHomeAutomationRows' diff --git a/mobile/src/home/tabs/MobileHomeFeedTab.tsx b/mobile/src/home/tabs/MobileHomeFeedTab.tsx index 68e1d7ad013..3ba20626d9a 100644 --- a/mobile/src/home/tabs/MobileHomeFeedTab.tsx +++ b/mobile/src/home/tabs/MobileHomeFeedTab.tsx @@ -4,16 +4,16 @@ import { useResponsiveLayout } from '../../layout/responsive-layout' import { spacing } from '../../theme/mobile-theme' import { themedStyleSheet } from '../../theme/themed-styles' import type { AgentListRowHandlers } from '../../agents/MobileAgentListRows' -import type { HostCatalogEntry } from '../../transport/hosts/host-profile' +import type { HostCatalogEntry } from '../../host-catalog/host-profile' import { MobileHomeAppUpdateCard } from '../MobileHomeAppUpdateCard' import { MobileHomeEmptyState } from '../MobileHomeEmptyState' import { MobileHomeHostList } from '../MobileHomeHostList' -import { MobileHomeNeedsYou } from '../MobileHomeNeedsYou' +import { MobileHomeActiveAgents } from '../MobileHomeActiveAgents' import { MobileHomeTasksSection } from '../MobileHomeTasksSection' import type { MobileHomeData } from '../use-mobile-home-data' import { MobileHomeTabHeader } from './MobileHomeTabHeader' -/** Home's first tab: agents that need you, the desktops, and Tasks. */ +/** Home's first tab: agents that need you or are working, the desktops, and Tasks. */ export function MobileHomeFeedTab(props: { data: MobileHomeData bottomInset: number @@ -42,7 +42,7 @@ export function MobileHomeFeedTab(props: { /> ) } - const needsYou = data.agentsNeedingYou.length > 0 + const hasActiveAgents = data.activeAgents.length > 0 return ( <> {title} @@ -53,8 +53,8 @@ export function MobileHomeFeedTab(props: { isWideLayout && { maxWidth: contentMaxWidth, width: '100%', alignSelf: 'center' } ]} > - selectAgentsNeedingYou(agentList), [agentList]) + const activeAgents = useMemo(() => selectActiveAgents(agentList), [agentList]) const needsYouByHost = useMemo( () => countAgentsNeedingYouByHost(agentsNeedingYou), [agentsNeedingYou] @@ -274,6 +276,7 @@ export function useMobileHomeData() { ...connections, accountsByHost, applyAgentActivity: agentActivity.apply, + activeAgents, agentList, agentsNeedingYou, connectedHosts, diff --git a/mobile/src/home/use-mobile-home-host-connections.ts b/mobile/src/home/use-mobile-home-host-connections.ts index 11b26c25c46..cb5838a8510 100644 --- a/mobile/src/home/use-mobile-home-host-connections.ts +++ b/mobile/src/home/use-mobile-home-host-connections.ts @@ -12,7 +12,7 @@ import { usePrimeHosts } from '../transport/connection/host-client-hooks' import { selectHomeAutoConnectHostIds } from '../transport/hosts/home-host-auto-connect' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import type { ConnectionState } from '../transport/connection/connection-state' -import type { HostCatalogEntry, HostProfile } from '../transport/hosts/host-profile' +import type { HostCatalogEntry, HostProfile } from '../host-catalog/host-profile' import { useAllHostClients } from '../transport/connection/use-all-host-clients' import { readMobileHomeLastConnected, diff --git a/mobile/src/transport/hosts/host-catalog-credential-join.ts b/mobile/src/host-catalog/host-catalog-credential-join.ts similarity index 92% rename from mobile/src/transport/hosts/host-catalog-credential-join.ts rename to mobile/src/host-catalog/host-catalog-credential-join.ts index 5f7b45e1cc1..be175ff615b 100644 --- a/mobile/src/transport/hosts/host-catalog-credential-join.ts +++ b/mobile/src/host-catalog/host-catalog-credential-join.ts @@ -1,4 +1,4 @@ -import type { MobileRelayEndpoint } from '../../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' +import type { MobileRelayEndpoint } from '../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' import type { HostListSnapshot } from './host-list-load-sharing' import type { HostCatalogEntry, StoredHostProfile } from './host-profile' diff --git a/mobile/src/transport/hosts/host-catalog-selection.ts b/mobile/src/host-catalog/host-catalog-selection.ts similarity index 100% rename from mobile/src/transport/hosts/host-catalog-selection.ts rename to mobile/src/host-catalog/host-catalog-selection.ts diff --git a/mobile/src/host-catalog/host-connection-history.ts b/mobile/src/host-catalog/host-connection-history.ts new file mode 100644 index 00000000000..a34e4289c12 --- /dev/null +++ b/mobile/src/host-catalog/host-connection-history.ts @@ -0,0 +1,17 @@ +import { mutateStoredHosts } from './host-list-mutation-queue' + +export async function updateLastConnected(hostId: string): Promise { + try { + await mutateStoredHosts((hosts) => { + const index = hosts.findIndex((h) => h.id === hostId) + if (index === -1) { + return hosts + } + const next = hosts.slice() + next[index] = { ...next[index]!, lastConnected: Date.now() } + return next + }) + } catch { + // Swallow bookkeeping failures because void callers cannot catch them. + } +} diff --git a/mobile/src/host-catalog/host-connection-history.web.ts b/mobile/src/host-catalog/host-connection-history.web.ts new file mode 100644 index 00000000000..095f18af6dd --- /dev/null +++ b/mobile/src/host-catalog/host-connection-history.web.ts @@ -0,0 +1,2 @@ +// Recency belongs to the native host list, which this page does not show. +export const updateLastConnected = (_hostId: string): Promise => Promise.resolve() diff --git a/mobile/src/transport/hosts/host-list-load-sharing.test.ts b/mobile/src/host-catalog/host-list-load-sharing.test.ts similarity index 100% rename from mobile/src/transport/hosts/host-list-load-sharing.test.ts rename to mobile/src/host-catalog/host-list-load-sharing.test.ts diff --git a/mobile/src/transport/hosts/host-list-load-sharing.ts b/mobile/src/host-catalog/host-list-load-sharing.ts similarity index 100% rename from mobile/src/transport/hosts/host-list-load-sharing.ts rename to mobile/src/host-catalog/host-list-load-sharing.ts diff --git a/mobile/src/transport/hosts/host-list-mutation-queue.ts b/mobile/src/host-catalog/host-list-mutation-queue.ts similarity index 100% rename from mobile/src/transport/hosts/host-list-mutation-queue.ts rename to mobile/src/host-catalog/host-list-mutation-queue.ts diff --git a/mobile/src/transport/hosts/host-metadata-store.ts b/mobile/src/host-catalog/host-metadata-store.ts similarity index 100% rename from mobile/src/transport/hosts/host-metadata-store.ts rename to mobile/src/host-catalog/host-metadata-store.ts diff --git a/mobile/src/transport/hosts/host-name-identity.test.ts b/mobile/src/host-catalog/host-name-identity.test.ts similarity index 96% rename from mobile/src/transport/hosts/host-name-identity.test.ts rename to mobile/src/host-catalog/host-name-identity.test.ts index 0c4878d0ef4..b69bc8d38fb 100644 --- a/mobile/src/transport/hosts/host-name-identity.test.ts +++ b/mobile/src/host-catalog/host-name-identity.test.ts @@ -25,7 +25,7 @@ vi.mock('react-native', () => ({ Platform: { OS: 'ios' } })) -vi.mock('./host-credential-cleanup', () => ({ +vi.mock('../host-credentials/host-credential-cleanup', () => ({ cancelPendingHostCredentialCleanup: vi.fn().mockResolvedValue(undefined), recordHostCredentialCleanupIntent: vi.fn().mockResolvedValue(undefined), scheduleHostCredentialCleanup: vi.fn().mockResolvedValue(undefined), @@ -38,7 +38,7 @@ import { savePairedHost, updateHostNameAndEndpoint } from './host-store' -import { updateHostDescriptor } from './host-descriptor-persistence' +import { updateHostDescriptor } from '../host-descriptors/host-descriptor-persistence' import { resetMobileRelayHostOverlayStoreForTests } from './mobile-relay-host-overlay-store' import { StoredHostProfileSchema, type StoredHostProfile } from './host-profile' diff --git a/mobile/src/transport/hosts/host-name-identity.ts b/mobile/src/host-catalog/host-name-identity.ts similarity index 97% rename from mobile/src/transport/hosts/host-name-identity.ts rename to mobile/src/host-catalog/host-name-identity.ts index b87cf1c273f..1b5bdb878e1 100644 --- a/mobile/src/transport/hosts/host-name-identity.ts +++ b/mobile/src/host-catalog/host-name-identity.ts @@ -1,6 +1,6 @@ import { GENERATED_HOST_NAME_PATTERN, getNextHostNameFromHosts } from './host-names' import type { StoredHostProfile } from './host-profile' -import { sameHostMachine, type HostMachine } from '../../../../src/shared/host-machine-line' +import { sameHostMachine, type HostMachine } from '../../../src/shared/host-machine-line' // Resolve name identity inside host-store’s serialized mutation so display name and sources commit together; see withReportedDescriptor’s omission exception. diff --git a/mobile/src/transport/hosts/host-names.ts b/mobile/src/host-catalog/host-names.ts similarity index 100% rename from mobile/src/transport/hosts/host-names.ts rename to mobile/src/host-catalog/host-names.ts diff --git a/mobile/src/transport/hosts/host-profile.ts b/mobile/src/host-catalog/host-profile.ts similarity index 82% rename from mobile/src/transport/hosts/host-profile.ts rename to mobile/src/host-catalog/host-profile.ts index 9fb53ad7404..f74c01a0f79 100644 --- a/mobile/src/transport/hosts/host-profile.ts +++ b/mobile/src/host-catalog/host-profile.ts @@ -1,13 +1,13 @@ import { z } from 'zod' -import '../../../../src/shared/remote-runtime/pairing/mobile-relay-pairing-offer' +import '../../../src/shared/remote-runtime/pairing/mobile-relay-pairing-offer' import { MobileRelayEndpointSchema, type MobileRelayEndpoint -} from '../../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' -import { NODE_PLATFORM_NAMES } from '../connection/mobile-runtime-host-platform' -import { salvagedOptional } from '../../../../src/shared/zod-salvage' -import type { HostMachine } from '../../../../src/shared/host-machine-line' -import { HostMachineSchema } from './host-status-reply-schema' +} from '../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' +import { NODE_PLATFORM_NAMES } from '../transport/connection/mobile-runtime-host-platform' +import { salvagedOptional } from '../../../src/shared/zod-salvage' +import type { HostMachine } from '../../../src/shared/host-machine-line' +import { HostMachineSchema } from '../transport/hosts/host-status-reply-schema' export type HostProfile = { id: string diff --git a/mobile/src/transport/hosts/host-removal-lifecycle.ts b/mobile/src/host-catalog/host-removal-lifecycle.ts similarity index 76% rename from mobile/src/transport/hosts/host-removal-lifecycle.ts rename to mobile/src/host-catalog/host-removal-lifecycle.ts index 4349f09127e..65ff0eff370 100644 --- a/mobile/src/transport/hosts/host-removal-lifecycle.ts +++ b/mobile/src/host-catalog/host-removal-lifecycle.ts @@ -1,12 +1,12 @@ import type { QueryClient } from '@tanstack/react-query' -import { wipeHostStore } from '../../device-store/device-store' +import { wipeHostStore } from '../device-store/device-store' import { deleteHostPageCache, forgetHostUpdateFailures -} from '../../mobile-web-shell/removed-host-shell-cache' -import { unregisterPushForRemovedHost } from '../../notifications/push-registration' -import { forgetNativeHostQueries } from '../../query/native-query-persistence' -import { forgetHostDescriptor } from './host-descriptor-store' +} from '../mobile-web-shell/removed-host-shell-cache' +import { unregisterPushForRemovedHost } from '../notifications/push-registration' +import { forgetNativeHostQueries } from '../query/native-query-persistence' +import { forgetHostDescriptor } from '../host-descriptors/host-descriptor-store' import { removeHost } from './host-store' export async function removeHostAndCloseClient( diff --git a/mobile/src/transport/hosts/host-removal-lifecycle.web.ts b/mobile/src/host-catalog/host-removal-lifecycle.web.ts similarity index 100% rename from mobile/src/transport/hosts/host-removal-lifecycle.web.ts rename to mobile/src/host-catalog/host-removal-lifecycle.web.ts diff --git a/mobile/src/transport/hosts/host-store.test.ts b/mobile/src/host-catalog/host-store.test.ts similarity index 55% rename from mobile/src/transport/hosts/host-store.test.ts rename to mobile/src/host-catalog/host-store.test.ts index 04b82058be9..9b2a3a60382 100644 --- a/mobile/src/transport/hosts/host-store.test.ts +++ b/mobile/src/host-catalog/host-store.test.ts @@ -31,24 +31,14 @@ vi.mock('react-native', () => ({ Platform: platformMock })) -vi.mock('./host-credential-cleanup', () => ({ +vi.mock('../host-credentials/host-credential-cleanup', () => ({ cancelPendingHostCredentialCleanup: (...args: unknown[]) => cancelCleanupMock(...args), recordHostCredentialCleanupIntent: (...args: unknown[]) => recordCleanupIntentMock(...args), scheduleHostCredentialCleanup: (...args: unknown[]) => scheduleCleanupMock(...args), retryPendingHostCredentialCleanups: vi.fn() })) -import { - loadHostCatalog, - loadHosts, - RelayRoutingHostRemovedError, - removeHost, - resolvePairingHostIdentity, - resetHostStoreForTests, - savePairedHost, - setRelayRouting, - updateHostNameAndEndpoint -} from './host-store' +import { loadHostCatalog, loadHosts, resetHostStoreForTests, savePairedHost } from './host-store' import { resetMobileRelayHostOverlayStoreForTests } from './mobile-relay-host-overlay-store' const HOSTS_STORAGE_KEY = 'orca:hosts' @@ -67,14 +57,6 @@ const HOST_TWO = { publicKeyB64: 'key-2', lastConnected: 0 } -const HOST_ONE_RELAY = { - v: 1 as const, - directorUrl: 'https://relay.onorca.dev', - cellUrl: 'https://relay-c1.onorca.dev', - assignmentEpoch: 7, - relayHostId: 'AbCdEf0123_-xyZ9', - e2eeFraming: 2 as const -} describe('host-store list mutations', () => { let storedHostsRaw: string @@ -134,13 +116,6 @@ describe('host-store list mutations', () => { expect(profiles.map(({ id }) => id)).toEqual([HOST_TWO.id]) }) - it('fails closed when durable host identity storage is unreadable', async () => { - asyncStorageMock.getItem.mockRejectedValueOnce(new Error('storage unavailable')) - - await expect(resolvePairingHostIdentity('key-new', 'host-new')).rejects.toThrow(/unreadable/) - expect(asyncStorageMock.setItem).not.toHaveBeenCalled() - }) - it('serves a committed replacement token when same-key metadata persistence fails', async () => { const duplicate = { ...HOST_TWO, @@ -164,148 +139,6 @@ describe('host-store list mutations', () => { loadHosts().then((hosts) => hosts.find(({ id }) => id === HOST_ONE.id)?.deviceToken) ).resolves.toBe('replacement-token') }) - - it('refuses an early same-key token write without durable cleanup intent', async () => { - const replacement = { - ...HOST_TWO, - id: 'host-replacement', - publicKeyB64: HOST_ONE.publicKeyB64, - deviceToken: 'replacement-token' - } - recordCleanupIntentMock.mockRejectedValueOnce(new Error('intent storage unavailable')) - - await expect(savePairedHost(replacement)).rejects.toThrow('intent storage unavailable') - - expect(JSON.parse(storedHostsRaw)).toEqual([HOST_ONE, HOST_TWO]) - expect(secureStoreMock.setItemAsync).not.toHaveBeenCalled() - }) - - it('refuses to resurrect a removed host during relay upgrade publication', async () => { - storedHostsRaw = JSON.stringify([HOST_TWO]) - - await expect(setRelayRouting(HOST_ONE.id, HOST_ONE_RELAY)).rejects.toBeInstanceOf( - RelayRoutingHostRemovedError - ) - - expect(JSON.parse(storedHostsRaw)).toEqual([HOST_TWO]) - expect(storedOverlayRaw).toBeNull() - expect(secureStoreMock.setItemAsync).not.toHaveBeenCalled() - }) - - it('applies concurrent rename and remove without clobbering either', async () => { - let releaseReads: (() => void) | undefined - const readsReleased = new Promise((resolve) => { - releaseReads = resolve - }) - let pendingReads = 0 - asyncStorageMock.getItem.mockImplementation(async (key: string) => { - if (key !== HOSTS_STORAGE_KEY) { - return null - } - pendingReads += 1 - if (pendingReads <= 2) { - await readsReleased - } - return storedHostsRaw - }) - - const rename = updateHostNameAndEndpoint(HOST_ONE.id, { personalName: 'Renamed Host' }) - const remove = removeHost(HOST_TWO.id) - // Overlap writers behind one read gate to expose lost updates without serialization. - await vi.waitFor(() => { - expect(pendingReads).toBeGreaterThanOrEqual(1) - }) - releaseReads?.() - await Promise.all([rename, remove]) - - expect(JSON.parse(storedHostsRaw)).toEqual([ - { ...HOST_ONE, name: 'Renamed Host', personalName: 'Renamed Host' } - ]) - }) - - it('does not wipe the host list when storage is unreadable during mutation', async () => { - storedHostsRaw = '{' - await expect(updateHostNameAndEndpoint(HOST_ONE.id, { personalName: 'Nope' })).rejects.toThrow( - /unreadable/ - ) - expect(asyncStorageMock.setItem).not.toHaveBeenCalled() - expect(storedHostsRaw).toBe('{') - }) - - // Park the slow keychain pass while a durable write invalidates it. - function gateKeychainReads(): () => void { - let release: () => void = () => {} - const gate = new Promise((resolve) => { - release = resolve - }) - secureStoreMock.getItemAsync.mockImplementation(async (key: string) => { - await gate - return key.endsWith(HOST_ONE.id) || key.endsWith(HOST_TWO.id) ? `token-${key.at(-1)}` : null - }) - return release - } - - it('does not serve a pre-removal snapshot to a load issued after the removal (#8791)', async () => { - const releaseKeychain = gateKeychainReads() - const parkedLoad = loadHosts() - await vi.waitFor(() => { - expect(secureStoreMock.getItemAsync).toHaveBeenCalled() - }) - - await removeHost(HOST_ONE.id) - const afterRemoval = loadHosts() - releaseKeychain() - - await parkedLoad - await expect(afterRemoval.then((hosts) => hosts.map((host) => host.id))).resolves.toEqual([ - HOST_TWO.id - ]) - }) - - it('does not serve a pre-rename snapshot to a load issued after the rename (#8791)', async () => { - const releaseKeychain = gateKeychainReads() - const parkedLoad = loadHosts() - await vi.waitFor(() => { - expect(secureStoreMock.getItemAsync).toHaveBeenCalled() - }) - - await updateHostNameAndEndpoint(HOST_ONE.id, { personalName: 'Living Room Mac' }) - const afterRename = loadHosts() - releaseKeychain() - - await parkedLoad - const hosts = await afterRename - expect(hosts.find((host) => host.id === HOST_ONE.id)?.name).toBe('Living Room Mac') - }) - - it('does not let a late pre-write token read poison the token cache', async () => { - const newHost = { - id: 'host-new', - name: 'New Host', - endpoint: 'ws://127.0.0.1:3', - publicKeyB64: 'key-new', - deviceToken: 'token-new', - lastConnected: 0 - } - storedHostsRaw = JSON.stringify([{ ...newHost, deviceToken: undefined }]) - let resolvePrewriteTokenRead: (token: string) => void = () => {} - secureStoreMock.getItemAsync.mockReturnValue( - new Promise((resolve) => { - resolvePrewriteTokenRead = resolve - }) - ) - - const parkedLoad = loadHosts() - await vi.waitFor(() => { - expect(secureStoreMock.getItemAsync).toHaveBeenCalled() - }) - await savePairedHost(newHost) - resolvePrewriteTokenRead('token-old') - await parkedLoad - - const hosts = await loadHosts() - expect(hosts.find((host) => host.id === newHost.id)?.deviceToken).toBe(newHost.deviceToken) - }) }) describe('host-store pairing save after an Android encryption rejection', () => { diff --git a/mobile/src/transport/hosts/host-store.ts b/mobile/src/host-catalog/host-store.ts similarity index 91% rename from mobile/src/transport/hosts/host-store.ts rename to mobile/src/host-catalog/host-store.ts index 487b1344b13..f8e09c068dd 100644 --- a/mobile/src/transport/hosts/host-store.ts +++ b/mobile/src/host-catalog/host-store.ts @@ -1,4 +1,4 @@ -import type { MobileRelayEndpoint } from '../../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' +import type { MobileRelayEndpoint } from '../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' import { HostProfileSchema } from './host-profile' import type { HostCatalogEntry, HostProfile, StoredHostProfile } from './host-profile' @@ -6,27 +6,30 @@ import { getNextHostNameFromHosts } from './host-names' import { mergeHostNameIdentity, withPersonalName } from './host-name-identity' import * as hostListLoads from './host-list-load-sharing' import { joinHostCatalogCredentials } from './host-catalog-credential-join' -import { resetPairingKeychainForTests } from './pairing-keychain' -import { readHostDeviceToken, writeHostDeviceToken } from './host-device-token-store' +import { resetPairingKeychainForTests } from '../host-credentials/pairing-keychain' +import { + readHostDeviceToken, + writeHostDeviceToken +} from '../host-credentials/host-device-token-store' import { cancelPendingHostCredentialCleanup, recordHostCredentialCleanupIntent, retryPendingHostCredentialCleanups, scheduleHostCredentialCleanup -} from './host-credential-cleanup' +} from '../host-credentials/host-credential-cleanup' import { loadMobileRelayHostRoutingState, removeMobileRelayHostRouting, removeMobileRelayHostRoutings, saveMobileRelayHostRouting } from './mobile-relay-host-overlay-store' -import { scheduleOrphanedMobileRelayCleanup } from '../relay/mobile-relay-orphan-cleanup' +import { scheduleOrphanedMobileRelayCleanup } from '../transport/relay/mobile-relay-orphan-cleanup' import { getHostCredentialWriteRevision, markHostCredentialWrite, resetHostCredentialWriteRevisionsForTests -} from './host-credential-write-revision' -import { createUnpairedHostCredentialDeletion } from '../../pairing/unpaired-host-credential-deletion' +} from '../host-credentials/host-credential-write-revision' +import { createUnpairedHostCredentialDeletion } from '../pairing/unpaired-host-credential-deletion' import { loadStoredHostProfiles, readStoredHostProfilesForMutation, @@ -148,7 +151,7 @@ function removeOrphanOverlayIfUnpaired(hostId: string): Promise { }) } -import './host-descriptor-persistence' +import '../host-descriptors/host-descriptor-persistence' export class RelayRoutingHostRemovedError extends Error {} @@ -315,22 +318,6 @@ export async function updateHostNameAndEndpoint( }) } -export async function updateLastConnected(hostId: string): Promise { - try { - await mutateStoredHosts((hosts) => { - const index = hosts.findIndex((h) => h.id === hostId) - if (index === -1) { - return hosts - } - const next = hosts.slice() - next[index] = { ...next[index]!, lastConnected: Date.now() } - return next - }) - } catch { - // Swallow bookkeeping failures because void callers cannot catch them. - } -} - export function resetHostStoreForTests(): void { resetHostListMutationQueueForTests() tokenCache.clear() diff --git a/mobile/src/transport/hosts/host-store.web.ts b/mobile/src/host-catalog/host-store.web.ts similarity index 77% rename from mobile/src/transport/hosts/host-store.web.ts rename to mobile/src/host-catalog/host-store.web.ts index 3b8e3f33ac8..37475ac40ed 100644 --- a/mobile/src/transport/hosts/host-store.web.ts +++ b/mobile/src/host-catalog/host-store.web.ts @@ -1,5 +1,5 @@ -import { readPageHostProfile } from '../../mobile-web-shell/bridge/page-host-profile' -import type { MobileRelayEndpoint } from '../../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' +import { readPageHostProfile } from '../mobile-web-shell/bridge/page-host-profile' +import type { MobileRelayEndpoint } from '../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' import type { HostCatalogEntry, HostProfile } from './host-profile' // The page gets no device credential or public key; RPC uses the shell’s paired client. @@ -26,9 +26,6 @@ export const setRelayRouting = (_hostId: string, _relay: MobileRelayEndpoint): P export const removeHost = (_hostId: string): Promise => Promise.resolve() -// Recency belongs to the native host list, which this page does not show. -export const updateLastConnected = (_hostId: string): Promise => Promise.resolve() - export function updateHostNameAndEndpoint( _hostId: string, _updates: { personalName?: string | null; endpoint?: string } diff --git a/mobile/src/transport/hosts/mobile-relay-host-overlay-store.test.ts b/mobile/src/host-catalog/mobile-relay-host-overlay-store.test.ts similarity index 78% rename from mobile/src/transport/hosts/mobile-relay-host-overlay-store.test.ts rename to mobile/src/host-catalog/mobile-relay-host-overlay-store.test.ts index 6d4daea98d3..fd4e8f54f2f 100644 --- a/mobile/src/transport/hosts/mobile-relay-host-overlay-store.test.ts +++ b/mobile/src/host-catalog/mobile-relay-host-overlay-store.test.ts @@ -74,22 +74,4 @@ describe('mobile relay host overlay store', () => { await expect(saveMobileRelayHostRouting('host-1', RELAY)).resolves.toBe(true) expect(JSON.parse(stored!)).toEqual([RELAY_ONLY_OVERLAY]) }) - - it('never overlays or resurrects a host whose legacy base was removed', async () => { - stored = JSON.stringify([LEGACY_OVERLAY]) - - await expect(loadMobileRelayHostRoutingState(new Set())).resolves.toEqual({ - relays: new Map(), - orphanHostIds: ['host-1'] - }) - expect(asyncStorage.setItem).not.toHaveBeenCalled() - expect(JSON.parse(stored)).toEqual([LEGACY_OVERLAY]) - }) - - it('refuses to overwrite unreadable overlay storage', async () => { - stored = '{' - - await expect(saveMobileRelayHostRouting('host-1', RELAY)).rejects.toThrow(/unreadable/) - expect(asyncStorage.setItem).not.toHaveBeenCalled() - }) }) diff --git a/mobile/src/transport/hosts/mobile-relay-host-overlay-store.ts b/mobile/src/host-catalog/mobile-relay-host-overlay-store.ts similarity index 96% rename from mobile/src/transport/hosts/mobile-relay-host-overlay-store.ts rename to mobile/src/host-catalog/mobile-relay-host-overlay-store.ts index 8a30cd7219a..3f4da803bd2 100644 --- a/mobile/src/transport/hosts/mobile-relay-host-overlay-store.ts +++ b/mobile/src/host-catalog/mobile-relay-host-overlay-store.ts @@ -1,5 +1,5 @@ import AsyncStorage from '@react-native-async-storage/async-storage' -import type { MobileRelayEndpoint } from '../../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' +import type { MobileRelayEndpoint } from '../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' import { MobileRelayHostOverlaySchema, toStoredMobileRelayHostOverlay, diff --git a/mobile/src/transport/hosts/mobile-relay-host-overlay.ts b/mobile/src/host-catalog/mobile-relay-host-overlay.ts similarity index 92% rename from mobile/src/transport/hosts/mobile-relay-host-overlay.ts rename to mobile/src/host-catalog/mobile-relay-host-overlay.ts index 3e82389cde5..f97d6f7cb2c 100644 --- a/mobile/src/transport/hosts/mobile-relay-host-overlay.ts +++ b/mobile/src/host-catalog/mobile-relay-host-overlay.ts @@ -2,8 +2,8 @@ import { z } from 'zod' import { MobileRelayEndpointSchema, type MobileRelayEndpoint -} from '../../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' -import { relayConnectWebSocketUrl } from '../relay/mobile-relay-connect-url' +} from '../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' +import { relayConnectWebSocketUrl } from '../transport/relay/mobile-relay-connect-url' const MobileAccessEndpointSchema = z .object({ diff --git a/mobile/src/transport/hosts/page-host-removal-refusal.ts b/mobile/src/host-catalog/page-host-removal-refusal.ts similarity index 100% rename from mobile/src/transport/hosts/page-host-removal-refusal.ts rename to mobile/src/host-catalog/page-host-removal-refusal.ts diff --git a/mobile/src/transport/hosts/use-host-profile.ts b/mobile/src/host-catalog/use-host-profile.ts similarity index 100% rename from mobile/src/transport/hosts/use-host-profile.ts rename to mobile/src/host-catalog/use-host-profile.ts diff --git a/mobile/src/transport/hosts/host-credential-cleanup.ts b/mobile/src/host-credentials/host-credential-cleanup.ts similarity index 100% rename from mobile/src/transport/hosts/host-credential-cleanup.ts rename to mobile/src/host-credentials/host-credential-cleanup.ts diff --git a/mobile/src/transport/hosts/host-credential-write-revision.ts b/mobile/src/host-credentials/host-credential-write-revision.ts similarity index 100% rename from mobile/src/transport/hosts/host-credential-write-revision.ts rename to mobile/src/host-credentials/host-credential-write-revision.ts diff --git a/mobile/src/transport/hosts/host-device-token-store.ts b/mobile/src/host-credentials/host-device-token-store.ts similarity index 100% rename from mobile/src/transport/hosts/host-device-token-store.ts rename to mobile/src/host-credentials/host-device-token-store.ts diff --git a/mobile/src/transport/hosts/host-device-token-store.web.ts b/mobile/src/host-credentials/host-device-token-store.web.ts similarity index 100% rename from mobile/src/transport/hosts/host-device-token-store.web.ts rename to mobile/src/host-credentials/host-device-token-store.web.ts diff --git a/mobile/src/transport/hosts/mobile-relay-credential-bundle.test.ts b/mobile/src/host-credentials/mobile-relay-credential-bundle.test.ts similarity index 96% rename from mobile/src/transport/hosts/mobile-relay-credential-bundle.test.ts rename to mobile/src/host-credentials/mobile-relay-credential-bundle.test.ts index 48b66a8b2da..37e2f71cbd9 100644 --- a/mobile/src/transport/hosts/mobile-relay-credential-bundle.test.ts +++ b/mobile/src/host-credentials/mobile-relay-credential-bundle.test.ts @@ -19,7 +19,7 @@ vi.mock('expo-secure-store', () => ({ vi.mock('react-native', () => ({ Platform: platform })) import { promotePairingJournalCredential } from './mobile-relay-credential-bundle' -import type { MobileRelayPairingJournal } from '../../pairing/mobile-relay-pairing-journal' +import type { MobileRelayPairingJournal } from '../pairing/mobile-relay-pairing-journal' import { resetPairingKeychainForTests } from './pairing-keychain' const journal = { diff --git a/mobile/src/transport/hosts/mobile-relay-credential-bundle.ts b/mobile/src/host-credentials/mobile-relay-credential-bundle.ts similarity index 93% rename from mobile/src/transport/hosts/mobile-relay-credential-bundle.ts rename to mobile/src/host-credentials/mobile-relay-credential-bundle.ts index 21e103cfc40..f48b5b939d3 100644 --- a/mobile/src/transport/hosts/mobile-relay-credential-bundle.ts +++ b/mobile/src/host-credentials/mobile-relay-credential-bundle.ts @@ -1,7 +1,7 @@ import { Platform } from 'react-native' import { z } from 'zod' -import type { DeviceCredentialInstalled } from '../../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' -import type { MobileRelayPairingJournal } from '../../pairing/mobile-relay-pairing-journal' +import type { DeviceCredentialInstalled } from '../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' +import type { MobileRelayPairingJournal } from '../pairing/mobile-relay-pairing-journal' import { deletePairingKeychainItem, readPairingKeychainItem, diff --git a/mobile/src/transport/hosts/pairing-keychain.ts b/mobile/src/host-credentials/pairing-keychain.ts similarity index 100% rename from mobile/src/transport/hosts/pairing-keychain.ts rename to mobile/src/host-credentials/pairing-keychain.ts diff --git a/mobile/src/transport/hosts/host-app-version-store.ts b/mobile/src/host-descriptors/host-app-version-store.ts similarity index 100% rename from mobile/src/transport/hosts/host-app-version-store.ts rename to mobile/src/host-descriptors/host-app-version-store.ts diff --git a/mobile/src/transport/hosts/host-app-version-store.web.ts b/mobile/src/host-descriptors/host-app-version-store.web.ts similarity index 100% rename from mobile/src/transport/hosts/host-app-version-store.web.ts rename to mobile/src/host-descriptors/host-app-version-store.web.ts diff --git a/mobile/src/transport/hosts/host-app-version.ts b/mobile/src/host-descriptors/host-app-version.ts similarity index 100% rename from mobile/src/transport/hosts/host-app-version.ts rename to mobile/src/host-descriptors/host-app-version.ts diff --git a/mobile/src/transport/hosts/host-descriptor-persistence.ts b/mobile/src/host-descriptors/host-descriptor-persistence.ts similarity index 82% rename from mobile/src/transport/hosts/host-descriptor-persistence.ts rename to mobile/src/host-descriptors/host-descriptor-persistence.ts index 12fd0d18d24..dbd342527ed 100644 --- a/mobile/src/transport/hosts/host-descriptor-persistence.ts +++ b/mobile/src/host-descriptors/host-descriptor-persistence.ts @@ -1,5 +1,8 @@ -import { mutateStoredHosts } from './host-list-mutation-queue' -import { withReportedDescriptor, type ReportedHostDescriptor } from './host-name-identity' +import { mutateStoredHosts } from '../host-catalog/host-list-mutation-queue' +import { + withReportedDescriptor, + type ReportedHostDescriptor +} from '../host-catalog/host-name-identity' // Keep authenticated descriptor upkeep best-effort; older hosts omitting both fields must not churn stored rows. export async function updateHostDescriptor( diff --git a/mobile/src/transport/hosts/host-descriptor-persistence.web.ts b/mobile/src/host-descriptors/host-descriptor-persistence.web.ts similarity index 59% rename from mobile/src/transport/hosts/host-descriptor-persistence.web.ts rename to mobile/src/host-descriptors/host-descriptor-persistence.web.ts index 43933095a61..b99ea73eb3c 100644 --- a/mobile/src/transport/hosts/host-descriptor-persistence.web.ts +++ b/mobile/src/host-descriptors/host-descriptor-persistence.web.ts @@ -1,5 +1,5 @@ -import '../../mobile-web-shell/bridge/page-host-profile' -import type { ReportedHostDescriptor } from './host-name-identity' +import '../mobile-web-shell/bridge/page-host-profile' +import type { ReportedHostDescriptor } from '../host-catalog/host-name-identity' // Last-known descriptors belong to the native host list. export function updateHostDescriptor( diff --git a/mobile/src/transport/hosts/host-descriptor-recorder.ts b/mobile/src/host-descriptors/host-descriptor-recorder.ts similarity index 83% rename from mobile/src/transport/hosts/host-descriptor-recorder.ts rename to mobile/src/host-descriptors/host-descriptor-recorder.ts index 0b5ab0e5cdb..49aad137b63 100644 --- a/mobile/src/transport/hosts/host-descriptor-recorder.ts +++ b/mobile/src/host-descriptors/host-descriptor-recorder.ts @@ -1,7 +1,7 @@ import { recordHostDescriptor } from './host-descriptor-store' -import './host-store' +import '../host-catalog/host-store' import { updateHostDescriptor } from './host-descriptor-persistence' -import type { HostStatusReply } from './host-status-reply-schema' +import type { HostStatusReply } from '../transport/hosts/host-status-reply-schema' // Update live rows and persisted last-known descriptors together; best-effort bookkeeping must never gate connection. export function recordHostDescriptorFromStatus(hostId: string, status: HostStatusReply): void { diff --git a/mobile/src/transport/hosts/host-descriptor-store.ts b/mobile/src/host-descriptors/host-descriptor-store.ts similarity index 95% rename from mobile/src/transport/hosts/host-descriptor-store.ts rename to mobile/src/host-descriptors/host-descriptor-store.ts index bb114074164..ad33c055070 100644 --- a/mobile/src/transport/hosts/host-descriptor-store.ts +++ b/mobile/src/host-descriptors/host-descriptor-store.ts @@ -1,5 +1,5 @@ import { useCallback, useSyncExternalStore } from 'react' -import { sameHostMachine, type HostMachine } from '../../../../src/shared/host-machine-line' +import { sameHostMachine, type HostMachine } from '../../../src/shared/host-machine-line' export type HostMachineDescriptor = { machineName: string | null diff --git a/mobile/src/transport/hosts/use-host-display.ts b/mobile/src/host-descriptors/use-host-display.ts similarity index 85% rename from mobile/src/transport/hosts/use-host-display.ts rename to mobile/src/host-descriptors/use-host-display.ts index 0f0e8abefe6..49ab4f235df 100644 --- a/mobile/src/transport/hosts/use-host-display.ts +++ b/mobile/src/host-descriptors/use-host-display.ts @@ -1,10 +1,10 @@ import { resolveHostDisplay, type HostDisplayResolution -} from '../../../../src/shared/host-display-resolution' +} from '../../../src/shared/host-display-resolution' import { useHostDescriptor } from './host-descriptor-store' -import { classifyLegacyHostName } from './host-name-identity' -import type { HostMachine } from '../../../../src/shared/host-machine-line' +import { classifyLegacyHostName } from '../host-catalog/host-name-identity' +import type { HostMachine } from '../../../src/shared/host-machine-line' export type HostDisplaySource = { id: string diff --git a/mobile/src/host-list-action-sheet-actions.ts b/mobile/src/host-list-action-sheet-actions.ts index 036d025d798..ea156122a5a 100644 --- a/mobile/src/host-list-action-sheet-actions.ts +++ b/mobile/src/host-list-action-sheet-actions.ts @@ -1,7 +1,7 @@ import { Activity, Edit3, PowerOff, RefreshCw } from 'lucide-react-native' import type { ActionSheetAction } from './components/ActionSheetModal' import type { ConnectionState } from './transport/connection/connection-state' -import type { HostProfile } from './transport/hosts/host-profile' +import type { HostProfile } from './host-catalog/host-profile' import { translate } from './i18n/mobile-i18n' // Defer navigation and new drawers until this native Modal unmounts; presenting into a live one freezes iOS (#8791). diff --git a/mobile/src/host-screen/host-stored-identity.ts b/mobile/src/host-screen/host-stored-identity.ts index 31d75015e5d..dd02444eb75 100644 --- a/mobile/src/host-screen/host-stored-identity.ts +++ b/mobile/src/host-screen/host-stored-identity.ts @@ -1,4 +1,4 @@ -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' import type { HostMachine } from '../../../src/shared/host-machine-line' export type HostStoredDescriptor = { diff --git a/mobile/src/host-screen/use-host-display-worktrees.ts b/mobile/src/host-screen/use-host-display-worktrees.ts index 84f72fa8a86..517c0924fa2 100644 --- a/mobile/src/host-screen/use-host-display-worktrees.ts +++ b/mobile/src/host-screen/use-host-display-worktrees.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react' -import { useHostDescriptor } from '../transport/hosts/host-descriptor-store' +import { useHostDescriptor } from '../host-descriptors/host-descriptor-store' import type { ConnectionState } from '../transport/connection/connection-state' import { serverHostHealth, diff --git a/mobile/src/host-screen/use-host-screen-controller.ts b/mobile/src/host-screen/use-host-screen-controller.ts index 983fa99eb96..e5ea6277d43 100644 --- a/mobile/src/host-screen/use-host-screen-controller.ts +++ b/mobile/src/host-screen/use-host-screen-controller.ts @@ -28,7 +28,7 @@ import { useHostViewSettings } from './use-host-view-settings' import { countActiveWorkspaceFilters } from '../../../src/shared/workspace-view/workspace-row-filters' import { useHostWorktreeActions } from './use-host-worktree-actions' import { useHostWorktreeCatalog } from './use-host-worktree-catalog' -import { useHostDisplay } from '../transport/hosts/use-host-display' +import { useHostDisplay } from '../host-descriptors/use-host-display' import { classifyConnection } from '../transport/connection/connection-health' export type HostScreenProps = { diff --git a/mobile/src/host-screen/use-host-screen-identity.ts b/mobile/src/host-screen/use-host-screen-identity.ts index f4e10c10019..057a23b8718 100644 --- a/mobile/src/host-screen/use-host-screen-identity.ts +++ b/mobile/src/host-screen/use-host-screen-identity.ts @@ -3,8 +3,9 @@ import { useQueryClient } from '@tanstack/react-query' import { translate } from '../i18n/mobile-i18n' import { ORCA_SIDEBAR_INPUTS_IS_MAIN } from '../../../src/shared/sidebar-inputs-switch' import { loadPinnedIds } from '../storage/preferences' -import { loadHosts, peekHosts, updateLastConnected } from '../transport/hosts/host-store' -import type { HostProfile } from '../transport/hosts/host-profile' +import { loadHosts, peekHosts } from '../host-catalog/host-store' +import { updateLastConnected } from '../host-catalog/host-connection-history' +import type { HostProfile } from '../host-catalog/host-profile' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import type { HostScreenState } from './use-host-screen-state' import { storedHostDescriptor } from './host-stored-identity' diff --git a/mobile/src/host-screen/use-host-screen-state.ts b/mobile/src/host-screen/use-host-screen-state.ts index 742a6ac91c5..4f40a1a95bb 100644 --- a/mobile/src/host-screen/use-host-screen-state.ts +++ b/mobile/src/host-screen/use-host-screen-state.ts @@ -4,7 +4,7 @@ import type { ExecutionHostId } from '../../../src/shared/execution-host' import type { ExecutionHostHealth } from '../../../src/shared/execution-host/execution-host-health' import { storedHostDescriptor, type HostStoredDescriptor } from './host-stored-identity' import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' import { INITIAL_MOBILE_VIEW, type MobileViewState } from '../worktree/workspace-view-settings' import type { Worktree } from '../worktree/workspace-list-sections' import type { ServedProjectSections } from '../worktree/project-sections-operations' diff --git a/mobile/src/host-screen/use-host-worktree-actions.ts b/mobile/src/host-screen/use-host-worktree-actions.ts index 5d2814b1049..d96d2e8c9ab 100644 --- a/mobile/src/host-screen/use-host-worktree-actions.ts +++ b/mobile/src/host-screen/use-host-worktree-actions.ts @@ -6,8 +6,8 @@ import { floatingWorkspaceSessionPath } from '../session/floating-workspace' import { holdSessionLeave } from '../session/session-leave-guard' import { savePinnedIds } from '../storage/preferences' import type { useForgetHostClient } from '../transport/connection/host-client-hooks' -import { removeHostAndCloseClient } from '../transport/hosts/host-removal-lifecycle' -import { isPageHostRemovalUnavailable } from '../transport/hosts/page-host-removal-refusal' +import { removeHostAndCloseClient } from '../host-catalog/host-removal-lifecycle' +import { isPageHostRemovalUnavailable } from '../host-catalog/page-host-removal-refusal' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import { rpcClientForExecutionHost, diff --git a/mobile/src/i18n/bundled-locale-catalogs.ts b/mobile/src/i18n/bundled-locale-catalogs.ts new file mode 100644 index 00000000000..5883e969ed4 --- /dev/null +++ b/mobile/src/i18n/bundled-locale-catalogs.ts @@ -0,0 +1,23 @@ +import type { SupportedUiLocale } from '../../../src/shared/ui-locale' + +export type LocaleCatalog = Readonly> + +// Literal specifiers: Metro evaluates only the chosen module, and the page build splits each into its own chunk. +const CATALOG_IMPORTS: Record, () => Promise> = { + de: () => import('./locales/de.json').then((module) => module.default), + es: () => import('./locales/es.json').then((module) => module.default), + fr: () => import('./locales/fr.json').then((module) => module.default), + ja: () => import('./locales/ja.json').then((module) => module.default), + ko: () => import('./locales/ko.json').then((module) => module.default), + pt: () => import('./locales/pt.json').then((module) => module.default), + ru: () => import('./locales/ru.json').then((module) => module.default), + tr: () => import('./locales/tr.json').then((module) => module.default), + zh: () => import('./locales/zh.json').then((module) => module.default), + 'zh-Hant': () => import('./locales/zh-Hant.json').then((module) => module.default) +} + +export function importBundledLocaleCatalog( + locale: Exclude +): Promise { + return CATALOG_IMPORTS[locale]() +} diff --git a/mobile/src/i18n/en-runtime-required.json b/mobile/src/i18n/en-runtime-required.json index acba365e2f1..ff6c952994d 100644 --- a/mobile/src/i18n/en-runtime-required.json +++ b/mobile/src/i18n/en-runtime-required.json @@ -315,7 +315,11 @@ "forkOriginalMissingNamed": "{{agent}} could not find this response in \"{{detail}}\". Open that chat and fork from there.", "forkOriginalUnavailable": "{{agent}} cannot fork this response in the original chat. Open it and fork from there.", "forkOriginalUnavailableNamed": "{{agent}} cannot fork this response in \"{{detail}}\". Open that chat and fork from there.", - "pluginInputRequired": "{{agent}} stopped because the \"{{plugin}}\" plugin is waiting for input in a terminal pane. Disable the plugin for chat sessions, or run the task in a {{agent}} terminal." + "pluginInputRequired": "{{agent}} stopped because the \"{{plugin}}\" plugin is waiting for input in a terminal pane. Disable the plugin for chat sessions, or run the task in a {{agent}} terminal.", + "providerResponseFailed": "{{agent}} couldn't finish this response. Open Details for more information.", + "providerSafetyStopped": "{{agent}} stopped this response after a safety check. Review your request and send again.", + "providerUnavailable": "{{agent}} couldn't respond because the service is busy. Pick another model, or wait a little and send again.", + "selectedModel": "the selected model" }, "fileReader": { "reviewNotes_one": "{{count}} review note", diff --git a/mobile/src/i18n/locale-catalog-imports.ts b/mobile/src/i18n/locale-catalog-imports.ts index 664d608019e..d89bb938fea 100644 --- a/mobile/src/i18n/locale-catalog-imports.ts +++ b/mobile/src/i18n/locale-catalog-imports.ts @@ -1,23 +1,9 @@ import type { SupportedUiLocale } from '../../../src/shared/ui-locale' +import type { LocaleCatalog } from './bundled-locale-catalogs' -export type LocaleCatalog = Readonly> +export { importBundledLocaleCatalog as importLocaleCatalog } from './bundled-locale-catalogs' -// Literal specifiers: Metro evaluates only the chosen module, and the page build splits each into its own chunk. -const CATALOG_IMPORTS: Record, () => Promise> = { - de: () => import('./locales/de.json').then((module) => module.default), - es: () => import('./locales/es.json').then((module) => module.default), - fr: () => import('./locales/fr.json').then((module) => module.default), - ja: () => import('./locales/ja.json').then((module) => module.default), - ko: () => import('./locales/ko.json').then((module) => module.default), - pt: () => import('./locales/pt.json').then((module) => module.default), - ru: () => import('./locales/ru.json').then((module) => module.default), - tr: () => import('./locales/tr.json').then((module) => module.default), - zh: () => import('./locales/zh.json').then((module) => module.default), - 'zh-Hant': () => import('./locales/zh-Hant.json').then((module) => module.default) -} - -export function importLocaleCatalog( - locale: Exclude -): Promise { - return CATALOG_IMPORTS[locale]() -} +// Bundled catalogs never change after their import, so none arrives later; the page build's .web.ts does. +export const onLocaleCatalogArrival: ( + listener: (locale: Exclude, catalog: LocaleCatalog) => void +) => () => void = () => () => undefined diff --git a/mobile/src/i18n/locale-catalog-imports.web.ts b/mobile/src/i18n/locale-catalog-imports.web.ts new file mode 100644 index 00000000000..9b3d85fdce2 --- /dev/null +++ b/mobile/src/i18n/locale-catalog-imports.web.ts @@ -0,0 +1,36 @@ +import type { SupportedUiLocale } from '../../../src/shared/ui-locale' +import { importBundledLocaleCatalog, type LocaleCatalog } from './bundled-locale-catalogs' + +// A shell that skips the catalog chunks has page-locale-catalog-source.ts read them from the desktop +// and the device store; other shells import the chunk as before. No transport here, so pages that +// only translate pull in none. +export type { LocaleCatalog } +type CatalogLocale = Exclude +type CatalogLoader = (locale: CatalogLocale) => Promise +type ArrivalListener = (locale: CatalogLocale, catalog: LocaleCatalog) => void + +let loader: CatalogLoader | null = null +const arrivalListeners = new Set() + +export function publishPageLocaleCatalogLoader(next: CatalogLoader): void { + loader = next +} + +// Resolve the catalog or reject so activation falls back to English. +export function importLocaleCatalog(locale: CatalogLocale): Promise { + return loader === null ? importBundledLocaleCatalog(locale) : loader(locale) +} + +// A catalog that arrives after activation settled: a newer copy, or the first one after an offline start. +export function onLocaleCatalogArrival(listener: ArrivalListener): () => void { + arrivalListeners.add(listener) + return () => { + arrivalListeners.delete(listener) + } +} + +export function announceLocaleCatalog(locale: CatalogLocale, catalog: LocaleCatalog): void { + for (const listener of arrivalListeners) { + listener(locale, catalog) + } +} diff --git a/mobile/src/i18n/locales/de.json b/mobile/src/i18n/locales/de.json index 48043e5b8b3..c8c64c2cf93 100644 --- a/mobile/src/i18n/locales/de.json +++ b/mobile/src/i18n/locales/de.json @@ -1339,7 +1339,18 @@ }, "announce": { "typedInto": "Eingetippt in {{target}}", - "insertedIn": "Eingefügt in {{target}}" + "insertedIn": "Eingefügt in {{target}}", + "listeningOnPhone": "Hört zu. Transkription auf diesem Telefon.", + "listeningOn": "Hört zu. Transkription auf {{computer}}.", + "listeningOnComputer": "Hört zu. Transkription auf dem Computer.", + "finishing": "Wird abgeschlossen.", + "inserted": "Eingefügt.", + "cancelled": "Diktat abgebrochen.", + "movedTo": "Dieses Telefon hat die Transkription beendet. Weiter auf {{computer}}.", + "movedToComputer": "Dieses Telefon hat die Transkription beendet. Weiter auf dem Computer.", + "stoppedKept": "Diktat gestoppt. {{reason}}. Deine Aufnahme bleibt erhalten.", + "stoppedKeptGeneric": "Diktat gestoppt. Deine Aufnahme bleibt erhalten.", + "stillListening": "Hört weiter zu." }, "pill": { "open": "Öffnen", @@ -2153,6 +2164,10 @@ "providerExitedRejection": "{{agent}} wurde gestoppt, bevor diese Nachricht gesendet wurde.", "providerExitedRow": "{{agent}} wurde während dieser Antwort gestoppt. Die Unterhaltung kann fortgesetzt werden.", "providerRateLimited": "{{agent}} hat das Ratenlimit erreicht und versucht es erneut.", + "providerUnavailable": "{{agent}} konnte nicht antworten, weil der Dienst ausgelastet ist. Wähle ein anderes Modell oder warte kurz und sende erneut.", + "providerSafetyStopped": "{{agent}} hat diese Antwort nach einer Sicherheitsprüfung gestoppt. Überprüfe deine Anfrage und sende sie erneut.", + "providerResponseFailed": "{{agent}} konnte diese Antwort nicht abschließen. Öffnen Sie die Details für weitere Informationen.", + "selectedModel": "das ausgewählte Modell", "providerRejected": "{{agent}} hat diese Nachricht nicht angenommen.", "providerRejectedQuoted": "{{agent}} hat diese Nachricht nicht angenommen: {{detail}}.", "providerRetryLastError": "Letzter Fehler: {{detail}}.", @@ -2439,8 +2454,7 @@ "tabStrip": { "checkingCapabilities": "Desktop-Funktionen werden geprüft – gleich erneut versuchen", "newTab": "Neuen Tab erstellen", - "quickCommandsUpdateRequired": "Desktop-Update für Schnellbefehle erforderlich", - "tabStatus": "{{title}}, {{status}}" + "quickCommandsUpdateRequired": "Desktop-Update für Schnellbefehle erforderlich" }, "terminalActionSheetActions": { "clearTerminal": "Terminal leeren", @@ -2553,8 +2567,8 @@ "insertFailed": "Diktat konnte nicht eingefügt werden", "insertFailedCopied": "Diktat konnte nicht eingefügt werden und wurde daher in die Zwischenablage kopiert", "inserted": "Diktat eingefügt", - "stoppedAfterSilence": "Nach einer Minute Stille beendet", - "stoppedAtCloudLimit": "Diktat am 10-Minuten-Limit der Cloud gestoppt." + "stoppedAtCloudLimit": "Diktat am 10-Minuten-Limit der Cloud gestoppt.", + "stoppedAfterSilenceSeconds": "Nach {{seconds}} Sekunden Stille gestoppt" }, "useNativeChatStop": { "stopNotSent": "Stoppbefehl nicht gesendet", @@ -3349,6 +3363,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "Zusammengeführt", + "closed": "Geschlossen", + "conflicts": "Konflikte", + "behind": "Nicht aktuell", + "blocked": "Blockiert", + "checksPending": "Prüfungen ausstehend", + "ableToMerge": "Zusammenführen möglich", + "unknown": "Unbekannt" + }, + "pagination": { + "pageUnreachable": "Seite {{page}} liegt außerhalb des Bereichs der GitHub-Suche.", + "loadPageFailed": "Seite {{page}} konnte nicht von GitHub geladen werden.", + "noMoreResults": "Keine weiteren Ergebnisse auf Seite {{page}}." + }, "composerSource": { "baseFailed": "Der Basis-Branch konnte nicht ermittelt werden.", "forkPushWarning": "Bei diesem PR ist „Allow edits from maintainers“ deaktiviert; GitHub könnte einen Push zum Fork ablehnen." diff --git a/mobile/src/i18n/locales/en.json b/mobile/src/i18n/locales/en.json index 46765ee3df1..f14faed6778 100644 --- a/mobile/src/i18n/locales/en.json +++ b/mobile/src/i18n/locales/en.json @@ -554,7 +554,18 @@ }, "announce": { "typedInto": "Typed into {{target}}", - "insertedIn": "Inserted in {{target}}" + "insertedIn": "Inserted in {{target}}", + "listeningOnPhone": "Listening. Transcribing on this phone.", + "listeningOn": "Listening. Transcribing on {{computer}}.", + "listeningOnComputer": "Listening. Transcribing on the computer.", + "finishing": "Finishing.", + "inserted": "Inserted.", + "cancelled": "Dictation cancelled.", + "movedTo": "This phone stopped transcribing. Continuing on {{computer}}.", + "movedToComputer": "This phone stopped transcribing. Continuing on the computer.", + "stoppedKept": "Dictation stopped. {{reason}}. Your recording is kept.", + "stoppedKeptGeneric": "Dictation stopped. Your recording is kept.", + "stillListening": "Still listening." }, "pill": { "open": "Open", @@ -650,8 +661,8 @@ "openAccountsHint": "Opens this desktop’s accounts", "emptyTitle": "No usage yet" }, - "needsYou": { - "heading": "Needs you", + "activeAgents": { + "heading": "Active", "seeAll": "See all agents" } }, @@ -1479,6 +1490,15 @@ }, "offlineAsOfTime": { "yesterday": "yesterday, {{time}}" + }, + "newWorkspaceCreateSubmit": { + "uncertainFolderCreate": "This worktree may have been created. Check the folder before creating another.", + "uncertainCreate": "This workspace may have been created. Check your workspaces before creating another.", + "folderCreateBusy": "A worktree in this repository is still being created or checked. It shows in the folder once it lands." + }, + "smartRailRow": { + "title": "Smart rail", + "subtitle": "Shows keys for what your agent is doing" } }, "pullRequest": { @@ -2162,10 +2182,10 @@ "renameTerminal": "Rename Terminal", "renameTerminalFailed": "Couldn't rename the terminal. {{reason}}", "terminalName": "Terminal name", - "allowAutoClose": "Allow Auto-Close" + "allowAutoClose": "Allow Auto-Close", + "agents": "Agents" }, "tabStrip": { - "tabStatus": "{{title}}, {{status}}", "newTab": "New tab", "quickCommandsUpdateRequired": "Desktop update required for quick commands", "checkingCapabilities": "Checking desktop capabilities — try again in a moment" @@ -2386,8 +2406,8 @@ "insertFailedCopied": "Couldn't insert dictation, so it was copied to the clipboard", "insertFailed": "Couldn't insert dictation", "inserted": "Dictation inserted", - "stoppedAfterSilence": "Stopped after a minute of silence", - "stoppedAtCloudLimit": "Dictation stopped at the 10-minute cloud limit." + "stoppedAtCloudLimit": "Dictation stopped at the 10-minute cloud limit.", + "stoppedAfterSilenceSeconds": "Stopped after {{seconds}} seconds of silence" }, "quickCommandLaunch": { "editBeforeRunning": "Edit this quick command before running it", @@ -2638,6 +2658,10 @@ "modelUnavailable": "{{agent}} couldn't use {{detail}}. Pick another model and send again.", "modelUnavailableUpdate": "{{agent}} couldn't use {{detail}}. Update {{agent}} to {{minimumVersion}} or later to keep it after a restart, or pick another model and send again.", "modelNotSelected": "{{agent}} has no model selected. Check your model selection and {{agent}} sign-in, then send again.", + "providerUnavailable": "{{agent}} couldn't respond because the service is busy. Pick another model, or wait a little and send again.", + "providerSafetyStopped": "{{agent}} stopped this response after a safety check. Review your request and send again.", + "providerResponseFailed": "{{agent}} couldn't finish this response. Open Details for more information.", + "selectedModel": "the selected model", "providerRejected": "{{agent}} didn't accept this message.", "providerRejectedQuoted": "{{agent}} didn't accept this message: {{detail}}.", "attachmentEmpty": "An image on this message is empty, so the message was not sent.", @@ -2863,8 +2887,6 @@ }, "presentation": { "loadingTabs": "Loading tabs", - "oneTab": "1 tab", - "tabCount": "{{tabCount}} tabs", "tapToRetry": "{{status}} — tap to retry" }, "documentReaders": { @@ -2883,6 +2905,48 @@ }, "usePrTextAction": { "updateFailed": "Failed to update pull request." + }, + "smartKeys": { + "always": "Always", + "answer": "Answer", + "background": "Background", + "cancel": "Cancel", + "confirm": "Confirm", + "edit": "Edit", + "history": "History", + "keyLabel": "{{word}}, sends {{combo}}", + "mode": "Mode", + "no": "No", + "queue": "Queue", + "reject": "Reject", + "rewind": "Rewind", + "sendNow": "Send now", + "skip": "Skip", + "stop": "Stop", + "yes": "Yes" + }, + "tabsSheet": { + "needsYou": "Needs you", + "working": "Working", + "everythingElse": "Everything else", + "open": "Open", + "closeTab": "Close {{title}}" + }, + "tabRows": { + "browser": "Browser", + "markdown": "Markdown note", + "file": "File", + "chat": "Chat", + "terminal": "Terminal" + }, + "tabBar": { + "oneTab": "1 tab", + "tabCount": "{{count}} tabs", + "anotherNeedsYou": "another tab needs you", + "actionsHint": "Shows actions for this tab", + "next": "Next tab", + "previous": "Previous tab", + "hint": "Shows all tabs" } }, "chat": { @@ -2924,7 +2988,12 @@ "skip": "Skip", "step": "Step {{step}}", "other": "Other…", - "answerPlaceholder": "Type your answer" + "answerPlaceholder": "Type your answer", + "optionPreview": "{{option}} preview", + "previewPosition": "{{current}} of {{total}}", + "chosen": "Chosen", + "chooseThis": "Choose this", + "viewPreview": "View" }, "permission": { "reason": "Reason: ", @@ -3635,7 +3704,17 @@ "emptyTitle": "No attached worktrees yet", "emptyCopy": "Worktrees created from this workspace will show up here.", "statusUnavailable": "Unavailable", - "backToFolder": "Back to folder" + "backToFolder": "Back to folder", + "createSection": "Create a worktree", + "createIn": "Create a worktree in {{repo}}", + "created": "Created worktree {{name}} in {{repo}}", + "createdNamed": "Created worktree {{name}}", + "createFailed": "Could not create a worktree in {{repo}}.", + "loadReposRetry": "Load repositories", + "setupChoiceTitle": "Retry without setup?", + "setupChoiceMessage": "Orca couldn't confirm the last create in {{repo}}. Retrying it needs a setup choice; it will be created without running the repository's setup.", + "setupChoiceSkip": "Retry without setup", + "checking": "A worktree from {{repo}} may already have been created. Checking the folder…" }, "hostedReviewCopy": { "updatingBranch": "Updating branch...", diff --git a/mobile/src/i18n/locales/es.json b/mobile/src/i18n/locales/es.json index 158cd39f958..78f372f2264 100644 --- a/mobile/src/i18n/locales/es.json +++ b/mobile/src/i18n/locales/es.json @@ -1380,7 +1380,18 @@ }, "announce": { "typedInto": "Escrito en {{target}}", - "insertedIn": "Insertado en {{target}}" + "insertedIn": "Insertado en {{target}}", + "listeningOnPhone": "Escuchando. Transcribiendo en este teléfono.", + "listeningOn": "Escuchando. Transcribiendo en {{computer}}.", + "listeningOnComputer": "Escuchando. Transcribiendo en el ordenador.", + "finishing": "Terminando.", + "inserted": "Insertado.", + "cancelled": "Dictado cancelado.", + "movedTo": "Este teléfono dejó de transcribir. Continúa en {{computer}}.", + "movedToComputer": "Este teléfono dejó de transcribir. Continúa en el ordenador.", + "stoppedKept": "Dictado detenido. {{reason}}. Tu grabación se conserva.", + "stoppedKeptGeneric": "Dictado detenido. Tu grabación se conserva.", + "stillListening": "Sigue escuchando." }, "pill": { "open": "Abrir", @@ -1491,11 +1502,11 @@ "updateRequired": "Actualiza Orca Mobile para abrir archivos PDF" }, "unsavedEditsOffer": { - "changedSince": "Modificado en el escritorio desde tus cambios de las {{time}}", + "changedSince": "Modificado en el ordenador después de tus cambios de {{time}}", "copyMyEdits": "Copiar mis cambios", "discard": "Descartar", "restore": "Restaurar", - "unsavedFrom": "Cambios sin guardar de las {{time}}" + "unsavedFrom": "Cambios sin guardar ({{time}})" } }, "home": { @@ -2221,6 +2232,10 @@ "providerExitedRejection": "{{agent}} se detuvo antes de que se enviara este mensaje.", "providerExitedRow": "{{agent}} se detuvo mientras esta respuesta estaba en curso. Puede continuar en esta conversación.", "providerRateLimited": "{{agent}} alcanzó un límite de solicitudes y está reintentando.", + "providerUnavailable": "{{agent}} no pudo responder porque el servicio está ocupado. Elige otro modelo o espera un poco y vuelve a enviar el mensaje.", + "providerSafetyStopped": "{{agent}} detuvo esta respuesta tras una comprobación de seguridad. Revisa tu solicitud y vuelve a enviarla.", + "providerResponseFailed": "{{agent}} no pudo terminar esta respuesta. Abre los detalles para obtener más información.", + "selectedModel": "el modelo seleccionado", "providerRejected": "{{agent}} no aceptó este mensaje.", "providerRejectedQuoted": "{{agent}} no aceptó este mensaje: {{detail}}.", "providerRetryLastError": "Último error: {{detail}}.", @@ -2509,8 +2524,7 @@ "tabStrip": { "checkingCapabilities": "Comprobando las funciones del escritorio. Inténtalo de nuevo en un momento.", "newTab": "Nueva pestaña", - "quickCommandsUpdateRequired": "Actualiza el escritorio para usar los comandos rápidos.", - "tabStatus": "{{title}}, {{status}}" + "quickCommandsUpdateRequired": "Actualiza el escritorio para usar los comandos rápidos." }, "terminalActionSheetActions": { "clearTerminal": "Limpiar terminal", @@ -2623,8 +2637,8 @@ "insertFailed": "No se pudo insertar el dictado", "insertFailedCopied": "No se pudo insertar el dictado, así que se copió al portapapeles.", "inserted": "Dictado insertado", - "stoppedAfterSilence": "Se detuvo tras un minuto de silencio", - "stoppedAtCloudLimit": "Dictado detenido al llegar al límite de 10 minutos en la nube." + "stoppedAtCloudLimit": "Dictado detenido al llegar al límite de 10 minutos en la nube.", + "stoppedAfterSilenceSeconds": "Detenido tras {{seconds}} segundos de silencio" }, "useNativeChatStop": { "stopNotSent": "No se envió la orden de detener", @@ -3437,6 +3451,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "Fusionado", + "closed": "Cerrado", + "conflicts": "Conflictos", + "behind": "Desactualizado", + "blocked": "Bloqueado", + "checksPending": "Comprobaciones pendientes", + "ableToMerge": "Se puede fusionar", + "unknown": "Desconocido" + }, + "pagination": { + "pageUnreachable": "La página {{page}} está fuera del alcance de la búsqueda de GitHub.", + "loadPageFailed": "No se pudo cargar la página {{page}} desde GitHub.", + "noMoreResults": "No hay más resultados en la página {{page}}." + }, "composerSource": { "baseFailed": "No se pudo resolver la rama base.", "forkPushWarning": "Esta PR tiene desactivada la opción \"Allow edits from maintainers\"; GitHub podría rechazar el push al fork." diff --git a/mobile/src/i18n/locales/fr.json b/mobile/src/i18n/locales/fr.json index c7f2225a033..20d2d3b5828 100644 --- a/mobile/src/i18n/locales/fr.json +++ b/mobile/src/i18n/locales/fr.json @@ -1380,7 +1380,18 @@ }, "announce": { "typedInto": "Saisi dans {{target}}", - "insertedIn": "Inséré dans {{target}}" + "insertedIn": "Inséré dans {{target}}", + "listeningOnPhone": "Écoute. Transcription sur ce téléphone.", + "listeningOn": "Écoute. Transcription sur {{computer}}.", + "listeningOnComputer": "Écoute. Transcription sur l’ordinateur.", + "finishing": "Finalisation.", + "inserted": "Inséré.", + "cancelled": "Dictée annulée.", + "movedTo": "Ce téléphone a arrêté de transcrire. Suite sur {{computer}}.", + "movedToComputer": "Ce téléphone a arrêté de transcrire. Suite sur l’ordinateur.", + "stoppedKept": "Dictée arrêtée. {{reason}}. Votre enregistrement est conservé.", + "stoppedKeptGeneric": "Dictée arrêtée. Votre enregistrement est conservé.", + "stillListening": "Toujours à l’écoute." }, "pill": { "open": "Ouvrir", @@ -2222,6 +2233,10 @@ "providerExitedRejection": "{{agent}} s'est arrêté avant l'envoi de ce message.", "providerExitedRow": "{{agent}} s'est arrêté pendant que cette réponse était en cours. Vous pouvez continuer dans cette conversation.", "providerRateLimited": "{{agent}} est limité en débit et réessaie.", + "providerUnavailable": "{{agent}} n’a pas pu répondre car le service est occupé. Choisissez un autre modèle ou patientez un peu, puis renvoyez le message.", + "providerSafetyStopped": "{{agent}} a arrêté cette réponse après un contrôle de sécurité. Vérifiez votre demande et renvoyez-la.", + "providerResponseFailed": "{{agent}} n’a pas pu terminer cette réponse. Ouvrez les détails pour en savoir plus.", + "selectedModel": "le modèle sélectionné", "providerRejected": "{{agent}} n'a pas accepté ce message.", "providerRejectedQuoted": "{{agent}} n'a pas accepté ce message : {{detail}}.", "providerRetryLastError": "Dernière erreur : {{detail}}.", @@ -2509,8 +2524,7 @@ "tabStrip": { "checkingCapabilities": "Vérification des fonctionnalités de l'ordinateur — réessayez dans un instant", "newTab": "Nouvel onglet", - "quickCommandsUpdateRequired": "Mettez à jour Orca sur l'ordinateur pour utiliser les commandes rapides", - "tabStatus": "{{title}}, {{status}}" + "quickCommandsUpdateRequired": "Mettez à jour Orca sur l'ordinateur pour utiliser les commandes rapides" }, "terminalActionSheetActions": { "clearTerminal": "Effacer le terminal", @@ -2623,8 +2637,8 @@ "insertFailed": "Impossible d'insérer la dictée", "insertFailedCopied": "Impossible d'insérer la dictée ; elle a été copiée dans le presse-papiers", "inserted": "Dictée insérée", - "stoppedAfterSilence": "Arrêt après une minute de silence", - "stoppedAtCloudLimit": "Dictée arrêtée à la limite cloud de 10 minutes." + "stoppedAtCloudLimit": "Dictée arrêtée à la limite cloud de 10 minutes.", + "stoppedAfterSilenceSeconds": "Arrêté après {{seconds}} secondes de silence" }, "useNativeChatStop": { "stopNotSent": "Commande d'arrêt non envoyée", @@ -3437,6 +3451,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "Fusionné", + "closed": "Fermé", + "conflicts": "Conflits", + "behind": "En retard", + "blocked": "Bloqué", + "checksPending": "Vérifications en attente", + "ableToMerge": "Fusion possible", + "unknown": "Inconnu" + }, + "pagination": { + "pageUnreachable": "La page {{page}} dépasse la limite des résultats de recherche GitHub.", + "loadPageFailed": "La page {{page}} n’a pas pu être chargée depuis GitHub.", + "noMoreResults": "Aucun autre résultat sur la page {{page}}." + }, "composerSource": { "baseFailed": "Échec de la résolution de la branche de base.", "forkPushWarning": "L'option « Autoriser les modifications des mainteneurs » est désactivée pour cette PR ; le push vers le fork peut être refusé par GitHub." diff --git a/mobile/src/i18n/locales/ja.json b/mobile/src/i18n/locales/ja.json index ed93625b9f0..c6ee2e0fa4f 100644 --- a/mobile/src/i18n/locales/ja.json +++ b/mobile/src/i18n/locales/ja.json @@ -1335,7 +1335,18 @@ }, "announce": { "typedInto": "{{target}} に入力しました", - "insertedIn": "{{target}} に挿入しました" + "insertedIn": "{{target}} に挿入しました", + "listeningOnPhone": "聞き取り中。このスマートフォンで文字起こししています。", + "listeningOn": "聞き取り中。{{computer}} で文字起こししています。", + "listeningOnComputer": "聞き取り中。コンピュータで文字起こししています。", + "finishing": "仕上げ中。", + "inserted": "挿入しました。", + "cancelled": "音声入力をキャンセルしました。", + "movedTo": "このスマートフォンでの文字起こしが止まりました。{{computer}} で続けます。", + "movedToComputer": "このスマートフォンでの文字起こしが止まりました。コンピュータで続けます。", + "stoppedKept": "音声入力が停止しました。{{reason}}。録音は保持されています。", + "stoppedKeptGeneric": "音声入力が停止しました。録音は保持されています。", + "stillListening": "聞き取りを続けています。" }, "pill": { "open": "開く", @@ -2149,6 +2160,10 @@ "providerExitedRejection": "このメッセージが送信される前に {{agent}} が停止しました。", "providerExitedRow": "この応答の途中で {{agent}} が停止しました。この会話で続けることができます。", "providerRateLimited": "{{agent}} はレート制限を受けているため、再試行しています。", + "providerUnavailable": "サービスが混雑しているため、{{agent}} は応答できませんでした。別のモデルを選ぶか、しばらく待ってから再送してください。", + "providerSafetyStopped": "{{agent}} は安全確認の後、この応答を停止しました。リクエストを見直して再送してください。", + "providerResponseFailed": "{{agent}} はこの応答を完了できませんでした。詳細を開いて確認してください。", + "selectedModel": "選択されたモデル", "providerRejected": "{{agent}} はこのメッセージを受け付けませんでした。", "providerRejectedQuoted": "{{agent}} はこのメッセージを受け付けませんでした: {{detail}}。", "providerRetryLastError": "直近のエラー: {{detail}}。", @@ -2435,8 +2450,7 @@ "tabStrip": { "checkingCapabilities": "デスクトップの対応機能を確認中です。少し待ってから再試行してください。", "newTab": "新規タブ", - "quickCommandsUpdateRequired": "クイックコマンドの利用にはデスクトップの更新が必要です。", - "tabStatus": "{{title}}、{{status}}" + "quickCommandsUpdateRequired": "クイックコマンドの利用にはデスクトップの更新が必要です。" }, "terminalActionSheetActions": { "clearTerminal": "ターミナルをクリア", @@ -2549,8 +2563,8 @@ "insertFailed": "ディクテーションの結果を挿入できませんでした。", "insertFailedCopied": "ディクテーションの結果を挿入できず、クリップボードにコピーしました。", "inserted": "ディクテーションの結果を挿入しました。", - "stoppedAfterSilence": "1分間音声がなかったため停止しました。", - "stoppedAtCloudLimit": "クラウドの10分の上限に達したため、ディクテーションが停止しました。" + "stoppedAtCloudLimit": "クラウドの10分の上限に達したため、ディクテーションが停止しました。", + "stoppedAfterSilenceSeconds": "{{seconds}} 秒間無音だったため停止しました" }, "useNativeChatStop": { "stopNotSent": "停止要求を送信できませんでした。", @@ -3425,6 +3439,16 @@ "githubViewControls": { "openView": "GitHub でビューを開く" }, + "hostedMerge": { + "merged": "マージ済み", + "closed": "クローズ済み", + "conflicts": "競合あり", + "behind": "遅れあり", + "blocked": "ブロック中", + "checksPending": "チェック待ち", + "ableToMerge": "マージ可能", + "unknown": "不明" + }, "itemActions": { "changeStatus": "ステータスを変更", "copyGitHubLink": "GitHub リンクをコピーする", @@ -3571,6 +3595,11 @@ "updated": "更新日時", "updatedSortDescription": "アクティビティが新しい順" }, + "pagination": { + "pageUnreachable": "ページ {{page}} は GitHub 検索で取得できる範囲を超えています。", + "loadPageFailed": "ページ {{page}} を GitHub から読み込めませんでした。", + "noMoreResults": "ページ {{page}} にこれ以上の結果はありません。" + }, "pickerProjection": { "allRepos": "すべてのリポジトリ", "allSites": "すべてのサイト", diff --git a/mobile/src/i18n/locales/ko.json b/mobile/src/i18n/locales/ko.json index 108a7a20015..2b51f3ce5ae 100644 --- a/mobile/src/i18n/locales/ko.json +++ b/mobile/src/i18n/locales/ko.json @@ -1335,7 +1335,18 @@ }, "announce": { "typedInto": "{{target}}에 입력됨", - "insertedIn": "{{target}}에 삽입됨" + "insertedIn": "{{target}}에 삽입됨", + "listeningOnPhone": "듣는 중. 이 휴대폰에서 받아쓰는 중입니다.", + "listeningOn": "듣는 중. {{computer}}에서 받아쓰는 중입니다.", + "listeningOnComputer": "듣는 중. 컴퓨터에서 받아쓰는 중입니다.", + "finishing": "마무리 중.", + "inserted": "삽입됨.", + "cancelled": "받아쓰기가 취소되었습니다.", + "movedTo": "이 휴대폰의 받아쓰기가 멈췄습니다. {{computer}}에서 계속합니다.", + "movedToComputer": "이 휴대폰의 받아쓰기가 멈췄습니다. 컴퓨터에서 계속합니다.", + "stoppedKept": "받아쓰기가 중지되었습니다. {{reason}}. 녹음은 보관됩니다.", + "stoppedKeptGeneric": "받아쓰기가 중지되었습니다. 녹음은 보관됩니다.", + "stillListening": "계속 듣는 중입니다." }, "pill": { "open": "열기", @@ -2149,6 +2160,10 @@ "providerExitedRejection": "이 메시지가 전송되기 전에 {{agent}}이(가) 중지되었습니다.", "providerExitedRow": "이 응답이 진행되는 동안 {{agent}}이(가) 중지되었습니다. 이 대화에서 계속할 수 있습니다.", "providerRateLimited": "{{agent}}이(가) 속도 제한에 걸려 다시 시도하고 있습니다.", + "providerUnavailable": "서비스가 혼잡하여 {{agent}}이(가) 응답하지 못했습니다. 다른 모델을 선택하거나 잠시 기다린 후 다시 보내세요.", + "providerSafetyStopped": "{{agent}}이(가) 안전 검사 후 이 응답을 중단했습니다. 요청을 검토한 후 다시 보내세요.", + "providerResponseFailed": "{{agent}}이(가) 이 응답을 완료하지 못했습니다. 자세한 내용을 열어 확인하세요.", + "selectedModel": "선택한 모델", "providerRejected": "{{agent}}이(가) 이 메시지를 받아들이지 않았습니다.", "providerRejectedQuoted": "{{agent}}이(가) 이 메시지를 받아들이지 않았습니다: {{detail}}.", "providerRetryLastError": "마지막 오류: {{detail}}.", @@ -2435,8 +2450,7 @@ "tabStrip": { "checkingCapabilities": "데스크톱에서 지원하는 기능을 확인 중입니다. 잠시 후 다시 시도하세요.", "newTab": "새 탭", - "quickCommandsUpdateRequired": "빠른 명령을 사용하려면 데스크톱 업데이트가 필요합니다.", - "tabStatus": "{{title}}, {{status}}" + "quickCommandsUpdateRequired": "빠른 명령을 사용하려면 데스크톱 업데이트가 필요합니다." }, "terminalActionSheetActions": { "clearTerminal": "터미널 지우기", @@ -2549,8 +2563,8 @@ "insertFailed": "받아쓰기 내용을 삽입하지 못했습니다.", "insertFailedCopied": "받아쓰기 내용을 삽입하지 못해 클립보드에 복사했습니다.", "inserted": "받아쓰기 내용 삽입됨", - "stoppedAfterSilence": "1분 동안 말소리가 없어 중지했습니다.", - "stoppedAtCloudLimit": "클라우드 10분 제한에 도달해 받아쓰기가 중지되었습니다." + "stoppedAtCloudLimit": "클라우드 10분 제한에 도달해 받아쓰기가 중지되었습니다.", + "stoppedAfterSilenceSeconds": "{{seconds}}초 동안 조용해서 중지했습니다" }, "useNativeChatStop": { "stopNotSent": "중지 요청 전송 안 됨", @@ -3345,6 +3359,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "병합됨", + "closed": "닫힘", + "conflicts": "충돌", + "behind": "뒤처짐", + "blocked": "차단됨", + "checksPending": "검사 대기 중", + "ableToMerge": "병합 가능", + "unknown": "알 수 없음" + }, + "pagination": { + "pageUnreachable": "{{page}}페이지는 GitHub 검색에서 반환할 수 있는 범위를 벗어났습니다.", + "loadPageFailed": "GitHub에서 {{page}}페이지를 불러오지 못했습니다.", + "noMoreResults": "{{page}}페이지에 더 이상 결과가 없습니다." + }, "composerSource": { "baseFailed": "기본 브랜치를 확인하지 못했습니다.", "forkPushWarning": "이 PR에서 \"유지 관리자의 수정 허용\"이 꺼져 있어 GitHub에서 포크로의 푸시를 거부할 수 있습니다." diff --git a/mobile/src/i18n/locales/pt.json b/mobile/src/i18n/locales/pt.json index 675f0e6c313..0d4a2150210 100644 --- a/mobile/src/i18n/locales/pt.json +++ b/mobile/src/i18n/locales/pt.json @@ -1380,7 +1380,18 @@ }, "announce": { "typedInto": "Digitado em {{target}}", - "insertedIn": "Inserido em {{target}}" + "insertedIn": "Inserido em {{target}}", + "listeningOnPhone": "Ouvindo. Transcrevendo neste telefone.", + "listeningOn": "Ouvindo. Transcrevendo em {{computer}}.", + "listeningOnComputer": "Ouvindo. Transcrevendo no computador.", + "finishing": "Finalizando.", + "inserted": "Inserido.", + "cancelled": "Ditado cancelado.", + "movedTo": "Este telefone parou de transcrever. Continuando em {{computer}}.", + "movedToComputer": "Este telefone parou de transcrever. Continuando no computador.", + "stoppedKept": "Ditado interrompido. {{reason}}. Sua gravação foi mantida.", + "stoppedKeptGeneric": "Ditado interrompido. Sua gravação foi mantida.", + "stillListening": "Ainda ouvindo." }, "pill": { "open": "Abrir", @@ -2221,6 +2232,10 @@ "providerExitedRejection": "{{agent}} parou antes de esta mensagem ser enviada.", "providerExitedRow": "{{agent}} parou enquanto esta resposta estava em andamento. Você pode continuar nesta conversa.", "providerRateLimited": "{{agent}} atingiu o limite de requisições e está tentando novamente.", + "providerUnavailable": "{{agent}} não conseguiu responder porque o serviço está ocupado. Escolha outro modelo ou aguarde um pouco e envie novamente.", + "providerSafetyStopped": "{{agent}} interrompeu esta resposta após uma verificação de segurança. Revise sua solicitação e envie novamente.", + "providerResponseFailed": "{{agent}} não conseguiu concluir esta resposta. Abra os detalhes para obter mais informações.", + "selectedModel": "o modelo selecionado", "providerRejected": "{{agent}} não aceitou esta mensagem.", "providerRejectedQuoted": "{{agent}} não aceitou esta mensagem: {{detail}}.", "providerRetryLastError": "Último erro: {{detail}}.", @@ -2509,8 +2524,7 @@ "tabStrip": { "checkingCapabilities": "Verificando os recursos do desktop — tente novamente em instantes", "newTab": "Nova aba", - "quickCommandsUpdateRequired": "Atualize o desktop para usar comandos rápidos", - "tabStatus": "{{title}}, {{status}}" + "quickCommandsUpdateRequired": "Atualize o desktop para usar comandos rápidos" }, "terminalActionSheetActions": { "clearTerminal": "Limpar Terminal", @@ -2623,8 +2637,8 @@ "insertFailed": "Não foi possível inserir o ditado", "insertFailedCopied": "Não foi possível inserir o ditado, então ele foi copiado para a área de transferência", "inserted": "Ditado inserido", - "stoppedAfterSilence": "Parou após um minuto de silêncio", - "stoppedAtCloudLimit": "O ditado foi interrompido no limite de 10 minutos da nuvem." + "stoppedAtCloudLimit": "O ditado foi interrompido no limite de 10 minutos da nuvem.", + "stoppedAfterSilenceSeconds": "Parado após {{seconds}} segundos de silêncio" }, "useNativeChatStop": { "stopNotSent": "Comando de parada não enviado", @@ -3437,6 +3451,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "Mesclado", + "closed": "Fechado", + "conflicts": "Conflitos", + "behind": "Desatualizado", + "blocked": "Bloqueado", + "checksPending": "Verificações pendentes", + "ableToMerge": "Pode ser mesclado", + "unknown": "Desconhecido" + }, + "pagination": { + "pageUnreachable": "A página {{page}} está além do que a pesquisa do GitHub pode retornar.", + "loadPageFailed": "A página {{page}} não pôde ser carregada do GitHub.", + "noMoreResults": "Não há mais resultados na página {{page}}." + }, "composerSource": { "baseFailed": "Falha ao determinar a branch base.", "forkPushWarning": "Este PR está com \"Permitir edições de mantenedores\" desativado; o GitHub pode rejeitar o push para o fork." diff --git a/mobile/src/i18n/locales/ru.json b/mobile/src/i18n/locales/ru.json index 97b5c0be44f..cec7d8ced57 100644 --- a/mobile/src/i18n/locales/ru.json +++ b/mobile/src/i18n/locales/ru.json @@ -1421,7 +1421,18 @@ }, "announce": { "typedInto": "Введено в {{target}}", - "insertedIn": "Вставлено в {{target}}" + "insertedIn": "Вставлено в {{target}}", + "listeningOnPhone": "Слушаю. Распознавание на этом телефоне.", + "listeningOn": "Слушаю. Распознавание на {{computer}}.", + "listeningOnComputer": "Слушаю. Распознавание на компьютере.", + "finishing": "Завершение.", + "inserted": "Вставлено.", + "cancelled": "Диктовка отменена.", + "movedTo": "Этот телефон перестал распознавать. Продолжение на {{computer}}.", + "movedToComputer": "Этот телефон перестал распознавать. Продолжение на компьютере.", + "stoppedKept": "Диктовка остановлена. {{reason}}. Запись сохранена.", + "stoppedKeptGeneric": "Диктовка остановлена. Запись сохранена.", + "stillListening": "Продолжаю слушать." }, "pill": { "open": "Открыть", @@ -2289,6 +2300,10 @@ "providerExitedRejection": "{{agent}} остановился до отправки этого сообщения.", "providerExitedRow": "{{agent}} остановился во время ответа. Вы можете продолжить этот разговор.", "providerRateLimited": "{{agent}} повторяет попытку из-за ограничения частоты запросов.", + "providerUnavailable": "{{agent}} не смог ответить, поскольку сервис занят. Выберите другую модель или немного подождите и отправьте сообщение снова.", + "providerSafetyStopped": "{{agent}} остановил этот ответ после проверки безопасности. Проверьте запрос и отправьте его снова.", + "providerResponseFailed": "{{agent}} не удалось завершить этот ответ. Откройте подробности, чтобы узнать больше.", + "selectedModel": "выбранную модель", "providerRejected": "{{agent}} не принял это сообщение.", "providerRejectedQuoted": "{{agent}} не принял это сообщение: {{detail}}.", "providerRetryLastError": "Последняя ошибка: {{detail}}.", @@ -2579,8 +2594,7 @@ "tabStrip": { "checkingCapabilities": "Проверяем возможности Orca на компьютере — повторите попытку чуть позже", "newTab": "Новая вкладка", - "quickCommandsUpdateRequired": "Для быстрых команд обновите Orca на компьютере", - "tabStatus": "{{title}}, {{status}}" + "quickCommandsUpdateRequired": "Для быстрых команд обновите Orca на компьютере" }, "terminalActionSheetActions": { "clearTerminal": "Очистить терминал", @@ -2693,8 +2707,8 @@ "insertFailed": "Не удалось вставить текст диктовки", "insertFailedCopied": "Не удалось вставить текст диктовки — он скопирован в буфер обмена", "inserted": "Текст диктовки вставлен", - "stoppedAfterSilence": "Остановлено после минуты тишины", - "stoppedAtCloudLimit": "Диктовка остановлена: достигнут 10-минутный облачный лимит." + "stoppedAtCloudLimit": "Диктовка остановлена: достигнут 10-минутный облачный лимит.", + "stoppedAfterSilenceSeconds": "Остановлено после {{seconds}} с тишины" }, "useNativeChatStop": { "stopNotSent": "Команда остановки не отправлена", @@ -3525,6 +3539,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "Слито", + "closed": "Закрыто", + "conflicts": "Конфликты", + "behind": "Отстаёт", + "blocked": "Заблокировано", + "checksPending": "Проверки ожидаются", + "ableToMerge": "Можно слить", + "unknown": "Неизвестно" + }, + "pagination": { + "pageUnreachable": "Страница {{page}} выходит за пределы результатов поиска GitHub.", + "loadPageFailed": "Не удалось загрузить страницу {{page}} из GitHub.", + "noMoreResults": "На странице {{page}} больше нет результатов." + }, "composerSource": { "baseFailed": "Не удалось определить базовую ветку.", "forkPushWarning": "В этом PR отключена настройка «Разрешить правки сопровождающим»; GitHub может отклонить отправку в форк." diff --git a/mobile/src/i18n/locales/tr.json b/mobile/src/i18n/locales/tr.json index 9fd904d49c4..81be23db055 100644 --- a/mobile/src/i18n/locales/tr.json +++ b/mobile/src/i18n/locales/tr.json @@ -1339,7 +1339,18 @@ }, "announce": { "typedInto": "{{target}} içine yazıldı", - "insertedIn": "{{target}} içine eklendi" + "insertedIn": "{{target}} içine eklendi", + "listeningOnPhone": "Dinleniyor. Bu telefonda yazıya dökülüyor.", + "listeningOn": "Dinleniyor. {{computer}} üzerinde yazıya dökülüyor.", + "listeningOnComputer": "Dinleniyor. Bilgisayarda yazıya dökülüyor.", + "finishing": "Tamamlanıyor.", + "inserted": "Eklendi.", + "cancelled": "Dikte iptal edildi.", + "movedTo": "Bu telefon yazıya dökmeyi bıraktı. {{computer}} üzerinde devam ediliyor.", + "movedToComputer": "Bu telefon yazıya dökmeyi bıraktı. Bilgisayarda devam ediliyor.", + "stoppedKept": "Dikte durdu. {{reason}}. Kaydınız saklandı.", + "stoppedKeptGeneric": "Dikte durdu. Kaydınız saklandı.", + "stillListening": "Dinlemeye devam ediliyor." }, "pill": { "open": "Aç", @@ -1450,11 +1461,11 @@ "updateRequired": "PDF'leri açmak için Orca Mobile'ı güncelleyin" }, "unsavedEditsOffer": { - "changedSince": "{{time}} tarihli düzenlemelerinizden sonra masaüstünde değişti", + "changedSince": "Düzenlemelerinizden ({{time}}) sonra masaüstünde değişti", "copyMyEdits": "Düzenlemelerimi kopyala", "discard": "Vazgeç", "restore": "Geri yükle", - "unsavedFrom": "{{time}} tarihli kaydedilmemiş düzenlemeler" + "unsavedFrom": "Kaydedilmemiş düzenlemeler ({{time}})" } }, "home": { @@ -2153,6 +2164,10 @@ "providerExitedRejection": "Bu mesaj gönderilmeden önce {{agent}} durdu.", "providerExitedRow": "Bu yanıt hazırlanırken {{agent}} durdu. Bu konuşmada devam edebilirsiniz.", "providerRateLimited": "{{agent}} istek hızı sınırına ulaştı ve yeniden deniyor.", + "providerUnavailable": "Hizmet meşgul olduğu için {{agent}} yanıt veremedi. Başka bir model seçin veya biraz bekleyip yeniden gönderin.", + "providerSafetyStopped": "{{agent}}, bir güvenlik kontrolünden sonra bu yanıtı durdurdu. İsteğinizi gözden geçirip yeniden gönderin.", + "providerResponseFailed": "{{agent}} bu yanıtı tamamlayamadı. Daha fazla bilgi için ayrıntıları açın.", + "selectedModel": "seçilen modeli", "providerRejected": "{{agent}} bu mesajı kabul etmedi.", "providerRejectedQuoted": "{{agent}} bu mesajı kabul etmedi: {{detail}}.", "providerRetryLastError": "Son hata: {{detail}}.", @@ -2439,8 +2454,7 @@ "tabStrip": { "checkingCapabilities": "Masaüstü özellikleri kontrol ediliyor — birazdan tekrar deneyin", "newTab": "Yeni sekme", - "quickCommandsUpdateRequired": "Hızlı komutlar için masaüstü uygulaması güncellenmeli", - "tabStatus": "{{title}}, {{status}}" + "quickCommandsUpdateRequired": "Hızlı komutlar için masaüstü uygulaması güncellenmeli" }, "terminalActionSheetActions": { "clearTerminal": "Terminali Temizle", @@ -2553,8 +2567,8 @@ "insertFailed": "Dikte metni eklenemedi", "insertFailedCopied": "Dikte metni eklenemediği için panoya kopyalandı", "inserted": "Dikte metni eklendi", - "stoppedAfterSilence": "Bir dakika sessizlikten sonra durduruldu", - "stoppedAtCloudLimit": "Dikte, 10 dakikalık bulut sınırında durduruldu." + "stoppedAtCloudLimit": "Dikte, 10 dakikalık bulut sınırında durduruldu.", + "stoppedAfterSilenceSeconds": "{{seconds}} saniyelik sessizlikten sonra durduruldu" }, "useNativeChatStop": { "stopNotSent": "Durdurma isteği gönderilemedi", @@ -3349,6 +3363,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "Birleştirildi", + "closed": "Kapatıldı", + "conflicts": "Çakışmalar", + "behind": "Geride", + "blocked": "Engellendi", + "checksPending": "Kontroller bekleniyor", + "ableToMerge": "Birleştirilebilir", + "unknown": "Bilinmiyor" + }, + "pagination": { + "pageUnreachable": "{{page}}. sayfa GitHub aramasının döndürebileceği aralığın dışında.", + "loadPageFailed": "{{page}}. sayfa GitHub’dan yüklenemedi.", + "noMoreResults": "{{page}}. sayfada başka sonuç yok." + }, "composerSource": { "baseFailed": "Temel branch çözümlenemedi.", "forkPushWarning": "Bu PR'da “Allow edits from maintainers” kapalı; fork'a push işlemi GitHub tarafından reddedilebilir." diff --git a/mobile/src/i18n/locales/zh-Hant.json b/mobile/src/i18n/locales/zh-Hant.json index 6512122f33a..535fb5d378a 100644 --- a/mobile/src/i18n/locales/zh-Hant.json +++ b/mobile/src/i18n/locales/zh-Hant.json @@ -1335,7 +1335,18 @@ }, "announce": { "typedInto": "已輸入到 {{target}}", - "insertedIn": "已插入到 {{target}}" + "insertedIn": "已插入到 {{target}}", + "listeningOnPhone": "正在聽。正在此手機上轉寫。", + "listeningOn": "正在聽。正在 {{computer}} 上轉寫。", + "listeningOnComputer": "正在聽。正在電腦上轉寫。", + "finishing": "正在完成。", + "inserted": "已插入。", + "cancelled": "已取消聽寫。", + "movedTo": "此手機已停止轉寫。在 {{computer}} 上繼續。", + "movedToComputer": "此手機已停止轉寫。在電腦上繼續。", + "stoppedKept": "聽寫已停止。{{reason}}。錄音已保留。", + "stoppedKeptGeneric": "聽寫已停止。錄音已保留。", + "stillListening": "仍在聽。" }, "pill": { "open": "開啟", @@ -2149,6 +2160,10 @@ "providerExitedRejection": "{{agent}} 在傳送此訊息前已停止。", "providerExitedRow": "{{agent}} 在產生此回覆時停止了。您可以在此對話中繼續。", "providerRateLimited": "{{agent}} 受到速率限制,正在重試。", + "providerUnavailable": "{{agent}} 因服務忙碌而無法回覆。請選擇其他模型,或稍候片刻後重新傳送。", + "providerSafetyStopped": "{{agent}} 在安全檢查後停止了此次回覆。請檢查您的請求後重新傳送。", + "providerResponseFailed": "{{agent}} 未能完成此回覆。開啟詳細資料以取得更多資訊。", + "selectedModel": "所選模型", "providerRejected": "{{agent}} 未接受此訊息。", "providerRejectedQuoted": "{{agent}} 未接受此訊息:{{detail}}。", "providerRetryLastError": "上次錯誤:{{detail}}。", @@ -2435,8 +2450,7 @@ "tabStrip": { "checkingCapabilities": "正在檢查桌面版支援的功能,請稍後再試", "newTab": "新分頁", - "quickCommandsUpdateRequired": "需更新桌面版才能使用快速命令", - "tabStatus": "{{title}},{{status}}" + "quickCommandsUpdateRequired": "需更新桌面版才能使用快速命令" }, "terminalActionSheetActions": { "clearTerminal": "清除終端機", @@ -2549,8 +2563,8 @@ "insertFailed": "無法插入聽寫內容", "insertFailedCopied": "無法插入聽寫內容,已複製到剪貼簿", "inserted": "已插入聽寫內容", - "stoppedAfterSilence": "靜音一分鐘後已停止", - "stoppedAtCloudLimit": "已達 10 分鐘雲端上限。聽寫已停止。" + "stoppedAtCloudLimit": "已達 10 分鐘雲端上限。聽寫已停止。", + "stoppedAfterSilenceSeconds": "靜音 {{seconds}} 秒後已停止" }, "useNativeChatStop": { "stopNotSent": "未送出停止命令", @@ -3345,6 +3359,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "已合併", + "closed": "已關閉", + "conflicts": "有衝突", + "behind": "落後", + "blocked": "已封鎖", + "checksPending": "等待檢查", + "ableToMerge": "可以合併", + "unknown": "未知" + }, + "pagination": { + "pageUnreachable": "第 {{page}} 頁超出 GitHub 搜尋可傳回的範圍。", + "loadPageFailed": "無法從 GitHub 載入第 {{page}} 頁。", + "noMoreResults": "第 {{page}} 頁沒有更多結果。" + }, "composerSource": { "baseFailed": "無法解析基礎分支。", "forkPushWarning": "此 PR 未啟用「允許維護者編輯」;推送至分叉存放庫可能會遭 GitHub 拒絕。" diff --git a/mobile/src/i18n/locales/zh.json b/mobile/src/i18n/locales/zh.json index 9982692931e..f845b0e146d 100644 --- a/mobile/src/i18n/locales/zh.json +++ b/mobile/src/i18n/locales/zh.json @@ -1335,7 +1335,18 @@ }, "announce": { "typedInto": "已输入到 {{target}}", - "insertedIn": "已插入到 {{target}}" + "insertedIn": "已插入到 {{target}}", + "listeningOnPhone": "正在听。正在此手机上转写。", + "listeningOn": "正在听。正在 {{computer}} 上转写。", + "listeningOnComputer": "正在听。正在电脑上转写。", + "finishing": "正在完成。", + "inserted": "已插入。", + "cancelled": "已取消听写。", + "movedTo": "此手机已停止转写。在 {{computer}} 上继续。", + "movedToComputer": "此手机已停止转写。在电脑上继续。", + "stoppedKept": "听写已停止。{{reason}}。录音已保留。", + "stoppedKeptGeneric": "听写已停止。录音已保留。", + "stillListening": "仍在听。" }, "pill": { "open": "打开", @@ -2149,6 +2160,10 @@ "providerExitedRejection": "{{agent}} 在发送此消息前已停止。", "providerExitedRow": "{{agent}} 在生成此回复时停止了。您可以在此对话中继续。", "providerRateLimited": "{{agent}} 已被限流,正在重试。", + "providerUnavailable": "{{agent}} 因服务繁忙而无法回复。请选择其他模型,或稍等片刻后重新发送。", + "providerSafetyStopped": "{{agent}} 在安全检查后停止了此次回复。请检查您的请求后重新发送。", + "providerResponseFailed": "{{agent}} 未能完成此回复。打开详情了解更多信息。", + "selectedModel": "所选模型", "providerRejected": "{{agent}} 未接受此消息。", "providerRejectedQuoted": "{{agent}} 未接受此消息:{{detail}}。", "providerRetryLastError": "上次错误:{{detail}}。", @@ -2435,8 +2450,7 @@ "tabStrip": { "checkingCapabilities": "正在检查桌面支持的功能,请稍后重试", "newTab": "新标签页", - "quickCommandsUpdateRequired": "使用快捷命令需更新桌面应用", - "tabStatus": "{{title}},{{status}}" + "quickCommandsUpdateRequired": "使用快捷命令需更新桌面应用" }, "terminalActionSheetActions": { "clearTerminal": "清空终端", @@ -2549,8 +2563,8 @@ "insertFailed": "无法插入听写文本", "insertFailedCopied": "无法插入听写文本,已复制到剪贴板", "inserted": "已插入听写文本", - "stoppedAfterSilence": "静音一分钟后已停止", - "stoppedAtCloudLimit": "已达 10 分钟云端上限。听写已停止。" + "stoppedAtCloudLimit": "已达 10 分钟云端上限。听写已停止。", + "stoppedAfterSilenceSeconds": "静音 {{seconds}} 秒后已停止" }, "useNativeChatStop": { "stopNotSent": "停止指令未发送", @@ -3425,6 +3439,16 @@ "githubViewControls": { "openView": "在 GitHub 中打开视图" }, + "hostedMerge": { + "merged": "已合并", + "closed": "已关闭", + "conflicts": "有冲突", + "behind": "落后", + "blocked": "已阻止", + "checksPending": "检查待完成", + "ableToMerge": "可以合并", + "unknown": "未知" + }, "itemActions": { "changeStatus": "更改状态", "copyGitHubLink": "复制 GitHub 链接", @@ -3571,6 +3595,11 @@ "updated": "已更新", "updatedSortDescription": "最新活动优先" }, + "pagination": { + "pageUnreachable": "第 {{page}} 页超出了 GitHub 搜索可返回的范围。", + "loadPageFailed": "无法从 GitHub 加载第 {{page}} 页。", + "noMoreResults": "第 {{page}} 页没有更多结果。" + }, "pickerProjection": { "allRepos": "所有仓库", "allSites": "所有站点", diff --git a/mobile/src/i18n/mobile-i18n.test.ts b/mobile/src/i18n/mobile-i18n.test.ts index a2906b02959..08e08089f53 100644 --- a/mobile/src/i18n/mobile-i18n.test.ts +++ b/mobile/src/i18n/mobile-i18n.test.ts @@ -7,7 +7,8 @@ vi.mock('./locale-catalog-imports', () => ({ importLocaleCatalog: (locale: string) => failing.has(locale) ? Promise.reject(new Error('missing chunk')) - : new Promise((resolve) => pending.set(locale, resolve)) + : new Promise((resolve) => pending.set(locale, resolve)), + onLocaleCatalogArrival: () => () => undefined })) const { activateMobileUiLocale, getMobileUiLocale, mobileI18n, translate } = diff --git a/mobile/src/i18n/mobile-i18n.ts b/mobile/src/i18n/mobile-i18n.ts index c3f58905000..d3a5b94be34 100644 --- a/mobile/src/i18n/mobile-i18n.ts +++ b/mobile/src/i18n/mobile-i18n.ts @@ -3,7 +3,7 @@ import { resolvePluralFamilyKey } from '../../../src/shared/i18n-plural-family' import { pseudoLocalizeString } from '../../../src/shared/pseudo-localization' import { DEFAULT_UI_LOCALE, type SupportedUiLocale } from '../../../src/shared/ui-locale' import enRuntimeRequired from './en-runtime-required.json' -import { importLocaleCatalog } from './locale-catalog-imports' +import { importLocaleCatalog, onLocaleCatalogArrival } from './locale-catalog-imports' export type Translate = (key: string, fallback: string, options?: TOptions) => string @@ -83,10 +83,12 @@ export function subscribeMobileUiLanguage(listener: () => void): () => void { } let activationRequest = 0 +let requestedLocale: SupportedUiLocale = DEFAULT_UI_LOCALE // Latest request wins: an older catalog import that settles later must not replace a newer choice. export async function activateMobileUiLocale(locale: SupportedUiLocale): Promise { const request = ++activationRequest + requestedLocale = locale try { if (locale !== 'en' && !mobileI18n.hasResourceBundle(locale, 'translation')) { const catalog = await importLocaleCatalog(locale) @@ -115,6 +117,16 @@ export async function activateMobileUiLocale(locale: SupportedUiLocale): Promise publish() } +// Switch in place, without a reload: a newer copy replaces the shown one, a first copy replaces the English fallback. +// Install it even when another language is up now, so switching back shows the newer copy. +onLocaleCatalogArrival((locale, catalog) => { + mobileI18n.removeResourceBundle(locale, 'translation') + mobileI18n.addResourceBundle(locale, 'translation', catalog, false, true, { skipCopy: true }) + if (locale === requestedLocale) { + void activateMobileUiLocale(locale) + } +}) + // Development-only layout check: accents and pads every string so clipping shows on device. export function setMobilePseudoLocalization(enabled: boolean): void { if (pseudoLocalization !== enabled) { diff --git a/mobile/src/i18n/page-locale-catalog-source.test.ts b/mobile/src/i18n/page-locale-catalog-source.test.ts new file mode 100644 index 00000000000..d69a92dc1b2 --- /dev/null +++ b/mobile/src/i18n/page-locale-catalog-source.test.ts @@ -0,0 +1,218 @@ +import { describe, expect, it, vi } from 'vitest' +import type { ConnectionState } from '../transport/connection/connection-state' +import type { RpcResponse } from '../transport/rpc/rpc-wire-types' +import { + decodeDeviceStoreValue, + encodeDeviceStoreValue +} from '../device-store/device-store-value-codec' +import type { PageDeviceStore } from '../mobile-web-shell/bridge/page-device-store' + +// The page build resolves mobile-i18n's catalog import to the .web module; mirror that here. +vi.mock('./locale-catalog-imports', () => import('./locale-catalog-imports.web')) +// A shell that skipped the catalog chunks: only locales listed here are on disk. +const chunksOnDisk = new Map>() +vi.mock('./bundled-locale-catalogs', () => ({ + importBundledLocaleCatalog: async (locale: string) => { + const catalog = chunksOnDisk.get(locale) + if (!catalog) { + throw new Error('not on disk') + } + return catalog + } +})) + +const OLD_SHA = 'a'.repeat(64) +const NEW_SHA = 'b'.repeat(64) + +type SentRequest = { + method: string + params: unknown + reply: (response: RpcResponse) => void + fail: (error: Error) => void +} + +function fakeClient(initial: ConnectionState) { + let state = initial + let generation = 1 + const listeners = new Set<(next: ConnectionState) => void>() + const sent: SentRequest[] = [] + return { + sent, + getState: () => state, + getGeneration: () => generation, + onStateChange: (listener: (next: ConnectionState) => void) => { + listeners.add(listener) + return () => { + listeners.delete(listener) + } + }, + sendRequest: (method: string, params?: unknown) => + new Promise((reply, fail) => sent.push({ method, params, reply, fail })), + moveTo(next: ConnectionState) { + state = next + for (const listener of listeners) { + listener(next) + } + }, + // The shell swaps in an already-connected replacement, as on a relay-to-LAN move. + cutover() { + generation += 1 + for (const listener of listeners) { + listener('connected') + } + } + } +} + +function fakeStore(rows: Record): PageDeviceStore & { rows: Map } { + const stored = new Map(Object.entries(rows)) + return { + rows: stored, + available: () => true, + read: async (_table, keys) => ({ + status: 'ok', + values: keys.map((key) => stored.get(key) ?? null) + }), + write: async (_table, ops) => { + for (const op of ops) { + if (op.value !== null) { + stored.set(op.key, op.value) + } + } + return { written: true } + } + } +} + +const { startPageLocaleCatalogs } = await import('./page-locale-catalog-source') +const i18n = await import('./mobile-i18n') + +// Module state outlives a test, so each test uses its own locale and publishes its own source. +function openPage(client: ReturnType, store: PageDeviceStore): void { + startPageLocaleCatalogs({ client, store }) +} + +// Microtasks, then one macrotask, which is when the store write runs. +async function settle(): Promise { + for (let turn = 0; turn < 20; turn++) { + await Promise.resolve() + } + await new Promise((resolve) => setTimeout(resolve, 0)) +} + +describe('the page language catalog', () => { + it('opens on the stored copy, then switches in place to the desktop newer one', async () => { + const client = fakeClient('connected') + const store = fakeStore({ + 'i18n-catalog:de': encodeDeviceStoreValue({ + v: 1, + sha256: OLD_SHA, + catalog: { greeting: 'Hallo' } + }) + }) + openPage(client, store) + + await i18n.activateMobileUiLocale('de') + expect(i18n.translate('greeting', 'Hello')).toBe('Hallo') + expect(client.sent.map(({ method, params }) => ({ method, params }))).toEqual([ + { method: 'mobileWeb.bundle.localeCatalog', params: { locale: 'de', knownSha256: OLD_SHA } } + ]) + + client.sent[0].reply({ + id: 'r1', + ok: true, + result: { locale: 'de', sha256: NEW_SHA, catalog: { greeting: 'Servus' } } + }) + await settle() + + expect(i18n.getMobileUiLocale()).toBe('de') + expect(i18n.translate('greeting', 'Hello')).toBe('Servus') + expect(decodeDeviceStoreValue(store.rows.get('i18n-catalog:de') ?? '')).toEqual({ + v: 1, + sha256: NEW_SHA, + catalog: { greeting: 'Servus' } + }) + }) + + it('shows English offline with nothing stored, then the language once the desktop answers', async () => { + vi.spyOn(console, 'warn').mockImplementation(() => {}) + const client = fakeClient('reconnecting') + openPage(client, fakeStore({})) + + await i18n.activateMobileUiLocale('fr') + expect(i18n.getMobileUiLocale()).toBe('en') + expect(i18n.translate('greeting', 'Hello')).toBe('Hello') + expect(client.sent).toHaveLength(0) + + client.moveTo('connected') + await settle() + expect(client.sent.map(({ params }) => params)).toEqual([{ locale: 'fr' }]) + client.sent[0].reply({ + id: 'r1', + ok: true, + result: { locale: 'fr', sha256: NEW_SHA, catalog: { greeting: 'Bonjour' } } + }) + await settle() + + expect(i18n.getMobileUiLocale()).toBe('fr') + expect(i18n.translate('greeting', 'Hello')).toBe('Bonjour') + }) + + it('opens in English when the first request fails on a live link, then switches on the next connection', async () => { + vi.spyOn(console, 'warn').mockImplementation(() => {}) + const client = fakeClient('connected') + openPage(client, fakeStore({})) + + const activation = i18n.activateMobileUiLocale('ja') + await settle() + client.sent[0].fail(new Error('timed out')) + await activation + expect(i18n.getMobileUiLocale()).toBe('en') + + client.moveTo('reconnecting') + client.moveTo('connected') + await settle() + client.sent[1].reply({ + id: 'r2', + ok: true, + result: { locale: 'ja', sha256: NEW_SHA, catalog: { greeting: 'こんにちは' } } + }) + await settle() + + expect(i18n.getMobileUiLocale()).toBe('ja') + expect(i18n.translate('greeting', 'Hello')).toBe('こんにちは') + }) + + it('asks again on the connection a cutover swaps in, without waiting for another reconnect', async () => { + vi.spyOn(console, 'warn').mockImplementation(() => {}) + const client = fakeClient('reconnecting') + openPage(client, fakeStore({})) + + await i18n.activateMobileUiLocale('ko') + client.moveTo('connected') + await settle() + client.cutover() + client.sent[0].fail(new Error('client cut over')) + await settle() + client.sent[1].reply({ + id: 'r2', + ok: true, + result: { locale: 'ko', sha256: NEW_SHA, catalog: { greeting: '안녕하세요' } } + }) + await settle() + + expect(i18n.getMobileUiLocale()).toBe('ko') + expect(i18n.translate('greeting', 'Hello')).toBe('안녕하세요') + }) + + it('imports the chunk an older shell left on disk, with no wait and no request', async () => { + chunksOnDisk.set('es', { greeting: 'Hola' }) + const client = fakeClient('reconnecting') + openPage(client, fakeStore({})) + + await i18n.activateMobileUiLocale('es') + + expect(i18n.translate('greeting', 'Hello')).toBe('Hola') + expect(client.sent).toHaveLength(0) + }) +}) diff --git a/mobile/src/i18n/page-locale-catalog-source.ts b/mobile/src/i18n/page-locale-catalog-source.ts new file mode 100644 index 00000000000..76333fdc22b --- /dev/null +++ b/mobile/src/i18n/page-locale-catalog-source.ts @@ -0,0 +1,265 @@ +import * as z from 'zod' +import type { SupportedUiLocale } from '../../../src/shared/ui-locale' +import { SHA256_PATTERN } from '../../../src/shared/mobile-web-bundle/manifest-contract' +import { + MOBILE_WEB_BUNDLE_LOCALE_CATALOG_METHOD, + MobileWebBundleLocaleCatalogResultSchema +} from '../../../src/shared/mobile-web-bundle/locale-catalog-contract' +import { withTimeoutResult } from '../../../src/shared/promise-timeout-fallback' +import { + decodeDeviceStoreValue, + encodeDeviceStoreValue +} from '../device-store/device-store-value-codec' +import type { BridgeRpcClient } from '../mobile-web-shell/bridge/bridge-rpc-client' +import type { PageDeviceStore } from '../mobile-web-shell/bridge/page-device-store' +import { isMobileMethodUnavailableError } from '../transport/rpc/mobile-method-unavailable' +import { captureRpcOperationSettlement, defineRpcOperation } from '../transport/rpc/rpc-operation' +import { rpcResultVariant } from '../transport/rpc/rpc-operation-result-reader' +import { importBundledLocaleCatalog } from './bundled-locale-catalogs' +import { + announceLocaleCatalog as announce, + publishPageLocaleCatalogLoader, + type LocaleCatalog +} from './locale-catalog-imports.web' + +// The desktop serves the active catalog and the phone keeps a copy per host; only the page entry imports this. +type CatalogLocale = Exclude +type HeldCatalog = { readonly sha256: string; readonly catalog: LocaleCatalog } +type CatalogClient = Pick< + BridgeRpcClient, + 'getState' | 'getGeneration' | 'onStateChange' | 'sendRequest' +> +type CatalogSource = { readonly client: CatalogClient; readonly store: PageDeviceStore } + +const storedCatalogSchema = z.object({ + v: z.literal(1), + sha256: z.string().regex(SHA256_PATTERN), + catalog: z.record(z.string(), z.unknown()) +}) + +const localeCatalogRead = defineRpcOperation({ + name: 'mobileWeb.bundle-locale-catalog', + method: MOBILE_WEB_BUNDLE_LOCALE_CATALOG_METHOD, + acceptance: 'require-result-or-throw', + barrier: 'on-settle', + // Loose like every phone reader, so a host may add fields. + read: rpcResultVariant( + 'mobile-web-bundle-locale-catalog', + MobileWebBundleLocaleCatalogResultSchema.loose() + ) +}) + +const syncing = new Set() +// The stored read plus a relay round trip with the largest catalog fit well inside; past it the page opens in English. +const FIRST_PAINT_CATALOG_WAIT_MS = 3_000 + +const storeKey = (locale: CatalogLocale): string => `i18n-catalog:${locale}` + +async function readStoredCatalog( + store: PageDeviceStore, + locale: CatalogLocale +): Promise { + if (!store.available()) { + return null + } + const read = await store.read('cache', [storeKey(locale)]).catch(() => null) + const raw = read?.status === 'ok' ? read.values[0] : null + if (!raw) { + return null + } + const parsed = storedCatalogSchema.safeParse(decodeDeviceStoreValue(raw)) + return parsed.success ? { sha256: parsed.data.sha256, catalog: parsed.data.catalog } : null +} + +function writeStoredCatalog( + store: PageDeviceStore, + locale: CatalogLocale, + next: HeldCatalog +): void { + if (store.available()) { + const value = encodeDeviceStoreValue({ v: 1, ...next }) + void store.write('cache', [{ key: storeKey(locale), value }]).catch(() => undefined) + } +} + +// A send the host never answered, as opposed to a refusal or an unreadable reply. +class CatalogSendFailed extends Error { + constructor( + message: string, + readonly generation: number | null = null + ) { + super(message) + } +} + +const generationOf = (client: CatalogClient): number | null => client.getGeneration?.() ?? null + +// After a failed send, wait for a reconnect or a cutover to another connection, which is often connected already. +// False once pairing is revoked: that connection never comes back. +function whenConnected(client: CatalogClient, failedGeneration: number | null): Promise { + let reconnected = failedGeneration === null || client.getState() !== 'connected' + const ready = (): boolean => + client.getState() === 'connected' && (reconnected || generationOf(client) !== failedGeneration) + if (ready() || client.getState() === 'auth-failed') { + return Promise.resolve(ready()) + } + return new Promise((resolve) => { + const stop = client.onStateChange((state) => { + reconnected ||= state !== 'connected' + if (ready() || state === 'auth-failed') { + stop() + resolve(ready()) + } + }) + }) +} + +// Rejects when the connection drops first, so a first paint never waits on a reply that can't come. +function beforeConnectionLoss(client: CatalogClient, work: Promise): Promise { + return new Promise((resolve, reject) => { + const stop = client.onStateChange((state) => { + if (state !== 'connected') { + stop() + reject(new CatalogSendFailed('[i18n] connection lost before the catalog arrived')) + } + }) + work.then( + (value) => { + stop() + resolve(value) + }, + (error: unknown) => { + stop() + reject(error) + } + ) + }) +} + +// One request. On an answer the copy becomes the page's and the store's. +async function askHost( + { client, store }: CatalogSource, + locale: CatalogLocale, + known: HeldCatalog | undefined +): Promise { + const generation = generationOf(client) + const settled = await captureRpcOperationSettlement(client, localeCatalogRead, { + locale, + ...(known ? { knownSha256: known.sha256 } : {}) + }) + if (settled.status === 'rejected') { + throw new CatalogSendFailed(`[i18n] the ${locale} catalog request got no answer`, generation) + } + const { outcome } = settled + if (outcome.kind === 'decoded') { + const { sha256, catalog } = outcome.value + // A null catalog only confirms the copy the phone named. + const next = catalog !== null ? { sha256, catalog } : known?.sha256 === sha256 ? known : null + if (next) { + if (next !== known) { + // After the first paint: encoding the copy is main-thread work nothing waits on. + setTimeout(() => { + writeStoredCatalog(store, locale, next) + }, 0) + } + return next + } + } + const refusal = outcome.kind === 'outer-refused' ? outcome.error : undefined + throw new Error( + isMobileMethodUnavailableError(refusal?.code, refusal?.message) + ? '[i18n] this desktop serves no language catalogs' + : `[i18n] the desktop answered no ${locale} catalog` + ) +} + +// Asks until the host answers, resending once per new connection; a refusal ends it. +async function syncFromHost( + current: CatalogSource, + locale: CatalogLocale, + known: HeldCatalog | undefined, + failedGeneration: number | null +): Promise { + for (;;) { + if (!(await whenConnected(current.client, failedGeneration))) { + throw new Error('[i18n] this phone is no longer paired with the desktop') + } + try { + return await askHost(current, locale, known) + } catch (error) { + if (!(error instanceof CatalogSendFailed)) { + throw error + } + failedGeneration = error.generation + } + } +} + +// One sync per locale, announcing a copy other than the one the page already shows. +function syncOnce( + current: CatalogSource, + locale: CatalogLocale, + known: HeldCatalog | undefined, + failedGeneration: number | null = null +): void { + if (syncing.has(locale)) { + return + } + syncing.add(locale) + syncFromHost(current, locale, known, failedGeneration).then( + (next) => { + syncing.delete(locale) + if (next !== known) { + announce(locale, next.catalog) + } + }, + () => { + syncing.delete(locale) + } + ) +} + +// What a first paint may wait for: the stored copy, else one request while connected. +async function firstCatalog(current: CatalogSource, locale: CatalogLocale): Promise { + // Only a locale with no catalog installed is asked for, so nothing is held in memory here. + const known = await readStoredCatalog(current.store, locale) + if (known) { + // Show the stored copy now; a newer one replaces it when the host answers. + syncOnce(current, locale, known) + return known + } + if (current.client.getState() !== 'connected') { + throw new CatalogSendFailed('[i18n] no connection for the catalog yet') + } + return beforeConnectionLoss(current.client, askHost(current, locale, undefined)) +} + +async function loadCatalog(current: CatalogSource, locale: CatalogLocale): Promise { + // A generation an older shell downloaded still holds the chunk: no wait, and this page's own strings. + const bundled = await importBundledLocaleCatalog(locale).catch(() => null) + if (bundled !== null) { + return bundled + } + const first = firstCatalog(current, locale) + const settled = await withTimeoutResult(first, FIRST_PAINT_CATALOG_WAIT_MS) + if (settled.ok) { + return settled.value.catalog + } + // Activation shows English meanwhile; whatever comes later switches the page in place. + first.then( + (late) => { + announce(locale, late.catalog) + }, + (failure: unknown) => { + if (failure instanceof CatalogSendFailed) { + syncOnce(current, locale, undefined, failure.generation) + } + } + ) + throw new Error(`[i18n] no ${locale} catalog for the first paint`) +} + +// Before the first activation, so its catalog comes from the desktop and the store. +export function startPageLocaleCatalogs(current: CatalogSource): void { + publishPageLocaleCatalogLoader((locale) => loadCatalog(current, locale)) +} diff --git a/mobile/src/mobile-web-shell/ShellDownloadProgress.tsx b/mobile/src/mobile-web-shell/ShellDownloadProgress.tsx index 02b19f0caa6..46093799133 100644 --- a/mobile/src/mobile-web-shell/ShellDownloadProgress.tsx +++ b/mobile/src/mobile-web-shell/ShellDownloadProgress.tsx @@ -1,4 +1,4 @@ -import { useHostDisplay, type HostDisplaySource } from '../transport/hosts/use-host-display' +import { useHostDisplay, type HostDisplaySource } from '../host-descriptors/use-host-display' import type { DownloadProgressFeed } from './download-progress-feed' import { DownloadProgressBar, downloadedMegabytesCaption } from './DownloadProgressBar' import type { MobileWebShellSessionState } from './mobile-web-shell-session-contract' diff --git a/mobile/src/mobile-web-shell/ShellStateScreen.tsx b/mobile/src/mobile-web-shell/ShellStateScreen.tsx index 01617b74903..d22e7e2c055 100644 --- a/mobile/src/mobile-web-shell/ShellStateScreen.tsx +++ b/mobile/src/mobile-web-shell/ShellStateScreen.tsx @@ -6,7 +6,7 @@ import { themedStyleSheet } from '../theme/themed-styles' import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' import type { Translate } from '../i18n/mobile-i18n' import { useMobileTranslation } from '../i18n/use-mobile-translation' -import type { HostDisplaySource } from '../transport/hosts/use-host-display' +import type { HostDisplaySource } from '../host-descriptors/use-host-display' import type { DownloadProgressFeed } from './download-progress-feed' import type { MobileWebShellFailureCause, diff --git a/mobile/src/mobile-web-shell/bridge-host-init.test.ts b/mobile/src/mobile-web-shell/bridge-host-init.test.ts index 0a64fd9585f..a2add44e7ad 100644 --- a/mobile/src/mobile-web-shell/bridge-host-init.test.ts +++ b/mobile/src/mobile-web-shell/bridge-host-init.test.ts @@ -48,6 +48,7 @@ describe('init and state', () => { expect(init.grants.native).toEqual([ BRIDGE_FAULT_GRANT, BRIDGE_RPC_ENVELOPE_GRANT, + 'hostCatalogs', 'navigate', 'storage', 'haptics', diff --git a/mobile/src/mobile-web-shell/bridge-host-native-verbs.test.ts b/mobile/src/mobile-web-shell/bridge-host-native-verbs.test.ts index 87e837fc66b..3a9655cfb7b 100644 --- a/mobile/src/mobile-web-shell/bridge-host-native-verbs.test.ts +++ b/mobile/src/mobile-web-shell/bridge-host-native-verbs.test.ts @@ -205,7 +205,7 @@ describe('grants scoped to the route the page was opened for', () => { const bridge = harness({ routeGrants: navigationOnly, ready: true }) expect(bridge.last()).toMatchObject({ type: 'init', - grants: { native: ['fault', 'rpcEnvelope', 'navigate', 'storage'] } + grants: { native: ['fault', 'rpcEnvelope', 'hostCatalogs', 'navigate', 'storage'] } }) for (const [method, params] of [ ['native.clipboard.read', { mime: 'text' }], diff --git a/mobile/src/mobile-web-shell/bridge-host.ts b/mobile/src/mobile-web-shell/bridge-host.ts index 914b25c9b70..166f3e791d3 100644 --- a/mobile/src/mobile-web-shell/bridge-host.ts +++ b/mobile/src/mobile-web-shell/bridge-host.ts @@ -7,9 +7,8 @@ import { BridgeHostRequests } from './bridge-host-requests' import { BridgeHostSubscriptions } from './bridge-host-subscriptions' import { createBridgeHostStreamFrames } from './bridge-host-stream-frames' import { - BRIDGE_FAULT_GRANT, BRIDGE_PROTOCOL_VERSION, - BRIDGE_RPC_ENVELOPE_GRANT, + BRIDGE_SHELL_GRANTS, readBridgeClientMessage, type BridgeClientMessage } from './bridge/bridge-envelope' @@ -30,11 +29,7 @@ export type { BridgeHost, BridgeHostDiagnostic, BridgeHostOptions } from './brid // Bind the host structurally to one RPC client; the protocol lets pages name no other host. Native origin checks reject expired sessions, and init caps are enforced here. export function createBridgeHost(options: BridgeHostOptions): BridgeHost { const { client, buildId, sessionId, pageRoutes, host } = options - const granted: readonly string[] = [ - BRIDGE_FAULT_GRANT, - BRIDGE_RPC_ENVELOPE_GRANT, - ...options.routeGrants - ] + const granted: readonly string[] = [...BRIDGE_SHELL_GRANTS, ...options.routeGrants] // Validate manifest pairs like the route: a pair refused by the page would invalidate the entire init. const parsedRouteGrants = options.pageRouteGrants === undefined diff --git a/mobile/src/mobile-web-shell/bridge/bridge-envelope.ts b/mobile/src/mobile-web-shell/bridge/bridge-envelope.ts index 8f8e8946fa9..5af16b2a9b3 100644 --- a/mobile/src/mobile-web-shell/bridge/bridge-envelope.ts +++ b/mobile/src/mobile-web-shell/bridge/bridge-envelope.ts @@ -32,10 +32,12 @@ export { BRIDGE_EXTERNAL_LINK_GRANT, BRIDGE_FAULT_GRANT, BRIDGE_FOREGROUND_NUDGE_REASONS, + BRIDGE_HOST_CATALOGS_GRANT, BRIDGE_ID_PATTERN, BRIDGE_NAVIGATE_BACK_NOTIFY, BRIDGE_PROTOCOL_VERSION, - BRIDGE_RPC_ENVELOPE_GRANT + BRIDGE_RPC_ENVELOPE_GRANT, + BRIDGE_SHELL_GRANTS } from './bridge-frame-fields' import { isPageStorageKey, diff --git a/mobile/src/mobile-web-shell/bridge/bridge-frame-fields.ts b/mobile/src/mobile-web-shell/bridge/bridge-frame-fields.ts index 9fea8193746..0a2ce887cd6 100644 --- a/mobile/src/mobile-web-shell/bridge/bridge-frame-fields.ts +++ b/mobile/src/mobile-web-shell/bridge/bridge-frame-fields.ts @@ -25,3 +25,13 @@ export const BRIDGE_EXTERNAL_LINK_GRANT = 'externalLink' // Negotiate rpcEnvelope before relying on extra wire fields; older shells drop unknown fields and could execute without caller-required metadata. export const BRIDGE_RPC_ENVELOPE_GRANT = 'rpcEnvelope' + +// The shell skipped the build's language-catalog chunks, so the page reads its catalog from the desktop. +export const BRIDGE_HOST_CATALOGS_GRANT = 'hostCatalogs' + +// Granted to every page this shell opens, whatever its route declares. +export const BRIDGE_SHELL_GRANTS: readonly string[] = [ + BRIDGE_FAULT_GRANT, + BRIDGE_RPC_ENVELOPE_GRANT, + BRIDGE_HOST_CATALOGS_GRANT +] diff --git a/mobile/src/mobile-web-shell/bridge/bridge-init-frame.ts b/mobile/src/mobile-web-shell/bridge/bridge-init-frame.ts index 2c5208dfe6f..ac4c256e67f 100644 --- a/mobile/src/mobile-web-shell/bridge/bridge-init-frame.ts +++ b/mobile/src/mobile-web-shell/bridge/bridge-init-frame.ts @@ -6,9 +6,8 @@ import { import { BRIDGE_MAX_PENDING_REQUESTS, BRIDGE_MAX_SUBSCRIPTIONS } from './bridge-caps' import { MOBILE_WEB_SHELL_GRANTS } from '../page-route-policy' import { - BRIDGE_FAULT_GRANT, BRIDGE_PROTOCOL_VERSION, - BRIDGE_RPC_ENVELOPE_GRANT, + BRIDGE_SHELL_GRANTS, type BridgeColorScheme, type BridgeConnectionSnapshot, type BridgeHostMessage, @@ -27,8 +26,7 @@ import type { HostStatusReply } from '../../transport/hosts/host-status-reply-sc // Grant the intersection of implemented capabilities and route declarations, plus protocol fault. Use the same resolved list for init and enforcement; new names need no version bump. export const BRIDGE_NATIVE_GRANTS: readonly string[] = [ - BRIDGE_FAULT_GRANT, - BRIDGE_RPC_ENVELOPE_GRANT, + ...BRIDGE_SHELL_GRANTS, ...MOBILE_WEB_SHELL_GRANTS ] diff --git a/mobile/src/mobile-web-shell/bridge/bridge-native-verbs.ts b/mobile/src/mobile-web-shell/bridge/bridge-native-verbs.ts index ef1f628473e..7dfff72f157 100644 --- a/mobile/src/mobile-web-shell/bridge/bridge-native-verbs.ts +++ b/mobile/src/mobile-web-shell/bridge/bridge-native-verbs.ts @@ -41,7 +41,8 @@ export const BRIDGE_NATIVE_VERB_NAMES = [ 'native.pdf.view', 'native.image.act', BRIDGE_SPEECH_VERB, - BRIDGE_STORE_VERB + BRIDGE_STORE_VERB, + 'native.a11y.announce' ] as const export type BridgeNativeVerb = (typeof BRIDGE_NATIVE_VERB_NAMES)[number] @@ -93,6 +94,11 @@ export type BridgePdfOpenParams = Omit< 'action' > +// The page has no announce call of its own (RNW's is a no-op); the shell speaks for it. Long text is a page bug, so it is refused. +export const a11yAnnounceParamsSchema = z.strictObject({ message: z.string().min(1).max(500) }) +// announced:false when the shell leaves it to the page's live region (Android, where TalkBack reads it). +export const a11yAnnounceResultSchema = z.strictObject({ announced: z.boolean() }) + export const BRIDGE_NATIVE_VERBS: Readonly> = { 'native.clipboard.write': { params: clipboardWriteParamsSchema, @@ -150,6 +156,10 @@ export const BRIDGE_NATIVE_VERBS: Readonly, 'rpc'> & { rpc?: FakeRpcClient } = {} -): BridgePortPair { - return createBridgePortPair({ ...options, rpc: options.rpc ?? createFakeRpcClient() }) -} - -// Attempt each already-owned teardown phase even when an earlier original close throws. -export async function disposeBridgePortPair( - pair: Pick, 'client' | 'host' | 'flush'> -): Promise { - const errors: unknown[] = [] - // Async wrappers turn a synchronous close/dispose throw into a rejection the same catch records. - for (const cleanup of [ - async () => pair.client.close(), - async () => pair.host.dispose(), - () => pair.flush() - ]) { - try { - await cleanup() - } catch (error) { - errors.push(error) - } - } - if (errors.length === 1) { - throw errors[0] - } - if (errors.length) { - throw new AggregateError(errors, 'Bridge pair teardown failed') - } -} diff --git a/mobile/src/mobile-web-shell/bridge/bridge-port-pair-test-harness.ts b/mobile/src/mobile-web-shell/bridge/bridge-port-pair-test-harness.ts index c9746cb644a..fd2e268af53 100644 --- a/mobile/src/mobile-web-shell/bridge/bridge-port-pair-test-harness.ts +++ b/mobile/src/mobile-web-shell/bridge/bridge-port-pair-test-harness.ts @@ -1,4 +1,5 @@ import type { RpcClient } from '../../transport/rpc/rpc-client-contract' +import { createFakeRpcClient, type FakeRpcClient } from '../bridge-host-test-fakes' import { createBridgeHost, type BridgeHostDiagnostic } from '../bridge-host' import type { BridgeNavigateBackOutcome } from '../bridge-host-contract' import { BRIDGE_MAX_PENDING_REQUESTS } from './bridge-caps' @@ -23,7 +24,6 @@ export type { BridgePortObservation } from './bridge-port-pair-contract' import { createLane, readAll, defaultVerbAnswer, neutralObservation } from './bridge-port-lane' -export { createFakeBridgePortPair, disposeBridgePortPair } from './bridge-port-pair-lifecycle' export const PORT_PAIR_CLIENT_IDENTITY = 'device-token-a' @@ -217,3 +217,34 @@ export async function fillFreeDesktopSlots(pair: BridgePortPair): Promise, 'rpc'> & { rpc?: FakeRpcClient } = {} +): BridgePortPair { + return createBridgePortPair({ ...options, rpc: options.rpc ?? createFakeRpcClient() }) +} + +// Attempt each already-owned teardown phase even when an earlier original close throws. +export async function disposeBridgePortPair( + pair: Pick, 'client' | 'host' | 'flush'> +): Promise { + const errors: unknown[] = [] + // Async wrappers turn a synchronous close/dispose throw into a rejection the same catch records. + for (const cleanup of [ + async () => pair.client.close(), + async () => pair.host.dispose(), + () => pair.flush() + ]) { + try { + await cleanup() + } catch (error) { + errors.push(error) + } + } + if (errors.length === 1) { + throw errors[0] + } + if (errors.length) { + throw new AggregateError(errors, 'Bridge pair teardown failed') + } +} diff --git a/mobile/src/mobile-web-shell/bridge/use-native-verbs.ts b/mobile/src/mobile-web-shell/bridge/use-native-verbs.ts index f9f0cc9e62e..1c771635517 100644 --- a/mobile/src/mobile-web-shell/bridge/use-native-verbs.ts +++ b/mobile/src/mobile-web-shell/bridge/use-native-verbs.ts @@ -18,6 +18,7 @@ import { } from './bridge-audio-verbs' import { clipboardReadResultSchema, + a11yAnnounceResultSchema, clipboardWriteResultSchema, pdfViewResultSchema, type BridgeClipboardMime, @@ -70,6 +71,10 @@ export type NativeVerbs = { speechRead: () => Promise speechFinish: () => Promise speechCancel: () => Promise + // Older shells lack it; the page then keeps its live region, which VoiceOver may not read. + canAnnounce: boolean + // True when the shell spoke it. + announce: (message: string) => Promise } // Expose stable reason codes, including local ungranted and frame refusals. Unknown newer-shell codes floor to unreported so caller switches remain exhaustive. @@ -204,7 +209,10 @@ export function useNativeVerbs(): NativeVerbs { speechFinish: () => call(BRIDGE_SPEECH_VERB, { action: 'finish' }, speechFinishResultSchema), speechCancel: async () => { await call(BRIDGE_SPEECH_VERB, { action: 'cancel' }, speechCancelResultSchema) - } + }, + canAnnounce: has('native.a11y.announce'), + announce: async (message) => + (await call('native.a11y.announce', { message }, a11yAnnounceResultSchema)).announced } }, [client]) } diff --git a/mobile/src/mobile-web-shell/generation-file-system-fake.ts b/mobile/src/mobile-web-shell/generation-file-system-fake.ts index f26861173cc..2659276f2d2 100644 --- a/mobile/src/mobile-web-shell/generation-file-system-fake.ts +++ b/mobile/src/mobile-web-shell/generation-file-system-fake.ts @@ -27,7 +27,8 @@ export function createFakeGenerationFileSystem(): FakeGenerationFileSystem { const parentOf = (target: string): string => target.slice(0, target.lastIndexOf('/')) const makeDirectory = (target: string): void => { - for (let at = target; at.startsWith(ROOT); at = parentOf(at)) { + // Any file:// tree, so a store can also be handed an older root on the same disk. + for (let at = target; at.startsWith('file:///'); at = parentOf(at)) { nodes.set(at, { kind: 'directory' }) } } @@ -45,7 +46,7 @@ export function createFakeGenerationFileSystem(): FakeGenerationFileSystem { writes, paths: () => [...nodes.keys()] - .filter((key) => key !== ROOT) + .filter((key) => key.startsWith(`${ROOT}/`)) .map((key) => key.slice(ROOT.length + 1)) .sort(), seed: (path, node) => { diff --git a/mobile/src/mobile-web-shell/generation-legacy-root.ts b/mobile/src/mobile-web-shell/generation-legacy-root.ts new file mode 100644 index 00000000000..a254e90933f --- /dev/null +++ b/mobile/src/mobile-web-shell/generation-legacy-root.ts @@ -0,0 +1,27 @@ +import { joinUri } from './generation-cache-uri' +import type { GenerationFileSystem } from './generation-store-file-system' + +// One pass, then the old root goes: an entry that fails to move costs one download, and nothing old can return +// after a later delete or cap. An entry already here wins over its old copy. +export async function adoptLegacyRoot( + fs: GenerationFileSystem, + legacyRootUri: string +): Promise { + const legacy = await fs.list(legacyRootUri) + if (legacy.length === 0) { + return + } + await fs.createDirectory(fs.rootUri) + const present = new Set((await fs.list(fs.rootUri)).map((entry) => entry.name)) + for (const entry of legacy) { + if (present.has(entry.name)) { + continue + } + const from = joinUri(legacyRootUri, entry.name) + const to = joinUri(fs.rootUri, entry.name) + await (entry.isDirectory ? fs.moveDirectory(from, to) : fs.moveFile(from, to)).catch( + () => undefined + ) + } + await fs.delete(legacyRootUri) +} diff --git a/mobile/src/mobile-web-shell/generation-manifest-read.ts b/mobile/src/mobile-web-shell/generation-manifest-read.ts index 875cf4966d5..71c6ee09e18 100644 --- a/mobile/src/mobile-web-shell/generation-manifest-read.ts +++ b/mobile/src/mobile-web-shell/generation-manifest-read.ts @@ -1,5 +1,6 @@ import { MobileWebBundleManifestReadSchema, + shellDownloadedAssets, type MobileWebBundleManifestRead } from '../transport/web-bundle/mobile-web-bundle-reply-schemas' import { MANIFEST_FILE_NAME } from './generation-asset-path' @@ -33,12 +34,13 @@ export async function readWaitingStage( } // Deletes are not atomic, so a kill mid-delete can leave the manifest without its assets; only every byte counts as whole. const sizes = new Map() - for (const folder of new Set(manifest.assets.map((asset) => parentOf(asset.path)))) { + const assets = shellDownloadedAssets(manifest) + for (const folder of new Set(assets.map((asset) => parentOf(asset.path)))) { for (const file of await fs.listFiles(folder === '' ? directory : joinUri(directory, folder))) { sizes.set(folder === '' ? file.name : `${folder}/${file.name}`, file.size) } } - const whole = manifest.assets.every((asset) => sizes.get(asset.path) === asset.byteLength) + const whole = assets.every((asset) => sizes.get(asset.path) === asset.byteLength) return whole ? { hostKey, buildId, directory, manifest } : null } diff --git a/mobile/src/mobile-web-shell/generation-staging-assets.ts b/mobile/src/mobile-web-shell/generation-staging-assets.ts index ded1033d931..cd61866c2b4 100644 --- a/mobile/src/mobile-web-shell/generation-staging-assets.ts +++ b/mobile/src/mobile-web-shell/generation-staging-assets.ts @@ -1,10 +1,11 @@ import type { MobileWebBundleFetchResult } from '../transport/web-bundle/mobile-web-bundle-fetch' +import { shellDownloadedAssets } from '../transport/web-bundle/mobile-web-bundle-reply-schemas' import { requireStorablePath } from './generation-asset-path' import { joinUri } from './generation-cache-uri' export function stagingAssetsOf(directory: string, result: MobileWebBundleFetchResult) { const reused = new Set(result.reused) - return result.manifest.assets.map((asset) => ({ + return shellDownloadedAssets(result.manifest).map((asset) => ({ asset, uri: joinUri(directory, requireStorablePath(asset.path)), bytes: reused.has(asset.path) ? null : requireExactBytes(result.assets.get(asset.path), asset) diff --git a/mobile/src/mobile-web-shell/generation-store-file-system.ts b/mobile/src/mobile-web-shell/generation-store-file-system.ts index 44fec06c4a4..74189aeb408 100644 --- a/mobile/src/mobile-web-shell/generation-store-file-system.ts +++ b/mobile/src/mobile-web-shell/generation-store-file-system.ts @@ -1,6 +1,4 @@ -import { Directory, File, Paths } from 'expo-file-system' - -export const MOBILE_WEB_CACHE_DIRECTORY_NAME = 'mobile-web' +import { Directory, File } from 'expo-file-system' export type GenerationDirectoryEntry = { readonly name: string @@ -53,9 +51,9 @@ export function generationDirectoryPath(uri: string): string { return decodeURIComponent(uri.slice(FILE_URI_PREFIX.length)) } -export function createExpoGenerationFileSystem(): GenerationFileSystem { +export function createExpoGenerationFileSystem(rootUri: string): GenerationFileSystem { return { - rootUri: new Directory(Paths.cache, MOBILE_WEB_CACHE_DIRECTORY_NAME).uri, + rootUri, async list(uri) { const directory = new Directory(uri) if (!directory.exists) { diff --git a/mobile/src/mobile-web-shell/generation-store.test.ts b/mobile/src/mobile-web-shell/generation-store.test.ts index e8bbca2a3f2..7b5ebd20edf 100644 --- a/mobile/src/mobile-web-shell/generation-store.test.ts +++ b/mobile/src/mobile-web-shell/generation-store.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { createGenerationStore, MAX_CACHED_HOSTS } from './generation-store' +import { createGenerationStore } from './generation-store' import { deriveHostCacheKey } from './host-cache-key' import type { MobileWebBundleFetchResult } from '../transport/web-bundle/mobile-web-bundle-fetch' import { computeMobileWebBundleId } from '../../../src/shared/mobile-web-bundle/manifest-contract' @@ -13,7 +13,7 @@ const HOST = deriveHostCacheKey('host-a') function buildResult(options: { buildId?: string - assets?: readonly { path: string; byteLength: number }[] + assets?: readonly { path: string; byteLength: number; kind?: string }[] bytes?: ReadonlyMap }): MobileWebBundleFetchResult { const listed = options.assets ?? [ @@ -24,7 +24,8 @@ function buildResult(options: { path: asset.path, sha256: String(index).repeat(64).slice(0, 64), byteLength: asset.byteLength, - contentType: 'text/html; charset=utf-8' + contentType: 'text/html; charset=utf-8', + ...(asset.kind === undefined ? {} : { kind: asset.kind }) })) const totalBytes = assets.reduce((sum, asset) => sum + asset.byteLength, 0) return { @@ -59,332 +60,6 @@ async function activate( await store.commitGeneration(await store.stageGeneration(hostKey, result)) } -function hostKeys(count: number): string[] { - return Array.from({ length: count }, (_, index) => deriveHostCacheKey(`host-${index}`)) -} - -describe('generation store', () => { - it('refuses an asset that is missing or the wrong length, leaving no generation', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - const missing = buildResult({ bytes: new Map([['index.html', new Uint8Array(4)]]) }) - const short = buildResult({ - bytes: new Map([ - ['index.html', new Uint8Array(4)], - ['assets/app.js', new Uint8Array(1)] - ]) - }) - - await expect(store.stageGeneration(HOST, missing)).rejects.toThrow('assets/app.js is absent') - await expect(store.stageGeneration(HOST, short)).rejects.toThrow("not the manifest's 2") - expect(fs.paths()).toEqual([]) - expect(await store.readActiveGeneration(HOST)).toBeNull() - }) - - it('drops the staged tree when a write fails', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - fs.failWritesAt(`${HOST}/tmp/${BUILD}/assets/app.js`) - - await expect(store.stageGeneration(HOST, buildResult({}))).rejects.toThrow('disk-full') - - expect(fs.paths().some((path) => path.includes(`tmp/${BUILD}`))).toBe(false) - expect(await store.readActiveGeneration(HOST)).toBeNull() - }) - - it('leaves no generation and no tmp for any host when a download is interrupted', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - const other = deriveHostCacheKey('host-b') - // The manifest is written last, so a download cut off mid-stage leaves assets without one. - fs.seed(`${HOST}/tmp/${BUILD}/index.html`, { kind: 'file', bytes: new Uint8Array(4) }) - fs.seed(`${other}/tmp/${BUILD}/index.html`, { kind: 'file', bytes: new Uint8Array(4) }) - - expect(await store.readActiveGeneration(HOST)).toBeNull() - expect(await store.readActiveGeneration(other)).toBeNull() - expect(fs.paths().some((path) => path.includes('/tmp'))).toBe(false) - }) - - it('reads two generations as no activation and drops the host tree', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - await activate(store, HOST) - fs.seed(`${HOST}/generations/${'c'.repeat(64)}/manifest.json`, { - kind: 'file', - bytes: new TextEncoder().encode('{}') - }) - - expect(await store.readActiveGeneration(HOST)).toBeNull() - expect(fs.paths().some((path) => path.startsWith(HOST))).toBe(false) - }) - - it('reads an unparseable or mismatched manifest as no activation and drops the host tree', async () => { - for (const body of [ - 'not json', - JSON.stringify({ ...buildResult({}).manifest, buildId: 'd'.repeat(64) }) - ]) { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - await activate(store, HOST) - fs.seed(`${HOST}/generations/${BUILD}/manifest.json`, { - kind: 'file', - bytes: new TextEncoder().encode(body) - }) - - expect(await store.readActiveGeneration(HOST)).toBeNull() - expect(fs.paths().some((path) => path.startsWith(HOST))).toBe(false) - } - }) - - it('evicts the least recently activated host past the ceiling', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - const hosts = hostKeys(MAX_CACHED_HOSTS + 1) - - for (const host of hosts) { - await activate(store, host) - } - - expect(await store.readActiveGeneration(hosts[0])).toBeNull() - expect(fs.paths().some((path) => path.startsWith(hosts[0]))).toBe(false) - for (const host of hosts.slice(1)) { - expect((await store.readActiveGeneration(host))?.buildId).toBe(BUILD) - } - expect(fs.text('hosts.json')).toBe(JSON.stringify(hosts.slice(1))) - }) - - it('evicts a host with no index entry before the least recently activated one', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - const [oldest, ...rest] = hostKeys(MAX_CACHED_HOSTS - 1) - const orphan = deriveHostCacheKey('orphan') - for (const host of [oldest, ...rest]) { - await activate(store, host) - } - await activate(store, orphan) - const order = [oldest, ...rest] - fs.seed('hosts.json', { kind: 'file', bytes: new TextEncoder().encode(JSON.stringify(order)) }) - - await activate(store, deriveHostCacheKey('one-too-many')) - - expect(fs.paths().some((path) => path.startsWith(orphan))).toBe(false) - expect((await store.readActiveGeneration(oldest))?.buildId).toBe(BUILD) - }) - - it('never counts or evicts a host that is only mid-download', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - const hosts = hostKeys(MAX_CACHED_HOSTS) - const oldest = hosts[0] - const downloading = deriveHostCacheKey('downloading') - for (const host of hosts) { - await activate(store, host) - } - const staged = await store.stageGeneration(downloading, buildResult({})) - - await activate(store, deriveHostCacheKey('one-too-many')) - - // Count activations only; eviction must leave staged downloads intact. - expect(fs.paths().some((path) => path.startsWith(oldest))).toBe(false) - expect(fs.text(`${staged.directory.slice(ROOT.length + 1)}/manifest.json`)).not.toBeNull() - await store.commitGeneration(staged) - expect((await store.readActiveGeneration(downloading))?.buildId).toBe(BUILD) - }) - - it('serializes two stage calls for one host and build', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - // Give one build id conflicting asset lists to expose interleaved writes into the same staging directory. - const staging = `${HOST}/tmp/${BUILD}` - const earlier = buildResult({ - buildId: BUILD, - assets: [{ path: 'assets/earlier.js', byteLength: 2 }] - }) - const later = buildResult({ - buildId: BUILD, - assets: [{ path: 'assets/later.js', byteLength: 3 }] - }) - - const [first, second] = await Promise.all([ - store.stageGeneration(HOST, earlier), - store.stageGeneration(HOST, later) - ]) - - expect(first.directory).toBe(second.directory) - expect(fs.writes).toEqual([ - `${staging}/assets/earlier.js`, - `${staging}/manifest.json`, - `${staging}/assets/later.js`, - `${staging}/manifest.json` - ]) - expect(fs.paths().filter((path) => path.startsWith(`${staging}/assets/`))).toEqual([ - `${staging}/assets/later.js` - ]) - }) - - it('refuses a path that escapes the staged tree, and a host key that is not one', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - const escapes = [ - '../outside.js', - 'assets/../../outside.js', - '/etc/passwd', - 'assets//app.js', - 'manifest.json', - 'Manifest.JSON' - ] - - for (const path of escapes) { - const result = buildResult({ assets: [{ path, byteLength: 1 }] }) - await expect(store.stageGeneration(HOST, result)).rejects.toThrow('refuses to stage') - } - await expect(store.stageGeneration('host-a', buildResult({}))).rejects.toThrow( - 'not a host cache key' - ) - expect(fs.paths()).toEqual([]) - }) - - it('refuses a rename that did not carry the tree, as Android below API 26 can', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - fs.loseContentsOnMove() - - const staged = await store.stageGeneration(HOST, buildResult({})) - await expect(store.commitGeneration(staged)).rejects.toThrow('did not carry its manifest') - - expect(await store.readActiveGeneration(HOST)).toBeNull() - expect(fs.paths().some((path) => path.includes('generations/'))).toBe(false) - }) - - it('keeps the host tree when the manifest read fails, and drops it when it is missing', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - const manifest = `${HOST}/generations/${BUILD}/manifest.json` - await activate(store, HOST) - const before = fs.paths().filter((path) => !path.endsWith('/tmp')) - - fs.failReadsAt(manifest) - expect(await store.readActiveGeneration(HOST)).toBeNull() - expect(fs.paths()).toEqual(before) - - fs.failReadsAt(null) - await fs.delete(`${ROOT}/${manifest}`) - expect(await store.readActiveGeneration(HOST)).toBeNull() - expect(fs.paths().some((path) => path.startsWith(HOST))).toBe(false) - }) - - it('replaces an entry named for the build id that is not a readable generation', async () => { - const build = BUILD - // Model a crash between rename and the post-rename manifest check. - for (const seeded of [ - { kind: 'directory' }, - { kind: 'file', bytes: new Uint8Array(1) } - ] as const) { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - fs.seed(`${HOST}/generations/${build}`, seeded) - - await activate(store, HOST) - - expect((await store.readActiveGeneration(HOST))?.buildId).toBe(build) - expect(fs.text(`${HOST}/generations/${build}/index.html`)).not.toBeNull() - } - }) - - it('refuses a handle whose staged tree is gone without touching the activation', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - await activate(store, HOST) - - const staged = await store.stageGeneration(HOST, buildResult(SECOND)) - await store.abortStagedGeneration(staged) - - await expect(store.commitGeneration(staged)).rejects.toThrow('no longer on disk') - expect((await store.readActiveGeneration(HOST))?.buildId).toBe(BUILD) - }) - - it('refuses a staged handle it did not issue', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - await activate(store, HOST) - const before = fs.paths() - const forged = { - hostKey: HOST, - buildId: SECOND_BUILD, - directory: `${ROOT}/${HOST}/generations/${BUILD}`, - manifest: buildResult({}).manifest - } - - await expect(store.commitGeneration(forged)).rejects.toThrow('did not issue') - await expect(store.abortStagedGeneration(forged)).rejects.toThrow('did not issue') - expect(fs.paths()).toEqual(before) - expect((await store.readActiveGeneration(HOST))?.buildId).toBe(BUILD) - }) -}) - -describe('reusable assets for the next download', () => { - const NEXT = buildResult({ - assets: [ - { path: 'index.html', byteLength: 8 }, - { path: 'assets/app-2.js', byteLength: 2 } - ] - }) - const NEXT_BUILD = NEXT.manifest.buildId - const [PAGE, SCRIPT] = NEXT.manifest.assets - const DOWNLOADED = new Map([['index.html', new Uint8Array(8).fill(9)]]) - const LEFT_TO_STAGE = { ...NEXT, assets: DOWNLOADED, reused: ['assets/app-2.js'] } - - it.each([HOST, deriveHostCacheKey('second-host')])( - 'matches cached assets by content for %s', - async (opened) => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - expect((await store.openReusableAssets(HOST)).has(SCRIPT!)).toBe(false) - await activate(store, HOST) - - const reusable = await store.openReusableAssets(opened) - - expect(reusable.has(SCRIPT!)).toBe(true) - expect(reusable.has(PAGE!)).toBe(false) - expect(reusable.has({ ...SCRIPT!, sha256: 'f'.repeat(64) })).toBe(false) - expect(await reusable.check(SCRIPT!)).toBe(true) - fs.seed(`${HOST}/generations/${BUILD}/assets/app.js`, { - kind: 'file', - bytes: new Uint8Array(1) - }) - expect(await reusable.check(SCRIPT!)).toBe(false) - } - ) - - it('copies the reused assets beside the downloaded ones and commits the whole build', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - await activate(store, HOST) - - await activate(store, HOST, LEFT_TO_STAGE) - - const generation = `${HOST}/generations/${NEXT_BUILD}` - expect(fs.bytes(`${generation}/index.html`)).toEqual(new Uint8Array(8).fill(9)) - expect(fs.bytes(`${generation}/assets/app-2.js`)).toEqual(new Uint8Array(2).fill(7)) - expect((await store.readActiveGeneration(HOST))?.buildId).toBe(NEXT_BUILD) - }) - - it('refuses to stage a reused asset the active generation no longer holds', async () => { - const fs = createFakeFileSystem() - const store = createGenerationStore({ fileSystem: fs }) - await activate(store, HOST) - fs.failReadsAt(`${HOST}/generations/${BUILD}/assets/app.js`) - - await expect(store.stageGeneration(HOST, LEFT_TO_STAGE)).rejects.toThrow('unreadable') - await store.deleteHostCache(HOST) - fs.failReadsAt(null) - await expect(store.stageGeneration(HOST, LEFT_TO_STAGE)).rejects.toThrow( - 'no longer holds the reused asset assets/app-2.js' - ) - expect(fs.paths().some((path) => path.includes(`tmp/${NEXT_BUILD}`))).toBe(false) - }) -}) - // Commit deletes the old build first, so it must not run under a page still loading that build's chunks. describe('an update staged behind a live page', () => { it('stays staged while a page reads the old build, and the next read after it commits', async () => { @@ -402,44 +77,24 @@ describe('an update staged behind a live page', () => { expect(await fs.fileExists(`${ROOT}/${HOST}/generations/${BUILD}/index.html`)).toBe(false) }) - it('lets a page that waited on another page fetch the build itself when that page gives up', async () => { - const store = createGenerationStore({ fileSystem: createFakeFileSystem() }) - const first = await store.claimUpdate(HOST, SECOND_BUILD) - const second = store.claimUpdate(HOST, SECOND_BUILD) - - first?.() - - expect(await second).not.toBeNull() - }) - - it('commits at the next launch when the app ends while the page still reads the old build', async () => { + it('stages a build without its language-catalog chunks and still commits it at the next launch', async () => { const fs = createFakeFileSystem() const first = createGenerationStore({ fileSystem: fs }) await activate(first, HOST) first.holdGeneration(HOST) - first.deferCommit(await first.stageGeneration(HOST, buildResult(SECOND))) + const withCatalog = buildResult({ + assets: [ + { path: 'index.html', byteLength: 8 }, + { path: 'assets/de.js', byteLength: 3, kind: 'catalog' } + ], + bytes: new Map([['index.html', new Uint8Array(8)]]) + }) + first.deferCommit(await first.stageGeneration(HOST, withCatalog)) const relaunched = createGenerationStore({ fileSystem: fs }) - expect((await relaunched.readActiveGeneration(HOST))?.buildId).toBe(SECOND_BUILD) - expect(await fs.fileExists(`${ROOT}/${HOST}/generations/${SECOND_BUILD}/index.html`)).toBe(true) - }) - - it('lets a reader of a host’s build go before a commit or a removal deletes it', async () => { - const fs = createFakeFileSystem() - const onDisk: boolean[] = [] - let reading = BUILD - const store = createGenerationStore({ - fileSystem: fs, - beforeHostFilesDeleted: async (hostKey) => { - onDisk.push(await fs.fileExists(`${ROOT}/${hostKey}/generations/${reading}/manifest.json`)) - } - }) - await activate(store, HOST) - onDisk.length = 0 - await activate(store, HOST, buildResult(SECOND)) - reading = SECOND_BUILD - await store.deleteHostCache(HOST) - expect(onDisk).toEqual([true, true]) + const build = withCatalog.manifest.buildId + expect((await relaunched.readActiveGeneration(HOST))?.buildId).toBe(build) + expect(await fs.fileExists(`${ROOT}/${HOST}/generations/${build}/assets/de.js`)).toBe(false) }) }) diff --git a/mobile/src/mobile-web-shell/generation-store.ts b/mobile/src/mobile-web-shell/generation-store.ts index 67da4168d49..0e78ad2a2d6 100644 --- a/mobile/src/mobile-web-shell/generation-store.ts +++ b/mobile/src/mobile-web-shell/generation-store.ts @@ -6,6 +6,7 @@ import type { import { joinUri } from './generation-cache-uri' import { createGenerationHostOrder, withHostLast } from './generation-host-order' import { createDeferredCommits } from './generation-deferred-commits' +import { adoptLegacyRoot } from './generation-legacy-root' import { MANIFEST_FILE_NAME } from './generation-asset-path' import { parseGenerationManifest, readWaitingStage } from './generation-manifest-read' import { reusableAssetsOf, reusableAssetsOfHosts } from './generation-reuse' @@ -72,6 +73,8 @@ export function createGenerationStore(options: { fileSystem: GenerationFileSystem // Runs before a host's built files are deleted, so nothing still reading them outlives them. beforeHostFilesDeleted?: (hostKey: string) => Promise + // An older root whose contents move here before any other work, so changing roots costs no download. + legacyRootUri?: string }): GenerationStore { const fs = options.fileSystem const hostOrder = createGenerationHostOrder(fs) @@ -308,7 +311,10 @@ export function createGenerationStore(options: { } // Serialize across the whole store to order stage/commit/sweep/delete and keep same-build staging writes contiguous. - let tail: Promise = Promise.resolve() + let tail: Promise = + options.legacyRootUri === undefined + ? Promise.resolve() + : adoptLegacyRoot(fs, options.legacyRootUri).catch(() => undefined) function serialize(operation: () => Promise): Promise { const run = tail.then(operation, operation) tail = run.catch(() => undefined) diff --git a/mobile/src/mobile-web-shell/host-area-page-storage.test.tsx b/mobile/src/mobile-web-shell/host-area-page-storage.test.tsx index 1d12bae7036..fe9a34b9777 100644 --- a/mobile/src/mobile-web-shell/host-area-page-storage.test.tsx +++ b/mobile/src/mobile-web-shell/host-area-page-storage.test.tsx @@ -26,7 +26,7 @@ vi.mock('@react-native-async-storage/async-storage', () => ({ ) } })) -vi.mock('../transport/hosts/host-store', () => ({ +vi.mock('../host-catalog/host-store', () => ({ loadHosts: async () => [{ id: 'host-a', name: 'Host', endpoint: 'ws://h', lastConnected: 1 }] })) diff --git a/mobile/src/mobile-web-shell/mobile-web-shell-session-contract.ts b/mobile/src/mobile-web-shell/mobile-web-shell-session-contract.ts index 1a6f608e8c2..656adbf6b78 100644 --- a/mobile/src/mobile-web-shell/mobile-web-shell-session-contract.ts +++ b/mobile/src/mobile-web-shell/mobile-web-shell-session-contract.ts @@ -25,6 +25,7 @@ export type MobileWebShellGates = { export type MobileWebShellManifestFacts = MobileWebBundleCompatManifest & { readonly buildId: string + // A download with nothing to reuse, in fetch progress's unit (each brotli copy where read, else asset bytes). readonly totalBytes: number readonly totalAssets: number // Older desktops omit routes and serve none. diff --git a/mobile/src/mobile-web-shell/mobile-web-shell-session-effects.ts b/mobile/src/mobile-web-shell/mobile-web-shell-session-effects.ts index c5995d21023..a8d939a15d7 100644 --- a/mobile/src/mobile-web-shell/mobile-web-shell-session-effects.ts +++ b/mobile/src/mobile-web-shell/mobile-web-shell-session-effects.ts @@ -1,8 +1,10 @@ import { fetchMobileWebBundle } from '../transport/web-bundle/mobile-web-bundle-fetch' +import { mobileWebBundleStreamBytes } from '../transport/web-bundle/mobile-web-bundle-window-reader' import { mobileWebBundleManifestRead } from '../transport/web-bundle/mobile-web-bundle-operations' -import type { - MobileWebBundleManifestRead, - MobileWebBundleManifestReply +import { + shellDownloadedAssets, + type MobileWebBundleManifestRead, + type MobileWebBundleManifestReply } from '../transport/web-bundle/mobile-web-bundle-reply-schemas' import type { MobileWebBundleCompatManifest } from '../transport/web-bundle/mobile-web-bundle-compat' import { runRpcOperation } from '../transport/rpc/rpc-operation' @@ -87,8 +89,9 @@ export async function readManifest( manifest: { ...compatOf(manifest), buildId: manifest.buildId, - totalBytes: manifest.totalBytes, - totalAssets: manifest.assets.length, + // What this shell downloads: wire bytes, without the catalog chunks it skips. + totalBytes: mobileWebBundleStreamBytes(opened), + totalAssets: shellDownloadedAssets(manifest).length, routes: manifest.routes } }) diff --git a/mobile/src/mobile-web-shell/process-generation-store.ts b/mobile/src/mobile-web-shell/process-generation-store.ts index 1087603b3e0..144fe4bf4bc 100644 --- a/mobile/src/mobile-web-shell/process-generation-store.ts +++ b/mobile/src/mobile-web-shell/process-generation-store.ts @@ -1,15 +1,26 @@ +import { Directory, Paths } from 'expo-file-system' +import { generationStoreDirectory } from '../../modules/orca-mobile-web-shell/src/generation-store-directory' import { createGenerationStore, type GenerationStore } from './generation-store' import { createExpoGenerationFileSystem } from './generation-store-file-system' import { dropHomeSparePage } from './home-spare-page' +const GENERATION_STORE_DIRECTORY_NAME = 'mobile-web' + let processStore: GenerationStore | null = null // Share one store queue across native callers so host removal cannot interleave with generation/index/failure-log writes. export function processGenerationStore(): GenerationStore { - processStore ??= createGenerationStore({ - fileSystem: createExpoGenerationFileSystem(), - beforeHostFilesDeleted: dropHomeSparePage - }) + if (processStore === null) { + // Builds lived in the OS cache until storage pressure or "Clear cache" emptied it and forced a full download. + const cacheRoot = new Directory(Paths.cache, GENERATION_STORE_DIRECTORY_NAME).uri + // A binary from before the durable directory keeps the cache root. + const durableRoot = generationStoreDirectory(GENERATION_STORE_DIRECTORY_NAME) + processStore = createGenerationStore({ + fileSystem: createExpoGenerationFileSystem(durableRoot ?? cacheRoot), + beforeHostFilesDeleted: dropHomeSparePage, + ...(durableRoot === null ? {} : { legacyRootUri: cacheRoot }) + }) + } return processStore } diff --git a/mobile/src/mobile-web-shell/removed-host-shell-cache.test.ts b/mobile/src/mobile-web-shell/removed-host-shell-cache.test.ts deleted file mode 100644 index cc945efc055..00000000000 --- a/mobile/src/mobile-web-shell/removed-host-shell-cache.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' - -vi.mock('expo-file-system', () => ({ Directory: class {}, File: class {}, Paths: { cache: '' } })) -vi.mock('./generation-store-file-system', async () => { - const { createFakeGenerationFileSystem } = await import('./generation-file-system-fake') - const fileSystem = createFakeGenerationFileSystem() - return { createExpoGenerationFileSystem: () => fileSystem } -}) - -import { createGenerationStore } from './generation-store' -import { createExpoGenerationFileSystem } from './generation-store-file-system' -import { forgetHostUpdateFailures } from './removed-host-shell-cache' - -function store() { - return createGenerationStore({ fileSystem: createExpoGenerationFileSystem() }) -} - -async function seed(hostId: string): Promise { - await store().recordUpdateFailure({ - hostId, - at: 1, - reason: 'connection-lost', - hostCode: null, - offeredBuildId: null, - cachedBuildId: null, - outcome: 'opened-cached', - wall: null - }) -} - -describe('forgetHostUpdateFailures', () => { - beforeEach(async () => { - await store().forgetHostUpdateFailures('host-1') - await store().forgetHostUpdateFailures('host-2') - }) - - it("drops the removed host's records and keeps the rest", async () => { - await seed('host-1') - await seed('host-2') - await forgetHostUpdateFailures('host-1') - expect((await store().readUpdateFailures()).map((entry) => entry.hostId)).toEqual(['host-2']) - }) - - it('writes nothing when nothing was recorded', async () => { - const fileSystem = createExpoGenerationFileSystem() - expect(await fileSystem.readText(`${fileSystem.rootUri}/update-failures.json`)).toBeNull() - const write = vi.spyOn(fileSystem, 'writeText') - try { - await forgetHostUpdateFailures('host-1') - expect(write).not.toHaveBeenCalled() - expect(await fileSystem.readText(`${fileSystem.rootUri}/update-failures.json`)).toBeNull() - } finally { - write.mockRestore() - } - }) -}) diff --git a/mobile/src/mobile-web-shell/use-app-leaves-foreground.ts b/mobile/src/mobile-web-shell/use-app-leaves-foreground.ts index 41306009caa..2a439d8c3fc 100644 --- a/mobile/src/mobile-web-shell/use-app-leaves-foreground.ts +++ b/mobile/src/mobile-web-shell/use-app-leaves-foreground.ts @@ -1,5 +1,5 @@ import { useEffect, useLayoutEffect, useRef } from 'react' -import { AppState } from 'react-native' +import { AppState, Platform } from 'react-native' /** * Calls `onLeave` once each time the app leaves the foreground, before the system can kill it from the app @@ -29,13 +29,17 @@ export function useAppLeavesForeground(onLeave: () => void): void { const change = AppState.addEventListener('change', (next) => next === 'active' ? back() : leave() ) - // Window focus events come from Android only. - const blur = AppState.addEventListener('blur', leave) - const focus = AppState.addEventListener('focus', back) + // Window focus events come from Android only; iOS's RCTAppState rejects the subscription outright + // (a red screen in development), so it is never made there. + const windowFocus = + Platform.OS === 'android' + ? [AppState.addEventListener('blur', leave), AppState.addEventListener('focus', back)] + : [] return () => { change.remove() - blur.remove() - focus.remove() + for (const subscription of windowFocus) { + subscription.remove() + } } }, []) } diff --git a/mobile/src/mobile-web-shell/use-page-host-snapshot.test.tsx b/mobile/src/mobile-web-shell/use-page-host-snapshot.test.tsx index 98b98f51dfd..0d9b3956c08 100644 --- a/mobile/src/mobile-web-shell/use-page-host-snapshot.test.tsx +++ b/mobile/src/mobile-web-shell/use-page-host-snapshot.test.tsx @@ -46,7 +46,7 @@ vi.mock('@react-native-async-storage/async-storage', () => ({ getItem: async (key: string) => doubles.store.get(key) ?? null } })) -vi.mock('../transport/hosts/host-store', () => ({ +vi.mock('../host-catalog/host-store', () => ({ loadHosts: async () => { if (doubles.hostsReject) { throw new Error('the keychain would not answer') diff --git a/mobile/src/mobile-web-shell/use-page-host-snapshot.ts b/mobile/src/mobile-web-shell/use-page-host-snapshot.ts index bfba2b5ac7f..55a30b6e8bb 100644 --- a/mobile/src/mobile-web-shell/use-page-host-snapshot.ts +++ b/mobile/src/mobile-web-shell/use-page-host-snapshot.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, useRef, useState } from 'react' -import { loadHosts } from '../transport/hosts/host-store' +import { loadHosts } from '../host-catalog/host-store' import type { BridgeInitHost } from './bridge/bridge-envelope' import { hydrateMirroredStorage, diff --git a/mobile/src/new-workspace/NewWorkspaceHostPicker.tsx b/mobile/src/new-workspace/NewWorkspaceHostPicker.tsx index 4fdc22c2acf..b9d5cb446bf 100644 --- a/mobile/src/new-workspace/NewWorkspaceHostPicker.tsx +++ b/mobile/src/new-workspace/NewWorkspaceHostPicker.tsx @@ -3,9 +3,9 @@ import { useRouter } from 'expo-router' import { PickerModal } from '../components/PickerModal' import { useMobileTranslation } from '../i18n/use-mobile-translation' import { hostPickerOptions } from '../components/use-connected-host-picker' -import { selectConnectableHostProfiles } from '../transport/hosts/host-catalog-selection' -import { loadHostCatalog } from '../transport/hosts/host-store' -import type { HostProfile } from '../transport/hosts/host-profile' +import { selectConnectableHostProfiles } from '../host-catalog/host-catalog-selection' +import { loadHostCatalog } from '../host-catalog/host-store' +import type { HostProfile } from '../host-catalog/host-profile' // Keep picker and loading drawer in the overlay’s window so the load can start as selection leaves. export function NewWorkspaceHostPicker({ diff --git a/mobile/src/notifications/host-push-registration-state.ts b/mobile/src/notifications/host-push-registration-state.ts index bd7385d568b..30c739f318f 100644 --- a/mobile/src/notifications/host-push-registration-state.ts +++ b/mobile/src/notifications/host-push-registration-state.ts @@ -1,8 +1,8 @@ -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' export type HostPushState = { connection: { - client: RpcOperationSender | null + client: UnvalidatedRpcRequestPort | null support: ReturnType | null } // An unanswered probe is unknown, not unsupported. diff --git a/mobile/src/notifications/mobile-notifications.ts b/mobile/src/notifications/mobile-notifications.ts index a8bee3af321..1200887b82b 100644 --- a/mobile/src/notifications/mobile-notifications.ts +++ b/mobile/src/notifications/mobile-notifications.ts @@ -4,7 +4,7 @@ import type { DismissNotificationEvent } from './desktop-notification-events' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import { waitForPushFallback } from './push-fallback' import { getHostPushSupported, getHostPushSupportCompletion } from './push-registration' -import { loadHostCatalog } from '../transport/hosts/host-store' +import { loadHostCatalog } from '../host-catalog/host-store' import { deriveHostFingerprint } from './push-host-fingerprint' import { presentForegroundPush } from './android-foreground-push' import { diff --git a/mobile/src/notifications/mobile-push-registration-operations.ts b/mobile/src/notifications/mobile-push-registration-operations.ts index c9ff7f995e9..6c7f76ae8dd 100644 --- a/mobile/src/notifications/mobile-push-registration-operations.ts +++ b/mobile/src/notifications/mobile-push-registration-operations.ts @@ -1,3 +1,9 @@ +import type { + MobilePushFilter, + MobilePushRegisterInput +} from '../../../src/shared/mobile-push-contract' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' +import type { MobilePushToken } from './push-token' import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc/rpc-operation' import { rpcResultVariant } from '../transport/rpc/rpc-operation-result-reader' import { @@ -26,3 +32,36 @@ export const pushRouteUnregister = bindDeferredRpcOperation( read: rpcResultVariant('push-unregistered', notificationUnreadReplySchema) }) ) + +const REQUEST_TIMEOUT_MS = 5_000 + +export async function sendRegister( + client: UnvalidatedRpcRequestPort, + token: MobilePushToken, + filter: MobilePushFilter +): Promise { + const params: Omit = { + platform: token.platform, + token: token.token, + ...(token.apnsEnvironment ? { apnsEnvironment: token.apnsEnvironment } : {}), + filter + } + const reply = await pushRouteRegister + .request(client, params, { timeoutMs: REQUEST_TIMEOUT_MS, failWhenDisconnected: true }) + .catch(() => null) + const registration = reply && pushRouteRegister.interpret(reply) + if (!registration?.accepted) { + return false + } + return registration.value?.registered === true +} + +export async function sendUnregister( + client: UnvalidatedRpcRequestPort, + timeoutMs: number +): Promise { + const reply = await pushRouteUnregister + .request(client, null, { timeoutMs, failWhenDisconnected: true }) + .catch(() => null) + return reply !== null && pushRouteUnregister.interpret(reply).accepted +} diff --git a/mobile/src/notifications/notification-reply-schema.test.ts b/mobile/src/notifications/notification-reply-schema.test.ts deleted file mode 100644 index 78f4f1e6fc2..00000000000 --- a/mobile/src/notifications/notification-reply-schema.test.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { z } from 'zod' -import { - missedNotificationsSchema, - notificationUnreadReplySchema, - PUSH_REGISTER_REFUSAL_REASONS, - PUSH_TEST_REFUSAL_REASONS, - pushDeliveryTestResultSchema, - pushRouteRegistrationSchema -} from './notification-reply-schema' - -function reads(schema: z.ZodType, value: unknown): T { - const parsed = schema.safeParse(value) - if (!parsed.success) { - throw new Error(`expected a readable reply: ${parsed.error.message}`) - } - return parsed.data -} - -function refuses(schema: z.ZodType, value: unknown): boolean { - return !schema.safeParse(value).success -} - -describe('notification replies tolerate the shapes their call sites guard', () => { - it('reads a test-push reply the screen reaches through optional chaining', () => { - expect(reads(pushDeliveryTestResultSchema, { accepted: true })?.accepted).toBe(true) - expect(reads(pushDeliveryTestResultSchema, null)).toBe(null) - expect(reads(pushDeliveryTestResultSchema, undefined)).toBe(undefined) - expect(reads(pushDeliveryTestResultSchema, { error: 'refused' })?.accepted).toBe(undefined) - }) - - // Schema refusal would replace the screen’s generic send-failure copy with a parser error. - it('reads a non-object test-push result as absent, which takes the generic copy', () => { - for (const value of ['garbage', 7, true, []]) { - expect(refuses(pushDeliveryTestResultSchema, value)).toBe(false) - const result = reads(pushDeliveryTestResultSchema, value) - expect(result?.accepted).toBe(undefined) - expect(result?.reason).toBe(undefined) - } - }) - - it('reads a registration reply the reconciler reaches through optional chaining', () => { - expect(reads(pushRouteRegistrationSchema, { registered: true })?.registered).toBe(true) - expect(reads(pushRouteRegistrationSchema, null)).toBe(null) - expect(reads(pushRouteRegistrationSchema, { registered: 'yes' })?.registered).toBe(undefined) - }) - - it('takes every reply at the two sites whose body nothing reads', () => { - expect(refuses(notificationUnreadReplySchema, undefined)).toBe(false) - expect(refuses(notificationUnreadReplySchema, null)).toBe(false) - expect(refuses(notificationUnreadReplySchema, 'anything')).toBe(false) - }) -}) - -describe('closed enums degrade to the copy main showed', () => { - it('keeps a reason the screen branches on and drops one it does not know', () => { - expect( - reads(pushDeliveryTestResultSchema, { accepted: false, reason: 'rate_limited' })?.reason - ).toBe('rate_limited') - expect( - reads(pushDeliveryTestResultSchema, { accepted: false, reason: 'not_registered' })?.reason - ).toBe('not_registered') - expect(reads(pushDeliveryTestResultSchema, { accepted: false, reason: 'quota' })?.reason).toBe( - undefined - ) - }) - - it('keeps a registration reason and drops an unknown one', () => { - const reply = { registered: false, reason: 'throttled' } - expect(reads(pushRouteRegistrationSchema, reply)?.reason).toBe('throttled') - expect( - reads(pushRouteRegistrationSchema, { registered: false, reason: 'moon-phase' })?.reason - ).toBe(undefined) - }) - - // Host-pinned unions cover every arm; these loops prove each survives parsing. - it('keeps every refusal reason the host declares for either route', () => { - for (const reason of PUSH_TEST_REFUSAL_REASONS) { - expect(reads(pushDeliveryTestResultSchema, { accepted: false, reason })?.reason).toBe(reason) - } - for (const reason of PUSH_REGISTER_REFUSAL_REASONS) { - expect(reads(pushRouteRegistrationSchema, { registered: false, reason })?.reason).toBe(reason) - } - }) -}) - -describe('dismissal rows stay opaque', () => { - it('keeps every row for readPushNotificationIdentity to judge', () => { - const rows = [{ notificationId: 'n-1' }, 'not-a-row', 7] - expect(reads(missedNotificationsSchema, { dismissedPushes: rows })?.dismissedPushes).toEqual( - rows - ) - }) - - it('drops a dismissedPushes that is not an array, as Array.isArray did', () => { - expect(reads(missedNotificationsSchema, { dismissedPushes: 'all' })?.dismissedPushes).toBe( - undefined - ) - expect(reads(missedNotificationsSchema, null)).toBe(null) - }) -}) diff --git a/mobile/src/notifications/notification-routing.ts b/mobile/src/notifications/notification-routing.ts index 51a81548b0a..a083798e327 100644 --- a/mobile/src/notifications/notification-routing.ts +++ b/mobile/src/notifications/notification-routing.ts @@ -1,7 +1,7 @@ import { parseExecutionHostId } from '../../../src/shared/execution-host' import type { HostStackRouteTarget } from '../navigation/host-stack-navigation' import { mobileSessionRouteTarget } from '../session/mobile-session-route' -import type { HostCredentialStatus } from '../transport/hosts/host-profile' +import type { HostCredentialStatus } from '../host-catalog/host-profile' export type NotificationNavigationOptions = { knownHostIds?: ReadonlySet diff --git a/mobile/src/notifications/push-dismissal-reconciliation.ts b/mobile/src/notifications/push-dismissal-reconciliation.ts index 6f5c0a5457a..5a77d259d17 100644 --- a/mobile/src/notifications/push-dismissal-reconciliation.ts +++ b/mobile/src/notifications/push-dismissal-reconciliation.ts @@ -1,6 +1,6 @@ import * as Notifications from 'expo-notifications' import { pushMissedSinceRead, type MobilePushDismissalRpcSender } from './push-dismissal-operations' -import { loadHostCatalog } from '../transport/hosts/host-store' +import { loadHostCatalog } from '../host-catalog/host-store' import { resolveHostIdForFingerprint } from './push-host-fingerprint' import { readNativeNotificationData } from './native-notification-data' import { readOrcaPushPayload, type OrcaPushPayload } from './push-payload' diff --git a/mobile/src/notifications/push-receive.test.ts b/mobile/src/notifications/push-receive.test.ts index 9c1b8832c9c..e7d93268bb5 100644 --- a/mobile/src/notifications/push-receive.test.ts +++ b/mobile/src/notifications/push-receive.test.ts @@ -4,8 +4,8 @@ import { setNotificationViewingWorkspace } from './notification-viewing-policy' vi.mock('./push-tray-dismissal', () => ({ dismissPresentedPushNotification: vi.fn() })) import { beforeEach, describe, expect, it, vi } from 'vitest' import { sha256 } from '@noble/hashes/sha256' -import { loadHostCatalog } from '../transport/hosts/host-store' -import type { HostCatalogEntry } from '../transport/hosts/host-profile' +import { loadHostCatalog } from '../host-catalog/host-store' +import type { HostCatalogEntry } from '../host-catalog/host-profile' import { foregroundNotificationBehavior, @@ -19,7 +19,7 @@ async function shouldSuppressForegroundPush(data: unknown): Promise { } vi.mock('react-native', () => ({ AppState: { currentState: 'background' } })) -vi.mock('../transport/hosts/host-store', () => ({ loadHostCatalog: vi.fn() })) +vi.mock('../host-catalog/host-store', () => ({ loadHostCatalog: vi.fn() })) const storage = vi.hoisted(() => new Map()) vi.mock('@react-native-async-storage/async-storage', () => ({ default: { diff --git a/mobile/src/notifications/push-receive.ts b/mobile/src/notifications/push-receive.ts index 44a64e05e09..15d07022d14 100644 --- a/mobile/src/notifications/push-receive.ts +++ b/mobile/src/notifications/push-receive.ts @@ -2,7 +2,7 @@ import { wasPushDismissed } from './push-dismissal-watermarks' import { dismissPresentedPushNotification } from './push-tray-dismissal' import { shouldSuppressNotificationWhileViewing } from './notification-viewing-policy' import { loadPushNotificationsEnabled } from '../storage/preferences' -import { loadHostCatalog } from '../transport/hosts/host-store' +import { loadHostCatalog } from '../host-catalog/host-store' import { resolveHostIdForFingerprint } from './push-host-fingerprint' import { readOrcaPushPayload, type OrcaPushPayload } from './push-payload' import type { NotificationBehavior } from 'expo-notifications' diff --git a/mobile/src/notifications/push-registration.ts b/mobile/src/notifications/push-registration.ts index 5c8267a49d4..853f0329894 100644 --- a/mobile/src/notifications/push-registration.ts +++ b/mobile/src/notifications/push-registration.ts @@ -13,14 +13,10 @@ import { saveNotificationDeliveryPreferences, type NotificationDeliveryPreferences } from './notification-delivery-preferences' -import type { - MobilePushFilter, - MobilePushRegisterInput -} from '../../../src/shared/mobile-push-contract' import { NOTIFICATIONS_REMOTE_PUSH_RUNTIME_CAPABILITY } from '../../../src/shared/protocol-version' -import type { RpcOperationSender as PushClient } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import { startRuntimeCapabilityProbe } from '../transport/connection/runtime-capability-probe' -import { pushRouteRegister, pushRouteUnregister } from './mobile-push-registration-operations' +import { sendRegister, sendUnregister } from './mobile-push-registration-operations' import { loadPushNotificationsEnabled, loadRemotePushHostRegistrations, @@ -44,7 +40,7 @@ export function getHostPushSupported(hostId: string): boolean | null { } export function getHostPushSupportCompletion( hostId: string, - client: PushClient + client: UnvalidatedRpcRequestPort ): HostPushSupportCompletion | null { const connection = hostsById.get(hostId)?.connection return connection?.client === client ? connection.support : null @@ -98,34 +94,6 @@ async function currentToken(): Promise { return tokenPromise } -async function sendRegister( - client: PushClient, - token: MobilePushToken, - filter: MobilePushFilter -): Promise { - const params: Omit = { - platform: token.platform, - token: token.token, - ...(token.apnsEnvironment ? { apnsEnvironment: token.apnsEnvironment } : {}), - filter - } - const reply = await pushRouteRegister - .request(client, params, { timeoutMs: REQUEST_TIMEOUT_MS, failWhenDisconnected: true }) - .catch(() => null) - const registration = reply && pushRouteRegister.interpret(reply) - if (!registration?.accepted) { - return false - } - return registration.value?.registered === true -} - -async function sendUnregister(client: PushClient, timeoutMs: number): Promise { - const reply = await pushRouteUnregister - .request(client, null, { timeoutMs, failWhenDisconnected: true }) - .catch(() => null) - return reply !== null && pushRouteUnregister.interpret(reply).accepted -} - async function reconcileHost(hostId: string): Promise { const state = hostsById.get(hostId) const client = state?.connection.client @@ -222,7 +190,10 @@ async function reconcileAllHosts(): Promise { } // Keep tracked host intent across disconnects; this disposer detaches only its current connected client. -export function attachPushRegistration(hostId: string, client: PushClient): () => void { +export function attachPushRegistration( + hostId: string, + client: UnvalidatedRpcRequestPort +): () => void { const state = hostState(hostId) if (state.connection.client !== client) { state.capabilityProbeStop?.() diff --git a/mobile/src/notifications/push-socket-dismissal.ts b/mobile/src/notifications/push-socket-dismissal.ts index 16a3b560db2..84f548684b8 100644 --- a/mobile/src/notifications/push-socket-dismissal.ts +++ b/mobile/src/notifications/push-socket-dismissal.ts @@ -1,4 +1,4 @@ -import { loadHostCatalog } from '../transport/hosts/host-store' +import { loadHostCatalog } from '../host-catalog/host-store' import { deriveHostFingerprint } from './push-host-fingerprint' import { dismissPresentedPushNotification } from './push-tray-dismissal' import type { DismissNotificationEvent } from './desktop-notification-events' diff --git a/mobile/src/notifications/use-remote-push-capable-hosts.ts b/mobile/src/notifications/use-remote-push-capable-hosts.ts index db86e9d08b2..f7ff991cff1 100644 --- a/mobile/src/notifications/use-remote-push-capable-hosts.ts +++ b/mobile/src/notifications/use-remote-push-capable-hosts.ts @@ -1,5 +1,5 @@ import { useEffect, useRef, useState } from 'react' -import { loadHostCatalog } from '../transport/hosts/host-store' +import { loadHostCatalog } from '../host-catalog/host-store' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import { startRuntimeCapabilityProbe } from '../transport/connection/runtime-capability-probe' import { useAllHostClients } from '../transport/connection/use-all-host-clients' diff --git a/mobile/src/pairing/mobile-relay-pairing-journal-store.ts b/mobile/src/pairing/mobile-relay-pairing-journal-store.ts index bc885969b67..cbd96e1289c 100644 --- a/mobile/src/pairing/mobile-relay-pairing-journal-store.ts +++ b/mobile/src/pairing/mobile-relay-pairing-journal-store.ts @@ -11,7 +11,7 @@ import { readPairingKeychainItem, resetPairingKeychainForTests, writePairingKeychainItem -} from '../transport/hosts/pairing-keychain' +} from '../host-credentials/pairing-keychain' const JOURNAL_STORAGE_KEY = 'orca:mobile-relay:pairing-journal:v1' const JOURNAL_SECRET_KEY = 'orca.mobile-relay.pairing-journal.v1' diff --git a/mobile/src/pairing/mobile-relay-pairing-recovery.test.ts b/mobile/src/pairing/mobile-relay-pairing-recovery.test.ts index 648a53fd90b..7ad28633fff 100644 --- a/mobile/src/pairing/mobile-relay-pairing-recovery.test.ts +++ b/mobile/src/pairing/mobile-relay-pairing-recovery.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { MobileRelayCredentialBundle } from '../transport/hosts/mobile-relay-credential-bundle' +import type { MobileRelayCredentialBundle } from '../host-credentials/mobile-relay-credential-bundle' import { createMobileRelayPairingJournal } from './mobile-relay-pairing-journal' import { recoverMobileRelayPairing, @@ -10,7 +10,7 @@ import type { connectMobileRelayForPairing, PairingCandidateClient } from './mobile-relay-physical-client' -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' import type { RpcResponse } from '../transport/rpc/rpc-wire-types' import type { PairingOffer } from '../../../src/shared/remote-runtime/pairing/mobile-relay-pairing-offer' diff --git a/mobile/src/pairing/mobile-relay-pairing-recovery.ts b/mobile/src/pairing/mobile-relay-pairing-recovery.ts index 03fc772c3c0..e375bab0604 100644 --- a/mobile/src/pairing/mobile-relay-pairing-recovery.ts +++ b/mobile/src/pairing/mobile-relay-pairing-recovery.ts @@ -4,13 +4,13 @@ import type { PairingGetEndpointsResult } from '../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' import type { PairingRelay } from '../../../src/shared/remote-runtime/pairing/mobile-relay-pairing-offer' -import { loadHosts, savePairedHost } from '../transport/hosts/host-store' +import { loadHosts, savePairedHost } from '../host-catalog/host-store' import { promotePairingJournalCredential, readMobileRelayCredentialBundle, writeMobileRelayCredentialBundle, type MobileRelayCredentialBundle -} from '../transport/hosts/mobile-relay-credential-bundle' +} from '../host-credentials/mobile-relay-credential-bundle' import { resolvePairingInviteThroughDirector } from './mobile-relay-invite-director' import type { MobileRelayPairingJournal } from './mobile-relay-pairing-journal' import { diff --git a/mobile/src/pairing/pairing-relay-host.ts b/mobile/src/pairing/pairing-relay-host.ts index ff50da77e7f..a6cd7017273 100644 --- a/mobile/src/pairing/pairing-relay-host.ts +++ b/mobile/src/pairing/pairing-relay-host.ts @@ -3,7 +3,7 @@ import type { MobileRelayEndpoint } from '../../../src/shared/remote-runtime/relay/mobile-relay-credential-contract' import type { MobileRelayPairingJournal } from './mobile-relay-pairing-journal' -import type { HostProfile } from '../transport/hosts/host-profile' +import type { HostProfile } from '../host-catalog/host-profile' import type { PairingOffer } from '../../../src/shared/remote-runtime/pairing/mobile-relay-pairing-offer' export function directHost( diff --git a/mobile/src/pairing/pairing.ts b/mobile/src/pairing/pairing.ts index d4641651478..4f3379efe29 100644 --- a/mobile/src/pairing/pairing.ts +++ b/mobile/src/pairing/pairing.ts @@ -1,4 +1,4 @@ -import '../transport/hosts/host-profile' +import '../host-catalog/host-profile' import { PairingOfferSchema, type PairingOffer diff --git a/mobile/src/pairing/pre-profile-pairing-coordinator.ts b/mobile/src/pairing/pre-profile-pairing-coordinator.ts index f7f8f426ad7..e88d92b7e04 100644 --- a/mobile/src/pairing/pre-profile-pairing-coordinator.ts +++ b/mobile/src/pairing/pre-profile-pairing-coordinator.ts @@ -1,6 +1,6 @@ import { Platform } from 'react-native' import { connect, type ConnectOptions } from '../transport/rpc/direct-rpc-connect' -import { resolvePairingHostIdentity, savePairedHost } from '../transport/hosts/host-store' +import { resolvePairingHostIdentity, savePairedHost } from '../host-catalog/host-store' import type { PairingOffer } from '../../../src/shared/remote-runtime/pairing/mobile-relay-pairing-offer' import { isPairingRelayRpcUnavailable } from './pairing-relay-rpc-unavailable' import { @@ -21,7 +21,7 @@ import { settleMobileRelayPairingRecovery } from './mobile-relay-pairing-recover import { promotePairingJournalCredential, writeMobileRelayCredentialBundle -} from '../transport/hosts/mobile-relay-credential-bundle' +} from '../host-credentials/mobile-relay-credential-bundle' import { connectMobileRelayForPairing, type PairingCandidateClient @@ -33,7 +33,7 @@ import { createRecoveringPairingRelayCandidate } from './pairing-relay-candidate import { createPairingRelayLogger } from '../diagnostics/connection/pairing-relay-log' import { redactSocketEndpoint } from '../diagnostics/connection/socket-event-debug' import { assertCommittedInstall, directHost, relayHost } from './pairing-relay-host' -import { recordHostDescriptorFromStatus } from '../transport/hosts/host-descriptor-recorder' +import { recordHostDescriptorFromStatus } from '../host-descriptors/host-descriptor-recorder' import { adoptExchangedToken, exchangePairingTicket } from './pairing-ticket-exchange' import type { HostStatusReply } from '../transport/hosts/host-status-reply-schema' diff --git a/mobile/src/pairing/unpaired-host-credential-deletion.ts b/mobile/src/pairing/unpaired-host-credential-deletion.ts index a7e056764bd..1df85f8f740 100644 --- a/mobile/src/pairing/unpaired-host-credential-deletion.ts +++ b/mobile/src/pairing/unpaired-host-credential-deletion.ts @@ -1,9 +1,9 @@ -import { deleteHostDeviceToken } from '../transport/hosts/host-device-token-store' +import { deleteHostDeviceToken } from '../host-credentials/host-device-token-store' import { clearHostCredentialWriteRevision, getHostCredentialWriteRevision -} from '../transport/hosts/host-credential-write-revision' -import { deleteMobileRelayCredentialBundle } from '../transport/hosts/mobile-relay-credential-bundle' +} from '../host-credentials/host-credential-write-revision' +import { deleteMobileRelayCredentialBundle } from '../host-credentials/mobile-relay-credential-bundle' import { deleteMobileRelayDirectUpgradeJournal } from '../transport/relay/mobile-relay-direct-upgrade-journal' type DeletionDependencies = { diff --git a/mobile/src/platform/accessibility-announcer.ts b/mobile/src/platform/accessibility-announcer.ts new file mode 100644 index 00000000000..3f98cfba33b --- /dev/null +++ b/mobile/src/platform/accessibility-announcer.ts @@ -0,0 +1,10 @@ +import { useCallback } from 'react' +import { AccessibilityInfo } from 'react-native' + +// Speak a message to the screen reader; false when the caller should put it in a live region instead. +export function useAccessibilityAnnouncer(): (message: string) => Promise { + return useCallback(async (message: string) => { + AccessibilityInfo.announceForAccessibility(message) + return true + }, []) +} diff --git a/mobile/src/platform/accessibility-announcer.web.ts b/mobile/src/platform/accessibility-announcer.web.ts new file mode 100644 index 00000000000..647555ab841 --- /dev/null +++ b/mobile/src/platform/accessibility-announcer.web.ts @@ -0,0 +1,16 @@ +import { useCallback } from 'react' +import { useNativeVerbs } from '../mobile-web-shell/bridge/use-native-verbs' + +// RNW's announceForAccessibility does nothing, so the shell announces; older shells and Android leave it to the page's live region. +export function useAccessibilityAnnouncer(): (message: string) => Promise { + const verbs = useNativeVerbs() + return useCallback( + async (message: string) => { + if (!verbs.canAnnounce) { + return false + } + return verbs.announce(message).catch(() => false) + }, + [verbs] + ) +} diff --git a/mobile/src/platform/native-accessibility-announce.ts b/mobile/src/platform/native-accessibility-announce.ts new file mode 100644 index 00000000000..b171ff3948e --- /dev/null +++ b/mobile/src/platform/native-accessibility-announce.ts @@ -0,0 +1,12 @@ +import { AccessibilityInfo, Platform } from 'react-native' +import { a11yAnnounceParamsSchema } from '../mobile-web-shell/bridge/bridge-native-verbs' + +// VoiceOver ignores the page's live regions inside the shell's WebView, so the shell announces for it; TalkBack reads them, so Android leaves it to the page. +export function serveNativeAnnounceVerb(params: unknown): { announced: boolean } { + const { message } = a11yAnnounceParamsSchema.parse(params) + if (Platform.OS !== 'ios') { + return { announced: false } + } + AccessibilityInfo.announceForAccessibilityWithOptions(message, { queue: true }) + return { announced: true } +} diff --git a/mobile/src/platform/use-native-device-verbs.test.tsx b/mobile/src/platform/use-native-device-verbs.test.tsx index da46626ef78..757d8cb3805 100644 --- a/mobile/src/platform/use-native-device-verbs.test.tsx +++ b/mobile/src/platform/use-native-device-verbs.test.tsx @@ -17,6 +17,11 @@ const device = vi.hoisted(() => ({ wakeTags: new Array() })) +// The shell's announce verb speaks through React Native's AccessibilityInfo. +vi.mock('react-native', () => ({ + AccessibilityInfo: { announceForAccessibilityWithOptions: () => {} }, + Platform: { OS: 'ios' } +})) vi.mock('expo-clipboard', () => ({ setStringAsync: () => Promise.resolve(true), getStringAsync: device.clipboard.getStringAsync, diff --git a/mobile/src/platform/use-native-device-verbs.ts b/mobile/src/platform/use-native-device-verbs.ts index 3e7579ecd34..647133dea35 100644 --- a/mobile/src/platform/use-native-device-verbs.ts +++ b/mobile/src/platform/use-native-device-verbs.ts @@ -7,6 +7,7 @@ import { NATIVE_AUDIO_DEVICE_SAMPLE_RATE, nativeAudioDeviceEngine } from './nati import { createNativeSpeechServer } from './native-speech' import { nativeSpeechDeviceEngine } from './native-speech-device' import { serveNativeClipboardVerb } from './native-clipboard' +import { serveNativeAnnounceVerb } from './native-accessibility-announce' import { createNativeMediaVerbServer } from './native-media' import { discardStagedMedia, nativeMediaDeviceDeps } from './native-media-device' @@ -37,6 +38,9 @@ export function useNativeDeviceVerbs( if (verb === 'native.speech.act') { return speech.serve(params) } + if (verb === 'native.a11y.announce') { + return Promise.resolve(serveNativeAnnounceVerb(params)) + } if (verb === 'native.audio.start') { return speech.mayCapture().then((may) => may diff --git a/mobile/src/query/first-paint-query-keys.ts b/mobile/src/query/first-paint-query-keys.ts index 47654004af7..8305d983bb4 100644 --- a/mobile/src/query/first-paint-query-keys.ts +++ b/mobile/src/query/first-paint-query-keys.ts @@ -16,7 +16,7 @@ import { hostProjectSectionsQuery } from '../host-screen/use-host-project-sectio import { sessionTabsFamily, sessionTabsKey } from '../session/tabs/mobile-session-last-tabs' import type { MobileSessionTab } from '../session/tabs/mobile-session-tabs' import { activeSessionTabOf } from '../session/tabs/active-session-tab' -import { storedTabChatTranscriptIdentity } from '../session/native-chat/mobile-native-chat-transcript-store' +import { storedTabChatTranscriptIdentity } from '../session/native-chat/transcript/mobile-native-chat-transcript-store' import { gitStatusQuery } from '../source-control/mobile-git-status-query' import { firstPaintTaskKeys } from '../tasks/task-query-storage' import { hostQueryKey } from './host-query-key' diff --git a/mobile/src/query/host-query.ts b/mobile/src/query/host-query.ts index e7b0a36706c..7a03ae8efb4 100644 --- a/mobile/src/query/host-query.ts +++ b/mobile/src/query/host-query.ts @@ -24,9 +24,6 @@ import { import { holdsRestoredHostQueryData, type HostQueryPersist } from './host-query-persistence' import { hostReadClient } from './host-read-client' -// Exported with the query hooks so the router lands in their page chunk, not a chunk of its own. -export { useHostEventRouter } from './host-event-router' - export type HostQuery = { family: string // Calls the domain's loader. `previous` is the cached data a revalidation may build on; live reads pass none. diff --git a/mobile/src/query/page-query-persistence.ts b/mobile/src/query/page-query-persistence.ts index d0dad07998c..0e3eadf7368 100644 --- a/mobile/src/query/page-query-persistence.ts +++ b/mobile/src/query/page-query-persistence.ts @@ -1,6 +1,6 @@ import type { QueryClient } from '@tanstack/react-query' import type { PageDeviceStore } from '../mobile-web-shell/bridge/page-device-store' -import { primeStoredChatTranscripts } from '../session/native-chat/mobile-native-chat-transcript-store' +import { primeStoredChatTranscripts } from '../session/native-chat/transcript/mobile-native-chat-transcript-store' import { firstPaintChatTranscriptIdentity, firstPaintQueryKeys } from './first-paint-query-keys' import { createHostQueryPersistence } from './host-query-persistence' diff --git a/mobile/src/session/MobileNativeChatForkProvider.tsx b/mobile/src/session/MobileNativeChatForkProvider.tsx index 44f80dff88a..6607dae2a36 100644 --- a/mobile/src/session/MobileNativeChatForkProvider.tsx +++ b/mobile/src/session/MobileNativeChatForkProvider.tsx @@ -2,7 +2,7 @@ import { useCallback, useLayoutEffect, useMemo, useRef } from 'react' import { useHostProtocolGates } from '../components/host-protocol-gates-context' import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { StructuredAgentSessionForkSource } from '../../../src/shared/agent-session/structured-agent-session-create' -import { MobileNativeChatForkedFromContext } from './mobile-native-chat-notice-context' +import { MobileNativeChatForkedFromContext } from './native-chat/transcript/mobile-native-chat-notice-context' import { forkMobileStructuredChat } from './mobile-structured-chat-fork' import { MobileNativeChatForkContext, diff --git a/mobile/src/session/MobileSessionActiveContent.tsx b/mobile/src/session/MobileSessionActiveContent.tsx index 06861569071..0400353b3ca 100644 --- a/mobile/src/session/MobileSessionActiveContent.tsx +++ b/mobile/src/session/MobileSessionActiveContent.tsx @@ -25,8 +25,8 @@ import { useMobileSessionContentKeyboardLift } from '../terminal/session/use-mob import { useOpenUrlInOrca } from '../browser/use-open-url-in-orca' import { useWorkspaceExecutionHost } from '../navigation/workspace-execution-host' import { useOpenHostAccounts } from '../accounts/use-open-mobile-accounts' -import { useHostProfile } from '../transport/hosts/use-host-profile' -import { useHostDisplay } from '../transport/hosts/use-host-display' +import { useHostProfile } from '../host-catalog/use-host-profile' +import { useHostDisplay } from '../host-descriptors/use-host-display' import { FileReader } from '../files/session-documents/MobileSessionFileReader' import { MobileSessionContentState } from './MobileSessionContentState' import { MarkdownReader } from '../files/session-documents/MobileSessionMarkdownReader' diff --git a/mobile/src/session/MobileSessionCommandDock.tsx b/mobile/src/session/MobileSessionCommandDock.tsx index 81e820cc289..a1678120b64 100644 --- a/mobile/src/session/MobileSessionCommandDock.tsx +++ b/mobile/src/session/MobileSessionCommandDock.tsx @@ -60,7 +60,6 @@ export function MobileSessionCommandDock({ controller }: { controller: MobileSes { - // A ctrl/alt/shift held on the Duo rail turns the next typed letter into a combo, while the rail shows it. - if ( - !keysInRail || - !dockKeys.interceptTypedCharacter(text, event.nativeEvent.text, liveInputRef) - ) { + // A held Shift, Ctrl or Alt on the key row or the Duo rail turns the next typed letter into a combo. + if (!dockKeys.interceptTypedCharacter(text, event.nativeEvent.text, liveInputRef)) { handleLiveInputChange(event) } }} diff --git a/mobile/src/session/MobileSessionContentRow.tsx b/mobile/src/session/MobileSessionContentRow.tsx index 9a7cea2d3f1..474f974e441 100644 --- a/mobile/src/session/MobileSessionContentRow.tsx +++ b/mobile/src/session/MobileSessionContentRow.tsx @@ -9,7 +9,6 @@ import { styles } from './mobile-session-styles' import type { MobileSessionController } from './use-mobile-session-controller' import { MobileSessionActiveContent } from './MobileSessionActiveContent' import { MobileSessionCommandDock } from './MobileSessionCommandDock' -import { MobileDictationStatusAnnouncement } from '../dictation/MobileDictationStatusAnnouncement' import { MobileDictationLiveContext } from '../dictation/mobile-dictation-live-context' import { useMobileDictationLive } from '../dictation/use-mobile-dictation-live' @@ -56,7 +55,6 @@ export function MobileSessionContentRow({ controller }: { controller: MobileSess {/* Why: translate instead of resize so keyboard toggles don't trigger a server-side PTY viewport change. */} - {canDockPanel && activePanel !== null && ( 0 const tabsInTopBar = (layout.isLandscapePhone || sideRail) && hasTabs - // Bar buttons otherwise leave less than two readable tabs on a narrow header. + // Bar buttons otherwise leave the tab bar too narrow to read on a narrow header. const actionsCollapsed = tabsInTopBar && (headerWidth ?? layout.width) < 600 const sourceControlInBar = !isFloatingWorkspaceRoute && !actionsCollapsed const tabStrip = hasTabs ? ( - - { - setShowCreateTabDrawer(false) - void handleCreateTerminal() - } - }, - // Why: browser/markdown creation resolve a real worktree on the host - // (browser.tabCreate, files.createFile); the floating sentinel is - // terminal-only over RPC, so those options hide there. - ...(isFloatingWorkspaceRoute - ? [] - : [ - { - id: 'browser', - label: t('session.sheets.browser', 'Browser'), - icon: Globe, - closeBeforePress: true, - onPress: () => { - if (browserScreencastSupported !== true) { - showToast( - t( - 'session.sheets.browserUpdateRequired', - 'Desktop update required for mobile browser streaming' - ), - 1600 - ) - return - } - setShowCreateBrowserModal(true) - } - }, - ...(onPairedHost - ? [ - { - id: 'markdownNote', - label: t('session.sheets.markdownNote', 'Markdown Note'), - icon: FileText, - onPress: () => { - setShowCreateTabDrawer(false) - void handleCreateMarkdownNote() - } - } - ] - : []) - ]) - ]} + workspaceName={worktreeName} + agentOptions={createTabAgentOptions} + agentStatusRow={createTabAgentStatusRow} + // Why: browser/markdown creation resolve a real worktree on the host + // (browser.tabCreate, files.createFile); the floating sentinel is + // terminal-only over RPC, so those options hide there. + canCreateBrowser={!isFloatingWorkspaceRoute} + canCreateMarkdownNote={!isFloatingWorkspaceRoute && onPairedHost} onClose={() => setShowCreateTabDrawer(false)} + onCreateAgent={(agent) => void handleCreateTerminal(agent)} + onCreateTerminal={() => void handleCreateTerminal()} + onCreateBrowser={() => { + if (browserScreencastSupported !== true) { + showToast( + t( + 'session.sheets.browserUpdateRequired', + 'Desktop update required for mobile browser streaming' + ), + 1600 + ) + return + } + setShowCreateBrowserModal(true) + }} + onCreateMarkdownNote={() => void handleCreateMarkdownNote()} /> setShowCustomKeyModal(false)} onKeysChanged={setCustomKeys} onManageShortcuts={handleManageShortcuts} + smartRail={{ enabled: smartRailEnabled, onChange: handleSmartRailChange }} /> - hostId: string - worktreeId: string - name: string - availableWidth: number - onRequestClose: () => void -} +type Props = SessionDockPanelContentProps & { availableWidth: number } -type DockPanelContentProps = Omit +// Panels load with the first dock open so phone sessions, which never dock, skip Source Control and Files code. +const SessionDockPanelContent = lazy(() => + import('./SessionDockPanelContent').then((module) => ({ + default: module.SessionDockPanelContent + })) +) // Keep drag width state in this subtree; terminal refits follow frame onLayout and need no width prop. export function SessionDockColumn({ @@ -34,49 +30,20 @@ export function SessionDockColumn({ {/* Dedicated drag handle over the dock's left border — a leaf overlay so the inner ScrollView can't intercept the gesture on Android. */} - + {/* The column frame paints at once; its panel fills in from local disk with no spinner. */} + + + ) } -// Width-independent panel props let memo skip content rerenders during resize. -const DockPanelContent = memo(function DockPanelContent({ - activePanel, - hostId, - worktreeId, - name, - onRequestClose -}: DockPanelContentProps) { - // Reuse the source-control hub so dock icon switches retain commit draft, visited tabs and scroll. - if (activePanel === 'sourceControl' || activePanel === 'pr') { - return ( - - ) - } - return ( - - ) -}) - const RESIZE_EDGE_WIDTH = 24 const styles = StyleSheet.create({ diff --git a/mobile/src/session/SessionDockPanelContent.tsx b/mobile/src/session/SessionDockPanelContent.tsx new file mode 100644 index 00000000000..e4bcfd06bf6 --- /dev/null +++ b/mobile/src/session/SessionDockPanelContent.tsx @@ -0,0 +1,44 @@ +import { memo } from 'react' +import { MobileSourceControlRoutePanel } from '../source-control/MobileSourceControlRoutePanel' +import { MobileFileExplorerPanel } from '../files/MobileFileExplorerPanel' +import type { ActivePanel } from './session-panel-host' + +export type SessionDockPanelContentProps = { + activePanel: Exclude + hostId: string + worktreeId: string + name: string + onRequestClose: () => void +} + +// Width-independent panel props let memo skip content rerenders during resize. +export const SessionDockPanelContent = memo(function SessionDockPanelContent({ + activePanel, + hostId, + worktreeId, + name, + onRequestClose +}: SessionDockPanelContentProps) { + // Reuse the source-control hub so dock icon switches retain commit draft, visited tabs and scroll. + if (activePanel === 'sourceControl' || activePanel === 'pr') { + return ( + + ) + } + return ( + + ) +}) diff --git a/mobile/src/session/__mocks__/mobile-prompt-controller.ts b/mobile/src/session/__mocks__/mobile-prompt-controller.ts index 1e8bd3d9c36..5d374b386be 100644 --- a/mobile/src/session/__mocks__/mobile-prompt-controller.ts +++ b/mobile/src/session/__mocks__/mobile-prompt-controller.ts @@ -2,7 +2,7 @@ import './mobile-prompt-render-mocks' import { createElement } from 'react' import { Pressable } from 'react-native' import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' -import type { MobileNativeChatSendOutcome } from '../native-chat/mobile-native-chat-send' +import type { MobileNativeChatSendOutcome } from '../native-chat/composer/mobile-native-chat-send' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import type { RpcResponse } from '../../transport/rpc/rpc-wire-types' import type { ConnectionState } from '../../transport/connection/connection-state' @@ -55,7 +55,7 @@ vi.mock('../use-mobile-session-view-mode', () => ({ }) })) // The chat's per-connection CI setting read isn't a prompt write; these tests count only those. -vi.mock('../use-mobile-native-chat-ci-result-lines', () => ({ +vi.mock('../native-chat/preferences/use-mobile-native-chat-ci-result-lines', () => ({ useMobileNativeChatCiResultLines: () => false })) vi.mock('../native-chat/use-mobile-native-chat-session-lane', () => ({ diff --git a/mobile/src/session/agent-launch/mobile-agent-detection-operations.ts b/mobile/src/session/agent-launch/mobile-agent-detection-operations.ts index 443525aca2d..3587dbbb98e 100644 --- a/mobile/src/session/agent-launch/mobile-agent-detection-operations.ts +++ b/mobile/src/session/agent-launch/mobile-agent-detection-operations.ts @@ -1,14 +1,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rpc/rpc-operation' import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' -import '../../terminal/terminal-reply-schema' import { detectedAgentsSchema, refreshedAgentsSchema } from './mobile-agent-detection-reply-schema' -import '../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../../terminal/session/mobile-session-terminal-reply-schema' -import '../../worktree/session-worktree-record-reply-schema' -import '../native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../../terminal/quick-commands/mobile-quick-command-reply-schema' -import '../../files/workspace-file-paths-reply-schema' // Launch detection surfaces host refusals; advisory task-drawer readers intentionally skip them. export const preflightDetectAgentsRead = bindDeferredRpcOperation( diff --git a/mobile/src/session/agent-launch/mobile-existing-agent-launch.ts b/mobile/src/session/agent-launch/mobile-existing-agent-launch.ts index 6b3be4fb6b9..1d2c17eb236 100644 --- a/mobile/src/session/agent-launch/mobile-existing-agent-launch.ts +++ b/mobile/src/session/agent-launch/mobile-existing-agent-launch.ts @@ -22,9 +22,9 @@ import { isAgentLaunchReservationTakenRefusal } from '../../../../src/shared/agent-launch/contracts/agent-launch-replay-refusal' import { sendReplayingAmbiguousDelivery } from '../../tasks/replay-on-ambiguous-delivery' -import { structuredSessionOperationId } from '../structured-session-operation-id' +import { structuredSessionOperationId } from '../native-chat/agent-session/structured-session-operation-id' import { randomV4Uuid } from '../../platform/random-v4-uuid' -import { rememberMobileCreatedStructuredSession } from '../mobile-created-structured-sessions' +import { rememberMobileCreatedStructuredSession } from '../native-chat/agent-session/mobile-created-structured-sessions' // Why: the host waits up to 60s for a terminal agent to become ready before pasting the prompt, // so a prompted launch must outlive that wait or the phone reports a launch that is still running. diff --git a/mobile/src/session/agent-launch/mobile-new-tab-settings-operations.ts b/mobile/src/session/agent-launch/mobile-new-tab-settings-operations.ts index 1a0627c3289..f7a8ecd5f50 100644 --- a/mobile/src/session/agent-launch/mobile-new-tab-settings-operations.ts +++ b/mobile/src/session/agent-launch/mobile-new-tab-settings-operations.ts @@ -1,6 +1,5 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rpc/rpc-operation' import type { RpcCompatibleReader } from '../../transport/rpc/rpc-operation-contract' -import '../../../../src/shared/source-control/listing/source-control-group-order' import { settingsMember } from '../../settings/mobile-settings-projection' // New-tab checks the sibling's refusal before touching settings, but after its own refusal. diff --git a/mobile/src/session/agent-launch/mobile-runtime-repo-operations.ts b/mobile/src/session/agent-launch/mobile-runtime-repo-operations.ts index cb885ee3fc6..0980441d230 100644 --- a/mobile/src/session/agent-launch/mobile-runtime-repo-operations.ts +++ b/mobile/src/session/agent-launch/mobile-runtime-repo-operations.ts @@ -1,14 +1,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rpc/rpc-operation' import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' -import '../../terminal/terminal-reply-schema' import { runtimeRepoListSchema } from './mobile-agent-detection-reply-schema' -import '../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../../terminal/session/mobile-session-terminal-reply-schema' -import '../../worktree/session-worktree-record-reply-schema' -import '../native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../../terminal/quick-commands/mobile-quick-command-reply-schema' -import '../../files/workspace-file-paths-reply-schema' export type MobileRuntimeRepoSummary = { id: string diff --git a/mobile/src/session/agent-session-write-notice-copy.test.ts b/mobile/src/session/agent-session-write-notice-copy.test.ts deleted file mode 100644 index 5788ba290c2..00000000000 --- a/mobile/src/session/agent-session-write-notice-copy.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { agentSessionWriteNoticeParts } from '../../../src/shared/agent-session/failures/agent-session-refusal-notice' -import { agentSessionRefusalFailure } from '../../../src/shared/agent-session/failures/agent-session-write-failure' -import { mobileAgentSessionWriteNoticeText } from './agent-session-write-notice-copy' - -describe('mobileAgentSessionWriteNoticeText', () => { - it('names the attachment an expired refusal lists, as its card labels it', () => { - const failure = agentSessionRefusalFailure({ - code: 'agent_session_operation_invalid', - details: { - reason: 'attachmentExpired', - expiredAttachments: [{ uploadId: 'upload-1', name: 'notes.pdf' }] - } - }) - expect( - mobileAgentSessionWriteNoticeText(agentSessionWriteNoticeParts(failure, 'composer-send')) - ).toBe('notes.pdf expired. Your message was not sent. Remove it and attach it again.') - }) -}) diff --git a/mobile/src/session/floating-workspace.test.ts b/mobile/src/session/floating-workspace.test.ts deleted file mode 100644 index 8f29646b49b..00000000000 --- a/mobile/src/session/floating-workspace.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - FLOATING_WORKSPACE_WORKTREE_ID, - floatingWorkspaceSessionPath, - isFloatingWorkspaceWorktreeId -} from './floating-workspace' - -describe('floating workspace routing', () => { - it('matches only the desktop sentinel id', () => { - expect(isFloatingWorkspaceWorktreeId('global-floating-terminal')).toBe(true) - expect(isFloatingWorkspaceWorktreeId('repo-1::/worktree')).toBe(false) - expect(isFloatingWorkspaceWorktreeId('folder:group-1')).toBe(false) - expect(isFloatingWorkspaceWorktreeId(undefined)).toBe(false) - expect(isFloatingWorkspaceWorktreeId(null)).toBe(false) - }) - - it('builds the session route with an explicit title seed', () => { - expect(floatingWorkspaceSessionPath('host-1')).toBe( - `/h/host-1/session/${FLOATING_WORKSPACE_WORKTREE_ID}?name=Floating%20Workspace` - ) - }) -}) diff --git a/mobile/src/session/mobile-closed-tab-dictation-lifetime.test.tsx b/mobile/src/session/mobile-closed-tab-dictation-lifetime.test.tsx deleted file mode 100644 index f5c97c0cedb..00000000000 --- a/mobile/src/session/mobile-closed-tab-dictation-lifetime.test.tsx +++ /dev/null @@ -1,109 +0,0 @@ -import { createElement, type ReactNode } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, expect, it, vi } from 'vitest' -import { MobileNativeChatComposer } from './native-chat/composer/MobileNativeChatComposer' -import { captureMobileNativeChatTextDestination } from './native-chat/composer/mobile-native-chat-draft-inputs' -import { - closeMobileNativeChatTabDraft, - readMobileNativeChatDraftEditGeneration, - resetMobileNativeChatDraftStoreForTests, - setMobileNativeChatDraftText -} from './native-chat/composer/mobile-native-chat-draft-store' -import { findByHostType } from '../test-support/react-test-renderer-host-nodes' - -vi.mock('../components/MobileSwitch', () => ({ MobileSwitch: 'Switch' })) -vi.mock('./native-chat/composer/MobileNativeChatContextUsageRing', () => ({ - useMobileNativeChatContextRing: () => ({ barProps: {}, ring: null }) -})) -// BottomDrawer also carries the option pager, which loads Reanimated at import. -vi.mock('react-native-reanimated', async () => - (await import('../test-support/reanimated-pager-stub')).reanimatedPagerStub() -) -vi.mock('react-native', async () => { - const React = await import('react') - return { - ...(await import('../test-support/react-native-motion-stub')).reactNativeMotionStub(), - ActivityIndicator: 'ActivityIndicator', - Image: 'Image', - Keyboard: { dismiss: vi.fn() }, - Platform: { OS: 'ios' }, - Pressable: 'Pressable', - ScrollView: ({ children, ...props }: { children?: ReactNode }) => - React.createElement('ScrollView', props, children), - StyleSheet: { create: (styles: unknown) => styles, hairlineWidth: 1 }, - Text: 'Text', - TextInput: 'TextInput', - View: 'View' - } -}) -vi.mock('lucide-react-native', () => ({ - ArrowUp: 'ArrowUp', - ListEnd: 'ListEnd', - CornerDownRight: 'CornerDownRight', - Check: 'Check', - ChevronDown: 'ChevronDown', - ChevronLeft: 'ChevronLeft', - ChevronRight: 'ChevronRight', - FileText: 'FileText', - Mic: 'Mic', - Package: 'Package', - Plus: 'Plus', - ShieldAlert: 'ShieldAlert', - Square: 'Square', - Terminal: 'Terminal', - X: 'X' -})) -vi.mock('../components/bottom-drawer/mounted-bottom-drawer', () => ({ - MountedBottomDrawer: 'BottomDrawer' -})) -vi.mock('../components/bottom-drawer/bottom-drawer-modal-host-scope', () => ({ - useBottomDrawerModalHost: () => null -})) - -let renderer: ReactTestRenderer | undefined -afterEach(async () => { - await act(async () => renderer?.unmount()) - renderer = undefined - resetMobileNativeChatDraftStoreForTests() -}) - -it.each([false, true])( - 'rejects captured dictation after tab retirement with custom insert=%s', - async (customInsert) => { - const scope = `retired-dictation-${customInsert}` - const insertDictation = vi.fn(() => true) - setMobileNativeChatDraftText(scope, 'old text') - await act(async () => { - renderer = create( - createElement(MobileNativeChatComposer, { - value: 'old text', - draftScopeKey: scope, - insertDictation: customInsert ? insertDictation : undefined, - onChangeText: vi.fn(), - onSend: async () => true, - sendSurfaceId: scope, - getSendCompletionGeneration: () => 0, - getComposerEditGeneration: () => 0 - }) - ) - }) - act(() => findByHostType(renderer!.root, 'TextInput').props.onFocus()) - const insert = captureMobileNativeChatTextDestination()?.insert - if (!insert) { - throw new Error('composer did not register dictation') - } - act(() => { - insert('live dictation') - }) - if (customInsert) { - expect(insertDictation).toHaveBeenCalledOnce() - } else { - expect(readMobileNativeChatDraftEditGeneration(scope)).toBe(2) - } - insertDictation.mockClear() - await act(async () => closeMobileNativeChatTabDraft(scope)) - expect(insert('late dictation')).toBe(false) - expect(insertDictation).not.toHaveBeenCalled() - expect(readMobileNativeChatDraftEditGeneration(scope)).toBe(0) - } -) diff --git a/mobile/src/session/mobile-dictation-session-outcomes.test.tsx b/mobile/src/session/mobile-dictation-session-outcomes.test.tsx index 1c906784758..46d24d9a1d9 100644 --- a/mobile/src/session/mobile-dictation-session-outcomes.test.tsx +++ b/mobile/src/session/mobile-dictation-session-outcomes.test.tsx @@ -4,7 +4,7 @@ import { act } from 'react-test-renderer' import { createWithQueryClient } from '../test-support/query-client-test-renderer' import { beforeEach, describe, expect, it, vi } from 'vitest' import { createFakeRpcClient, type FakeRpcClient } from '../mobile-web-shell/bridge-host-test-fakes' -import type * as NativeChatSendError from './native-chat/use-mobile-native-chat-send-error' +import type * as NativeChatSendError from './native-chat/composer/use-mobile-native-chat-send-error' import type * as NativeChatDraftStore from './native-chat/composer/mobile-native-chat-draft-store' type ChatView = { shown: boolean; scope: string | null } @@ -14,8 +14,6 @@ const seen = vi.hoisted(() => { return { toasts: new Array(), errorHaptics: 0, - setupSheetOpens: 0, - micPermissionRequests: 0, clipboard: new Array(), inputs: new Array(), chat, @@ -26,8 +24,11 @@ const seen = vi.hoisted(() => { vi.mock('react-native', () => ({ AppState: { currentState: 'active', addEventListener: () => ({ remove: () => {} }) }, + AccessibilityInfo: { announceForAccessibility: () => {} }, Platform: { OS: 'ios' } })) +// The computer's name only words announcements; the stored host profile pulls in secure storage. +vi.mock('../host-catalog/use-host-profile', () => ({ useHostProfile: () => null })) vi.mock('@orca/expo-two-way-audio', () => ({ addExpoTwoWayAudioEventListener: (name: string, listener: (event: { data: string }) => void) => { seen.audioListeners.set(name, listener) @@ -35,7 +36,6 @@ vi.mock('@orca/expo-two-way-audio', () => ({ }, initialize: () => Promise.resolve(true), requestMicrophonePermissionsAsync: () => { - seen.micPermissionRequests += 1 return Promise.resolve({ granted: true }) }, tearDown: () => {}, @@ -66,7 +66,7 @@ vi.mock('../platform/clipboard', () => { }) // Stub off-path native chat dependencies to keep Expo out of this mic test. -vi.mock('./native-chat/use-mobile-native-chat-send-error', async (importOriginal) => ({ +vi.mock('./native-chat/composer/use-mobile-native-chat-send-error', async (importOriginal) => ({ ...(await importOriginal()), useMobileNativeChatSendError: () => ({ message: null, @@ -79,7 +79,7 @@ vi.mock('./native-chat/use-mobile-native-chat-send-error', async (importOriginal vi.mock('./native-chat/transcript/use-mobile-native-chat-readability', () => ({ useMobileNativeChatReadability: () => false })) -vi.mock('./native-chat/use-mobile-native-chat-input-lease', () => ({ +vi.mock('./native-chat/composer/use-mobile-native-chat-input-lease', () => ({ useMobileNativeChatInputLease: () => ({ ready: true, readyRef: { current: true }, @@ -156,11 +156,7 @@ function mount( activeSessionTab: { id: 'tab1', type: 'terminal', terminal: 't1', title: 'Claude Code' }, diffComments: [], diffCommentsRef: useRef([]), - setShowDictationSetup: (next: boolean) => { - if (next) { - seen.setupSheetOpens += 1 - } - }, + setShowDictationSetup: () => {}, setDictationMode: () => {}, dictationEnabled: true, setDictationEnabled: () => {}, @@ -256,8 +252,6 @@ async function startRecording( beforeEach(() => { seen.toasts.length = 0 seen.errorHaptics = 0 - seen.setupSheetOpens = 0 - seen.micPermissionRequests = 0 seen.clipboard.length = 0 seen.inputs.length = 0 seen.chat = { shown: false, scope: null } @@ -265,70 +259,6 @@ beforeEach(() => { seen.audioListeners.clear() }) -describe('a mic tap after the host reported dictation is not set up', () => { - it('opens setup without asking for the microphone, then lets the host judge the tap after the sheet closes', async () => { - const rpc = createFakeRpcClient() - const mounted = mount(rpc) - await act(async () => { - const read = mounted.current().refreshDictationMode() - for (const request of rpc.requests.splice(0)) { - request.resolve({ - id: 'desktop', - ok: true, - result: { enabled: false, selectedModelId: '', dictationMode: 'toggle', models: [] } - }) - } - await read - }) - act(() => mounted.current().handleDictationToggle()) - expect(seen.setupSheetOpens).toBe(1) - expect(seen.micPermissionRequests).toBe(0) - expect(rpc.requests).toEqual([]) - - // Closing the sheet hands the next tap to the host until a fresh read lands. - act(() => mounted.current().closeDictationSetup()) - act(() => mounted.current().handleDictationToggle()) - await settle(rpc, '') - expect(seen.setupSheetOpens).toBe(1) - expect(seen.micPermissionRequests).toBe(1) - }) -}) - -describe('an audio interruption while recording', () => { - it('finishes the dictation and keeps what was said', async () => { - const rpc = createFakeRpcClient() - await startRecording(rpc) - act(() => seen.audioListeners.get('onAudioInterruption')?.({ data: 'began' })) - const methods = await settle(rpc, 'call me back') - expect(methods).toContain('speech.dictation.finish') - expect(methods).not.toContain('speech.dictation.cancel') - expect(seen.inputs).toEqual(['call me back']) - expect(seen.toasts).toEqual(['Dictation inserted']) - }) -}) - -describe('leaving the session while recording', () => { - it('stops and inserts what was said instead of leaving, and lets the next leave go', async () => { - const rpc = createFakeRpcClient() - const mounted = await startRecording(rpc) - const held: boolean[] = [] - act(() => { - held.push(mounted.current().dictationLeaveHold.hold()) - }) - // Back is released while transcribing, so a swipe can leave too. - expect(mounted.current().dictationLeaveHold.holdsLeave).toBe(false) - act(() => { - held.push(mounted.current().dictationLeaveHold.hold()) - }) - expect(held).toEqual([true, false]) - const methods = await settle(rpc, 'one more thing') - expect(methods.filter((method) => method === 'speech.dictation.finish')).toHaveLength(1) - expect(methods).not.toContain('speech.dictation.cancel') - expect(seen.inputs).toEqual(['one more thing']) - expect(seen.toasts).toEqual(['Dictation inserted']) - }) -}) - describe('a mic tap while the transcript is processing', () => { it('keeps the transcript that comes back', async () => { const rpc = createFakeRpcClient() @@ -364,19 +294,3 @@ describe('a dictation that ends after switching between chat and terminal', () = expect(seen.inputs).toEqual([]) }) }) - -describe('a dictation whose session screen was left', () => { - it('keeps recording, then puts its words in the chat it started in with a toast that opens it', async () => { - seen.chat = { shown: true, scope: 'chat-a' } - const rpc = createFakeRpcClient() - const mounted = await startRecording(rpc) - mounted.leave() - expect(mounted.host().getDictation().isRecording).toBe(true) - expect(mounted.host().pill?.away).toBe(true) - act(() => mounted.host().stop()) - await settle(rpc, 'ship it') - expect(seen.chatWrites).toEqual([['chat-a', 'ship it']]) - expect(mounted.host().pill?.toast?.message).toBe('Inserted in Claude Code') - expect(mounted.host().pill?.toast?.open).toBeTypeOf('function') - }) -}) diff --git a/mobile/src/session/mobile-native-chat-picker-scaling.test.ts b/mobile/src/session/mobile-native-chat-picker-scaling.test.ts deleted file mode 100644 index 8a3adb1e363..00000000000 --- a/mobile/src/session/mobile-native-chat-picker-scaling.test.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { afterEach, expect, it, vi } from 'vitest' -import capture from '../../../src/shared/__fixtures__/omp-native-commands.json' -import * as catalog from '../../../src/shared/native-chat/input/native-chat-slash-commands' -import type { NativeChatPickerItem } from '../../../src/shared/native-chat/input/native-chat-picker-items' -import { deriveComposerAutocomplete } from '../../../src/shared/native-chat/input/native-chat-composer-autocomplete' -import { - mobileComposerCatalog, - boundedMenuItems -} from './native-chat/composer/mobile-native-chat-composer-menu' - -afterEach(() => vi.restoreAllMocks()) - -it('bounds native OMP picker name reads at N/10N while preserving first duplicate descriptions', () => { - const reportedSkills = catalog.sessionReportedSkills - let visits = 0 - vi.spyOn(catalog, 'sessionReportedSkills').mockImplementation((...args) => - reportedSkills(...args).map((skill) => ({ - ...skill, - get name() { - visits += 1 - return skill.name - } - })) - ) - const native = capture.enabled.availableCommands.find((row) => row.name === 'skill:plan')! - for (const surface of ['desktop', 'mobile'] as const) { - const counts = [10, 100].map((size) => { - const reported = [ - ...Array.from({ length: size }, (_, i) => ({ - name: `${native.name}-${i}`, - kind: 'command' as const, - description: i === 0 ? undefined : native.description - })), - { name: `${native.name}-0`, kind: 'command' as const, description: 'Later duplicate' }, - { name: `${native.name}-1`, kind: 'command' as const, description: 'Later duplicate' } - ] - visits = 0 - let rows: NativeChatPickerItem[] - if (surface === 'desktop') { - const picker = deriveComposerAutocomplete( - '/plan', - 5, - catalog.sessionSlashCommandSuggestions('omp', reported), - [], - null, - { status: 'ready', skills: [] }, - null, - catalog.sessionReportedSkills(reported, 'omp') - ) - expect(picker.mode).toBe('slash') - if (picker.mode !== 'slash') { - throw new Error('Missing native picker') - } - rows = picker.items - } else { - const menu = mobileComposerCatalog({ - agent: 'omp', - structured: { reported, conversationCommands: [] } - }) - const picker = deriveComposerAutocomplete( - '/plan', - 5, - menu.commands, - menu.discovery.skills, - menu.profile, - menu.discovery, - null, - menu.sessionSkills - ) - expect(picker.mode).toBe('slash') - rows = picker.mode === 'slash' ? boundedMenuItems(picker.items) : [] - } - const skills = rows.filter((row) => row.kind === 'skill') - expect(skills).toHaveLength(Math.min(size, surface === 'desktop' ? 50 : 10)) - expect(new Set(skills.map((row) => row.token)).size).toBe(skills.length) - expect(skills.find((row) => row.token === '/skill:plan-0')?.description).toBeNull() - expect(skills.find((row) => row.token === '/skill:plan-1')?.description).toBe( - native.description - ) - expect(visits).toBeGreaterThanOrEqual(reported.length) - expect(visits).toBeLessThanOrEqual(10 * reported.length) - return visits - }) - expect(counts[1]).toBeLessThanOrEqual(12 * counts[0]!) - } -}) diff --git a/mobile/src/session/mobile-queued-edit-hook.test-fixture.tsx b/mobile/src/session/mobile-queued-edit-hook.test-fixture.tsx deleted file mode 100644 index fdf2e5e21d0..00000000000 --- a/mobile/src/session/mobile-queued-edit-hook.test-fixture.tsx +++ /dev/null @@ -1,261 +0,0 @@ -import { QueuedMessageUpdateParams } from '../../../src/shared/rpc-contract/structured-agent-session-queued-edit-params' -import { useMobileNativeChatComposerMenu } from './native-chat/composer/use-mobile-native-chat-composer-menu' -import { - resetMobileNativeChatDraftStoreForTests, - useMobileNativeChatDraft -} from './native-chat/composer/mobile-native-chat-draft-store' -import { - updateMobileNativeChatDraftInputs, - resetMobileNativeChatDraftInputsForTests -} from './native-chat/composer/mobile-native-chat-draft-inputs' -import { createElement, type ReactNode } from 'react' -import { act, type ReactTestRenderer } from 'react-test-renderer' -import { createWithQueryClient } from '../test-support/query-client-test-renderer' -import { afterEach, expect, vi } from 'vitest' -import type { - AgentSessionQueuedMessage, - AgentSessionQueuedMessageEditHoldResult -} from '../../../src/shared/agent-session/requests/agent-session-queued-message-wire' -import { agentSessionSendBodyFingerprint } from '../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' -import { queuedMessageWithEdit } from '../../../src/shared/queued-message-edit' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import type { RpcResponse } from '../transport/rpc/rpc-wire-types' -import { useMobileStructuredAgentSession } from './use-mobile-structured-agent-session' -import { - CAPABLE, - SESSION_ID, - fieldsOf, - mutationOk, - ok, - snapshotEvent -} from './native-chat/agent-session/use-mobile-structured-agent-session-queued.test-fixture' - -export function withText(body: AgentSessionQueuedMessage['body'], text: string) { - const edited = queuedMessageWithEdit(body, { text }) - if (!edited.ok) { - throw new Error(edited.reason) - } - return edited.body -} - -export function editHoldReply(params: unknown): RpcResponse { - const result: AgentSessionQueuedMessageEditHoldResult = - fieldsOf(params).action === 'release' - ? { status: 'released' } - : { status: 'held', fingerprint: 'fp', leaseDurationMs: 120_000, remainingMs: 120_000 } - return ok(result) -} - -export function readOrHoldReply(method: string, params: unknown): RpcResponse { - return method === 'agentSession.queuedMessageEditHold' - ? editHoldReply(params) - : ok({ models: [], current: {} }) -} - -vi.mock('react-native', async () => ({ - ...(await import('../test-support/react-native-motion-stub')).reactNativeMotionStub(), - Text: 'Text', - View: 'View', - Pressable: 'Pressable', - ScrollView: 'ScrollView', - TextInput: 'TextInput', - ActivityIndicator: 'ActivityIndicator', - Image: 'Image', - Keyboard: { dismiss: vi.fn() }, - Platform: { OS: 'ios' }, - useWindowDimensions: () => ({ fontScale: 1 }), - StyleSheet: { create: (styles: unknown) => styles } -})) -vi.mock('lucide-react-native', () => ({ - FileText: 'FileText', - Package: 'Package', - Terminal: 'Terminal', - ArrowUp: 'ArrowUp', - AtSign: 'AtSign', - AlertCircle: 'AlertCircle', - Image: 'Image', - Paperclip: 'Paperclip', - Check: 'Check', - ChevronDown: 'ChevronDown', - ChevronLeft: 'ChevronLeft', - ChevronRight: 'ChevronRight', - CornerDownRight: 'CornerDownRight', - ListEnd: 'ListEnd', - MoreHorizontal: 'MoreHorizontal', - Mic: 'Mic', - Pencil: 'Pencil', - Play: 'Play', - Plus: 'Plus', - Send: 'Send', - ShieldAlert: 'ShieldAlert', - Square: 'Square', - Trash2: 'Trash2', - X: 'X' -})) -vi.mock('@react-native-async-storage/async-storage', () => ({ - default: { getItem: async () => null, setItem: async () => {}, removeItem: async () => {} } -})) - -export function mobileQueuedEditHarness() { - const state: { - renderer?: ReactTestRenderer - bottomText: string - hook?: ReturnType - menu?: ReturnType - listener?: (data: unknown) => void - } = { bottomText: '' } - const append = vi.fn(() => true) - const error = vi.fn() - const notice = vi.fn() - const resolved = vi.fn() - const sendRequest = vi.fn() - const client: RpcClient = { - sendRequest, - subscribe: (_method, _params, onData) => { - if (_method === 'agentSession.subscribe') { - state.listener = onData - } - return () => {} - }, - updateTerminalSubscriptionViewport: () => {}, - getState: () => 'connected', - getReconnectAttempt: () => 0, - getLastConnectedAt: () => null, - onStateChange: () => () => {}, - notifyForeground: () => {}, - close: () => {} - } - function Harness({ - sessionId = SESSION_ID, - editSupport = true, - enabled = true, - connected = true, - transport = client, - composerScopeKey, - imagesSupport = false, - skillsSupport = false, - agent = 'codex', - renderContent - }: { - sessionId?: string - editSupport?: boolean | null - enabled?: boolean - connected?: boolean - transport?: RpcClient | null - composerScopeKey?: string - imagesSupport?: boolean - skillsSupport?: boolean - agent?: string - renderContent?: (hook: ReturnType) => ReactNode - }): ReactNode { - state.bottomText = useMobileNativeChatDraft('original-bottom') - state.hook = useMobileStructuredAgentSession({ - client: transport, - pairedHostClient: transport, - sessionId, - sourceIdentity: 'host-a', - enabled, - connected, - agent, - hostSupport: - editSupport === null - ? null - : { - ...CAPABLE, - sendSkills: true, - queuedMessages: false, - queuedMessageImageEdit: imagesSupport, - queuedMessageSkillsEdit: skillsSupport, - queuedMessageEdit: editSupport - }, - composerScopeKey, - appendComposerText: append, - onSendError: error, - onQueuedEditNotice: notice, - onActionResolved: resolved - }) - state.menu = useMobileNativeChatComposerMenu({ - value: state.hook.queued.editor?.text ?? '', - onChangeText: (text) => state.hook?.queued.editor?.change(text), - agent, - structuredCatalog: { - reported: [{ name: 'review', kind: 'skill', path: '/B/SKILL.md' }], - conversationCommands: [] - }, - filePaths: [], - focusField: () => {}, - editing: true, - // Mirrors the real composer: the menu hands over its row; the draft keeps name and path. - onPickSkill: ({ token, path }) => { - const key = state.hook?.queued.editor?.scopeKey - if (key && path) { - updateMobileNativeChatDraftInputs(key, (before) => ({ - ...before, - skills: [{ name: token.slice(1), path }] - })) - } - } - }) - return renderContent?.(state.hook) ?? null - } - function requestedFingerprint(message: AgentSessionQueuedMessage) { - const params = sendRequest.mock.calls.findLast( - ([method]) => method === 'agentSession.queuedMessageUpdate' - )?.[1] - const fields = QueuedMessageUpdateParams.parse(params) - const edited = queuedMessageWithEdit(message.body, fields) - if (!edited.ok) { - throw new Error(edited.reason) - } - return agentSessionSendBodyFingerprint(SESSION_ID, edited.body) - } - async function mount( - message: AgentSessionQueuedMessage, - editSupport: boolean | null = true, - agent = 'codex', - sessionId = SESSION_ID - ) { - vi.clearAllMocks() - resetMobileNativeChatDraftInputsForTests() - resetMobileNativeChatDraftStoreForTests() - sendRequest.mockImplementation(async (method, params) => - method === 'agentSession.queuedMessageUpdate' - ? mutationOk({ - status: 'updated', - messageId: message.messageId, - fingerprint: requestedFingerprint(message) - }) - : readOrHoldReply(method, params) - ) - await act(async () => { - state.renderer = createWithQueryClient( - createElement(Harness, { editSupport, agent, sessionId }) - ) - }) - const snapshot = snapshotEvent({ queuedMessages: [message], runningTurn: true }) - act(() => state.listener?.({ ...snapshot, sessionId, page: { ...snapshot.page, sessionId } })) - if (editSupport !== null) { - await act(async () => { - expect(await state.hook!.queued.edit!(message.messageId)).toBe(true) - }) - } - } - afterEach(async () => { - await act(async () => state.renderer?.unmount()) - vi.useRealTimers() - vi.unstubAllGlobals() - }) - - return { - state, - Harness, - mount, - client, - sendRequest, - append, - error, - notice, - resolved, - requestedFingerprint - } -} diff --git a/mobile/src/session/mobile-session-appearance-startup.test.tsx b/mobile/src/session/mobile-session-appearance-startup.test.tsx deleted file mode 100644 index afa67b42404..00000000000 --- a/mobile/src/session/mobile-session-appearance-startup.test.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import { createElement } from 'react' -import { act, create, type ReactTestInstance, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { MobileSessionRouteScreen } from './MobileSessionRouteScreen' - -// Mocked react-native components are string tags that ReactTestInstance's ElementType omits. -function hostType(node: ReactTestInstance): unknown { - return node.type -} - -const state = vi.hoisted(() => ({ - terminalPreferencesReady: false, - accessoryPreferencesReady: false, - nativeChatController: { sessionViewReady: false } -})) -const mounts = vi.hoisted(() => ({ count: 0 })) -vi.mock('react-native', () => ({ - ActivityIndicator: 'ActivityIndicator', - Text: 'Text', - View: 'View' -})) -vi.mock('./mobile-session-styles', () => ({ styles: {} })) -vi.mock('./use-mobile-session-controller', () => ({ useMobileSessionController: () => state })) -vi.mock('./MobileSessionSurface', async () => { - const react = await import('react') - return { - MobileSessionSurface: () => { - react.useEffect(() => { - mounts.count += 1 - }, []) - return react.createElement('ReadySession') - } - } -}) - -let renderer: ReactTestRenderer | null = null -afterEach(() => { - act(() => renderer?.unmount()) - renderer = null -}) - -describe('first visible session appearance', () => { - it.each(['terminal', 'accessory', 'chat'] as const)( - 'waits for the saved %s setting before mounting the session', - (waiting) => { - state.terminalPreferencesReady = waiting !== 'terminal' - state.accessoryPreferencesReady = waiting !== 'accessory' - state.nativeChatController.sessionViewReady = waiting !== 'chat' - mounts.count = 0 - const render = () => - act(() => { - if (renderer) { - renderer.update(createElement(MobileSessionRouteScreen)) - } else { - renderer = create(createElement(MobileSessionRouteScreen)) - } - }) - const expectPreparing = () => { - expect(renderer?.root.findAll((node) => hostType(node) === 'ReadySession')).toHaveLength(0) - expect( - renderer?.root.findAll((node) => hostType(node) === 'ActivityIndicator') - ).toHaveLength(1) - expect(mounts.count).toBe(0) - } - render() - expectPreparing() - state.terminalPreferencesReady = true - state.accessoryPreferencesReady = true - state.nativeChatController.sessionViewReady = true - render() - expect(renderer?.root.findAll((node) => hostType(node) === 'ReadySession')).toHaveLength(1) - expect(mounts.count).toBe(1) - render() - expect(mounts.count).toBe(1) - } - ) -}) diff --git a/mobile/src/session/mobile-session-frame-styles.ts b/mobile/src/session/mobile-session-frame-styles.ts index 524a265cc29..352a639e607 100644 --- a/mobile/src/session/mobile-session-frame-styles.ts +++ b/mobile/src/session/mobile-session-frame-styles.ts @@ -58,108 +58,6 @@ export const mobileSessionFrameStyles = themedStyleSheet(() => ({ color: colors.textSecondary, fontSize: typography.metaSize }, - tabBar: { - flexDirection: 'row', - alignItems: 'center', - borderTopWidth: 1, - borderTopColor: colors.borderSubtle - }, - // Cancels the top bar's vertical padding so tab borders run the bar's full height. - tabBarInTopBar: { - flex: 1, - minWidth: 0, - flexDirection: 'row', - alignItems: 'center', - alignSelf: 'stretch', - marginVertical: -spacing.xs, - marginLeft: spacing.md, - borderLeftWidth: 1, - borderLeftColor: colors.borderSubtle - }, - tabScrollFrame: { - flex: 1, - minWidth: 0, - flexDirection: 'row', - alignItems: 'center', - alignSelf: 'stretch' - }, - tabEdgeHint: { - position: 'absolute', - top: 0, - bottom: 0, - justifyContent: 'center', - paddingHorizontal: spacing.xs, - backgroundColor: colors.bgPanel - }, - tabEdgeHintLeft: { - left: 0, - borderRightWidth: 1, - borderRightColor: colors.borderSubtle - }, - tabEdgeHintRight: { - right: 0, - borderLeftWidth: 1, - borderLeftColor: colors.borderSubtle - }, - // Opaque like the chrome behind it: see the chat page scroll (#36553). - tabScroll: { - flex: 1, - maxHeight: 44, - backgroundColor: colors.bgPanel - }, - tabScrollInTopBar: { - alignSelf: 'stretch', - maxHeight: 44 - }, - tabContent: { - paddingLeft: spacing.md, - paddingRight: spacing.sm - }, - tabContentInTopBar: { - paddingLeft: 0 - }, - tab: { - minWidth: 44, - maxWidth: 128, - minHeight: 44, - alignItems: 'center', - justifyContent: 'center', - paddingHorizontal: spacing.sm, - paddingVertical: spacing.sm, - borderBottomWidth: 2, - borderBottomColor: 'transparent', - borderRightWidth: 1, - borderRightColor: colors.borderSubtle - }, - tabFirst: { - borderLeftWidth: 1, - borderLeftColor: colors.borderSubtle - }, - tabActive: { - borderBottomColor: colors.textSecondary, - backgroundColor: colors.bgRaised - }, - tabPressed: { - backgroundColor: colors.translucentFill - }, - tabLabelRow: { - maxWidth: '100%', - flexDirection: 'row', - alignItems: 'center', - gap: spacing.xs - }, - // Prevent web SVG shrink before the title ellipsizes. - tabIcon: { - flexShrink: 0 - }, - tabText: { - flexShrink: 1, - color: colors.textSecondary, - fontSize: 13 - }, - tabTextActive: { - color: colors.textPrimary - }, newTerminalButtonPressed: { backgroundColor: colors.bgRaised }, diff --git a/mobile/src/session/mobile-session-status-result.ts b/mobile/src/session/mobile-session-status-result.ts deleted file mode 100644 index 722e62ab480..00000000000 --- a/mobile/src/session/mobile-session-status-result.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type RuntimeStatusResult = { - capabilities?: string[] -} diff --git a/mobile/src/session/mobile-structured-agent-prompts-free-text.test.ts b/mobile/src/session/mobile-structured-agent-prompts-free-text.test.ts deleted file mode 100644 index 950672cc3c7..00000000000 --- a/mobile/src/session/mobile-structured-agent-prompts-free-text.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { AgentJournalFreeTextInput } from '../../../src/shared/agent-session/journal/agent-session-journal-types' -import { formatQuestionFreeTextAnswer } from './native-chat/input/mobile-native-chat-question' -import { - projectStructuredQuestion, - structuredQuestionResponseTarget, - type StructuredQuestionItem -} from './mobile-structured-agent-prompts' - -function prompt(freeTextInput?: AgentJournalFreeTextInput): StructuredQuestionItem { - return { - itemId: 'item-1', - revision: 3, - sequence: 1, - observedAt: 1, - body: { - kind: 'question', - question: 'Edit the draft', - options: [], - freeTextQuestionId: 'q1', - ...(freeTextInput ? { freeTextInput } : {}), - resolution: { state: 'pending', selectedOptionId: null, resolvedBy: null, resolvedAt: null } - } - } -} - -describe('mobile structured free-text questions', () => { - it('accepts empty and whitespace text only for the matching allowed prompt', () => { - const current = prompt({ allowEmpty: true }) - const projected = projectStructuredQuestion(current)! - for (const answer of ['', ' \n ']) { - const response = formatQuestionFreeTextAnswer(projected, answer) - expect(structuredQuestionResponseTarget(response, current)).toEqual({ - itemId: 'item-1', - expectedRevision: 3, - answer: { questionId: 'q1', optionIds: [], other: answer } - }) - expect(structuredQuestionResponseTarget(response, prompt())).toBeNull() - } - expect( - structuredQuestionResponseTarget(formatQuestionFreeTextAnswer(projected, ''), { - ...current, - revision: 4 - }) - ).toBeNull() - }) - - it('keeps legacy trimming for ordinary free-text answers', () => { - const current = prompt() - const projected = projectStructuredQuestion(current)! - expect( - structuredQuestionResponseTarget( - formatQuestionFreeTextAnswer(projected, ' draft '), - current - ) - ).toMatchObject({ answer: { other: 'draft' } }) - expect(structuredQuestionResponseTarget('', current)).toBeNull() - }) -}) diff --git a/mobile/src/session/mobile-structured-chat-fork.ts b/mobile/src/session/mobile-structured-chat-fork.ts index ff26e8eb7c7..009bde60332 100644 --- a/mobile/src/session/mobile-structured-chat-fork.ts +++ b/mobile/src/session/mobile-structured-chat-fork.ts @@ -7,7 +7,7 @@ import type { StructuredAgentSessionForkSource } from '../../../src/shared/agent-session/structured-agent-session-create' import { AGENT_SESSION_CREATE_TAB_PLACEMENT_RUNTIME_CAPABILITY } from '../../../src/shared/agent-session/agent-session-create-capabilities' -import { createMobileStructuredAgentSession } from './mobile-structured-agent-session-launch' +import { createMobileStructuredAgentSession } from './native-chat/agent-session/mobile-structured-agent-session-launch' import { launchedSelection, withLaunchReply, diff --git a/mobile/src/session/native-chat/MobileNativeChatDiffCard.test.tsx b/mobile/src/session/native-chat/MobileNativeChatDiffCard.test.tsx deleted file mode 100644 index 42da6626f1e..00000000000 --- a/mobile/src/session/native-chat/MobileNativeChatDiffCard.test.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import './transcript/mobile-agent-message-renderer.test-fixture' -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, expect, it } from 'vitest' -import { findAllByHostType } from '../../test-support/react-test-renderer-host-nodes' -import { Transcript, textIn } from './transcript/mobile-native-chat-turn-diff.test-fixture' - -let renderer: ReactTestRenderer | null = null -afterEach(() => { - act(() => renderer?.unmount()) - renderer = null -}) - -it('shows finished-turn files outside folded work and opens a patch with one tap', () => { - act(() => { - renderer = create(createElement(Transcript, { working: true })) - }) - expect(textIn(renderer!.root)).toContain('greeting.ts') - act(() => { - renderer!.update(createElement(Transcript)) - }) - expect(textIn(renderer!.root)).toContain('greeting.ts') - expect(textIn(renderer!.root)).not.toContain('diagnostic-output') - expect(textIn(renderer!.root)).not.toContain('helloNew()') - const file = findAllByHostType(renderer!.root, 'Pressable').find( - (node) => node.props.accessibilityLabel === '/repo/greeting.ts' - )! - act(() => file.props.onPress()) - expect(textIn(renderer!.root)).toContain('helloNew()') - expect(textIn(renderer!.root)).not.toContain('statusNew()') - act(() => renderer!.unmount()) - act(() => { - renderer = create(createElement(Transcript)) - }) - expect(textIn(renderer!.root)).toContain('status.ts') -}) diff --git a/mobile/src/session/native-chat/MobileNativeChatOverlay.tsx b/mobile/src/session/native-chat/MobileNativeChatOverlay.tsx index 649307a056f..398c127dd31 100644 --- a/mobile/src/session/native-chat/MobileNativeChatOverlay.tsx +++ b/mobile/src/session/native-chat/MobileNativeChatOverlay.tsx @@ -1,4 +1,4 @@ -import { MobileQueuedMessageComposerContext } from '../mobile-queued-message-composer-context' +import { MobileQueuedMessageComposerContext } from './input/mobile-queued-message-composer-context' import { Activity, useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react' import { StyleSheet, View } from 'react-native' import { MobileNativeChatView, type MobileNativeChatInputLockReason } from './MobileNativeChatView' @@ -6,11 +6,11 @@ import { useMobileNativeChatProjection } from './transcript/use-mobile-native-ch import { nativeChatDockedTaskList } from '../../../../src/shared/native-chat/input/native-chat-task-list-state' import type { MobileNativeChatImageAttachments } from './composer/use-mobile-native-chat-image-attachments' import type { MobileNativeChatController } from './mobile-native-chat-controller-contract' -import type { MobileNativeChatStructuredComposer } from './composer/MobileNativeChatComposer' +import type { MobileNativeChatStructuredComposer } from './composer/mobile-native-chat-structured-composer' import { useMobileNativeChatComposerTray } from './composer/use-mobile-native-chat-composer-tray' import { useMobileNativeChatVisualRenderer } from './visual/MobileNativeChatVisual' import { MobileNativeChatVisualContext } from './visual/mobile-native-chat-visual-context' -import { MobileNativeChatRootItemSourceContext } from './mobile-native-chat-item-read' +import { MobileNativeChatRootItemSourceContext } from './transcript/mobile-native-chat-item-read' import { useMobileNativeChatMessageDetail } from './transcript/use-mobile-native-chat-message-detail' import { MobileNativeChatReplyRevealsContext, @@ -19,7 +19,7 @@ import { import { MobileNativeChatRowOverlaysHost } from './transcript/MobileNativeChatRowOverlaysHost' import { nativeChatAskRequiresTerminal } from '../../../../src/shared/native-chat/native-chat-agent-support' import { tuiAgentDisplayName } from '../../../../src/shared/agent-launch/catalog/tui-agent-display-names' -import { MobileNativeChatNoticeContext } from '../mobile-native-chat-notice-context' +import { MobileNativeChatNoticeContext } from './transcript/mobile-native-chat-notice-context' import type { MobileNativeChatImageSource } from './visual/mobile-native-chat-image-preview' import type { MobileNativeChatHostOutage } from './mobile-native-chat-host-outage' import { useMobileNativeChatMarkdownLinks } from './use-mobile-native-chat-markdown-links' diff --git a/mobile/src/session/native-chat/MobileNativeChatView.failure-banner.test.ts b/mobile/src/session/native-chat/MobileNativeChatView.failure-banner.test.ts index 6e7ba0d0431..d2438307f36 100644 --- a/mobile/src/session/native-chat/MobileNativeChatView.failure-banner.test.ts +++ b/mobile/src/session/native-chat/MobileNativeChatView.failure-banner.test.ts @@ -1,14 +1,9 @@ import { describe, expect, it, vi } from 'vitest' import { installChatViewHooks, - assistantTurn, - banners, bannerText, - hostType, - listIds, pressSend, render, - root, update } from './MobileNativeChatView.harness.test-fixture' @@ -51,35 +46,6 @@ vi.mock('./composer/MobileNativeChatComposer', async () => { describe('MobileNativeChatView: send and read failure banners', () => { installChatViewHooks() - it('leaves only the words of a read that failed for good, over a loaded transcript', async () => { - const loaded = [assistantTurn('m1', 'earlier reply')] - const words = 'This chat was saved by a newer Orca. Update Orca to open it.' - const shown = (text: string) => - root().findAll((node) => hostType(node) === 'Text' && node.props.children === text) - const composers = () => root().findAll((node) => hostType(node) === 'Composer') - const lists = () => root().findAll((node) => hostType(node) === 'FlatList') - const failure = { - messages: loaded, - folded: loaded, - status: 'error' as const, - error: words, - canStop: true, - permission: { title: 'Approve?', options: [{ label: 'Allow', send: '1' }] }, - sendErrorMessage: 'Message unconfirmed — check chat before retrying' - } - await render({ ...failure, readFailedFinally: true }) - expect(shown(words)).toHaveLength(1) - expect(composers()).toHaveLength(0) - expect(lists()).toHaveLength(0) - expect(banners()).toHaveLength(0) - expect(root().findAllByProps({ accessibilityLabel: 'Stop the agent' })).toHaveLength(0) - - await update({ ...failure, error: "Orca couldn't open this chat's history right now." }) - expect(listIds()).toEqual(['m1']) - expect(composers()).toHaveLength(1) - expect(banners()).toHaveLength(1) - }) - it('retires the previous banner before sending and preserves the new delivery notice', async () => { const onClearSendError = vi.fn() await render({ @@ -99,6 +65,6 @@ describe('MobileNativeChatView: send and read failure banners', () => { }) }) -vi.mock('../MobileQueuedMessageComposer', () => ({ +vi.mock('./input/MobileQueuedMessageComposer', () => ({ MobileQueuedMessageComposer: 'QueuedMessageComposer' })) diff --git a/mobile/src/session/native-chat/MobileNativeChatView.prompt-presentation.test.ts b/mobile/src/session/native-chat/MobileNativeChatView.prompt-presentation.test.ts deleted file mode 100644 index e905f481014..00000000000 --- a/mobile/src/session/native-chat/MobileNativeChatView.prompt-presentation.test.ts +++ /dev/null @@ -1,188 +0,0 @@ -import './MobileNativeChatView.harness.test-fixture' -import { createElement, type ComponentProps } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { Pressable } from 'react-native' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { MobileNativeChatView } from './MobileNativeChatView' -import { useMobileNativeChatPromptPresentation } from './input/use-mobile-native-chat-prompt-presentation' -import type { MobileChatPermission } from './input/mobile-native-chat-permission' -import { setMobileNativeChatDraftText } from './composer/mobile-native-chat-draft-store' -vi.mock('react-native', async () => { - const React = await import('react') - return { - ...(await import('../../test-support/react-native-motion-stub')).reactNativeMotionStub(), - ActivityIndicator: 'ActivityIndicator', - Image: 'Image', - Platform: { OS: 'ios' }, - Keyboard: { dismiss: vi.fn() }, - FlatList: React.forwardRef((props, ref) => { - React.useImperativeHandle(ref, () => ({ scrollToEnd: vi.fn(), scrollToOffset: vi.fn() }), []) - return React.createElement('FlatList', props) - }), - Pressable: 'Pressable', - ScrollView: 'ScrollView', - TextInput: 'TextInput', - StyleSheet: { create: (styles: unknown) => styles, hairlineWidth: 1 }, - Text: 'Text', - View: 'View' - } -}) -vi.mock('react-native-safe-area-context', () => ({ - useSafeAreaInsets: () => ({ top: 0, bottom: 0, left: 0, right: 0 }) -})) -vi.mock('react-native-gesture-handler', () => { - type GestureChain = { - runOnJS: () => GestureChain - onStart: () => GestureChain - onUpdate: () => GestureChain - } - const chain: GestureChain = { runOnJS: () => chain, onStart: () => chain, onUpdate: () => chain } - return { - Gesture: { Simultaneous: () => ({}), Native: () => ({}), Pinch: () => chain }, - GestureDetector: 'GestureDetector', - GestureHandlerRootView: 'GestureHandlerRootView' - } -}) -vi.mock('lucide-react-native', () => - Object.fromEntries( - [ - 'ArrowDown', - 'ArrowUp', - 'ListEnd', - 'CornerDownRight', - 'ChevronDown', - 'ChevronUp', - 'ChevronsDownUp', - 'ChevronsUpDown', - 'ShieldQuestion', - 'ImagePlus', - 'Package', - 'Plus', - 'Mic', - 'Square', - 'X' - ].map((x) => [x, x]) - ) -) -vi.mock('./transcript/MobileNativeChatMessage', () => ({ - MobileNativeChatMessage: 'ChatMessage' -})) -vi.mock('./transcript/MobileNativeChatLiveLine', () => ({ - MobileNativeChatLiveLine: 'LiveStatus' -})) -vi.mock('./input/MobileNativeChatAsk', () => ({ MobileNativeChatAsk: 'ChatAsk' })) -vi.mock('./input/MobileNativeChatQuestion', () => ({ - MobileNativeChatQuestion: 'ChatQuestion' -})) -vi.mock('./input/MobileNativeChatSessionOptionPickers', () => ({ - MobileNativeChatSessionOptionPickers: 'SessionOptions' -})) -vi.mock('./composer/MobileNativeChatComposerMenu', () => ({ - MobileNativeChatComposerSuggestions: 'Suggestions' -})) -vi.mock('../../components/ActionSheetModal', () => ({ ActionSheetModal: 'ActionSheetModal' })) -vi.mock('../../components/MobileMarkdown', () => ({ MobileMarkdown: 'Markdown' })) -let tree: ReactTestRenderer | null = null -setMobileNativeChatDraftText('terminal-1', 'no, do X instead') -const props = { - messages: [], - folded: [], - status: 'ready' as const, - streaming: null, - pending: [], - onSend: vi.fn(async () => true), - sendSurfaceId: 'terminal-1', - getSendCompletionGeneration: () => 0, - getComposerEditGeneration: () => 0, - draftKey: 'terminal-1', - onComposerTextChange: vi.fn() -} -const permission: MobileChatPermission = { - title: 'Claude wants to use Bash', - options: [{ label: 'Deny', send: String.fromCharCode(27) }] -} -type Overrides = Partial> & { - waitStartedAt?: number - sessionKey?: string -} -function Harness(overrides: Overrides) { - const shown = useMobileNativeChatPromptPresentation({ - permission: overrides.permission ?? null, - waitStartedAt: overrides.waitStartedAt ?? 10, - scopeKey: 'tab-1', - sessionKey: overrides.sessionKey ?? 'session-1', - observing: true, - respondPermission: overrides.onRespondPermission ?? (async () => false) - }) - return createElement(MobileNativeChatView, { - ...props, - ...overrides, - permission: shown.permission, - promptKey: shown.occurrenceKey, - onRespondPermission: shown.respondPermission - }) -} -const render = async (overrides: Overrides) => { - await act(async () => { - const element = createElement(Harness, overrides) - if (tree) { - tree.update(element) - } else { - tree = create(element) - } - }) -} -const sendButton = () => tree!.root.findByProps({ accessibilityLabel: 'Send message' }) -const approvalAction = () => - tree!.root.findByProps({ testID: 'native-chat-approval-actions' }).findByType(Pressable) -afterEach(() => { - act(() => tree?.unmount()) - tree = null - vi.unstubAllGlobals() -}) -describe('terminal prompt presentation with the production view, card and composer', () => { - it('a late answer cannot reshow an answered replacement occurrence', async () => { - let finishOld: (accepted: boolean) => void = () => {} - const onRespondPermission = vi - .fn<(send: string) => Promise>() - .mockReturnValueOnce( - new Promise((resolve) => { - finishOld = resolve - }) - ) - .mockResolvedValueOnce(true) - await render({ permission, onRespondPermission }) - act(() => { - void approvalAction().props.onPress() - }) - await render({ permission, onRespondPermission, waitStartedAt: 20 }) - await act(async () => { - await approvalAction().props.onPress() - }) - expect(sendButton().props.disabled).toBe(false) - await act(async () => finishOld(true)) - expect(sendButton().props.disabled).toBe(false) - }) - - it('a late answer cannot dismiss a replacement session', async () => { - let finishOld: (accepted: boolean) => void = () => {} - const onRespondPermission = vi.fn( - () => - new Promise((resolve) => { - finishOld = resolve - }) - ) - await render({ permission, onRespondPermission }) - act(() => { - void approvalAction().props.onPress() - }) - await render({ permission, onRespondPermission, sessionKey: 'session-2' }) - await act(async () => finishOld(true)) - expect(sendButton().props.disabled).toBe(true) - expect(approvalAction().props.disabled).toBe(false) - }) -}) - -vi.mock('../MobileQueuedMessageComposer', () => ({ - MobileQueuedMessageComposer: 'QueuedMessageComposer' -})) diff --git a/mobile/src/session/native-chat/MobileNativeChatView.tsx b/mobile/src/session/native-chat/MobileNativeChatView.tsx index b3eead5e801..5e701c297d3 100644 --- a/mobile/src/session/native-chat/MobileNativeChatView.tsx +++ b/mobile/src/session/native-chat/MobileNativeChatView.tsx @@ -22,19 +22,19 @@ import { useMobileTranslation } from '../../i18n/use-mobile-translation' import { MobileNativeChatInputLockStatus } from './composer/MobileNativeChatInputLockStatus' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' import { styles } from './mobile-native-chat-view-styles' -import { MobileNativeChatEmptyStateView } from '../MobileNativeChatEmptyStateView' -import { mobileNativeChatListFooter } from './mobile-native-chat-list-footer' -import { mobileNativeChatListHeader } from './mobile-native-chat-list-header' +import { MobileNativeChatEmptyStateView } from './transcript/MobileNativeChatEmptyStateView' +import { mobileNativeChatListFooter } from './transcript/mobile-native-chat-list-footer' +import { mobileNativeChatListHeader } from './transcript/mobile-native-chat-list-header' import { mobileNativeChatEmptyState, type MobileNativeChatPendingItem -} from './mobile-native-chat-render-data' +} from './transcript/mobile-native-chat-render-data' import { useMobileNativeChatTransientData } from './transcript/use-mobile-native-chat-transient-data' import { useMobileNativeChatRowKeys } from './transcript/mobile-native-chat-row-keys' import { useMobileNativeChatPinchGesture } from './transcript/use-mobile-native-chat-pinch-gesture' import { useMobileNativeChatTailFollow } from './transcript/use-mobile-native-chat-tail-follow' import { useMobileNativeChatTurnDisclosure } from './transcript/use-mobile-native-chat-turn-disclosure' -import { mobileNativeChatComposerPlaceholder } from './use-mobile-native-chat-input-lease' +import { mobileNativeChatComposerPlaceholder } from './composer/use-mobile-native-chat-input-lease' import { MobileNativeChatLiveLine } from './transcript/MobileNativeChatLiveLine' import { MobileNativeChatAwaitingInputRow } from './transcript/MobileNativeChatAwaitingInputRow' import type { NativeChatAwaitingInput } from '../../../../src/shared/native-chat/native-chat-terminal-turn' @@ -43,9 +43,9 @@ import type { PendingNativeChatImage } from './composer/mobile-native-chat-image import type { MobilePastedImages } from './composer/mobile-native-chat-composer-paste' import { MobileNativeChatDraftComposer, - type MobileNativeChatSendProps, - type MobileNativeChatStructuredComposer + type MobileNativeChatSendProps } from './composer/MobileNativeChatComposer' +import type { MobileNativeChatStructuredComposer } from './composer/mobile-native-chat-structured-composer' import { MobileNativeChatPromptCard } from './input/MobileNativeChatPromptCard' import type { MobileNativeChatMicProps } from './composer/MobileNativeChatComposerMic' import { useMobileNativeChatPromptInputOwner } from './input/use-mobile-native-chat-prompt-input-owner' @@ -54,11 +54,11 @@ import { type ComposerTrayProps } from './composer/use-mobile-native-chat-composer-tray' import type { MobileNativeChatSessionOptionPickersProps } from './input/MobileNativeChatSessionOptionPickers' -import { MobileNativeChatScrollRootsBoundary } from '../MobileNativeChatScrollRootsBoundary' +import { MobileNativeChatScrollRootsBoundary } from './transcript/MobileNativeChatScrollRootsBoundary' import { MobileNativeChatRowList } from './transcript/MobileNativeChatRowList' import { useMobileNativeChatRowRenderer } from './transcript/use-mobile-native-chat-row-renderer' -import type { MobileNativeChatStatus } from './use-mobile-native-chat-session' -import type { OlderPagePhase } from '../use-mobile-older-page-loader' +import type { MobileNativeChatStatus } from './mobile-native-chat-session-status' +import type { OlderPagePhase } from './transcript/use-mobile-older-page-loader' import { MobileNativeChatOpenFileContext } from './mobile-native-chat-open-file-context' import { MobileNativeChatLowerRegion } from './MobileNativeChatLowerRegion' import { MobileNativeChatOfflineQueue } from './input/MobileNativeChatOfflineQueue' diff --git a/mobile/src/session/native-chat/MobileNativeChatView.turn-status.test.ts b/mobile/src/session/native-chat/MobileNativeChatView.turn-status.test.ts deleted file mode 100644 index 6fa4e9c347b..00000000000 --- a/mobile/src/session/native-chat/MobileNativeChatView.turn-status.test.ts +++ /dev/null @@ -1,213 +0,0 @@ -import './MobileNativeChatView.harness.test-fixture' -import { createElement, type ReactNode } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' -import { MobileNativeChatView } from './MobileNativeChatView' - -const scrollToEnd = vi.hoisted(() => vi.fn()) -const scrollToOffset = vi.hoisted(() => vi.fn()) - -vi.mock('react-native', async () => { - const React = await import('react') - return { - ...(await import('../../test-support/react-native-motion-stub')).reactNativeMotionStub(), - ActivityIndicator: 'ActivityIndicator', - FlatList: React.forwardRef< - unknown, - { - data: NativeChatMessage[] - renderItem: (row: { item: NativeChatMessage; index: number }) => ReactNode - ListFooterComponent: ReactNode - } - >((props, ref) => { - React.useImperativeHandle(ref, () => ({ scrollToEnd, scrollToOffset }), []) - return React.createElement( - 'FlatList', - props, - props.data.map((item, index) => - React.createElement(React.Fragment, { key: item.id }, props.renderItem({ item, index })) - ), - props.ListFooterComponent - ) - }), - Platform: { OS: 'ios' }, - Pressable: 'Pressable', - StyleSheet: { create: (styles: unknown) => styles, hairlineWidth: 1 }, - Text: 'Text', - View: 'View' - } -}) - -vi.mock('react-native-safe-area-context', () => ({ - useSafeAreaInsets: () => ({ top: 0, bottom: 0, left: 0, right: 0 }) -})) - -vi.mock('react-native-gesture-handler', () => { - const chain = { - runOnJS: () => chain, - onStart: () => chain, - onUpdate: () => chain - } - return { - Gesture: { Simultaneous: () => ({}), Native: () => ({}), Pinch: () => chain }, - GestureDetector: 'GestureDetector', - GestureHandlerRootView: 'GestureHandlerRootView' - } -}) - -vi.mock('lucide-react-native', () => ({ - ArrowDown: 'ArrowDown', - ChevronsDownUp: 'ChevronsDownUp', - ChevronsUpDown: 'ChevronsUpDown', - Square: 'Square' -})) - -vi.mock('./transcript/MobileNativeChatMessage', () => ({ - MobileNativeChatMessage: 'ChatMessage' -})) -vi.mock('./transcript/MobileNativeChatLiveLine', () => ({ - MobileNativeChatLiveLine: 'LiveStatus' -})) -vi.mock('./input/MobileNativeChatAsk', () => ({ MobileNativeChatAsk: 'ChatAsk' })) -vi.mock('./input/MobileNativeChatPermission', () => ({ - MobileNativeChatPermission: 'ChatPermission' -})) -vi.mock('./input/MobileNativeChatQuestion', () => ({ - MobileNativeChatQuestion: 'ChatQuestion' -})) -vi.mock('../../components/ActionSheetModal', () => ({ ActionSheetModal: 'ActionSheetModal' })) - -vi.mock('./composer/MobileNativeChatComposer', async () => { - const { composerStub } = await import('./MobileNativeChatView.render-stubs.test-fixture') - return composerStub() -}) - -type Overrides = { - messages?: Parameters[0]['messages'] - folded?: Parameters[0]['folded'] - streaming?: string | null - sendErrorMessage?: string | null - onClearSendError?: () => void - inputLockReason?: 'disconnected' | 'waiting' | null - onSend?: (text: string) => Promise - pending?: Parameters[0]['pending'] - structuredActivityUi?: boolean - turnIndicator?: Parameters[0]['turnIndicator'] - agentWorking?: boolean - canStop?: boolean - ask?: Parameters[0]['ask'] - question?: Parameters[0]['question'] - permission?: Parameters[0]['permission'] - sendSurfaceId?: string - keyboardInset?: number - hasMore?: boolean - onLoadEarlier?: () => void -} - -function chatViewElement(overrides: Overrides): ReturnType { - return createElement(MobileNativeChatView, { - messages: [], - folded: [], - status: 'ready', - streaming: null, - onSend: vi.fn().mockResolvedValue(true), - sendSurfaceId: 'tab-a', - getSendCompletionGeneration: () => 0, - getComposerEditGeneration: () => 0, - pending: [], - draftKey: null, - onComposerTextChange: vi.fn(), - ...overrides - }) -} - -describe('MobileNativeChatView', () => { - let renderer: ReactTestRenderer | null = null - - beforeEach(() => { - vi.stubGlobal('requestAnimationFrame', (callback: FrameRequestCallback) => - setTimeout(() => callback(0), 0) - ) - vi.stubGlobal('cancelAnimationFrame', (handle: ReturnType) => - clearTimeout(handle) - ) - }) - - afterEach(() => { - act(() => renderer?.unmount()) - renderer = null - scrollToEnd.mockReset() - scrollToOffset.mockReset() - vi.unstubAllGlobals() - }) - - async function render(overrides: Overrides = {}): Promise { - await act(async () => { - renderer = create(chatViewElement(overrides)) - }) - } - - async function update(overrides: Overrides = {}): Promise { - await act(async () => { - renderer?.update(chatViewElement(overrides)) - }) - } - - function renderedRow(id: string): ReturnType { - return createElement( - 'Row', - renderer!.root.find( - (node) => String(node.type) === 'ChatMessage' && node.props.message.id === id - ).props - ) - } - - describe('structured turn status wiring', () => { - const userTurn = (id: string, text: string): NativeChatMessage => ({ - id, - role: 'user', - blocks: [{ type: 'text', text }], - timestamp: 0, - source: 'transcript' - }) - - function rowProps(id: string): Record { - return (renderedRow(id) as { props: Record }).props - } - - it('does not carry a running turn clock across chat surfaces', async () => { - vi.useFakeTimers() - try { - vi.setSystemTime(1_000) - const firstTab = [userTurn('u1', 'first')] - await render({ - messages: firstTab, - folded: firstTab, - structuredActivityUi: true, - agentWorking: true, - sendSurfaceId: 'host\0worktree\0tab-a' - }) - expect(rowProps('u1').turnStatus).toMatchObject({ startedAt: 1_000 }) - - vi.setSystemTime(12_000) - const secondTab = [userTurn('u2', 'second')] - await update({ - messages: secondTab, - folded: secondTab, - structuredActivityUi: true, - agentWorking: true, - sendSurfaceId: 'host\0worktree\0tab-b' - }) - - expect(rowProps('u2').turnStatus).toMatchObject({ startedAt: 12_000 }) - } finally { - vi.useRealTimers() - } - }) - }) -}) - -vi.mock('../MobileQueuedMessageComposer', () => ({ - MobileQueuedMessageComposer: 'QueuedMessageComposer' -})) diff --git a/mobile/src/session/agent-session-failure-copy.ts b/mobile/src/session/native-chat/agent-session/agent-session-failure-copy.ts similarity index 96% rename from mobile/src/session/agent-session-failure-copy.ts rename to mobile/src/session/native-chat/agent-session/agent-session-failure-copy.ts index 541b5a76698..d7779789684 100644 --- a/mobile/src/session/agent-session-failure-copy.ts +++ b/mobile/src/session/native-chat/agent-session/agent-session-failure-copy.ts @@ -2,9 +2,9 @@ import type { AgentSessionFailureCopyId, AgentSessionFailureCopyValues, AgentSessionFailureSay -} from '../../../src/shared/agent-session/failures/agent-session-failure-copy' -import { translate } from '../i18n/mobile-i18n' -import { AGENT_SESSION_FAILURE_COPY } from '../../../src/shared/agent-session/failures/agent-session-failure-copy' +} from '../../../../../src/shared/agent-session/failures/agent-session-failure-copy' +import { translate } from '../../../i18n/mobile-i18n' +import { AGENT_SESSION_FAILURE_COPY } from '../../../../../src/shared/agent-session/failures/agent-session-failure-copy' import { START_FAILURE_COPY } from './agent-session-start-failure-copy' import { SEND_FAILURE_COPY } from './agent-session-send-failure-copy' diff --git a/mobile/src/session/agent-session-send-failure-copy.ts b/mobile/src/session/native-chat/agent-session/agent-session-send-failure-copy.ts similarity index 87% rename from mobile/src/session/agent-session-send-failure-copy.ts rename to mobile/src/session/native-chat/agent-session/agent-session-send-failure-copy.ts index 1564774d712..4efaf079a87 100644 --- a/mobile/src/session/agent-session-send-failure-copy.ts +++ b/mobile/src/session/native-chat/agent-session/agent-session-send-failure-copy.ts @@ -1,8 +1,9 @@ +import { AGENT_SESSION_FAILURE_COPY } from '../../../../../src/shared/agent-session/failures/agent-session-failure-copy' import type { AgentSessionFailureCopyId, AgentSessionFailureCopyValues -} from '../../../src/shared/agent-session/failures/agent-session-failure-copy' -import { translate } from '../i18n/mobile-i18n' +} from '../../../../../src/shared/agent-session/failures/agent-session-failure-copy' +import { translate } from '../../../i18n/mobile-i18n' export const SEND_FAILURE_COPY = { unconfirmed: (values) => @@ -53,6 +54,26 @@ export const SEND_FAILURE_COPY = { "{{agent}} couldn't use {{detail}}. Update {{agent}} to {{minimumVersion}} or later to keep it after a restart, or pick another model and send again.", values ), + selectedModel: (values) => + translate('session.failure.selectedModel', AGENT_SESSION_FAILURE_COPY.selectedModel, values), + providerUnavailable: (values) => + translate( + 'session.failure.providerUnavailable', + AGENT_SESSION_FAILURE_COPY.providerUnavailable, + values + ), + providerSafetyStopped: (values) => + translate( + 'session.failure.providerSafetyStopped', + AGENT_SESSION_FAILURE_COPY.providerSafetyStopped, + values + ), + providerResponseFailed: (values) => + translate( + 'session.failure.providerResponseFailed', + AGENT_SESSION_FAILURE_COPY.providerResponseFailed, + values + ), providerRejected: (values) => translate('session.failure.providerRejected', "{{agent}} didn't accept this message.", values), providerRejectedQuoted: (values) => diff --git a/mobile/src/session/agent-session-start-failure-copy.ts b/mobile/src/session/native-chat/agent-session/agent-session-start-failure-copy.ts similarity index 98% rename from mobile/src/session/agent-session-start-failure-copy.ts rename to mobile/src/session/native-chat/agent-session/agent-session-start-failure-copy.ts index 036264d4a0a..924ff47be42 100644 --- a/mobile/src/session/agent-session-start-failure-copy.ts +++ b/mobile/src/session/native-chat/agent-session/agent-session-start-failure-copy.ts @@ -1,8 +1,8 @@ import type { AgentSessionFailureCopyId, AgentSessionFailureCopyValues -} from '../../../src/shared/agent-session/failures/agent-session-failure-copy' -import { translate } from '../i18n/mobile-i18n' +} from '../../../../../src/shared/agent-session/failures/agent-session-failure-copy' +import { translate } from '../../../i18n/mobile-i18n' export const START_FAILURE_COPY = { savedConversationMissing: (values) => diff --git a/mobile/src/session/agent-session-write-notice-copy.ts b/mobile/src/session/native-chat/agent-session/agent-session-write-notice-copy.ts similarity index 96% rename from mobile/src/session/agent-session-write-notice-copy.ts rename to mobile/src/session/native-chat/agent-session/agent-session-write-notice-copy.ts index ffab10462a5..ca95e2529ca 100644 --- a/mobile/src/session/agent-session-write-notice-copy.ts +++ b/mobile/src/session/native-chat/agent-session/agent-session-write-notice-copy.ts @@ -1,10 +1,10 @@ -import { expiredAttachmentsSentence } from '../../../src/shared/agent-session/failures/agent-session-attachment-failure-words' -import { agentSessionFailureSentence } from '../../../src/shared/agent-session/failures/agent-session-failure-words' +import { expiredAttachmentsSentence } from '../../../../../src/shared/agent-session/failures/agent-session-attachment-failure-words' +import { agentSessionFailureSentence } from '../../../../../src/shared/agent-session/failures/agent-session-failure-words' import type { AgentSessionWriteNoticePart, AgentSessionWriteNoticeSentence -} from '../../../src/shared/agent-session/failures/agent-session-write-notice-copy' -import { translate } from '../i18n/mobile-i18n' +} from '../../../../../src/shared/agent-session/failures/agent-session-write-notice-copy' +import { translate } from '../../../i18n/mobile-i18n' import { sayMobileAgentSessionFailure } from './agent-session-failure-copy' const SENTENCES: Record string> = { diff --git a/mobile/src/session/mobile-created-structured-sessions.ts b/mobile/src/session/native-chat/agent-session/mobile-created-structured-sessions.ts similarity index 100% rename from mobile/src/session/mobile-created-structured-sessions.ts rename to mobile/src/session/native-chat/agent-session/mobile-created-structured-sessions.ts diff --git a/mobile/src/session/native-chat/agent-session/mobile-native-chat-page-read-operations.ts b/mobile/src/session/native-chat/agent-session/mobile-native-chat-page-read-operations.ts index b91d5156f2d..f7a712d7aba 100644 --- a/mobile/src/session/native-chat/agent-session/mobile-native-chat-page-read-operations.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-native-chat-page-read-operations.ts @@ -2,13 +2,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../../transport import { rpcResultVariant } from '../../../transport/rpc/rpc-operation-result-reader' import '../../../terminal/terminal-reply-schema' import { sessionForwardedReplySchema } from '../../../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../../agent-launch/mobile-agent-detection-reply-schema' -import '../../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../../terminal/session/mobile-session-terminal-reply-schema' -import '../../../worktree/session-worktree-record-reply-schema' -import '../composer/mobile-native-chat-skill-reply-schema' -import '../../../terminal/quick-commands/mobile-quick-command-reply-schema' -import '../../../files/workspace-file-paths-reply-schema' // Retain the live window on refusal and let the caller offer retry; read the whole legacy error/window union before selecting messages. export const nativeChatSessionPageRead = bindDeferredRpcOperation( diff --git a/mobile/src/session/mobile-structured-agent-session-cancel.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-cancel.ts similarity index 89% rename from mobile/src/session/mobile-structured-agent-session-cancel.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-cancel.ts index e7678dfbed5..849b252116f 100644 --- a/mobile/src/session/mobile-structured-agent-session-cancel.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-cancel.ts @@ -1,18 +1,18 @@ import { useCallback, useRef } from 'react' import type { StructuredAgentSessionHostSupport } from './mobile-structured-agent-session-host-support' -import type { AgentSessionCancelResult } from '../../../src/shared/agent-session/agent-session-wire' -import type { StructuredAgentSessionState } from '../../../src/shared/agent-session/structured-agent-session-reducer' -import { runningStructuredAgentSessionTurnId } from '../../../src/shared/agent-session/view/structured-agent-session-live-turn' +import type { AgentSessionCancelResult } from '../../../../../src/shared/agent-session/agent-session-wire' +import type { StructuredAgentSessionState } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' +import { runningStructuredAgentSessionTurnId } from '../../../../../src/shared/agent-session/view/structured-agent-session-live-turn' import { joinStructuredAgentSessionStop, structuredAgentSessionStopIsJoinable -} from '../../../src/shared/agent-session/requests/structured-agent-session-stop-join' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +} from '../../../../../src/shared/agent-session/requests/structured-agent-session-stop-join' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import { requestStructuredAgentSessionMutation, type StructuredAgentSessionMutationCallResult } from './mobile-structured-agent-session-rpc' -import { actionableStructuredPrompts } from './mobile-structured-actionable-prompt' +import { actionableStructuredPrompts } from '../input/mobile-structured-actionable-prompt' type PromptIdentity = { itemId: string; expectedRevision: number } diff --git a/mobile/src/session/mobile-structured-agent-session-contract.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-contract.ts similarity index 63% rename from mobile/src/session/mobile-structured-agent-session-contract.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-contract.ts index f3d9f5284fd..f869e25c360 100644 --- a/mobile/src/session/mobile-structured-agent-session-contract.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-contract.ts @@ -1,36 +1,36 @@ -import type { AgentSessionSlashCommand } from '../../../src/shared/agent-session/agent-session-wire' -import type { NativeChatSendFollowUp } from '../../../src/shared/native-chat/input/native-chat-follow-up-behavior' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +import type { AgentSessionSlashCommand } from '../../../../../src/shared/agent-session/agent-session-wire' +import type { NativeChatSendFollowUp } from '../../../../../src/shared/native-chat/input/native-chat-follow-up-behavior' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import type { StructuredAgentSessionHostSupport } from './mobile-structured-agent-session-host-support' import type { MobileNativeChatSendIntent, MobileNativeChatSendOutcome -} from './native-chat/mobile-native-chat-send' -import type { MobileNativeChatVisualSource } from './native-chat/visual/mobile-native-chat-visual-read' -import type { MobileChatPermission } from './native-chat/input/mobile-native-chat-permission' -import type { MobileChatQuestion } from './native-chat/input/mobile-native-chat-question' -import type { MobileNativeChatSession } from './native-chat/use-mobile-native-chat-session' -import type { NativeChatLiveTurnIndicator } from '../../../src/shared/native-chat/transcript/native-chat-turn-status' -import type { NativeChatResolvedPrompt } from '../../../src/shared/native-chat/native-chat-resolution-receipt' -import type { useMobileStructuredAgentOptions } from './use-mobile-structured-agent-options' -import type { useMobileStructuredAgentTurnTiming } from './use-mobile-structured-agent-turn-timing' -import type { StructuredMobileSendAttachment } from './use-mobile-structured-send-with-outcome' +} from '../composer/mobile-native-chat-send' +import type { MobileNativeChatVisualSource } from '../visual/mobile-native-chat-visual-read' +import type { MobileChatPermission } from '../input/mobile-native-chat-permission' +import type { MobileChatQuestion } from '../input/mobile-native-chat-question' +import type { MobileNativeChatSession } from '../use-mobile-native-chat-session' +import type { NativeChatLiveTurnIndicator } from '../../../../../src/shared/native-chat/transcript/native-chat-turn-status' +import type { NativeChatResolvedPrompt } from '../../../../../src/shared/native-chat/native-chat-resolution-receipt' +import type { useMobileStructuredAgentOptions } from '../input/use-mobile-structured-agent-options' +import type { useMobileStructuredAgentTurnTiming } from '../transcript/use-mobile-structured-agent-turn-timing' +import type { StructuredMobileSendAttachment } from '../composer/use-mobile-structured-send-with-outcome' import type { AgentJournalSkillRef, AgentJournalSubmission -} from '../../../src/shared/agent-session/journal/agent-session-journal-types' +} from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' import type { MobileNativeChatCommandRefusalCauses, MobileNativeChatSendErrorReporter -} from './native-chat/use-mobile-native-chat-send-error' -import type { MobileStructuredQueuedMessageControls } from './use-mobile-structured-queued-message-controls' -import type { MobileStructuredBackgroundTasks } from './use-mobile-structured-background-tasks' -import type { NativeChatContextUsageSummary } from '../../../src/shared/native-chat/native-chat-context-usage-summary' -import type { MobileStructuredInterruptedContinue } from './use-mobile-structured-interrupted-continue' -import type { MobileStructuredThreadGoal } from './use-mobile-structured-thread-goal' -import type { MobileStructuredSends } from './use-mobile-structured-sends' -import type { AgentSessionRewindSurface } from '../../../src/shared/agent-session/lifecycle/agent-session-rewind-request' -import type { MobileNativeChatUsageLimit } from './native-chat/use-mobile-native-chat-usage-limit' +} from '../composer/use-mobile-native-chat-send-error' +import type { MobileStructuredQueuedMessageControls } from '../input/use-mobile-structured-queued-message-controls' +import type { MobileStructuredBackgroundTasks } from '../input/use-mobile-structured-background-tasks' +import type { NativeChatContextUsageSummary } from '../../../../../src/shared/native-chat/native-chat-context-usage-summary' +import type { MobileStructuredInterruptedContinue } from '../composer/use-mobile-structured-interrupted-continue' +import type { MobileStructuredThreadGoal } from '../input/use-mobile-structured-thread-goal' +import type { MobileStructuredSends } from '../composer/use-mobile-structured-sends' +import type { AgentSessionRewindSurface } from '../../../../../src/shared/agent-session/lifecycle/agent-session-rewind-request' +import type { MobileNativeChatUsageLimit } from '../use-mobile-native-chat-usage-limit' export type StructuredMobileSession = Omit< ReturnType, diff --git a/mobile/src/session/mobile-structured-agent-session-host-support.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-host-support.ts similarity index 90% rename from mobile/src/session/mobile-structured-agent-session-host-support.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-host-support.ts index af40170fc5b..ab43f813b57 100644 --- a/mobile/src/session/mobile-structured-agent-session-host-support.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-host-support.ts @@ -2,12 +2,12 @@ import { AGENT_SESSION_COMMANDS_ON_REQUEST_CAPABILITY, AGENT_SESSION_MODEL_EFFORT_DISCOVERY_CAPABILITY, AGENT_SESSION_COHERENT_MODEL_CATALOG_CAPABILITY -} from '../../../src/shared/agent-session/structured-agent-session-surface-capabilities' +} from '../../../../../src/shared/agent-session/structured-agent-session-surface-capabilities' import { AGENT_SESSION_CONVERSATION_STOP_RUNTIME_CAPABILITY, AGENT_SESSION_PROMPT_CANCEL_RUNTIME_CAPABILITY, AGENT_SESSION_REPEATED_STOP_RUNTIME_CAPABILITY -} from '../../../src/shared/agent-session/lifecycle/agent-session-stop-capabilities' +} from '../../../../../src/shared/agent-session/lifecycle/agent-session-stop-capabilities' import { AGENT_SESSION_ITEM_DETAIL_RUNTIME_CAPABILITY, AGENT_SESSION_SEND_RECORDED_RUNTIME_CAPABILITY, @@ -22,21 +22,21 @@ import { AGENT_SESSION_PHONE_REWIND_RUNTIME_CAPABILITY, AGENT_SESSION_PHONE_USAGE_LIMIT_CONTINUE_CANCEL_RUNTIME_CAPABILITY, AGENT_SESSION_QUEUED_MESSAGE_SKILLS_EDIT_RUNTIME_CAPABILITY -} from '../../../src/shared/agent-session/agent-session-runtime-capabilities' -import { AGENT_SESSION_STATUS_FEED_RUNTIME_CAPABILITY } from '../../../src/shared/agent-session/agent-session-attention-capabilities' +} from '../../../../../src/shared/agent-session/agent-session-runtime-capabilities' +import { AGENT_SESSION_STATUS_FEED_RUNTIME_CAPABILITY } from '../../../../../src/shared/agent-session/agent-session-attention-capabilities' import { AGENT_SESSION_SEND_SELECTION_RUNTIME_CAPABILITY, AGENT_SESSION_SEND_OPTIONS_RUNTIME_CAPABILITY, AGENT_SESSION_SEND_SKILLS_RUNTIME_CAPABILITY, AGENT_SESSION_SEND_USAGE_LIMIT_CONTINUATION_RUNTIME_CAPABILITY, AGENT_SESSION_USAGE_LIMIT_AUTO_CONTINUE_RUNTIME_CAPABILITY -} from '../../../src/shared/agent-session/agent-session-create-capabilities' +} from '../../../../../src/shared/agent-session/agent-session-create-capabilities' import { AGENT_SESSION_PERMISSION_MODES_RUNTIME_CAPABILITY, AGENT_SESSION_PERMISSION_OWN_RUNTIME_CAPABILITY -} from '../../../src/shared/agent-session/agent-session-permission-modes-capability' -import { SKILL_DISCOVER_WORKSPACE_CAPABILITY } from '../../../src/shared/skill-install-capability' -import { AGENT_SESSION_PHONE_CONTINUE_INTERRUPTED_RUNTIME_CAPABILITY } from '../../../src/shared/agent-session/agent-session-continue-interrupted-capability' +} from '../../../../../src/shared/agent-session/agent-session-permission-modes-capability' +import { SKILL_DISCOVER_WORKSPACE_CAPABILITY } from '../../../../../src/shared/skill-install-capability' +import { AGENT_SESSION_PHONE_CONTINUE_INTERRUPTED_RUNTIME_CAPABILITY } from '../../../../../src/shared/agent-session/agent-session-continue-interrupted-capability' export type StructuredAgentSessionHostSupport = { commandsOnRequest?: boolean diff --git a/mobile/src/session/mobile-structured-agent-session-launch.test.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.test.ts similarity index 64% rename from mobile/src/session/mobile-structured-agent-session-launch.test.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.test.ts index b5b62c474c0..13c056860b2 100644 --- a/mobile/src/session/mobile-structured-agent-session-launch.test.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import { markRpcDeliveryUnknown } from '../transport/rpc/rpc-delivery-ambiguity' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import { markRpcDeliveryUnknown } from '../../../transport/rpc/rpc-delivery-ambiguity' import { createMobileStructuredAgentSession } from './mobile-structured-agent-session-launch' import './mobile-created-structured-sessions' @@ -57,3 +57,31 @@ it('settles a proven missing-original fork refusal but keeps a lost earlier atte (await createMobileStructuredAgentSession(lost, 'workspace-1', 'opencode', forkFrom)).kind ).toBe('unknown') }) + +it('settles a proven fork read refusal without settling a prior lost copy', async () => { + const refusal = { + ok: true, + result: { + ok: false, + refusal: { + code: 'agent_session_identity_required', + details: { reason: 'transcriptUnreadable' }, + createAttemptRefusedBeforeCommit: true, + message: 'Codex could not read the saved chat.' + } + } + } + const client = clientReturning({ ok: true, result: { supported: true } }, refusal) + const forkFrom = { sessionId: 'source-chat', throughItemId: 'codex:source:selected:1' } + expect( + (await createMobileStructuredAgentSession(client, 'workspace-1', 'codex', forkFrom)).kind + ).toBe('failed') + const lost = clientReturning({ ok: true, result: { supported: true } }, refusal) + lost.sendRequest + .mockImplementationOnce(async () => ({ ok: true, result: { supported: true } })) + .mockRejectedValueOnce(markRpcDeliveryUnknown(new Error('copy reply lost'))) + .mockResolvedValueOnce(refusal) + expect( + (await createMobileStructuredAgentSession(lost, 'workspace-1', 'codex', forkFrom)).kind + ).toBe('unknown') +}) diff --git a/mobile/src/session/mobile-structured-agent-session-launch.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts similarity index 86% rename from mobile/src/session/mobile-structured-agent-session-launch.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts index 55dbc1ebef0..dda006a7c68 100644 --- a/mobile/src/session/mobile-structured-agent-session-launch.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-launch.ts @@ -1,29 +1,30 @@ -import { agentSessionForkSourceFailureWords } from '../../../src/shared/agent-session/failures/agent-session-failure-copy' +import { agentSessionForkSourceFailureWords } from '../../../../../src/shared/agent-session/failures/agent-session-failure-copy' import { sayMobileAgentSessionFailure } from './agent-session-failure-copy' -import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' +import type { TuiAgent } from '../../../../../src/shared/agent-launch/catalog/tui-agent' import type { AgentSessionAttachResult, AgentSessionMutationResult -} from '../../../src/shared/agent-session/agent-session-wire' +} from '../../../../../src/shared/agent-session/agent-session-wire' import { isDefinitiveAgentSessionCreateRefusal, - isAgentSessionForkSourceAdmissionRefusal -} from '../../../src/shared/agent-session/failures/agent-session-definitive-refusal' + isAgentSessionForkSourceAdmissionRefusal, + isAgentSessionCreateAdmissionRefusal +} from '../../../../../src/shared/agent-session/failures/agent-session-definitive-refusal' import { createStructuredAgentSessionId, structuredAgentSessionCreateParams, type StructuredAgentSessionCreateParams, type StructuredAgentSessionForkSource -} from '../../../src/shared/agent-session/structured-agent-session-create' -import type { StructuredAgentCreateSupportReply } from '../../../src/shared/agent-session/structured-agent-create-support-reply' -import { TUI_AGENT_DISPLAY_NAMES } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' -import { hasRuntimeRpcErrorCode } from '../../../src/shared/runtime-rpc-error-code' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +} from '../../../../../src/shared/agent-session/structured-agent-session-create' +import type { StructuredAgentCreateSupportReply } from '../../../../../src/shared/agent-session/structured-agent-create-support-reply' +import { TUI_AGENT_DISPLAY_NAMES } from '../../../../../src/shared/agent-launch/catalog/tui-agent-display-names' +import { hasRuntimeRpcErrorCode } from '../../../../../src/shared/runtime-rpc-error-code' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import { structuredAgentSessionCreate, structuredAgentSupportProbe -} from './native-chat/agent-session/mobile-structured-create-operations' -import { randomV4Uuid } from '../platform/random-v4-uuid' +} from './mobile-structured-create-operations' +import { randomV4Uuid } from '../../../platform/random-v4-uuid' import { rememberMobileCreatedStructuredSession } from './mobile-created-structured-sessions' // Partial: the reply is read before it is checked. @@ -187,7 +188,8 @@ export async function createMobileStructuredAgentSession( forkFrom && !priorCreateOutcomeUnknown && result.refusal.createAttemptRefusedBeforeCommit === true && - isAgentSessionForkSourceAdmissionRefusal(result.refusal) + (isAgentSessionForkSourceAdmissionRefusal(result.refusal) || + isAgentSessionCreateAdmissionRefusal(result.refusal)) ) { return { kind: 'failed', diff --git a/mobile/src/session/mobile-structured-agent-session-rpc.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-rpc.ts similarity index 86% rename from mobile/src/session/mobile-structured-agent-session-rpc.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-rpc.ts index 15cd4a7c1bc..e43935f46ac 100644 --- a/mobile/src/session/mobile-structured-agent-session-rpc.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-rpc.ts @@ -1,11 +1,11 @@ -import type { AgentSessionMutationResult } from '../../../src/shared/agent-session/agent-session-wire' +import type { AgentSessionMutationResult } from '../../../../../src/shared/agent-session/agent-session-wire' import type { AgentSessionWireRefusalCode, AgentSessionRefusalReference -} from '../../../src/shared/agent-session/failures/agent-session-wire-refusals' -import type { AgentJournalCursor } from '../../../src/shared/agent-session/journal/agent-session-journal-identity' -import { structuredAgentSessionPayloadFingerprint } from '../../../src/shared/agent-session/lifecycle/structured-agent-session-mutation' -import { agentSessionWriteNoticeParts } from '../../../src/shared/agent-session/failures/agent-session-refusal-notice' +} from '../../../../../src/shared/agent-session/failures/agent-session-wire-refusals' +import type { AgentJournalCursor } from '../../../../../src/shared/agent-session/journal/agent-session-journal-identity' +import { structuredAgentSessionPayloadFingerprint } from '../../../../../src/shared/agent-session/lifecycle/structured-agent-session-mutation' +import { agentSessionWriteNoticeParts } from '../../../../../src/shared/agent-session/failures/agent-session-refusal-notice' import { agentSessionRefusalFailure, agentSessionThrownFailure, @@ -13,14 +13,14 @@ import { readAgentSessionErrorRefusal, type AgentSessionWriteFailure, type AgentSessionWriteKind -} from '../../../src/shared/agent-session/failures/agent-session-write-failure' +} from '../../../../../src/shared/agent-session/failures/agent-session-write-failure' import { mobileAgentSessionWriteNoticeText } from './agent-session-write-notice-copy' import { structuredSessionOperationId } from './structured-session-operation-id' -import { isRpcDeliveryUnknown } from '../transport/rpc/rpc-delivery-ambiguity' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import '../transport/connection/stable-logical-rpc-client' -import { isLogicalClientCutoverError } from '../transport/connection/logical-client-cutover-error' -import { MOBILE_NATIVE_CHAT_MIN_WRITE_TIMEOUT_MS } from './native-chat/mobile-native-chat-send' +import { isRpcDeliveryUnknown } from '../../../transport/rpc/rpc-delivery-ambiguity' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import '../../../transport/connection/stable-logical-rpc-client' +import { isLogicalClientCutoverError } from '../../../transport/connection/logical-client-cutover-error' +import { MOBILE_NATIVE_CHAT_MIN_WRITE_TIMEOUT_MS } from '../composer/mobile-native-chat-send' export const STRUCTURED_SEND_TIMEOUT_MS = 15_000 diff --git a/mobile/src/session/mobile-structured-agent-session-send.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-send.ts similarity index 74% rename from mobile/src/session/mobile-structured-agent-session-send.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-send.ts index 76fad9815a5..6fd2d8fda9a 100644 --- a/mobile/src/session/mobile-structured-agent-session-send.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-send.ts @@ -1,21 +1,21 @@ -import type { AgentSessionSendResult } from '../../../src/shared/agent-session/agent-session-wire' -import type { AgentJournalCursor } from '../../../src/shared/agent-session/journal/agent-session-journal-identity' -import type { AgentJournalSkillRef } from '../../../src/shared/agent-session/journal/agent-session-journal-types' +import type { AgentSessionSendResult } from '../../../../../src/shared/agent-session/agent-session-wire' +import type { AgentJournalCursor } from '../../../../../src/shared/agent-session/journal/agent-session-journal-identity' +import type { AgentJournalSkillRef } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' import { structuredAgentSessionSendBody, type StructuredAgentSessionAttachment -} from '../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' -import { structuredAgentSessionBlocksTooLarge } from '../../../src/shared/rpc-contract/structured-agent-session-message-params' -import { AGENT_SESSION_MESSAGE_TOO_LARGE_PARTS } from '../../../src/shared/agent-session/failures/agent-session-refusal-notice' +} from '../../../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' +import { structuredAgentSessionBlocksTooLarge } from '../../../../../src/shared/rpc-contract/structured-agent-session-message-params' +import { AGENT_SESSION_MESSAGE_TOO_LARGE_PARTS } from '../../../../../src/shared/agent-session/failures/agent-session-refusal-notice' import { mobileAgentSessionWriteNoticeText } from './agent-session-write-notice-copy' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import type { MobileNativeChatSendOutcome } from './native-chat/mobile-native-chat-send' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import type { MobileNativeChatSendOutcome } from '../composer/mobile-native-chat-send' import { requestStructuredAgentSessionMutation, timeoutForDeadline } from './mobile-structured-agent-session-rpc' -import { mobileStructuredSendDelivery } from './mobile-structured-send-delivery' -import type { MobileNativeChatSendErrorReporter } from './native-chat/use-mobile-native-chat-send-error' +import { mobileStructuredSendDelivery } from '../composer/mobile-structured-send-delivery' +import type { MobileNativeChatSendErrorReporter } from '../composer/use-mobile-native-chat-send-error' export async function sendMobileStructuredAgentSessionMessage(input: { client: RpcClient diff --git a/mobile/src/session/mobile-structured-agent-session-working.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-working.ts similarity index 61% rename from mobile/src/session/mobile-structured-agent-session-working.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-working.ts index 1394f856d48..1d4d7986736 100644 --- a/mobile/src/session/mobile-structured-agent-session-working.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-agent-session-working.ts @@ -1,9 +1,9 @@ -import type { StructuredAgentSessionState } from '../../../src/shared/agent-session/structured-agent-session-reducer' +import type { StructuredAgentSessionState } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' import { runningStructuredAgentSessionTurnId, structuredAgentSessionHostSaysWorking -} from '../../../src/shared/agent-session/view/structured-agent-session-live-turn' -import { isStructuredAgentSessionMainAgentWorking } from '../../../src/shared/agent-session/view/structured-agent-session-main-agent-working' +} from '../../../../../src/shared/agent-session/view/structured-agent-session-live-turn' +import { isStructuredAgentSessionMainAgentWorking } from '../../../../../src/shared/agent-session/view/structured-agent-session-main-agent-working' export function mobileStructuredAgentSessionWorking(state: StructuredAgentSessionState): boolean { return structuredAgentSessionHostSaysWorking(state.working, () => diff --git a/mobile/src/session/mobile-structured-host-clock-offset.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-host-clock-offset.ts similarity index 79% rename from mobile/src/session/mobile-structured-host-clock-offset.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-host-clock-offset.ts index 1a0e9abcf3c..70142d96979 100644 --- a/mobile/src/session/mobile-structured-host-clock-offset.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-host-clock-offset.ts @@ -1,4 +1,4 @@ -import type { StructuredAgentHostClock } from '../../../src/shared/agent-session/structured-agent-session-reducer' +import type { StructuredAgentHostClock } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' // Ignore delivery jitter below the precision of displayed clocks. const OFFSET_GRAIN_MS = 1_000 diff --git a/mobile/src/session/mobile-structured-session-open-message.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-session-open-message.ts similarity index 90% rename from mobile/src/session/mobile-structured-session-open-message.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-session-open-message.ts index 0557d24bbb6..b70c8f837e8 100644 --- a/mobile/src/session/mobile-structured-session-open-message.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-session-open-message.ts @@ -1,6 +1,6 @@ -import { formatAgentTypeLabel } from '../../../src/shared/agent-status/presentation/agent-type-label' -import type { StructuredSessionOpenFailure } from '../../../src/shared/open-structured-agent-session' -import { translate } from '../i18n/mobile-i18n' +import { formatAgentTypeLabel } from '../../../../../src/shared/agent-status/presentation/agent-type-label' +import type { StructuredSessionOpenFailure } from '../../../../../src/shared/open-structured-agent-session' +import { translate } from '../../../i18n/mobile-i18n' export function mobileStructuredSessionOpenMessage( reason: StructuredSessionOpenFailure['reason'], diff --git a/mobile/src/session/mobile-structured-session-open-rpc.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-session-open-rpc.ts similarity index 88% rename from mobile/src/session/mobile-structured-session-open-rpc.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-session-open-rpc.ts index b0afd135322..4a6af221381 100644 --- a/mobile/src/session/mobile-structured-session-open-rpc.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-session-open-rpc.ts @@ -1,7 +1,7 @@ import * as z from 'zod' -import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc/rpc-operation' -import { rpcResultVariant } from '../transport/rpc/rpc-operation-result-reader' -import type { RpcMethodName } from '../../../src/shared/rpc-contract/rpc-params-catalog.generated' +import { bindDeferredRpcOperation, defineRpcOperation } from '../../../transport/rpc/rpc-operation' +import { rpcResultVariant } from '../../../transport/rpc/rpc-operation-result-reader' +import type { RpcMethodName } from '../../../../../src/shared/rpc-contract/rpc-params-catalog.generated' function openingRead( method: Method, diff --git a/mobile/src/session/mobile-structured-session-status-feed.test.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-session-status-feed.test.ts similarity index 84% rename from mobile/src/session/mobile-structured-session-status-feed.test.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-session-status-feed.test.ts index 170c101788f..892df6a0497 100644 --- a/mobile/src/session/mobile-structured-session-status-feed.test.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-session-status-feed.test.ts @@ -1,10 +1,10 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { AgentSessionStatusSummary } from '../../../src/shared/agent-session/agent-session-wire' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import type { ConnectionState } from '../transport/connection/connection-state' -import '../transport/connection/stable-logical-rpc-client' +import type { AgentSessionStatusSummary } from '../../../../../src/shared/agent-session/agent-session-wire' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import type { ConnectionState } from '../../../transport/connection/connection-state' +import '../../../transport/connection/stable-logical-rpc-client' import { mobileStructuredSessionStatusFeed } from './mobile-structured-session-status-feed' -import { stubRpcClient } from '../transport/rpc/rpc-client-test-stub' +import { stubRpcClient } from '../../../transport/rpc/rpc-client-test-stub' function summary(stopping: boolean): AgentSessionStatusSummary { return { diff --git a/mobile/src/session/mobile-structured-session-status-feed.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-session-status-feed.ts similarity index 91% rename from mobile/src/session/mobile-structured-session-status-feed.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-session-status-feed.ts index 8617b8afd29..841ef3995af 100644 --- a/mobile/src/session/mobile-structured-session-status-feed.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-session-status-feed.ts @@ -5,14 +5,14 @@ import { foldAgentSessionStatusEvent, revokeAgentSessionStatusLive, type AgentSessionStatusSnapshot -} from '../../../src/shared/agent-session/view/agent-session-status-snapshot-fold' -import type { AgentSessionStatusEvent } from '../../../src/shared/agent-session/agent-session-wire' +} from '../../../../../src/shared/agent-session/view/agent-session-status-snapshot-fold' +import type { AgentSessionStatusEvent } from '../../../../../src/shared/agent-session/agent-session-wire' import { foldAgentSessionConversationNames, type AgentSessionConversationNames -} from '../../../src/shared/agent-session/agent-session-conversation-names' -import { isMobileMethodUnavailableError } from '../transport/rpc/mobile-method-unavailable' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +} from '../../../../../src/shared/agent-session/agent-session-conversation-names' +import { isMobileMethodUnavailableError } from '../../../transport/rpc/mobile-method-unavailable' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' export type MobileStructuredSessionStatusFeed = { subscribe: (listener: () => void) => () => void diff --git a/mobile/src/session/mobile-structured-transcript-subscription.ts b/mobile/src/session/native-chat/agent-session/mobile-structured-transcript-subscription.ts similarity index 83% rename from mobile/src/session/mobile-structured-transcript-subscription.ts rename to mobile/src/session/native-chat/agent-session/mobile-structured-transcript-subscription.ts index 2d07c89e144..24402f13bd0 100644 --- a/mobile/src/session/mobile-structured-transcript-subscription.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-structured-transcript-subscription.ts @@ -1,6 +1,6 @@ -import type { AgentSessionSubscribeEvent } from '../../../src/shared/agent-session/agent-session-wire' -import type { StructuredAgentSessionLiveSubscribe } from '../../../src/shared/agent-session/structured-agent-session-live-read' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +import type { AgentSessionSubscribeEvent } from '../../../../../src/shared/agent-session/agent-session-wire' +import type { StructuredAgentSessionLiveSubscribe } from '../../../../../src/shared/agent-session/structured-agent-session-live-read' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' function isSubscribeEvent(value: unknown): value is AgentSessionSubscribeEvent { if (typeof value !== 'object' || value === null || !('type' in value)) { diff --git a/mobile/src/session/open-mobile-structured-session.ts b/mobile/src/session/native-chat/agent-session/open-mobile-structured-session.ts similarity index 91% rename from mobile/src/session/open-mobile-structured-session.ts rename to mobile/src/session/native-chat/agent-session/open-mobile-structured-session.ts index 346aa09264a..9f37d080a8a 100644 --- a/mobile/src/session/open-mobile-structured-session.ts +++ b/mobile/src/session/native-chat/agent-session/open-mobile-structured-session.ts @@ -4,17 +4,17 @@ import { type StructuredSessionOpenSource, type StructuredSessionOpenTab, type StructuredSessionOpenTarget -} from '../../../src/shared/open-structured-agent-session' -import { isStructuredAgentId } from '../../../src/shared/agent-session/lifecycle/agent-session-provider-handle-encoding' -import { structuredAgentSessionPaneKey } from '../../../src/shared/agent-session/view/structured-agent-session-projection' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +} from '../../../../../src/shared/open-structured-agent-session' +import { isStructuredAgentId } from '../../../../../src/shared/agent-session/lifecycle/agent-session-provider-handle-encoding' +import { structuredAgentSessionPaneKey } from '../../../../../src/shared/agent-session/view/structured-agent-session-projection' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import { structuredOpenLocation, structuredOpenParty, structuredOpenReveal, structuredOpenTabs } from './mobile-structured-session-open-rpc' -import { sessionTabActivate } from './tabs/mobile-session-tab-write-operations' +import { sessionTabActivate } from '../../tabs/mobile-session-tab-write-operations' /** The workspace client already carries executionHost; a single budget includes connect waits. */ export async function openMobileStructuredSession(args: { diff --git a/mobile/src/session/structured-session-operation-id.ts b/mobile/src/session/native-chat/agent-session/structured-session-operation-id.ts similarity index 69% rename from mobile/src/session/structured-session-operation-id.ts rename to mobile/src/session/native-chat/agent-session/structured-session-operation-id.ts index 434a0f19b5b..80c298a94fb 100644 --- a/mobile/src/session/structured-session-operation-id.ts +++ b/mobile/src/session/native-chat/agent-session/structured-session-operation-id.ts @@ -1,7 +1,7 @@ // Keep id generation dependency-free so create/tasks callers do not pull in the native-chat write graph. -import { createStructuredAgentSessionOperationId } from '../../../src/shared/agent-session/lifecycle/structured-agent-session-mutation' -import { randomV4Uuid } from '../platform/random-v4-uuid' +import { createStructuredAgentSessionOperationId } from '../../../../../src/shared/agent-session/lifecycle/structured-agent-session-mutation' +import { randomV4Uuid } from '../../../platform/random-v4-uuid' export function structuredSessionOperationId(now: number = Date.now()): string { return createStructuredAgentSessionOperationId(randomV4Uuid, now) diff --git a/mobile/src/session/use-mobile-structured-agent-mutation.ts b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-mutation.ts similarity index 90% rename from mobile/src/session/use-mobile-structured-agent-mutation.ts rename to mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-mutation.ts index bf684cf71f3..9ccefcba3fd 100644 --- a/mobile/src/session/use-mobile-structured-agent-mutation.ts +++ b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-mutation.ts @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import type { StructuredAgentSessionState } from '../../../src/shared/agent-session/structured-agent-session-reducer' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +import type { StructuredAgentSessionState } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import { requestStructuredAgentSessionMutation, type StructuredAgentSessionMutationResult diff --git a/mobile/src/session/use-mobile-structured-agent-rewind.ts b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-rewind.ts similarity index 78% rename from mobile/src/session/use-mobile-structured-agent-rewind.ts rename to mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-rewind.ts index 51e9f65a2d1..3200bd020ab 100644 --- a/mobile/src/session/use-mobile-structured-agent-rewind.ts +++ b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-rewind.ts @@ -1,24 +1,24 @@ import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react' -import { AGENT_SESSION_CONVERSATION_COMMAND_TIMEOUT_MS } from '../../../src/shared/agent-session/agent-session-conversation-command' -import { AGENT_SESSION_PHONE_REWIND_RUNTIME_CAPABILITY } from '../../../src/shared/agent-session/agent-session-runtime-capabilities' -import type { AgentSessionRewindResult } from '../../../src/shared/agent-session/lifecycle/agent-session-rewind' +import { AGENT_SESSION_CONVERSATION_COMMAND_TIMEOUT_MS } from '../../../../../src/shared/agent-session/agent-session-conversation-command' +import { AGENT_SESSION_PHONE_REWIND_RUNTIME_CAPABILITY } from '../../../../../src/shared/agent-session/agent-session-runtime-capabilities' +import type { AgentSessionRewindResult } from '../../../../../src/shared/agent-session/lifecycle/agent-session-rewind' import { createAgentSessionRewindHook, type AgentSessionRewindInput, type AgentSessionRewindSendOutcome -} from '../../../src/shared/agent-session/lifecycle/agent-session-rewind-request' -import type { StructuredAgentSessionState } from '../../../src/shared/agent-session/structured-agent-session-reducer' -import { actionableStructuredPrompts } from './mobile-structured-actionable-prompt' -import { useRouteRelaysCapability } from '../worktree/workspace-server-context' -import { sayMobileNativeChatRewind } from './native-chat/mobile-native-chat-rewind-copy' -import type { MobileNativeChatSendOutcome } from './native-chat/mobile-native-chat-send' +} from '../../../../../src/shared/agent-session/lifecycle/agent-session-rewind-request' +import type { StructuredAgentSessionState } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' +import { actionableStructuredPrompts } from '../input/mobile-structured-actionable-prompt' +import { useRouteRelaysCapability } from '../../../worktree/workspace-server-context' +import { sayMobileNativeChatRewind } from '../mobile-native-chat-rewind-copy' +import type { MobileNativeChatSendOutcome } from '../composer/mobile-native-chat-send' import { requestStructuredAgentSessionMutation } from './mobile-structured-agent-session-rpc' -import { returnMobileNativeChatMessageToComposer } from './mobile-native-chat-message-hand-back' -import type { useMobileStructuredAgentOptions } from './use-mobile-structured-agent-options' +import { returnMobileNativeChatMessageToComposer } from '../composer/mobile-native-chat-message-hand-back' +import type { useMobileStructuredAgentOptions } from '../input/use-mobile-structured-agent-options' import type { MobileStructuredAgentSessionArgs } from './mobile-structured-agent-session-contract' -import type { MobileStructuredBackgroundTasks } from './use-mobile-structured-background-tasks' -import type { MobileStructuredSendsOut } from './use-mobile-structured-stop-offer' -import { tuiAgentDisplayName } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' +import type { MobileStructuredBackgroundTasks } from '../input/use-mobile-structured-background-tasks' +import type { MobileStructuredSendsOut } from '../composer/use-mobile-structured-stop-offer' +import { tuiAgentDisplayName } from '../../../../../src/shared/agent-launch/catalog/tui-agent-display-names' const useAgentSessionRewind = createAgentSessionRewindHook( { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState }, diff --git a/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session-queued.test-fixture.ts b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session-queued.test-fixture.ts index f4934fb7f57..03221a2d5cf 100644 --- a/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session-queued.test-fixture.ts +++ b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session-queued.test-fixture.ts @@ -8,7 +8,7 @@ import type { } from '../../../../../src/shared/agent-session/requests/agent-session-queued-message-wire' import type { AgentSessionSubscribeEvent } from '../../../../../src/shared/agent-session/agent-session-wire' import type { RpcResponse } from '../../../transport/rpc/rpc-wire-types' -import type { StructuredAgentSessionHostSupport } from '../../mobile-structured-agent-session-host-support' +import type { StructuredAgentSessionHostSupport } from './mobile-structured-agent-session-host-support' export const SESSION_ID = 'session-1' diff --git a/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session-queued.test.tsx b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session-queued.test.tsx index cae9208f26d..d9e72dd6b4f 100644 --- a/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session-queued.test.tsx +++ b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session-queued.test.tsx @@ -7,8 +7,8 @@ import type { AgentSessionSubscribeEvent } from '../../../../../src/shared/agent import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import type { RpcResponse } from '../../../transport/rpc/rpc-wire-types' import { markRpcDeliveryUnknown } from '../../../transport/rpc/rpc-delivery-ambiguity' -import type { StructuredAgentSessionHostSupport } from '../../mobile-structured-agent-session-host-support' -import { useMobileStructuredAgentSession } from '../../use-mobile-structured-agent-session' +import type { StructuredAgentSessionHostSupport } from './mobile-structured-agent-session-host-support' +import { useMobileStructuredAgentSession } from './use-mobile-structured-agent-session' import type { RpcClientContextValue } from '../../../transport/connection/rpc-client-context-contract' diff --git a/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.clear.test.tsx b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.clear.test.tsx index ba720a54a09..3c48b99c6fe 100644 --- a/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.clear.test.tsx +++ b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.clear.test.tsx @@ -6,7 +6,7 @@ import type { AgentSessionSubscribeEvent } from '../../../../../src/shared/agent import { createWithQueryClient } from '../../../test-support/query-client-test-renderer' import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import type { RpcResponse } from '../../../transport/rpc/rpc-wire-types' -import { useMobileStructuredAgentSession } from '../../use-mobile-structured-agent-session' +import { useMobileStructuredAgentSession } from './use-mobile-structured-agent-session' import { SESSION_ID, mutationOk, @@ -29,25 +29,6 @@ const row = ( observedAt: sequence, body: { kind: 'message', role, blocks: [{ type: 'text', text }] } }) -const divider = (sequence: number): AgentJournalRenderItem => ({ - ...row(sequence, 'assistant', ''), - body: { - kind: 'status', - text: 'Context cleared', - presentation: 'context-cleared', - contextClear: { operationId: `clear-${sequence}`, afterFence: 3, clearedAt: sequence } - } -}) -const dividerLands = (sequence: number): AgentSessionSubscribeEvent => ({ - type: 'batch', - sessionId: SESSION_ID, - batch: { - cursor: { epoch: 'epoch-1', sequence }, - items: [divider(sequence)], - removedItemIds: [], - submissions: [] - } -}) describe('useMobileStructuredAgentSession /clear', () => { let renderer: ReactTestRenderer | null = null @@ -132,22 +113,6 @@ describe('useMobileStructuredAgentSession /clear', () => { } } - it('hides the old transcript from the press until the divider lands', async () => { - const chat = await mount() - expect(chat.shown()).toEqual({ text: ['question', 'reply'], clearing: false }) - - const { outcome } = await chat.sendClear() - expect(chat.shown()).toEqual({ text: [], clearing: true }) - - // The host's reply can reach the phone before the divider it already wrote. - await chat.reply({ command: 'clear', state: 'completed' }) - await expect(outcome).resolves.toBe('accepted') - expect(chat.shown()).toEqual({ text: [], clearing: true }) - - chat.push(dividerLands(3)) - expect(chat.shown()).toEqual({ text: ['Context cleared'], clearing: false }) - }) - it('shows the old transcript again when the host refuses the /clear', async () => { const chat = await mount() const { outcome } = await chat.sendClear() diff --git a/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.interrupted-continue.test.tsx b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.interrupted-continue.test.tsx index 8030186142d..2778f4aa07a 100644 --- a/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.interrupted-continue.test.tsx +++ b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.interrupted-continue.test.tsx @@ -7,12 +7,12 @@ import { agentJournalItemKey } from '../../../../../src/shared/agent-session/jou import { AGENT_SESSION_PHONE_CONTINUE_INTERRUPTED_RUNTIME_CAPABILITY } from '../../../../../src/shared/agent-session/agent-session-continue-interrupted-capability' import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import type { RpcResponse } from '../../../transport/rpc/rpc-wire-types' -import { structuredAgentSessionHostSupport } from '../../mobile-structured-agent-session-host-support' +import { structuredAgentSessionHostSupport } from './mobile-structured-agent-session-host-support' import { snapshotEvent, SESSION_ID } from './use-mobile-structured-agent-session-queued.test-fixture' -import { useMobileStructuredAgentSession } from '../../use-mobile-structured-agent-session' +import { useMobileStructuredAgentSession } from './use-mobile-structured-agent-session' vi.mock('@react-native-async-storage/async-storage', () => ({ default: { getItem: vi.fn(async () => null), setItem: vi.fn(), removeItem: vi.fn() } diff --git a/mobile/src/session/use-mobile-structured-agent-session.test.tsx b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.test.tsx similarity index 91% rename from mobile/src/session/use-mobile-structured-agent-session.test.tsx rename to mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.test.tsx index 327436f803b..73c4f8898d9 100644 --- a/mobile/src/session/use-mobile-structured-agent-session.test.tsx +++ b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.test.tsx @@ -4,16 +4,16 @@ import { fieldsOf, mutationOk, ok -} from './native-chat/agent-session/use-mobile-structured-agent-session-queued.test-fixture' +} from './use-mobile-structured-agent-session-queued.test-fixture' import { act, type ReactTestRenderer } from 'react-test-renderer' -import { createWithQueryClient } from '../test-support/query-client-test-renderer' +import { createWithQueryClient } from '../../../test-support/query-client-test-renderer' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { AgentJournalRenderItem } from '../../../src/shared/agent-session/journal/agent-session-journal-types' +import type { AgentJournalRenderItem } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import type { ConnectionState } from '../transport/connection/connection-state' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import type { ConnectionState } from '../../../transport/connection/connection-state' -import { structuredSendResultFixture } from './structured-agent-send-result.test-fixture' +import { structuredSendResultFixture } from '../../structured-agent-send-result.test-fixture' import { useMobileStructuredAgentSession } from './use-mobile-structured-agent-session' const asyncStorage = vi.hoisted(() => ({ diff --git a/mobile/src/session/use-mobile-structured-agent-session.ts b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.ts similarity index 79% rename from mobile/src/session/use-mobile-structured-agent-session.ts rename to mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.ts index 62c4cd9d9cd..9672b413618 100644 --- a/mobile/src/session/use-mobile-structured-agent-session.ts +++ b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-session.ts @@ -1,57 +1,57 @@ -import { asyncQuestionSourceScope as questionSourceScope } from '../../../src/shared/native-chat/input/native-chat-ask' -import { structuredChatTranscriptIdentity } from './native-chat/mobile-native-chat-transcript-store' +import { asyncQuestionSourceScope as questionSourceScope } from '../../../../../src/shared/native-chat/input/native-chat-ask' +import { structuredChatTranscriptIdentity } from '../transcript/mobile-native-chat-transcript-store' import { useMemo, useRef } from 'react' -import { tuiAgentDisplayName } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' +import { tuiAgentDisplayName } from '../../../../../src/shared/agent-launch/catalog/tui-agent-display-names' import { mobileStructuredAgentSessionWorking } from './mobile-structured-agent-session-working' -import { isFinalAgentSessionReadRefusal } from '../../../src/shared/agent-session/failures/structured-agent-session-read-refusal' +import { isFinalAgentSessionReadRefusal } from '../../../../../src/shared/agent-session/failures/structured-agent-session-read-refusal' import { runningStructuredAgentSessionTurnId, structuredAgentSessionQueueSendsNext -} from '../../../src/shared/agent-session/view/structured-agent-session-live-turn' +} from '../../../../../src/shared/agent-session/view/structured-agent-session-live-turn' import { actionableStructuredApproval, actionableStructuredQuestion -} from './mobile-structured-actionable-prompt' +} from '../input/mobile-structured-actionable-prompt' import { projectStructuredPermission, projectStructuredQuestion -} from './mobile-structured-agent-prompts' +} from '../input/mobile-structured-agent-prompts' import type { MobileStructuredAgentSessionArgs, StructuredMobileSession } from './mobile-structured-agent-session-contract' -import type { MobileNativeChatVisualSource } from './native-chat/visual/mobile-native-chat-visual-read' +import type { MobileNativeChatVisualSource } from '../visual/mobile-native-chat-visual-read' import { useMobileStructuredAgentState } from './use-mobile-structured-agent-state' -import { useMobileStructuredStopPress } from './use-mobile-structured-stop-press' +import { useMobileStructuredStopPress } from '../composer/use-mobile-structured-stop-press' import { useMobileStructuredSessionHostStopping } from './use-mobile-structured-session-host-stopping' -import { useMobileStructuredPromptResponses } from './use-mobile-structured-prompt-responses' -import { useMobileStructuredAgentOptions } from './use-mobile-structured-agent-options' -import { useHostModelCatalogCache } from './mobile-host-model-catalog-query' -import { useMobileStructuredCommandController } from './use-mobile-structured-command-controller' -import { useMobileStructuredSessionOptionStamp } from './use-mobile-structured-session-option-stamp' -import { useMobileStructuredAgentTurnTiming } from './use-mobile-structured-agent-turn-timing' +import { useMobileStructuredPromptResponses } from '../input/use-mobile-structured-prompt-responses' +import { useMobileStructuredAgentOptions } from '../input/use-mobile-structured-agent-options' +import { useHostModelCatalogCache } from '../input/mobile-host-model-catalog-query' +import { useMobileStructuredCommandController } from '../composer/use-mobile-structured-command-controller' +import { useMobileStructuredSessionOptionStamp } from '../input/use-mobile-structured-session-option-stamp' +import { useMobileStructuredAgentTurnTiming } from '../transcript/use-mobile-structured-agent-turn-timing' import { pendingStructuredPromptIdentity, useMobileStructuredRequestCancel } from './mobile-structured-agent-session-cancel' import { useMobileStructuredAgentMutate } from './use-mobile-structured-agent-mutation' -import { useMobileStructuredSendWithOutcome } from './use-mobile-structured-send-with-outcome' -import { useMobileStructuredQueuedMessageControls } from './use-mobile-structured-queued-message-controls' -import { useMobileStructuredBackgroundTasks } from './use-mobile-structured-background-tasks' -import { useMobileStructuredSends } from './use-mobile-structured-sends' -import { useMobileStructuredSendRecorded } from './mobile-structured-send-recorded-read' -import { useMobileNativeChatQueueFollowUps as useQueueFollowUps } from './use-mobile-native-chat-queue-follow-ups' -import { useMobileStructuredStopOffer } from './use-mobile-structured-stop-offer' -import { useMobileStructuredTurnIndicator } from './use-mobile-structured-turn-indicator' -import { useMobileStructuredContextUsage } from './use-mobile-structured-context-usage' -import { useMobileStructuredInterruptedContinue } from './use-mobile-structured-interrupted-continue' +import { useMobileStructuredSendWithOutcome } from '../composer/use-mobile-structured-send-with-outcome' +import { useMobileStructuredQueuedMessageControls } from '../input/use-mobile-structured-queued-message-controls' +import { useMobileStructuredBackgroundTasks } from '../input/use-mobile-structured-background-tasks' +import { useMobileStructuredSends } from '../composer/use-mobile-structured-sends' +import { useMobileStructuredSendRecorded } from '../composer/mobile-structured-send-recorded-read' +import { useMobileNativeChatQueueFollowUps as useQueueFollowUps } from '../preferences/use-mobile-native-chat-queue-follow-ups' +import { useMobileStructuredStopOffer } from '../composer/use-mobile-structured-stop-offer' +import { useMobileStructuredTurnIndicator } from '../transcript/use-mobile-structured-turn-indicator' +import { useMobileStructuredContextUsage } from '../composer/use-mobile-structured-context-usage' +import { useMobileStructuredInterruptedContinue } from '../composer/use-mobile-structured-interrupted-continue' import { useMobileStructuredThreadGoal, useMobileStructuredThreadGoalSend -} from './use-mobile-structured-thread-goal' -import { useMobileStructuredTranscript } from './use-mobile-structured-transcript' +} from '../input/use-mobile-structured-thread-goal' +import { useMobileStructuredTranscript } from '../transcript/use-mobile-structured-transcript' import { useMobileStructuredAgentRewind } from './use-mobile-structured-agent-rewind' -import { useMobileNativeChatUsageLimit } from './native-chat/use-mobile-native-chat-usage-limit' +import { useMobileNativeChatUsageLimit } from '../use-mobile-native-chat-usage-limit' export function useMobileStructuredAgentSession( args: MobileStructuredAgentSessionArgs diff --git a/mobile/src/session/use-mobile-structured-agent-state.ts b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-state.ts similarity index 87% rename from mobile/src/session/use-mobile-structured-agent-state.ts rename to mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-state.ts index c2bcae0c88e..7a847917079 100644 --- a/mobile/src/session/use-mobile-structured-agent-state.ts +++ b/mobile/src/session/native-chat/agent-session/use-mobile-structured-agent-state.ts @@ -1,45 +1,48 @@ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react' -import { isRootAgentJournalItem } from '../../../src/shared/agent-session/journal/agent-session-journal-producer' +import { isRootAgentJournalItem } from '../../../../../src/shared/agent-session/journal/agent-session-journal-producer' import type { AgentSessionQueuedMessage, AgentSessionQueuePause -} from '../../../src/shared/agent-session/requests/agent-session-queued-message-wire' +} from '../../../../../src/shared/agent-session/requests/agent-session-queued-message-wire' import { type AgentSessionHistoryResult, AGENT_SESSION_HISTORY_MAX_LIMIT -} from '../../../src/shared/agent-session/agent-session-wire' -import { structuredAgentSessionHolderId } from '../../../src/shared/agent-session/view/structured-agent-session-holder' -import { startStructuredAgentSessionLiveRead } from '../../../src/shared/agent-session/structured-agent-session-live-read' +} from '../../../../../src/shared/agent-session/agent-session-wire' +import { structuredAgentSessionHolderId } from '../../../../../src/shared/agent-session/view/structured-agent-session-holder' +import { startStructuredAgentSessionLiveRead } from '../../../../../src/shared/agent-session/structured-agent-session-live-read' import { type AgentSessionTextAppendCapabilities, agentSessionTextAppendRequest -} from '../../../src/shared/agent-session/agent-session-text-append' -import { isFinalAgentSessionReadRefusal } from '../../../src/shared/agent-session/failures/structured-agent-session-read-refusal' +} from '../../../../../src/shared/agent-session/agent-session-text-append' +import { isFinalAgentSessionReadRefusal } from '../../../../../src/shared/agent-session/failures/structured-agent-session-read-refusal' import { EMPTY_STRUCTURED_AGENT_SESSION, oldestStructuredAgentSessionCursor, type StructuredAgentSessionAction, type StructuredAgentSessionState -} from '../../../src/shared/agent-session/structured-agent-session-reducer' -import { subscribeConnectionRevival } from '../diagnostics/connection/connection-revival-signal' +} from '../../../../../src/shared/agent-session/structured-agent-session-reducer' +import { subscribeConnectionRevival } from '../../../diagnostics/connection/connection-revival-signal' import { readRuntimeStatusProbe, recordRuntimeStatusProbe -} from '../transport/connection/runtime-status-probe' -import { decodeHostStatusReply, readHostStatusReply } from '../query/host-status-query' -import { hostStatusSchema } from '../transport/hosts/host-status-reply-schema' +} from '../../../transport/connection/runtime-status-probe' +import { decodeHostStatusReply, readHostStatusReply } from '../../../query/host-status-query' +import { hostStatusSchema } from '../../../transport/hosts/host-status-reply-schema' import { AGENT_SESSION_TEXT_APPEND_RUNTIME_CAPABILITY, AGENT_SESSION_TOOL_OUTPUT_APPEND_RUNTIME_CAPABILITY -} from '../../../src/shared/agent-session/agent-session-runtime-capabilities' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +} from '../../../../../src/shared/agent-session/agent-session-runtime-capabilities' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import { agentSessionReadFailureRefusal, agentSessionReadRefusalText, callAgentSession } from './mobile-structured-agent-session-rpc' import { subscribeTranscriptAfterHold } from './mobile-structured-transcript-subscription' -import { useMobileOlderPageLoader, type OlderPagePhase } from './use-mobile-older-page-loader' +import { + useMobileOlderPageLoader, + type OlderPagePhase +} from '../transcript/use-mobile-older-page-loader' import { mobileStructuredAgentSessionWorking } from './mobile-structured-agent-session-working' import { reduceStructuredChatState, @@ -47,8 +50,8 @@ import { storedStructuredSessionState, storedStructuredCopy, unconfirmedStructuredStateSavedAt -} from './native-chat/mobile-native-chat-transcript-writer' -import { useStoredChatTranscript } from './native-chat/use-stored-chat-transcript' +} from '../transcript/mobile-native-chat-transcript-writer' +import { useStoredChatTranscript } from '../transcript/use-stored-chat-transcript' const MAX_RETAINED_SESSION_STATES = 32 diff --git a/mobile/src/session/use-mobile-structured-session-host-stopping.ts b/mobile/src/session/native-chat/agent-session/use-mobile-structured-session-host-stopping.ts similarity index 92% rename from mobile/src/session/use-mobile-structured-session-host-stopping.ts rename to mobile/src/session/native-chat/agent-session/use-mobile-structured-session-host-stopping.ts index a1d3db4174a..866b1873358 100644 --- a/mobile/src/session/use-mobile-structured-session-host-stopping.ts +++ b/mobile/src/session/native-chat/agent-session/use-mobile-structured-session-host-stopping.ts @@ -1,5 +1,5 @@ import { useCallback, useSyncExternalStore } from 'react' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import { mobileStructuredSessionStatusFeed } from './mobile-structured-session-status-feed' const noSubscription = (): (() => void) => () => {} diff --git a/mobile/src/session/native-chat/composer/MobileNativeChatComposer.keyboard.web.test.tsx b/mobile/src/session/native-chat/composer/MobileNativeChatComposer.keyboard.web.test.tsx index e1cee3abee1..3facb1e14f7 100644 --- a/mobile/src/session/native-chat/composer/MobileNativeChatComposer.keyboard.web.test.tsx +++ b/mobile/src/session/native-chat/composer/MobileNativeChatComposer.keyboard.web.test.tsx @@ -5,7 +5,6 @@ import type * as ReactNative from 'react-native' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { MobileNativeChatComposer } from './MobileNativeChatComposer' import { MobileNativeChatLowerRegion } from '../MobileNativeChatLowerRegion.web' -import { NATIVE_CHAT_STEER_CHORD_HOLD_MS } from '../../../../../src/shared/native-chat/input/use-native-chat-steer-chord-preview' vi.mock('react-native', () => vi.importActual('react-native-web')) vi.mock( @@ -189,31 +188,6 @@ describe('mobile composer modifier submit in the paired web page', () => { expect(field().value).toBe(' hello ') }) - it('holding Cmd alone on an empty composer shows Steer queued in Send, lights the head card and sends it on a press', async () => { - vi.spyOn(document, 'hasFocus').mockReturnValue(true) - const steerHead = { steers: () => true, run: vi.fn(() => true), light: vi.fn() } - await render({ value: '', sendFollowUp: { action: 'queue', offersChoice: true }, steerHead }) - const preview = () => container.querySelector('[data-preview]') - vi.useFakeTimers() - try { - await act(async () => { - field().dispatchEvent(new KeyboardEvent('keydown', { key: 'Meta', bubbles: true })) - }) - await act(async () => vi.advanceTimersByTime(NATIVE_CHAT_STEER_CHORD_HOLD_MS)) - } finally { - vi.useRealTimers() - } - expect(preview()?.dataset.preview).toBe('steer-queued') - expect(steerHead.light).toHaveBeenLastCalledWith(true) - await act(async () => preview()?.click()) - expect(steerHead.run).toHaveBeenCalledExactlyOnceWith(true) - await act(async () => { - field().dispatchEvent(new KeyboardEvent('keyup', { key: 'Meta', bubbles: true })) - }) - expect(preview()).toBeNull() - expect(steerHead.light).toHaveBeenLastCalledWith(false) - }) - it.each([ { value: '@rea', expected: '@README.md ', filePaths: ['README.md', 'src/read.ts'] }, { value: '/comp', expected: '/compact ', filePaths: [] } diff --git a/mobile/src/session/native-chat/composer/MobileNativeChatComposer.structured.test.ts b/mobile/src/session/native-chat/composer/MobileNativeChatComposer.structured.test.ts index c04552d7585..29fc29234d0 100644 --- a/mobile/src/session/native-chat/composer/MobileNativeChatComposer.structured.test.ts +++ b/mobile/src/session/native-chat/composer/MobileNativeChatComposer.structured.test.ts @@ -7,17 +7,17 @@ import { updateMobileNativeChatDraftInputs } from './mobile-native-chat-draft-inputs' import './use-mobile-native-chat-drafts' -import '../../use-mobile-structured-native-chat-send-bridge' +import './use-mobile-structured-native-chat-send-bridge' import '../mobile-native-chat-scope-key' -import '../../use-mobile-structured-agent-session' +import '../agent-session/use-mobile-structured-agent-session' import '../agent-session/use-mobile-structured-agent-session-queued.test-fixture' import '../../structured-agent-send-result.test-fixture' import { findByHostType } from '../../../test-support/react-test-renderer-host-nodes' -import '../../mobile-structured-agent-session-host-support' +import '../agent-session/mobile-structured-agent-session-host-support' import '../../../../../src/shared/agent-session/agent-session-runtime-capabilities' -import '../../use-mobile-structured-agent-options' -import '../../use-mobile-structured-agent-options.test-fixture' +import '../input/use-mobile-structured-agent-options' +import '../input/use-mobile-structured-agent-options.test-fixture' import { createElement, type ComponentProps } from 'react' diff --git a/mobile/src/session/native-chat/composer/MobileNativeChatComposer.tsx b/mobile/src/session/native-chat/composer/MobileNativeChatComposer.tsx index b58cdede682..07f31ca25c1 100644 --- a/mobile/src/session/native-chat/composer/MobileNativeChatComposer.tsx +++ b/mobile/src/session/native-chat/composer/MobileNativeChatComposer.tsx @@ -39,7 +39,7 @@ import { composerInputStyles as inputStyles } from '../../../components/composer import { MobileNativeChatComposerSendSlot } from './MobileNativeChatComposerSendSlot' import { MobileNativeChatEditActions } from './MobileNativeChatEditActions' import { useMobileNativeChatContextRing } from './MobileNativeChatContextUsageRing' -import type { MobileNativeChatSendIntent } from '../mobile-native-chat-send' +import type { MobileNativeChatSendIntent } from './mobile-native-chat-send' import { MobileNativeChatComposerMic } from './MobileNativeChatComposerMic' import type { MobileNativeChatMicProps } from './MobileNativeChatComposerMic' import { MobileNativeChatDictationLeading } from './MobileNativeChatDictationLeading' @@ -51,8 +51,6 @@ const NO_FILE_PATHS: string[] = [] const NO_ATTACHMENTS: PendingNativeChatImage[] = [] const NO_FILES: PendingNativeChatFile[] = [] -export type { MobileNativeChatStructuredComposer } from './mobile-native-chat-structured-composer' - type Props = MobileNativeChatMicProps & { // Applies dictation's edit to the draft this composer shows; false when it can no longer take it. insertDictation?: (insert: (draft: string) => string) => boolean | void diff --git a/mobile/src/session/native-chat/composer/MobileNativeChatComposerAttachButton.tsx b/mobile/src/session/native-chat/composer/MobileNativeChatComposerAttachButton.tsx index d9760401fca..45d89b53131 100644 --- a/mobile/src/session/native-chat/composer/MobileNativeChatComposerAttachButton.tsx +++ b/mobile/src/session/native-chat/composer/MobileNativeChatComposerAttachButton.tsx @@ -4,7 +4,7 @@ import { Plus } from 'lucide-react-native' import { colors } from '../../../theme/mobile-theme' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' import { ActionSheetModal } from '../../../components/ActionSheetModal' -import { mobileNativeChatAttachActions } from '../mobile-native-chat-attach-actions' +import { mobileNativeChatAttachActions } from './mobile-native-chat-attach-actions' import { COMPOSER_CONTROL_HIT_SLOP, composerInputStyles as inputStyles diff --git a/mobile/src/session/native-chat/composer/MobileNativeChatComposerSendSlot.tsx b/mobile/src/session/native-chat/composer/MobileNativeChatComposerSendSlot.tsx index cc4dd16223b..4651ce6c6d8 100644 --- a/mobile/src/session/native-chat/composer/MobileNativeChatComposerSendSlot.tsx +++ b/mobile/src/session/native-chat/composer/MobileNativeChatComposerSendSlot.tsx @@ -6,7 +6,7 @@ import type { NativeChatSendFollowUp } from '../../../../../src/shared/native-ch import type { SessionOptionDescriptor } from '../../../../../src/shared/native-chat/input/native-chat-session-options' import { MobileNativeChatStopButton } from '../input/MobileNativeChatStopButton' import { MobileNativeChatControlSwap } from '../input/mobile-native-chat-control-swap' -import type { MobileNativeChatSendIntent } from '../mobile-native-chat-send' +import type { MobileNativeChatSendIntent } from './mobile-native-chat-send' import { mobileNativeChatComposerShowsStop } from './mobile-native-chat-composer-layout' import type { MobileNativeChatStructuredComposer } from './mobile-native-chat-structured-composer' import { readMobileNativeChatPickedSkills } from './mobile-native-chat-draft-store' diff --git a/mobile/src/session/native-chat/composer/MobileNativeChatSendButton.tsx b/mobile/src/session/native-chat/composer/MobileNativeChatSendButton.tsx index cde9442e07c..af5a2a79dc9 100644 --- a/mobile/src/session/native-chat/composer/MobileNativeChatSendButton.tsx +++ b/mobile/src/session/native-chat/composer/MobileNativeChatSendButton.tsx @@ -16,7 +16,7 @@ import { useMobileTranslation } from '../../../i18n/use-mobile-translation' import { useKeyboardPersistingTaps } from '../../../platform/keyboard-persisting-taps' import { colors } from '../../../theme/mobile-theme' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' -import type { MobileNativeChatSendIntent } from '../mobile-native-chat-send' +import type { MobileNativeChatSendIntent } from './mobile-native-chat-send' const FOLLOW_UP_ICON = { queue: ListEnd, steer: CornerDownRight } as const diff --git a/mobile/src/session/native-chat/composer/mobile-draft-inputs-scaling.test.ts b/mobile/src/session/native-chat/composer/mobile-draft-inputs-scaling.test.ts deleted file mode 100644 index 8155332bd37..00000000000 --- a/mobile/src/session/native-chat/composer/mobile-draft-inputs-scaling.test.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { createElement } from 'react' -import { act, create } from 'react-test-renderer' -import { afterEach, expect, it, vi } from 'vitest' -import { useMobileNativeChatFileAttachments } from './use-mobile-native-chat-file-attachments' -import { useMobileNativeChatImageAttachments } from './use-mobile-native-chat-image-attachments' -import { - useMobileNativeChatDraft, - setMobileNativeChatDraftText, - resetMobileNativeChatDraftStoreForTests -} from './mobile-native-chat-draft-store' -import { - subscribeMobileNativeChatDraftInputs, - updateMobileNativeChatDraftInputs, - closeMobileNativeChatEditInputs, - useMobileNativeChatDraftInputs -} from './mobile-native-chat-draft-inputs' - -const picker = vi.hoisted(() => ({ pickFiles: vi.fn(), pickImages: vi.fn() })) -vi.mock('../../../platform/media-picker', () => ({ useMediaPicker: () => picker })) -afterEach(resetMobileNativeChatDraftStoreForTests) - -it.each([20, 200])( - 'isolates mounted text, input, image and file consumers across %i other scopes', - async (count) => { - const scopes = [ - 'own-host:target', - ...Array.from({ length: count }, (_, i) => `other-host:${i}`) - ] - const own = scopes[0] - const renders = scopes.map(() => ({ text: 0, input: 0, image: 0, file: 0 })) - const values: { - text: string - pending: number - images: readonly string[] - files: readonly string[] - }[] = scopes.map(() => ({ text: '', pending: 0, images: [], files: [] })) - const upstream = scopes.map(() => vi.fn()) - const releases = scopes.map((scope, i) => - subscribeMobileNativeChatDraftInputs(scope, upstream[i]) - ) - function Text({ index }: { index: number }) { - values[index].text = useMobileNativeChatDraft(scopes[index]) - renders[index].text++ - return null - } - function Input({ index }: { index: number }) { - values[index].pending = useMobileNativeChatDraftInputs(scopes[index]).pending ?? 0 - renders[index].input++ - return null - } - function File({ index }: { index: number }) { - const file = useMobileNativeChatFileAttachments({ - client: null, - sessionId: null, - scopeKey: scopes[index], - enabled: false, - showToast: vi.fn() - }) - values[index].files = file.files.map((entry) => entry.path ?? '') - renders[index].file++ - return null - } - function Image({ index }: { index: number }) { - const image = useMobileNativeChatImageAttachments({ - client: null, - agent: 'codex', - activeHandleRef: { current: null }, - deviceTokenRef: { current: null }, - getActiveWorktreeConnectionId: async () => null, - connState: 'disconnected', - scopeKey: scopes[index], - enabled: false, - structuredNativeChat: true, - showToast: vi.fn(), - onSendError: vi.fn(), - baseSend: async () => 'rejected', - readSeededLaunchDraft: () => null - }) - values[index].images = image.attachments.map((entry) => entry.path) - renders[index].image++ - return null - } - let view: ReturnType | undefined - await act(async () => { - view = create( - createElement( - 'fixture', - {}, - scopes.flatMap((_, index) => [ - createElement(Text, { key: `t${index}`, index }), - createElement(Input, { key: `p${index}`, index }), - createElement(File, { key: `f${index}`, index }), - createElement(Image, { key: `i${index}`, index }) - ]) - ) - ) - }) - renders.forEach((entry) => { - entry.text = entry.input = entry.image = entry.file = 0 - }) - try { - await act(async () => setMobileNativeChatDraftText(own, 'own text')) - expect(values[0].text).toBe('own text') - expect(renders[0]).toEqual({ text: 1, input: 0, image: 0, file: 0 }) - await act(async () => - updateMobileNativeChatDraftInputs(own, (current) => ({ ...current, pending: 1 })) - ) - expect(values[0].pending).toBe(1) - await act(async () => - updateMobileNativeChatDraftInputs(own, (current) => ({ - ...current, - images: [{ id: 'image', path: '/saved.png', previewUri: 'file:///saved.png' }] - })) - ) - expect(values[0].images).toEqual(['/saved.png']) - await act(async () => - updateMobileNativeChatDraftInputs(own, (current) => ({ - ...current, - files: [ - { id: 'file', path: '/saved.txt', name: 'saved.txt', mime: 'text/plain', byteLength: 1 } - ] - })) - ) - expect(values[0].files).toEqual(['/saved.txt']) - expect(renders[0]).toEqual({ text: 1, input: 3, image: 2, file: 1 }) - expect(upstream[0]).toHaveBeenCalledTimes(3) - for (let index = 1; index < scopes.length; index++) { - expect(renders[index]).toEqual({ text: 0, input: 0, image: 0, file: 0 }) - expect(upstream[index]).not.toHaveBeenCalled() - } - } finally { - await act(async () => view?.unmount()) - releases.forEach((release) => release()) - } - await act(async () => - updateMobileNativeChatDraftInputs(own, (current) => ({ ...current, pending: 0 })) - ) - expect(renders[0]).toEqual({ text: 1, input: 3, image: 2, file: 1 }) - expect(upstream[0]).toHaveBeenCalledTimes(3) - } -) -it.each([20, 200])( - 'notifies only affected scopes across %i retained input subscribers and retires listeners', - (count) => { - const idle = vi.fn() - const releases = Array.from({ length: count }, (_, index) => - subscribeMobileNativeChatDraftInputs(`idle-${index}`, idle) - ) - const source = vi.fn() - const destination = vi.fn() - releases.push( - subscribeMobileNativeChatDraftInputs('queued-edit:one', source), - subscribeMobileNativeChatDraftInputs('bottom', destination) - ) - updateMobileNativeChatDraftInputs('queued-edit:one', (inputs) => ({ ...inputs, pending: 1 })) - expect(source).toHaveBeenCalledTimes(1) - expect(idle).not.toHaveBeenCalled() - closeMobileNativeChatEditInputs('queued-edit:one', 'bottom') - expect(source).toHaveBeenCalledTimes(2) - expect(destination).toHaveBeenCalledTimes(1) - expect(idle).not.toHaveBeenCalled() - releases.forEach((release) => release()) - updateMobileNativeChatDraftInputs('bottom', (inputs) => ({ ...inputs, pending: 0 })) - expect(destination).toHaveBeenCalledTimes(1) - } -) diff --git a/mobile/src/session/native-chat/mobile-native-chat-attach-actions.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-attach-actions.ts similarity index 93% rename from mobile/src/session/native-chat/mobile-native-chat-attach-actions.ts rename to mobile/src/session/native-chat/composer/mobile-native-chat-attach-actions.ts index 4b855587cfb..aae916a7d71 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-attach-actions.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-attach-actions.ts @@ -1,6 +1,6 @@ import { AtSign, Image, Package, Paperclip, Terminal } from 'lucide-react-native' -import type { ActionSheetAction } from '../../components/ActionSheetModal' -import { translate } from '../../i18n/mobile-i18n' +import type { ActionSheetAction } from '../../../components/ActionSheetModal' +import { translate } from '../../../i18n/mobile-i18n' // Dismiss the sheet before opening pickers because iOS cannot present them over its Modal. export function mobileNativeChatAttachActions(args: { diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-composer-menu.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-composer-menu.ts index ecac1d211d2..ea5597fd311 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-composer-menu.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-composer-menu.ts @@ -1,6 +1,7 @@ import type { AgentSessionConversationCommand } from '../../../../../src/shared/agent-session/agent-session-conversation-command' import type { AgentSessionSlashCommand } from '../../../../../src/shared/agent-session/agent-session-wire' import { + getAgentAnsweredNativeChatCommands, getNativeChatAgentProfile, type NativeChatAgentProfile } from '../../../../../src/shared/native-chat/native-chat-agent-profiles' @@ -19,7 +20,6 @@ import type { SlashCommandSuggestion } from '../../../../../src/shared/native-chat/input/native-chat-slash-commands' import { structuredSessionSlashCommands } from '../../../../../src/shared/agent-session/view/structured-agent-session-composer' -import { getMobileNativeChatCommands } from '../mobile-native-chat-send-classification' // Why: the menu is a plain ScrollView right above a streaming transcript, so it mounts a bounded // number of rows; typing narrows the rest. @@ -66,7 +66,7 @@ export function mobileComposerCatalog({ structured.compactInstructions, interactionModeSupported ) - : getMobileNativeChatCommands(agent) + : getAgentAnsweredNativeChatCommands(agent) return { profile: getNativeChatAgentProfile(agent), commands: nativeChatPickerCommands(agent, commands, discovery.skills), diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-draft-inputs.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-draft-inputs.ts index 337c2995584..c6f5e4d0f6a 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-draft-inputs.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-draft-inputs.ts @@ -225,13 +225,6 @@ export function captureMobileNativeChatTextDestination(): return focusedScope ? textDestinations.get(focusedScope)?.() : undefined } -export function resetMobileNativeChatDraftInputsForTests(): void { - drafts.clear() - destinations.clear() - textDestinations.clear() - focusedScope = null -} - export function pruneMobileNativeChatDraftSkills( scope: string, text: string, diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-draft-persistence.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-draft-persistence.ts index 80a77014ac6..68c3989edac 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-draft-persistence.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-draft-persistence.ts @@ -19,7 +19,6 @@ import { deviceStoreDraftBackend, durableDraftRow, durableDraftRowKey, - resetDurableDraftRowsForTests, type DurableDraftRow, type DurableDraftRowBackend } from '../../../drafts/durable-draft-rows' @@ -204,8 +203,3 @@ export function closeSavedMobileNativeChatDraft(scope: string): void { tab.workspace.row.save('immediate') } } - -export function resetMobileNativeChatDraftPersistenceForTests(): void { - resetDurableDraftRowsForTests() - workspaces.clear() -} diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-draft-reconcile.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-draft-reconcile.ts index 8ecab906278..5c5a85fad74 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-draft-reconcile.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-draft-reconcile.ts @@ -21,10 +21,6 @@ export type UnconfirmedSend = { deadline: ReturnType | null } -export function normalizedUserText(message: NativeChatMessage): string | null { - return normalizedNativeChatUserMessageText(message) -} - export type PendingImagePreviewEcho = Pick< NativeChatPendingSend, 'id' | 'text' | 'sentAt' | 'afterMessageId' | 'matchingOccurrence' @@ -161,7 +157,7 @@ export function findLandedImagePreviewEchoes( return false } if (targetText) { - const text = normalizedUserText(message) + const text = normalizedNativeChatUserMessageText(message) if (text === null) { return false } @@ -199,7 +195,9 @@ export function findLandedUnconfirmedSends( if (message.role !== 'user') { continue } - const key = isImageSourceUserTurn(message) ? '' : (normalizedUserText(message) ?? '') + const key = isImageSourceUserTurn(message) + ? '' + : (normalizedNativeChatUserMessageText(message) ?? '') const current = userMessagesByText.get(key) ?? [] current.push({ id: message.id, index }) userMessagesByText.set(key, current) diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-draft-store.test.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-draft-store.test.ts index c4bf647ba36..1ea977b8fdc 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-draft-store.test.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-draft-store.test.ts @@ -1,13 +1,20 @@ import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, describe, expect, it } from 'vitest' +import { afterEach, describe, expect, it, vi } from 'vitest' import { useMobileNativeChatDrafts } from './use-mobile-native-chat-drafts' import { - resetMobileNativeChatDraftStoreForTests, + closeMobileNativeChatTabDraft, useMobileNativeChatDraft } from './mobile-native-chat-draft-store' -import { resetMobileNativeChatDraftInputsForTests } from './mobile-native-chat-draft-inputs' + +import { loadMobileNativeChatDrafts } from './mobile-native-chat-draft-persistence' + +vi.mock('@react-native-async-storage/async-storage', async () => { + const { createInMemoryAsyncStorage } = + await import('../../../test-support/in-memory-async-storage') + return { default: createInMemoryAsyncStorage() } +}) type DraftState = ReturnType & { composerText: string } @@ -15,10 +22,12 @@ describe('mobile native-chat draft store', () => { let renderer: ReactTestRenderer | null = null let state: DraftState | null = null - afterEach(() => { + afterEach(async () => { act(() => renderer?.unmount()) - resetMobileNativeChatDraftStoreForTests() - resetMobileNativeChatDraftInputsForTests() + await loadMobileNativeChatDrafts('host', 'worktree') + closeMobileNativeChatTabDraft('host\0worktree\0a') + closeMobileNativeChatTabDraft('host\0worktree\0b') + await loadMobileNativeChatDrafts('host', 'worktree') renderer = null state = null }) diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-draft-store.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-draft-store.ts index 565990929b3..ba17d73c0d9 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-draft-store.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-draft-store.ts @@ -2,7 +2,6 @@ import { useSyncExternalStore, type SetStateAction } from 'react' import type { AgentJournalSkillRef } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' import { appendReturnedDraftText } from '../../../../../src/shared/returned-draft-text' import { - resetMobileNativeChatDraftInputsForTests, returnMobileNativeChatDraftAttachments, closeMobileNativeChatEditInputs, mobileNativeChatDraftDestination, @@ -18,7 +17,6 @@ import { readMobileNativeChatInFlightSend, readMobileNativeChatInFlightSendsByScope, registerSavedMobileNativeChatInFlightSends, - resetMobileNativeChatInFlightSendsForTests, retireMobileNativeChatInFlightSends, restoredImages, restoredFiles, @@ -28,13 +26,11 @@ import { import { dropMobileNativeChatOfflineSends, mobileNativeChatOfflineSendScopes, - resetMobileNativeChatOfflineSendsForTests, restoreMobileNativeChatOfflineSends, savedMobileNativeChatOfflineSends } from './mobile-native-chat-offline-sends' import { closeSavedMobileNativeChatDraft, - resetMobileNativeChatDraftPersistenceForTests, retainSavedMobileNativeChatDrafts, saveMobileNativeChatDraft, setMobileNativeChatDraftSource @@ -306,15 +302,6 @@ export function useMobileNativeChatDraft(draftKey: string | null): string { return useSyncExternalStore(subscribe, read, read) } -export function resetMobileNativeChatDraftStoreForTests(): void { - resetMobileNativeChatDraftInputsForTests() - drafts.clear() - resetMobileNativeChatInFlightSendsForTests() - resetMobileNativeChatOfflineSendsForTests() - mobileNativeChatLaunchDraftSeeds.clear() - resetMobileNativeChatDraftPersistenceForTests() -} - export type MobileComposerWriter = ((text: string) => boolean) & { captureOrigin?: () => (text: string) => boolean } diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-file-attachment.test.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-file-attachment.test.ts index c6a04295615..6a373e8674f 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-file-attachment.test.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-file-attachment.test.ts @@ -1,26 +1,5 @@ import { describe, expect, it } from 'vitest' -import { - MobileFileTooLargeError, - type PickedMobileFile -} from '../../../platform/media-picker-contract' -import { - nativeChatTextWithFileReferences, - uploadPickedNativeChatFiles, - type PendingNativeChatFile -} from './mobile-native-chat-file-attachment' - -function picked(name: string): PickedMobileFile { - return { name, mime: 'text/plain', byteLength: 1, base64: 'YQ==' } -} - -async function* pickedFiles(files: PickedMobileFile[], thenThrow?: Error) { - for (const file of files) { - yield file - } - if (thenThrow) { - throw thenThrow - } -} +import { nativeChatTextWithFileReferences } from './mobile-native-chat-file-attachment' describe('nativeChatTextWithFileReferences', () => { it('references each stored file on a line after the text', () => { @@ -39,64 +18,3 @@ describe('nativeChatTextWithFileReferences', () => { expect(nativeChatTextWithFileReferences('hi', [])).toBe('hi') }) }) - -describe('uploadPickedNativeChatFiles', () => { - function run(files: AsyncIterable, failName?: string) { - const chips = new Map() - const errors: string[] = [] - const pickedChips: PendingNativeChatFile[] = [] - let id = 0 - const done = uploadPickedNativeChatFiles({ - picked: files, - upload: async (file) => { - if (file.name === failName) { - throw new Error('host refused') - } - return { path: `/store/${file.name}`, name: file.name, byteLength: 1 } - }, - nextId: () => `file-${(id += 1)}`, - onPicked: (file) => { - pickedChips.push(file) - chips.set(file.id, file) - }, - onStored: (fileId, stored) => { - const chip = chips.get(fileId) - if (chip) { - chips.set(fileId, { ...chip, path: stored.path }) - } - }, - onFailed: (fileId) => chips.delete(fileId), - onError: (message) => errors.push(message) - }) - return { chips, errors, pickedChips, done } - } - - it('keeps every stored file as a chip with its host path', async () => { - const { chips, errors, pickedChips, done } = run( - pickedFiles([picked('a.txt'), picked('b.txt')]) - ) - await done - expect(pickedChips).toEqual([ - { id: 'file-1', name: 'a.txt', mime: 'text/plain', byteLength: 1, path: null }, - { id: 'file-2', name: 'b.txt', mime: 'text/plain', byteLength: 1, path: null } - ]) - expect([...chips.values()].map((chip) => chip.path)).toEqual(['/store/a.txt', '/store/b.txt']) - expect(errors).toEqual([]) - }) - - it('drops the chip of a failed upload, says which file, and carries on', async () => { - const { chips, errors, done } = run(pickedFiles([picked('a.txt'), picked('b.txt')]), 'a.txt') - await done - expect([...chips.values()].map((chip) => chip.name)).toEqual(['b.txt']) - expect(errors).toEqual(["Couldn't upload a.txt"]) - }) - - it('keeps what was stored before the picker refused an oversized file', async () => { - const { chips, errors, done } = run( - pickedFiles([picked('a.txt')], new MobileFileTooLargeError('clip.mov')) - ) - await done - expect([...chips.values()].map((chip) => chip.name)).toEqual(['a.txt']) - expect(errors).toEqual([new MobileFileTooLargeError('clip.mov').message]) - }) -}) diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-image-scope-state.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-image-scope-state.ts deleted file mode 100644 index 3429717ed67..00000000000 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-image-scope-state.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { PendingNativeChatImage } from './mobile-native-chat-image-attachment' - -export const NO_NATIVE_CHAT_IMAGE_ATTACHMENTS: PendingNativeChatImage[] = [] - -export type MobileNativeChatImagesByScope = Record - -export function withScopeAttachments( - byScope: Readonly>, - scope: string, - next: List -): Record { - if (next.length > 0) { - return { ...byScope, [scope]: next } - } - const remaining = { ...byScope } - delete remaining[scope] - return remaining -} diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-image-send.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-image-send.ts index 130b89692b6..f94eeab180b 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-image-send.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-image-send.ts @@ -5,9 +5,9 @@ import { MOBILE_NATIVE_CHAT_MIN_WRITE_TIMEOUT_MS, openMobileNativeChatSendBudget, readMobileNativeChatInputClear -} from '../mobile-native-chat-send' +} from './mobile-native-chat-send' import { nativeChatTerminalWrite } from '../../../terminal/session/mobile-session-terminal-operations' -import type { MobileNativeChatRpcSender } from '../mobile-native-chat-send' +import type { MobileNativeChatRpcSender } from './mobile-native-chat-send' // Wait for the TUI to register bracketed image attachments before text/Enter arrives. export const MOBILE_NATIVE_CHAT_IMAGE_SETTLE_MS = 300 diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-in-flight-sends.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-in-flight-sends.ts index 08d94b1b7cc..d979ebb5d35 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-in-flight-sends.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-in-flight-sends.ts @@ -5,8 +5,8 @@ import { updateMobileNativeChatDraftInputs } from './mobile-native-chat-draft-inputs' import type { PendingNativeChatFile } from './mobile-native-chat-file-attachment' -import type { MobileNativeChatSendOrigin } from '../mobile-native-chat-pending-echo' -import type { MobileNativeChatSendIntent } from '../mobile-native-chat-send' +import type { MobileNativeChatSendOrigin } from '../transcript/mobile-native-chat-pending-echo' +import type { MobileNativeChatSendIntent } from './mobile-native-chat-send' import { saveMobileNativeChatDraft } from './mobile-native-chat-draft-persistence' import type { MobileNativeChatInFlightSend, @@ -215,7 +215,3 @@ export function retireMobileNativeChatInFlightSends(scope: string): void { } } } - -export function resetMobileNativeChatInFlightSendsForTests(): void { - inFlightSends.clear() -} diff --git a/mobile/src/session/mobile-native-chat-message-hand-back.test.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-message-hand-back.test.ts similarity index 88% rename from mobile/src/session/mobile-native-chat-message-hand-back.test.ts rename to mobile/src/session/native-chat/composer/mobile-native-chat-message-hand-back.test.ts index 697c0dd00af..bb086a110ab 100644 --- a/mobile/src/session/mobile-native-chat-message-hand-back.test.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-message-hand-back.test.ts @@ -5,19 +5,19 @@ import { returnMobileNativeChatMessageToComposer } from './mobile-native-chat-me import { readMobileNativeChatDraftInputs, updateMobileNativeChatDraftInputs -} from './native-chat/composer/mobile-native-chat-draft-inputs' +} from './mobile-native-chat-draft-inputs' import { - resetMobileNativeChatDraftStoreForTests, + closeMobileNativeChatTabDraft, setMobileNativeChatDraftText, useMobileNativeChatDraft -} from './native-chat/composer/mobile-native-chat-draft-store' +} from './mobile-native-chat-draft-store' let renderer: ReactTestRenderer | null = null let text = '' afterEach(() => { act(() => renderer?.unmount()) - resetMobileNativeChatDraftStoreForTests() + closeMobileNativeChatTabDraft('scope') renderer = null }) diff --git a/mobile/src/session/mobile-native-chat-message-hand-back.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-message-hand-back.ts similarity index 73% rename from mobile/src/session/mobile-native-chat-message-hand-back.ts rename to mobile/src/session/native-chat/composer/mobile-native-chat-message-hand-back.ts index 7391481887f..a3a288a70e7 100644 --- a/mobile/src/session/mobile-native-chat-message-hand-back.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-message-hand-back.ts @@ -1,12 +1,12 @@ -import type { AgentJournalMessageItem } from '../../../src/shared/agent-session/journal/agent-session-journal-types' -import { queuedEditTextForKeptImages } from '../../../src/shared/queued-message-edit' -import { appendReturnedDraftText } from '../../../src/shared/returned-draft-text' -import { mobileDraftImageOfBlock } from './mobile-queued-message-edit-draft' +import type { AgentJournalMessageItem } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' +import { queuedEditTextForKeptImages } from '../../../../../src/shared/queued-message-edit' +import { appendReturnedDraftText } from '../../../../../src/shared/returned-draft-text' +import { mobileDraftImageOfBlock } from '../input/mobile-queued-message-edit-draft' import { readMobileNativeChatDraftInputs, updateMobileNativeChatDraftInputs -} from './native-chat/composer/mobile-native-chat-draft-inputs' -import { setMobileNativeChatDraftText } from './native-chat/composer/mobile-native-chat-draft-store' +} from './mobile-native-chat-draft-inputs' +import { setMobileNativeChatDraftText } from './mobile-native-chat-draft-store' /** Append a sent message's text and images after what is typed; stable chip ids keep a repeat from doubling them. */ export function returnMobileNativeChatMessageToComposer( diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-offline-sends.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-offline-sends.ts index 53ab4be9eb2..e2e74e4acc8 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-offline-sends.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-offline-sends.ts @@ -186,7 +186,3 @@ export function useMobileNativeChatOfflineSends( }, []) return useSyncExternalStore(subscribe, () => readMobileNativeChatOfflineSends(scope)) } - -export function resetMobileNativeChatOfflineSendsForTests(): void { - queues.clear() -} diff --git a/mobile/src/session/native-chat/mobile-native-chat-send-classification.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-send-classification.ts similarity index 62% rename from mobile/src/session/native-chat/mobile-native-chat-send-classification.ts rename to mobile/src/session/native-chat/composer/mobile-native-chat-send-classification.ts index 77febaf434c..e228d61446f 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-send-classification.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-send-classification.ts @@ -3,17 +3,13 @@ import { getAgentAnsweredNativeChatCommands, getNativeChatAgentProfile -} from '../../../../src/shared/native-chat/native-chat-agent-profiles' +} from '../../../../../src/shared/native-chat/native-chat-agent-profiles' import { classifyNativeChatSend, - type NativeChatSendClassification, - type SlashCommandSuggestion -} from '../../../../src/shared/native-chat/input/native-chat-slash-commands' + type NativeChatSendClassification +} from '../../../../../src/shared/native-chat/input/native-chat-slash-commands' // Terminal mobile chat lacks desktop-owned command answers and reply rows. -export function getMobileNativeChatCommands(agent: string): readonly SlashCommandSuggestion[] { - return getAgentAnsweredNativeChatCommands(agent) -} export function classifyMobileNativeChatSend( agent: string | null, @@ -26,7 +22,7 @@ export function classifyMobileNativeChatSend( const profile = getNativeChatAgentProfile(agent) return classifyNativeChatSend( text, - getMobileNativeChatCommands(agent), + getAgentAnsweredNativeChatCommands(agent), pickerSkillOriginToken, profile?.skillPrefix ?? null ) diff --git a/mobile/src/session/native-chat/mobile-native-chat-send.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-send.ts similarity index 88% rename from mobile/src/session/native-chat/mobile-native-chat-send.ts rename to mobile/src/session/native-chat/composer/mobile-native-chat-send.ts index c91e15906ee..9c980127a97 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-send.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-send.ts @@ -1,22 +1,22 @@ -import type { RpcClient } from '../../transport/rpc/rpc-client-contract' -import type { PendingNativeChatImage } from './composer/mobile-native-chat-image-attachment' -import type { PendingNativeChatFile } from './composer/mobile-native-chat-file-attachment' -import { isRpcDeliveryUnknown } from '../../transport/rpc/rpc-delivery-ambiguity' -import '../../transport/connection/stable-logical-rpc-client' -import { isLogicalClientCutoverError } from '../../transport/connection/logical-client-cutover-error' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import type { PendingNativeChatImage } from './mobile-native-chat-image-attachment' +import type { PendingNativeChatFile } from './mobile-native-chat-file-attachment' +import { isRpcDeliveryUnknown } from '../../../transport/rpc/rpc-delivery-ambiguity' +import '../../../transport/connection/stable-logical-rpc-client' +import { isLogicalClientCutoverError } from '../../../transport/connection/logical-client-cutover-error' import { nativeChatTerminalWrite, nativeChatTerminalDraftRead -} from '../../terminal/session/mobile-session-terminal-operations' -import { typeAgentTuiCommand } from '../../../../src/shared/agent-launch/startup/agent-tui-command-typing' -import { readTerminalSendAcknowledgment } from '../../../../src/shared/terminal/pty/lifecycle/terminal-send-acknowledgment' +} from '../../../terminal/session/mobile-session-terminal-operations' +import { typeAgentTuiCommand } from '../../../../../src/shared/agent-launch/startup/agent-tui-command-typing' +import { readTerminalSendAcknowledgment } from '../../../../../src/shared/terminal/pty/lifecycle/terminal-send-acknowledgment' import { AGENT_TUI_CLEAR_MAX_LINES, countAgentTuiInputLines, buildAgentTuiClearInputForText -} from '../../../../src/shared/agent-launch/startup/agent-tui-input-clear' +} from '../../../../../src/shared/agent-launch/startup/agent-tui-input-clear' -import type { AgentJournalSkillRef } from '../../../../src/shared/agent-session/journal/agent-session-journal-types' +import type { AgentJournalSkillRef } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' export type MobileNativeChatRpcSender = Parameters[0] diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-skill-operations.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-skill-operations.ts index fc06f8e0be0..de98372945e 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-skill-operations.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-skill-operations.ts @@ -2,13 +2,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../../transport import { rpcResultVariant } from '../../../transport/rpc/rpc-operation-result-reader' import '../../../terminal/terminal-reply-schema' import { skillDiscoveryReplySchema } from './mobile-native-chat-skill-reply-schema' -import '../../agent-launch/mobile-agent-detection-reply-schema' -import '../../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../../../terminal/session/mobile-session-terminal-reply-schema' -import '../../../worktree/session-worktree-record-reply-schema' -import '../../../terminal/quick-commands/mobile-quick-command-reply-schema' -import '../../../files/workspace-file-paths-reply-schema' // Mobile names the workspace and lets the host resolve and scan it; see SKILL_DISCOVER_WORKSPACE_CAPABILITY. export const nativeChatSkillDiscoveryRead = bindDeferredRpcOperation( diff --git a/mobile/src/session/native-chat/mobile-native-chat-stale-input.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts similarity index 96% rename from mobile/src/session/native-chat/mobile-native-chat-stale-input.ts rename to mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts index f0885dd157d..7762f7762ea 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-stale-input.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-stale-input.ts @@ -1,4 +1,4 @@ -import { pasteMobileNativeChatImagePaths } from './composer/mobile-native-chat-image-send' +import { pasteMobileNativeChatImagePaths } from './mobile-native-chat-image-send' import type { MobileNativeChatRpcSender } from './mobile-native-chat-send' // The condition tracked here — a bracketed image paste left sitting on the agent's diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-structured-composer.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-structured-composer.ts index 5efa1fe1f80..27de249feb3 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-structured-composer.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-structured-composer.ts @@ -1,6 +1,6 @@ import type { MobileComposerStructuredCatalog } from './mobile-native-chat-composer-menu' import type { PendingNativeChatFile } from './mobile-native-chat-file-attachment' -import type { MobileStructuredThreadGoal } from '../../use-mobile-structured-thread-goal' +import type { MobileStructuredThreadGoal } from '../input/use-mobile-structured-thread-goal' export type MobileNativeChatStructuredComposer = { catalog: MobileComposerStructuredCatalog diff --git a/mobile/src/session/native-chat/mobile-native-chat-terminal-write-lock.test.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-terminal-write-lock.test.ts similarity index 100% rename from mobile/src/session/native-chat/mobile-native-chat-terminal-write-lock.test.ts rename to mobile/src/session/native-chat/composer/mobile-native-chat-terminal-write-lock.test.ts diff --git a/mobile/src/session/native-chat/mobile-native-chat-terminal-write-lock.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-terminal-write-lock.ts similarity index 100% rename from mobile/src/session/native-chat/mobile-native-chat-terminal-write-lock.ts rename to mobile/src/session/native-chat/composer/mobile-native-chat-terminal-write-lock.ts diff --git a/mobile/src/session/mobile-structured-composer-command.ts b/mobile/src/session/native-chat/composer/mobile-structured-composer-command.ts similarity index 85% rename from mobile/src/session/mobile-structured-composer-command.ts rename to mobile/src/session/native-chat/composer/mobile-structured-composer-command.ts index 04d80c271fb..55c0ea4432f 100644 --- a/mobile/src/session/mobile-structured-composer-command.ts +++ b/mobile/src/session/native-chat/composer/mobile-structured-composer-command.ts @@ -2,26 +2,26 @@ import { agentSessionConversationCommandFields, type AgentSessionConversationCommand, type AgentSessionConversationCommandResult -} from '../../../src/shared/agent-session/agent-session-conversation-command' -import type { AgentSessionFailureFact } from '../../../src/shared/agent-session/failures/agent-session-failure' +} from '../../../../../src/shared/agent-session/agent-session-conversation-command' +import type { AgentSessionFailureFact } from '../../../../../src/shared/agent-session/failures/agent-session-failure' import { dispatchStructuredAgentSessionComposerCommand, isStructuredAgentSessionHostCommand, type StructuredAgentSessionCommandRefusalCause, type StructuredAgentSessionComposerOptions -} from '../../../src/shared/agent-session/view/structured-agent-session-composer' +} from '../../../../../src/shared/agent-session/view/structured-agent-session-composer' import { conversationCommandReply, heldConversationCommandParts, structuredConversationCommandHold -} from '../../../src/shared/structured-conversation-command-hold' -import { mobileAgentSessionWriteNoticeText } from './agent-session-write-notice-copy' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import { translate } from '../i18n/mobile-i18n' -import { sayMobileAgentSessionFailure } from './agent-session-failure-copy' -import type { MobileNativeChatSendOutcome } from './native-chat/mobile-native-chat-send' -import { requestStructuredAgentSessionMutation } from './mobile-structured-agent-session-rpc' -import type { MobileNativeChatSendErrorReporter } from './native-chat/use-mobile-native-chat-send-error' +} from '../../../../../src/shared/structured-conversation-command-hold' +import { mobileAgentSessionWriteNoticeText } from '../agent-session/agent-session-write-notice-copy' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import { translate } from '../../../i18n/mobile-i18n' +import { sayMobileAgentSessionFailure } from '../agent-session/agent-session-failure-copy' +import type { MobileNativeChatSendOutcome } from './mobile-native-chat-send' +import { requestStructuredAgentSessionMutation } from '../agent-session/mobile-structured-agent-session-rpc' +import type { MobileNativeChatSendErrorReporter } from './use-mobile-native-chat-send-error' /** What the phone shows at keypress that holds a command; `background` also counts the strip mid-turn. */ export type MobileStructuredCommandHolds = Readonly< diff --git a/mobile/src/session/mobile-structured-send-delivery.ts b/mobile/src/session/native-chat/composer/mobile-structured-send-delivery.ts similarity index 77% rename from mobile/src/session/mobile-structured-send-delivery.ts rename to mobile/src/session/native-chat/composer/mobile-structured-send-delivery.ts index d9f3eb2c58f..129006f77ca 100644 --- a/mobile/src/session/mobile-structured-send-delivery.ts +++ b/mobile/src/session/native-chat/composer/mobile-structured-send-delivery.ts @@ -1,9 +1,9 @@ -import type { AgentSessionSendResult } from '../../../src/shared/agent-session/agent-session-wire' -import { agentSessionRefusalOperationState } from '../../../src/shared/agent-session/failures/agent-session-refusal-retry' -import type { MobileNativeChatSendOutcome } from './native-chat/mobile-native-chat-send' -import type { StructuredAgentSessionMutationCallResult } from './mobile-structured-agent-session-rpc' -import { STRUCTURED_AGENT_SESSION_SUBMISSION_MISSING } from '../../../src/shared/agent-session/requests/structured-agent-session-send-evidence' -import { translate } from '../i18n/mobile-i18n' +import type { AgentSessionSendResult } from '../../../../../src/shared/agent-session/agent-session-wire' +import { agentSessionRefusalOperationState } from '../../../../../src/shared/agent-session/failures/agent-session-refusal-retry' +import type { MobileNativeChatSendOutcome } from './mobile-native-chat-send' +import type { StructuredAgentSessionMutationCallResult } from '../agent-session/mobile-structured-agent-session-rpc' +import { STRUCTURED_AGENT_SESSION_SUBMISSION_MISSING } from '../../../../../src/shared/agent-session/requests/structured-agent-session-send-evidence' +import { translate } from '../../../i18n/mobile-i18n' export type MobileStructuredSendDelivery = { outcome: MobileNativeChatSendOutcome diff --git a/mobile/src/session/mobile-structured-send-queue-rule.ts b/mobile/src/session/native-chat/composer/mobile-structured-send-queue-rule.ts similarity index 67% rename from mobile/src/session/mobile-structured-send-queue-rule.ts rename to mobile/src/session/native-chat/composer/mobile-structured-send-queue-rule.ts index 12065e7d0a2..8a5f9dd97c0 100644 --- a/mobile/src/session/mobile-structured-send-queue-rule.ts +++ b/mobile/src/session/native-chat/composer/mobile-structured-send-queue-rule.ts @@ -1,9 +1,9 @@ -import { selectAgentSessionCurrentRequests } from '../../../src/shared/agent-session/requests/agent-session-current-requests' -import type { StructuredAgentSessionState } from '../../../src/shared/agent-session/structured-agent-session-reducer' +import { selectAgentSessionCurrentRequests } from '../../../../../src/shared/agent-session/requests/agent-session-current-requests' +import type { StructuredAgentSessionState } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' import { structuredAgentSessionFollowUpsQueue, structuredAgentSessionQueueEnabled -} from '../../../src/shared/agent-session/view/structured-agent-session-queued-cards' +} from '../../../../../src/shared/agent-session/view/structured-agent-session-queued-cards' /** The desktop's rule: the alternate flips the setting first, then the queue's own rules decide. */ export function mobileStructuredSendQueues( diff --git a/mobile/src/session/mobile-structured-send-recorded-read.ts b/mobile/src/session/native-chat/composer/mobile-structured-send-recorded-read.ts similarity index 85% rename from mobile/src/session/mobile-structured-send-recorded-read.ts rename to mobile/src/session/native-chat/composer/mobile-structured-send-recorded-read.ts index 17e47b2199e..8fec033fadb 100644 --- a/mobile/src/session/mobile-structured-send-recorded-read.ts +++ b/mobile/src/session/native-chat/composer/mobile-structured-send-recorded-read.ts @@ -1,9 +1,9 @@ import { useLayoutEffect, useMemo, useRef } from 'react' import * as z from 'zod' -import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc/rpc-operation' -import { rpcResultVariant } from '../transport/rpc/rpc-operation-result-reader' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import type { StructuredAgentSessionHostSupport } from './mobile-structured-agent-session-host-support' +import { bindDeferredRpcOperation, defineRpcOperation } from '../../../transport/rpc/rpc-operation' +import { rpcResultVariant } from '../../../transport/rpc/rpc-operation-result-reader' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import type { StructuredAgentSessionHostSupport } from '../agent-session/mobile-structured-agent-session-host-support' const sendRecordedRead = bindDeferredRpcOperation( defineRpcOperation({ diff --git a/mobile/src/session/native-chat/unconfirmed-send-deadlines.ts b/mobile/src/session/native-chat/composer/unconfirmed-send-deadlines.ts similarity index 100% rename from mobile/src/session/native-chat/unconfirmed-send-deadlines.ts rename to mobile/src/session/native-chat/composer/unconfirmed-send-deadlines.ts diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-composer-goal-mode.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-composer-goal-mode.ts index 91d7ce33131..5c3abd01481 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-composer-goal-mode.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-composer-goal-mode.ts @@ -3,8 +3,8 @@ import { Goal } from 'lucide-react-native' import type { NativeChatSendFollowUp } from '../../../../../src/shared/native-chat/input/native-chat-follow-up-behavior' import { isBareStructuredAgentSessionGoalCommand } from '../../../../../src/shared/agent-session/view/structured-agent-session-composer' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' -import type { MobileStructuredThreadGoal } from '../../use-mobile-structured-thread-goal' -import type { MobileNativeChatSendIntent } from '../mobile-native-chat-send' +import type { MobileStructuredThreadGoal } from '../input/use-mobile-structured-thread-goal' +import type { MobileNativeChatSendIntent } from './mobile-native-chat-send' import { MobileNativeChatThreadGoalStrip } from '../input/MobileNativeChatThreadGoalStrip' import { MobileNativeChatComposerModeChip } from './MobileNativeChatComposerModeChip' diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-composer-tray.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-composer-tray.ts index 2b8005f6de8..4dfbcf863ee 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-composer-tray.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-composer-tray.ts @@ -8,7 +8,7 @@ import { mobileNativeChatChordHeadId, type MobileNativeChatQueuedMessagesProps } from '../input/MobileNativeChatQueuedMessages' -import type { MobileStructuredBackgroundTasks } from '../../use-mobile-structured-background-tasks' +import type { MobileStructuredBackgroundTasks } from '../input/use-mobile-structured-background-tasks' import { useMobileNativeChatQueuedEditFocus } from '../input/use-mobile-native-chat-queued-edit-focus' import { createMobileQueuedHeadLight } from '../input/mobile-queued-head-light' import { diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-glued-pending.test.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-glued-pending.test.ts index 09542d51dfb..1db30d2be50 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-glued-pending.test.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-glued-pending.test.ts @@ -1,24 +1,28 @@ import { createElement } from 'react' import { act, create } from 'react-test-renderer' -import { afterEach, describe, expect, it } from 'vitest' +import { afterEach, describe, expect, it, vi } from 'vitest' import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' -import { buildMobileNativeChatTransientData } from '../mobile-native-chat-render-data' + import { useMobileNativeChatDrafts } from './use-mobile-native-chat-drafts' import { - resetMobileNativeChatDraftStoreForTests, + closeMobileNativeChatTabDraft, useMobileNativeChatDraft } from './mobile-native-chat-draft-store' +import { loadMobileNativeChatDrafts } from './mobile-native-chat-draft-persistence' + +vi.mock('@react-native-async-storage/async-storage', async () => { + const { createInMemoryAsyncStorage } = + await import('../../../test-support/in-memory-async-storage') + return { default: createInMemoryAsyncStorage() } +}) + type DraftState = ReturnType & { composerText: string } type TestRenderer = { unmount(): void update(element: ReturnType): void } -function userTurn(id: string, text: string, timestamp: number): NativeChatMessage { - return { id, role: 'user', blocks: [{ type: 'text', text }], timestamp, source: 'transcript' } -} - function assistantTurn(id: string, text: string, timestamp: number): NativeChatMessage { return { id, @@ -39,27 +43,15 @@ function imageTurn(id: string, path: string, timestamp: number): NativeChatMessa } } -function renderedPendingTexts( - messages: NativeChatMessage[], - state: DraftState | null -): (string | undefined)[] { - const { data } = buildMobileNativeChatTransientData({ - folded: messages, - streaming: null, - pending: state?.pending ?? [] - }) - return data - .filter((message) => !messages.some((existing) => existing.id === message.id)) - .map((message) => message.blocks.find((block) => block.type === 'text')?.text) -} - describe('useMobileNativeChatDrafts glued pending sends', () => { let renderer: TestRenderer | null = null let state: DraftState | null = null - afterEach(() => { + afterEach(async () => { act(() => renderer?.unmount()) - resetMobileNativeChatDraftStoreForTests() + await loadMobileNativeChatDrafts('host', 'worktree') + closeMobileNativeChatTabDraft('host\0worktree\0tab') + await loadMobileNativeChatDrafts('host', 'worktree') renderer = null state = null }) @@ -109,23 +101,6 @@ describe('useMobileNativeChatDrafts glued pending sends', () => { // Between the older history rows and the rows that land after a send, on the host's clock. const SENT_AT = 3000 - function send(text: string): void { - const origin = state?.captureSendOrigin(text, SENT_AT) - if (origin) { - state?.acceptSend(origin, text) - } - } - - function rapidSend(first: string, second: string): void { - act(() => { - send(first) - send(second) - }) - } - - const pendingTexts = (): (string | undefined)[] | undefined => - state?.pending.map((item) => item.text) - // Hydrating rows give no boundary, so these sends match only rows newer than their send time. describe('sends issued while the transcript is still hydrating', () => { // An image retires only by preview binding; excluding its own echo would strand both the photo and later glued sends. @@ -146,18 +121,4 @@ describe('useMobileNativeChatDrafts glued pending sends', () => { }) // Failed-read emptiness is unknown history, not an empty conversation; old rows must not claim sends against it. - describe('sends issued before any read settled', () => { - it('keeps both bubbles when the late read carries only an older glue-alike', async () => { - await mount([], false, false) - rapidSend('fix the', 'bug') - - const olderIdentical = [ - userTurn('m1', 'fix the bug', 1000), - assistantTurn('m2', 'fixed', 1100) - ] - await update(olderIdentical) - expect(pendingTexts()).toEqual(['fix the', 'bug']) - expect(renderedPendingTexts(olderIdentical, state)).toEqual(['fix the', 'bug']) - }) - }) }) diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-launch-draft.test.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-launch-draft.test.ts index a6b9e635071..34fbb34186e 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-launch-draft.test.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-launch-draft.test.ts @@ -1,14 +1,22 @@ import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, describe, expect, it } from 'vitest' +import { afterEach, describe, expect, it, vi } from 'vitest' import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' import { useMobileNativeChatDrafts } from './use-mobile-native-chat-drafts' import { - resetMobileNativeChatDraftStoreForTests, + closeMobileNativeChatTabDraft, useMobileNativeChatDraft } from './mobile-native-chat-draft-store' +import { loadMobileNativeChatDrafts } from './mobile-native-chat-draft-persistence' + +vi.mock('@react-native-async-storage/async-storage', async () => { + const { createInMemoryAsyncStorage } = + await import('../../../test-support/in-memory-async-storage') + return { default: createInMemoryAsyncStorage() } +}) + type DraftState = ReturnType & { composerText: string } function userTextMessage(id: string, text: string): NativeChatMessage { @@ -25,9 +33,12 @@ describe('useMobileNativeChatDrafts launch draft', () => { let renderer: ReactTestRenderer | null = null let state: DraftState | null = null - afterEach(() => { + afterEach(async () => { act(() => renderer?.unmount()) - resetMobileNativeChatDraftStoreForTests() + await loadMobileNativeChatDrafts('host', 'worktree') + closeMobileNativeChatTabDraft('host\0worktree\0a') + closeMobileNativeChatTabDraft('host\0worktree\0b') + await loadMobileNativeChatDrafts('host', 'worktree') renderer = null state = null }) diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-queued-hold.test.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-queued-hold.test.ts index 69def691118..1bea79e1632 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-queued-hold.test.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts-queued-hold.test.ts @@ -1,19 +1,29 @@ import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, describe, expect, it } from 'vitest' +import { afterEach, describe, expect, it, vi } from 'vitest' import { useMobileNativeChatDrafts } from './use-mobile-native-chat-drafts' import { - resetMobileNativeChatDraftStoreForTests, + closeMobileNativeChatTabDraft, useMobileNativeChatDraft } from './mobile-native-chat-draft-store' +import { loadMobileNativeChatDrafts } from './mobile-native-chat-draft-persistence' + +vi.mock('@react-native-async-storage/async-storage', async () => { + const { createInMemoryAsyncStorage } = + await import('../../../test-support/in-memory-async-storage') + return { default: createInMemoryAsyncStorage() } +}) + describe('useMobileNativeChatDrafts with queued cards', () => { let renderer: ReactTestRenderer | null = null let state: (ReturnType & { composerText: string }) | null = null - afterEach(() => { + afterEach(async () => { act(() => renderer?.unmount()) - resetMobileNativeChatDraftStoreForTests() + await loadMobileNativeChatDrafts('host', 'worktree') + closeMobileNativeChatTabDraft('host\0worktree\0a') + await loadMobileNativeChatDrafts('host', 'worktree') renderer = null state = null }) diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.test.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.test.ts index 3545d6e078a..f5bd3751aae 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.test.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.test.ts @@ -4,10 +4,18 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' import { useMobileNativeChatDrafts } from './use-mobile-native-chat-drafts' import { - resetMobileNativeChatDraftStoreForTests, + closeMobileNativeChatTabDraft, useMobileNativeChatDraft } from './mobile-native-chat-draft-store' +import { loadMobileNativeChatDrafts } from './mobile-native-chat-draft-persistence' + +vi.mock('@react-native-async-storage/async-storage', async () => { + const { createInMemoryAsyncStorage } = + await import('../../../test-support/in-memory-async-storage') + return { default: createInMemoryAsyncStorage() } +}) + type DraftState = ReturnType & { composerText: string } function userTextMessage(id: string, text: string): NativeChatMessage { @@ -34,11 +42,15 @@ describe('useMobileNativeChatDrafts', () => { let renderer: ReactTestRenderer | null = null let state: DraftState | null = null - afterEach(() => { + afterEach(async () => { act(() => renderer?.unmount()) - resetMobileNativeChatDraftStoreForTests() + await loadMobileNativeChatDrafts('host', 'worktree') + closeMobileNativeChatTabDraft('host\0worktree\0a') + closeMobileNativeChatTabDraft('host\0worktree\0b') + await loadMobileNativeChatDrafts('host', 'worktree') renderer = null state = null + vi.useRealTimers() }) function Harness({ @@ -195,7 +207,8 @@ describe('useMobileNativeChatDrafts', () => { ) expect(state?.composerText).toBe('') } finally { - vi.useRealTimers() + act(() => renderer?.unmount()) + renderer = null } }) @@ -354,52 +367,6 @@ describe('useMobileNativeChatDrafts', () => { expect(state?.composerText).toBe(' /clear') }) - it('reconciles an image-only unconfirmed send against the next user turn (no false warning)', async () => { - vi.useFakeTimers() - try { - await mount('a') - await act(async () => - renderer?.update( - createElement(Harness, { tabId: 'a', messages: [assistantTextMessage('a1', 'hi')] }) - ) - ) - const origin = state?.captureSendOrigin('') - const onUnconfirmed = vi.fn() - act(() => { - if (origin) { - state?.holdUnconfirmedSend(origin, '', onUnconfirmed) - } - }) - - await act(async () => - renderer?.update( - createElement(Harness, { - tabId: 'a', - messages: [assistantTextMessage('a1', 'hi'), assistantTextMessage('a2', 'ok')] - }) - ) - ) - await act(async () => - renderer?.update( - createElement(Harness, { - tabId: 'a', - messages: [ - assistantTextMessage('a1', 'hi'), - assistantTextMessage('a2', 'ok'), - userTextMessage('u1', '') - ] - }) - ) - ) - act(() => { - vi.advanceTimersByTime(30_000) - }) - expect(onUnconfirmed).not.toHaveBeenCalled() - } finally { - vi.useRealTimers() - } - }) - it('clears image-only echoes one per landed user turn, not all at once', async () => { await mount('a') await act(async () => @@ -430,59 +397,6 @@ describe('useMobileNativeChatDrafts', () => { expect(state?.pending.map((pending) => pending.images)).toEqual([['file:///b.jpg']]) }) - it('registers no deadline when the transcript echo beat the ambiguous RPC rejection', async () => { - vi.useFakeTimers() - try { - await mount('a') - const origin = state?.captureSendOrigin('ping') - const onUnconfirmed = vi.fn() - - await act(async () => - renderer?.update( - createElement(Harness, { tabId: 'a', messages: [userTextMessage('m1', 'ping')] }) - ) - ) - act(() => { - if (origin) { - state?.holdUnconfirmedSend(origin, 'ping', onUnconfirmed) - } - }) - - expect(vi.getTimerCount()).toBe(0) - act(() => { - vi.advanceTimersByTime(30_000) - }) - expect(onUnconfirmed).not.toHaveBeenCalled() - } finally { - vi.useRealTimers() - } - }) - - it('surfaces uncertainty when no echo lands before the deadline', async () => { - vi.useFakeTimers() - try { - await mount('a') - const origin = state?.captureSendOrigin('ping') - const onUnconfirmed = vi.fn() - act(() => { - if (origin) { - state?.holdUnconfirmedSend(origin, 'ping', onUnconfirmed) - } - }) - - act(() => { - vi.advanceTimersByTime(19_999) - }) - expect(onUnconfirmed).not.toHaveBeenCalled() - act(() => { - vi.advanceTimersByTime(1) - }) - expect(onUnconfirmed).toHaveBeenCalledTimes(1) - } finally { - vi.useRealTimers() - } - }) - it('does not confirm an unconfirmed send against an older identical turn', async () => { vi.useFakeTimers() try { @@ -516,7 +430,8 @@ describe('useMobileNativeChatDrafts', () => { }) expect(onUnconfirmed).toHaveBeenCalledTimes(1) } finally { - vi.useRealTimers() + act(() => renderer?.unmount()) + renderer = null } }) @@ -552,64 +467,8 @@ describe('useMobileNativeChatDrafts', () => { }) expect(onUnconfirmed).toHaveBeenCalledTimes(1) } finally { - vi.useRealTimers() - } - }) - - it('requires one new transcript echo per repeated unconfirmed send', async () => { - vi.useFakeTimers() - try { - await mount('a') - act(() => state?.setComposerText('ping')) - const origin = state?.captureSendOrigin('ping') - const firstUnconfirmed = vi.fn() - const secondUnconfirmed = vi.fn() - act(() => { - if (origin) { - state?.holdUnconfirmedSend(origin, 'ping', firstUnconfirmed) - state?.holdUnconfirmedSend(origin, 'ping', secondUnconfirmed) - } - }) - - await act(async () => - renderer?.update( - createElement(Harness, { tabId: 'a', messages: [userTextMessage('echo-1', 'ping')] }) - ) - ) - act(() => { - vi.advanceTimersByTime(30_000) - }) - - expect(firstUnconfirmed).not.toHaveBeenCalled() - expect(secondUnconfirmed).toHaveBeenCalledTimes(1) - } finally { - vi.useRealTimers() - } - }) - - it('does not retain a deadline when an ambiguous send settles after unmount', async () => { - vi.useFakeTimers() - try { - await mount('a') - const origin = state?.captureSendOrigin('ping') - const holdUnconfirmedSend = state?.holdUnconfirmedSend - const onUnconfirmed = vi.fn() act(() => renderer?.unmount()) renderer = null - - act(() => { - if (origin) { - holdUnconfirmedSend?.(origin, 'ping', onUnconfirmed) - } - }) - - expect(vi.getTimerCount()).toBe(0) - act(() => { - vi.advanceTimersByTime(30_000) - }) - expect(onUnconfirmed).not.toHaveBeenCalled() - } finally { - vi.useRealTimers() } }) @@ -661,7 +520,8 @@ describe('useMobileNativeChatDrafts', () => { }) expect(onUnconfirmed).toHaveBeenCalledTimes(1) } finally { - vi.useRealTimers() + act(() => renderer?.unmount()) + renderer = null } }) diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.ts index 814f11e6d90..456058a6867 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.ts @@ -18,7 +18,7 @@ import { normalizeImageTranscriptMessages, normalizeNativeChatUserText as normalizeReconcileText } from '../../../../../src/shared/native-chat/transcript/native-chat-image-transcript-markers' -import { useMobileNativeChatUnconfirmedSends } from '../use-mobile-native-chat-unconfirmed-sends' +import { useMobileNativeChatUnconfirmedSends } from './use-mobile-native-chat-unconfirmed-sends' import { appendMobileNativeChatPending, combineMobileNativeChatPending, @@ -28,7 +28,7 @@ import { visibleMobileNativeChatPending, type MobileNativeChatPendingMessage, type MobileNativeChatSendOrigin -} from '../mobile-native-chat-pending-echo' +} from '../transcript/mobile-native-chat-pending-echo' import { mobileNativeChatScopeKey } from '../mobile-native-chat-scope-key' import { mobileNativeChatDraftDestination } from './mobile-native-chat-draft-inputs' import { useMobileNativeChatLaunchDraftSeed } from './use-mobile-native-chat-launch-draft-seed' diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.test.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.test.ts index f9ed1c439a8..cdae2e0d6e9 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.test.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.test.ts @@ -1,12 +1,12 @@ -import { resetMobileNativeChatDraftInputsForTests } from './mobile-native-chat-draft-inputs' +import { closeMobileNativeChatEditInputs } from './mobile-native-chat-draft-inputs' import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import '../../../../../src/shared/agent-launch/startup/agent-tui-input-clear' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import type { RpcResponse, RpcSuccess } from '../../../transport/rpc/rpc-wire-types' -import { resetMobileNativeChatStaleInputForTests } from '../mobile-native-chat-stale-input' -import { resetMobileNativeChatTerminalWritesForTests } from '../mobile-native-chat-terminal-write-lock' +import { resetMobileNativeChatStaleInputForTests } from './mobile-native-chat-stale-input' +import { resetMobileNativeChatTerminalWritesForTests } from './mobile-native-chat-terminal-write-lock' import { useMobileNativeChatImageAttachments } from './use-mobile-native-chat-image-attachments' // Stub the media seam so direct Expo imports would expose unsupported Flow syntax and fail the transform. @@ -79,6 +79,8 @@ function baseArgs(overrides: Partial & Pick): Hook describe('useMobileNativeChatImageAttachments', () => { let renderer: ReactTestRenderer | null = null let hook: Hook | null = null + let releaseConnection: ((id: string | null) => void) | null = null + let firstAttach: Promise | null = null function Harness({ args }: { args: HookArgs }): null { hook = useMobileNativeChatImageAttachments(args) @@ -86,14 +88,20 @@ describe('useMobileNativeChatImageAttachments', () => { } beforeEach(() => { - resetMobileNativeChatDraftInputsForTests() ids.next = 0 pick.mockReset() resetMobileNativeChatStaleInputForTests() resetMobileNativeChatTerminalWritesForTests() }) - afterEach(() => { + afterEach(async () => { act(() => renderer?.unmount()) + closeMobileNativeChatEditInputs(SCOPE_A) + await act(async () => { + releaseConnection?.(null) + await firstAttach + }) + releaseConnection = null + firstAttach = null renderer = null hook = null }) @@ -106,7 +114,6 @@ describe('useMobileNativeChatImageAttachments', () => { it('keeps isAttaching true when a cancelled pick overlaps a genuine in-flight upload', async () => { // Hold a real upload after its counter increment; a concurrent cancelled pick must not decrement work it never started. - let releaseConnection: ((id: string | null) => void) | null = null const client = makeClient([methodNotFound('start'), ok('save', '/tmp/a.png')]) const args = baseArgs({ client: client as unknown as RpcClient, @@ -118,7 +125,6 @@ describe('useMobileNativeChatImageAttachments', () => { mount(args) pick.mockResolvedValue([{ base64: 'AAAA', uri: 'file:///a.jpg' }]) - let firstAttach: Promise | null = null await act(async () => { firstAttach = hook!.attachImage('library') for (let i = 0; i < 50 && !releaseConnection; i++) { diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.ts index b3cfdc53aa1..c5533f5492d 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-image-attachments.ts @@ -21,20 +21,20 @@ import { openMobileNativeChatSendBudget, type MobileNativeChatSendIntent, type MobileNativeChatSendOutcome -} from '../mobile-native-chat-send' +} from './mobile-native-chat-send' import { clearMobileNativeChatInputStale, healMobileNativeChatStaleInput, isMobileNativeChatInputStale, markMobileNativeChatInputStale -} from '../mobile-native-chat-stale-input' +} from './mobile-native-chat-stale-input' import { acquireMobileNativeChatTerminalWrite, releaseMobileNativeChatTerminalWrite -} from '../mobile-native-chat-terminal-write-lock' +} from './mobile-native-chat-terminal-write-lock' import { useMobileNativeChatImageUpload } from './use-mobile-native-chat-image-upload' import type { PendingNativeChatFile } from './mobile-native-chat-file-attachment' -import type { StructuredMobileSendAttachment } from '../../use-mobile-structured-send-with-outcome' +import type { StructuredMobileSendAttachment } from './use-mobile-structured-send-with-outcome' type CurrentRef = { readonly current: T } type ShowToast = (message: string, durationMs?: number) => void diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-input-lease.test.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-input-lease.test.ts similarity index 57% rename from mobile/src/session/native-chat/use-mobile-native-chat-input-lease.test.ts rename to mobile/src/session/native-chat/composer/use-mobile-native-chat-input-lease.test.ts index 8b99f5736b4..0126af0b4c0 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-input-lease.test.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-input-lease.test.ts @@ -1,10 +1,7 @@ import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { - useMobileNativeChatInputLease, - useSettledMobileNativeChatInputLock -} from './use-mobile-native-chat-input-lease' +import { afterEach, describe, expect, it } from 'vitest' +import { useMobileNativeChatInputLease } from './use-mobile-native-chat-input-lease' type Lease = ReturnType @@ -65,47 +62,3 @@ describe('useMobileNativeChatInputLease', () => { expect(lease?.clear()).toBe(true) }) }) - -describe('useSettledMobileNativeChatInputLock', () => { - let renderer: ReactTestRenderer | null = null - let settled: ReturnType | undefined - - afterEach(() => { - act(() => renderer?.unmount()) - renderer = null - vi.useRealTimers() - }) - - function Harness({ reason }: { reason: 'waiting' | 'disconnected' | null }): null { - settled = useSettledMobileNativeChatInputLock(reason) - return null - } - - it('holds each edge until the lease has stopped flapping', () => { - vi.useFakeTimers() - act(() => { - renderer = create(createElement(Harness, { reason: 'waiting' })) - }) - expect(settled).toBeNull() - act(() => { - vi.advanceTimersByTime(600) - }) - expect(settled).toBe('waiting') - - act(() => renderer?.update(createElement(Harness, { reason: null }))) - act(() => { - vi.advanceTimersByTime(300) - }) - act(() => renderer?.update(createElement(Harness, { reason: 'disconnected' }))) - act(() => { - vi.advanceTimersByTime(600) - }) - expect(settled).toBe('disconnected') - - act(() => renderer?.update(createElement(Harness, { reason: null }))) - act(() => { - vi.advanceTimersByTime(600) - }) - expect(settled).toBeNull() - }) -}) diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-input-lease.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-input-lease.ts similarity index 93% rename from mobile/src/session/native-chat/use-mobile-native-chat-input-lease.ts rename to mobile/src/session/native-chat/composer/use-mobile-native-chat-input-lease.ts index 9dd2bd8b078..417500e8ea2 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-input-lease.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-input-lease.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useRef, useState } from 'react' -import { nativeChatTurnStatusCopy } from './native-chat-turn-status-copy' -import { translate, type Translate } from '../../i18n/mobile-i18n' -import type { MobileNativeChatInputLockReason } from './MobileNativeChatView' +import { nativeChatTurnStatusCopy } from '../transcript/native-chat-turn-status-copy' +import { translate, type Translate } from '../../../i18n/mobile-i18n' +import type { MobileNativeChatInputLockReason } from '../MobileNativeChatView' export function useMobileNativeChatInputLease(args: { activeHandle: string | null diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-launch-draft-seed.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-launch-draft-seed.ts index acb46ca7679..b5e03cb117e 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-launch-draft-seed.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-launch-draft-seed.ts @@ -5,7 +5,7 @@ import { nativeChatLaunchDraftTurnBaseline, type NativeChatLaunchDraftTurnBaseline } from '../../../../../src/shared/native-chat/transcript/native-chat-launch-draft-resolution' -import { normalizedUserText } from './mobile-native-chat-draft-reconcile' +import { normalizedNativeChatUserMessageText } from '../../../../../src/shared/native-chat/transcript/native-chat-image-transcript-markers' import { mobileNativeChatLaunchDraftSeeds } from './mobile-native-chat-draft-store' import { mobileNativeChatDraftDestination } from './mobile-native-chat-draft-inputs' @@ -22,7 +22,7 @@ function launchDraftResolved( ): boolean { // Old hosts send no creation time, so any user turn retires the draft. if (createdAt === null) { - return messages.some((message) => normalizedUserText(message) !== null) + return messages.some((message) => normalizedNativeChatUserMessageText(message) !== null) } return launchDraftResolvedByTranscript({ createdAt }, messages, baseline) } diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-offline-sends.test.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-offline-sends.test.ts index 72d5595f366..a47686107f4 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-offline-sends.test.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-offline-sends.test.ts @@ -1,18 +1,23 @@ import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { MobileNativeChatSendIntent } from '../mobile-native-chat-send' +import type { MobileNativeChatSendIntent } from './mobile-native-chat-send' import type { MobileNativeChatInputLockReason } from '../MobileNativeChatView' -import { resetMobileNativeChatDraftStoreForTests } from './mobile-native-chat-draft-store' -import { - readMobileNativeChatOfflineSends, - resetMobileNativeChatOfflineSendsForTests -} from './mobile-native-chat-offline-sends' +import { closeMobileNativeChatTabDraft } from './mobile-native-chat-draft-store' +import { readMobileNativeChatOfflineSends } from './mobile-native-chat-offline-sends' import { useMobileNativeChatOfflineQueue, type MobileNativeChatOfflineQueue } from './use-mobile-native-chat-offline-sends' +import { loadMobileNativeChatDrafts } from './mobile-native-chat-draft-persistence' + +vi.mock('@react-native-async-storage/async-storage', async () => { + const { createInMemoryAsyncStorage } = + await import('../../../test-support/in-memory-async-storage') + return { default: createInMemoryAsyncStorage() } +}) + const SCOPE = 'host\0worktree\0tab' type Send = (text: string, intent?: MobileNativeChatSendIntent) => Promise @@ -20,6 +25,8 @@ type Send = (text: string, intent?: MobileNativeChatSendIntent) => Promise { let renderer: ReactTestRenderer | null = null let queue: MobileNativeChatOfflineQueue | null = null + let releasePending: (() => void) | null = null + let pendingSend: Promise | null = null function Harness({ lock, send }: { lock: MobileNativeChatInputLockReason | null; send: Send }) { queue = useMobileNativeChatOfflineQueue({ @@ -41,12 +48,19 @@ describe('useMobileNativeChatOfflineQueue', () => { await act(async () => renderer?.update(createElement(Harness, { lock: null, send }))) } - afterEach(() => { + afterEach(async () => { act(() => renderer?.unmount()) renderer = null queue = null - resetMobileNativeChatOfflineSendsForTests() - resetMobileNativeChatDraftStoreForTests() + await loadMobileNativeChatDrafts('host', 'worktree') + closeMobileNativeChatTabDraft('host\0worktree\0tab') + await act(async () => { + releasePending?.() + await pendingSend + }) + releasePending = null + pendingSend = null + await loadMobileNativeChatDrafts('host', 'worktree') }) it('pauses a queued message whose send fails and holds later sends behind it until Resume', async () => { @@ -84,13 +98,16 @@ describe('useMobileNativeChatOfflineQueue', () => { it('keeps a pending send single across remounts and drains later messages when it settles', async () => { const delivered: string[] = [] let finishFirst: ((sent: boolean) => void) | undefined - const send: Send = async (text) => { + const send: Send = (text) => { delivered.push(text) - return text === 'first' - ? new Promise((resolve) => { - finishFirst = resolve - }) - : true + pendingSend = + text === 'first' + ? new Promise((resolve) => { + finishFirst = resolve + releasePending = () => resolve(false) + }) + : Promise.resolve(true) + return pendingSend } await mount('disconnected', send) await act(async () => { diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-offline-sends.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-offline-sends.ts index 21f629a0aec..24ea22aef03 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-offline-sends.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-offline-sends.ts @@ -1,8 +1,8 @@ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react' import { appendReturnedDraftText } from '../../../../../src/shared/returned-draft-text' -import type { MobileNativeChatSendIntent } from '../mobile-native-chat-send' +import type { MobileNativeChatSendIntent } from './mobile-native-chat-send' import type { MobileNativeChatInputLockReason } from '../MobileNativeChatView' -import { useSettledMobileNativeChatInputLock } from '../use-mobile-native-chat-input-lease' +import { useSettledMobileNativeChatInputLock } from './use-mobile-native-chat-input-lease' import { mobileNativeChatDraftDestination, readMobileNativeChatDraftInputs, diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-send-error.test.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-send-error.test.ts similarity index 77% rename from mobile/src/session/native-chat/use-mobile-native-chat-send-error.test.ts rename to mobile/src/session/native-chat/composer/use-mobile-native-chat-send-error.test.ts index d0db1f8c01e..825c6960288 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-send-error.test.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-send-error.test.ts @@ -100,54 +100,6 @@ describe('useMobileNativeChatSendError', () => { expect(api().message).toBe('Background tasks are still running.') }) - it('holds a failure for four seconds, then drops it', async () => { - await render() - await act(async () => api().show('a')) - expect(api().message).toBe('a') - - await act(async () => { - vi.advanceTimersByTime(3999) - }) - expect(api().message).toBe('a') - await act(async () => { - vi.advanceTimersByTime(1) - }) - expect(api().message).toBeNull() - }) - - it('restarts the hold when a second failure lands mid-hold', async () => { - await render() - await act(async () => api().show('a')) - await act(async () => { - vi.advanceTimersByTime(3000) - }) - await act(async () => api().show('b')) - - await act(async () => { - vi.advanceTimersByTime(3000) - }) - expect(api().message).toBe('b') - - await act(async () => { - vi.advanceTimersByTime(1000) - }) - expect(api().message).toBeNull() - }) - - it('clears immediately and cancels the pending hold', async () => { - await render() - await act(async () => api().show('a')) - await act(async () => api().clear()) - expect(api().message).toBeNull() - - await act(async () => api().show('b')) - await act(async () => api().clear()) - await act(async () => { - vi.advanceTimersByTime(10_000) - }) - expect(api().message).toBeNull() - }) - it('drops a held failure when the scope changes', async () => { await render('terminal-1') await act(async () => api().show('a')) @@ -210,13 +162,4 @@ describe('useMobileNativeChatSendError', () => { expect(showToast).toHaveBeenCalledWith('Delivery unconfirmed', 1600) }) - - it('cancels the pending hold timer on unmount', async () => { - await render() - await act(async () => api().show('a')) - expect(vi.getTimerCount()).toBe(1) - act(() => renderer?.unmount()) - renderer = null - expect(vi.getTimerCount()).toBe(0) - }) }) diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-send-error.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-send-error.ts similarity index 97% rename from mobile/src/session/native-chat/use-mobile-native-chat-send-error.ts rename to mobile/src/session/native-chat/composer/use-mobile-native-chat-send-error.ts index db9fc4dab94..fbc0b4ed6f0 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-send-error.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-send-error.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, useRef, useState, type MutableRefObject } from 'react' -import type { StructuredAgentSessionCommandRefusalCause } from '../../../../src/shared/agent-session/view/structured-agent-session-composer' +import type { StructuredAgentSessionCommandRefusalCause } from '../../../../../src/shared/agent-session/view/structured-agent-session-composer' // Keep command-refusal causes only while the chat still shows the work that caused them. export type MobileNativeChatSendErrorDetails = { diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-stop.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-stop.ts similarity index 88% rename from mobile/src/session/native-chat/use-mobile-native-chat-stop.ts rename to mobile/src/session/native-chat/composer/use-mobile-native-chat-stop.ts index 0adce2c38b9..b6411fd0036 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-stop.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-stop.ts @@ -1,13 +1,13 @@ import { useCallback, useEffect, useRef, type MutableRefObject } from 'react' -import { translate } from '../../i18n/mobile-i18n' -import type { RpcClient } from '../../transport/rpc/rpc-client-contract' -import { isRpcDeliveryUnknown } from '../../transport/rpc/rpc-delivery-ambiguity' -import '../../transport/connection/stable-logical-rpc-client' -import { isLogicalClientCutoverError } from '../../transport/connection/logical-client-cutover-error' -import { nativeChatTerminalWrite } from '../../terminal/session/mobile-session-terminal-operations' +import { translate } from '../../../i18n/mobile-i18n' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import { isRpcDeliveryUnknown } from '../../../transport/rpc/rpc-delivery-ambiguity' +import '../../../transport/connection/stable-logical-rpc-client' +import { isLogicalClientCutoverError } from '../../../transport/connection/logical-client-cutover-error' +import { nativeChatTerminalWrite } from '../../../terminal/session/mobile-session-terminal-operations' import { openMobileNativeChatSendBudget } from './mobile-native-chat-send' -import { nativeChatStopSendsSecondEscape } from '../../../../src/shared/native-chat/native-chat-agent-support' -import { NATIVE_CHAT_QUESTION_STEP_MS } from '../../../../src/shared/native-chat/input/native-chat-answer-stepping' +import { nativeChatStopSendsSecondEscape } from '../../../../../src/shared/native-chat/native-chat-agent-support' +import { NATIVE_CHAT_QUESTION_STEP_MS } from '../../../../../src/shared/native-chat/input/native-chat-answer-stepping' // Resolves false only when no Escape could have landed, so the chat may offer Stop again. export function useMobileNativeChatStop(args: { diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-structured-composer.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-structured-composer.ts index a0a7b6efb54..80d1e453980 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-structured-composer.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-structured-composer.ts @@ -1,9 +1,9 @@ import { useMemo } from 'react' import type { AgentSessionConversationCommand } from '../../../../../src/shared/agent-session/agent-session-conversation-command' -import type { MobileNativeChatStructuredComposer } from './MobileNativeChatComposer' +import type { MobileNativeChatStructuredComposer } from './mobile-native-chat-structured-composer' import type { MobileNativeChatFileAttachments } from './use-mobile-native-chat-file-attachments' -import type { useMobileStructuredSessionCommands } from '../../use-mobile-structured-session-commands' -import type { MobileStructuredThreadGoal } from '../../use-mobile-structured-thread-goal' +import type { useMobileStructuredSessionCommands } from './use-mobile-structured-session-commands' +import type { MobileStructuredThreadGoal } from '../input/use-mobile-structured-thread-goal' const NO_COMMANDS: readonly AgentSessionConversationCommand[] = [] diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-unconfirmed-sends.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-unconfirmed-sends.ts similarity index 94% rename from mobile/src/session/native-chat/use-mobile-native-chat-unconfirmed-sends.ts rename to mobile/src/session/native-chat/composer/use-mobile-native-chat-unconfirmed-sends.ts index c62e77df380..1adf0877a0b 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-unconfirmed-sends.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-unconfirmed-sends.ts @@ -1,19 +1,19 @@ // Lost acknowledgements may hide delivered sends: hold them quietly until the transcript confirms them, or hand them back at the deadline. Structured sends own a separate hold. import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react' -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' +import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' import { findLandedUnconfirmedSends, type UnconfirmedSend -} from './composer/mobile-native-chat-draft-reconcile' -import { returnMobileNativeChatInFlightSend } from './composer/mobile-native-chat-draft-store' +} from './mobile-native-chat-draft-reconcile' +import { returnMobileNativeChatInFlightSend } from './mobile-native-chat-draft-store' import { claimMobileNativeChatInFlightSends, releaseMobileNativeChatInFlightSends, settleMobileNativeChatInFlightSend, useMobileNativeChatSavedInFlightVersion -} from './composer/mobile-native-chat-in-flight-sends' -import type { MobileNativeChatSendOrigin } from './mobile-native-chat-pending-echo' +} from './mobile-native-chat-in-flight-sends' +import type { MobileNativeChatSendOrigin } from '../transcript/mobile-native-chat-pending-echo' import { createUnconfirmedSendDeadlines } from './unconfirmed-send-deadlines' export const UNCONFIRMED_SEND_MESSAGE = 'Delivery unconfirmed — check chat before retrying' diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-workspace-catalog.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-workspace-catalog.ts index 75a0b920379..eb5c6b79b61 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-workspace-catalog.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-workspace-catalog.ts @@ -1,5 +1,5 @@ import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' -import type { StructuredAgentSessionHostSupport } from '../../mobile-structured-agent-session-host-support' +import type { StructuredAgentSessionHostSupport } from '../agent-session/mobile-structured-agent-session-host-support' import { useMobileNativeChatFileSearch } from './use-mobile-native-chat-file-search' import { useMobileNativeChatSkills } from './use-mobile-native-chat-skills' diff --git a/mobile/src/session/use-mobile-structured-command-controller.ts b/mobile/src/session/native-chat/composer/use-mobile-structured-command-controller.ts similarity index 88% rename from mobile/src/session/use-mobile-structured-command-controller.ts rename to mobile/src/session/native-chat/composer/use-mobile-structured-command-controller.ts index d86f4cdb9f7..2bc205eb14e 100644 --- a/mobile/src/session/use-mobile-structured-command-controller.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-structured-command-controller.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react' -import type { useMobileStructuredAgentOptions } from './use-mobile-structured-agent-options' +import type { useMobileStructuredAgentOptions } from '../input/use-mobile-structured-agent-options' type MobileStructuredAgentOptions = ReturnType diff --git a/mobile/src/session/use-mobile-structured-context-usage.ts b/mobile/src/session/native-chat/composer/use-mobile-structured-context-usage.ts similarity index 64% rename from mobile/src/session/use-mobile-structured-context-usage.ts rename to mobile/src/session/native-chat/composer/use-mobile-structured-context-usage.ts index c381c955bec..1c69e420732 100644 --- a/mobile/src/session/use-mobile-structured-context-usage.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-structured-context-usage.ts @@ -1,11 +1,11 @@ import { useMemo } from 'react' -import type { AgentJournalRenderItem } from '../../../src/shared/agent-session/journal/agent-session-journal-types' -import type { AgentSessionOptionsResult } from '../../../src/shared/agent-session/options/agent-session-options-result' -import { selectStructuredAgentSessionContextUsage } from '../../../src/shared/agent-session/structured-agent-session-context-usage' +import type { AgentJournalRenderItem } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' +import type { AgentSessionOptionsResult } from '../../../../../src/shared/agent-session/options/agent-session-options-result' +import { selectStructuredAgentSessionContextUsage } from '../../../../../src/shared/agent-session/structured-agent-session-context-usage' import { summarizeContextUsage, type NativeChatContextUsageSummary -} from '../../../src/shared/native-chat/native-chat-context-usage-summary' +} from '../../../../../src/shared/native-chat/native-chat-context-usage-summary' /** The composer ring's readout, from desktop's rule; an older host's missing answer leaves the loaded window's facts. */ export function useMobileStructuredContextUsage( diff --git a/mobile/src/session/use-mobile-structured-interrupted-continue.ts b/mobile/src/session/native-chat/composer/use-mobile-structured-interrupted-continue.ts similarity index 82% rename from mobile/src/session/use-mobile-structured-interrupted-continue.ts rename to mobile/src/session/native-chat/composer/use-mobile-structured-interrupted-continue.ts index 4b0e38729ce..315272016b2 100644 --- a/mobile/src/session/use-mobile-structured-interrupted-continue.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-structured-interrupted-continue.ts @@ -2,20 +2,20 @@ import { useCallback, useMemo, useState } from 'react' import type { AgentJournalRenderItem, AgentJournalSubmission -} from '../../../src/shared/agent-session/journal/agent-session-journal-types' -import { latestNativeChatOrcaStopCut } from '../../../src/shared/native-chat/native-chat-orca-stop-cut' +} from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' +import { latestNativeChatOrcaStopCut } from '../../../../../src/shared/native-chat/native-chat-orca-stop-cut' import { failNativeChatInterruptedContinue, nativeChatInterruptedContinueState, NO_NATIVE_CHAT_INTERRUPTED_CONTINUE_ATTEMPT, nativeChatInterruptedContinueAccepted, type NativeChatInterruptedContinueAttempt -} from '../../../src/shared/native-chat/native-chat-interrupted-continue' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import { callAgentSession } from './mobile-structured-agent-session-rpc' -import { useRouteRelaysCapability } from '../worktree/workspace-server-context' -import { AGENT_SESSION_PHONE_CONTINUE_INTERRUPTED_RUNTIME_CAPABILITY } from '../../../src/shared/agent-session/agent-session-continue-interrupted-capability' -import type { StructuredAgentSessionHostSupport } from './mobile-structured-agent-session-host-support' +} from '../../../../../src/shared/native-chat/native-chat-interrupted-continue' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import { callAgentSession } from '../agent-session/mobile-structured-agent-session-rpc' +import { useRouteRelaysCapability } from '../../../worktree/workspace-server-context' +import { AGENT_SESSION_PHONE_CONTINUE_INTERRUPTED_RUNTIME_CAPABILITY } from '../../../../../src/shared/agent-session/agent-session-continue-interrupted-capability' +import type { StructuredAgentSessionHostSupport } from '../agent-session/mobile-structured-agent-session-host-support' export type MobileStructuredInterruptedContinue = { continueAvailable: boolean diff --git a/mobile/src/session/use-mobile-structured-native-chat-send-bridge.ts b/mobile/src/session/native-chat/composer/use-mobile-structured-native-chat-send-bridge.ts similarity index 85% rename from mobile/src/session/use-mobile-structured-native-chat-send-bridge.ts rename to mobile/src/session/native-chat/composer/use-mobile-structured-native-chat-send-bridge.ts index 255bb98d849..c1fde649e55 100644 --- a/mobile/src/session/use-mobile-structured-native-chat-send-bridge.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-structured-native-chat-send-bridge.ts @@ -1,26 +1,26 @@ import { useCallback } from 'react' -import type { AgentSessionSlashCommand } from '../../../src/shared/agent-session/agent-session-wire' -import type { StructuredAgentId } from '../../../src/shared/agent-session/lifecycle/agent-session-provider-handle' +import type { AgentSessionSlashCommand } from '../../../../../src/shared/agent-session/agent-session-wire' +import type { StructuredAgentId } from '../../../../../src/shared/agent-session/lifecycle/agent-session-provider-handle' import type { MobileNativeChatSendIntent, MobileNativeChatSendOutcome -} from './native-chat/mobile-native-chat-send' -import type { MobileNativeChatSendOrigin } from './native-chat/mobile-native-chat-pending-echo' +} from './mobile-native-chat-send' +import type { MobileNativeChatSendOrigin } from '../transcript/mobile-native-chat-pending-echo' import type { StructuredMobileSendAttachment } from './use-mobile-structured-send-with-outcome' -import type { AgentJournalSkillRef } from '../../../src/shared/agent-session/journal/agent-session-journal-types' +import type { AgentJournalSkillRef } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' import { readMobileNativeChatPickedSkills, restoreMobileNativeChatPickedSkills -} from './native-chat/composer/mobile-native-chat-draft-store' +} from './mobile-native-chat-draft-store' import { beginMobileNativeChatInFlightSend, settleMobileNativeChatInFlightSend -} from './native-chat/composer/mobile-native-chat-in-flight-sends' +} from './mobile-native-chat-in-flight-sends' import type { MobileStructuredSends } from './use-mobile-structured-sends' -import { structuredSessionOperationId } from './structured-session-operation-id' -import { isSlashCommandDraft } from '../../../src/shared/native-chat/input/native-chat-slash-commands' -import { UNCONFIRMED_SEND_RESTORED_MESSAGE } from './native-chat/use-mobile-native-chat-unconfirmed-sends' +import { structuredSessionOperationId } from '../agent-session/structured-session-operation-id' +import { isSlashCommandDraft } from '../../../../../src/shared/native-chat/input/native-chat-slash-commands' +import { UNCONFIRMED_SEND_RESTORED_MESSAGE } from './use-mobile-native-chat-unconfirmed-sends' export function useMobileStructuredNativeChatSendBridge(args: { agent: StructuredAgentId | undefined diff --git a/mobile/src/session/use-mobile-structured-send-with-outcome.ts b/mobile/src/session/native-chat/composer/use-mobile-structured-send-with-outcome.ts similarity index 80% rename from mobile/src/session/use-mobile-structured-send-with-outcome.ts rename to mobile/src/session/native-chat/composer/use-mobile-structured-send-with-outcome.ts index be4dd2ea649..5adf512760d 100644 --- a/mobile/src/session/use-mobile-structured-send-with-outcome.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-structured-send-with-outcome.ts @@ -1,46 +1,46 @@ -import { agentSessionInteractionCommand } from '../../../src/shared/agent-session/options/agent-session-interaction-mode' -import { selectAgentSessionCurrentRequests } from '../../../src/shared/agent-session/requests/agent-session-current-requests' +import { agentSessionInteractionCommand } from '../../../../../src/shared/agent-session/options/agent-session-interaction-mode' +import { selectAgentSessionCurrentRequests } from '../../../../../src/shared/agent-session/requests/agent-session-current-requests' import { useCallback } from 'react' -import { runningStructuredAgentSessionTurnId } from '../../../src/shared/agent-session/view/structured-agent-session-live-turn' -import { mobileStructuredAgentSessionWorking } from './mobile-structured-agent-session-working' -import { structuredSessionBackgroundTasksView } from '../../../src/shared/structured-session-background-tasks-view' -import { agentSessionVisibleFailureFacts } from '../../../src/shared/agent-session/failures/agent-session-visible-failures' -import { tuiAgentDisplayName } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' -import { pendingPromptsAllUnanswerableHere } from '../../../src/shared/agent-session/agent-session-approval-subject' +import { runningStructuredAgentSessionTurnId } from '../../../../../src/shared/agent-session/view/structured-agent-session-live-turn' +import { mobileStructuredAgentSessionWorking } from '../agent-session/mobile-structured-agent-session-working' +import { structuredSessionBackgroundTasksView } from '../../../../../src/shared/structured-session-background-tasks-view' +import { agentSessionVisibleFailureFacts } from '../../../../../src/shared/agent-session/failures/agent-session-visible-failures' +import { tuiAgentDisplayName } from '../../../../../src/shared/agent-launch/catalog/tui-agent-display-names' +import { pendingPromptsAllUnanswerableHere } from '../../../../../src/shared/agent-session/agent-session-approval-subject' import { SkillRefLimitError, structuredAgentSessionSendBody, type StructuredAgentSessionAttachment, type StructuredAgentSessionSendControl -} from '../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' -import type { AgentJournalSkillRef } from '../../../src/shared/agent-session/journal/agent-session-journal-types' -import { MAX_SKILL_REFS } from '../../../src/shared/rpc-contract/structured-agent-session-message-params' +} from '../../../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' +import type { AgentJournalSkillRef } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' +import { MAX_SKILL_REFS } from '../../../../../src/shared/rpc-contract/structured-agent-session-message-params' import { structuredAgentSessionGoalObjective, type StructuredAgentSessionComposerOptions -} from '../../../src/shared/agent-session/view/structured-agent-session-composer' -import { translate } from '../i18n/mobile-i18n' -import type { AgentSessionSlashCommand } from '../../../src/shared/agent-session/agent-session-wire' -import type { StructuredAgentSessionState } from '../../../src/shared/agent-session/structured-agent-session-reducer' +} from '../../../../../src/shared/agent-session/view/structured-agent-session-composer' +import { translate } from '../../../i18n/mobile-i18n' +import type { AgentSessionSlashCommand } from '../../../../../src/shared/agent-session/agent-session-wire' +import type { StructuredAgentSessionState } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' import { mobileStructuredSendQueues } from './mobile-structured-send-queue-rule' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import type { MobileNativeChatSendIntent, MobileNativeChatSendOutcome -} from './native-chat/mobile-native-chat-send' +} from './mobile-native-chat-send' import { dispatchMobileStructuredCommand } from './mobile-structured-composer-command' -import type { MobileNativeChatSendErrorReporter } from './native-chat/use-mobile-native-chat-send-error' -import { sendMobileStructuredAgentSessionMessage } from './mobile-structured-agent-session-send' +import type { MobileNativeChatSendErrorReporter } from './use-mobile-native-chat-send-error' +import { sendMobileStructuredAgentSessionMessage } from '../agent-session/mobile-structured-agent-session-send' import type { MobileStructuredSends } from './use-mobile-structured-sends' import type { MobileStructuredSendsOut } from './use-mobile-structured-stop-offer' -import { structuredSessionOperationId } from './structured-session-operation-id' -import { UNCONFIRMED_SEND_MESSAGE } from './native-chat/use-mobile-native-chat-unconfirmed-sends' -import { timeoutForDeadline } from './mobile-structured-agent-session-rpc' -import { nativeChatTextWithFileReferences } from './native-chat/composer/mobile-native-chat-file-attachment' +import { structuredSessionOperationId } from '../agent-session/structured-session-operation-id' +import { UNCONFIRMED_SEND_MESSAGE } from './use-mobile-native-chat-unconfirmed-sends' +import { timeoutForDeadline } from '../agent-session/mobile-structured-agent-session-rpc' +import { nativeChatTextWithFileReferences } from './mobile-native-chat-file-attachment' import { actionableStructuredApproval, actionableStructuredQuestion -} from './mobile-structured-actionable-prompt' +} from '../input/mobile-structured-actionable-prompt' export type StructuredMobileSendAttachment = | (StructuredAgentSessionAttachment & { kind?: 'image'; id?: string }) diff --git a/mobile/src/session/use-mobile-structured-sends.ts b/mobile/src/session/native-chat/composer/use-mobile-structured-sends.ts similarity index 89% rename from mobile/src/session/use-mobile-structured-sends.ts rename to mobile/src/session/native-chat/composer/use-mobile-structured-sends.ts index 670fc66e312..8764a9b0e3a 100644 --- a/mobile/src/session/use-mobile-structured-sends.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-structured-sends.ts @@ -1,21 +1,21 @@ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react' -import type { AgentJournalCursor } from '../../../src/shared/agent-session/journal/agent-session-journal-identity' -import type { AgentJournalSubmission } from '../../../src/shared/agent-session/journal/agent-session-journal-types' -import { agentJournalSubmissionKey } from '../../../src/shared/agent-session/journal/agent-session-journal-item-key' -import type { StructuredAgentSessionOptimisticMessage } from '../../../src/shared/agent-session/view/structured-agent-session-message-projection' +import type { AgentJournalCursor } from '../../../../../src/shared/agent-session/journal/agent-session-journal-identity' +import type { AgentJournalSubmission } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' +import { agentJournalSubmissionKey } from '../../../../../src/shared/agent-session/journal/agent-session-journal-item-key' +import type { StructuredAgentSessionOptimisticMessage } from '../../../../../src/shared/agent-session/view/structured-agent-session-message-projection' import { structuredAgentSessionReadCoversSend, structuredAgentSessionSettledSends -} from '../../../src/shared/agent-session/requests/structured-agent-session-send-settlement' -import { mergeSentImagePreviews } from './native-chat/composer/mobile-native-chat-draft-reconcile' -import type { AgentSessionQueuedMessage } from '../../../src/shared/agent-session/requests/agent-session-queued-message-wire' -import type { MobileNativeChatSendErrorReporter } from './native-chat/use-mobile-native-chat-send-error' +} from '../../../../../src/shared/agent-session/requests/structured-agent-session-send-settlement' +import { mergeSentImagePreviews } from './mobile-native-chat-draft-reconcile' +import type { AgentSessionQueuedMessage } from '../../../../../src/shared/agent-session/requests/agent-session-queued-message-wire' +import type { MobileNativeChatSendErrorReporter } from './use-mobile-native-chat-send-error' import { UNCONFIRMED_SEND_MESSAGE, UNCONFIRMED_SEND_RESTORED_MESSAGE -} from './native-chat/use-mobile-native-chat-unconfirmed-sends' -import { createUnconfirmedSendDeadlines } from './native-chat/unconfirmed-send-deadlines' -import { returnMobileNativeChatInFlightSend } from './native-chat/composer/mobile-native-chat-draft-store' +} from './use-mobile-native-chat-unconfirmed-sends' +import { createUnconfirmedSendDeadlines } from './unconfirmed-send-deadlines' +import { returnMobileNativeChatInFlightSend } from './mobile-native-chat-draft-store' import { claimMobileNativeChatInFlightSends, mobileNativeChatInFlightSendIds, @@ -23,7 +23,7 @@ import { releaseMobileNativeChatInFlightSends, settleMobileNativeChatInFlightSend, useMobileNativeChatSavedInFlightVersion -} from './native-chat/composer/mobile-native-chat-in-flight-sends' +} from './mobile-native-chat-in-flight-sends' // Ordinary in-memory input outlives its request; exact host IDs retire it, and a lost reply hands it back at the deadline. type MobileStructuredSend = StructuredAgentSessionOptimisticMessage diff --git a/mobile/src/session/use-mobile-structured-session-commands.ts b/mobile/src/session/native-chat/composer/use-mobile-structured-session-commands.ts similarity index 89% rename from mobile/src/session/use-mobile-structured-session-commands.ts rename to mobile/src/session/native-chat/composer/use-mobile-structured-session-commands.ts index 3c5b002a17e..a86b674b3d7 100644 --- a/mobile/src/session/use-mobile-structured-session-commands.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-structured-session-commands.ts @@ -1,14 +1,14 @@ -import { startAgentSessionCommandMenuQuery } from '../../../src/shared/agent-session/agent-session-command-menu-query' +import { startAgentSessionCommandMenuQuery } from '../../../../../src/shared/agent-session/agent-session-command-menu-query' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useQueryClient } from '@tanstack/react-query' import * as z from 'zod' -import type { AgentSessionSlashCommand } from '../../../src/shared/agent-session/agent-session-wire' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc/rpc-operation' -import { rpcResultVariant } from '../transport/rpc/rpc-operation-result-reader' -import { defineHostQuery, useHostQuery } from '../query/host-query' -import { hostQueryKey } from '../query/host-query-key' -import { useWorkspaceExecutionHost } from '../navigation/workspace-execution-host' +import type { AgentSessionSlashCommand } from '../../../../../src/shared/agent-session/agent-session-wire' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import { bindDeferredRpcOperation, defineRpcOperation } from '../../../transport/rpc/rpc-operation' +import { rpcResultVariant } from '../../../transport/rpc/rpc-operation-result-reader' +import { defineHostQuery, useHostQuery } from '../../../query/host-query' +import { hostQueryKey } from '../../../query/host-query-key' +import { useWorkspaceExecutionHost } from '../../../navigation/workspace-execution-host' type Reported = { client: RpcClient diff --git a/mobile/src/session/use-mobile-structured-stop-offer.test.ts b/mobile/src/session/native-chat/composer/use-mobile-structured-stop-offer.test.ts similarity index 100% rename from mobile/src/session/use-mobile-structured-stop-offer.test.ts rename to mobile/src/session/native-chat/composer/use-mobile-structured-stop-offer.test.ts diff --git a/mobile/src/session/use-mobile-structured-stop-offer.ts b/mobile/src/session/native-chat/composer/use-mobile-structured-stop-offer.ts similarity index 94% rename from mobile/src/session/use-mobile-structured-stop-offer.ts rename to mobile/src/session/native-chat/composer/use-mobile-structured-stop-offer.ts index bc0f6261b86..d13e4e32cfe 100644 --- a/mobile/src/session/use-mobile-structured-stop-offer.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-structured-stop-offer.ts @@ -1,5 +1,5 @@ import { useCallback, useMemo, useRef, useState } from 'react' -import { structuredAgentSessionCanStop } from '../../../src/shared/agent-session/view/structured-agent-session-stop-control' +import { structuredAgentSessionCanStop } from '../../../../../src/shared/agent-session/view/structured-agent-session-stop-control' type Send = (...args: Args) => Promise diff --git a/mobile/src/session/use-mobile-structured-stop-press.test.ts b/mobile/src/session/native-chat/composer/use-mobile-structured-stop-press.test.ts similarity index 100% rename from mobile/src/session/use-mobile-structured-stop-press.test.ts rename to mobile/src/session/native-chat/composer/use-mobile-structured-stop-press.test.ts diff --git a/mobile/src/session/use-mobile-structured-stop-press.ts b/mobile/src/session/native-chat/composer/use-mobile-structured-stop-press.ts similarity index 100% rename from mobile/src/session/use-mobile-structured-stop-press.ts rename to mobile/src/session/native-chat/composer/use-mobile-structured-stop-press.ts diff --git a/mobile/src/session/native-chat/input/MobileNativeChatAsk.previews.test.tsx b/mobile/src/session/native-chat/input/MobileNativeChatAsk.previews.test.tsx new file mode 100644 index 00000000000..6abc1652572 --- /dev/null +++ b/mobile/src/session/native-chat/input/MobileNativeChatAsk.previews.test.tsx @@ -0,0 +1,165 @@ +import { createElement, type ReactNode } from 'react' +import { act, create, type ReactTestInstance, type ReactTestRenderer } from 'react-test-renderer' +import { afterEach, expect, it, vi, type Mock } from 'vitest' +import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' +import { MobileNativeChatAsk } from './MobileNativeChatAsk' + +vi.mock('react-native', () => ({ + Keyboard: { dismiss: vi.fn() }, + Platform: { select: (options: { ios: unknown }) => options.ios }, + Pressable: 'Pressable', + ScrollView: 'ScrollView', + Text: 'Text', + View: 'View', + StyleSheet: { create: (styles: unknown) => styles, hairlineWidth: 1 } +})) +vi.mock('lucide-react-native', () => ({ Check: 'Check' })) +vi.mock('../../../components/composer-input/MessageBox', () => ({ MessageBox: 'MessageBox' })) +vi.mock('../transcript/MobileNativeChatQuestionText', () => ({ + MobileNativeChatQuestionText: 'QuestionText' +})) +vi.mock('./MobileNativeChatCardHeaderAction', () => ({ + MobileNativeChatCardHeaderAction: () => null +})) +vi.mock('../../../components/bottom-drawer/keyed-bottom-drawer', () => ({ + KeyedBottomDrawer: ({ + sheet, + children + }: { + sheet: number | null + children: (index: number) => ReactNode + }) => (sheet === null ? null : children(sheet)) +})) +vi.mock('../../../components/nav-bar/SheetHeader', () => ({ + SheetHeader: ({ onClose }: { onClose: () => void }) => + createElement('button', { accessibilityLabel: 'Close viewer', onPress: onClose }) +})) + +let renderer: ReactTestRenderer +const compactedPreview = `${'| panes |'.repeat(450)}…` +function prompt(multiSelect = false): AskPrompt { + return { + questions: [ + { + question: 'Which layout?', + header: 'Layout', + multiSelect, + options: [ + { label: 'First', preview: 'A\t|\n𠀀\t|' }, + { label: 'No preview' }, + { label: 'Last', preview: compactedPreview } + ] + } + ] + } +} +function buttons(): ReactTestInstance[] { + return renderer.root.findAll( + (node) => String(node.type) === 'Pressable' || String(node.type) === 'button' + ) +} +function button(label: string): ReactTestInstance { + return buttons().find((node) => node.props.accessibilityLabel === label)! +} +function row(index: number): ReactTestInstance { + return buttons().filter((node) => ['radio', 'checkbox'].includes(node.props.accessibilityRole))[ + index + ]! +} +function textAction(label: string): ReactTestInstance { + return buttons().find((node) => + node + .findAll((child) => String(child.type) === 'Text') + .some((text) => text.children.includes(label)) + )! +} +function press(node: ReactTestInstance): void { + act(() => node.props.onPress()) +} +type Answer = Parameters[0]['onAnswer'] +function mount(value: AskPrompt): Mock { + const onAnswer = vi.fn(async () => true) + act(() => { + renderer = create(createElement(MobileNativeChatAsk, { prompt: value, onAnswer })) + }) + return onAnswer +} + +afterEach(() => { + act(() => renderer?.unmount()) + vi.useRealTimers() +}) + +it('inspects every preview without choosing, and keeps the original option when choosing and submitting', async () => { + vi.useFakeTimers() + const onAnswer = mount(prompt()) + expect(button('First preview')).toBeDefined() + expect(button('Last preview')).toBeDefined() + expect(row(2).props.accessibilityState.checked).toBe(false) + press(button('First preview')) + expect(renderer.root.findByProps({ selectable: true }).props.children).toBe('A\t|\n𠀀\t|') + // Paging crosses the option with no preview; inspection does not change the answer. + press( + buttons().find( + (node) => node.props.accessibilityLabel === 'Last preview' && node.props.accessibilityState + )! + ) + expect( + renderer.root + .findAll((node) => String(node.type) === 'Text') + .some((node) => node.children.includes(compactedPreview)) + ).toBe(true) + press(button('Close viewer')) + act(() => { + vi.runAllTimers() + }) + expect(onAnswer).not.toHaveBeenCalled() + expect(row(2).props.accessibilityState.checked).toBe(false) + press(button('Last preview')) + press(button('Choose this')) + act(() => { + vi.runAllTimers() + }) + expect(row(2).props.accessibilityState.checked).toBe(true) + expect(onAnswer).not.toHaveBeenCalled() + press(button('Last preview')) + press(button('Chosen')) + press(row(2)) + expect(row(2).props.accessibilityState.checked).toBe(true) + await act(async () => textAction('Submit').props.onPress()) + expect(onAnswer).toHaveBeenCalledWith([{ indices: [2] }], expect.any(Function)) +}) + +it('preserves generic multi choices while inspecting and choosing, with row checkbox removal', async () => { + const onAnswer = mount(prompt(true)) + press(row(0)) + press(button('Last preview')) + press(button('Choose this')) + press(button('Last preview')) + press(button('Chosen')) + expect(row(0).props.accessibilityState.checked).toBe(true) + expect(row(2).props.accessibilityState.checked).toBe(true) + press(row(0)) + await act(async () => textAction('Submit').props.onPress()) + expect(onAnswer).toHaveBeenCalledWith([{ indices: [2] }], expect.any(Function)) +}) + +it('retains automatic answer for an ordinary question and disables the viewer choice while pending', async () => { + vi.useFakeTimers() + const plain = prompt() + plain.questions[0]!.options = [{ label: 'Plain' }] + const onAnswer = mount(plain) + press(row(0)) + await act(async () => { + vi.runAllTimers() + }) + expect(onAnswer).toHaveBeenCalledWith([{ indices: [0] }], expect.any(Function)) + act(() => renderer.unmount()) + act(() => { + renderer = create( + createElement(MobileNativeChatAsk, { prompt: prompt(), answerPending: true, onAnswer }) + ) + }) + press(button('Last preview')) + expect(button('Choose this').props.disabled).toBe(true) +}) diff --git a/mobile/src/session/native-chat/input/MobileNativeChatAsk.styles.ts b/mobile/src/session/native-chat/input/MobileNativeChatAsk.styles.ts new file mode 100644 index 00000000000..cc895c5404f --- /dev/null +++ b/mobile/src/session/native-chat/input/MobileNativeChatAsk.styles.ts @@ -0,0 +1,95 @@ +import { StyleSheet } from 'react-native' +import { colors, radii, spacing, typography } from '../../../theme/mobile-theme' +import { themedStyleSheet } from '../../../theme/themed-styles' + +export const mobileNativeChatAskStyles = themedStyleSheet(() => ({ + card: { + flexShrink: 1, + minHeight: 0, + backgroundColor: colors.bgPanel, + borderTopWidth: StyleSheet.hairlineWidth, + borderTopColor: colors.borderSubtle + }, + tabs: { + flexGrow: 0, + paddingTop: spacing.sm, + borderBottomWidth: StyleSheet.hairlineWidth, + borderBottomColor: colors.borderSubtle + }, + tabsContent: { + paddingHorizontal: spacing.sm, + gap: spacing.xs, + alignItems: 'center' + }, + tab: { + flexDirection: 'row', + alignItems: 'center', + gap: 4, + minHeight: 36, + paddingHorizontal: spacing.sm, + paddingVertical: spacing.xs, + borderBottomWidth: 2, + borderBottomColor: 'transparent' + }, + tabActive: { + borderBottomColor: colors.statusGreen + }, + tabText: { + color: colors.textSecondary, + fontSize: typography.metaSize, + fontWeight: '600' + }, + tabTextActive: { + color: colors.textPrimary + }, + scroll: { + paddingHorizontal: spacing.md + }, + questionRow: { flexDirection: 'row', alignItems: 'flex-start', gap: spacing.sm }, + questionText: { + flex: 1, + marginVertical: spacing.sm + }, + other: { + marginBottom: spacing.xs + }, + footer: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between', + padding: spacing.md, + gap: spacing.sm, + borderTopWidth: StyleSheet.hairlineWidth, + borderTopColor: colors.borderSubtle + }, + cancel: { + paddingVertical: spacing.sm, + paddingHorizontal: spacing.sm + }, + cancelText: { + color: colors.textSecondary, + fontSize: typography.bodySize, + fontWeight: '600' + }, + progress: { + color: colors.textMuted, + fontSize: typography.metaSize + }, + next: { + paddingVertical: spacing.sm, + paddingHorizontal: spacing.lg, + borderRadius: radii.control, + backgroundColor: colors.textPrimary + }, + nextSkip: { + backgroundColor: colors.bgRaised + }, + nextText: { + color: colors.bgBase, + fontSize: typography.bodySize, + fontWeight: '700' + }, + nextSkipText: { + color: colors.textMuted + } +})) diff --git a/mobile/src/session/native-chat/input/MobileNativeChatAsk.tsx b/mobile/src/session/native-chat/input/MobileNativeChatAsk.tsx index d201f87b06d..3ec989ff1ee 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatAsk.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatAsk.tsx @@ -1,5 +1,5 @@ import { useMemo, useRef, useState } from 'react' -import { Pressable, ScrollView, StyleSheet, Text, View } from 'react-native' +import { Keyboard, Pressable, ScrollView, Text, View } from 'react-native' import { Check } from 'lucide-react-native' import { nativeChatAnswerOperationEvidence, @@ -12,20 +12,22 @@ import type { AgentJournalFreeTextInput } from '../../../../../src/shared/agent- import { askAcceptsEmptyAnswer, askConfirmAction, + askQuestionShowsPreviews, askConfirmLabel, askTypedText, toggleAskOption } from '../../../../../src/shared/native-chat/input/native-chat-ask-card-rules' -import { colors, radii, spacing, typography, pressedStyle } from '../../../theme/mobile-theme' -import { themedStyleSheet } from '../../../theme/themed-styles' +import { colors, pressedStyle } from '../../../theme/mobile-theme' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' import type { Translate } from '../../../i18n/mobile-i18n' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' import { MessageBox } from '../../../components/composer-input/MessageBox' -import { MobileNativeChatCardHeaderAction } from '../MobileNativeChatCardHeaderAction' -import { MobileNativeChatQuestionText } from '../MobileNativeChatQuestionText' +import { MobileNativeChatCardHeaderAction } from './MobileNativeChatCardHeaderAction' +import { MobileNativeChatQuestionText } from '../transcript/MobileNativeChatQuestionText' import { useMobileNativeChatAskAutoAdvance } from './use-mobile-native-chat-ask-auto-advance' import { MobileNativeChatAskOptionRow } from './MobileNativeChatAskOptionRow' +import { MobileNativeChatOptionPreviewSheet } from './MobileNativeChatOptionPreviewSheet' +import { mobileNativeChatAskStyles as styles } from './MobileNativeChatAsk.styles' import { useMobileNativeChatReplyScroll } from './use-mobile-native-chat-reply-scroll' type Props = { @@ -67,6 +69,7 @@ export function MobileNativeChatAsk({ const t = useMobileTranslation() const { scrollRef, inputRef, revealReply, onViewportLayout } = useMobileNativeChatReplyScroll() const [index, setIndex] = useState(0) + const [viewedOption, setViewedOption] = useState(null) const [selections, setSelections] = useState(() => prompt.questions.map(() => [])) const [otherText, setOtherText] = useState(() => prompt.questions.map((_, qi) => freeTextInputs?.[qi]?.initialValue ?? '') @@ -91,6 +94,7 @@ export function MobileNativeChatAsk({ const autoAdvance = useMobileNativeChatAskAutoAdvance(submitting) // Open each step at its question and end the last step's edit, so no typing lands out of view. const showStep = (next: (current: number) => number): void => { + setViewedOption(null) inputRef.current?.blur() scrollRef.current?.scrollTo({ y: 0, animated: false }) setIndex(next) @@ -103,17 +107,21 @@ export function MobileNativeChatAsk({ askAcceptsEmptyAnswer(prompt.questions[qi], freeTextInputs?.[qi]) // Delay single-select advance to show the choice; Other still needs text. - const toggle = (qi: number, optIndex: number, multi: boolean): void => { + const toggle = (qi: number, optIndex: number, multi: boolean, choosing = false): void => { // Block same-frame taps before disabled state renders. if (isLocalPending(operationRef.current) || answerPending) { return } const cur = selections[qi] ?? [] + // Preview choices wait for Submit so inspecting alternatives never commits an answer. + const keep = optIndex !== OTHER && askQuestionShowsPreviews(prompt.questions[qi]) const picked = !cur.includes(optIndex) - const next = selections.map((s, i) => (i === qi ? toggleAskOption(cur, optIndex, multi) : s)) + const next = selections.map((s, i) => + i === qi ? toggleAskOption(cur, optIndex, multi, keep || choosing) : s + ) setSelections(next) autoAdvance.cancel() - if (picked && !multi && optIndex !== OTHER) { + if (picked && !multi && optIndex !== OTHER && !keep) { autoAdvance.schedule(() => void advance(next)) } } @@ -270,6 +278,13 @@ export function MobileNativeChatAsk({ key={`${optIndex}:${opt.label}`} label={opt.label} description={opt.description} + preview={opt.preview} + onPreview={() => { + autoAdvance.cancel() + inputRef.current?.blur() + Keyboard.dismiss() + setViewedOption(optIndex) + }} selected={(selections[index] ?? []).includes(optIndex)} multi={q.multiSelect} disabled={submitting} @@ -330,98 +345,18 @@ export function MobileNativeChatAsk({ + setViewedOption(null)} + onChoose={(optionIndex) => { + setViewedOption(null) + toggle(index, optionIndex, q.multiSelect, true) + }} + /> ) } - -const styles = themedStyleSheet(() => ({ - card: { - flexShrink: 1, - minHeight: 0, - backgroundColor: colors.bgPanel, - borderTopWidth: StyleSheet.hairlineWidth, - borderTopColor: colors.borderSubtle - }, - tabs: { - flexGrow: 0, - paddingTop: spacing.sm, - borderBottomWidth: StyleSheet.hairlineWidth, - borderBottomColor: colors.borderSubtle - }, - tabsContent: { - paddingHorizontal: spacing.sm, - gap: spacing.xs, - alignItems: 'center' - }, - tab: { - flexDirection: 'row', - alignItems: 'center', - gap: 4, - minHeight: 36, - paddingHorizontal: spacing.sm, - paddingVertical: spacing.xs, - borderBottomWidth: 2, - borderBottomColor: 'transparent' - }, - tabActive: { - borderBottomColor: colors.statusGreen - }, - tabText: { - color: colors.textSecondary, - fontSize: typography.metaSize, - fontWeight: '600' - }, - tabTextActive: { - color: colors.textPrimary - }, - scroll: { - paddingHorizontal: spacing.md - }, - questionRow: { flexDirection: 'row', alignItems: 'flex-start', gap: spacing.sm }, - questionText: { - flex: 1, - marginVertical: spacing.sm - }, - other: { - marginBottom: spacing.xs - }, - footer: { - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'space-between', - padding: spacing.md, - gap: spacing.sm, - borderTopWidth: StyleSheet.hairlineWidth, - borderTopColor: colors.borderSubtle - }, - cancel: { - paddingVertical: spacing.sm, - paddingHorizontal: spacing.sm - }, - cancelText: { - color: colors.textSecondary, - fontSize: typography.bodySize, - fontWeight: '600' - }, - progress: { - color: colors.textMuted, - fontSize: typography.metaSize - }, - next: { - paddingVertical: spacing.sm, - paddingHorizontal: spacing.lg, - borderRadius: radii.control, - backgroundColor: colors.textPrimary - }, - nextSkip: { - backgroundColor: colors.bgRaised - }, - nextText: { - color: colors.bgBase, - fontSize: typography.bodySize, - fontWeight: '700' - }, - nextSkipText: { - color: colors.textMuted - } -})) diff --git a/mobile/src/session/native-chat/input/MobileNativeChatAskOptionRow.tsx b/mobile/src/session/native-chat/input/MobileNativeChatAskOptionRow.tsx index 43eed751446..8734fd41ce0 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatAskOptionRow.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatAskOptionRow.tsx @@ -1,5 +1,6 @@ import { Pressable, Text, View } from 'react-native' import { Check } from 'lucide-react-native' +import { MobileNativeChatOptionThumbnail } from './MobileNativeChatOptionThumbnail' import { colors, concentricRadius, @@ -14,6 +15,8 @@ import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' export function MobileNativeChatAskOptionRow({ label, description, + preview, + onPreview, selected, multi, disabled, @@ -21,19 +24,24 @@ export function MobileNativeChatAskOptionRow({ }: { label: string description?: string + /** Read-only inspection is separate from choosing the option. */ + preview?: string + onPreview?: () => void selected: boolean multi?: boolean disabled: boolean onPress: () => void }): React.JSX.Element { useMobileColorScheme() - return ( + const hasPreview = Boolean(preview && onPreview) + const row = ( [ styles.option, selected && styles.optionSelected, + hasPreview && styles.optionWithPreview, pressed && pressedStyle ]} disabled={disabled} @@ -59,6 +67,16 @@ export function MobileNativeChatAskOptionRow({ ) + return hasPreview ? ( + + {row} + + + + + ) : ( + row + ) } const styles = themedStyleSheet(() => ({ @@ -106,5 +124,18 @@ const styles = themedStyleSheet(() => ({ optionDescription: { color: colors.textSecondary, fontSize: typography.metaSize + }, + optionCard: { + borderWidth: 1, + borderColor: colors.borderSubtle, + borderRadius: concentricRadius(radii.surface, spacing.xs), + backgroundColor: colors.bgRaised, + marginBottom: spacing.xs + }, + optionWithPreview: { borderWidth: 0, marginBottom: 0 }, + previewInset: { + marginLeft: 18 + spacing.sm * 2, + marginRight: spacing.sm, + marginBottom: spacing.sm } })) diff --git a/mobile/src/session/native-chat/input/MobileNativeChatBackgroundTasks.test.tsx b/mobile/src/session/native-chat/input/MobileNativeChatBackgroundTasks.test.tsx index 8e39cddc41d..55bd4868066 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatBackgroundTasks.test.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatBackgroundTasks.test.tsx @@ -52,7 +52,6 @@ type Props = Parameters[0] type StopResult = Awaited> const REJECTED: StopResult = { status: 'rejected' } -const UNCONFIRMED: StopResult = { status: 'unknown' } const STOPPED: StopResult = { status: 'accepted', value: { cancelled: true }, sameFence: true } const NOTHING_STOPPED: StopResult = { status: 'accepted', @@ -98,20 +97,6 @@ describe('MobileNativeChatBackgroundTasks', () => { return mounted } - function styleOf(node: ReactTestInstance): Record { - const rendered: unknown = - typeof node.props.style === 'function' - ? node.props.style({ pressed: false }) - : node.props.style - const parts = Array.isArray(rendered) ? rendered : [rendered] - return Object.assign( - {}, - ...parts.filter( - (part): part is Record => typeof part === 'object' && part !== null - ) - ) - } - function header(mounted: ReactTestRenderer): ReactTestInstance { return mounted.root.findAll( (node) => @@ -132,31 +117,6 @@ describe('MobileNativeChatBackgroundTasks', () => { ) } - it('stops one row by its provider id and holds its button while the Stop is on its way', async () => { - let finish: (result: StopResult) => void = () => {} - const stop = vi.fn(() => new Promise((resolve) => (finish = resolve))) - const mounted = mount( - tasksFor( - { - state: 'monitoring', - supportsTaskStop: true, - children: [view('a'), view('b', { stoppable: false })] - }, - { stop } - ) - ) - expand(mounted) - const buttons = stopButtons(mounted) - expect(buttons.map((button) => button.props.accessibilityLabel)).toEqual(['Stop review a']) - act(() => buttons[0]!.props.onPress()) - act(() => buttons[0]!.props.onPress()) - expect(stop).toHaveBeenCalledTimes(1) - expect(stop).toHaveBeenCalledWith('task-a') - expect(stopButtons(mounted)[0]!.props.disabled).toBe(true) - await act(async () => finish(UNCONFIRMED)) - expect(stopButtons(mounted)[0]!.props.disabled).toBe(false) - }) - it('keeps a confirmed Stop held until its row leaves, and offers it again if the row comes back', async () => { let finish: (result: StopResult) => void = () => {} const stop = vi.fn(() => new Promise((resolve) => (finish = resolve))) @@ -206,30 +166,4 @@ describe('MobileNativeChatBackgroundTasks', () => { }) expect(stopButtons(mounted)[0]!.props.disabled).toBe(false) }) - - it('offers Stop all only to a host with no per-row stop that still accepts one', async () => { - let finish: (result: StopResult) => void = () => {} - const stop = vi.fn(() => new Promise((resolve) => (finish = resolve))) - const fallback = mount(tasksFor({ state: 'monitoring', children: [view('a')] }, { stop })) - expand(fallback) - expect(stopButtons(fallback).map((button) => button.props.accessibilityLabel)).toEqual([ - 'Stop background tasks' - ]) - const button = stopButtons(fallback)[0]! - expect(styleOf(button)).toMatchObject({ minHeight: 32, minWidth: 44 }) - expect(button.props.hitSlop).toBe(6) - expect(Number(styleOf(button).minHeight) + 2 * button.props.hitSlop).toBe(44) - act(() => button.props.onPress()) - act(() => button.props.onPress()) - expect(stop).toHaveBeenCalledTimes(1) - expect(stop).toHaveBeenCalledWith(undefined) - expect(stopButtons(fallback)[0]!.props.disabled).toBe(true) - await act(async () => finish(STOPPED)) - expect(stopButtons(fallback)[0]!.props.disabled).toBe(false) - const none = mount( - tasksFor({ state: 'monitoring', supportsStopAll: false, children: [view('a')] }) - ) - expand(none) - expect(stopButtons(none)).toEqual([]) - }) }) diff --git a/mobile/src/session/native-chat/input/MobileNativeChatBackgroundTasks.tsx b/mobile/src/session/native-chat/input/MobileNativeChatBackgroundTasks.tsx index 2776c6113d7..d35363724d4 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatBackgroundTasks.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatBackgroundTasks.tsx @@ -18,7 +18,7 @@ import { } from 'lucide-react-native' import type { AgentChildRowModel } from '../../../../../src/shared/agent-status/presentation/agent-child-row-model' import type { AgentSessionBackgroundTask } from '../../../../../src/shared/agent-session/agent-session-background-task-wire' -import { sayMobileBackgroundTask as say } from '../../mobile-background-task-copy' +import { sayMobileBackgroundTask as say } from './mobile-background-task-copy' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' import { backgroundTasksHeaderContent, @@ -38,11 +38,11 @@ import { useNow } from '../../../hooks/use-now' import { colors, radii, spacing, typography } from '../../../theme/mobile-theme' import { themedStyleSheet } from '../../../theme/themed-styles' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' -import type { MobileStructuredBackgroundTasks } from '../../use-mobile-structured-background-tasks' +import type { MobileStructuredBackgroundTasks } from './use-mobile-structured-background-tasks' import { useMobileBackgroundTaskStops, type MobileBackgroundTaskStopping as Stopping -} from '../../use-mobile-background-task-stops' +} from './use-mobile-background-task-stops' import { mobileAgentChildRowName, mobileAgentChildRowText diff --git a/mobile/src/session/native-chat/MobileNativeChatCardHeaderAction.tsx b/mobile/src/session/native-chat/input/MobileNativeChatCardHeaderAction.tsx similarity index 86% rename from mobile/src/session/native-chat/MobileNativeChatCardHeaderAction.tsx rename to mobile/src/session/native-chat/input/MobileNativeChatCardHeaderAction.tsx index 564a5fc6930..6f479175fb6 100644 --- a/mobile/src/session/native-chat/MobileNativeChatCardHeaderAction.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatCardHeaderAction.tsx @@ -1,8 +1,8 @@ import { Keyboard, Pressable, StyleSheet } from 'react-native' import { ChevronDown, X } from 'lucide-react-native' -import { colors, pressedStyle } from '../../theme/mobile-theme' -import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' -import { useMobileTranslation } from '../../i18n/use-mobile-translation' +import { colors, pressedStyle } from '../../../theme/mobile-theme' +import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' +import { useMobileTranslation } from '../../../i18n/use-mobile-translation' export function MobileNativeChatCardHeaderAction({ prompt, diff --git a/mobile/src/session/native-chat/input/MobileNativeChatOfflineQueue.tsx b/mobile/src/session/native-chat/input/MobileNativeChatOfflineQueue.tsx index 3a2b2e747c2..0db837cc17a 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatOfflineQueue.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatOfflineQueue.tsx @@ -1,10 +1,10 @@ import { useContext, useMemo } from 'react' import { queuedMessageCardLine } from '../../../../../src/shared/agent-session/view/structured-agent-session-queued-cards' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' -import type { MobileQueuedMessageCard } from '../../mobile-structured-queued-message-cards' +import type { MobileQueuedMessageCard } from './mobile-structured-queued-message-cards' import type { MobileNativeChatOfflineQueue as Queue } from '../composer/use-mobile-native-chat-offline-sends' import { MobileNativeChatQueuedMessages } from './MobileNativeChatQueuedMessages' -import { MobileNativeChatNoticeContext } from '../../mobile-native-chat-notice-context' +import { MobileNativeChatNoticeContext } from '../transcript/mobile-native-chat-notice-context' const PAUSED = { reason: 'failed' } as const diff --git a/mobile/src/session/native-chat/input/MobileNativeChatOptionPreviewSheet.tsx b/mobile/src/session/native-chat/input/MobileNativeChatOptionPreviewSheet.tsx new file mode 100644 index 00000000000..3328570d533 --- /dev/null +++ b/mobile/src/session/native-chat/input/MobileNativeChatOptionPreviewSheet.tsx @@ -0,0 +1,129 @@ +import { useMemo } from 'react' +import { Pressable, ScrollView, Text, View } from 'react-native' +import type { AskQuestion } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' +import { KeyedBottomDrawer } from '../../../components/bottom-drawer/keyed-bottom-drawer' +import { SheetHeader } from '../../../components/nav-bar/SheetHeader' +import { SheetPrimaryButton } from '../../../components/SheetPrimaryButton' +import { useMobileTranslation } from '../../../i18n/use-mobile-translation' +import { colors, radii, spacing, typography, pressedStyle } from '../../../theme/mobile-theme' +import { themedStyleSheet } from '../../../theme/themed-styles' +import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' +import { optionPreviewFont } from './mobile-native-chat-option-preview' + +const sheetKey = () => 'option-preview' + +export function MobileNativeChatOptionPreviewSheet({ + options, + viewedIndex, + selected, + disabled, + onView, + onChoose, + onClose +}: { + options: AskQuestion['options'] + viewedIndex: number | null + selected: readonly number[] + disabled: boolean + onView: (index: number) => void + onChoose: (index: number) => void + onClose: () => void +}): React.JSX.Element { + useMobileColorScheme() + const t = useMobileTranslation() + const previews = useMemo( + () => options.flatMap((option, index) => (option.preview ? [{ option, index }] : [])), + [options] + ) + return ( + + {(index) => { + const option = options[index]! + return ( + <> + item.index === index) + 1, + total: previews.length + })} + onClose={onClose} + /> + + {previews.length > 1 ? ( + + {previews.map((item) => ( + onView(item.index)} + style={({ pressed }) => [styles.page, pressed && pressedStyle]} + > + + + ))} + + ) : null} + onChoose(index)} + /> + + ) + }} + + ) +} + +function ReadablePreview({ preview }: { preview: string }): React.JSX.Element { + useMobileColorScheme() + return ( + + + + {preview} + + + + ) +} + +const styles = themedStyleSheet(() => ({ + preview: { flex: 1, minHeight: 0, backgroundColor: colors.bgPanel }, + text: { + padding: spacing.md, + color: colors.textPrimary, + fontFamily: optionPreviewFont, + fontSize: typography.bodySize, + lineHeight: typography.bodySize * 1.5 + }, + pages: { flexGrow: 0, marginVertical: spacing.xs }, + pageContent: { flexGrow: 1, justifyContent: 'center' }, + page: { width: 44, height: 44, alignItems: 'center', justifyContent: 'center' }, + dot: { width: 6, height: 6, borderRadius: radii.pill, backgroundColor: colors.borderSubtle }, + currentDot: { backgroundColor: colors.textPrimary } +})) diff --git a/mobile/src/session/native-chat/input/MobileNativeChatOptionThumbnail.tsx b/mobile/src/session/native-chat/input/MobileNativeChatOptionThumbnail.tsx new file mode 100644 index 00000000000..1399a26db65 --- /dev/null +++ b/mobile/src/session/native-chat/input/MobileNativeChatOptionThumbnail.tsx @@ -0,0 +1,117 @@ +import { useState } from 'react' +import { Platform, Pressable, Text, View, type TextStyle } from 'react-native' +import { MobileEdgeFade } from '../../../components/MobileEdgeFade' +import { useMobileTranslation } from '../../../i18n/use-mobile-translation' +import { colors, radii, spacing, typography, pressedStyle } from '../../../theme/mobile-theme' +import { themedStyleSheet } from '../../../theme/themed-styles' +import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' +import { optionPreviewFont } from './mobile-native-chat-option-preview' + +const MAX_HEIGHT = 96 - spacing.sm * 2 + +export function MobileNativeChatOptionThumbnail({ + label, + preview, + onPress +}: { + label: string + preview: string + onPress: () => void +}): React.JSX.Element { + return ( + + ) +} + +function MeasuredPreviewThumbnail({ + label, + preview, + onPress +}: { + label: string + preview: string + onPress: () => void +}): React.JSX.Element { + useMobileColorScheme() + const t = useMobileTranslation() + const [width, setWidth] = useState(0) + const [bounds, setBounds] = useState<{ width: number; height: number } | null>(null) + const scale = bounds && width > 0 ? Math.min(1, width / Math.max(1, bounds.width)) : 0 + const height = bounds && width > 0 ? Math.min(MAX_HEIGHT, bounds.height * scale) : MAX_HEIGHT + + return ( + [styles.thumbnail, pressed && pressedStyle]} + > + setWidth(event.nativeEvent.layout.width)} + style={[styles.image, { height }]} + accessibilityElementsHidden + importantForAccessibility="no-hide-descendants" + > + { + const { width, height } = event.nativeEvent.layout + setBounds((previous) => + previous?.width === width && previous.height === height ? previous : { width, height } + ) + }} + style={[styles.text, { transform: [{ scale }] }]} + > + {preview} + + {height >= MAX_HEIGHT ? : null} + + {t('chat.ask.viewPreview', 'View')} + + ) +} + +const styles = themedStyleSheet(() => ({ + thumbnail: { + minHeight: 44, + padding: spacing.sm, + borderWidth: 1, + borderColor: colors.borderSubtle, + borderRadius: radii.control, + backgroundColor: colors.bgPanel, + overflow: 'hidden' + }, + // Native rows measure absolute Text intrinsically; the web uses its explicit CSS width below. + image: { position: 'relative', flexDirection: 'row', overflow: 'hidden' }, + text: { + position: 'absolute', + ...(Platform.OS === 'web' + ? { + whiteSpace: 'pre' as const, + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: RN Web accepts intrinsic CSS widths; this branch never reaches native. + width: 'max-content' as TextStyle['width'] + } + : {}), + top: 0, + left: 0, + transformOrigin: 'top left', + fontFamily: optionPreviewFont, + fontSize: typography.metaSize, + lineHeight: typography.metaSize * 1.25, + color: colors.textPrimary, + includeFontPadding: false + }, + view: { + alignSelf: 'flex-end', + color: colors.textSecondary, + fontSize: typography.metaSize, + fontWeight: '600', + position: 'absolute', + right: spacing.xs, + bottom: spacing.xs, + paddingHorizontal: spacing.sm, + borderRadius: radii.pill, + backgroundColor: colors.bgRaised + } +})) diff --git a/mobile/src/session/native-chat/input/MobileNativeChatPermission.tsx b/mobile/src/session/native-chat/input/MobileNativeChatPermission.tsx index 960d7128b3c..f8fffdcc0bd 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatPermission.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatPermission.tsx @@ -3,8 +3,8 @@ import { Pressable, ScrollView, StyleSheet, Text, View } from 'react-native' import { ShieldQuestion } from 'lucide-react-native' import { approvalDetailPreview } from '../../../../../src/shared/agent-session/agent-session-approval-detail-preview' import { approvalBlockedPathToShow } from '../../../../../src/shared/agent-session/agent-session-approval-blocked-path' -import { MobileNativeChatCardHeaderAction } from '../MobileNativeChatCardHeaderAction' -import { MobileNativeChatMarkdown } from '../MobileNativeChatMarkdown' +import { MobileNativeChatCardHeaderAction } from './MobileNativeChatCardHeaderAction' +import { MobileNativeChatMarkdown } from '../transcript/MobileNativeChatMarkdown' import { colors, radii, spacing, typography } from '../../../theme/mobile-theme' import { themedStyleSheet } from '../../../theme/themed-styles' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' diff --git a/mobile/src/session/native-chat/input/MobileNativeChatQuestion.tsx b/mobile/src/session/native-chat/input/MobileNativeChatQuestion.tsx index 8de47622917..43c6bd612b3 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatQuestion.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatQuestion.tsx @@ -1,8 +1,8 @@ import { useMemo, useRef, useState } from 'react' import { Pressable, ScrollView, StyleSheet, Text, View } from 'react-native' import { Check, CircleHelp } from 'lucide-react-native' -import { MobileNativeChatCardHeaderAction } from '../MobileNativeChatCardHeaderAction' -import { MobileNativeChatQuestionText } from '../MobileNativeChatQuestionText' +import { MobileNativeChatCardHeaderAction } from './MobileNativeChatCardHeaderAction' +import { MobileNativeChatQuestionText } from '../transcript/MobileNativeChatQuestionText' import { colors, concentricRadius, radii, spacing, typography } from '../../../theme/mobile-theme' import { themedStyleSheet } from '../../../theme/themed-styles' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' diff --git a/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.test.tsx b/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.test.tsx index b7cdfdd5a3c..2aa3100d182 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.test.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.test.tsx @@ -1,46 +1,14 @@ // @vitest-environment happy-dom import { activateMobileUiLocale } from '../../../i18n/mobile-i18n' -import { - mobileQueuedMessageCards, - type MobileQueuedMessageCard -} from '../../mobile-structured-queued-message-cards' +import type { MobileQueuedMessageCard } from './mobile-structured-queued-message-cards' import { createElement } from 'react' -import type * as QueuedCardRowModule from '../../MobileQueuedMessageCardRow' -import { MobileNativeChatLowerRegion } from '../MobileNativeChatLowerRegion.web' -import { - useMobileNativeChatLowerGeometry, - useMobileNativeChatLowerRegion -} from '../mobile-native-chat-lower-region-context' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, describe, expect, it, vi } from 'vitest' import { MobileNativeChatQueuedMessages } from './MobileNativeChatQueuedMessages' -import { - useMobileNativeChatComposerTray, - type MobileNativeChatComposerTray -} from '../composer/use-mobile-native-chat-composer-tray' -import { useMobileQueuedMessageComposerActions } from '../../use-mobile-queued-message-composer-actions' -import type { MobileStructuredAgentMutate } from '../../use-mobile-structured-agent-mutation' -import type { - AgentSessionQueuedMessage, - AgentSessionQueuedMessageMoveResult -} from '../../../../../src/shared/agent-session/requests/agent-session-queued-message-wire' -import type { StructuredAgentSessionMutationResult } from '../../mobile-structured-agent-session-rpc' -const rowRenders = vi.hoisted(() => ({ count: 0 })) -vi.mock('../../MobileQueuedMessageCardRow', async (importOriginal) => { - const original = await importOriginal() - return { - MobileQueuedMessageCardRow: ( - props: Parameters[0] - ) => { - rowRenders.count++ - return createElement(original.MobileQueuedMessageCardRow, props) - } - } -}) let fontScale = 1 vi.mock('../../../components/DragReorderList', () => ({ DragReorderList: 'DragReorderList' })) vi.mock('react-native-reanimated', async () => { @@ -89,7 +57,7 @@ vi.mock('./MobileNativeChatDockedTaskList', () => ({ MobileNativeChatDockedTaskList: 'DockedTaskList' })) -vi.mock('../../MobileQueuedMessageComposer', () => ({ +vi.mock('./MobileQueuedMessageComposer', () => ({ MobileQueuedMessageComposer: 'QueuedMessageComposer' })) @@ -162,82 +130,6 @@ describe('MobileNativeChatQueuedMessages', () => { expect(sheet(mounted).props.visible).toBe(false) }) - it('the empty chord presses only the head card where its own button would, and offers it only while that press would act, across chat switches', async () => { - let tray!: MobileNativeChatComposerTray - function Tray(props: Parameters[0]['queued']) { - tray = useMobileNativeChatComposerTray({ - queued: props, - taskList: null, - backgroundTasks: null - }) - return createElement('View', null, tray.content) - } - const settles: ((accepted: boolean) => void)[] = [] - const onSend = vi.fn(() => new Promise((resolve) => settles.push(resolve))) - const chatA = { sessionKey: 'a', cards: [card({ messageId: 'a1' }), card({ messageId: 'a2' })] } - const chatB = { sessionKey: 'b', cards: [card({ messageId: 'b1' })] } - const show = async ( - chat: typeof chatA, - props: Partial[0]> = {} - ): Promise => { - await act(async () => { - renderer ??= create(createElement('View')) - renderer.update(createElement(Tray, { ...chat, agentWorking: true, onSend, ...props })) - }) - } - const press = (alternateSteers = true) => { - let pressed = false - act(() => { - pressed = tray.steerHead!.run(alternateSteers) - }) - return pressed - } - - await show(chatA) - expect(tray.steerHead!.steers(true)).toBe(true) - expect(press()).toBe(true) - expect(onSend).toHaveBeenLastCalledWith('a1') - // On its way: neither offered nor admitted again, like a second tap. - expect(tray.steerHead!.steers(true)).toBe(false) - expect(press()).toBe(false) - - // Another chat's head is its own; A settling later must not clear B's hold. - await show(chatB) - expect(tray.steerHead!.steers(true)).toBe(true) - expect(press()).toBe(true) - await act(async () => settles[0]!(true)) - expect(tray.steerHead!.steers(true)).toBe(false) - expect(press()).toBe(false) - await act(async () => settles[1]!(true)) - expect(tray.steerHead!.steers(true)).toBe(true) - - // Back to A, whose list remounts: an action started there still holds until it settles. - await show(chatA) - expect(press()).toBe(true) - await show(chatB) - await show(chatA) - expect(tray.steerHead!.steers(true)).toBe(false) - expect(press()).toBe(false) - await act(async () => settles[2]!(true)) - expect(tray.steerHead!.steers(true)).toBe(true) - - // No turn running (the paused queue after Stop): the head card's own Send. - await show(chatA, { agentWorking: false }) - expect(tray.steerHead!.steers(false)).toBe(true) - const refusals: [Partial[0]>, boolean][] = [ - [{}, false], - [{ steerHeld: true }, true], - [{ cards: [card({ messageId: 'a1', command: true }), card({ messageId: 'a2' })] }, true] - ] - for (const [props, alternateSteers] of refusals) { - await show(chatA, props) - expect(tray.steerHead!.steers(alternateSteers)).toBe(false) - const sends = onSend.mock.calls.length - expect(press(alternateSteers)).toBe(false) - expect(onSend).toHaveBeenCalledTimes(sends) - } - }) - it('runs one action per card at a time, however fast its controls are tapped', async () => { let answer: (done: boolean) => void = () => undefined const onSend = vi.fn(() => new Promise((resolve) => (answer = resolve))) @@ -270,71 +162,6 @@ describe('MobileNativeChatQueuedMessages', () => { }) } - it.each([100, 1000])('keeps pending work linear at %i cards', async (size) => { - let counting = false - let reads = 0 - let memberships = 0 - const ids = Array.from({ length: size }, (_, index) => `perf-card-${index}`) - const cards = ids.map((messageId) => - Object.defineProperty(card({ messageId }), 'messageId', { - get: () => { - reads += Number(counting) - return messageId - } - }) - ) - const has = Set.prototype.has - const membership = vi.spyOn(Set.prototype, 'has') - membership.mockImplementation(function (this: Set, key: unknown) { - if (counting && typeof key === 'string' && key.startsWith('perf-card-')) { - memberships++ - } - return has.call(this, key) - }) - const send = Promise.withResolvers() - const clear = Promise.withResolvers() - const onClearAll = vi.fn(() => clear.promise) - const onResume = vi.fn(async () => true) - const onSend = vi.fn(() => send.promise) - const mounted = await mountPaused({ - cards, - pause: { reason: 'stopped' }, - onClearAll, - onResume, - onSend - }) - const labels = ['Delete every queued message', 'Resume sending the queued messages'] - const steer = 'Send this message' - const trigger = async (action: () => void) => { - counting = true - await act(async () => action()) - counting = false - } - // The last card forces the complete conflict scan; admission and settlement each rerender. - await trigger(() => control(mounted, steer, size - 1).props.onPress()) - expect(onSend).toHaveBeenCalledExactlyOnceWith(ids.at(-1)) - expect(control(mounted, labels[0]!).props.disabled).toBe(true) - await trigger(() => send.resolve(false)) - // Same frame, before disabled state renders: the shared admission check refuses the rest. - await trigger(() => { - control(mounted, labels[0]!).props.onPress() - control(mounted, labels[1]!).props.onPress() - control(mounted, steer).props.onPress() - }) - expect(onClearAll).toHaveBeenCalledExactlyOnceWith(ids) - expect([onResume.mock.calls.length, onSend.mock.calls.length]).toEqual([0, 1]) - const greyed = () => [...labels, steer].map((label) => control(mounted, label).props.disabled) - expect(greyed()).toEqual([true, true, true]) - await trigger(() => clear.resolve(false)) - expect(greyed()).toEqual([false, false, false]) - // Four pending/settled renders plus admission: fixed linear budgets, independent of N. - expect(reads).toBeGreaterThanOrEqual(4 * size) - expect(reads).toBeLessThanOrEqual(36 * size) - expect(memberships).toBeGreaterThanOrEqual(size) - expect(memberships).toBeLessThanOrEqual(18 * size) - console.info('queue operation counts', { cards: size, reads, memberships }) - }) - function resumeButton(mounted: ReactTestRenderer) { return control(mounted, 'Resume sending the queued messages') } @@ -355,193 +182,4 @@ describe('MobileNativeChatQueuedMessages', () => { expect(onResume).toHaveBeenCalledTimes(2) }) }) - - it('admits one queue move synchronously, preserves unrelated actions and releases after settlement', async () => { - const messages: AgentSessionQueuedMessage[] = ['a', 'b', 'c', 'd'].map( - (messageId, position) => ({ - messageId, - position, - state: 'waiting', - body: { kind: 'message', role: 'user', blocks: [{ type: 'text', text: messageId }] } - }) - ) - messages[2]!.body.from = { kind: 'agent', senders: [], orchestration: null } - type MoveReply = StructuredAgentSessionMutationResult - const first = Promise.withResolvers() - const second = Promise.withResolvers() - const mutate = vi - .fn<(...args: Parameters) => Promise>() - .mockReturnValueOnce(first.promise) - .mockReturnValueOnce(second.promise) - const send = vi.fn(async () => true) - function Harness({ published = messages }: { published?: AgentSessionQueuedMessage[] }) { - const queue = useMobileQueuedMessageComposerActions({ - messages: published, - sessionId: 's', - sessionKey: 's', - reorderCapable: true, - enabled: true, - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Vitest erases the generic result signature; this hook only requests queuedMessageMove, and both deferred replies are checked as MoveReply. - mutate: mutate as MobileStructuredAgentMutate, - onSendError: () => {} - }) - return createElement(MobileNativeChatQueuedMessages, { - cards: mobileQueuedMessageCards(queue.messages, []), - onMove: queue.move, - onSend: send - }) - } - await act(async () => { - renderer = create(createElement(Harness)) - }) - const list = () => renderer!.root.find((node) => String(node.type) === 'DragReorderList') - const ids = () => list().props.items.map((entry: MobileQueuedMessageCard) => entry.messageId) - const queuedMove = list().props.onMove - act(() => { - expect(queuedMove({ movedId: 'c', beforeId: 'a' })).toBe(true) - expect(queuedMove({ movedId: 'b', afterId: 'd' })).toBe(false) - }) - expect(mutate).toHaveBeenCalledTimes(1) - expect(ids()).toEqual(['c', 'a', 'b', 'd']) - expect(list().props.canMove).toBeUndefined() - expect(list().props.items[0].from).toBeDefined() - expect( - list().props.items.every((entry: MobileQueuedMessageCard) => - list().props.isMoveDisabled(entry) - ) - ).toBe(true) - const movedRow = list().props.renderRow(list().props.items[0]) - act(() => movedRow.props.onSend()) - expect(send).not.toHaveBeenCalled() - const otherRow = list().props.renderRow(list().props.items[1]) - await act(async () => otherRow.props.onSend()) - expect(send).toHaveBeenCalledExactlyOnceWith('a') - await act(async () => { - first.resolve({ - status: 'accepted', - value: { messageId: 'c', status: 'stale' }, - sameFence: true - }) - await first.promise - }) - expect(ids()).toEqual(['a', 'b', 'c', 'd']) - expect( - list().props.items.every( - (entry: MobileQueuedMessageCard) => !list().props.isMoveDisabled(entry) - ) - ).toBe(true) - act(() => expect(list().props.onMove({ movedId: 'b', afterId: 'd' })).toBe(true)) - // The host republishes the moved order with fresh positions; cards sort by position. - const published = [0, 2, 3, 1].map((index, position) => ({ ...messages[index]!, position })) - await act(async () => renderer!.update(createElement(Harness, { published }))) - expect(ids()).toEqual(['a', 'c', 'd', 'b']) - await act(async () => renderer!.unmount()) - renderer = null - await act(async () => { - second.resolve({ - status: 'accepted', - value: { messageId: 'b', status: 'moved' }, - sameFence: true - }) - await second.promise - }) - expect(mutate).toHaveBeenCalledTimes(2) - }) }) - -for (const population of [10, 100]) { - it(`does no queue population work on geometry-only updates with ${population} cards`, async () => { - const root = document.createElement('div') - root.dataset.testid = 'native-chat-view' - const viewport = document.createElement('div') - const content = document.createElement('div') - root.append(viewport) - viewport.append(content) - document.body.append(root) - let height = 180 - Object.defineProperties(viewport, { - clientHeight: { get: () => height }, - clientWidth: { value: 300 }, - scrollHeight: { value: 300 } - }) - vi.spyOn(root, 'getBoundingClientRect').mockImplementation(() => new DOMRect(0, 0, 300, 500)) - let visits = 0 - let operationRenders = 0 - let observedHeight = 0 - function GeometryConsumer() { - observedHeight = useMobileNativeChatLowerGeometry().viewportHeight - return null - } - function OperationConsumer() { - useMobileNativeChatLowerRegion() - operationRenders++ - return null - } - const cards = Array.from({ length: population }, (_, index) => { - const item = card({ messageId: `queued-${index}` }) - Object.defineProperty(item, 'messageId', { - get: () => { - visits++ - return `queued-${index}` - } - }) - return item - }) - let mounted: ReactTestRenderer | undefined - const paint = () => new Promise((resolve) => requestAnimationFrame(() => resolve())) - const render = (items: MobileQueuedMessageCard[]) => ( - - - - - - ) - try { - await act(async () => { - mounted = create(render(cards), { - createNodeMock: (element) => { - const props = element.props - if ( - typeof props === 'object' && - props !== null && - 'testID' in props && - props.testID === 'native-chat-lower-scroll' - ) { - return { getScrollableNode: () => viewport } - } - return element.type === 'ScrollView' ? { scrollToEnd: () => {} } : content - } - }) - }) - await act(paint) - await act(paint) - expect(observedHeight).toBe(180) - visits = 0 - operationRenders = 0 - rowRenders.count = 0 - await act(async () => { - height = 120 - window.dispatchEvent(new Event('resize')) - await paint() - }) - expect(observedHeight).toBe(120) - expect.soft(operationRenders).toBe(0) - expect.soft(rowRenders.count).toBe(0) - expect.soft(visits).toBe(0) - await act(async () => - mounted!.update( - render([...cards, card({ messageId: 'appended', text: 'A real new message' })]) - ) - ) - expect(rowRenders.count).toBeGreaterThan(0) - expect(visits).toBeGreaterThan(0) - expect( - mounted!.root.findAllByProps({ children: 'A real new message' }).length - ).toBeGreaterThan(0) - } finally { - await act(async () => mounted?.unmount()) - root.remove() - vi.restoreAllMocks() - } - }) -} diff --git a/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.tsx b/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.tsx index 40d45fd502b..b2a8d678a9e 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatQueuedMessages.tsx @@ -9,7 +9,7 @@ import { colors } from '../../../theme/mobile-theme' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' import { useLargeSystemText } from '../../../theme/use-large-system-text' -import type { MobileQueuedMessageCard } from '../../mobile-structured-queued-message-cards' +import type { MobileQueuedMessageCard } from './mobile-structured-queued-message-cards' import type { MobileQueuedHeadLight } from './mobile-queued-head-light' import { createMobileQueuedCardActionStore, @@ -18,10 +18,10 @@ import { } from './mobile-queued-card-actions' import { headSteerableQueuedMessageCard } from '../../../../../src/shared/agent-session/view/structured-agent-session-queued-cards' import type { AgentSessionQueuePause } from '../../../../../src/shared/agent-session/requests/agent-session-queued-message-wire' -import type { MobileQueuedMessageEdit } from '../../use-mobile-structured-queued-message-controls' -import type { MobileQueuedMessageInlineEditor } from '../../mobile-queued-message-edit-draft' -import { MobileQueuedMessageCardRow } from '../../MobileQueuedMessageCardRow' -import { MobileQueuedMessageScrollList } from '../../MobileQueuedMessageScrollList' +import type { MobileQueuedMessageEdit } from './use-mobile-structured-queued-message-controls' +import type { MobileQueuedMessageInlineEditor } from './mobile-queued-message-edit-draft' +import { MobileQueuedMessageCardRow } from './MobileQueuedMessageCardRow' +import { MobileQueuedMessageScrollList } from './MobileQueuedMessageScrollList' import { queuedMessageStyles as styles } from './mobile-native-chat-queued-message-styles' import { useMobileNativeChatLowerRegion } from '../mobile-native-chat-lower-region-context' diff --git a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.test.ts b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.test.ts index 676636c583d..f43f8762553 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.test.ts +++ b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.test.ts @@ -1,15 +1,3 @@ -import type { AgentSessionOptionsResult } from '../../../../../src/shared/agent-session/options/agent-session-options-result' -import { useMobileNativeChatSessionOptionController } from './use-mobile-native-chat-session-option-controller' -import { - OPTIONS, - BASE, - deferred, - accepted, - optionsClient, - recordingMutate, - mountOptions, - settle -} from '../../use-mobile-structured-agent-options.test-fixture' import { createElement, useState, type ReactNode } from 'react' import { act, type ReactTestRenderer } from 'react-test-renderer' import { createWithQueryClient } from '../../../test-support/query-client-test-renderer' @@ -180,124 +168,6 @@ describe('MobileNativeChatSessionOptionPickers', () => { await act(async () => rowByText('Full access').props.onPress()) expect(setOption).toHaveBeenCalledExactlyOnceWith('permissionMode', 'full-access') }) - - it('picks the shown Codex default during a reply and captures it only for the next message', async () => { - const pending = deferred() - let reads = 0 - const rpc = optionsClient(() => - ++reads === 1 - ? Promise.resolve({ - ...OPTIONS, - listedModelIds: OPTIONS.models.map((row) => row.id), - current: { model: 'gpt-fast', acceptedInputSources: { model: 'saved' }, defaulted: [] } - }) - : pending.promise - ) - const { calls, mutate } = recordingMutate(async () => - accepted({ key: 'effort', value: 'low', options: { effort: 'low' } }, true) - ) - const view = await mountOptions({ ...BASE, client: rpc.client, mutate, sendSelection: true }) - const snapshot = () => [...view.current().optionSnapshot] - try { - const update = mount(snapshot(), true) - const running = view.current().sendSelection() - expect(running).toEqual({ selection: { model: 'gpt-fast' } }) - await act(async () => pill('Model').props.onPress()) - setOption.mockImplementation(view.current().setStructuredOption) - await act(async () => pill('Low').props.onPress()) - await settle() - expect(calls.map((call) => call.fields)).toEqual([{ key: 'effort', value: 'low' }]) - expect(view.current().sendSelection()).toEqual({ - selection: { model: 'gpt-fast', effort: 'low' } - }) - expect(running).toEqual({ selection: { model: 'gpt-fast' } }) - update(true, snapshot()) - await act(async () => pill('Low').props.onPress()) - expect(setOption).toHaveBeenCalledTimes(1) - } finally { - await view.unmount() - } - }) - - it('renders actual settled permission/reset picks without busy state and locks ordinary pending model work', async () => { - const idle = deferred() - let reads = 0 - const rpc = optionsClient(() => - ++reads === 1 - ? Promise.resolve({ ...OPTIONS, current: { ...OPTIONS.current, permissionMode: 'ask' } }) - : idle.promise - ) - const replies = Array.from({ length: 3 }, () => deferred>()) - const { calls, mutate } = recordingMutate((index) => replies[index].promise) - const view = await mountOptions({ ...BASE, client: rpc.client, mutate, permissionOwn: true }) - function ActualPickers() { - const options = view.current() - const { nativeChatSessionOptions } = useMobileNativeChatSessionOptionController({ - client: rpc.client, - activeChatStructured: true, - activeSessionTabId: BASE.sessionId, - agent: 'codex', - dispatchCommand: async () => 'accepted', - hostId: 'phone-picker', - isTabChatView: () => true, - isWorking: true, - reportedModel: null, - structured: { - snapshot: options.optionSnapshot, - pendingId: options.pendingOptionId, - setOption: options.setStructuredOption, - invokeAction: options.invokeStructuredOption - }, - toggleTabChatView: () => {}, - worktreeId: 'workspace-1' - }) - return createElement(MobileNativeChatSessionOptionPickers, { - ...nativeChatSessionOptions!, - presentation: { page: 'model', refocus: false }, - onDrawerOpen: () => {}, - onNavigate: () => {} - }) - } - try { - await act(async () => { - renderer = createWithQueryClient(createElement(ActualPickers)) - }) - for (const [index, value] of ['full-access', 'own'].entries()) { - let pick!: Promise - act(() => { - pick = view.current().setStructuredOption('permissionMode', value) - }) - expect(calls[index]?.fields).toEqual({ key: 'permissionMode', value }) - expect(view.current().pendingOptionId).toBeNull() - await act(async () => renderer!.update(createElement(ActualPickers))) - expect(renderer!.root.findAllByProps({ children: 'Applying…' })).toHaveLength(0) - expect(rowByText('GPT Fast').props.accessibilityState?.disabled).toBe(false) - await act(async () => - replies[index].resolve( - accepted({ key: 'permissionMode', value, options: { permissionMode: value } }, true) - ) - ) - await expect(pick).resolves.toBe(true) - expect(view.current().pendingOptionId).toBeNull() - await act(async () => renderer!.update(createElement(ActualPickers))) - expect(renderer!.root.findAllByProps({ children: 'Applying…' })).toHaveLength(0) - expect(rowByText('GPT Fast').props.accessibilityState?.disabled).toBe(false) - } - act(() => { - void view.current().setStructuredOption('model', 'gpt-fast') - }) - await act(async () => renderer!.update(createElement(ActualPickers))) - expect(rowByText('GPT Live').props.accessibilityState?.disabled).toBe(true) - expect(renderer!.root.findAllByProps({ children: 'Applying…' })).toHaveLength(1) - expect(calls.map((call) => call.fields)).toEqual([ - { key: 'permissionMode', value: 'full-access' }, - { key: 'permissionMode', value: 'own' }, - { key: 'model', value: 'gpt-fast' } - ]) - } finally { - await view.unmount() - } - }) }) const PERMISSION_CHOICES: SessionOptionSelectChoice[] = [ diff --git a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.tsx b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.tsx index 64360176bd6..973ee4010c1 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionPickers.tsx @@ -36,7 +36,8 @@ import { descriptorRowElements, ModelPill, SessionOptionCaption, - SessionOptionSummaryRow + SessionOptionSummaryRow, + showsSessionOptionAsSwitch } from './MobileNativeChatSessionOptionRows' import { SessionOptionSegments, @@ -383,7 +384,7 @@ function OptionRows({ {descriptors.flatMap((descriptor) => { const isPermission = descriptor === permission const disabled = locked(descriptor) || !descriptor.settable - if (descriptor.kind.type === 'boolean' && !descriptor.action) { + if (showsSessionOptionAsSwitch(descriptor)) { return descriptorRowElements( { descriptor, diff --git a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionRows.tsx b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionRows.tsx index e8dfb017a3d..63c69893624 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionRows.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatSessionOptionRows.tsx @@ -17,6 +17,10 @@ import { nativeChatSessionOptionActionLabel, nativeChatSessionOptionLabel } from '../../../../../src/shared/native-chat/input/native-chat-session-option-labels' +import { + loneFastTier, + speedButtonTiers +} from '../../../../../src/shared/native-chat/input/native-chat-session-speed-tiers' import { sayMobileNativeChatSessionOption as say } from './native-chat-session-option-copy' import { MobileSwitch } from '../../../components/MobileSwitch' @@ -131,6 +135,20 @@ type DescriptorRowsProps = { moreChoices?: { shown: boolean; onToggle: () => void } } +/** A Fast-only speed, which toggles on one row like Claude's Fast mode. */ +function fastSpeedSwitch(descriptor: SessionOptionDescriptor) { + const speed = speedButtonTiers(descriptor) + const fast = speed ? loneFastTier(speed.tiers) : undefined + return speed && fast ? { standard: speed.standard, fast } : null +} + +export function showsSessionOptionAsSwitch(descriptor: SessionOptionDescriptor): boolean { + return ( + !descriptor.action && + (descriptor.kind.type === 'boolean' || fastSpeedSwitch(descriptor) !== null) + ) +} + /** One descriptor's rows as an array, so a ListGroup can draw the separators between them. */ export function descriptorRowElements( { @@ -156,8 +174,10 @@ export function descriptorRowElements( ] } // An unknown baseline still renders a switch; the source marker prevents implying the value was confirmed. - if (descriptor.kind.type === 'boolean') { - const label = nativeChatSessionOptionLabel(descriptor, say) + const fastSpeed = fastSpeedSwitch(descriptor) + if (descriptor.kind.type === 'boolean' || fastSpeed) { + const { kind } = descriptor + const label = fastSpeed ? say('fastMode') : nativeChatSessionOptionLabel(descriptor, say) const marker = sessionOptionValueMarker(descriptor) return [ onSetOption(next)} + value={ + kind.type === 'boolean' + ? kind.currentValue + : kind.currentValue === fastSpeed?.fast.value + } + onValueChange={(next) => + onSetOption( + fastSpeed ? (next ? fastSpeed.fast.value : fastSpeed.standard.value) : next + ) + } disabled={locked} /> } diff --git a/mobile/src/session/native-chat/input/MobileNativeChatThreadGoalStrip.tsx b/mobile/src/session/native-chat/input/MobileNativeChatThreadGoalStrip.tsx index 9d73bb6da3f..d1aa5793cd7 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatThreadGoalStrip.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatThreadGoalStrip.tsx @@ -17,7 +17,7 @@ import { themedStyleSheet } from '../../../theme/themed-styles' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' import { COMPOSER_TUCK } from '../composer/mobile-native-chat-composer-styles' import { queuedMessageStyles } from './mobile-native-chat-queued-message-styles' -import type { MobileStructuredThreadGoal } from '../../use-mobile-structured-thread-goal' +import type { MobileStructuredThreadGoal } from './use-mobile-structured-thread-goal' type Translate = ReturnType diff --git a/mobile/src/session/MobileQueuedCardText.tsx b/mobile/src/session/native-chat/input/MobileQueuedCardText.tsx similarity index 85% rename from mobile/src/session/MobileQueuedCardText.tsx rename to mobile/src/session/native-chat/input/MobileQueuedCardText.tsx index c0af69cf12f..d97d8e1beeb 100644 --- a/mobile/src/session/MobileQueuedCardText.tsx +++ b/mobile/src/session/native-chat/input/MobileQueuedCardText.tsx @@ -1,10 +1,10 @@ import { useState } from 'react' import { Pressable, Text, View } from 'react-native' -import { colors, typography, pressedStyle } from '../theme/mobile-theme' -import { themedStyleSheet } from '../theme/themed-styles' -import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' -import { queuedMessageStyles } from './native-chat/input/mobile-native-chat-queued-message-styles' -import { useMobileTranslation } from '../i18n/use-mobile-translation' +import { colors, typography, pressedStyle } from '../../../theme/mobile-theme' +import { themedStyleSheet } from '../../../theme/themed-styles' +import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' +import { queuedMessageStyles } from './mobile-native-chat-queued-message-styles' +import { useMobileTranslation } from '../../../i18n/use-mobile-translation' // Expand clipped queued text before Steer/Delete; use the queue’s capped scroller rather than nesting another scroll box. export function MobileQueuedCardText({ diff --git a/mobile/src/session/MobileQueuedMessageCardRow.tsx b/mobile/src/session/native-chat/input/MobileQueuedMessageCardRow.tsx similarity index 91% rename from mobile/src/session/MobileQueuedMessageCardRow.tsx rename to mobile/src/session/native-chat/input/MobileQueuedMessageCardRow.tsx index 66460db018e..d7bb5553a1b 100644 --- a/mobile/src/session/MobileQueuedMessageCardRow.tsx +++ b/mobile/src/session/native-chat/input/MobileQueuedMessageCardRow.tsx @@ -10,19 +10,19 @@ import { Send, Trash2 } from 'lucide-react-native' -import { colors, pressedStyle } from '../theme/mobile-theme' -import { queuedMessageCardSteers } from '../../../src/shared/agent-session/view/structured-agent-session-queued-cards' -import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' +import { colors, pressedStyle } from '../../../theme/mobile-theme' +import { queuedMessageCardSteers } from '../../../../../src/shared/agent-session/view/structured-agent-session-queued-cards' +import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' import type { MobileQueuedMessageCard } from './mobile-structured-queued-message-cards' -import type { MobileQueuedMessageInlineEditor } from './use-mobile-structured-queued-edit' +import type { MobileQueuedMessageInlineEditor } from './mobile-queued-message-edit-draft' import { MobileQueuedMessageComposer } from './MobileQueuedMessageComposer' import { MobileQueuedCardText } from './MobileQueuedCardText' -import type { MobileQueuedHeadLight } from './native-chat/input/mobile-queued-head-light' +import type { MobileQueuedHeadLight } from './mobile-queued-head-light' const subscribeNever = () => () => undefined -import { MobileAgentMessageSenders } from './native-chat/transcript/MobileAgentMessageSenders' -import { queuedMessageStyles as styles } from './native-chat/input/mobile-native-chat-queued-message-styles' -import { useMobileTranslation } from '../i18n/use-mobile-translation' +import { MobileAgentMessageSenders } from '../transcript/MobileAgentMessageSenders' +import { queuedMessageStyles as styles } from './mobile-native-chat-queued-message-styles' +import { useMobileTranslation } from '../../../i18n/use-mobile-translation' type QueuedMessageCardRowProps = { dragHandle?: ReactNode diff --git a/mobile/src/session/MobileQueuedMessageComposer.tsx b/mobile/src/session/native-chat/input/MobileQueuedMessageComposer.tsx similarity index 82% rename from mobile/src/session/MobileQueuedMessageComposer.tsx rename to mobile/src/session/native-chat/input/MobileQueuedMessageComposer.tsx index 6ec1670fbff..94bec868eb4 100644 --- a/mobile/src/session/MobileQueuedMessageComposer.tsx +++ b/mobile/src/session/native-chat/input/MobileQueuedMessageComposer.tsx @@ -1,21 +1,21 @@ import { useContext, useEffect, useMemo, useRef } from 'react' import { MobileQueuedMessageComposerContext } from './mobile-queued-message-composer-context' import { Text, type TextInput, View } from 'react-native' -import { MobileNativeChatComposer } from './native-chat/composer/MobileNativeChatComposer' -import type { MobileQueuedMessageInlineEditor } from './use-mobile-structured-queued-edit' -import { useMobileNativeChatFileAttachments } from './native-chat/composer/use-mobile-native-chat-file-attachments' -import { useMobileNativeChatImageUpload } from './native-chat/composer/use-mobile-native-chat-image-upload' +import { MobileNativeChatComposer } from '../composer/MobileNativeChatComposer' +import type { MobileQueuedMessageInlineEditor } from './mobile-queued-message-edit-draft' +import { useMobileNativeChatFileAttachments } from '../composer/use-mobile-native-chat-file-attachments' +import { useMobileNativeChatImageUpload } from '../composer/use-mobile-native-chat-image-upload' import { updateMobileNativeChatDraftInputs, useMobileNativeChatDraftInputs -} from './native-chat/composer/mobile-native-chat-draft-inputs' -import { prepareQueuedMessageEditText } from '../../../src/shared/queued-message-edit-command' -import type { AgentMessageSource } from '../../../src/shared/agent-session/agent-session-message-source' -import { MobileAgentMessageSenders } from './native-chat/transcript/MobileAgentMessageSenders' -import { queuedMessageStyles as styles } from './native-chat/input/mobile-native-chat-queued-message-styles' -import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' -import { createUuidV4 } from '../../../src/shared/uuid-v4' -import { useMobileTranslation } from '../i18n/use-mobile-translation' +} from '../composer/mobile-native-chat-draft-inputs' +import { prepareQueuedMessageEditText } from '../../../../../src/shared/queued-message-edit-command' +import type { AgentMessageSource } from '../../../../../src/shared/agent-session/agent-session-message-source' +import { MobileAgentMessageSenders } from '../transcript/MobileAgentMessageSenders' +import { queuedMessageStyles as styles } from './mobile-native-chat-queued-message-styles' +import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' +import { createNonSecureContextUuid as createUuidV4 } from '../../../../../src/shared/non-secure-context-uuid' +import { useMobileTranslation } from '../../../i18n/use-mobile-translation' export function MobileQueuedMessageComposer({ editor, diff --git a/mobile/src/session/MobileQueuedMessageScrollList.tsx b/mobile/src/session/native-chat/input/MobileQueuedMessageScrollList.tsx similarity index 95% rename from mobile/src/session/MobileQueuedMessageScrollList.tsx rename to mobile/src/session/native-chat/input/MobileQueuedMessageScrollList.tsx index fac8c9e1e8f..c7a05ffed9d 100644 --- a/mobile/src/session/MobileQueuedMessageScrollList.tsx +++ b/mobile/src/session/native-chat/input/MobileQueuedMessageScrollList.tsx @@ -6,9 +6,9 @@ import Animated, { type AnimatedRef, type SharedValue } from 'react-native-reanimated' -import { spacing } from '../theme/mobile-theme' -import { MobileEdgeFade } from '../components/MobileEdgeFade' -import { useMobileNativeChatLowerRegion } from './native-chat/mobile-native-chat-lower-region-context' +import { spacing } from '../../../theme/mobile-theme' +import { MobileEdgeFade } from '../../../components/MobileEdgeFade' +import { useMobileNativeChatLowerRegion } from '../mobile-native-chat-lower-region-context' /** Desktop's `max-h-40`: three one-line cards and part of a fourth, whose cut-off edge is the * sign that the list scrolls. */ diff --git a/mobile/src/session/mobile-background-task-copy.ts b/mobile/src/session/native-chat/input/mobile-background-task-copy.ts similarity index 98% rename from mobile/src/session/mobile-background-task-copy.ts rename to mobile/src/session/native-chat/input/mobile-background-task-copy.ts index e204e2e8005..52cd8474413 100644 --- a/mobile/src/session/mobile-background-task-copy.ts +++ b/mobile/src/session/native-chat/input/mobile-background-task-copy.ts @@ -1,8 +1,8 @@ import type { BackgroundTaskCopyId, BackgroundTaskSay -} from '../../../src/shared/background-task-copy' -import { translate } from '../i18n/mobile-i18n' +} from '../../../../../src/shared/background-task-copy' +import { translate } from '../../../i18n/mobile-i18n' export const sayMobileBackgroundTask: BackgroundTaskSay = (id, values) => { const count = values?.count diff --git a/mobile/src/session/mobile-host-model-catalog-query.ts b/mobile/src/session/native-chat/input/mobile-host-model-catalog-query.ts similarity index 82% rename from mobile/src/session/mobile-host-model-catalog-query.ts rename to mobile/src/session/native-chat/input/mobile-host-model-catalog-query.ts index 04e3eb307f4..eb6eb1ff7d1 100644 --- a/mobile/src/session/mobile-host-model-catalog-query.ts +++ b/mobile/src/session/native-chat/input/mobile-host-model-catalog-query.ts @@ -1,18 +1,18 @@ import { useMemo } from 'react' import { useQueryClient } from '@tanstack/react-query' -import type { AgentSessionModelCatalogResult } from '../../../src/shared/agent-session/agent-session-wire' +import type { AgentSessionModelCatalogResult } from '../../../../../src/shared/agent-session/agent-session-wire' import { hostReadsSavedModelCatalogsOnly, selectHostModelCatalogSnapshot, withHostModelCatalogAnswer, type HostModelCatalogSnapshot -} from '../../../src/shared/agent-session/options/host-model-catalog-snapshot-rules' -import { defineHostQuery, useHostQuery } from '../query/host-query' -import { hostQueryKey } from '../query/host-query-key' -import { useWorkspaceExecutionHost } from '../navigation/workspace-execution-host' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import { readRuntimeStatusProbe } from '../transport/connection/runtime-status-probe' -import { callAgentSession } from './mobile-structured-agent-session-rpc' +} from '../../../../../src/shared/agent-session/options/host-model-catalog-snapshot-rules' +import { defineHostQuery, useHostQuery } from '../../../query/host-query' +import { hostQueryKey } from '../../../query/host-query-key' +import { useWorkspaceExecutionHost } from '../../../navigation/workspace-execution-host' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import { readRuntimeStatusProbe } from '../../../transport/connection/runtime-status-probe' +import { callAgentSession } from '../agent-session/mobile-structured-agent-session-rpc' import type { HostModelCatalogCache } from './use-mobile-host-model-catalog-upgrade' // The host's account-level lists per agent, which a chat's first frame shows before its own read answers. diff --git a/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.test.ts b/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.test.ts deleted file mode 100644 index ed8d3c730ea..00000000000 --- a/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { - mobileNativeChatQuestionOffsets, - scheduleMobileClaudeAnswer, - MOBILE_NATIVE_CHAT_ADVANCE_BUFFER_MS, - MOBILE_NATIVE_CHAT_SUBMIT_DELAY_MS -} from './mobile-native-chat-answer-stepping' - -describe('mobileNativeChatQuestionOffsets', () => { - it('paces each question a full step apart, Enter 500ms after its body', () => { - expect(mobileNativeChatQuestionOffsets(0)).toEqual({ bodyAt: 0, enterAt: 500 }) - expect(mobileNativeChatQuestionOffsets(1)).toEqual({ bodyAt: 1000, enterAt: 1500 }) - expect(mobileNativeChatQuestionOffsets(2)).toEqual({ bodyAt: 2000, enterAt: 2500 }) - }) -}) - -describe('scheduleMobileClaudeAnswer', () => { - beforeEach(() => vi.useFakeTimers()) - afterEach(() => vi.useRealTimers()) - - it('writes each question body then its Enter, paced per step, one Enter per line', () => { - const events: string[] = [] - const timers = scheduleMobileClaudeAnswer( - ['', 'b', 'c'], - (line) => events.push(`body:${line}`), - () => events.push('enter') - ) - expect(timers).toHaveLength(6) - - vi.advanceTimersByTime(0) - expect(events).toEqual(['body:']) - vi.advanceTimersByTime(MOBILE_NATIVE_CHAT_SUBMIT_DELAY_MS - 1) - expect(events).toEqual(['body:']) - vi.advanceTimersByTime(1) - expect(events).toEqual(['body:', 'enter']) - vi.advanceTimersByTime(MOBILE_NATIVE_CHAT_ADVANCE_BUFFER_MS) - expect(events).toEqual(['body:', 'enter', 'body:b']) - - vi.runAllTimers() - expect(events).toEqual(['body:', 'enter', 'body:b', 'enter', 'body:c', 'enter']) - }) - - it('cancelling the returned timers stops all pending writes', () => { - const events: string[] = [] - const timers = scheduleMobileClaudeAnswer( - ['a', 'b'], - (line) => events.push(`body:${line}`), - () => events.push('enter') - ) - for (const timer of timers) { - clearTimeout(timer) - } - vi.runAllTimers() - expect(events).toEqual([]) - }) -}) diff --git a/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.ts b/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.ts deleted file mode 100644 index ad105d55a74..00000000000 --- a/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { - nativeChatQuestionOffsets, - scheduleNativeChatAnswer, - NATIVE_CHAT_ADVANCE_BUFFER_MS, - NATIVE_CHAT_QUESTION_STEP_MS, - NATIVE_CHAT_SUBMIT_DELAY_MS -} from '../../../../../src/shared/native-chat/input/native-chat-answer-stepping' - -export const MOBILE_NATIVE_CHAT_ADVANCE_BUFFER_MS = NATIVE_CHAT_ADVANCE_BUFFER_MS -export const MOBILE_NATIVE_CHAT_QUESTION_STEP_MS = NATIVE_CHAT_QUESTION_STEP_MS -export const MOBILE_NATIVE_CHAT_SUBMIT_DELAY_MS = NATIVE_CHAT_SUBMIT_DELAY_MS -export const mobileNativeChatQuestionOffsets = nativeChatQuestionOffsets -export const scheduleMobileClaudeAnswer = scheduleNativeChatAnswer diff --git a/mobile/src/session/native-chat/input/mobile-native-chat-answered-prompts.test-fixture.ts b/mobile/src/session/native-chat/input/mobile-native-chat-answered-prompts.test-fixture.ts deleted file mode 100644 index 829ffd49bda..00000000000 --- a/mobile/src/session/native-chat/input/mobile-native-chat-answered-prompts.test-fixture.ts +++ /dev/null @@ -1,261 +0,0 @@ -// A structured Claude chat on the desktop, read back with `agentSession.history` after its owner -// approved a Bash call and answered an AskUserQuestion (Claude Code 2.1.300, 2026-10-15). - -import type { AgentJournalRenderItem } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' - -export const ANSWERED_PROMPT_ITEMS: AgentJournalRenderItem[] = [ - { - itemId: 'orca:1792024009236-87ed41e5430c47008ef7978ca5d60505', - revision: 0, - body: { - kind: 'message', - role: 'user', - blocks: [ - { - type: 'text', - text: 'Run the bash command: echo receipt-check > receipt.txt' - } - ] - }, - sequence: 43, - observedAt: 1792024010442, - turnScope: { - kind: 'thread' - } - }, - { - itemId: - 'orca:claude-tool%3A2ee61cec-1207-4f44-a915-b6adbcbf169b%3Atoolu_01FhhC72BuRiD3d9hXkAsURD', - revision: 2, - body: { - kind: 'tool-call', - name: 'Bash', - input: { - command: 'echo receipt-check > receipt.txt', - description: 'Write receipt-check to receipt.txt' - }, - callId: 'toolu_01FhhC72BuRiD3d9hXkAsURD', - state: 'completed', - output: { - head: '(Bash completed with no output)', - byteLength: 31, - digest: 'cac1685585590361647e7a27b58a25a590f335bfcd0ab70fcdc0424e40c20843', - truncated: false - } - }, - sequence: 46, - observedAt: 1792024014854, - turnScope: { - kind: 'turn', - turnItemId: - 'legacy:claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:turn-lifecycle%3A6a80bc01-4be4-466f-bd98-5cae8368ed1d' - } - }, - { - itemId: - 'orca:claude-prompt%3Aclaude_c65b4304_2acf_4eec_a749_e06876328e0c%3A79c45210-730e-482c-82bd-db0708c992e5', - revision: 2, - body: { - kind: 'approval', - title: 'Allow Bash?', - displayName: 'Bash', - description: 'Write receipt-check to receipt.txt', - blockedPath: '/private/tmp/mnw-scratch/receipt.txt', - detail: - '{\n "command": "echo receipt-check > receipt.txt",\n "description": "Write receipt-check to receipt.txt"\n}', - options: [ - { - id: 'allow', - label: 'Allow' - }, - { - id: 'allowForSession', - label: 'Allow for this session' - }, - { - id: 'deny', - label: 'Deny' - } - ], - resolution: { - state: 'resolved', - selectedOptionId: 'allow', - resolvedBy: 'desktop-renderer', - resolvedAt: 1792024037937 - } - }, - sequence: 48, - observedAt: 1792024014910, - turnScope: { - kind: 'turn', - turnItemId: - 'legacy:claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:turn-lifecycle%3A6a80bc01-4be4-466f-bd98-5cae8368ed1d' - } - }, - { - itemId: 'claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:4408cf7b-bbe2-4a5d-aa80-6471db6d9c18', - revision: 2, - body: { - kind: 'message', - role: 'assistant', - blocks: [ - { - type: 'text', - text: 'I ran the command. `receipt.txt` in `/private/tmp/mnw-scratch` now holds the line `receipt-check`.' - } - ] - }, - sequence: 51, - observedAt: 1792024040901, - turnScope: { - kind: 'turn', - turnItemId: - 'legacy:claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:turn-lifecycle%3A6a80bc01-4be4-466f-bd98-5cae8368ed1d' - } - }, - { - itemId: 'orca:1792024048049-e58989ce33eb411a970225d03d2e4a18', - revision: 0, - body: { - kind: 'message', - role: 'user', - blocks: [ - { - type: 'text', - text: 'Use the AskUserQuestion tool to ask me whether I prefer tea or coffee, then reply with my answer in one short sentence.' - } - ] - }, - sequence: 57, - observedAt: 1792024048075, - turnScope: { - kind: 'thread' - } - }, - { - itemId: - 'orca:claude-tool%3A2ee61cec-1207-4f44-a915-b6adbcbf169b%3Atoolu_01WByTgphD4HFByq9zPKXn2J', - revision: 2, - body: { - kind: 'tool-call', - name: 'AskUserQuestion', - input: { - questions: [ - { - question: 'Do you prefer tea or coffee?', - header: 'Drink', - multiSelect: false, - options: [ - { - label: 'Tea', - description: 'You prefer tea.' - }, - { - label: 'Coffee', - description: 'You prefer coffee.' - } - ] - } - ] - }, - callId: 'toolu_01WByTgphD4HFByq9zPKXn2J', - state: 'completed', - output: { - head: 'Your questions have been answered: "Do you prefer tea or coffee?"="Coffee". You can now continue with these answers in mind.', - byteLength: 124, - digest: '65dfb0af315c9ab1c70fc26c6c6bfb4ef0138216e35c89cf332927d10cbb629d', - truncated: false - } - }, - sequence: 60, - observedAt: 1792024052205, - turnScope: { - kind: 'turn', - turnItemId: - 'legacy:claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:turn-lifecycle%3A1ea7cf09-10c6-4635-93bb-8d4b16fb1c60' - } - }, - { - itemId: - 'orca:claude-prompt%3Aclaude_c65b4304_2acf_4eec_a749_e06876328e0c%3A6fd8be6a-830f-44b4-a3ef-a7f044cd4a4f', - revision: 2, - body: { - kind: 'question', - question: 'Do you prefer tea or coffee?', - options: [ - { - id: 'q1:choice-1', - label: 'Tea', - description: 'You prefer tea.' - }, - { - id: 'q1:choice-2', - label: 'Coffee', - description: 'You prefer coffee.' - } - ], - freeTextQuestionId: 'q1', - questions: [ - { - id: 'q1', - question: 'Do you prefer tea or coffee?', - header: 'Drink', - multiSelect: false, - options: [ - { - id: 'q1:choice-1', - label: 'Tea', - description: 'You prefer tea.' - }, - { - id: 'q1:choice-2', - label: 'Coffee', - description: 'You prefer coffee.' - } - ], - freeTextQuestionId: 'q1' - } - ], - resolution: { - state: 'resolved', - selectedOptionId: 'question-group:[{"questionId":"q1","optionIds":["q1:choice-2"]}]', - answers: [ - { - questionId: 'q1', - optionIds: ['q1:choice-2'] - } - ], - resolvedBy: 'desktop-renderer', - resolvedAt: 1792024081980 - } - }, - sequence: 62, - observedAt: 1792024052228, - turnScope: { - kind: 'turn', - turnItemId: - 'legacy:claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:turn-lifecycle%3A1ea7cf09-10c6-4635-93bb-8d4b16fb1c60' - } - }, - { - itemId: 'claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:32c8a879-b68c-41ba-9a9e-4b844fa07890', - revision: 2, - body: { - kind: 'message', - role: 'assistant', - blocks: [ - { - type: 'text', - text: 'You prefer coffee.' - } - ] - }, - sequence: 65, - observedAt: 1792024084176, - turnScope: { - kind: 'turn', - turnItemId: - 'legacy:claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:turn-lifecycle%3A1ea7cf09-10c6-4635-93bb-8d4b16fb1c60' - } - } -] diff --git a/mobile/src/session/native-chat/input/mobile-native-chat-option-preview.ts b/mobile/src/session/native-chat/input/mobile-native-chat-option-preview.ts new file mode 100644 index 00000000000..e39b7d52635 --- /dev/null +++ b/mobile/src/session/native-chat/input/mobile-native-chat-option-preview.ts @@ -0,0 +1,7 @@ +import { Platform } from 'react-native' +import { typography } from '../../../theme/mobile-theme' + +export const optionPreviewFont = Platform.select({ + ios: 'Menlo', + default: typography.monoFamily +}) diff --git a/mobile/src/session/native-chat/input/mobile-native-chat-permission-send.ts b/mobile/src/session/native-chat/input/mobile-native-chat-permission-send.ts index 8a63b5555c7..f40820cae03 100644 --- a/mobile/src/session/native-chat/input/mobile-native-chat-permission-send.ts +++ b/mobile/src/session/native-chat/input/mobile-native-chat-permission-send.ts @@ -3,11 +3,11 @@ import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import { sendMobileNativeChatMessageWithOutcome, type MobileNativeChatSendOutcome -} from '../mobile-native-chat-send' +} from '../composer/mobile-native-chat-send' import { acquireMobileNativeChatTerminalWrite, releaseMobileNativeChatTerminalWrite -} from '../mobile-native-chat-terminal-write-lock' +} from '../composer/mobile-native-chat-terminal-write-lock' export function sendMobileNativeChatPermissionResponse(args: { client: RpcClient diff --git a/mobile/src/session/mobile-prompt-controller.test.ts b/mobile/src/session/native-chat/input/mobile-prompt-controller.test.ts similarity index 90% rename from mobile/src/session/mobile-prompt-controller.test.ts rename to mobile/src/session/native-chat/input/mobile-prompt-controller.test.ts index 8b82f60e47a..c863cdd5e25 100644 --- a/mobile/src/session/mobile-prompt-controller.test.ts +++ b/mobile/src/session/native-chat/input/mobile-prompt-controller.test.ts @@ -1,11 +1,11 @@ import { act } from 'react-test-renderer' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import './native-chat/input/mobile-native-chat-prompt-dismissals' -import './mobile-structured-send-delivery' -import './structured-agent-send-result.test-fixture' -import type { RpcResponse } from '../transport/rpc/rpc-wire-types' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import type { NativeChatMessage } from '../../../src/shared/native-chat/native-chat-types' +import './mobile-native-chat-prompt-dismissals' +import '../composer/mobile-structured-send-delivery' +import '../../structured-agent-send-result.test-fixture' +import type { RpcResponse } from '../../../transport/rpc/rpc-wire-types' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' import { session, @@ -20,7 +20,7 @@ import { permissionAction, getController, askAnswer -} from './__mocks__/mobile-prompt-controller' +} from '../../__mocks__/mobile-prompt-controller' const client: RpcClient = { sendRequest: vi.fn(), diff --git a/mobile/src/session/mobile-queued-message-composer-context.ts b/mobile/src/session/native-chat/input/mobile-queued-message-composer-context.ts similarity index 80% rename from mobile/src/session/mobile-queued-message-composer-context.ts rename to mobile/src/session/native-chat/input/mobile-queued-message-composer-context.ts index c4e6382b5d6..9bfeea6fd03 100644 --- a/mobile/src/session/mobile-queued-message-composer-context.ts +++ b/mobile/src/session/native-chat/input/mobile-queued-message-composer-context.ts @@ -1,6 +1,6 @@ -import type { NativeChatSkillDiscoverySnapshot } from '../../../src/shared/native-chat/input/native-chat-picker-items' +import type { NativeChatSkillDiscoverySnapshot } from '../../../../../src/shared/native-chat/input/native-chat-picker-items' import { createContext } from 'react' -import type { MobileNativeChatStructuredComposer } from './native-chat/composer/MobileNativeChatComposer' +import type { MobileNativeChatStructuredComposer } from '../composer/mobile-native-chat-structured-composer' export const MobileQueuedMessageComposerContext = createContext<{ agent: string | null diff --git a/mobile/src/session/mobile-queued-message-edit-draft.ts b/mobile/src/session/native-chat/input/mobile-queued-message-edit-draft.ts similarity index 86% rename from mobile/src/session/mobile-queued-message-edit-draft.ts rename to mobile/src/session/native-chat/input/mobile-queued-message-edit-draft.ts index dc794e4dba1..81bf996551b 100644 --- a/mobile/src/session/mobile-queued-message-edit-draft.ts +++ b/mobile/src/session/native-chat/input/mobile-queued-message-edit-draft.ts @@ -1,5 +1,8 @@ -import type { QueuedEditLeaseLoss } from '../../../src/shared/queued-message-edit-lease' -import type { MobileStructuredAgentMutate } from './use-mobile-structured-agent-mutation' +import type { + QueuedEditLease, + QueuedEditLeaseLoss +} from '../../../../../src/shared/queued-message-edit-lease' +import type { MobileStructuredAgentMutate } from '../agent-session/use-mobile-structured-agent-mutation' import type { MobileQueuedMessageCard } from './mobile-structured-queued-message-cards' import { mobileQueuedEditValueKey, @@ -11,23 +14,22 @@ import { closeMobileNativeChatEditInputs, readMobileNativeChatDraftInputs, updateMobileNativeChatDraftInputs -} from './native-chat/composer/mobile-native-chat-draft-inputs' -import type { AgentSessionQueuedMessage } from '../../../src/shared/agent-session/requests/agent-session-queued-message-wire' -import type { AgentJournalSubmission } from '../../../src/shared/agent-session/journal/agent-session-journal-types' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import type { MobileQueuedEditLease } from './mobile-queued-message-edit-lease' -import { pickedSkillsInText } from '../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' +} from '../composer/mobile-native-chat-draft-inputs' +import type { AgentSessionQueuedMessage } from '../../../../../src/shared/agent-session/requests/agent-session-queued-message-wire' +import type { AgentJournalSubmission } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import { pickedSkillsInText } from '../../../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' import { queuedEditKeptImages, queuedEditTextForKeptImages, type QueuedMessageImageBlock -} from '../../../src/shared/queued-message-edit' -import { appendReturnedDraftText } from '../../../src/shared/returned-draft-text' +} from '../../../../../src/shared/queued-message-edit' +import { appendReturnedDraftText } from '../../../../../src/shared/returned-draft-text' import { setMobileNativeChatDraftText, type MobileComposerWriter -} from './native-chat/composer/mobile-native-chat-draft-store' -import { nativeChatTextWithFileReferences } from './native-chat/composer/mobile-native-chat-file-attachment' +} from '../composer/mobile-native-chat-draft-store' +import { nativeChatTextWithFileReferences } from '../composer/mobile-native-chat-file-attachment' export type MobileQueuedMessageInlineEditor = { messageId: string @@ -84,7 +86,7 @@ export type MobileQueuedEditDraft = { attempt?: MobileQueuedEditAttempt closed: boolean pendingClose: boolean - lease: MobileQueuedEditLease + lease: QueuedEditLease } export function closeMobileQueuedEditDraft( diff --git a/mobile/src/session/mobile-queued-message-edit-lease.ts b/mobile/src/session/native-chat/input/mobile-queued-message-edit-lease.ts similarity index 66% rename from mobile/src/session/mobile-queued-message-edit-lease.ts rename to mobile/src/session/native-chat/input/mobile-queued-message-edit-lease.ts index 424f19e43a4..616a64e4c74 100644 --- a/mobile/src/session/mobile-queued-message-edit-lease.ts +++ b/mobile/src/session/native-chat/input/mobile-queued-message-edit-lease.ts @@ -1,12 +1,10 @@ import { startQueuedEditLease, type QueuedEditLeaseLoss -} from '../../../src/shared/queued-message-edit-lease' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import { callAgentSession } from './mobile-structured-agent-session-rpc' -import { structuredSessionOperationId } from './structured-session-operation-id' - -export type { QueuedEditLease as MobileQueuedEditLease } from '../../../src/shared/queued-message-edit-lease' +} from '../../../../../src/shared/queued-message-edit-lease' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import { callAgentSession } from '../agent-session/mobile-structured-agent-session-rpc' +import { structuredSessionOperationId } from '../agent-session/structured-session-operation-id' export function startMobileQueuedEditLease(args: { getClient: () => RpcClient | null diff --git a/mobile/src/session/mobile-queued-message-edit-open.ts b/mobile/src/session/native-chat/input/mobile-queued-message-edit-open.ts similarity index 83% rename from mobile/src/session/mobile-queued-message-edit-open.ts rename to mobile/src/session/native-chat/input/mobile-queued-message-edit-open.ts index cbb6d597434..5a5d550ad2a 100644 --- a/mobile/src/session/mobile-queued-message-edit-open.ts +++ b/mobile/src/session/native-chat/input/mobile-queued-message-edit-open.ts @@ -1,16 +1,16 @@ -import type { QueuedEditLeaseLoss } from '../../../src/shared/queued-message-edit-lease' +import type { QueuedEditLeaseLoss } from '../../../../../src/shared/queued-message-edit-lease' import { queuedMessageEditableText, queuedEditKeptImages -} from '../../../src/shared/queued-message-edit' -import { agentSessionSendBodyFingerprint } from '../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' -import { createUuidV4 } from '../../../src/shared/uuid-v4' +} from '../../../../../src/shared/queued-message-edit' +import { agentSessionSendBodyFingerprint } from '../../../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' +import { createNonSecureContextUuid as createUuidV4 } from '../../../../../src/shared/non-secure-context-uuid' import { startMobileQueuedEditLease } from './mobile-queued-message-edit-lease' import { mobileQueuedEditValueKey } from './mobile-queued-message-edit-value' import { mobileNativeChatDraftDestination, readMobileNativeChatDraftInputs -} from './native-chat/composer/mobile-native-chat-draft-inputs' +} from '../composer/mobile-native-chat-draft-inputs' import { seedMobileQueuedEditInputs, type MobileQueuedEditDraft as Edit, diff --git a/mobile/src/session/mobile-queued-message-edit-outcome.ts b/mobile/src/session/native-chat/input/mobile-queued-message-edit-outcome.ts similarity index 89% rename from mobile/src/session/mobile-queued-message-edit-outcome.ts rename to mobile/src/session/native-chat/input/mobile-queued-message-edit-outcome.ts index ef37efd9d30..13d8ab65330 100644 --- a/mobile/src/session/mobile-queued-message-edit-outcome.ts +++ b/mobile/src/session/native-chat/input/mobile-queued-message-edit-outcome.ts @@ -1,8 +1,8 @@ -import type { AgentSessionQueuedMessageUpdateResult } from '../../../src/shared/agent-session/requests/agent-session-queued-message-wire' -import { agentSessionSendBodyFingerprint } from '../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' +import type { AgentSessionQueuedMessageUpdateResult } from '../../../../../src/shared/agent-session/requests/agent-session-queued-message-wire' +import { agentSessionSendBodyFingerprint } from '../../../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' import type { MobileQueuedEditDraft } from './mobile-queued-message-edit-draft' -import type { StructuredAgentSessionMutationResult } from './mobile-structured-agent-session-rpc' -import { readMobileNativeChatDraftInputs } from './native-chat/composer/mobile-native-chat-draft-inputs' +import type { StructuredAgentSessionMutationResult } from '../agent-session/mobile-structured-agent-session-rpc' +import { readMobileNativeChatDraftInputs } from '../composer/mobile-native-chat-draft-inputs' import { mobileQueuedEditValueKey } from './mobile-queued-message-edit-value' type Outcome = 'close' | 'rebase' | 'gone' | 'changed' | 'refused' | 'stay' diff --git a/mobile/src/session/mobile-queued-message-edit-value.ts b/mobile/src/session/native-chat/input/mobile-queued-message-edit-value.ts similarity index 78% rename from mobile/src/session/mobile-queued-message-edit-value.ts rename to mobile/src/session/native-chat/input/mobile-queued-message-edit-value.ts index 173aacd67b2..ebf12bbbf00 100644 --- a/mobile/src/session/mobile-queued-message-edit-value.ts +++ b/mobile/src/session/native-chat/input/mobile-queued-message-edit-value.ts @@ -1,5 +1,5 @@ -import type { MobileNativeChatDraftInputs } from './native-chat/composer/mobile-native-chat-draft-inputs' -import { pickedSkillsInText } from '../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' +import type { MobileNativeChatDraftInputs } from '../composer/mobile-native-chat-draft-inputs' +import { pickedSkillsInText } from '../../../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' type Image = MobileNativeChatDraftInputs['images'][number] export function sameMobileQueuedEditImage(left: Image, right: Image): boolean { diff --git a/mobile/src/session/mobile-structured-actionable-prompt.ts b/mobile/src/session/native-chat/input/mobile-structured-actionable-prompt.ts similarity index 78% rename from mobile/src/session/mobile-structured-actionable-prompt.ts rename to mobile/src/session/native-chat/input/mobile-structured-actionable-prompt.ts index 71b34891229..1a79e5a192d 100644 --- a/mobile/src/session/mobile-structured-actionable-prompt.ts +++ b/mobile/src/session/native-chat/input/mobile-structured-actionable-prompt.ts @@ -1,5 +1,5 @@ -import { pendingStructuredSessionPrompts } from '../../../src/shared/agent-session/view/structured-agent-session-message-projection' -import type { StructuredAgentSessionState } from '../../../src/shared/agent-session/structured-agent-session-reducer' +import { pendingStructuredSessionPrompts } from '../../../../../src/shared/agent-session/view/structured-agent-session-message-projection' +import type { StructuredAgentSessionState } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' import type { StructuredApprovalItem, StructuredQuestionItem diff --git a/mobile/src/session/mobile-structured-agent-prompts-permission.test.ts b/mobile/src/session/native-chat/input/mobile-structured-agent-prompts-permission.test.ts similarity index 100% rename from mobile/src/session/mobile-structured-agent-prompts-permission.test.ts rename to mobile/src/session/native-chat/input/mobile-structured-agent-prompts-permission.test.ts diff --git a/mobile/src/session/mobile-structured-agent-prompts.ts b/mobile/src/session/native-chat/input/mobile-structured-agent-prompts.ts similarity index 94% rename from mobile/src/session/mobile-structured-agent-prompts.ts rename to mobile/src/session/native-chat/input/mobile-structured-agent-prompts.ts index 93a3bb5d7ed..ace186b66e5 100644 --- a/mobile/src/session/mobile-structured-agent-prompts.ts +++ b/mobile/src/session/native-chat/input/mobile-structured-agent-prompts.ts @@ -1,11 +1,11 @@ -import type { AgentJournalRenderItem } from '../../../src/shared/agent-session/journal/agent-session-journal-types' +import type { AgentJournalRenderItem } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' import { agentSessionPromptQuestions, type AgentSessionQuestionAnswer -} from '../../../src/shared/agent-session/agent-session-question-answer' -import { chatApprovalFromJournal } from '../../../src/shared/native-chat/input/native-chat-interactive-prompt' -import type { MobileChatPermission } from './native-chat/input/mobile-native-chat-permission' -import type { MobileChatQuestion } from './native-chat/input/mobile-native-chat-question' +} from '../../../../../src/shared/agent-session/agent-session-question-answer' +import { chatApprovalFromJournal } from '../../../../../src/shared/native-chat/input/native-chat-interactive-prompt' +import type { MobileChatPermission } from './mobile-native-chat-permission' +import type { MobileChatQuestion } from './mobile-native-chat-question' export type StructuredApprovalItem = AgentJournalRenderItem & { body: Extract diff --git a/mobile/src/session/mobile-structured-queued-message-cards.ts b/mobile/src/session/native-chat/input/mobile-structured-queued-message-cards.ts similarity index 78% rename from mobile/src/session/mobile-structured-queued-message-cards.ts rename to mobile/src/session/native-chat/input/mobile-structured-queued-message-cards.ts index 42d009d89bd..3730aa220fe 100644 --- a/mobile/src/session/mobile-structured-queued-message-cards.ts +++ b/mobile/src/session/native-chat/input/mobile-structured-queued-message-cards.ts @@ -1,18 +1,18 @@ -import { stripSentImagePromptMarkers } from '../../../src/shared/native-chat/transcript/native-chat-image-transcript-markers' -import type { AgentSessionFailureFact } from '../../../src/shared/agent-session/failures/agent-session-failure' -import { mobileAgentSessionWriteNoticeText } from './agent-session-write-notice-copy' -import type { AgentJournalSubmission } from '../../../src/shared/agent-session/journal/agent-session-journal-types' +import { stripSentImagePromptMarkers } from '../../../../../src/shared/native-chat/transcript/native-chat-image-transcript-markers' +import type { AgentSessionFailureFact } from '../../../../../src/shared/agent-session/failures/agent-session-failure' +import { mobileAgentSessionWriteNoticeText } from '../agent-session/agent-session-write-notice-copy' +import type { AgentJournalSubmission } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' import { QUEUED_MESSAGE_PAUSED_SEND_FAILED, type AgentSessionQueuedMessage -} from '../../../src/shared/agent-session/requests/agent-session-queued-message-wire' +} from '../../../../../src/shared/agent-session/requests/agent-session-queued-message-wire' import { projectQueuedMessageCards, queuedMessageCardLine, queuedMessageCardNeedsAttention, queuedMessageReturnedNotice, type QueuedMessageCard -} from '../../../src/shared/agent-session/view/structured-agent-session-queued-cards' +} from '../../../../../src/shared/agent-session/view/structured-agent-session-queued-cards' // The shared projection decides each card's hold; this layer words it for the phone. export type MobileQueuedMessageCard = QueuedMessageCard & { diff --git a/mobile/src/session/use-mobile-background-task-stops.ts b/mobile/src/session/native-chat/input/use-mobile-background-task-stops.ts similarity index 97% rename from mobile/src/session/use-mobile-background-task-stops.ts rename to mobile/src/session/native-chat/input/use-mobile-background-task-stops.ts index 7f70d3c67d3..f9031d89e2b 100644 --- a/mobile/src/session/use-mobile-background-task-stops.ts +++ b/mobile/src/session/native-chat/input/use-mobile-background-task-stops.ts @@ -2,7 +2,7 @@ import { useRef, useState } from 'react' import { structuredSessionConfirmedStopsStillListed, structuredSessionListedTaskRun -} from '../../../src/shared/structured-session-background-tasks-view' +} from '../../../../../src/shared/structured-session-background-tasks-view' import type { MobileStructuredBackgroundTasks } from './use-mobile-structured-background-tasks' export type MobileBackgroundTaskStopping = { taskIds: ReadonlySet; all: boolean } diff --git a/mobile/src/session/use-mobile-bridge-chat-prompt-writes.ts b/mobile/src/session/native-chat/input/use-mobile-bridge-chat-prompt-writes.ts similarity index 74% rename from mobile/src/session/use-mobile-bridge-chat-prompt-writes.ts rename to mobile/src/session/native-chat/input/use-mobile-bridge-chat-prompt-writes.ts index 07739f5ef3e..d2d918cc4f8 100644 --- a/mobile/src/session/use-mobile-bridge-chat-prompt-writes.ts +++ b/mobile/src/session/native-chat/input/use-mobile-bridge-chat-prompt-writes.ts @@ -1,10 +1,10 @@ import type { MutableRefObject } from 'react' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import { useMobileNativeChatPermissionSend } from './native-chat/input/mobile-native-chat-permission-send' -import { useMobileNativeChatAnswerSend } from './native-chat/input/use-mobile-native-chat-answer-send' -import { useMobileNativeChatCancelAsk } from './native-chat/input/use-mobile-native-chat-cancel-ask' -import { useMobileNativeChatStop } from './native-chat/use-mobile-native-chat-stop' -import type { MobileNativeChatAnswerSend } from './native-chat/input/use-mobile-native-chat-answer-send' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import { useMobileNativeChatPermissionSend } from './mobile-native-chat-permission-send' +import { useMobileNativeChatAnswerSend } from './use-mobile-native-chat-answer-send' +import { useMobileNativeChatCancelAsk } from './use-mobile-native-chat-cancel-ask' +import { useMobileNativeChatStop } from '../composer/use-mobile-native-chat-stop' +import type { MobileNativeChatAnswerSend } from './use-mobile-native-chat-answer-send' // Share the bridge write gate and cancel pending answer groups before interrupting; structured prompts use RPC instead. export function useMobileBridgeChatPromptWrites(args: { diff --git a/mobile/src/session/use-mobile-host-model-catalog-upgrade.ts b/mobile/src/session/native-chat/input/use-mobile-host-model-catalog-upgrade.ts similarity index 87% rename from mobile/src/session/use-mobile-host-model-catalog-upgrade.ts rename to mobile/src/session/native-chat/input/use-mobile-host-model-catalog-upgrade.ts index abb401f3d43..8075148cddf 100644 --- a/mobile/src/session/use-mobile-host-model-catalog-upgrade.ts +++ b/mobile/src/session/native-chat/input/use-mobile-host-model-catalog-upgrade.ts @@ -1,16 +1,16 @@ import { useCallback, useEffect, useRef, useState, type MutableRefObject } from 'react' -import type { AgentSessionModelCatalogResult } from '../../../src/shared/agent-session/agent-session-wire' -import type { AgentSessionOptionCatalog } from '../../../src/shared/agent-session/options/agent-session-option-catalog-types' -import type { StructuredAgentSessionOptionRecord } from '../../../src/shared/agent-session/options/structured-agent-session-option-state' -import type { StructuredAgentSessionOptionState } from '../../../src/shared/agent-session/options/structured-agent-session-options' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +import type { AgentSessionModelCatalogResult } from '../../../../../src/shared/agent-session/agent-session-wire' +import type { AgentSessionOptionCatalog } from '../../../../../src/shared/agent-session/options/agent-session-option-catalog-types' +import type { StructuredAgentSessionOptionRecord } from '../../../../../src/shared/agent-session/options/structured-agent-session-option-state' +import type { StructuredAgentSessionOptionState } from '../../../../../src/shared/agent-session/options/structured-agent-session-options' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import { isHostModelListingWaitInFlight, joinHostModelListingWait -} from '../../../src/shared/host-model-listing-waits' -import { callAgentSession } from './mobile-structured-agent-session-rpc' -import { usesModelSpecificAcpEfforts } from '../../../src/shared/agent-session/options/agent-model-catalog-ownership' -import type { HostModelCatalogLaunch } from '../../../src/shared/agent-session/options/host-model-catalog-snapshot-rules' +} from '../../../../../src/shared/host-model-listing-waits' +import { callAgentSession } from '../agent-session/mobile-structured-agent-session-rpc' +import { usesModelSpecificAcpEfforts } from '../../../../../src/shared/agent-session/options/agent-model-catalog-ownership' +import type { HostModelCatalogLaunch } from '../../../../../src/shared/agent-session/options/host-model-catalog-snapshot-rules' /** This world's last host lists for one chat's agent (`useHostModelCatalogCache`). A port, so this hook's * module graph stays free of the query layer for the root-only tests that bundle it. */ diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.ts index b5ba3e86b04..c14ccdac4fd 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.ts @@ -8,16 +8,16 @@ import { import type { AskAnswerSelection } from '../../../../../src/shared/native-chat/input/native-chat-ask-answer' import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' -import { MOBILE_NATIVE_CHAT_QUESTION_STEP_MS } from './mobile-native-chat-answer-stepping' +import { NATIVE_CHAT_QUESTION_STEP_MS } from '../../../../../src/shared/native-chat/input/native-chat-answer-stepping' import { openMobileNativeChatSendBudget, sendMobileNativeChatMessageWithOutcome -} from '../mobile-native-chat-send' -import { healMobileNativeChatStaleInput } from '../mobile-native-chat-stale-input' +} from '../composer/mobile-native-chat-send' +import { healMobileNativeChatStaleInput } from '../composer/mobile-native-chat-stale-input' import { acquireMobileNativeChatTerminalWrite, releaseMobileNativeChatTerminalWrite -} from '../mobile-native-chat-terminal-write-lock' +} from '../composer/mobile-native-chat-terminal-write-lock' import { nativeChatAskRequiresTerminal, resolveNativeChatTranscriptAgent, @@ -229,11 +229,11 @@ export function useMobileNativeChatAnswerSend(args: { return fail() } if (index < groups.length - 1) { - if (!(await wait(MOBILE_NATIVE_CHAT_QUESTION_STEP_MS))) { + if (!(await wait(NATIVE_CHAT_QUESTION_STEP_MS))) { return false } // Pacing is deliberate, not transport latency — don't charge it to the budget. - deadline += MOBILE_NATIVE_CHAT_QUESTION_STEP_MS + deadline += NATIVE_CHAT_QUESTION_STEP_MS } } return groups.length > 0 && writeTurnsRef.current.get(handle) === turn diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-cancel-ask.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-cancel-ask.ts index ea463e43a4e..64edb4f80de 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-cancel-ask.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-cancel-ask.ts @@ -1,7 +1,7 @@ import { useCallback, type MutableRefObject } from 'react' import { nativeChatAskRequiresTerminal } from '../../../../../src/shared/native-chat/native-chat-agent-support' import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' -import { sendMobileNativeChatMessageWithOutcome } from '../mobile-native-chat-send' +import { sendMobileNativeChatMessageWithOutcome } from '../composer/mobile-native-chat-send' export function useMobileNativeChatCancelAsk(args: { client: RpcClient | null diff --git a/mobile/src/session/use-mobile-native-chat-model-discovery.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-model-discovery.ts similarity index 86% rename from mobile/src/session/use-mobile-native-chat-model-discovery.ts rename to mobile/src/session/native-chat/input/use-mobile-native-chat-model-discovery.ts index 4eb3bd930b6..fbdcb937d30 100644 --- a/mobile/src/session/use-mobile-native-chat-model-discovery.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-model-discovery.ts @@ -1,12 +1,12 @@ import { useEffect, useState } from 'react' import * as z from 'zod' -import { getAgentSessionOptionCatalog } from '../../../src/shared/agent-session/options/agent-session-option-catalog' -import type { CatalogModel } from '../../../src/shared/agent-session/options/agent-session-option-catalog-types' +import { getAgentSessionOptionCatalog } from '../../../../../src/shared/agent-session/options/agent-session-option-catalog' +import type { CatalogModel } from '../../../../../src/shared/agent-session/options/agent-session-option-catalog-types' import { catalogModelsFromModelDiscovery, mergeDiscoveredCatalogModels -} from '../../../src/shared/native-chat/input/native-chat-discovered-catalog-models' -import { defineRpcOperation, runRpcOperation } from '../transport/rpc/rpc-operation' +} from '../../../../../src/shared/native-chat/input/native-chat-discovered-catalog-models' +import { defineRpcOperation, runRpcOperation } from '../../../transport/rpc/rpc-operation' const discoveredModel = z.object({ id: z.string().min(1), diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-prompt-cards.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-prompt-cards.ts index 77342854952..1a1e15afdb8 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-prompt-cards.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-prompt-cards.ts @@ -1,6 +1,6 @@ import type { MobileNativeChatController } from '../mobile-native-chat-controller-contract' -import type { useMobileStructuredAgentSession } from '../../use-mobile-structured-agent-session' -import { useNativeChatAcceptedAction } from '../../use-native-chat-action-outcomes' +import type { useMobileStructuredAgentSession } from '../agent-session/use-mobile-structured-agent-session' +import { useNativeChatAcceptedAction } from './use-native-chat-action-outcomes' import { useMobileNativeChatPromptPresentation } from './use-mobile-native-chat-prompt-presentation' export function useMobileNativeChatPromptCards({ diff --git a/mobile/src/session/use-mobile-native-chat-prompt-controller.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-prompt-controller.ts similarity index 81% rename from mobile/src/session/use-mobile-native-chat-prompt-controller.ts rename to mobile/src/session/native-chat/input/use-mobile-native-chat-prompt-controller.ts index 27590badf9f..9d4b146565c 100644 --- a/mobile/src/session/use-mobile-native-chat-prompt-controller.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-prompt-controller.ts @@ -1,14 +1,14 @@ -import { useMobileAsyncQuestionHides } from './native-chat/input/use-mobile-native-chat-prompt-dismiss' -import type { AskPrompt } from '../../../src/shared/native-chat/input/native-chat-ask-types' -import type { AskAnswerSelection } from '../../../src/shared/native-chat/input/native-chat-ask-answer' -import type { AgentStatusEntry } from '../../../src/shared/agent-status/contracts/agent-status-types' -import type { MobileNativeChatController } from './native-chat/mobile-native-chat-controller-contract' +import { useMobileAsyncQuestionHides } from './use-mobile-native-chat-prompt-dismiss' +import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' +import type { AskAnswerSelection } from '../../../../../src/shared/native-chat/input/native-chat-ask-answer' +import type { AgentStatusEntry } from '../../../../../src/shared/agent-status/contracts/agent-status-types' +import type { MobileNativeChatController } from '../mobile-native-chat-controller-contract' import type { useMobileBridgeChatPromptWrites } from './use-mobile-bridge-chat-prompt-writes' -import { useMobileNativeChatAskDismiss } from './native-chat/input/use-mobile-native-chat-ask-dismiss' -import { useMobileNativeChatPromptCards } from './native-chat/input/use-mobile-native-chat-prompt-cards' -import { useMobileNativeChatPrompts } from './native-chat/input/use-mobile-native-chat-prompts' -import type { useMobileNativeChatSession } from './native-chat/use-mobile-native-chat-session' -import type { useMobileStructuredAgentSession } from './use-mobile-structured-agent-session' +import { useMobileNativeChatAskDismiss } from './use-mobile-native-chat-ask-dismiss' +import { useMobileNativeChatPromptCards } from './use-mobile-native-chat-prompt-cards' +import { useMobileNativeChatPrompts } from './use-mobile-native-chat-prompts' +import type { useMobileNativeChatSession } from '../use-mobile-native-chat-session' +import type { useMobileStructuredAgentSession } from '../agent-session/use-mobile-structured-agent-session' import { useNativeChatAcceptedAction } from './use-native-chat-action-outcomes' // Read the chat's ask and permission/question prompts and route their answers to the active lane. diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-prompts.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-prompts.ts index 06d37d90677..309e699626d 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-prompts.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-prompts.ts @@ -14,7 +14,7 @@ import type { NativeChatMessage } from '../../../../../src/shared/native-chat/na import { useMobileStructuredAsyncQuestion, type MobileStructuredAskSession -} from '../../use-mobile-structured-async-question' +} from './use-mobile-structured-async-question' export type MobileNativeChatPrompts = { /** A terminal chat's approval; a structured chat's journal prompts are its own cards. */ diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-queued-edit-focus.test.tsx b/mobile/src/session/native-chat/input/use-mobile-native-chat-queued-edit-focus.test.tsx deleted file mode 100644 index 2afa78903dc..00000000000 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-queued-edit-focus.test.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { useMobileNativeChatQueuedEditFocus } from './use-mobile-native-chat-queued-edit-focus' -import type { MobileQueuedMessageEdit } from '../../use-mobile-structured-queued-message-controls' - -type Focus = ReturnType - -describe('useMobileNativeChatQueuedEditFocus', () => { - let renderer: ReactTestRenderer | null = null - let latest: Focus | null = null - - function Harness({ onEdit }: { onEdit?: MobileQueuedMessageEdit }): null { - latest = useMobileNativeChatQueuedEditFocus(onEdit) - return null - } - - beforeEach(() => { - vi.stubGlobal('requestAnimationFrame', (callback: FrameRequestCallback) => - setTimeout(() => callback(0), 0) - ) - }) - - afterEach(() => { - act(() => renderer?.unmount()) - renderer = null - latest = null - vi.unstubAllGlobals() - }) - - it('focuses the composer after Edit copies a queued message into it', async () => { - const onEdit = vi.fn(async (_messageId, onCopied) => { - onCopied?.() - return false - }) - await act(async () => { - renderer = create(createElement(Harness, { onEdit })) - }) - const focus = vi.fn() - const inputRef: { current: unknown } = latest!.composerInputRef - inputRef.current = { focus } - let edited: boolean | undefined - await act(async () => { - edited = await latest!.editQueuedMessage!('queued-1') - await new Promise((resolve) => setTimeout(resolve, 0)) - }) - expect(onEdit).toHaveBeenCalledWith('queued-1', expect.any(Function)) - // A failed Delete still leaves the copied text in the composer, so focus regardless. - expect(focus).toHaveBeenCalledTimes(1) - expect(edited).toBe(false) - }) - - it('leaves focus alone when Edit copied nothing', async () => { - const onEdit = vi.fn(async () => false) - await act(async () => { - renderer = create(createElement(Harness, { onEdit })) - }) - const focus = vi.fn() - const inputRef: { current: unknown } = latest!.composerInputRef - inputRef.current = { focus } - await act(async () => { - await latest!.editQueuedMessage!('queued-1') - await new Promise((resolve) => setTimeout(resolve, 0)) - }) - expect(focus).not.toHaveBeenCalled() - }) -}) diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-queued-edit-focus.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-queued-edit-focus.ts index 730c71eeb63..79777e6a83e 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-queued-edit-focus.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-queued-edit-focus.ts @@ -1,6 +1,6 @@ import { useMemo, useRef, type RefObject } from 'react' import type { TextInput } from 'react-native' -import type { MobileQueuedMessageEdit } from '../../use-mobile-structured-queued-message-controls' +import type { MobileQueuedMessageEdit } from './use-mobile-structured-queued-message-controls' // Focus after a queued Edit actually copies text; empty copies preserve current focus. export function useMobileNativeChatQueuedEditFocus(onEdit: MobileQueuedMessageEdit | undefined): { diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-session-option-controller.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-session-option-controller.ts index 66d2403ae64..fc87fe07d76 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-session-option-controller.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-session-option-controller.ts @@ -1,5 +1,5 @@ import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' -import { useMobileNativeChatModelDiscovery } from '../../use-mobile-native-chat-model-discovery' +import { useMobileNativeChatModelDiscovery } from './use-mobile-native-chat-model-discovery' import { writeMobileNativeChatSessionOptions } from './mobile-native-chat-session-option-persistence' import { getAgentSessionOptionCatalog } from '../../../../../src/shared/agent-session/options/agent-session-option-catalog' import type { AgentSessionOptionCatalog } from '../../../../../src/shared/agent-session/options/agent-session-option-catalog-types' @@ -12,7 +12,7 @@ import type { SessionOptionsSurface } from '../../../../../src/shared/native-chat/input/native-chat-session-options' import { mobileNativeChatScopeKey } from '../mobile-native-chat-scope-key' -import type { MobileNativeChatSendOutcome } from '../mobile-native-chat-send' +import type { MobileNativeChatSendOutcome } from '../composer/mobile-native-chat-send' import type { MobileNativeChatSessionOptionPickersProps } from './MobileNativeChatSessionOptionPickers' import { useMobileNativeChatSessionOptions, diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-session-options.test.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-session-options.test.ts index 6a856612617..94978c32671 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-session-options.test.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-session-options.test.ts @@ -1,18 +1,10 @@ +import { randomUUID } from 'node:crypto' import { createElement } from 'react' import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { MobileNativeChatSendOutcome } from '../mobile-native-chat-send' +import type { MobileNativeChatSendOutcome } from '../composer/mobile-native-chat-send' + import { - applyNativeChatSessionOptionSettingsMutation, - resolveNativeChatSessionOptionDefaults -} from '../../../../../src/shared/native-chat/input/native-chat-session-option-defaults' -import { resolveAgentSessionOptionLaunch } from '../../../../../src/shared/agent-session/options/agent-session-option-launch' -import type { - PersistedNativeChatSessionOptions, - NativeChatSessionOptionSettingsMutation -} from '../../../../../src/shared/native-chat/input/native-chat-session-options' -import { - clearMobileSessionOptionRecordsForTests, useMobileNativeChatSessionOptions, type MobileNativeChatSessionOptionsController } from './use-mobile-native-chat-session-options' @@ -23,6 +15,8 @@ describe('useMobileNativeChatSessionOptions', () => { let renderer: ReactTestRenderer | null = null let api: MobileNativeChatSessionOptionsController | null = null let hookArgs: HookArgs + let hostId: string + const scopeKey = (tabId: string): string => `${hostId}\0worktree\0${tabId}` const dispatchCommand = vi.fn() const onAgentPicker = vi.fn() @@ -34,7 +28,7 @@ describe('useMobileNativeChatSessionOptions', () => { const mount = (overrides: Partial = {}): void => { hookArgs = { agent: 'claude', - scopeKey: 'host\0worktree\0tab', + scopeKey: scopeKey('tab'), reportedModel: null, dispatchCommand, onAgentPicker, @@ -53,7 +47,7 @@ describe('useMobileNativeChatSessionOptions', () => { } beforeEach(() => { - clearMobileSessionOptionRecordsForTests() + hostId = `mobile-session-options-test-${randomUUID()}` dispatchCommand.mockReset() dispatchCommand.mockResolvedValue('accepted') onAgentPicker.mockReset() @@ -66,55 +60,6 @@ describe('useMobileNativeChatSessionOptions', () => { api = null }) - it.each([ - ['grok', true], - ['grok', false], - ['omp', true], - ['omp', false] - ] as const)( - '%s discovery cached=%s writes only an explicit owning-host pick', - async (agent, cached) => { - let persisted: PersistedNativeChatSessionOptions = { [agent]: { model: 'retired' } } - const writeOwner = vi.fn((mutation: NativeChatSessionOptionSettingsMutation) => { - persisted = applyNativeChatSessionOptionSettingsMutation(persisted, mutation) ?? persisted - }) - const writeOther = vi.fn() - const model = agent === 'grok' ? 'grok-4.7' : 'deepseek/deepseek-v4-pro' - const discoveredModels = [{ id: model, label: model, options: [] }] - mount({ - agent, - scopeKey: 'owner\0worktree\0tab', - reportedModel: 'retired', - modelSwitchCommand: 'orca-model', - writeSettings: writeOwner, - discoveredModels: cached ? discoveredModels : null - }) - if (!cached) { - update({ discoveredModels }) - } - expect(writeOwner).not.toHaveBeenCalled() - expect( - resolveAgentSessionOptionLaunch( - agent, - resolveNativeChatSessionOptionDefaults(persisted, agent) - ).args - ).toContain('retired') - await act(async () => { - expect(await api!.setOption('model', model)).toBe(true) - }) - expect(writeOwner).toHaveBeenCalledOnce() - expect( - resolveAgentSessionOptionLaunch( - agent, - resolveNativeChatSessionOptionDefaults(persisted, agent) - ).args - ).toContain(model) - update({ scopeKey: 'other\0worktree\0tab', writeSettings: writeOther }) - expect(writeOwner).toHaveBeenCalledOnce() - expect(writeOther).not.toHaveBeenCalled() - } - ) - it('starts over when the tab runs another agent and then a fresh session', async () => { mount({ reportedModel: 'claude-sonnet-5' }) await act(async () => { @@ -164,8 +109,8 @@ describe('useMobileNativeChatSessionOptions', () => { picked = api!.setOption('model', 'opus') await Promise.resolve() }) - update({ scopeKey: 'host\0worktree\0other-tab' }) - update({ scopeKey: 'host\0worktree\0tab' }) + update({ scopeKey: scopeKey('other-tab') }) + update({ scopeKey: scopeKey('tab') }) await act(async () => { resolveModel('accepted') await picked @@ -200,8 +145,8 @@ describe('useMobileNativeChatSessionOptions', () => { }) expect(api!.snapshot[0]!.kind).toMatchObject({ currentValue: 'opus' }) // Re-entering repeats session-start evidence that predates later user picks. - update({ scopeKey: 'host\0worktree\0other' }) - update({ scopeKey: 'host\0worktree\0tab' }) + update({ scopeKey: scopeKey('other') }) + update({ scopeKey: scopeKey('tab') }) expect(api!.snapshot[0]).toMatchObject({ valueSource: 'dispatched' }) expect(api!.snapshot[0]!.kind).toMatchObject({ currentValue: 'opus' }) }) @@ -213,8 +158,8 @@ describe('useMobileNativeChatSessionOptions', () => { }) // Repeatedly touch the live tab while exceeding capacity so insertion-order eviction would lose it. for (let index = 0; index < 40; index += 1) { - update({ scopeKey: `host\0worktree\0overflow-${index}` }) - update({ scopeKey: 'host\0worktree\0tab' }) + update({ scopeKey: scopeKey(`overflow-${index}`) }) + update({ scopeKey: scopeKey('tab') }) } expect(api!.snapshot[0]).toMatchObject({ valueSource: 'dispatched' }) expect(api!.snapshot[0]!.kind).toMatchObject({ currentValue: 'opus' }) @@ -266,7 +211,7 @@ describe('useMobileNativeChatSessionOptions', () => { queued = api!.setOption('model', 'opus') await Promise.resolve() }) - update({ scopeKey: 'host\0worktree\0other-tab' }) + update({ scopeKey: scopeKey('other-tab') }) await act(async () => { resolveFirst('accepted') await first diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-session-options.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-session-options.ts index 0158d5b3fc8..f5351f62cfa 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-session-options.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-session-options.ts @@ -19,13 +19,12 @@ import type { SessionOptionDescriptor, SessionOptionValue } from '../../../../../src/shared/native-chat/input/native-chat-session-options' -import type { MobileNativeChatSendOutcome } from '../mobile-native-chat-send' +import type { MobileNativeChatSendOutcome } from '../composer/mobile-native-chat-send' import { createNativeChatPtySessionOptions, type NativeChatPtySessionOptionsSurface } from '../../../../../src/shared/native-chat/input/native-chat-pty-session-options' import { - clearNativeChatSessionOptionCacheForTests, readNativeChatSessionOptionCache, writeNativeChatSessionOptionCache } from '../../../../../src/shared/native-chat/input/native-chat-session-option-cache' @@ -84,11 +83,6 @@ const getEmptySnapshot = (): SessionOptionDescriptor[] => EMPTY_SNAPSHOT // Kept across remounts: a repeated hook model is not fresh evidence, and reapplying it would revert a newer pick. const appliedReportByScope = new Map() -export function clearMobileSessionOptionRecordsForTests(): void { - clearNativeChatSessionOptionCacheForTests() - appliedReportByScope.clear() -} - /** A tab that runs another agent starts over: a new session there carries none of the old one's picks. */ function startScopeOverForAgent(scopeKey: string, agent: string): void { const cachedAgent = readNativeChatSessionOptionCache(scopeKey)?.agent diff --git a/mobile/src/session/use-mobile-queued-message-composer-actions.ts b/mobile/src/session/native-chat/input/use-mobile-queued-message-composer-actions.ts similarity index 91% rename from mobile/src/session/use-mobile-queued-message-composer-actions.ts rename to mobile/src/session/native-chat/input/use-mobile-queued-message-composer-actions.ts index ac28c9ed593..482e2cb4b70 100644 --- a/mobile/src/session/use-mobile-queued-message-composer-actions.ts +++ b/mobile/src/session/native-chat/input/use-mobile-queued-message-composer-actions.ts @@ -2,9 +2,9 @@ import { useCallback, useLayoutEffect, useRef, useState } from 'react' import type { AgentSessionQueuedMessage, AgentSessionQueuedMessageMoveResult -} from '../../../src/shared/agent-session/requests/agent-session-queued-message-wire' -import type { DragReorderMove } from '../components/drag-reorder-positions' -import type { MobileStructuredAgentMutate } from './use-mobile-structured-agent-mutation' +} from '../../../../../src/shared/agent-session/requests/agent-session-queued-message-wire' +import type { DragReorderMove } from '../../../components/drag-reorder-positions' +import type { MobileStructuredAgentMutate } from '../agent-session/use-mobile-structured-agent-mutation' type QueuedMessages = readonly AgentSessionQueuedMessage[] | null | undefined diff --git a/mobile/src/session/use-mobile-structured-agent-options.before-attach.test.ts b/mobile/src/session/native-chat/input/use-mobile-structured-agent-options.before-attach.test.ts similarity index 91% rename from mobile/src/session/use-mobile-structured-agent-options.before-attach.test.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-agent-options.before-attach.test.ts index 92b9d7c8fc0..83752c125af 100644 --- a/mobile/src/session/use-mobile-structured-agent-options.before-attach.test.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-agent-options.before-attach.test.ts @@ -1,7 +1,7 @@ import { act } from 'react-test-renderer' import { describe, expect, it, vi } from 'vitest' -import type { AgentSessionOptionResult } from '../../../src/shared/agent-session/agent-session-wire' -import type { StructuredAgentSessionMutationResult } from './mobile-structured-agent-session-rpc' +import type { AgentSessionOptionResult } from '../../../../../src/shared/agent-session/agent-session-wire' +import type { StructuredAgentSessionMutationResult } from '../agent-session/mobile-structured-agent-session-rpc' import { OPTIONS, deferred, diff --git a/mobile/src/session/use-mobile-structured-agent-options.test-fixture.ts b/mobile/src/session/native-chat/input/use-mobile-structured-agent-options.test-fixture.ts similarity index 92% rename from mobile/src/session/use-mobile-structured-agent-options.test-fixture.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-agent-options.test-fixture.ts index 936278b71b4..a679f3e3884 100644 --- a/mobile/src/session/use-mobile-structured-agent-options.test-fixture.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-agent-options.test-fixture.ts @@ -1,18 +1,18 @@ import { createElement, useLayoutEffect } from 'react' import { act, type ReactTestRenderer } from 'react-test-renderer' -import { createWithQueryClient } from '../test-support/query-client-test-renderer' +import { createWithQueryClient } from '../../../test-support/query-client-test-renderer' import { vi } from 'vitest' import type { AgentSessionModelCatalogResult, AgentSessionOptionResult -} from '../../../src/shared/agent-session/agent-session-wire' -import type { AgentSessionOptionsResult } from '../../../src/shared/agent-session/options/agent-session-options-result' -import type { SessionOptionDescriptor } from '../../../src/shared/native-chat/input/native-chat-session-options' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +} from '../../../../../src/shared/agent-session/agent-session-wire' +import type { AgentSessionOptionsResult } from '../../../../../src/shared/agent-session/options/agent-session-options-result' +import type { SessionOptionDescriptor } from '../../../../../src/shared/native-chat/input/native-chat-session-options' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import type { StructuredAgentSessionMutate, StructuredAgentSessionMutationResult -} from './mobile-structured-agent-session-rpc' +} from '../agent-session/mobile-structured-agent-session-rpc' import { useMobileStructuredAgentOptions } from './use-mobile-structured-agent-options' const OPTIONS: AgentSessionOptionsResult = { diff --git a/mobile/src/session/use-mobile-structured-agent-options.test.ts b/mobile/src/session/native-chat/input/use-mobile-structured-agent-options.test.ts similarity index 65% rename from mobile/src/session/use-mobile-structured-agent-options.test.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-agent-options.test.ts index 6cc5bdc886b..7c813e1409e 100644 --- a/mobile/src/session/use-mobile-structured-agent-options.test.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-agent-options.test.ts @@ -1,16 +1,15 @@ -import { structuredAgentSessionOptionStamp } from '../../../src/shared/agent-session/options/structured-agent-session-option-state' +import { structuredAgentSessionOptionStamp } from '../../../../../src/shared/agent-session/options/structured-agent-session-option-state' import { act } from 'react-test-renderer' import { describe, expect, it, vi } from 'vitest' import type { AgentSessionModelCatalogResult, AgentSessionOptionResult -} from '../../../src/shared/agent-session/agent-session-wire' -import type { AgentSessionOptionsResult } from '../../../src/shared/agent-session/options/agent-session-options-result' -import type { StructuredAgentSessionMutationResult } from './mobile-structured-agent-session-rpc' -import { rememberMobileCreatedStructuredSession } from './mobile-created-structured-sessions' +} from '../../../../../src/shared/agent-session/agent-session-wire' +import type { AgentSessionOptionsResult } from '../../../../../src/shared/agent-session/options/agent-session-options-result' +import type { StructuredAgentSessionMutationResult } from '../agent-session/mobile-structured-agent-session-rpc' +import { rememberMobileCreatedStructuredSession } from '../agent-session/mobile-created-structured-sessions' import { - type Controller, settle, OPTIONS, FAST_OPTIONS, @@ -26,48 +25,6 @@ import { BASE } from './use-mobile-structured-agent-options.test-fixture' -describe('useMobileStructuredAgentOptions generation fencing', () => { - it('drops an options read a later write superseded', async () => { - const stale = deferred() - const first = optionsClient(queuedReads(FAST_OPTIONS)) - // Reconnect replaces the client without staling the retained record; generation must fence its prior read. - let reads = 0 - const reconnected = optionsClient(() => - reads++ === 0 - ? stale.promise - : Promise.resolve({ - ...FAST_OPTIONS, - current: { ...FAST_OPTIONS.current, model: 'gpt-fast' } - }) - ) - const { mutate } = recordingMutate(async () => - accepted({ key: 'model', value: 'gpt-fast', options: { model: 'gpt-fast' } }, true) - ) - const harness = await mountOptions({ ...BASE, client: first.client, mutate }) - - expect(currentValueOf(harness.current().optionSnapshot, 'model')).toBe('gpt-live') - await harness.rerender({ client: reconnected.client }) - expect(reconnected.optionReads()).toBe(1) - - let outcome: boolean | null = null - await act(async () => { - outcome = await harness.current().setStructuredOption('model', 'gpt-fast') - }) - await settle() - expect(outcome).toBe(true) - expect(currentValueOf(harness.current().optionSnapshot, 'model')).toBe('gpt-fast') - - await act(async () => { - stale.resolve({ ...FAST_OPTIONS, conversationCommands: ['compact'] }) - }) - await settle() - - expect(currentValueOf(harness.current().optionSnapshot, 'model')).toBe('gpt-fast') - expect(harness.current().conversationCommands).toEqual([]) - await harness.unmount() - }) -}) - describe('useMobileStructuredAgentOptions images', () => { it('keeps the answer through a pick made during the read', async () => { const stale = deferred() @@ -246,79 +203,6 @@ describe('useMobileStructuredAgentOptions host catalog', () => { }) }) -describe('useMobileStructuredAgentOptions after a lost pick reply', () => { - const tiers = (value: string, label: string) => [{ value, label }] - const answer = (model: string, serviceTier: string): AgentSessionOptionsResult => ({ - models: [ - { - id: 'm1', - label: 'M1', - isDefault: true, - efforts: [], - serviceTiers: tiers('priority', 'Fast') - }, - { id: 'm2', label: 'M2', isDefault: false, efforts: [], serviceTiers: tiers('flex', 'Flex') } - ], - listedModelIds: ['m1', 'm2'], - current: { model, serviceTier, confirmed: ['model'] } - }) - const speed = (controller: Controller) => { - const kind = descriptorFor(controller.optionSnapshot, 'serviceTier')?.kind - return kind?.type === 'select' - ? { value: kind.currentValue, choices: kind.choices.map((choice) => choice.value) } - : null - } - - it('draws the tier the host reconciled to, stays usable through a failed read, and takes the reconnect read', async () => { - const pendingRead = deferred() - const reads = [ - () => Promise.resolve(answer('m1', 'priority')), - () => Promise.reject(new Error('terminal reconciliation offline')), - () => Promise.reject(new Error('status reconciliation offline')), - () => pendingRead.promise, - () => Promise.resolve(answer('m2', 'flex')) - ] - const client = optionsClient(() => - (reads.shift() ?? (() => Promise.resolve(answer('m2', 'flex'))))() - ) - const { mutate } = recordingMutate(async () => ({ status: 'unknown' })) - const harness = await mountOptions({ ...BASE, client: client.client, mutate }) - expect(speed(harness.current())?.value).toBe('priority') - - // The host switched and set Standard, but its reply never arrived. - await act(async () => { - await harness.current().setStructuredOption('model', 'm2') - }) - expect(currentValueOf(harness.current().optionSnapshot, 'model')).toBe('m2') - expect(speed(harness.current())).toEqual({ value: 'default', choices: ['default', 'flex'] }) - expect(harness.current().pendingOptionId).toBeNull() - - expect(client.optionReads()).toBe(2) // The terminal wake consumed its failed query. - // The status-triggered read fails independently: nothing changes. - await harness.rerender({ optionStamp: 'status-1' }) - expect(speed(harness.current())?.value).toBe('default') - - // A read in flight when the user picks Flex answers for the old state and is dropped. - await harness.rerender({ optionStamp: 'status-2' }) - let picked = false - await act(async () => { - picked = await harness.current().setStructuredOption('serviceTier', 'flex') - }) - expect(picked).toBe(true) - await act(async () => pendingRead.resolve(answer('m1', 'priority'))) - await settle() - expect(currentValueOf(harness.current().optionSnapshot, 'model')).toBe('m2') - expect(speed(harness.current())?.value).toBe('flex') - - // Reconnected, the host's answer stands. - await harness.rerender({ optionStamp: 'status-3' }) - expect(currentValueOf(harness.current().optionSnapshot, 'model')).toBe('m2') - expect(speed(harness.current())?.value).toBe('flex') - expect(client.optionReads()).toBe(6) - await harness.unmount() - }) -}) - it('joins the post-receipt menu read with an unchanged phone option stamp', async () => { const initial: AgentSessionOptionsResult = { models: [{ id: 'family', label: 'Family', isDefault: false, efforts: [], effortsKnown: false }], @@ -485,57 +369,6 @@ it('accepts a typed literal at an attached fence while options refresh with no m await view.unmount() }) -import type { PiRefreshFixtureModule } from '../../../src/shared/agent-session/options/structured-agent-session-option-refresh.test-fixture-contract' -const { piOptionRefreshContract } = await vi.importActual( - '../../../src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-option-refresh.test-fixture' -) - -describe('Pi catalog refresh completion', () => { - piOptionRefreshContract( - async (host) => { - const first = optionsClient( - () => host.options(), - () => host.catalog() - ) - const second = optionsClient( - () => host.options(), - () => host.catalog() - ) - const { mutate } = recordingMutate(async (_call, fields) => { - if (typeof fields.value !== 'string') { - throw new Error('missing effort') - } - return accepted(await host.acceptEffort(fields.value), true) - }) - const harness = await mountOptions({ - ...BASE, - agent: 'pi', - sendSelection: true, - sessionId: host.record.sessionId, - client: first.client, - mutate - }) - return { - snapshot: () => harness.current().optionSnapshot, - capture: () => harness.current().sendSelection().selection, - demand: () => harness.current().optionSurface.demandModelCatalog?.(), - pick: (value) => harness.current().setStructuredOption('effort', value), - replace: async (fence, otherHost) => - harness.rerender({ fence, client: otherHost ? second.client : first.client }), - close: () => harness.unmount() - } - }, - async (work) => { - await act(async () => { - work() - await Promise.resolve() - await Promise.resolve() - }) - await settle() - } - ) -}) - it('refreshes saved planning intent from the same host status stamp without remounting', async () => { let interactionMode: 'default' | 'plan' = 'default' const client = optionsClient(async () => ({ diff --git a/mobile/src/session/use-mobile-structured-agent-options.ts b/mobile/src/session/native-chat/input/use-mobile-structured-agent-options.ts similarity index 87% rename from mobile/src/session/use-mobile-structured-agent-options.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-agent-options.ts index 321ba47ba1a..2fe2c786134 100644 --- a/mobile/src/session/use-mobile-structured-agent-options.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-agent-options.ts @@ -1,31 +1,31 @@ -import type { AgentSessionConversationCommand } from '../../../src/shared/agent-session/agent-session-conversation-command' +import type { AgentSessionConversationCommand } from '../../../../../src/shared/agent-session/agent-session-conversation-command' import { useMobileStructuredOptionState } from './use-mobile-structured-option-state' import { useCallback, useLayoutEffect, useMemo, useRef } from 'react' -import { isAgentSessionHandleProvider } from '../../../src/shared/agent-session/lifecycle/agent-session-provider-handle' -import { structuredAgentSessionSeedCatalog } from '../../../src/shared/agent-session/options/structured-agent-session-seed-catalog' +import { isAgentSessionHandleProvider } from '../../../../../src/shared/agent-session/lifecycle/agent-session-provider-handle' +import { structuredAgentSessionSeedCatalog } from '../../../../../src/shared/agent-session/options/structured-agent-session-seed-catalog' import { structuredAgentSessionOptionView, structuredAgentSessionSendSelection, structuredAgentSessionMessageSelection, structuredAgentSessionShownSnapshot -} from '../../../src/shared/agent-session/options/structured-agent-session-option-view' -import { agentChatPermissionModes } from '../../../src/shared/agent-launch/permissions/agent-chat-permission-support' -import { legacyHostPermissionDescriptor } from '../../../src/shared/agent-session/options/structured-agent-session-permission-option' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import type { StructuredAgentSessionHostSupport } from './mobile-structured-agent-session-host-support' -import type { MobileStructuredAgentMutate } from './use-mobile-structured-agent-mutation' +} from '../../../../../src/shared/agent-session/options/structured-agent-session-option-view' +import { agentChatPermissionModes } from '../../../../../src/shared/agent-launch/permissions/agent-chat-permission-support' +import { legacyHostPermissionDescriptor } from '../../../../../src/shared/agent-session/options/structured-agent-session-permission-option' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import type { StructuredAgentSessionHostSupport } from '../agent-session/mobile-structured-agent-session-host-support' +import type { MobileStructuredAgentMutate } from '../agent-session/use-mobile-structured-agent-mutation' import { useMobileStructuredHeldOptionPicks } from './use-mobile-structured-held-option-picks' import { useMobileHostModelCatalogUpgrade, type HostModelCatalogCache } from './use-mobile-host-model-catalog-upgrade' -import { mobileCreatedStructuredSession } from './mobile-created-structured-sessions' +import { mobileCreatedStructuredSession } from '../agent-session/mobile-created-structured-sessions' import { structuredAgentSessionOptionAvailability, createStructuredAgentSessionOptionsWriteOwner -} from '../../../src/shared/agent-session/options/structured-agent-session-options-write-owner' +} from '../../../../../src/shared/agent-session/options/structured-agent-session-options-write-owner' import { useMobileStructuredOptionSurface } from './use-mobile-structured-option-surface' -import { lockedStructuredAgentSessionOptionSnapshot } from '../../../src/shared/agent-session/options/structured-agent-session-option-snapshot' +import { lockedStructuredAgentSessionOptionSnapshot } from '../../../../../src/shared/agent-session/options/structured-agent-session-option-snapshot' const NO_COMMANDS: readonly AgentSessionConversationCommand[] = [] diff --git a/mobile/src/session/use-mobile-structured-async-question.ts b/mobile/src/session/native-chat/input/use-mobile-structured-async-question.ts similarity index 78% rename from mobile/src/session/use-mobile-structured-async-question.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-async-question.ts index 3ce76cd2aba..19f632ed561 100644 --- a/mobile/src/session/use-mobile-structured-async-question.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-async-question.ts @@ -2,11 +2,11 @@ import { useCallback } from 'react' import { formatAskAnswer, type AskAnswerSelection -} from '../../../src/shared/native-chat/input/native-chat-ask-answer' -import { nativeChatAnswerSendIntent } from '../../../src/shared/native-chat/input/native-chat-follow-up-behavior' -import type { AskPrompt } from '../../../src/shared/native-chat/input/native-chat-ask-types' -import type { QueuedMessageCard } from '../../../src/shared/agent-session/view/structured-agent-session-queued-cards' -import type { useMobileStructuredAgentSession } from './use-mobile-structured-agent-session' +} from '../../../../../src/shared/native-chat/input/native-chat-ask-answer' +import { nativeChatAnswerSendIntent } from '../../../../../src/shared/native-chat/input/native-chat-follow-up-behavior' +import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' +import type { QueuedMessageCard } from '../../../../../src/shared/agent-session/view/structured-agent-session-queued-cards' +import type { useMobileStructuredAgentSession } from '../agent-session/use-mobile-structured-agent-session' export type MobileStructuredAskSession = Pick< ReturnType, diff --git a/mobile/src/session/use-mobile-structured-background-tasks.ts b/mobile/src/session/native-chat/input/use-mobile-structured-background-tasks.ts similarity index 66% rename from mobile/src/session/use-mobile-structured-background-tasks.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-background-tasks.ts index fa81de570ff..3f30e490e0e 100644 --- a/mobile/src/session/use-mobile-structured-background-tasks.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-background-tasks.ts @@ -1,16 +1,16 @@ import { useCallback, useMemo } from 'react' -import type { AgentChildRowContext } from '../../../src/shared/agent-status/presentation/agent-child-row-model' -import type { AgentSessionCancelResult } from '../../../src/shared/agent-session/agent-session-wire' -import { agentChildRowContextForSessionStream } from '../../../src/shared/agent-status/presentation/agent-child-row-stream-context' -import type { StructuredAgentSessionState } from '../../../src/shared/agent-session/structured-agent-session-reducer' +import type { AgentChildRowContext } from '../../../../../src/shared/agent-status/presentation/agent-child-row-model' +import type { AgentSessionCancelResult } from '../../../../../src/shared/agent-session/agent-session-wire' +import { agentChildRowContextForSessionStream } from '../../../../../src/shared/agent-status/presentation/agent-child-row-stream-context' +import type { StructuredAgentSessionState } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' import { structuredSessionBackgroundTasksView, type StructuredSessionBackgroundTasksView -} from '../../../src/shared/structured-session-background-tasks-view' -import { structuredSessionForegroundCommands } from '../../../src/shared/structured-session-foreground-commands' -import type { StructuredAgentSessionMutationResult } from './mobile-structured-agent-session-rpc' -import type { MobileStructuredAgentMutate } from './use-mobile-structured-agent-mutation' -import { mobileStructuredHostClockOffsetMs } from './mobile-structured-host-clock-offset' +} from '../../../../../src/shared/structured-session-background-tasks-view' +import { structuredSessionForegroundCommands } from '../../../../../src/shared/structured-session-foreground-commands' +import type { StructuredAgentSessionMutationResult } from '../agent-session/mobile-structured-agent-session-rpc' +import type { MobileStructuredAgentMutate } from '../agent-session/use-mobile-structured-agent-mutation' +import { mobileStructuredHostClockOffsetMs } from '../agent-session/mobile-structured-host-clock-offset' export type MobileStructuredBackgroundTasks = { // Scope strip expansion and stopping state to the conversation. diff --git a/mobile/src/session/use-mobile-structured-held-option-picks.ts b/mobile/src/session/native-chat/input/use-mobile-structured-held-option-picks.ts similarity index 81% rename from mobile/src/session/use-mobile-structured-held-option-picks.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-held-option-picks.ts index 245fb1c5d08..71ea9355013 100644 --- a/mobile/src/session/use-mobile-structured-held-option-picks.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-held-option-picks.ts @@ -1,16 +1,16 @@ import { useEffect, useLayoutEffect, useRef } from 'react' -import type { AgentSessionOptionResult } from '../../../src/shared/agent-session/agent-session-wire' -import { acceptedStructuredSessionSelectionOutcome } from '../../../src/shared/agent-session/options/structured-agent-session-options-write-owner' -import type { StructuredSessionSelectionController } from '../../../src/shared/agent-session/options/structured-agent-session-selection-operations' -import type { SessionOptionDescriptor } from '../../../src/shared/native-chat/input/native-chat-session-options' +import type { AgentSessionOptionResult } from '../../../../../src/shared/agent-session/agent-session-wire' +import { acceptedStructuredSessionSelectionOutcome } from '../../../../../src/shared/agent-session/options/structured-agent-session-options-write-owner' +import type { StructuredSessionSelectionController } from '../../../../../src/shared/agent-session/options/structured-agent-session-selection-operations' +import type { SessionOptionDescriptor } from '../../../../../src/shared/native-chat/input/native-chat-session-options' import { nativeChatModelPillLabel, nativeChatSessionOptionLabel -} from '../../../src/shared/native-chat/input/native-chat-session-option-labels' -import { translate } from '../i18n/mobile-i18n' -import { mobileSessionOptionSummaryValue } from './native-chat/input/mobile-native-chat-session-option-labels' -import { sayMobileNativeChatSessionOption as say } from './native-chat/input/native-chat-session-option-copy' -import type { MobileStructuredAgentMutate } from './use-mobile-structured-agent-mutation' +} from '../../../../../src/shared/native-chat/input/native-chat-session-option-labels' +import { translate } from '../../../i18n/mobile-i18n' +import { mobileSessionOptionSummaryValue } from './mobile-native-chat-session-option-labels' +import { sayMobileNativeChatSessionOption as say } from './native-chat-session-option-copy' +import type { MobileStructuredAgentMutate } from '../agent-session/use-mobile-structured-agent-mutation' function pickLabel(descriptor: SessionOptionDescriptor | undefined): string | null { if (!descriptor) { diff --git a/mobile/src/session/use-mobile-structured-option-state.ts b/mobile/src/session/native-chat/input/use-mobile-structured-option-state.ts similarity index 85% rename from mobile/src/session/use-mobile-structured-option-state.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-option-state.ts index 2be67786423..095dcb90908 100644 --- a/mobile/src/session/use-mobile-structured-option-state.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-option-state.ts @@ -1,19 +1,19 @@ import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react' -import { mobileStructuredSessionStatusFeed } from './mobile-structured-session-status-feed' -import { projectRuntimePermission } from '../../../src/shared/agent-session/options/structured-agent-session-permission-option' +import { mobileStructuredSessionStatusFeed } from '../agent-session/mobile-structured-session-status-feed' +import { projectRuntimePermission } from '../../../../../src/shared/agent-session/options/structured-agent-session-permission-option' import { useMobileStructuredSelectionController } from './use-mobile-structured-selection-controller' -import type { AgentSessionRewindSupport } from '../../../src/shared/agent-session/lifecycle/agent-session-rewind' -import type { AgentSessionOptionsResult } from '../../../src/shared/agent-session/options/agent-session-options-result' -import { callAgentSession } from './mobile-structured-agent-session-rpc' -import { forgetMobileCreatedStructuredSession } from './mobile-created-structured-sessions' -import { createStructuredAgentSessionOptionsReadOwner } from '../../../src/shared/agent-session/options/structured-agent-session-options-read-owner' -import { BoundedMap } from '../../../src/shared/bounded-map' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import type { AgentSessionOptionCatalog } from '../../../src/shared/agent-session/options/agent-session-option-catalog-types' -import { usesInstalledAgentModelCatalog } from '../../../src/shared/agent-session/options/agent-model-catalog-ownership' -import { structuredAgentSessionFirstFrameOptionState } from '../../../src/shared/agent-session/options/structured-agent-session-first-frame' +import type { AgentSessionRewindSupport } from '../../../../../src/shared/agent-session/lifecycle/agent-session-rewind' +import type { AgentSessionOptionsResult } from '../../../../../src/shared/agent-session/options/agent-session-options-result' +import { callAgentSession } from '../agent-session/mobile-structured-agent-session-rpc' +import { forgetMobileCreatedStructuredSession } from '../agent-session/mobile-created-structured-sessions' +import { createStructuredAgentSessionOptionsReadOwner } from '../../../../../src/shared/agent-session/options/structured-agent-session-options-read-owner' +import { BoundedMap } from '../../../../../src/shared/bounded-map' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import type { AgentSessionOptionCatalog } from '../../../../../src/shared/agent-session/options/agent-session-option-catalog-types' +import { usesInstalledAgentModelCatalog } from '../../../../../src/shared/agent-session/options/agent-model-catalog-ownership' +import { structuredAgentSessionFirstFrameOptionState } from '../../../../../src/shared/agent-session/options/structured-agent-session-first-frame' import type { HostModelCatalogCache } from './use-mobile-host-model-catalog-upgrade' -import { structuredAgentSessionReportsAtFence } from '../../../src/shared/agent-session/options/structured-agent-session-runtime-reports' +import { structuredAgentSessionReportsAtFence } from '../../../../../src/shared/agent-session/options/structured-agent-session-runtime-reports' // Matches the transcripts this view retains per chat. const MAX_RETAINED_CHAT_READERS = 32 diff --git a/mobile/src/session/use-mobile-structured-option-surface.ts b/mobile/src/session/native-chat/input/use-mobile-structured-option-surface.ts similarity index 95% rename from mobile/src/session/use-mobile-structured-option-surface.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-option-surface.ts index d1d96d6d118..4fed7c5eaf8 100644 --- a/mobile/src/session/use-mobile-structured-option-surface.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-option-surface.ts @@ -3,7 +3,7 @@ import type { SessionOptionDescriptor, SessionOptionsSurface, SessionOptionValue -} from '../../../src/shared/native-chat/input/native-chat-session-options' +} from '../../../../../src/shared/native-chat/input/native-chat-session-options' export function useMobileStructuredOptionSurface(args: { admits: NonNullable diff --git a/mobile/src/session/use-mobile-structured-prompt-responses.ts b/mobile/src/session/native-chat/input/use-mobile-structured-prompt-responses.ts similarity index 89% rename from mobile/src/session/use-mobile-structured-prompt-responses.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-prompt-responses.ts index cbc0a1d764f..b80ff2ecbae 100644 --- a/mobile/src/session/use-mobile-structured-prompt-responses.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-prompt-responses.ts @@ -1,14 +1,14 @@ import { useCallback } from 'react' -import type { AgentSessionPromptResult } from '../../../src/shared/agent-session/agent-session-wire' -import type { AgentJournalQuestionItem } from '../../../src/shared/agent-session/journal/agent-session-journal-types' +import type { AgentSessionPromptResult } from '../../../../../src/shared/agent-session/agent-session-wire' +import type { AgentJournalQuestionItem } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' import { AGENT_SESSION_RESPONSE_OPTION_ID_MAX_LENGTH, decodeAgentSessionQuestionAnswers, isValidAgentSessionQuestionAnswers, legacyAgentSessionSelectedOptionId, type AgentSessionQuestionAnswer -} from '../../../src/shared/agent-session/agent-session-question-answer' -import type { StructuredAgentSessionState } from '../../../src/shared/agent-session/structured-agent-session-reducer' +} from '../../../../../src/shared/agent-session/agent-session-question-answer' +import type { StructuredAgentSessionState } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' import { actionableStructuredApproval, actionableStructuredQuestion @@ -20,8 +20,8 @@ import { import type { StructuredAgentSessionMutate, StructuredAgentSessionMutationResult -} from './mobile-structured-agent-session-rpc' -import type { MobileChatQuestion } from './native-chat/input/mobile-native-chat-question' +} from '../agent-session/mobile-structured-agent-session-rpc' +import type { MobileChatQuestion } from './mobile-native-chat-question' export function useMobileStructuredPromptResponses(args: { stateRef: { readonly current: StructuredAgentSessionState } diff --git a/mobile/src/session/use-mobile-structured-queued-edit.ts b/mobile/src/session/native-chat/input/use-mobile-structured-queued-edit.ts similarity index 93% rename from mobile/src/session/use-mobile-structured-queued-edit.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-queued-edit.ts index 200a5608cb8..73db331e222 100644 --- a/mobile/src/session/use-mobile-structured-queued-edit.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-queued-edit.ts @@ -1,4 +1,4 @@ -import type { QueuedEditLeaseLoss } from '../../../src/shared/queued-message-edit-lease' +import type { QueuedEditLeaseLoss } from '../../../../../src/shared/queued-message-edit-lease' import { createMobileQueuedEdit } from './mobile-queued-message-edit-open' import { useCallback, @@ -9,21 +9,21 @@ import { useRef, useState } from 'react' -import type { AgentSessionQueuedMessageUpdateResult } from '../../../src/shared/agent-session/requests/agent-session-queued-message-wire' -import { agentSessionSendBodyFingerprint } from '../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' -import { queuedMessageWithEdit } from '../../../src/shared/queued-message-edit' +import type { AgentSessionQueuedMessageUpdateResult } from '../../../../../src/shared/agent-session/requests/agent-session-queued-message-wire' +import { agentSessionSendBodyFingerprint } from '../../../../../src/shared/agent-session/requests/structured-agent-session-send-mutation' +import { queuedMessageWithEdit } from '../../../../../src/shared/queued-message-edit' import { mobileQueuedEditValueKey, snapshotMobileQueuedEditInputs } from './mobile-queued-message-edit-value' import { settleMobileQueuedEdit } from './mobile-queued-message-edit-outcome' -import { queuedEditPublicationKey } from '../../../src/shared/queued-message-edit-publication' +import { queuedEditPublicationKey } from '../../../../../src/shared/queued-message-edit-publication' import { startMobileQueuedEditLease } from './mobile-queued-message-edit-lease' import { useMobileNativeChatDraftInputs, readMobileNativeChatDraftInputs, mobileNativeChatDraftDestination -} from './native-chat/composer/mobile-native-chat-draft-inputs' +} from '../composer/mobile-native-chat-draft-inputs' import { closeMobileQueuedEditDraft, mobileQueuedEditSaving, @@ -35,7 +35,6 @@ import { type MobileStructuredQueuedEditArgs, type MobileQueuedMessageInlineEditor } from './mobile-queued-message-edit-draft' -export type { MobileQueuedMessageInlineEditor } from './mobile-queued-message-edit-draft' export function useMobileStructuredQueuedEdit(args: MobileStructuredQueuedEditArgs) { const { sessionKey, sessionId, client, mutate, onSendError, onActionResolved } = args diff --git a/mobile/src/session/use-mobile-structured-queued-message-controls.ts b/mobile/src/session/native-chat/input/use-mobile-structured-queued-message-controls.ts similarity index 87% rename from mobile/src/session/use-mobile-structured-queued-message-controls.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-queued-message-controls.ts index 4013522fce1..e4026afd448 100644 --- a/mobile/src/session/use-mobile-structured-queued-message-controls.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-queued-message-controls.ts @@ -1,31 +1,29 @@ -import type { DragReorderMove } from '../components/drag-reorder-positions' +import type { DragReorderMove } from '../../../components/drag-reorder-positions' import { useMobileQueuedMessageComposerActions } from './use-mobile-queued-message-composer-actions' import { useCallback, useMemo } from 'react' -import { useMobileTranslation } from '../i18n/use-mobile-translation' +import { useMobileTranslation } from '../../../i18n/use-mobile-translation' import type { AgentJournalRenderItem, AgentJournalSubmission -} from '../../../src/shared/agent-session/journal/agent-session-journal-types' -import { agentSessionVisibleFailureFacts } from '../../../src/shared/agent-session/failures/agent-session-visible-failures' -import { mapSettledWithConcurrency } from '../../../src/shared/map-with-concurrency' +} from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' +import { agentSessionVisibleFailureFacts } from '../../../../../src/shared/agent-session/failures/agent-session-visible-failures' +import { mapSettledWithConcurrency } from '../../../../../src/shared/map-with-concurrency' import type { AgentSessionQueuedMessage, AgentSessionQueuedMessageDeleteResult, AgentSessionQueuedMessagesResumeResult, AgentSessionQueuePause -} from '../../../src/shared/agent-session/requests/agent-session-queued-message-wire' -import type { AgentSessionSendResult } from '../../../src/shared/agent-session/agent-session-wire' -import { queuedMessagesQueuePause } from '../../../src/shared/agent-session/view/structured-agent-session-queued-cards' +} from '../../../../../src/shared/agent-session/requests/agent-session-queued-message-wire' +import type { AgentSessionSendResult } from '../../../../../src/shared/agent-session/agent-session-wire' +import { queuedMessagesQueuePause } from '../../../../../src/shared/agent-session/view/structured-agent-session-queued-cards' import { mobileQueuedMessageCards, type MobileQueuedMessageCard } from './mobile-structured-queued-message-cards' -import type { MobileStructuredAgentMutate } from './use-mobile-structured-agent-mutation' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import { - useMobileStructuredQueuedEdit, - type MobileQueuedMessageInlineEditor -} from './use-mobile-structured-queued-edit' +import type { MobileStructuredAgentMutate } from '../agent-session/use-mobile-structured-agent-mutation' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import { useMobileStructuredQueuedEdit } from './use-mobile-structured-queued-edit' +import type { MobileQueuedMessageInlineEditor } from './mobile-queued-message-edit-draft' // The host owns queued drafts; render its published cards even when it cannot queue new sends. const CLEAR_DELETE_CONCURRENCY = 8 diff --git a/mobile/src/session/use-mobile-structured-selection-controller.ts b/mobile/src/session/native-chat/input/use-mobile-structured-selection-controller.ts similarity index 85% rename from mobile/src/session/use-mobile-structured-selection-controller.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-selection-controller.ts index f4a53b8aad3..82f26744f1e 100644 --- a/mobile/src/session/use-mobile-structured-selection-controller.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-selection-controller.ts @@ -1,7 +1,7 @@ import { useEffect, useMemo, useSyncExternalStore } from 'react' -import { createStructuredSessionSelectionController } from '../../../src/shared/agent-session/options/structured-agent-session-selection-operations' -import { persistMobileStructuredOptionPicks } from './native-chat/input/mobile-native-chat-session-option-persistence' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +import { createStructuredSessionSelectionController } from '../../../../../src/shared/agent-session/options/structured-agent-session-selection-operations' +import { persistMobileStructuredOptionPicks } from './mobile-native-chat-session-option-persistence' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' /** Temporary operations belong to one phone authority, above its queried host answer. */ export function useMobileStructuredSelectionController(args: { diff --git a/mobile/src/session/use-mobile-structured-session-option-stamp.ts b/mobile/src/session/native-chat/input/use-mobile-structured-session-option-stamp.ts similarity index 73% rename from mobile/src/session/use-mobile-structured-session-option-stamp.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-session-option-stamp.ts index 3e64e9e9198..0dec257c4d6 100644 --- a/mobile/src/session/use-mobile-structured-session-option-stamp.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-session-option-stamp.ts @@ -1,7 +1,7 @@ import { useCallback, useSyncExternalStore } from 'react' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import { structuredAgentSessionOptionStamp } from '../../../src/shared/agent-session/options/structured-agent-session-option-state' -import { mobileStructuredSessionStatusFeed } from './mobile-structured-session-status-feed' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import { structuredAgentSessionOptionStamp } from '../../../../../src/shared/agent-session/options/structured-agent-session-option-state' +import { mobileStructuredSessionStatusFeed } from '../agent-session/mobile-structured-session-status-feed' const noSubscription = (): (() => void) => () => {} diff --git a/mobile/src/session/use-mobile-structured-thread-goal.ts b/mobile/src/session/native-chat/input/use-mobile-structured-thread-goal.ts similarity index 81% rename from mobile/src/session/use-mobile-structured-thread-goal.ts rename to mobile/src/session/native-chat/input/use-mobile-structured-thread-goal.ts index b273b2d9780..a0145274ad1 100644 --- a/mobile/src/session/use-mobile-structured-thread-goal.ts +++ b/mobile/src/session/native-chat/input/use-mobile-structured-thread-goal.ts @@ -2,23 +2,23 @@ import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react' import { AGENT_OWNED_THREAD_GOAL_CLEAR_COMMAND, agentSessionThreadGoalReport -} from '../../../src/shared/agent-session/agent-session-thread-goal-report' +} from '../../../../../src/shared/agent-session/agent-session-thread-goal-report' import type { AgentSessionThreadGoalChange, AgentSessionThreadGoalResult -} from '../../../src/shared/agent-session/agent-session-thread-goal-wire' -import { agentSessionWriteNoticeParts } from '../../../src/shared/agent-session/failures/agent-session-refusal-notice' -import type { AgentJournalThreadGoal } from '../../../src/shared/agent-session/journal/agent-session-journal-types' -import type { AgentSessionOptionsResult } from '../../../src/shared/agent-session/options/agent-session-options-result' -import type { StructuredAgentSessionState } from '../../../src/shared/agent-session/structured-agent-session-reducer' -import type { StructuredAgentSessionComposerOptions } from '../../../src/shared/agent-session/view/structured-agent-session-composer' -import { mobileAgentSessionWriteNoticeText } from './agent-session-write-notice-copy' -import type { MobileStructuredAgentSessionArgs } from './mobile-structured-agent-session-contract' -import { mobileStructuredHostClockOffsetMs } from './mobile-structured-host-clock-offset' -import type { MobileNativeChatSendOutcome } from './native-chat/mobile-native-chat-send' -import type { MobileStructuredAgentMutate } from './use-mobile-structured-agent-mutation' -import { AGENT_SESSION_PHONE_THREAD_GOAL_RUNTIME_CAPABILITY } from '../../../src/shared/agent-session/agent-session-runtime-capabilities' -import { useRouteRelaysCapability } from '../worktree/workspace-server-context' +} from '../../../../../src/shared/agent-session/agent-session-thread-goal-wire' +import { agentSessionWriteNoticeParts } from '../../../../../src/shared/agent-session/failures/agent-session-refusal-notice' +import type { AgentJournalThreadGoal } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' +import type { AgentSessionOptionsResult } from '../../../../../src/shared/agent-session/options/agent-session-options-result' +import type { StructuredAgentSessionState } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' +import type { StructuredAgentSessionComposerOptions } from '../../../../../src/shared/agent-session/view/structured-agent-session-composer' +import { mobileAgentSessionWriteNoticeText } from '../agent-session/agent-session-write-notice-copy' +import type { MobileStructuredAgentSessionArgs } from '../agent-session/mobile-structured-agent-session-contract' +import { mobileStructuredHostClockOffsetMs } from '../agent-session/mobile-structured-host-clock-offset' +import type { MobileNativeChatSendOutcome } from '../composer/mobile-native-chat-send' +import type { MobileStructuredAgentMutate } from '../agent-session/use-mobile-structured-agent-mutation' +import { AGENT_SESSION_PHONE_THREAD_GOAL_RUNTIME_CAPABILITY } from '../../../../../src/shared/agent-session/agent-session-runtime-capabilities' +import { useRouteRelaysCapability } from '../../../worktree/workspace-server-context' export type MobileStructuredThreadGoal = { /** Scopes the strip's expansion to the conversation. */ diff --git a/mobile/src/session/use-native-chat-action-outcomes.ts b/mobile/src/session/native-chat/input/use-native-chat-action-outcomes.ts similarity index 100% rename from mobile/src/session/use-native-chat-action-outcomes.ts rename to mobile/src/session/native-chat/input/use-native-chat-action-outcomes.ts diff --git a/mobile/src/session/native-chat/mobile-native-chat-controller-contract.ts b/mobile/src/session/native-chat/mobile-native-chat-controller-contract.ts index a1b142c8dda..247fcbc108e 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-controller-contract.ts +++ b/mobile/src/session/native-chat/mobile-native-chat-controller-contract.ts @@ -1,7 +1,7 @@ import type { NativeChatSkillDiscoverySnapshot } from '../../../../src/shared/native-chat/input/native-chat-picker-items' import type { AgentSessionRewindSurface } from '../../../../src/shared/agent-session/lifecycle/agent-session-rewind-request' import type { NativeChatSendFollowUp } from '../../../../src/shared/native-chat/input/native-chat-follow-up-behavior' -import type { StructuredMobileSendAttachment } from '../use-mobile-structured-send-with-outcome' +import type { StructuredMobileSendAttachment } from './composer/use-mobile-structured-send-with-outcome' import type { MobileSessionView } from '../../storage/session-view-preferences' import type { Dispatch, MutableRefObject, SetStateAction } from 'react' import type { @@ -22,18 +22,18 @@ import type { NativeChatResolvedPrompt } from '../../../../src/shared/native-cha import type { MobileNativeChatSendIntent, MobileNativeChatSendOutcome -} from './mobile-native-chat-send' -import type { MobileNativeChatCommandRefusalCauses } from './use-mobile-native-chat-send-error' -import type { MobileStructuredQueuedMessageControls } from '../use-mobile-structured-queued-message-controls' -import type { MobileStructuredThreadGoal } from '../use-mobile-structured-thread-goal' -import type { MobileStructuredBackgroundTasks } from '../use-mobile-structured-background-tasks' -import type { MobileStructuredInterruptedContinue } from '../use-mobile-structured-interrupted-continue' -import type { MobileNativeChatPendingMessage } from './mobile-native-chat-pending-echo' +} from './composer/mobile-native-chat-send' +import type { MobileNativeChatCommandRefusalCauses } from './composer/use-mobile-native-chat-send-error' +import type { MobileStructuredQueuedMessageControls } from './input/use-mobile-structured-queued-message-controls' +import type { MobileStructuredThreadGoal } from './input/use-mobile-structured-thread-goal' +import type { MobileStructuredBackgroundTasks } from './input/use-mobile-structured-background-tasks' +import type { MobileStructuredInterruptedContinue } from './composer/use-mobile-structured-interrupted-continue' +import type { MobileNativeChatPendingMessage } from './transcript/mobile-native-chat-pending-echo' import type { useMobileNativeChatSession } from './use-mobile-native-chat-session' import type { MobileNativeChatSessionOptionPickersProps } from './input/MobileNativeChatSessionOptionPickers' import type { MobileNativeChatVisualSource } from './visual/mobile-native-chat-visual-read' import type { NativeChatContextUsageSummary } from '../../../../src/shared/native-chat/native-chat-context-usage-summary' -import type { useMobileStructuredSessionCommands } from '../use-mobile-structured-session-commands' +import type { useMobileStructuredSessionCommands } from './composer/use-mobile-structured-session-commands' import type { MobileNativeChatUsageLimit } from './use-mobile-native-chat-usage-limit' export type MobileNativeChatController = { diff --git a/mobile/src/session/native-chat/mobile-native-chat-diff.test.ts b/mobile/src/session/native-chat/mobile-native-chat-diff.test.ts deleted file mode 100644 index cb2936e8c51..00000000000 --- a/mobile/src/session/native-chat/mobile-native-chat-diff.test.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { diffFromText } from '../../../../src/shared/native-chat/tools/native-chat-diff' - -describe('diffFromText', () => { - it('caps large diffs before creating render rows', () => { - const text = Array.from( - { length: 1_000 }, - (_unused, index) => `${index % 2 === 0 ? '+' : '-'}line-${index}` - ).join('\n') - const lines = diffFromText(text) - - expect(lines).toHaveLength(120) - expect(lines?.at(-1)).toEqual({ kind: 'meta', text: '… diff truncated …' }) - }) - - it('honors a smaller caller-owned aggregate row budget', () => { - const text = Array.from( - { length: 100 }, - (_unused, index) => `${index % 2 === 0 ? '+' : '-'}line-${index}` - ).join('\n') - - expect(diffFromText(text, 20)).toHaveLength(20) - }) -}) diff --git a/mobile/src/session/native-chat/mobile-native-chat-lower-region-context.ts b/mobile/src/session/native-chat/mobile-native-chat-lower-region-context.ts index d0a7e8a5591..7f509992cf1 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-lower-region-context.ts +++ b/mobile/src/session/native-chat/mobile-native-chat-lower-region-context.ts @@ -1,5 +1,4 @@ -import { createContext, useContext, useLayoutEffect, useRef } from 'react' -import type { View } from 'react-native' +import { createContext, useContext } from 'react' export type MobileNativeChatLowerRegion = { getViewport: () => unknown @@ -30,17 +29,3 @@ export const MobileNativeChatComposerPresenceContext = createContext(true) export function useMobileNativeChatLowerGeometry() { return useContext(MobileNativeChatLowerGeometryContext) } - -export function useMobileNativeChatComposerRegion(shown: boolean, focused: boolean) { - const groupRef = useRef(null) - const lowerRegion = useMobileNativeChatLowerRegion() - const menuWasShown = useRef(false) - useLayoutEffect(() => { - lowerRegion?.layoutChanged() - if (shown !== menuWasShown.current && focused) { - lowerRegion?.reveal(groupRef.current, shown ? 'menu' : 'edit') - } - menuWasShown.current = shown - }) - return groupRef -} diff --git a/mobile/src/session/native-chat/mobile-native-chat-lower-scroll.ts b/mobile/src/session/native-chat/mobile-native-chat-lower-scroll.ts index 6aca979c534..d0194b0689c 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-lower-scroll.ts +++ b/mobile/src/session/native-chat/mobile-native-chat-lower-scroll.ts @@ -1,5 +1,5 @@ -import { createMobileNativeChatReadingHold } from './mobile-native-chat-reading-hold' -import { connectMobileNativeChatScrollGesture } from './mobile-native-chat-scroll-gesture' +import { createMobileNativeChatReadingHold } from './transcript/mobile-native-chat-reading-hold' +import { connectMobileNativeChatScrollGesture } from './transcript/mobile-native-chat-scroll-gesture' import { externalAllowance, composerGroupOf as groupOf, diff --git a/mobile/src/session/native-chat/mobile-native-chat-merge.test.ts b/mobile/src/session/native-chat/mobile-native-chat-merge.test.ts deleted file mode 100644 index 3b922e822f0..00000000000 --- a/mobile/src/session/native-chat/mobile-native-chat-merge.test.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { mergeNativeChatMessages } from '../../../../src/shared/native-chat/native-chat-merge' -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' - -function msg(id: string, overrides: Partial = {}): NativeChatMessage { - return { - id, - role: 'assistant', - blocks: [{ type: 'text', text: id }], - timestamp: 0, - source: 'transcript', - ...overrides - } -} - -describe('mergeNativeChatMessages', () => { - it('appends new ids in arrival order', () => { - const merged = mergeNativeChatMessages([msg('a')], [msg('b'), msg('c')]) - expect(merged.map((m) => m.id)).toEqual(['a', 'b', 'c']) - }) - - it('replaces a re-emitted id in place without reordering', () => { - const merged = mergeNativeChatMessages( - [msg('a'), msg('b'), msg('c')], - [msg('b', { blocks: [{ type: 'text', text: 'updated' }] })] - ) - expect(merged.map((m) => m.id)).toEqual(['a', 'b', 'c']) - expect(merged[1]!.blocks).toEqual([{ type: 'text', text: 'updated' }]) - }) - - it('does not let a lower-priority source overwrite a higher one', () => { - const merged = mergeNativeChatMessages( - [msg('a', { source: 'transcript', blocks: [{ type: 'text', text: 'real' }] })], - [msg('a', { source: 'scrape', blocks: [{ type: 'text', text: 'scraped' }] })] - ) - expect(merged[0]!.blocks).toEqual([{ type: 'text', text: 'real' }]) - }) - - it('returns the existing array unchanged for an empty batch', () => { - const existing = [msg('a')] - expect(mergeNativeChatMessages(existing, [])).toBe(existing) - }) - - it('does not mutate the existing array', () => { - const existing = [msg('a')] - mergeNativeChatMessages(existing, [msg('b')]) - expect(existing.map((m) => m.id)).toEqual(['a']) - }) -}) diff --git a/mobile/src/session/native-chat/mobile-native-chat-merger-oracle.test.ts b/mobile/src/session/native-chat/mobile-native-chat-merger-oracle.test.ts deleted file mode 100644 index d0f7b928f97..00000000000 --- a/mobile/src/session/native-chat/mobile-native-chat-merger-oracle.test.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' -import { - applyAppend, - createNativeChatMerger, - mergeNativeChatMessages, - replaceList -} from '../../../../src/shared/native-chat/native-chat-merge' - -function msg(id: string, overrides: Partial = {}): NativeChatMessage { - return { - id, - role: 'assistant', - blocks: [{ type: 'text', text: id }], - timestamp: 0, - source: 'transcript', - ...overrides - } -} - -// Compare each adversarial prefix with the pure merger so cached indexes cannot diverge from a full rebuild. -describe('mobile stateful merger — oracle vs pure merge', () => { - const base = [msg('a'), msg('b', { source: 'hook' })] - const batches: NativeChatMessage[][] = [ - [msg('c')], - [], - [msg('b', { source: 'transcript', blocks: [{ type: 'text', text: 'final' }] })], - [msg('b', { source: 'scrape' })], - [msg('a')], - [msg('d'), msg('e')] - ] - - it('matches the pure merge for every prefix', () => { - const merger = createNativeChatMerger() - replaceList(merger, base) - let pure = mergeNativeChatMessages(base, []) - expect(merger.list).toEqual(pure) - for (const batch of batches) { - const out = applyAppend(merger, batch) - pure = mergeNativeChatMessages(pure, batch) - expect(out).toEqual(pure) - } - }) - - it('keeps prior row identity on a pure tail append', () => { - const merger = createNativeChatMerger() - replaceList(merger, base) - const before = merger.list - const tail = msg('z') - const after = applyAppend(merger, [tail]) - expect(after).not.toBe(before) - expect(after[0]).toBe(before[0]) - expect(after[after.length - 1]).toBe(tail) - }) - - it('bounds live appends and rebuilds the cached indexes for the retained tail', () => { - const merger = createNativeChatMerger() - replaceList(merger, [msg('a'), msg('b'), msg('c')]) - - expect(applyAppend(merger, [msg('d'), msg('e')], 3).map((m) => m.id)).toEqual(['c', 'd', 'e']) - expect(merger.indexById.has('a')).toBe(false) - expect(merger.indexById.get('c')).toBe(0) - expect( - applyAppend(merger, [msg('d', { blocks: [{ type: 'text', text: 'updated' }] })], 3)[1] - ).toMatchObject({ id: 'd', blocks: [{ type: 'text', text: 'updated' }] }) - }) -}) diff --git a/mobile/src/session/native-chat/mobile-native-chat-reading-place.test.tsx b/mobile/src/session/native-chat/mobile-native-chat-reading-place.test.tsx deleted file mode 100644 index 9cd4aa4d9f9..00000000000 --- a/mobile/src/session/native-chat/mobile-native-chat-reading-place.test.tsx +++ /dev/null @@ -1,652 +0,0 @@ -import { - Activity, - createElement as h, - Fragment, - useMemo, - type ReactElement, - type ReactNode -} from 'react' -import { - act, - create, - type ReactTestRenderer, - type ReactTestRendererJSON as Node -} from 'react-test-renderer' -import { afterEach, expect, it, vi } from 'vitest' -import { splitNativeChatBlocks } from '../../../../src/shared/native-chat/tools/native-chat-tool-fold' -import type { - NativeChatBlock, - NativeChatMessage -} from '../../../../src/shared/native-chat/native-chat-types' -import { foldMobileNativeChatMessages } from './mobile-native-chat-render-data' -import { - useMobileNativeChatRowKeys, - type MobileNativeChatRowKeys -} from './transcript/mobile-native-chat-row-keys' -import { mobileNativeChatRowId } from '../mobile-native-chat-reading-place' -import { MobileNativeChatPageList } from './transcript/MobileNativeChatPageList' -import { ToolRun } from './transcript/MobileNativeChatToolRun' -import { useMobileNativeChatTurnDisclosure } from './transcript/use-mobile-native-chat-turn-disclosure' - -const platform = vi.hoisted(() => ({ OS: 'web' })) -const scrollable = vi.hoisted(() => { - const held: { node: unknown } = { node: null } - return held -}) - -vi.mock('react-native', async () => { - const React = await import('react') - class ScrollView extends React.Component<{ children?: ReactNode }> { - scrollToEnd = (): void => {} - scrollTo = (): void => {} - getScrollableNode = (): unknown => scrollable.node - getInnerViewNode = (): object => ({}) - render(): ReactNode { - return React.createElement('div', null, this.props.children) - } - } - const settled = () => ({ start: (): void => {}, stop: (): void => {} }) - return { - Platform: platform, - Text: 'span', - View: 'div', - Pressable: 'button', - ScrollView, - Animated: { - Text: 'span', - Value: class { - setValue(): void {} - }, - loop: (animation: unknown) => animation, - sequence: settled, - timing: settled - }, - StyleSheet: { create: (styles: unknown) => styles, hairlineWidth: 1 }, - useWindowDimensions: () => ({ width: 400, height: 800 }) - } -}) -vi.mock('lucide-react-native', () => { - const icon = () => null - const names = ['Bot', 'Brain', 'Check', 'ChevronRight', 'Circle', 'CircleCheck', 'CircleDot'] - const more = ['Eye', 'FileMinus2', 'FilePen', 'FilePlus2', 'Folder', 'Globe', 'ListChecks'] - const rest = ['MessageSquareMore', 'Pencil', 'Plug', 'Search', 'SquareTerminal', 'Wrench'] - return Object.fromEntries([...names, ...more, ...rest].map((name) => [name, icon])) -}) -vi.mock('./transcript/mobile-native-chat-tool-styles', () => ({ - toolStyles: {}, - toolType: () => ({ row: {}, meta: {}, code: {} }) -})) -vi.mock('../../components/MobileSourceCopyButton', () => ({ MobileSourceCopyButton: () => null })) -vi.mock('../../platform/external-link', () => ({ openExternalLink: vi.fn() })) -vi.mock('../../components/inline-text-selection', () => ({ INLINE_TEXT_SELECTION: false })) - -// The browser's resize step: after layout, before paint. -const observers = new Map<() => void, Set>() -const resized = () => act(() => observers.forEach((_, deliver) => deliver())) -// Only observers watching `target` hear about it, as in the browser. -const resizedOnly = (target: unknown) => - act(() => observers.forEach((targets, deliver) => targets.has(target) && deliver())) -vi.stubGlobal( - 'ResizeObserver', - class { - constructor(private readonly deliver: () => void) { - observers.set(deliver, new Set()) - } - observe(target: unknown): void { - observers.get(this.deliver)?.add(target) - } - unobserve(target: unknown): void { - observers.get(this.deliver)?.delete(target) - } - disconnect(): void { - observers.delete(this.deliver) - } - } -) - -const mountedRenderers = new Set() - -afterEach(() => { - act(() => { - for (const renderer of mountedRenderers) { - renderer.unmount() - } - }) - mountedRenderers.clear() - scrollable.node = null - vi.useRealTimers() - vi.restoreAllMocks() -}) - -const say = (id: string, role: 'user' | 'assistant', text: string): NativeChatMessage => ({ - id, - role, - timestamp: null, - source: 'transcript', - blocks: [{ type: 'text', text }] -}) -const edit = (n: number): NativeChatBlock => { - const lines = (word: string): string => Array.from({ length: 30 }, () => word).join('\n') - const input = { file_path: `f${n}.ts`, old_string: lines('old'), new_string: lines('new') } - return { type: 'tool-call', name: 'Edit', callId: `c${n}`, input } -} -const run = (n: number): NativeChatMessage[] => [ - { ...say(`a${n}`, 'assistant', ''), blocks: [edit(n)] }, - { ...say(`r${n}`, 'user', ''), blocks: [{ type: 'tool-result', callId: `c${n}`, output: 'ok' }] } -] -const chat = [say('u0', 'user', 'first'), say('x0', 'assistant', 'answer'), say('u1', 'user', 'go')] - .concat({ - ...say('a1', 'assistant', 'On it'), - blocks: [{ type: 'text', text: 'On it' }, edit(1)] - }) - .concat(run(1).slice(1), ...Array.from({ length: 39 }, (_, i) => run(i + 2))) - -type Box = { id: string; top: number; bottom: number; end: number; parent: number; rows: boolean } -type Element = { - getAttribute: () => string - getBoundingClientRect: () => { top: number; bottom: number } - querySelectorAll: (selector: string) => Element[] - children: Element[] - nextElementSibling: Element | null -} - -const oldHostTail = (): NativeChatMessage[] => JSON.parse(JSON.stringify(chat)) -const from = (id: string) => oldHostTail().slice(chat.findIndex((m) => m.id === id)) - -// Model end-anchored scrollTop=0 at the tail and negative offsets above; prepending history must not shift the view. -function page(tree: () => Node | Node[] | null) { - const boxes = (): Box[] => { - const out: Box[] = [] - let y = 0 - const walk = (node: Node | string, parent: number): void => { - if (typeof node === 'string' || node.type === 'span') { - y += typeof node === 'string' ? 0 : 20 - return - } - const id = String(node.props.testID ?? '') - const rows = node.props['data-chat-rows'] !== undefined - const at = out.push({ id, top: y, bottom: y, end: 0, parent, rows }) - 1 - node.children?.forEach((child) => walk(child, at)) - out[at] = { ...out[at]!, bottom: y, end: out.length } - } - walk({ type: 'page', props: {}, children: [tree() ?? []].flat() }, -1) - return out - } - const element = (all: Box[], at: number): Element => { - const box = all[at]! - const siblings = (parent: number): Element[] => - all.flatMap((other, i) => (other.parent === parent ? [element(all, i)] : [])) - return { - getAttribute: () => box.id, - getBoundingClientRect: () => ({ - top: box.top - node.viewTop(), - bottom: box.bottom - node.viewTop() - }), - querySelectorAll: (inner: string) => select(all, at + 1, box.end, inner), - get children() { - return siblings(at) - }, - get nextElementSibling() { - const next = all.findIndex((other, i) => i > at && other.parent === box.parent) - return next === -1 ? null : element(all, next) - } - } - } - const select = (all: Box[], from: number, to: number, selector: string): Element[] => { - const prefix = /\^="([^"]+)"/.exec(selector)?.[1] ?? '?' - return all.flatMap((box, at) => - at >= from && at < to && box.id.startsWith(prefix) ? [element(all, at)] : [] - ) - } - let scrollTop = 0 - const listeners = new Map void>() - const node = { - writes: 0, - get scrollTop(): number { - return scrollTop - }, - set scrollTop(value: number) { - node.writes += 1 - scrollTop = value - }, - clientHeight: 200, - get scrollHeight(): number { - return boxes()[0]?.bottom ?? 0 - }, - viewTop: (): number => Math.max(0, node.scrollHeight - node.clientHeight) + node.scrollTop, - showFrom: (y: number): void => { - node.scrollTop = y - Math.max(0, node.scrollHeight - node.clientHeight) - }, - getAttribute: () => null, - getBoundingClientRect: () => ({ top: 0, bottom: node.clientHeight }), - addEventListener: (type: string, listener: () => void): void => { - listeners.set(type, listener) - }, - removeEventListener: (type: string): void => { - listeners.delete(type) - }, - touch: (type: 'touchstart' | 'touchend'): void => listeners.get(type)?.(), - querySelectorAll: (selector: string): Element[] => select(boxes(), 0, Infinity, selector), - querySelector: (): Element | null => { - const all = boxes() - const at = all.findIndex((box) => box.rows) - return at === -1 ? null : element(all, at) - }, - top: (id: string): number => - (boxes().find((box) => box.id === id)?.top ?? Number.NaN) - node.viewTop() - } - return node -} - -function Row({ - message, - rowKey, - joined = 0, - workRun, - joinsWorkRun -}: { - message: NativeChatMessage - rowKey: string - joined?: number - workRun?: readonly NativeChatMessage[] - joinsWorkRun?: boolean -}): ReactElement | null { - if (joinsWorkRun) { - return null - } - const { prose, tools } = splitNativeChatBlocks((workRun ?? [message]).flatMap((m) => m.blocks)) - const words = prose - .map((block, i) => h('span', { key: i }, block.type === 'text' ? block.text : '')) - .concat(Array.from({ length: joined }, (_, i) => h('span', { key: `joined:${i}` }, 'joined'))) - const run = tools.length > 0 && h(ToolRun, { blocks: tools }) - return h('div', { testID: mobileNativeChatRowId(rowKey) }, words, run) -} - -let shownKeys!: MobileNativeChatRowKeys - -function Chat(props: { - messages: NativeChatMessage[] - following: boolean - live: boolean - joined?: number - runs?: boolean - status?: boolean -}): ReactElement { - const folded = useMemo( - () => foldMobileNativeChatMessages(props.messages, 'claude'), - [props.messages] - ) - const turns = useMobileNativeChatTurnDisclosure({ - messages: folded, - enabled: props.runs === true, - isWorking: false, - scopeKey: 'chat' - }) - const keys = useMobileNativeChatRowKeys(folded, props.messages, 'chat', turns.presentation) - shownKeys = keys - return h(MobileNativeChatPageList, { - ref: null, - rows: turns.listMessages, - rowKeys: keys, - runs: turns.presentation.workRuns.heads, - isFollowing: () => props.following, - onEndDistance: () => {}, - renderItem: ({ item, index }) => { - const { workRun, joinsWorkRun } = turns.resolveRow(index, item) - const row = h(Row, { - message: item, - rowKey: keys.keyOf(item), - joined: item === folded.at(-1) ? props.joined : 0, - workRun, - joinsWorkRun - }) - // Turn status draws beside its row, untagged. - return props.status - ? h( - Fragment, - null, - row, - ...Array.from({ length: 5 }, (_, i) => h('span', { key: i }, 'Done')) - ) - : row - }, - layoutKey: 'layout', - contentContainerStyle: null, - header: h('div', { testID: 'header' }, h('span', null, 'Loading')), - footer: props.live ? h('span', null, 'Working') : null, - emptyStateView: null, - onScroll: () => {} - }) -} - -function mount( - messages: NativeChatMessage[], - options: { following: boolean; live: boolean; runs?: boolean; status?: boolean } = { - following: false, - live: false - } -) { - let renderer!: ReactTestRenderer - act(() => { - renderer = create(h('div')) - mountedRenderers.add(renderer) - }) - const scroller = page(() => renderer.toJSON()) - scrollable.node = scroller - let mode: 'visible' | 'hidden' = 'visible' - let last: { messages: NativeChatMessage[]; joined: number } = { messages, joined: 0 } - const show = (next: NativeChatMessage[], joined = 0): number => { - const before = scroller.writes - last = { messages: next, joined } - act(() => renderer.update({h(Chat, { ...options, ...last })})) - return scroller.writes - before - } - // Hide or show the list the way the chat overlay does behind its terminal. - const display = (next: 'visible' | 'hidden') => { - mode = next - show(last.messages, last.joined) - } - vi.useFakeTimers({ now: 10_000, toFake: ['Date', 'setTimeout', 'clearTimeout'] }) - const scrolled = () => - act(() => - renderer.root.find((n) => n.props.onScroll && n.props.scrollEventThrottle).props.onScroll({}) - ) - const rest = () => - act(() => { - vi.advanceTimersByTime(400) - }) - const read = (move: () => void) => { - move() - scrolled() - rest() - } - show(messages) - const find = (id: string) => renderer.root.find((n) => n.props.testID === id) - const press = (id: string) => act(() => find(id).findAllByType('button')[0]!.props.onPress()) - const drawn = (id: string) => renderer.root.findAll((n) => n.props.testID === id).length - const lines = (id: string) => find(id).findAllByType('span').length - const rows = () => - renderer.root - .findAll((n) => n.type === 'div' && String(n.props.testID).startsWith('chat-row:')) - .map((n) => n.props.testID) - return { scroller, show, display, press, drawn, lines, find, rows, scrolled, rest, read } -} - -it('keeps the line a reader was on, its run open, when older messages join the run from an old host', () => { - // Exercise anchoring both inside a run and at Load earlier when older calls absorb the visible orphan result. - for (const atTop of [false, true]) { - const chat0 = mount(from('r31')) - chat0.press(mobileNativeChatRowId('a32')) - chat0.press('chat-member:call:c34') - const opened = chat0.lines('chat-member:call:c34') - chat0.read(() => (chat0.scroller.scrollTop += chat0.scroller.top('chat-member:call:c34'))) - // Old hosts can replay the whole tail as new objects with unchanged ids. - for (const [older, first] of [ - ['r21', 'c32'], - ['u0', 'c22'] - ] as const) { - if (atTop) { - chat0.read(() => chat0.scroller.showFrom(0)) - } - const line = `chat-member:call:${atTop ? first : 'c34'}` - const top = chat0.scroller.top(line) - expect(chat0.show(from(older))).toBeLessThanOrEqual(1) - expect(chat0.scroller.top(line)).toBe(top) - } - - expect(chat0.rows().slice(0, 3)).toEqual(['u0', 'x0', 'u1'].map(mobileNativeChatRowId)) - expect(chat0.lines('chat-member:call:c34')).toBe(opened) - expect(chat0.drawn('chat-member:call:c1')).toBe(1) - expect(shownKeys.current('r21')).toBe('a32') - - chat0.show([...oldHostTail(), say('done', 'assistant', 'Done'), say('ask', 'user', 'next')]) - expect(chat0.drawn(mobileNativeChatRowId('a32'))).toBe(1) - expect(chat0.drawn('chat-member:call:c34')).toBe(1) - } - - // Both collapsed headers and open lines must stay anchored as older calls join above. - const later = Array.from({ length: 10 }, (_, i) => say(`t${i}`, 'user', 'later')) - for (const open of [false, true]) { - const tail = mount([...from('r21'), ...later]) - if (open) { - tail.press(mobileNativeChatRowId('a22')) - tail.read(() => (tail.scroller.scrollTop += tail.scroller.top('chat-member:call:c27') + 40)) - } - const before = tail.scroller.top(mobileNativeChatRowId('t0')) - tail.show([...oldHostTail(), ...later]) - expect(tail.scroller.top(mobileNativeChatRowId('t0'))).toBe(before) - } -}) - -it('holds back a change below a scrolling reader until they rest, then keeps their line', () => { - const rows = Array.from({ length: 12 }, (_, i) => say(`m${i}`, i % 2 ? 'assistant' : 'user', 'x')) - const chat0 = mount(rows) - chat0.scroller.showFrom(40) - chat0.scrolled() - // A correction mid-fling would stop iOS momentum; hold the below-reader reply until rest. - const line = chat0.scroller.top(mobileNativeChatRowId('m4')) - expect(chat0.show([...rows, say('n1', 'assistant', 'reply')])).toBe(0) - expect(chat0.drawn(mobileNativeChatRowId('n1'))).toBe(0) - expect(chat0.scroller.top(mobileNativeChatRowId('m4'))).toBe(line) - chat0.rest() - expect(chat0.drawn(mobileNativeChatRowId('n1'))).toBe(1) - expect(chat0.scroller.top(mobileNativeChatRowId('m4'))).toBe(line) -}) - -it('a parked reader stays parked when React Native Web repeats the scroll event of its own correction', () => { - const rows = Array.from({ length: 12 }, (_, i) => say(`m${i}`, i % 2 ? 'assistant' : 'user', 'x')) - const chat0 = mount(rows) - chat0.read(() => chat0.scroller.showFrom(40)) - const line = chat0.scroller.top(mobileNativeChatRowId('m4')) - const n1 = say('n1', 'assistant', 'reply') - chat0.show([...rows, n1]) - chat0.scrolled() - // React Native Web sends the last scroll event again 100 ms after scrolling stops. - chat0.scrolled() - chat0.show([...rows, n1, say('n2', 'assistant', 'more')]) - expect(chat0.drawn(mobileNativeChatRowId('n2'))).toBe(1) - expect(chat0.scroller.top(mobileNativeChatRowId('m4'))).toBe(line) -}) - -it('releases a held change once a chat hidden mid-touch is shown again and the reader rests', () => { - const rows = Array.from({ length: 12 }, (_, i) => say(`m${i}`, i % 2 ? 'assistant' : 'user', 'x')) - const chat0 = mount(rows) - chat0.scroller.touch('touchstart') - chat0.scroller.showFrom(40) - chat0.scrolled() - chat0.show([...rows, say('n1', 'assistant', 'reply')]) - chat0.display('hidden') - // The hidden list hears no touchend. - chat0.scroller.touch('touchend') - chat0.display('visible') - chat0.rest() - expect(chat0.drawn(mobileNativeChatRowId('n1'))).toBe(1) -}) - -it('keeps a parked reader on their line when the list viewport changes height, as when the composer grows', () => { - const rows = Array.from({ length: 12 }, (_, i) => say(`m${i}`, i % 2 ? 'assistant' : 'user', 'x')) - const chat0 = mount(rows) - chat0.read(() => chat0.scroller.showFrom(40)) - const line = chat0.scroller.top(mobileNativeChatRowId('m4')) - - chat0.scroller.clientHeight = 120 - resizedOnly(chat0.scroller) - - expect(chat0.scroller.top(mobileNativeChatRowId('m4'))).toBe(line) -}) - -it("holds a row's look with its messages: what the chat's state adds lands once the reader rests", () => { - const rows = Array.from({ length: 12 }, (_, i) => say(`m${i}`, i % 2 ? 'assistant' : 'user', 'x')) - const chat0 = mount(rows) - chat0.scroller.showFrom(40) - chat0.scrolled() - const line = chat0.scroller.top(mobileNativeChatRowId('m4')) - expect(chat0.show(rows, 3)).toBe(0) - expect(chat0.lines(mobileNativeChatRowId('m11'))).toBe(1) - expect(chat0.scroller.top(mobileNativeChatRowId('m4'))).toBe(line) - chat0.rest() - expect(chat0.lines(mobileNativeChatRowId('m11'))).toBe(4) - expect(chat0.scroller.top(mobileNativeChatRowId('m4'))).toBe(line) -}) - -it('draws a run once when an older page brings in its start while the reader moves', () => { - const call = (id: string): NativeChatMessage => ({ - ...say(id, 'assistant', ''), - blocks: [{ type: 'tool-call', name: 'Bash', callId: id, input: { command: id } }] - }) - const thought: NativeChatMessage = { ...say('t', 'assistant', 'weighing it'), role: 'reasoning' } - const later = Array.from({ length: 12 }, (_, i) => - say(`m${i}`, i % 2 ? 'assistant' : 'user', 'x') - ) - const chat0 = mount([thought, call('b'), ...later], { following: false, live: false, runs: true }) - chat0.scroller.showFrom(40) - chat0.scrolled() - chat0.show([say('u', 'user', 'go'), call('a'), thought, call('b'), ...later]) - const once = ['u', 'a', 'm0'].map(mobileNativeChatRowId) - expect(chat0.rows().slice(0, 3)).toEqual(once) - expect(chat0.drawn('chat-member:run')).toBe(1) - chat0.rest() - expect(chat0.rows().slice(0, 3)).toEqual(once) - expect(chat0.drawn('chat-member:run')).toBe(1) -}) - -it('draws a bounded tail again once a reader who scrolled back through history returns to it', () => { - // Rows and their status lines are sized so a cut that drops a row's status would draw it back. - const messages = Array.from({ length: 200 }, (_, i) => ({ - ...say(`m${i}`, i % 2 ? 'assistant' : 'user', ''), - blocks: [0, 1].map((line) => ({ type: 'text' as const, text: `message ${i}.${line}` })) - })) - const options = { following: true, live: false, status: true } - const chat0 = mount(messages, options) - const tail = chat0.rows().length - options.following = false - chat0.show(messages) - for (let page = 0; page < 8; page += 1) { - chat0.read(() => chat0.scroller.showFrom(0)) - } - expect(chat0.rows().length).toBeGreaterThan(tail * 2) - - options.following = true - chat0.show(messages) - chat0.read(() => (chat0.scroller.scrollTop = 0)) - expect(chat0.rows().length).toBeLessThanOrEqual(tail) - expect(chat0.rows().at(-1)).toBe(mobileNativeChatRowId('m199')) -}) - -it('holds a row the reader taps open in place, and a reply below waits out a flick', () => { - const later = Array.from({ length: 10 }, (_, i) => say(`t${i}`, 'user', 'later')) - const chat0 = mount([...from('r21'), ...later]) - const header = mobileNativeChatRowId('a22') - chat0.read(() => (chat0.scroller.scrollTop += chat0.scroller.top(header) - 40)) - chat0.scroller.touch('touchstart') - chat0.scroller.touch('touchend') - const before = chat0.scroller.top(header) - chat0.press(header) - resized() - expect(chat0.scroller.top(header)).toBe(before) - - // Touch release can start a fling; it is not evidence the list is at rest. - chat0.scroller.touch('touchstart') - chat0.scroller.scrollTop -= 30 - chat0.scrolled() - chat0.scroller.touch('touchend') - expect(chat0.show([...from('r21'), ...later, say('n1', 'assistant', 'reply')])).toBe(0) - expect(chat0.drawn(mobileNativeChatRowId('n1'))).toBe(0) -}) - -it('at the cap, a trim and an append of equal height hold a parked reader and leave a following one to follow', () => { - const rows = Array.from({ length: 13 }, (_, i) => - say(`m${i}`, i % 2 ? 'assistant' : 'user', `message ${i}`) - ) - for (const options of [ - { following: true, live: false }, - { following: true, live: true }, - { following: false, live: false } - ]) { - const chat0 = mount(rows.slice(0, 12), options) - chat0.read(() => - options.following ? (chat0.scroller.scrollTop = 0) : chat0.scroller.showFrom(50) - ) - const before = { - scrollTop: chat0.scroller.scrollTop, - m4: chat0.scroller.top(mobileNativeChatRowId('m4')) - } - - const writes = chat0.show(rows.slice(1)) - - expect(writes).toBe(options.following ? 0 : 1) - if (options.following) { - expect(chat0.scroller.scrollTop).toBe(before.scrollTop) - } else { - expect(chat0.scroller.top(mobileNativeChatRowId('m4'))).toBe(before.m4) - } - } - - // Sequential and parallel trims split results to opposite sides; orphan results must never inherit a run’s key. - const output = (n: number): NativeChatMessage => ({ - ...say(`o${n}`, 'user', ''), - role: 'tool', - blocks: [{ type: 'tool-result', callId: `c${n}`, output: 'ok' }] - }) - const six = [1, 2, 3, 4, 5, 6] - const calls = (id: string) => - six.map((n) => ({ ...say(`${id}${n}`, 'assistant', ''), blocks: [edit(n)] })) - const outputs = { ...output(1), id: 'U', blocks: six.flatMap((n) => output(n).blocks) } - for (const [source, head, orphan, last, absorbed] of [ - [chat.slice(3, 15), 'a1', 'r1', 11, []], - [calls('p').concat(six.map(output)), 'p1', 'o1', 6, ['o1', 'o2', 'o3', 'o4']], - [calls('q').concat(outputs), 'q1', 'U', 6, ['U']] - ] as const) { - const top = mount([...source, ...rows]) - top.press(mobileNativeChatRowId(head)) - top.read(() => (top.scroller.scrollTop += top.scroller.top('chat-member:call:c6') - 10)) - const trim = (trimmed: number) => { - top.show([...source.slice(trimmed), ...rows, say(`done${trimmed}`, 'assistant', 'Done')]) - const run = top.find(mobileNativeChatRowId(head)) - expect(run.findAll((n) => n.props.testID === 'chat-member:call:c6')).toHaveLength(1) - expect(top.scroller.top('chat-member:call:c6')).toBe(10) - } - trim(1) - expect(top.drawn(mobileNativeChatRowId(orphan))).toBe(1) - trim(2) - trim(4) - top.show([...source, ...rows, say('done4', 'assistant', 'Done')]) - expect(absorbed.map(shownKeys.current)).toEqual(absorbed.map(() => head)) - top.show([...source.slice(last), ...rows, say('done', 'assistant', 'Done')]) - expect(top.drawn(mobileNativeChatRowId(head))).toBe(0) - } - - const reader = mount([...chat.slice(3, 15), ...rows]) - reader.press(mobileNativeChatRowId('a1')) - reader.read(() => (reader.scroller.scrollTop += reader.scroller.top('chat-member:call:c1'))) - const next = reader.scroller.top('chat-member:call:c2') - expect(next).toBeGreaterThan(0) - reader.show([...chat.slice(4, 15), ...rows, say('done', 'assistant', 'Done')]) - expect(reader.scroller.top('chat-member:call:c2')).toBe(next) -}) - -it('a roster keeps its key when the fold moves it, and the rows the reader saw after it stay put', () => { - const sibling = (id: string): NativeChatMessage => ({ - ...say(id, 'user', ''), - role: 'system', - blocks: [ - { type: 'text', text: `Ran subagent ${id}` }, - { type: 'subagent', id: `agent-${id}`, label: id, state: 'completed', groupId: 'turn-1' } - ] - }) - const said = (name: string) => - Array.from({ length: 12 }, (_, i) => say(`${name}${i}`, i % 2 ? 'assistant' : 'user', name)) - const all = [...said('old'), sibling('s1'), ...said('mid'), sibling('s2'), ...said('new')] - const chat0 = mount(all.slice(25)) - const tops = (ids: string[]) => ids.map((id) => chat0.scroller.top(mobileNativeChatRowId(id))) - chat0.read(() => chat0.scroller.showFrom(20)) - const below = tops(['new0', 'new5']) - expect(chat0.show(all)).toBeLessThanOrEqual(1) - expect(tops(['new0', 'new5'])).toEqual(below) - expect(chat0.drawn(mobileNativeChatRowId('s2'))).toBe(1) - chat0.read(() => (chat0.scroller.scrollTop += chat0.scroller.top(mobileNativeChatRowId('s2')))) - const after = tops(['mid0', 'mid5']) - expect(chat0.show(all.slice(13))).toBeLessThanOrEqual(1) - expect(tops(['mid0', 'mid5'])).toEqual(after) - expect(chat0.drawn(mobileNativeChatRowId('s2'))).toBe(1) -}) diff --git a/mobile/src/session/native-chat/mobile-native-chat-send-classification.test.ts b/mobile/src/session/native-chat/mobile-native-chat-send-classification.test.ts deleted file mode 100644 index a916038e77a..00000000000 --- a/mobile/src/session/native-chat/mobile-native-chat-send-classification.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - classifyMobileNativeChatSend, - getMobileNativeChatCommands -} from './mobile-native-chat-send-classification' - -describe('classifyMobileNativeChatSend', () => { - it('recognizes OMP selectors and context commands without claiming generic help', () => { - expect(classifyMobileNativeChatSend('omp', '/switch')).toBe('command') - expect(classifyMobileNativeChatSend('omp', '/compact focus on tests')).toBe('command') - expect(classifyMobileNativeChatSend('omp', '/help')).toBe('unknown-token') - expect(classifyMobileNativeChatSend('omp', '/smol')).toBe('unknown-token') - }) - - it('classifies catalog commands per agent', () => { - expect(classifyMobileNativeChatSend('claude', '/clear')).toBe('command') - expect(classifyMobileNativeChatSend('claude', '/compact')).toBe('command') - expect(classifyMobileNativeChatSend('codex', '/model')).toBe('command') - expect(classifyMobileNativeChatSend('codex', '/permissions')).toBe('command') - }) - - it('treats slash tokens outside the agent catalog as unknown, never chat', () => { - expect(classifyMobileNativeChatSend('claude', '/model sonnet')).toBe('unknown-token') - expect(classifyMobileNativeChatSend('claude', '/cost')).toBe('unknown-token') - expect(classifyMobileNativeChatSend('claude', '/diff')).toBe('unknown-token') - }) - - it('leaves /context off mobile, which has no way to show its answer', () => { - for (const agent of ['openclaude', 'omp']) { - expect(classifyMobileNativeChatSend(agent, '/context')).toBe('unknown-token') - expect(classifyMobileNativeChatSend(agent, '/compact')).toBe('command') - expect(getMobileNativeChatCommands(agent).map(({ name }) => name)).not.toContain('context') - } - }) - - it('keeps prose as chat, including leading-whitespace slash text', () => { - expect(classifyMobileNativeChatSend('claude', 'hello there')).toBe('chat') - expect(classifyMobileNativeChatSend('claude', ' /clear is a command')).toBe('chat') - expect(classifyMobileNativeChatSend('claude', '/usr/bin/python is missing')).toBe( - 'unknown-token' - ) - }) - - it('treats $ tokens as skill grammar only for Codex', () => { - expect(classifyMobileNativeChatSend('codex', '$deploy now')).toBe('unknown-token') - expect(classifyMobileNativeChatSend('claude', '$PATH is empty')).toBe('chat') - }) - - it('defaults to chat when no agent is resolved', () => { - expect(classifyMobileNativeChatSend(null, '/clear')).toBe('chat') - }) -}) diff --git a/mobile/src/session/native-chat/mobile-native-chat-transcript-writer.test.ts b/mobile/src/session/native-chat/mobile-native-chat-transcript-writer.test.ts deleted file mode 100644 index 08a181f1f7d..00000000000 --- a/mobile/src/session/native-chat/mobile-native-chat-transcript-writer.test.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' -import { publishPageDeviceStore } from '../../mobile-web-shell/bridge/page-device-store' -import { emitPageAppInactive } from '../../mobile-web-shell/bridge/bridge-app-inactive' -import { noteChatTranscript } from './mobile-native-chat-transcript-writer' - -function message(id: string): NativeChatMessage { - return { - id, - role: 'assistant', - blocks: [{ type: 'text', text: id }], - timestamp: 1, - source: 'transcript' - } -} - -describe('chat copies when the app leaves the foreground', () => { - const writes: string[] = [] - - beforeEach(() => { - writes.length = 0 - publishPageDeviceStore({ - available: () => true, - read: async (_table, keys) => ({ status: 'ok', values: keys.map(() => null) }), - write: async (_table, ops) => { - writes.push(...ops.map((op) => op.key)) - return { written: true } - } - }) - }) - - afterEach(() => { - vi.useRealTimers() - publishPageDeviceStore(null) - }) - - function note(rows: NativeChatMessage[]): void { - noteChatTranscript( - 'chat-leaving', - rows, - () => true, - (savedAt) => ({ - kind: 'terminal', - savedAt, - messages: rows, - hasMore: false, - beforeOffset: null - }) - ) - } - - it('saves new rows on leaving and writes nothing when a flap brings none', async () => { - vi.useFakeTimers() - const [m1, m2, m3] = [message('m1'), message('m2'), message('m3')] - note([m1, m2, m3]) - emitPageAppInactive() - await vi.runAllTimersAsync() - expect(writes).toHaveLength(1) - - // Two minutes later, Notification Centre and back: the rows on screen are a new list with the same rows. - vi.setSystemTime(Date.now() + 120_000) - note([m1, m2, m3]) - emitPageAppInactive() - note([m1, m2, m3]) - emitPageAppInactive() - await vi.runAllTimersAsync() - expect(writes).toHaveLength(1) - - // A middle row changed (a tool result landed), with the last row the same. - note([m1, { ...m2, blocks: [{ type: 'text', text: 'm2 with its result' }] }, m3]) - emitPageAppInactive() - await vi.runAllTimersAsync() - expect(writes).toHaveLength(2) - }) -}) diff --git a/mobile/src/session/native-chat/mobile-native-chat-unsent-notices.ts b/mobile/src/session/native-chat/mobile-native-chat-unsent-notices.ts index fb40c24539c..d3416e91524 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-unsent-notices.ts +++ b/mobile/src/session/native-chat/mobile-native-chat-unsent-notices.ts @@ -1,5 +1,5 @@ import { agentJournalSubmissionKey } from '../../../../src/shared/agent-session/journal/agent-session-journal-item-key' -import { mobileAgentSessionWriteNoticeText } from '../agent-session-write-notice-copy' +import { mobileAgentSessionWriteNoticeText } from './agent-session/agent-session-write-notice-copy' import { agentSessionVisibleFailureFacts } from '../../../../src/shared/agent-session/failures/agent-session-visible-failures' import type { NativeChatTurnJournal } from '../../../../src/shared/native-chat/transcript/native-chat-turn-membership' import { dispatchWasWithdrawn } from '../../../../src/shared/agent-session/requests/structured-agent-session-dispatch-rejection' diff --git a/mobile/src/session/mobile-native-chat-host-preference-operations.ts b/mobile/src/session/native-chat/preferences/mobile-native-chat-host-preference-operations.ts similarity index 82% rename from mobile/src/session/mobile-native-chat-host-preference-operations.ts rename to mobile/src/session/native-chat/preferences/mobile-native-chat-host-preference-operations.ts index 459aff6fdc0..d33af3fd738 100644 --- a/mobile/src/session/mobile-native-chat-host-preference-operations.ts +++ b/mobile/src/session/native-chat/preferences/mobile-native-chat-host-preference-operations.ts @@ -1,7 +1,6 @@ -import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc/rpc-operation' -import type { RpcCompatibleReader } from '../transport/rpc/rpc-operation-contract' -import '../../../src/shared/source-control/listing/source-control-group-order' -import { settingsMember, settingsField } from '../settings/mobile-settings-projection' +import { bindDeferredRpcOperation, defineRpcOperation } from '../../../transport/rpc/rpc-operation' +import type { RpcCompatibleReader } from '../../../transport/rpc/rpc-operation-contract' +import { settingsMember, settingsField } from '../../../settings/mobile-settings-projection' // Missing reports let the caller tell an older host's absence from a reported value. function reportedBooleanSettingReader( diff --git a/mobile/src/session/mobile-native-chat-host-preference.test.tsx b/mobile/src/session/native-chat/preferences/mobile-native-chat-host-preference.test.tsx similarity index 65% rename from mobile/src/session/mobile-native-chat-host-preference.test.tsx rename to mobile/src/session/native-chat/preferences/mobile-native-chat-host-preference.test.tsx index b19ba1fbb4b..83b0adec268 100644 --- a/mobile/src/session/mobile-native-chat-host-preference.test.tsx +++ b/mobile/src/session/native-chat/preferences/mobile-native-chat-host-preference.test.tsx @@ -2,9 +2,9 @@ import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, expect, it, vi } from 'vitest' import { useMobileNativeChatQueueFollowUps } from './use-mobile-native-chat-queue-follow-ups' import { useMobileNativeChatCiResultLines } from './use-mobile-native-chat-ci-result-lines' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import type { ConnectionState } from '../transport/connection/connection-state' -import type { RpcResponse } from '../transport/rpc/rpc-wire-types' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' +import type { ConnectionState } from '../../../transport/connection/connection-state' +import type { RpcResponse } from '../../../transport/rpc/rpc-wire-types' function connection() { let state: ConnectionState = 'connected' @@ -82,71 +82,6 @@ afterEach(() => { renderers.clear() }) -it('re-renders only the consumers of the preference and desktop that changed', async () => { - const a = connection(), - b = connection() - const renders = new Map() - const values = new Map() - const count = (id: string, value: boolean) => { - values.set(id, value) - renders.set(id, (renders.get(id) ?? 0) + 1) - } - function CiLines({ id, client }: { id: string; client: RpcClient }) { - count(id, useMobileNativeChatCiResultLines(client, true)) - return null - } - function FollowUps({ id, client }: { id: string; client: RpcClient }) { - count(id, useMobileNativeChatQueueFollowUps(client, true, id, client, true)) - return null - } - await act(async () => { - renderers.add( - create( - <> - - - - {Array.from({ length: 9 }, (_, index) => ( - - ))} - - ) - ) - }) - await act(async () => {}) - // Ten chats on B share one read and one stream. - expect(b.client.sendRequest).toHaveBeenCalledTimes(1) - expect(b.client.subscribe).toHaveBeenCalledTimes(1) - // B executes the chat and reports CI lines on; A, the paired desktop, hasn't reported. - await act(async () => b.emit({ type: 'nativeChatCiResultLinesChanged', ciResultLines: true })) - expect([values.get('ci-a'), values.get('follow-ups-a'), values.get('ci-b')]).toEqual([ - false, - true, - true - ]) - const settled = new Map(renders) - await act(async () => a.emit({ type: 'nativeChatCiResultLinesChanged', ciResultLines: true })) - expect(values.get('ci-a')).toBe(true) - expect(renders).toEqual(new Map([...settled, ['ci-a', settled.get('ci-a')! + 1]])) - await act(async () => a.emit({ type: 'nativeChatQueueFollowUpsChanged', queueFollowUps: false })) - expect(values.get('follow-ups-a')).toBe(false) - expect(renders).toEqual( - new Map([ - ...settled, - ['ci-a', settled.get('ci-a')! + 1], - ['follow-ups-a', settled.get('follow-ups-a')! + 1] - ]) - ) - const beforeOther = new Map(renders) - await act(async () => b.emit({ type: 'nativeChatCiResultLinesChanged', ciResultLines: false })) - expect(values.get('ci-b')).toBe(false) - expect(renders.get('ci-a')).toBe(beforeOther.get('ci-a')) - expect(renders.get('follow-ups-a')).toBe(beforeOther.get('follow-ups-a')) - // A snapshot-less ready re-reads once for the connection, not once per chat. - await act(async () => b.emit({ type: 'ready', subscriptionId: 'legacy' })) - expect(b.client.sendRequest).toHaveBeenCalledTimes(2) -}) - it('shows CI lines from the last value the paired desktop reported, hidden until it reports one', async () => { const desktop = connection() const values: boolean[] = [] diff --git a/mobile/src/session/mobile-native-chat-host-preference.ts b/mobile/src/session/native-chat/preferences/mobile-native-chat-host-preference.ts similarity index 95% rename from mobile/src/session/mobile-native-chat-host-preference.ts rename to mobile/src/session/native-chat/preferences/mobile-native-chat-host-preference.ts index a25db4207c0..5da3241c9fc 100644 --- a/mobile/src/session/mobile-native-chat-host-preference.ts +++ b/mobile/src/session/native-chat/preferences/mobile-native-chat-host-preference.ts @@ -2,12 +2,12 @@ import { nativeChatCiResultLinesRead, nativeChatQueueFollowUpsRead } from './mobile-native-chat-host-preference-operations' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import { subscribeSharedClientEvents, type SharedClientEvent -} from '../transport/connection/shared-client-events' -import { nativeChatQueueFollowUps } from '../../../src/shared/native-chat/input/native-chat-follow-up-behavior' +} from '../../../transport/connection/shared-client-events' +import { nativeChatQueueFollowUps } from '../../../../../src/shared/native-chat/input/native-chat-follow-up-behavior' /** A desktop chat setting the host pushes live: its read, its change event and its ready-snapshot field. */ export type MobileNativeChatHostPreferenceKind = { diff --git a/mobile/src/session/use-mobile-native-chat-ci-result-lines.ts b/mobile/src/session/native-chat/preferences/use-mobile-native-chat-ci-result-lines.ts similarity index 91% rename from mobile/src/session/use-mobile-native-chat-ci-result-lines.ts rename to mobile/src/session/native-chat/preferences/use-mobile-native-chat-ci-result-lines.ts index 8684aa95eb3..7a189a6d890 100644 --- a/mobile/src/session/use-mobile-native-chat-ci-result-lines.ts +++ b/mobile/src/session/native-chat/preferences/use-mobile-native-chat-ci-result-lines.ts @@ -1,5 +1,5 @@ import { useCallback, useSyncExternalStore } from 'react' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import { CI_RESULT_LINES_PREFERENCE, mobileNativeChatHostPreference diff --git a/mobile/src/session/use-mobile-native-chat-queue-follow-ups.ts b/mobile/src/session/native-chat/preferences/use-mobile-native-chat-queue-follow-ups.ts similarity index 89% rename from mobile/src/session/use-mobile-native-chat-queue-follow-ups.ts rename to mobile/src/session/native-chat/preferences/use-mobile-native-chat-queue-follow-ups.ts index 882b158db00..201c398ef02 100644 --- a/mobile/src/session/use-mobile-native-chat-queue-follow-ups.ts +++ b/mobile/src/session/native-chat/preferences/use-mobile-native-chat-queue-follow-ups.ts @@ -1,6 +1,6 @@ import { useCallback, useSyncExternalStore } from 'react' -import { nativeChatQueueFollowUps } from '../../../src/shared/native-chat/input/native-chat-follow-up-behavior' -import type { RpcClient } from '../transport/rpc/rpc-client-contract' +import { nativeChatQueueFollowUps } from '../../../../../src/shared/native-chat/input/native-chat-follow-up-behavior' +import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import { mobileNativeChatHostPreference, QUEUE_FOLLOW_UPS_PREFERENCE diff --git a/mobile/src/session/MobileLinkActionSheet.tsx b/mobile/src/session/native-chat/transcript/MobileLinkActionSheet.tsx similarity index 83% rename from mobile/src/session/MobileLinkActionSheet.tsx rename to mobile/src/session/native-chat/transcript/MobileLinkActionSheet.tsx index 81db7d52d06..6ab27dc905c 100644 --- a/mobile/src/session/MobileLinkActionSheet.tsx +++ b/mobile/src/session/native-chat/transcript/MobileLinkActionSheet.tsx @@ -1,10 +1,10 @@ import { useState } from 'react' import { Copy, ExternalLink, Globe } from 'lucide-react-native' -import { ActionSheetModal, type ActionSheetAction } from '../components/ActionSheetModal' -import { openExternalLink } from '../platform/external-link' -import { useClipboardWriter } from '../platform/clipboard' -import { triggerError, triggerSuccess } from '../platform/haptics' -import { useMobileTranslation } from '../i18n/use-mobile-translation' +import { ActionSheetModal, type ActionSheetAction } from '../../../components/ActionSheetModal' +import { openExternalLink } from '../../../platform/external-link' +import { useClipboardWriter } from '../../../platform/clipboard' +import { triggerError, triggerSuccess } from '../../../platform/haptics' +import { useMobileTranslation } from '../../../i18n/use-mobile-translation' // Choices for a tapped chat link: Orca's browser on the host, the phone's browser, or the clipboard. export function MobileLinkActionSheet(props: { diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatAgentMessageCard.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatAgentMessageCard.tsx index f3e0575224e..a7c2b263ac4 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatAgentMessageCard.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatAgentMessageCard.tsx @@ -11,7 +11,7 @@ import { type AgentMessageHeading } from '../../../../../src/shared/agent-session/agent-message-presentation' import { mobileNativeChatDisplayCopyText } from './mobile-native-chat-display-copy' -import { MobileNativeChatMarkdown } from '../MobileNativeChatMarkdown' +import { MobileNativeChatMarkdown } from './MobileNativeChatMarkdown' import { MobileAgentIcon } from '../../../components/MobileAgentIcon' import { AgentStateDot } from '../../../components/AgentStateDot' import { MobileSourceCopyButton } from '../../../components/MobileSourceCopyButton' diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatAwaitingInputRow.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatAwaitingInputRow.tsx index f29c25359ef..9d607c9658b 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatAwaitingInputRow.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatAwaitingInputRow.tsx @@ -8,7 +8,7 @@ import { colors, spacing, typography } from '../../../theme/mobile-theme' import { themedStyleSheet } from '../../../theme/themed-styles' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' import { scaledType } from './mobile-native-chat-message-styles' -import { MobileNativeChatQuestionText } from '../MobileNativeChatQuestionText' +import { MobileNativeChatQuestionText } from './MobileNativeChatQuestionText' const ICON_SIZE = 15 diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatBackgroundTaskRun.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatBackgroundTaskRun.tsx index 029bb7f7076..0e72502a666 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatBackgroundTaskRun.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatBackgroundTaskRun.tsx @@ -6,7 +6,7 @@ import { INLINE_TEXT_SELECTION } from '../../../components/inline-text-selection import { colors, spacing, typography } from '../../../theme/mobile-theme' import { themedStyleSheet } from '../../../theme/themed-styles' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' -import { sayMobileBackgroundTask } from '../../mobile-background-task-copy' +import { sayMobileBackgroundTask } from '../input/mobile-background-task-copy' import { BackgroundTaskKindIcon } from '../input/MobileNativeChatBackgroundTasks' import { scaledType } from './mobile-native-chat-message-styles' diff --git a/mobile/src/session/native-chat/MobileNativeChatDiffCard.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatDiffCard.tsx similarity index 85% rename from mobile/src/session/native-chat/MobileNativeChatDiffCard.tsx rename to mobile/src/session/native-chat/transcript/MobileNativeChatDiffCard.tsx index 261373b2835..fa7d1eeecb6 100644 --- a/mobile/src/session/native-chat/MobileNativeChatDiffCard.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatDiffCard.tsx @@ -1,25 +1,25 @@ import { useMemo } from 'react' import { Pressable, Text, View } from 'react-native' -import { MobileNativeChatOwnedScrollView } from './transcript/MobileNativeChatOwnedScrollView' +import { MobileNativeChatOwnedScrollView } from './MobileNativeChatOwnedScrollView' import { ChevronRight, FileMinus2, FilePen, FilePlus2 } from 'lucide-react-native' -import { nativeChatEditFilePatchText } from '../../../../src/shared/native-chat/tools/native-chat-edit-cards' +import { nativeChatEditFilePatchText } from '../../../../../src/shared/native-chat/tools/native-chat-edit-cards' import { nativeChatEditFileBaseName, nativeChatEditGutterChars, unifiedLineNumber, type NativeChatEditFile, type NativeChatEditLine -} from '../../../../src/shared/native-chat/tools/native-chat-edit-model' -import { nativeChatToolRowVerbCopy } from './transcript/native-chat-tool-row-verb-copy' -import { nativeChatDiffCardCopy } from '../../source-control/review/native-chat-diff-card-copy' -import { useMobileTranslation } from '../../i18n/use-mobile-translation' -import { MobileSourceCopyButton } from '../../components/MobileSourceCopyButton' -import { colors, pressedStyle } from '../../theme/mobile-theme' -import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' -import { useMobileNativeChatOpenedDetail } from './visual/mobile-native-chat-opened-detail' -import { useMobileNativeChatDisclosure } from './transcript/mobile-native-chat-disclosure-store' -import { toolStyles as styles, toolType } from './transcript/mobile-native-chat-tool-styles' -import { useMobileNativeChatOpenFile } from './mobile-native-chat-open-file-context' +} from '../../../../../src/shared/native-chat/tools/native-chat-edit-model' +import { nativeChatToolRowVerbCopy } from './native-chat-tool-row-verb-copy' +import { nativeChatDiffCardCopy } from '../../../source-control/review/native-chat-diff-card-copy' +import { useMobileTranslation } from '../../../i18n/use-mobile-translation' +import { MobileSourceCopyButton } from '../../../components/MobileSourceCopyButton' +import { colors, pressedStyle } from '../../../theme/mobile-theme' +import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' +import { useMobileNativeChatOpenedDetail } from '../visual/mobile-native-chat-opened-detail' +import { useMobileNativeChatDisclosure } from './mobile-native-chat-disclosure-store' +import { toolStyles as styles, toolType } from './mobile-native-chat-tool-styles' +import { useMobileNativeChatOpenFile } from '../mobile-native-chat-open-file-context' function VerbIcon({ kind, size }: { kind: NativeChatEditFile['changeKind']; size: number }) { useMobileColorScheme() diff --git a/mobile/src/session/MobileNativeChatEmptyStateView.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatEmptyStateView.tsx similarity index 64% rename from mobile/src/session/MobileNativeChatEmptyStateView.tsx rename to mobile/src/session/native-chat/transcript/MobileNativeChatEmptyStateView.tsx index 69e33b7ccad..e58ef3da95d 100644 --- a/mobile/src/session/MobileNativeChatEmptyStateView.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatEmptyStateView.tsx @@ -1,6 +1,6 @@ import { Text, View } from 'react-native' -import type { NativeChatEmptyStateCopy } from '../../../src/shared/native-chat/native-chat-empty-state' -import { styles } from './native-chat/mobile-native-chat-view-styles' +import type { NativeChatEmptyStateCopy } from '../../../../../src/shared/native-chat/native-chat-empty-state' +import { styles } from '../mobile-native-chat-view-styles' export function MobileNativeChatEmptyStateView({ copy }: { copy: NativeChatEmptyStateCopy }) { return ( diff --git a/mobile/src/session/native-chat/MobileNativeChatFullContent.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatFullContent.tsx similarity index 87% rename from mobile/src/session/native-chat/MobileNativeChatFullContent.tsx rename to mobile/src/session/native-chat/transcript/MobileNativeChatFullContent.tsx index 537902265eb..aab95c37457 100644 --- a/mobile/src/session/native-chat/MobileNativeChatFullContent.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatFullContent.tsx @@ -1,27 +1,27 @@ import { useContext, useEffect, useMemo, useState } from 'react' import { Pressable, Text, View, type TextStyle } from 'react-native' -import { truncateToolDetail } from '../../../../src/shared/native-chat/tools/native-chat-tool-summary' +import { truncateToolDetail } from '../../../../../src/shared/native-chat/tools/native-chat-tool-summary' import { isNativeChatToolOutputClipped, nativeChatToolFullPayload, nativeChatToolOutputPartialSizes -} from '../../../../src/shared/native-chat/tools/native-chat-tool-output' +} from '../../../../../src/shared/native-chat/tools/native-chat-tool-output' import type { NativeChatMessage, NativeChatToolResultBlock -} from '../../../../src/shared/native-chat/native-chat-types' -import type { AgentJournalBoundedPayload } from '../../../../src/shared/agent-session/journal/agent-session-journal-types' -import { INLINE_TEXT_SELECTION } from '../../components/inline-text-selection' -import { styles } from './transcript/mobile-native-chat-message-styles' -import { toolStyles } from './transcript/mobile-native-chat-tool-styles' -import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' -import { useMobileTranslation } from '../../i18n/use-mobile-translation' -import { MobileNativeChatOwnedScrollView } from './transcript/MobileNativeChatOwnedScrollView' +} from '../../../../../src/shared/native-chat/native-chat-types' +import type { AgentJournalBoundedPayload } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' +import { INLINE_TEXT_SELECTION } from '../../../components/inline-text-selection' +import { styles } from './mobile-native-chat-message-styles' +import { toolStyles } from './mobile-native-chat-tool-styles' +import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' +import { useMobileTranslation } from '../../../i18n/use-mobile-translation' +import { MobileNativeChatOwnedScrollView } from './MobileNativeChatOwnedScrollView' import { MobileNativeChatItemSourceContext, readMobileNativeChatItem } from './mobile-native-chat-item-read' -import { pressedStyle } from '../../theme/mobile-theme' +import { pressedStyle } from '../../../theme/mobile-theme' // Keep full-content state per row so live transcript revisions cannot overwrite the reader’s requested expansion. diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatLiveLine.android.test.ts b/mobile/src/session/native-chat/transcript/MobileNativeChatLiveLine.android.test.ts index 8a7b534e6d5..1a0fcdacd7a 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatLiveLine.android.test.ts +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatLiveLine.android.test.ts @@ -28,7 +28,7 @@ vi.mock('./MobileNativeChatRewindDialog', () => ({ MobileNativeChatRewindDialog: vi.mock('./MobileNativeChatMessageActionsSheet', () => ({ MobileNativeChatMessageActionsSheet: 'MessageActionsSheet' })) -vi.mock('../../MobileLinkActionSheet', () => ({ MobileLinkActionSheet: 'LinkActionSheet' })) +vi.mock('./MobileLinkActionSheet', () => ({ MobileLinkActionSheet: 'LinkActionSheet' })) vi.mock('../visual/MobileNativeChatImageViewer', () => ({ MobileNativeChatImageViewer: 'ImageViewer' })) diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatLiveLine.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatLiveLine.tsx index 4b0c5ce1df1..c08be0a7f06 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatLiveLine.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatLiveLine.tsx @@ -2,7 +2,7 @@ import { useContext } from 'react' import { Pressable, Text, View } from 'react-native' import { ChevronRight } from 'lucide-react-native' import { nativeChatReasoningDisclosureKey } from '../../../../../src/shared/native-chat/transcript/native-chat-reasoning-row' -import { formatMobileNativeChatActiveTurnLabel } from '../native-chat-turn-status-copy' +import { formatMobileNativeChatActiveTurnLabel } from './native-chat-turn-status-copy' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' import { INLINE_TEXT_SELECTION } from '../../../components/inline-text-selection' import { LoadingSpinner } from '../../../components/LoadingSpinner' diff --git a/mobile/src/session/native-chat/MobileNativeChatLongPressContent.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatLongPressContent.tsx similarity index 100% rename from mobile/src/session/native-chat/MobileNativeChatLongPressContent.tsx rename to mobile/src/session/native-chat/transcript/MobileNativeChatLongPressContent.tsx diff --git a/mobile/src/session/native-chat/MobileNativeChatMarkdown.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatMarkdown.tsx similarity index 73% rename from mobile/src/session/native-chat/MobileNativeChatMarkdown.tsx rename to mobile/src/session/native-chat/transcript/MobileNativeChatMarkdown.tsx index 399e14a473f..fbd25176b08 100644 --- a/mobile/src/session/native-chat/MobileNativeChatMarkdown.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatMarkdown.tsx @@ -1,6 +1,6 @@ import type { ComponentProps } from 'react' -import { MobileMarkdown } from '../../components/MobileMarkdown' -import { useMobileNativeChatOpenFile } from './mobile-native-chat-open-file-context' +import { MobileMarkdown } from '../../../components/MobileMarkdown' +import { useMobileNativeChatOpenFile } from '../mobile-native-chat-open-file-context' /** Chat markdown: generic markdown with the chat's file opener, so file paths in any chat text open, * and desktop chat's math delimiters. */ diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.status-notices.test.ts b/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.status-notices.test.ts deleted file mode 100644 index a6e395f3ff7..00000000000 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.status-notices.test.ts +++ /dev/null @@ -1,212 +0,0 @@ -import { createElement, type ReactNode } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, describe, expect, it, vi } from 'vitest' -import type { AgentJournalStatusItem } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' -import { projectStructuredItemToNativeChat } from '../../../../../src/shared/agent-session/view/structured-agent-session-projection' -import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' -import { colors } from '../../../theme/mobile-theme' -import { activateMobileUiLocale } from '../../../i18n/mobile-i18n' -import { MarkdownLinkHandlerContext } from '../../../components/markdown-link-handler' - -vi.mock('react-native', async () => { - const React = await import('react') - const Text = ({ children, ...props }: { children?: ReactNode }): unknown => - React.createElement('Text', props, children) - return { - ActivityIndicator: 'ActivityIndicator', - Animated: { - Text, - Value: class { - setValue(): void {} - }, - loop: (animation: unknown) => animation, - sequence: () => ({ start: vi.fn(), stop: vi.fn() }), - timing: () => ({ start: vi.fn(), stop: vi.fn() }) - }, - Image: 'Image', - Platform: { OS: 'ios' }, - Pressable: 'Pressable', - ScrollView: ({ children, ...props }: { children?: ReactNode }) => - React.createElement('ScrollView', props, children), - Text, - View: ({ children, ...props }: { children?: ReactNode }) => - React.createElement('View', props, children), - StyleSheet: { create: (styles: unknown) => styles, hairlineWidth: 1 }, - useWindowDimensions: () => ({ width: 400, height: 800 }) - } -}) -vi.mock('expo-clipboard', () => ({ setStringAsync: vi.fn() })) -vi.mock('lucide-react-native', () => ({ - AlertCircle: 'AlertCircle', - AlertTriangle: 'AlertTriangle', - ArrowUp: 'ArrowUp', - Bot: 'Bot', - Brain: 'Brain', - Check: 'Check', - ChevronDown: 'ChevronDown', - ChevronRight: 'ChevronRight', - CircleCheck: 'CircleCheck', - CircleX: 'CircleX', - Copy: 'Copy', - Eye: 'Eye', - FileMinus2: 'FileMinus2', - FilePen: 'FilePen', - FilePlus2: 'FilePlus2', - Folder: 'Folder', - Globe: 'Globe', - Info: 'Info', - ListChecks: 'ListChecks', - MessageSquareMore: 'MessageSquareMore', - Pencil: 'Pencil', - Plug: 'Plug', - Search: 'Search', - SquareChevronRight: 'SquareChevronRight', - SquareTerminal: 'SquareTerminal', - Wrench: 'Wrench' -})) -vi.mock('../../../components/MobileMarkdown', () => ({ MobileMarkdown: 'MobileMarkdown' })) -vi.mock('./MobileNativeChatMessageActionsSheet', () => ({ - MobileNativeChatMessageActionsSheet: 'MessageActionsSheet' -})) - -import { MobileNativeChatMessage } from './MobileNativeChatMessage' - -describe('MobileNativeChatMessage status notices', () => { - let renderer: ReactTestRenderer | null = null - - afterEach(async () => { - act(() => renderer?.unmount()) - renderer = null - await activateMobileUiLocale('en') - }) - - function render(message: NativeChatMessage): ReactTestRenderer { - act(() => { - renderer = create(createElement(MobileNativeChatMessage, { message })) - }) - return renderer! - } - - const statusRow = (body: AgentJournalStatusItem): NativeChatMessage => - projectStructuredItemToNativeChat({ - itemId: 'status', - revision: 1, - sequence: 2, - observedAt: 2, - body - })! - - it('links a CI result line to its pull request and commit through the link sheet', () => { - const openLink = vi.fn() - act(() => { - renderer = create( - createElement( - MarkdownLinkHandlerContext.Provider, - { value: openLink }, - createElement(MobileNativeChatMessage, { - message: { - // The journal key percent-encodes the line's client message id. - id: 'orca:pr-event%3Agithub.com%2Facme%2Frepo%233%3A8d5f74b0c1%3A1', - role: 'system', - blocks: [ - { - type: 'text', - text: 'CI failing on repo#3 at 8d5f74b', - presentation: 'pull-request-event', - tone: 'failure' - } - ], - timestamp: 0, - source: 'transcript' - } - }) - ) - ) - }) - const links = renderer!.root.findAll( - (node) => String(node.type) === 'Text' && node.props.accessibilityRole === 'link' - ) - // The whole lead is the PR's target, so a lead the ellipsis cuts still opens it. - expect(links.map((link) => link.props.accessibilityLabel ?? link.props.children)).toEqual([ - 'CI failing on repo#3', - '8d5f74b' - ]) - links.forEach((link) => act(() => link.props.onPress())) - expect(openLink.mock.calls).toEqual([ - ['https://github.com/acme/repo/pull/3'], - ['https://github.com/acme/repo/commit/8d5f74b0c1'] - ]) - }) - - // Protocol-shaped synthetic frames, not a live-provider reproduction. - it.each([ - [ - 'codex', - 'notification:guardianWarning', - 'warning', - 'Codex reported a safety review warning. View details.', - 'Codex a signalé un avertissement de sécurité. Voir les détails.', - colors.statusAmber - ] - ] as const)( - 'discloses the entire available %s notice without tool-output clipping or recovery', - async (provider, kind, tone, heading, french, color) => { - const text = `${'安全 '.repeat(1500)}EXPLANATION_SENTINEL` - const head = `{"partial":"${'é'.repeat(4500)}PAYLOAD_SENTINEL` - const tree = render( - statusRow({ - kind: 'status', - text, - tone, - providerFrame: { - provider, - kind, - payload: { head, byteLength: 99999, digest: 'synthetic', truncated: true } - } - }) - ) - const button = () => - tree.root.find( - (node) => - String(node.type) === 'Pressable' && - node.props.accessibilityLabel?.includes('View details.') - ) - expect(button().props.accessibilityLabel).toBe(heading) - expect(button().props['aria-expanded']).toBe(false) - const detailTexts = () => - tree.root.findAll( - (node) => - String(node.type) === 'Text' && - node.props.selectable === true && - Array.isArray(node.props.children) && - node.props.children.includes(text) - ) - expect(detailTexts()).toHaveLength(0) - act(() => button().props.onPress()) - expect(button().props['aria-expanded']).toBe(true) - const detail = detailTexts()[0] - expect(detail.props.children.join('')).toContain(text) - expect(detail.props.children.join('')).toContain(head) - expect(detail.props.children.join('')).toContain( - 'Provider response truncated (original size: 99999 bytes).' - ) - expect(Object.assign({}, ...detail.props.style)).toMatchObject({ color }) - expect( - tree.root.findAll( - (node) => - String(node.type) === 'Text' && String(node.props.children).includes('Show full output') - ) - ).toHaveLength(0) - await act(() => activateMobileUiLocale('fr')) - const translated = tree.root.find( - (node) => String(node.type) === 'Pressable' && node.props.accessibilityLabel === french - ) - expect(translated.props['aria-expanded']).toBe(true) - expect(detailTexts()[0].props.children.join('')).toContain( - 'Réponse du fournisseur tronquée (taille d’origine : 99999 octets).' - ) - act(() => translated.props.onPress()) - expect(detailTexts()).toHaveLength(0) - } - ) -}) diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.tool-result-availability.test.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.tool-result-availability.test.tsx index d43988aaf5c..d6b44de0b81 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.tool-result-availability.test.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.tool-result-availability.test.tsx @@ -1,15 +1,7 @@ -import { createElement, Fragment, type ReactNode } from 'react' +import { createElement, type ReactNode } from 'react' import { act, create, type ReactTestInstance, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, describe, expect, it, vi } from 'vitest' import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' -import type { - AgentJournalItemBody, - AgentJournalRenderItem -} from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' - -import { projectStructuredItemsToNativeChat } from '../../../../../src/shared/agent-session/view/structured-agent-session-projection' -import { foldMobileNativeChatMessages } from '../mobile-native-chat-render-data' -import { useMobileNativeChatTurnDisclosure } from './use-mobile-native-chat-turn-disclosure' vi.mock('react-native', async () => { const React = await import('react') @@ -118,21 +110,6 @@ describe('mobile tool result availability', () => { vi.restoreAllMocks() }) - function render(row: NativeChatMessage, openRun = true): ReactTestRenderer { - act(() => { - renderer = create(createElement(MobileNativeChatMessage, { message: row })) - }) - if (openRun) { - press( - renderer!.root.find( - (node) => - String(node.type) === 'Pressable' && node.props.accessibilityLiveRegion === 'polite' - ) - ) - } - return renderer! - } - // The page's window unmounts a row scrolled past; older messages joining its fold change its id. it('keeps what the reader opened in a windowed-out row by its row key', () => { const row = message([ @@ -177,175 +154,4 @@ describe('mobile tool result availability', () => { expect(textIn(renderer!.root)).toContain('first output') expect(textIn(renderer!.root)).not.toContain('second output') }) - - it('gives a named completion to its own call past silent calls, not to the first', () => { - const calls: NativeChatMessage['blocks'] = Array.from({ length: 18 }, (_, index) => ({ - type: 'tool-call', - callId: `call-${index}`, - name: 'Bash', - input: { command: `command ${index}` } - })) - const raw = message([ - ...calls, - { type: 'tool-result', callId: 'call-17', output: 'late named output' } - ]) - const [row] = foldMobileNativeChatMessages([raw], 'claude') - const tree = render(row!) - expect(toolLines(tree.root)).toHaveLength(18) - expect(textIn(tree.root)).not.toContain('late named output') - press(button(tree.root, 'command 17')) - expect(textIn(tree.root)).toContain('late named output') - press(button(tree.root, 'command 17')) - expect(button(tree.root, 'command 0').props.disabled).toBe(true) - }) - - it.each([true, false])( - 'draws derived outputs ahead of a prompt queued while stopping (host scopes: %s)', - (hasScopes) => { - function item( - itemId: string, - sequence: number, - body: AgentJournalItemBody - ): AgentJournalRenderItem { - return { - itemId, - sequence, - body, - revision: 1, - observedAt: sequence, - ...(hasScopes - ? { - turnScope: - sequence <= 2 - ? { kind: 'thread' as const } - : { kind: 'turn' as const, turnItemId: 'turn' } - } - : {}) - } - } - const items = [ - item('prompt', 1, { - kind: 'message', - role: 'user', - blocks: [{ type: 'text', text: 'question' }] - }), - item('turn', 2, { kind: 'turn', turnId: 'turn', userItemId: 'prompt', state: 'running' }), - item('working-call', 3, { - kind: 'tool-call', - callId: 'working', - name: 'Bash', - input: 'still working', - state: 'running' - }), - item('queued', 4, { - kind: 'message', - role: 'user', - blocks: [{ type: 'text', text: 'queued question' }] - }), - item('source', 5, { - kind: 'message', - role: 'assistant', - blocks: [ - { type: 'text', text: 'source context' }, - { type: 'tool-result', callId: 'unavailable-a', output: 'output one\nfull one' }, - { type: 'tool-result', callId: 'unavailable-b', output: 'output two\nfull two' } - ] - }) - ] - let drawn: NativeChatMessage[] = [] - let waiting: string[] = [] - let live: string[] = [] - function Phone({ journal }: { journal: AgentJournalRenderItem[] }): React.JSX.Element { - const raw = projectStructuredItemsToNativeChat(journal).map((row) => - row.id === 'queued' ? { ...row, queued: true as const } : row - ) - const rows = foldMobileNativeChatMessages(raw, 'claude') - const disclosure = useMobileNativeChatTurnDisclosure({ - messages: rows, - enabled: true, - isWorking: true, - stopping: true, - turnJournal: { items: journal, submissions: [] }, - scopeKey: 'remote-host\0folder\0tab' - }) - drawn = Array.from(disclosure.listMessages) - waiting = disclosure.waitingRows.map((row) => row.item.id) - live = drawn.flatMap((row, index) => - disclosure.resolveRow(index, row).activeTurnIsWorking ? [row.id] : [] - ) - return createElement( - Fragment, - null, - ...drawn.map((row, index) => - createElement(MobileNativeChatMessage, { - key: row.id, - message: row, - ...disclosure.resolveRow(index, row), - structuredActivityUi: true - }) - ) - ) - } - act(() => { - renderer = create(createElement(Phone, { journal: items })) - }) - const tree = renderer! - const headers = () => - tree.root.findAll( - (node) => - String(node.type) === 'Pressable' && node.props.accessibilityLiveRegion === 'polite' - ) - for (let index = 0; index < headers().length; index += 1) { - press(headers()[index]!) - } - for (let index = 0; index < toolLines(tree.root).length; index += 1) { - press(toolLines(tree.root)[index]!) - } - const orphan = drawn.find((row) => row.role === 'tool')! - expect(orphan.id).not.toBe('source') - expect(orphan.journalPosition).toEqual({ sequence: 5, index: 0 }) - expect(drawn.map((row) => row.id)).toEqual(['prompt', 'working-call', 'source', orphan.id]) - expect(waiting).toEqual(['queued']) - expect(live).toContain(orphan.id) - expect(toolLines(tree.root)).toHaveLength(3) - expect(textIn(tree.root)).toContain('output one\nfull one') - expect(textIn(tree.root)).toContain('output two\nfull two') - const firstOutput = button(tree.root, 'output one') - act(() => tree.update(createElement(Phone, { journal: structuredClone(items) }))) - expect(drawn.find((row) => row.role === 'tool')?.id).toBe(orphan.id) - expect(waiting).toEqual(['queued']) - expect(button(tree.root, 'output one')).toBe(firstOutput) - expect(foldMobileNativeChatMessages(drawn, 'claude')).toEqual(drawn) - } - ) - - it('keeps duplicate-ID rows independently open as results and later rows arrive', () => { - const initial = message([ - { type: 'tool-call', callId: 'duplicate', name: 'Bash', input: 'first input' }, - { type: 'tool-call', callId: 'duplicate', name: 'Bash', input: 'second input' }, - { type: 'tool-result', callId: 'duplicate', output: 'first output' } - ]) - const tree = render(initial) - const first = button(tree.root, 'first input') - const second = button(tree.root, 'second input') - press(first) - expect(textIn(tree.root)).toContain('first output') - const updated = message([ - { type: 'tool-call', callId: 'duplicate', name: 'Bash', input: 'changed first input' }, - { type: 'tool-call', callId: 'duplicate', name: 'Bash', input: 'changed second input' }, - { type: 'tool-result', callId: 'duplicate', output: 'first output' }, - { type: 'tool-result', callId: 'duplicate', output: 'second output' }, - { type: 'tool-call', callId: 'later', name: 'Bash', input: 'later input' } - ]) - act(() => tree.update(createElement(MobileNativeChatMessage, { message: updated }))) - expect(button(tree.root, 'changed first input')).toBe(first) - expect(button(tree.root, 'changed second input')).toBe(second) - expect(textIn(tree.root)).toContain('first output') - expect(textIn(tree.root)).not.toContain('second output') - press(second) - expect(textIn(tree.root)).toContain('second output') - press(first) - expect(textIn(tree.root)).not.toContain('first output') - expect(textIn(tree.root)).toContain('second output') - }) }) diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.tsx index 57100b34894..ab29aada0df 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatMessage.tsx @@ -1,7 +1,7 @@ import { memo, useCallback, useContext, useLayoutEffect, useMemo, useRef } from 'react' import { Text, View } from 'react-native' import { INLINE_TEXT_SELECTION } from '../../../components/inline-text-selection' -import { MobileNativeChatLongPressContent as Content } from '../MobileNativeChatLongPressContent' +import { MobileNativeChatLongPressContent as Content } from './MobileNativeChatLongPressContent' import { splitNativeChatBlocks } from '../../../../../src/shared/native-chat/tools/native-chat-tool-fold' import { nativeChatToolRunViewedImages } from '../../../../../src/shared/native-chat/tools/native-chat-tool-viewed-images' import { selectActiveToolCall } from '../../../../../src/shared/native-chat/tools/native-chat-tool-activity' @@ -15,7 +15,7 @@ import { MobileNativeChatGroupedThought, MobileNativeChatReasoningRow } from './MobileNativeChatReasoningRow' -import { mobileNativeChatRowId } from '../../mobile-native-chat-reading-place' +import { mobileNativeChatRowId } from './mobile-native-chat-reading-place' import { nativeChatWorkRunEntries } from '../../../../../src/shared/native-chat/native-chat-work-run' import { nativeChatReasoningDisclosureKey } from '../../../../../src/shared/native-chat/transcript/native-chat-reasoning-row' import { MobileNativeChatTurnStatus } from './MobileNativeChatTurnStatus' @@ -27,7 +27,7 @@ import { MobileNativeChatUserMessageFold } from './MobileNativeChatUserMessageFo import { TextAttachmentActions } from './MobileNativeChatTextAttachmentActions' import { MobileNativeChatMessageMeta } from './MobileNativeChatMessageMeta' import { MobileNativeChatAwaitingInputRow } from './MobileNativeChatAwaitingInputRow' -import { MobileNativeChatResolutionReceipt } from '../MobileNativeChatResolutionReceipt' +import { MobileNativeChatResolutionReceipt } from './MobileNativeChatResolutionReceipt' import { nativeChatAskRunBlocks, nativeChatAskRunSubject @@ -41,7 +41,7 @@ import type { NativeChatTurnStatus } from '../../../../../src/shared/native-chat import { styles } from './mobile-native-chat-message-styles' import { MobileNativeChatAgentMessageCard } from './MobileNativeChatAgentMessageCard' import { MobileNativeChatVisualContext } from '../visual/mobile-native-chat-visual-context' -import { useMobileNativeChatFullMessage } from '../MobileNativeChatFullContent' +import { useMobileNativeChatFullMessage } from './MobileNativeChatFullContent' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' import { MobileNativeChatPacedProse } from './MobileNativeChatPacedProse' diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatNoticeRow.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatNoticeRow.tsx index b849b08da44..c1b8600e34d 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatNoticeRow.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatNoticeRow.tsx @@ -21,14 +21,14 @@ import { readWholeAgentSessionFailureFact } from '../../../../../src/shared/agent-session/failures/agent-session-failure' import { agentSessionFailureSentence } from '../../../../../src/shared/agent-session/failures/agent-session-failure-words' -import { agentSessionRemoteSignInCommand } from '../../../../../src/shared/agent-session/lifecycle/agent-session-sign-in' +import { agentSessionSignInCommand } from '../../../../../src/shared/agent-session/lifecycle/agent-session-setup-commands' import { nativeChatOrcaStopRowText } from '../../../../../src/shared/native-chat/native-chat-orca-stop-words' import { MobileNativeChatForkedFromContext, MobileNativeChatNoticeContext, type MobileNativeChatNoticeView -} from '../../mobile-native-chat-notice-context' -import { MobileNativeChatMarkdown } from '../MobileNativeChatMarkdown' +} from './mobile-native-chat-notice-context' +import { MobileNativeChatMarkdown } from './MobileNativeChatMarkdown' import { INLINE_TEXT_SELECTION } from '../../../components/inline-text-selection' import { colors, radii, spacing, typography } from '../../../theme/mobile-theme' import { themedStyleSheet } from '../../../theme/themed-styles' @@ -36,7 +36,7 @@ import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' import { nativeChatHostStatusCopy, nativeChatNoticeCopy } from './native-chat-notice-copy' import { nativeChatOrcaStopSay } from './native-chat-orca-stop-copy' import { nativeChatUsageLimitText } from './native-chat-usage-limit-copy' -import { sayMobileAgentSessionFailure } from '../../agent-session-failure-copy' +import { sayMobileAgentSessionFailure } from '../agent-session/agent-session-failure-copy' import type { Translate } from '../../../i18n/mobile-i18n' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' import { NATIVE_CHAT_STOPPED_BEFORE_START_PRESENTATION } from '../../../../../src/shared/native-chat/native-chat-stopped-before-start' @@ -73,7 +73,15 @@ function noticeLineText( // Only reword text fully described by its fact; other host text stays as written. const context = { agentName: names.agentName } const surface = - failure?.kind === 'savedConversationMissing' || failure?.kind === 'pluginInputRequired' + failure && + [ + 'savedConversationMissing', + 'pluginInputRequired', + 'modelUnavailable', + 'providerUnavailable', + 'providerSafetyStopped', + 'providerResponseFailed' + ].includes(failure.kind) ? (['row', 'rejection'] as const).find( (candidate) => notice.text === agentSessionFailureSentence(failure, candidate, context) ) @@ -119,7 +127,7 @@ export function MobileNativeChatNoticeRow({ const failureDetail = agentSessionFailureDetailText(failure) const signInCommand = failure?.kind === 'notSignedIn' - ? agentSessionRemoteSignInCommand(names.agentName, failure.account) + ? agentSessionSignInCommand(names.agentName, { account: failure.account, remote: true }) : null const runInTerminal = names.onRunInTerminal const detail = failureDetail?.trim() !== lineText.trim() ? failureDetail : undefined diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatPageList.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatPageList.tsx index bc8f623b1cb..3ab666638f9 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatPageList.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatPageList.tsx @@ -27,14 +27,14 @@ import { mobileNativeChatRowBoxProps, type MobileNativeChatReadingUnit, type MobileNativeChatScrollNode -} from '../../mobile-native-chat-reading-place' +} from './mobile-native-chat-reading-place' import type { MobileNativeChatListHandle } from './use-mobile-native-chat-tail-follow' import type { MobileNativeChatScrollRoots } from './mobile-native-chat-scroll-roots' -import { scrollWritesStopMomentum } from '../../mobile-native-chat-scroll-motion' +import { scrollWritesStopMomentum } from './mobile-native-chat-scroll-motion' import { createMobileNativeChatGrowthHold, MobileNativeChatGrowthHoldContext -} from '../../mobile-native-chat-growth-hold' +} from './mobile-native-chat-growth-hold' const FIRST_ROWS = 24 const DRAW_BATCH = 12 diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatProse.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatProse.tsx index 69dc694ba84..f1df5cb06c7 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatProse.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatProse.tsx @@ -1,7 +1,7 @@ import { useCallback, useContext, useEffect, useState } from 'react' import { Image, Pressable, Text, View } from 'react-native' import { INLINE_TEXT_SELECTION } from '../../../components/inline-text-selection' -import { MobileNativeChatMarkdown } from '../MobileNativeChatMarkdown' +import { MobileNativeChatMarkdown } from './MobileNativeChatMarkdown' import { isImageRefBlock, isTextBlock, diff --git a/mobile/src/session/native-chat/MobileNativeChatQuestionText.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatQuestionText.tsx similarity index 88% rename from mobile/src/session/native-chat/MobileNativeChatQuestionText.tsx rename to mobile/src/session/native-chat/transcript/MobileNativeChatQuestionText.tsx index ff0069026fb..ccd2cb29a48 100644 --- a/mobile/src/session/native-chat/MobileNativeChatQuestionText.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatQuestionText.tsx @@ -1,7 +1,7 @@ import type { ComponentProps } from 'react' import { View, type StyleProp, type ViewStyle } from 'react-native' -import { styles as markdownStyles } from '../../components/mobile-markdown-styles' -import { typography } from '../../theme/mobile-theme' +import { styles as markdownStyles } from '../../../components/mobile-markdown-styles' +import { typography } from '../../../theme/mobile-theme' import { MobileNativeChatMarkdown } from './MobileNativeChatMarkdown' type Props = Pick< diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatReasoningRow.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatReasoningRow.tsx index d07ead88bed..acda77606de 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatReasoningRow.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatReasoningRow.tsx @@ -1,4 +1,4 @@ -import { mobileNativeChatMemberId } from '../../mobile-native-chat-reading-place' +import { mobileNativeChatMemberId } from './mobile-native-chat-reading-place' import { useState } from 'react' import { Pressable, Text, View } from 'react-native' import { MobileNativeChatOwnedScrollView } from './MobileNativeChatOwnedScrollView' @@ -10,11 +10,11 @@ import { } from '../../../../../src/shared/native-chat/transcript/native-chat-reasoning-row' import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' import { deriveNativeChatRowContent } from '../../../../../src/shared/native-chat/transcript/native-chat-row-content' -import { useMobileNativeChatFullMessage } from '../MobileNativeChatFullContent' -import { MobileNativeChatMarkdown } from '../MobileNativeChatMarkdown' +import { useMobileNativeChatFullMessage } from './MobileNativeChatFullContent' +import { MobileNativeChatMarkdown } from './MobileNativeChatMarkdown' import { colors } from '../../../theme/mobile-theme' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' -import { MobileNativeChatLongPressContent } from '../MobileNativeChatLongPressContent' +import { MobileNativeChatLongPressContent } from './MobileNativeChatLongPressContent' import { CHAT_PROSE_SCALE, styles } from './mobile-native-chat-message-styles' /** A grouped thought keeps its own source recovery when its original transcript row is hidden. */ diff --git a/mobile/src/session/native-chat/MobileNativeChatResolutionReceipt.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatResolutionReceipt.tsx similarity index 82% rename from mobile/src/session/native-chat/MobileNativeChatResolutionReceipt.tsx rename to mobile/src/session/native-chat/transcript/MobileNativeChatResolutionReceipt.tsx index 5aaab6a6ce0..4f026ad8cfc 100644 --- a/mobile/src/session/native-chat/MobileNativeChatResolutionReceipt.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatResolutionReceipt.tsx @@ -5,17 +5,17 @@ import { nativeChatReceiptDevice, nativeChatReceiptSubject, type NativeChatResolvedPrompt -} from '../../../../src/shared/native-chat/native-chat-resolution-receipt' -import { nativeChatReceiptCopy } from '../native-chat-receipt-copy' -import { useMobileTranslation } from '../../i18n/use-mobile-translation' -import { INLINE_TEXT_SELECTION } from '../../components/inline-text-selection' -import { colors, spacing, typography } from '../../theme/mobile-theme' -import { MobileNativeChatAwaitingInputRow } from './transcript/MobileNativeChatAwaitingInputRow' +} from '../../../../../src/shared/native-chat/native-chat-resolution-receipt' +import { nativeChatReceiptCopy } from './native-chat-receipt-copy' +import { useMobileTranslation } from '../../../i18n/use-mobile-translation' +import { INLINE_TEXT_SELECTION } from '../../../components/inline-text-selection' +import { colors, spacing, typography } from '../../../theme/mobile-theme' +import { MobileNativeChatAwaitingInputRow } from './MobileNativeChatAwaitingInputRow' import { MobileNativeChatQuestionText } from './MobileNativeChatQuestionText' -import { scaledType } from './transcript/mobile-native-chat-message-styles' -import { MobileNativeChatMessageTime } from './transcript/MobileNativeChatMessageTime' -import { themedStyleSheet } from '../../theme/themed-styles' -import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' +import { scaledType } from './mobile-native-chat-message-styles' +import { MobileNativeChatMessageTime } from './MobileNativeChatMessageTime' +import { themedStyleSheet } from '../../../theme/themed-styles' +import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' export function MobileNativeChatResolutionReceipt({ body, diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatRowItemSource.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatRowItemSource.tsx index fbe0ff64203..2aca8478910 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatRowItemSource.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatRowItemSource.tsx @@ -7,7 +7,7 @@ import { memo, useContext, useMemo, type ComponentProps } from 'react' import { MobileNativeChatItemSourceContext, MobileNativeChatRootItemSourceContext -} from '../mobile-native-chat-item-read' +} from './mobile-native-chat-item-read' import { MobileNativeChatMessage } from './MobileNativeChatMessage' import { resolveMobileNativeChatRowProps, diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatRowOverlaysHost.test.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatRowOverlaysHost.test.tsx index b103c43ec36..c6a5a70f8f6 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatRowOverlaysHost.test.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatRowOverlaysHost.test.tsx @@ -29,7 +29,7 @@ vi.mock('./MobileNativeChatRewindDialog', () => ({ MobileNativeChatRewindDialog: vi.mock('./MobileNativeChatMessageActionsSheet', () => ({ MobileNativeChatMessageActionsSheet: 'MessageActionsSheet' })) -vi.mock('../../MobileLinkActionSheet', () => ({ MobileLinkActionSheet: 'LinkActionSheet' })) +vi.mock('./MobileLinkActionSheet', () => ({ MobileLinkActionSheet: 'LinkActionSheet' })) vi.mock('../visual/MobileImageViewerActions', () => ({ MobileImageViewerActions: 'ImageViewerActions' })) diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatRowOverlaysHost.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatRowOverlaysHost.tsx index 04c59b46132..49f233a0224 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatRowOverlaysHost.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatRowOverlaysHost.tsx @@ -5,7 +5,7 @@ import { triggerMediumImpact } from '../../../platform/haptics' import { MobileNativeChatImageViewer } from '../visual/MobileNativeChatImageViewer' import { MobileImageViewerActions } from '../visual/MobileImageViewerActions' import { MobileNativeChatMessageActionsSheet } from './MobileNativeChatMessageActionsSheet' -import { MobileLinkActionSheet } from '../../MobileLinkActionSheet' +import { MobileLinkActionSheet } from './MobileLinkActionSheet' import { MarkdownLinkHandlerContext } from '../../../components/markdown-link-handler' import { MobileNativeChatRowOverlaysContext, diff --git a/mobile/src/session/MobileNativeChatScrollRootsBoundary.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatScrollRootsBoundary.tsx similarity index 86% rename from mobile/src/session/MobileNativeChatScrollRootsBoundary.tsx rename to mobile/src/session/native-chat/transcript/MobileNativeChatScrollRootsBoundary.tsx index 3c75a385228..9dc4cf30b88 100644 --- a/mobile/src/session/MobileNativeChatScrollRootsBoundary.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatScrollRootsBoundary.tsx @@ -1,7 +1,7 @@ import { Component } from 'react' import { Platform } from 'react-native' -import type { MobileNativeChatRowKeys } from './native-chat/transcript/mobile-native-chat-row-keys' -import type { MobileNativeChatScrollRoots } from './native-chat/transcript/mobile-native-chat-scroll-roots' +import type { MobileNativeChatRowKeys } from './mobile-native-chat-row-keys' +import type { MobileNativeChatScrollRoots } from './mobile-native-chat-scroll-roots' type Props = { children?: React.ReactNode diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatToolLine.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatToolLine.tsx index 39558247e75..53e3f3e2650 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatToolLine.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatToolLine.tsx @@ -26,7 +26,7 @@ import { colors, pressedStyle } from '../../../theme/mobile-theme' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' import { highlightMobileCode } from '../../../files/session-documents/mobile-file-syntax' import { MobileNativeChatToolGlyph } from './MobileNativeChatToolIcon' -import { MobileNativeChatToolOutput } from '../MobileNativeChatFullContent' +import { MobileNativeChatToolOutput } from './MobileNativeChatFullContent' import { useMobileNativeChatOpenedDetail } from '../visual/mobile-native-chat-opened-detail' import { useMobileNativeChatDisclosure } from './mobile-native-chat-disclosure-store' import { toolStyles as styles, toolType } from './mobile-native-chat-tool-styles' diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatToolRun.test.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatToolRun.test.tsx index 57f217b8611..5bd9a52d583 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatToolRun.test.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatToolRun.test.tsx @@ -165,50 +165,6 @@ describe('ToolRun', () => { }) }) - it('follows new work at the end of a live run, but holds still when the reader opens a row', () => { - const live = (blocks: NativeChatBlock[]) => - createElement(ToolRun, { - blocks, - activeTurnIsWorking: true, - trailing: true - }) - const first: NativeChatBlock[] = [ - { type: 'tool-call', name: 'Bash', input: { command: 'ls' }, state: 'completed' }, - { type: 'tool-result', output: 'a.ts' } - ] - act(() => { - renderer = create(live(first)) - }) - openRun(renderer!) - const box = () => renderer!.root.findAll((node) => String(node.type) === 'ScrollView')[0]! - act(() => { - box().props.onContentSizeChange() - }) - scrolls.toEnd.mockClear() - act(() => { - renderer!.root - .findAll((node) => String(node.type) === 'Pressable') - .findLast((node) => textIn(node).includes('ls'))! - .props.onPress() - }) - act(() => { - box().props.onContentSizeChange() - }) - expect(scrolls.toEnd).not.toHaveBeenCalled() - act(() => { - renderer!.update( - live([ - ...first, - { type: 'tool-call', name: 'Bash', input: { command: 'pwd' }, state: 'running' } - ]) - ) - }) - act(() => { - box().props.onContentSizeChange() - }) - expect(scrolls.toEnd).toHaveBeenCalledTimes(1) - }) - it('does not save a follow for a later row opening when new work left the height unchanged', () => { const live = (blocks: NativeChatBlock[]) => createElement(ToolRun, { diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatToolRun.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatToolRun.tsx index 852d0421203..2833156b26b 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatToolRun.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatToolRun.tsx @@ -33,7 +33,7 @@ import { colors, pressedStyle } from '../../../theme/mobile-theme' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' import { MobileNativeChatToolGlyph } from './MobileNativeChatToolIcon' import { MobileNativeChatToolLine } from './MobileNativeChatToolLine' -import { MobileNativeChatDiffCard } from '../MobileNativeChatDiffCard' +import { MobileNativeChatDiffCard } from './MobileNativeChatDiffCard' import { MobileNativeChatTaskList } from '../input/MobileNativeChatTaskList' import { MobileNativeChatOpenedDetailContext } from '../visual/mobile-native-chat-opened-detail' import { @@ -42,7 +42,7 @@ import { useMobileNativeChatDisclosure } from './mobile-native-chat-disclosure-store' import { toolStyles as styles, toolType } from './mobile-native-chat-tool-styles' -import { mobileNativeChatMemberId } from '../../mobile-native-chat-reading-place' +import { mobileNativeChatMemberId } from './mobile-native-chat-reading-place' import { MobileNativeChatOwnedScrollView } from './MobileNativeChatOwnedScrollView' import type { MobileNativeChatToolRunAsides, diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatTurnDiffRollup.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatTurnDiffRollup.tsx index cf68fbc59a4..7ab1d87549a 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatTurnDiffRollup.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatTurnDiffRollup.tsx @@ -6,7 +6,7 @@ import { type NativeChatTurnDiff, type NativeChatTurnDiffFile } from '../../../../../src/shared/native-chat/tools/native-chat-turn-diffs' -import { MobileNativeChatDiffCard } from '../MobileNativeChatDiffCard' +import { MobileNativeChatDiffCard } from './MobileNativeChatDiffCard' import { useMobileNativeChatDisclosure } from './mobile-native-chat-disclosure-store' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatTurnStatus.test.ts b/mobile/src/session/native-chat/transcript/MobileNativeChatTurnStatus.test.ts deleted file mode 100644 index 52ae2dd631a..00000000000 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatTurnStatus.test.ts +++ /dev/null @@ -1,147 +0,0 @@ -import { createElement, type ReactNode } from 'react' -import { act, create, type ReactTestInstance, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { AppStateStatus } from 'react-native' - -const appState = vi.hoisted(() => ({ - current: 'active', - listeners: new Set<(state: AppStateStatus) => void>() -})) - -vi.mock('react-native', async () => { - const React = await import('react') - const Text = ({ children, ...props }: { children?: ReactNode }): unknown => - React.createElement('Text', props, children) - return { - AppState: { - get currentState() { - return appState.current - }, - addEventListener: (_event: string, listener: (state: AppStateStatus) => void) => { - appState.listeners.add(listener) - return { - remove: () => { - appState.listeners.delete(listener) - } - } - } - }, - ActivityIndicator: (props: Record) => - React.createElement('ActivityIndicator', props), - Pressable: ({ children, ...props }: { children?: ReactNode }) => - React.createElement('Pressable', props, children), - Text, - View: ({ children, ...props }: { children?: ReactNode }) => - React.createElement('View', props, children), - StyleSheet: { create: (styles: unknown) => styles, hairlineWidth: 1 } - } -}) -vi.mock('lucide-react-native', () => ({ ChevronRight: 'ChevronRight' })) - -import { MobileNativeChatTurnStatus } from './MobileNativeChatTurnStatus' -import { findAllByHostType } from '../../../test-support/react-test-renderer-host-nodes' - -const labels = (node: ReactTestInstance): string[] => - findAllByHostType(node, 'Text').map((text) => String(text.children.join(''))) - -let renderer: ReactTestRenderer | null = null - -beforeEach(() => { - vi.useFakeTimers() - vi.setSystemTime(new Date('2026-09-04T00:00:00Z')) - appState.current = 'active' - appState.listeners.clear() -}) - -afterEach(() => { - act(() => renderer?.unmount()) - renderer = null - vi.restoreAllMocks() - vi.useRealTimers() -}) - -describe('MobileNativeChatTurnStatus', () => { - function changeAppState(state: AppStateStatus) { - act(() => { - appState.current = state - for (const listener of appState.listeners) { - listener(state) - } - }) - } - function render(props: { - startedAt: number | null - workedSeconds?: number | null - verdict?: 'interruption' | 'cancellation' - expanded?: boolean - onToggleExpanded?: () => void - }): ReactTestRenderer { - act(() => { - renderer = create(createElement(MobileNativeChatTurnStatus, props)) - }) - return renderer! - } - - it('stops clock callbacks in the background and catches up immediately on resume', () => { - const tree = render({ startedAt: Date.now() }) - act(() => { - vi.advanceTimersByTime(2_000) - }) - expect(labels(tree.root)).toEqual(['Working for 2s']) - - changeAppState('background') - const clockReads = vi.spyOn(Date, 'now') - act(() => { - vi.advanceTimersByTime(60_000) - }) - expect(clockReads).not.toHaveBeenCalled() - expect(vi.getTimerCount()).toBe(0) - expect(labels(tree.root)).toEqual(['Working for 2s']) - - changeAppState('active') - expect(labels(tree.root)).toEqual(['Working for 1m 2s']) - expect(vi.getTimerCount()).toBe(1) - act(() => { - vi.advanceTimersByTime(1_000) - }) - expect(labels(tree.root)).toEqual(['Working for 1m 3s']) - }) - - it('keeps the original pre-stamp epoch through background and settlement transitions', () => { - const tree = render({ startedAt: null }) - act(() => { - vi.advanceTimersByTime(3_000) - }) - expect(labels(tree.root)).toEqual(['Working for 3s']) - changeAppState('background') - act(() => { - vi.advanceTimersByTime(10_000) - }) - act(() => - tree.update(createElement(MobileNativeChatTurnStatus, { startedAt: null, workedSeconds: 8 })) - ) - changeAppState('active') - expect(labels(tree.root)).toEqual(['Worked for 8s']) - expect(vi.getTimerCount()).toBe(0) - - act(() => tree.update(createElement(MobileNativeChatTurnStatus, { startedAt: null }))) - expect(labels(tree.root)).toEqual(['Working for 13s']) - expect(vi.getTimerCount()).toBe(1) - act(() => tree.unmount()) - expect(vi.getTimerCount()).toBe(0) - expect(appState.listeners.size).toBe(0) - }) - - it('creates no clock while initially backgrounded and uses a supplied start time on resume', () => { - appState.current = 'background' - const startedAt = Date.now() - 5_000 - const tree = render({ startedAt }) - expect(vi.getTimerCount()).toBe(0) - act(() => { - vi.advanceTimersByTime(15_000) - }) - changeAppState('active') - expect(labels(tree.root)).toEqual(['Working for 20s']) - expect(vi.getTimerCount()).toBe(1) - }) -}) diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatTurnStatus.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatTurnStatus.tsx index c3066449b9e..0a10c804d48 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatTurnStatus.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatTurnStatus.tsx @@ -5,7 +5,7 @@ import { nativeChatElapsedSeconds } from '../../../../../src/shared/native-chat/ import { formatMobileNativeChatTurnStatusLabel, nativeChatTurnStatusCopy -} from '../native-chat-turn-status-copy' +} from './native-chat-turn-status-copy' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' import type { AgentTurnOutcome } from '../../../../../src/shared/agent-status/lifecycle/agent-turn-outcome' import { colors, spacing, typography } from '../../../theme/mobile-theme' diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatUsageLimitStatus.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatUsageLimitStatus.tsx index 32644911373..2aabf7eee08 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatUsageLimitStatus.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatUsageLimitStatus.tsx @@ -11,7 +11,7 @@ import { INLINE_TEXT_SELECTION } from '../../../components/inline-text-selection import { MobileNativeChatNoticePill } from './MobileNativeChatNoticePill' import { scaledType } from './mobile-native-chat-message-styles' import { nativeChatUsageLimitStatusText } from './native-chat-usage-limit-copy' -import { MobileNativeChatNoticeContext } from '../../mobile-native-chat-notice-context' +import { MobileNativeChatNoticeContext } from './mobile-native-chat-notice-context' /** True from the reset on; re-renders once when it passes. */ function useResetPassed(resetsAt: number | undefined): boolean { diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatUserMessageFold.tsx b/mobile/src/session/native-chat/transcript/MobileNativeChatUserMessageFold.tsx index 77030a4d412..9a757b6741d 100644 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatUserMessageFold.tsx +++ b/mobile/src/session/native-chat/transcript/MobileNativeChatUserMessageFold.tsx @@ -9,7 +9,7 @@ import { colors, spacing, typography, pressedStyle } from '../../../theme/mobile import { themedStyleSheet } from '../../../theme/themed-styles' import { useMobileColorScheme } from '../../../theme/use-mobile-color-scheme' import { CHAT_PROSE_SCALE } from './mobile-native-chat-message-styles' -import type { useMobileNativeChatFullMessage } from '../MobileNativeChatFullContent' +import type { useMobileNativeChatFullMessage } from './MobileNativeChatFullContent' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' const FOLDED_HEIGHT = diff --git a/mobile/src/session/native-chat/transcript/mobile-agent-message-renderer.test-fixture.ts b/mobile/src/session/native-chat/transcript/mobile-agent-message-renderer.test-fixture.ts index 301d7c57d18..abb586ea7d8 100644 --- a/mobile/src/session/native-chat/transcript/mobile-agent-message-renderer.test-fixture.ts +++ b/mobile/src/session/native-chat/transcript/mobile-agent-message-renderer.test-fixture.ts @@ -63,15 +63,11 @@ vi.mock('lucide-react-native', () => ({ Wrench: 'Wrench', Terminal: 'Terminal' })) -const proseRenders = vi.hoisted(() => ({ count: 0 })) -export function proseRenderCount() { - return proseRenders.count -} + vi.mock('../../../components/MobileMarkdown', async () => { const React = await import('react') return { MobileMarkdown: (props: ComponentProps) => { - proseRenders.count++ return React.createElement('MobileMarkdown', props) } } diff --git a/mobile/src/session/mobile-native-chat-growth-hold.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-growth-hold.ts similarity index 100% rename from mobile/src/session/mobile-native-chat-growth-hold.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-growth-hold.ts diff --git a/mobile/src/session/native-chat/mobile-native-chat-item-read.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-item-read.ts similarity index 77% rename from mobile/src/session/native-chat/mobile-native-chat-item-read.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-item-read.ts index c1dd1209ce7..ac6557bf371 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-item-read.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-item-read.ts @@ -1,11 +1,11 @@ import { createContext, type ContextType } from 'react' import * as z from 'zod' -import { isAdmissibleAgentJournalRenderItem } from '../../../../src/shared/agent-session/journal/agent-session-journal-schemas' -import type { AgentJournalRenderItem } from '../../../../src/shared/agent-session/journal/agent-session-journal-types' -import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rpc/rpc-operation' -import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' -import type { MobileNativeChatVisualSource } from './visual/mobile-native-chat-visual-read' -import type { MobileNativeChatMessageDetail } from './transcript/use-mobile-native-chat-message-detail' +import { isAdmissibleAgentJournalRenderItem } from '../../../../../src/shared/agent-session/journal/agent-session-journal-schemas' +import type { AgentJournalRenderItem } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' +import { bindDeferredRpcOperation, defineRpcOperation } from '../../../transport/rpc/rpc-operation' +import { rpcResultVariant } from '../../../transport/rpc/rpc-operation-result-reader' +import type { MobileNativeChatVisualSource } from '../visual/mobile-native-chat-visual-read' +import type { MobileNativeChatMessageDetail } from './use-mobile-native-chat-message-detail' const itemReplySchema = z.object({ item: z.custom(isAdmissibleAgentJournalRenderItem).nullable() diff --git a/mobile/src/session/native-chat/mobile-native-chat-list-footer.tsx b/mobile/src/session/native-chat/transcript/mobile-native-chat-list-footer.tsx similarity index 85% rename from mobile/src/session/native-chat/mobile-native-chat-list-footer.tsx rename to mobile/src/session/native-chat/transcript/mobile-native-chat-list-footer.tsx index ccfd71a9f9d..5435ee5257e 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-list-footer.tsx +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-list-footer.tsx @@ -1,5 +1,5 @@ import { Fragment, type ReactElement } from 'react' -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' +import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' type MobileNativeChatListRow = { item: NativeChatMessage; index: number } diff --git a/mobile/src/session/native-chat/mobile-native-chat-list-header.tsx b/mobile/src/session/native-chat/transcript/mobile-native-chat-list-header.tsx similarity index 93% rename from mobile/src/session/native-chat/mobile-native-chat-list-header.tsx rename to mobile/src/session/native-chat/transcript/mobile-native-chat-list-header.tsx index eca153e8ecf..b65201a55d9 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-list-header.tsx +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-list-header.tsx @@ -1,8 +1,8 @@ import { useEffect, useState, type ReactElement, type ReactNode } from 'react' import { ActivityIndicator, Animated, Easing, Platform, Pressable, Text, View } from 'react-native' -import { colors } from '../../theme/mobile-theme' -import { styles } from './mobile-native-chat-view-styles' -import type { OlderPagePhase } from '../use-mobile-older-page-loader' +import { colors } from '../../../theme/mobile-theme' +import { styles } from '../mobile-native-chat-view-styles' +import type { OlderPagePhase } from './use-mobile-older-page-loader' const LOAD_EARLIER_FAILED = "Couldn't load earlier messages" const LOAD_EARLIER_RETRY = 'Try Again' diff --git a/mobile/src/session/mobile-native-chat-notice-context.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-notice-context.ts similarity index 84% rename from mobile/src/session/mobile-native-chat-notice-context.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-notice-context.ts index bcf6ab8ab79..24c84092a51 100644 --- a/mobile/src/session/mobile-native-chat-notice-context.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-notice-context.ts @@ -1,6 +1,6 @@ import { createContext } from 'react' -import type { MobileStructuredInterruptedContinue } from './use-mobile-structured-interrupted-continue' -import type { MobileNativeChatUsageLimit } from './native-chat/use-mobile-native-chat-usage-limit' +import type { MobileStructuredInterruptedContinue } from '../composer/use-mobile-structured-interrupted-continue' +import type { MobileNativeChatUsageLimit } from '../use-mobile-native-chat-usage-limit' /** What a notice row needs: the Orca host behind the chat (null when unnamed), the agent, and Continue for an Orca-stopped turn. */ export type MobileNativeChatNoticeView = { diff --git a/mobile/src/session/native-chat/mobile-native-chat-pending-echo.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-pending-echo.ts similarity index 91% rename from mobile/src/session/native-chat/mobile-native-chat-pending-echo.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-pending-echo.ts index 642696fbac1..00ef55a7594 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-pending-echo.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-pending-echo.ts @@ -1,15 +1,15 @@ -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' -import type { MobileNativeChatDraftDestination } from './composer/mobile-native-chat-draft-inputs' +import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' +import type { MobileNativeChatDraftDestination } from '../composer/mobile-native-chat-draft-inputs' import { assignNativeChatPendingOccurrence, nativeChatPendingContentKey -} from '../../../../src/shared/native-chat/transcript/native-chat-pending-occurrence' +} from '../../../../../src/shared/native-chat/transcript/native-chat-pending-occurrence' import { NATIVE_CHAT_PENDING_SEND_LIMIT, prunePendingSends, visibleNativeChatPendingSends, type NativeChatPendingSend -} from '../../../../src/shared/native-chat/transcript/native-chat-pending-sends' +} from '../../../../../src/shared/native-chat/transcript/native-chat-pending-sends' export type MobileNativeChatPendingMessage = NativeChatPendingSend & { // Phone-local preview URIs; these echoes retire only once their preview binds to a transcript row. diff --git a/mobile/src/session/native-chat/transcript/mobile-native-chat-projection-sources.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-projection-sources.ts index d0e4be11ea1..48f57f9bf12 100644 --- a/mobile/src/session/native-chat/transcript/mobile-native-chat-projection-sources.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-projection-sources.ts @@ -7,7 +7,7 @@ import { nativeChatCommandOutputParentId, surfaceNativeChatCommandOutputs } from '../../../../../src/shared/native-chat/tools/native-chat-command-output' -import { isMobileNativeChatSource } from '../mobile-native-chat-render-data' +import { isMobileNativeChatSource } from './mobile-native-chat-render-data' export type MobileNativeChatProjectionSource = { raw: NativeChatMessage diff --git a/mobile/src/session/native-chat/transcript/mobile-native-chat-projection-tail.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-projection-tail.ts index 923e3cd5bca..dd964726853 100644 --- a/mobile/src/session/native-chat/transcript/mobile-native-chat-projection-tail.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-projection-tail.ts @@ -15,10 +15,11 @@ import { withMobileNativeChatHarness } from './mobile-native-chat-projection-sources' import { - buildMobileNativeChatUnit, - groupMobileNativeChatUnitMembers, - type Unit -} from './mobile-native-chat-projection-units' + buildNativeChatFoldUnit, + groupNativeChatFoldUnitMembers, + type NativeChatFoldUnit as Unit +} from '../../../../../src/shared/native-chat/transcript/native-chat-fold-units' +import { finishMobileNativeChatMessages } from './mobile-native-chat-render-data' // A tail harness row that is its own image unit and no roster member leaves every earlier unit as it was. function staysInTail(harness: NativeChatMessage): boolean { @@ -109,9 +110,15 @@ export function projectMobileNativeChatTail( rescan.push(...newRows) // Orphan names depend on every earlier id, so a re-projected unit with orphans takes the full pass. const rebuilt: Unit[] = [] - for (const members of groupMobileNativeChatUnitMembers(rescan, kinds)) { + for (const members of groupNativeChatFoldUnitMembers(rescan, kinds)) { const held = previous.units.findLast((unit) => unit.sources[0]!.id === members[0]!.id) - const unit = buildMobileNativeChatUnit(members, NO_IDS, kinds, held) + const unit = buildNativeChatFoldUnit( + members, + NO_IDS, + kinds, + held, + finishMobileNativeChatMessages + ) if (unit !== held && unit.orphans.length > 0) { return null } diff --git a/mobile/src/session/native-chat/transcript/mobile-native-chat-projection-units.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-projection-units.ts deleted file mode 100644 index 51ac45b648d..00000000000 --- a/mobile/src/session/native-chat/transcript/mobile-native-chat-projection-units.ts +++ /dev/null @@ -1,135 +0,0 @@ -import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' -import { - foldToolMessages, - type NativeChatToolFoldKind -} from '../../../../../src/shared/native-chat/tools/native-chat-tool-fold' -import { - orphanRowId, - type NativeChatOrphanOrigin -} from '../../../../../src/shared/native-chat/tools/native-chat-folded-tool-results' -import { finishMobileNativeChatMessages } from '../mobile-native-chat-render-data' - -export type Unit = { - sources: readonly NativeChatMessage[] - rows: NativeChatMessage[] - orphans: readonly NativeChatOrphanOrigin[] -} - -export function groupMobileNativeChatUnitMembers( - grouped: readonly NativeChatMessage[], - kinds: ReadonlyMap -): NativeChatMessage[][] { - const members: NativeChatMessage[][] = [] - let active = false - for (const source of grouped) { - const kind = kinds.get(source)! - if (active && (kind === 'tool' || kind === 'sidecar' || kind === 'pass')) { - members.at(-1)!.push(source) - } else { - members.push([source]) - active = source.role === 'assistant' && kind !== 'orphan' - } - } - return members -} - -export function buildMobileNativeChatUnit( - sources: readonly NativeChatMessage[], - ids: ReadonlySet, - kinds: ReadonlyMap, - before: Unit | undefined -): Unit { - if ( - before && - before.sources.length === sources.length && - before.sources.every((source, index) => source === sources[index]) - ) { - return before - } - const substituted = before && substituteProse(before, sources, kinds) - const orphans: NativeChatOrphanOrigin[] = [] - const rows = - substituted ?? - finishMobileNativeChatMessages( - foldToolMessages(sources, ids, kinds, (origin) => orphans.push(origin)) - ) - return { sources, rows, orphans: substituted ? before!.orphans : orphans } -} - -export function buildMobileNativeChatUnits( - grouped: readonly NativeChatMessage[], - kinds: ReadonlyMap, - previous?: { units: readonly Unit[] } -): Unit[] { - const ids = new Set(grouped.map((row) => row.id)) - const oldUnits = new Map(previous?.units.map((unit) => [unit.sources[0]!.id, unit])) - const units = groupMobileNativeChatUnitMembers(grouped, kinds).map((sources) => - buildMobileNativeChatUnit(sources, ids, kinds, oldUnits.get(sources[0]!.id)) - ) - const allocated = new Set(ids) - const occurrences = new Map() - return units.map((unit) => { - const renamed = new Map() - const orphans = unit.orphans.map((origin) => { - const id = orphanRowId(origin.sourceId, allocated, occurrences) - allocated.add(id) - if (id === origin.row.id) { - return origin - } - const row = { ...origin.row, id } - renamed.set(origin.row, row) - return { ...origin, row } - }) - return renamed.size === 0 - ? unit - : { - ...unit, - orphans, - rows: unit.rows.map((row) => renamed.get(row) ?? row) - } - }) -} - -function substituteProse( - before: Unit, - sources: readonly NativeChatMessage[], - kinds: ReadonlyMap -): NativeChatMessage[] | null { - if (before.sources.length !== sources.length) { - return null - } - const changed = sources.flatMap((source, index) => - source === before.sources[index] ? [] : [index] - ) - if (changed.length !== 1 || changed[0] !== 0) { - return null - } - const old = before.sources[0]!, - next = sources[0]! - if ( - old.role !== next.role || - (next.role !== 'assistant' && next.role !== 'reasoning') || - old.unpairedToolResults || - next.unpairedToolResults || - !old.blocks.every((block) => block.type === 'text' && !block.providerFrame) || - !next.blocks.every((block) => block.type === 'text' && !block.providerFrame) - ) { - return null - } - const target = before.rows.find((row) => row.id === old.id && row.role === old.role) - if (!target || !old.blocks.every((block, index) => block === target.blocks[index])) { - return null - } - const contribution = sources - .slice(1) - .findLast( - (source) => - source.journalPosition && (kinds.get(source) === 'tool' || kinds.get(source) === 'sidecar') - ) - const replacement: NativeChatMessage = { - ...next, - blocks: [...next.blocks, ...target.blocks.slice(old.blocks.length)], - ...(contribution ? { foldedJournalPosition: contribution.journalPosition } : {}) - } - return before.rows.map((row) => (row === target ? replacement : row)) -} diff --git a/mobile/src/session/native-chat/transcript/mobile-native-chat-projection.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-projection.ts index d393b28d89a..af6785bfc4d 100644 --- a/mobile/src/session/native-chat/transcript/mobile-native-chat-projection.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-projection.ts @@ -9,13 +9,19 @@ import { nativeChatImageTranscriptUnits, normalizeImageTranscriptUnit } from '../../../../../src/shared/native-chat/transcript/native-chat-image-transcript-markers' -import { foldMobileNativeChatMessages } from '../mobile-native-chat-render-data' +import { + finishMobileNativeChatMessages, + foldMobileNativeChatMessages +} from './mobile-native-chat-render-data' import { prepareMobileNativeChatSources, type MobileNativeChatProjectionSource } from './mobile-native-chat-projection-sources' import { projectMobileNativeChatTail } from './mobile-native-chat-projection-tail' -import { buildMobileNativeChatUnits, type Unit } from './mobile-native-chat-projection-units' +import { + buildNativeChatFoldUnits, + type NativeChatFoldUnit as Unit +} from '../../../../../src/shared/native-chat/transcript/native-chat-fold-units' type ImageUnit = { sources: readonly NativeChatMessage[]; rows: NativeChatMessage[] } export type MobileNativeChatProjection = { @@ -75,7 +81,12 @@ export function projectMobileNativeChatMessages( const kinds = new Map( grouped.map((source) => [source, previous?.kinds.get(source) ?? nativeChatToolFoldKind(source)]) ) - const units = buildMobileNativeChatUnits(grouped, kinds, previous) + const units = buildNativeChatFoldUnits( + grouped, + kinds, + new Map(previous?.units.map((unit) => [unit.sources[0]!.id, unit])), + finishMobileNativeChatMessages + ) const unchanged = previous && units.length === previous.units.length && diff --git a/mobile/src/session/native-chat/mobile-native-chat-reading-hold.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-reading-hold.ts similarity index 97% rename from mobile/src/session/native-chat/mobile-native-chat-reading-hold.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-reading-hold.ts index 9f741f237b5..e865435de65 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-reading-hold.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-reading-hold.ts @@ -1,4 +1,4 @@ -import { visible } from './mobile-native-chat-lower-geometry' +import { visible } from '../mobile-native-chat-lower-geometry' export function createMobileNativeChatReadingHold(viewport: HTMLElement, content: HTMLElement) { let hold: { element: HTMLElement; offset: number } | null = null diff --git a/mobile/src/session/mobile-native-chat-reading-place.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-reading-place.ts similarity index 96% rename from mobile/src/session/mobile-native-chat-reading-place.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-reading-place.ts index 14e486b65a5..705e2fad33c 100644 --- a/mobile/src/session/mobile-native-chat-reading-place.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-reading-place.ts @@ -1,9 +1,9 @@ -import type { MobileNativeChatRowKeys } from './native-chat/transcript/mobile-native-chat-row-keys' +import type { MobileNativeChatRowKeys } from './mobile-native-chat-row-keys' import { mobileNativeChatReadingParts, mobileNativeChatScrollRootKey -} from './native-chat/transcript/mobile-native-chat-scroll-root-handle' -import type { MobileNativeChatScrollRoots } from './native-chat/transcript/mobile-native-chat-scroll-roots' +} from './mobile-native-chat-scroll-root-handle' +import type { MobileNativeChatScrollRoots } from './mobile-native-chat-scroll-roots' type Box = { top: number; bottom: number } diff --git a/mobile/src/session/native-chat/mobile-native-chat-render-data.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-render-data.ts similarity index 77% rename from mobile/src/session/native-chat/mobile-native-chat-render-data.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-render-data.ts index 9065b441ab8..bd71aadc79d 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-render-data.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-render-data.ts @@ -1,25 +1,25 @@ -import { formatAgentTypeLabel } from '../../../../src/shared/agent-status/presentation/agent-type-label' -import { describeLoadError } from '../../components/load-error-description' -import type { NativeChatEmptyStateCopy } from '../../../../src/shared/native-chat/native-chat-empty-state' -import { isRootAgentJournalItem } from '../../../../src/shared/agent-session/journal/agent-session-journal-producer' -import { stripNoiseMessages } from '../../../../src/shared/native-chat/native-chat-noise' -import { nativeChatStreamingMessage } from '../../../../src/shared/native-chat/native-chat-streaming' -import { isWordlessProviderFrameMessage } from '../../../../src/shared/native-chat/native-chat-provider-frame-summary' +import { formatAgentTypeLabel } from '../../../../../src/shared/agent-status/presentation/agent-type-label' +import { describeLoadError } from '../../../components/load-error-description' +import type { NativeChatEmptyStateCopy } from '../../../../../src/shared/native-chat/native-chat-empty-state' +import { isRootAgentJournalItem } from '../../../../../src/shared/agent-session/journal/agent-session-journal-producer' +import { stripNoiseMessages } from '../../../../../src/shared/native-chat/native-chat-noise' +import { nativeChatStreamingMessage } from '../../../../../src/shared/native-chat/native-chat-streaming' +import { isWordlessProviderFrameMessage } from '../../../../../src/shared/native-chat/native-chat-provider-frame-summary' import { foldToolMessages, isUndrawnProviderFrameMessage -} from '../../../../src/shared/native-chat/tools/native-chat-tool-fold' -import { projectNativeChatTaskListFrames } from '../../../../src/shared/native-chat/input/native-chat-task-list-frames' -import { foldSubagentItems } from '../../../../src/shared/native-chat/transcript/native-chat-subagent-items' -import { prepareNativeChatMessages } from '../../../../src/shared/native-chat/transcript/native-chat-message-preparation' +} from '../../../../../src/shared/native-chat/tools/native-chat-tool-fold' +import { projectNativeChatTaskListFrames } from '../../../../../src/shared/native-chat/input/native-chat-task-list-frames' +import { foldSubagentItems } from '../../../../../src/shared/native-chat/transcript/native-chat-subagent-items' +import { prepareNativeChatMessages } from '../../../../../src/shared/native-chat/transcript/native-chat-message-preparation' import { isImageRefBlock, type NativeChatMessage -} from '../../../../src/shared/native-chat/native-chat-types' -import type { AgentType } from '../../../../src/shared/agent-status/contracts/agent-status-types' -import type { MobileNativeChatStatus } from './mobile-native-chat-session-status' -import { orderNativeChatDisplayMessages } from '../../../../src/shared/native-chat/transcript/native-chat-message-order' -import { translate } from '../../i18n/mobile-i18n' +} from '../../../../../src/shared/native-chat/native-chat-types' +import type { AgentType } from '../../../../../src/shared/agent-status/contracts/agent-status-types' +import type { MobileNativeChatStatus } from '../mobile-native-chat-session-status' +import { orderNativeChatDisplayMessages } from '../../../../../src/shared/native-chat/transcript/native-chat-message-order' +import { translate } from '../../../i18n/mobile-i18n' function mobileNativeChatEmptyStateCopy( kind: 'notFound' | 'empty' | 'error', diff --git a/mobile/src/session/native-chat/transcript/mobile-native-chat-row-keys.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-row-keys.ts index 04edddf3975..f9ed5e011dd 100644 --- a/mobile/src/session/native-chat/transcript/mobile-native-chat-row-keys.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-row-keys.ts @@ -5,7 +5,7 @@ import { updateMobileNativeChatRunDescriptors, type MobileNativeChatRunHistory, type MobileNativeChatRunPresentation -} from '../mobile-native-chat-run-descriptors' +} from './mobile-native-chat-run-descriptors' import { isSubagentGroupBlock, isToolResultBlock, diff --git a/mobile/src/session/native-chat/mobile-native-chat-run-descriptors.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-run-descriptors.ts similarity index 86% rename from mobile/src/session/native-chat/mobile-native-chat-run-descriptors.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-run-descriptors.ts index 002948aceb0..9eff1ad301e 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-run-descriptors.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-run-descriptors.ts @@ -1,10 +1,10 @@ -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' -import type { NativeChatResolvedPrompt } from '../../../../src/shared/native-chat/native-chat-resolution-receipt' -import { splitNativeChatBlocks } from '../../../../src/shared/native-chat/tools/native-chat-tool-fold' -import { nativeChatWorkRunEntries } from '../../../../src/shared/native-chat/native-chat-work-run' -import { nativeChatAskRunBlocks } from '../../../../src/shared/native-chat/input/native-chat-ask-row' -import type { MobileNativeChatWorkRuns } from './transcript/use-mobile-native-chat-transcript-rows' -import type { MobileNativeChatRowSources } from './transcript/mobile-native-chat-row-keys' +import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' +import type { NativeChatResolvedPrompt } from '../../../../../src/shared/native-chat/native-chat-resolution-receipt' +import { splitNativeChatBlocks } from '../../../../../src/shared/native-chat/tools/native-chat-tool-fold' +import { nativeChatWorkRunEntries } from '../../../../../src/shared/native-chat/native-chat-work-run' +import { nativeChatAskRunBlocks } from '../../../../../src/shared/native-chat/input/native-chat-ask-row' +import type { MobileNativeChatWorkRuns } from './use-mobile-native-chat-transcript-rows' +import type { MobileNativeChatRowSources } from './mobile-native-chat-row-keys' export type MobileNativeChatRunPresentation = { rows: readonly NativeChatMessage[] diff --git a/mobile/src/session/mobile-native-chat-scroll-anchoring.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-anchoring.ts similarity index 100% rename from mobile/src/session/mobile-native-chat-scroll-anchoring.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-anchoring.ts diff --git a/mobile/src/session/native-chat/mobile-native-chat-scroll-gesture.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-gesture.ts similarity index 100% rename from mobile/src/session/native-chat/mobile-native-chat-scroll-gesture.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-gesture.ts diff --git a/mobile/src/session/mobile-native-chat-scroll-motion.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-motion.ts similarity index 100% rename from mobile/src/session/mobile-native-chat-scroll-motion.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-motion.ts diff --git a/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-ownership.test.tsx b/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-ownership.test.tsx index bae41606a45..f2796e90993 100644 --- a/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-ownership.test.tsx +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-ownership.test.tsx @@ -1,479 +1,6 @@ // @vitest-environment happy-dom -import { - act, - createElement as h, - Fragment, - startTransition, - Suspense, - useLayoutEffect, - useMemo, - type ReactNode -} from 'react' -import { createRoot, type Root } from 'react-dom/client' -import { afterEach, expect, it, vi } from 'vitest' -import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' -import { foldToolMessages } from '../../../../../src/shared/native-chat/tools/native-chat-tool-fold' -import { MobileNativeChatMessage } from './MobileNativeChatMessage' -import { MobileNativeChatScrollRootsBoundary } from '../../MobileNativeChatScrollRootsBoundary' -import { MobileNativeChatScrollMotion } from '../../mobile-native-chat-scroll-motion' -import { - mobileNativeChatScrollFrame, - mobileNativeChatScrollRootKey, - mobileNativeChatReadingParts, - mobileNativeChatVisible -} from './mobile-native-chat-scroll-root-handle' +import { expect, it } from 'vitest' import { MobileNativeChatScrollRoots } from './mobile-native-chat-scroll-roots' -import { - MobileNativeChatDisclosureContext, - useMobileNativeChatDisclosures, - type MobileNativeChatDisclosureStore -} from './mobile-native-chat-disclosure-store' -import { useMobileNativeChatRowKeys } from './mobile-native-chat-row-keys' -import { useMobileNativeChatTurnDisclosure } from './use-mobile-native-chat-turn-disclosure' - -vi.mock('react-native', async () => { - const React = await import('react') - const View = (p: { - children?: ReactNode - testID?: string - onPress?: () => void - accessibilityLiveRegion?: string - }) => - React.createElement( - 'div', - { 'data-testid': p.testID, onClick: p.onPress, 'data-live': p.accessibilityLiveRegion }, - p.children - ) - const ScrollView = React.forwardRef((p: { children?: ReactNode }, ref) => { - const node = React.useRef(null) - React.useImperativeHandle(ref, () => ({ - getScrollableNode: () => node.current, - getInnerViewNode: () => node.current?.firstElementChild - })) - return React.createElement( - 'div', - { ref: node, className: 'viewport' }, - React.createElement('div', null, p.children) - ) - }) - const animation = () => ({ start() {}, stop() {} }) - return { - AppState: { currentState: 'active', addEventListener: () => ({ remove: () => {} }) }, - View, - Text: View, - Pressable: View, - ScrollView, - Image: View, - Platform: { OS: 'web' }, - StyleSheet: { create: (s: unknown) => s, hairlineWidth: 1 }, - useWindowDimensions: () => ({ width: 400, height: 800 }), - Animated: { - Text: View, - Value: class { - setValue() {} - }, - loop: animation, - sequence: animation, - timing: animation - } - } -}) -vi.mock('lucide-react-native', () => - Object.fromEntries( - 'ArrowUp Bot Brain Check ChevronDown ChevronRight Copy Eye FileMinus2 FilePen FilePlus2 Folder Globe ListChecks MessageSquareMore Pencil Plug Search SquareChevronRight SquareTerminal Wrench Circle CircleCheck CircleDot' - .split(' ') - .map((key) => [key, () => null]) - ) -) -vi.mock('../../../components/MobileMarkdown', () => ({ MobileMarkdown: () => null })) -vi.mock('../../../components/MobileSourceCopyButton', () => ({ - MobileSourceCopyButton: () => null -})) -vi.mock('../../../platform/external-link', () => ({ openExternalLink: vi.fn() })) -vi.mock('../../../components/inline-text-selection', () => ({ INLINE_TEXT_SELECTION: false })) - -let renderer: Root | undefined -let container: HTMLDivElement -let page: HTMLElement -let frameShift = 0 -let roots: MobileNativeChatScrollRoots -let owners: (string | undefined)[] -let projected: (string | undefined)[] -let store: MobileNativeChatDisclosureStore -const abandoned = new Promise(() => {}) -const msg = ( - id: string, - blocks: NativeChatMessage['blocks'], - role: NativeChatMessage['role'] = 'assistant' -): NativeChatMessage => ({ id, blocks, role, timestamp: null, source: 'transcript' }) -const a = msg( - 'a', - Array.from({ length: 6 }, (_, i) => ({ - type: 'tool-call', - callId: `c${i}`, - name: 'Bash', - input: { command: `command ${i} ${'argument '.repeat(20)}` } - })) -) -const thought = msg('r', [{ type: 'text', text: 'reason' }], 'reasoning') -const user = msg('u', [{ type: 'text', text: 'go' }], 'user') -const b = msg('b', [{ type: 'tool-call', callId: 'b', name: 'Bash', input: { command: 'b' } }]) -function reader(node: Element, top: number) { - node.dispatchEvent(new Event('touchstart')) - node.scrollTop = top - node.dispatchEvent(new Event('scroll')) - node.dispatchEvent(new Event('touchend')) -} -function members(root: Element): Element[] { - return Array.from(root.querySelectorAll('[data-testid^="chat-member:"]')).filter( - (node) => !mobileNativeChatScrollFrame(node, root) - ) -} -function rect(node: Element): DOMRect { - const viewport = node.closest('[data-chat-scroll-root]') - let top = 0 - let height = 1000 - if (node === page) { - return DOMRect.fromRect({ y: 100, height: 200, width: 400 }) - } - if (viewport === node) { - const parent = node.parentElement?.closest('[data-chat-scroll-root]') - top = parent - ? rect(node.parentElement!.closest('[data-testid^="chat-member:"]') ?? parent).top + 20 - : 40 + frameShift - page.scrollTop - height = 160 - } else if (viewport) { - const member = node.closest('[data-testid^="chat-member:"]') - top = - rect(viewport).top + - Math.max(0, members(viewport).indexOf(member ?? node)) * 60 - - viewport.scrollTop - height = 60 - } else if (node.closest('[data-live], [data-testid="chat-row:u"]')) { - top = -page.scrollTop - height = 20 - } else { - top = -page.scrollTop - } - return DOMRect.fromRect({ y: top, height, width: 400 }) -} -function Shift({ value }: { value: number }): null { - useLayoutEffect(() => { - frameShift = value - }, [value]) - return null -} -function Chat({ - rows, - open = true, - shown = true, - scope = 'chat', - shift = 0, - suspend = false, - structured = true, - working = false -}: { - rows: NativeChatMessage[] - open?: boolean - shown?: boolean - scope?: string - shift?: number - suspend?: boolean - structured?: boolean - working?: boolean -}) { - const current = useMobileNativeChatDisclosures(scope) - const disclosures = useMemo( - () => - open - ? { - ...current, - read: (key: string) => - current.read(key) ?? (/^(run|line|diff):/.test(key) ? true : undefined) - } - : current, - [current, open] - ) - const drawn = useMemo(() => (structured ? rows : foldToolMessages(rows)), [rows, structured]) - const turns = useMobileNativeChatTurnDisclosure({ - messages: drawn, - enabled: structured, - isWorking: working, - scopeKey: scope - }) - const keys = useMobileNativeChatRowKeys(drawn, rows, scope, turns.presentation) - useLayoutEffect(() => { - store = current - roots = current.roots - owners = drawn.map((row) => keys.runOwners.get(row.id)) - }) - if (suspend) { - projected = drawn.map((row) => keys.runOwners.get(row.id)) - throw abandoned - } - return h( - MobileNativeChatDisclosureContext.Provider, - { value: disclosures }, - h( - MobileNativeChatScrollRootsBoundary, - { - rowKeys: keys, - roots: current.roots, - runPlacements: keys.runPlacements, - layoutKey: '1' - }, - h(Shift, { value: shift }), - h( - Fragment, - { key: scope }, - shown && - drawn.map((message, i) => - h(MobileNativeChatMessage, { - key: keys.keyOf(message), - message, - rowKey: keys.keyOf(message), - ...turns.resolveRow(i, message), - ...(open ? { foldedAway: false } : {}), - runOwner: keys.runOwners.get(message.id), - structuredActivityUi: structured - }) - ) - ) - ) - ) -} -function mount(structured = true) { - vi.useFakeTimers() - vi.stubGlobal('IS_REACT_ACT_ENVIRONMENT', true) - vi.stubGlobal('navigator', { userAgent: 'AppleWebKit Safari' }) - container = document.createElement('div') - page = document.createElement('main') - page.style.overflowY = 'auto' - document.body.append(page) - page.append(container) - vi.spyOn(Element.prototype, 'getBoundingClientRect').mockImplementation(function (this: Element) { - return rect(this) - }) - vi.spyOn(HTMLElement.prototype, 'clientHeight', 'get').mockReturnValue(160) - vi.spyOn(Element.prototype, 'scrollHeight', 'get').mockImplementation(function (this: Element) { - return this.getAttribute('data-short') - ? 80 - : members(this).length * 60 + - 400 + - this.querySelectorAll('.viewport').length * 60 + - Number(this.getAttribute('data-growth') ?? 0) - }) - renderer = createRoot(container) - return (rows: NativeChatMessage[], rest: Partial[0]> = {}) => { - const render = () => - renderer!.render(h(Suspense, { fallback: null }, h(Chat, { rows, structured, ...rest }))) - act(() => (rest.suspend ? startTransition(render) : render())) - act(() => vi.advanceTimersByTime(20)) - } -} -afterEach(() => { - act(() => renderer?.unmount()) - page?.remove() - renderer = undefined - frameShift = 0 - vi.useRealTimers() - vi.restoreAllMocks() - vi.unstubAllGlobals() -}) - -it('keeps real structured runs and nested offsets under their own viewport across reheading', () => { - const draw = mount() - draw([user, a]) - const owner = owners[1] - const run = container.querySelector('[data-chat-scroll-root]') - if (!(run instanceof HTMLElement)) { - throw new Error('missing run viewport') - } - const detail = run.querySelector('[data-chat-scroll-root]') - if (!(detail instanceof HTMLElement)) { - throw new Error('missing command viewport') - } - const row = run.closest('[data-testid^="chat-row:"]')! - reader(run, 100) - reader(detail, 35) - act(() => vi.advanceTimersByTime(160)) - roots.restoreAll() - const clipped = run.querySelector('[data-testid="chat-member:call:c0"]')! - expect(mobileNativeChatVisible(clipped, page)).toBe(false) - expect(mobileNativeChatReadingParts(row)).toContain(run) - expect(mobileNativeChatReadingParts(row)).not.toContain(clipped) - const anchor = run.querySelector('[data-testid="chat-member:call:c3"]')! - const offset = rect(anchor).top - rect(run).top - draw([user, thought, a], { shift: 80 }) - expect(owners[1]).toBe(owner) - const restored = container.querySelector('[data-chat-scroll-root]')! - expect( - rect(restored.querySelector('[data-testid="chat-member:call:c3"]')!).top - rect(restored).top - ).toBe(offset) - expect(restored.querySelector('[data-chat-scroll-root]')?.scrollTop).toBe(35) - const top = restored.scrollTop - draw([user, thought, a], { shown: false, shift: 80 }) - draw([user, thought, a], { shift: 80 }) - expect(container.querySelector('[data-chat-scroll-root]')?.scrollTop).toBe(top) - const observer = { observe: vi.fn(), unobserve: vi.fn(), disconnect: vi.fn() } - roots.observeWith(observer) - expect(observer.observe).toHaveBeenCalledWith(container.querySelector('[data-chat-scroll-root]')) - const late = document.createElement('div') - const content = document.createElement('div') - late.append(content) - container.append(late) - late.setAttribute('data-short', 'yes') - store.runScroll.set('late', { top: 37, followsEnd: false, member: 'missing', offset: 10 }) - const stop = roots.register('late', late, content, 'late', 'late', false) - expect(late.scrollHeight).toBeLessThan(late.clientHeight) - expect(observer.observe).toHaveBeenCalledWith(content) - roots.capture(new Set(), false) - expect(store.runScroll.get('late')?.top).toBe(37) - late.removeAttribute('data-short') - roots.restoreAll() - expect(late.scrollTop).toBe(37) - expect(store.runScroll.get('late')?.member).toBeUndefined() - const removed = vi.spyOn(late, 'removeEventListener') - const replacement = document.createElement('div') - late.replaceChildren(replacement) - const replaced = roots.register('late', late, replacement, 'late', 'late', false) - observer.unobserve.mockClear() - stop() - expect(roots.frame('late')).toBe(late) - expect(observer.unobserve.mock.calls.some(([node]) => node === late)).toBe(false) - expect(observer.unobserve.mock.calls.some(([node]) => node === replacement)).toBe(false) - late.remove() - roots.restoreAll() - replaced() - expect(roots.frame('late')).toBeUndefined() - expect(observer.unobserve.mock.calls.some(([node]) => node === content)).toBe(true) - expect(removed).toHaveBeenCalledWith('scroll', expect.any(Function)) -}) - -it.each([true, false])( - 'issues fresh displayed owners through split and merge instead of reviving retired choices (structured=%s)', - (structured) => { - const draw = mount(structured) - draw([user, a, b], { working: true }) - const original = owners[1] - const oldKey = `run:${original}` - act(() => store.write(oldKey, false)) - store.runScroll.set(oldKey, { top: 111, followsEnd: false }) - const splitRows = [ - user, - a, - msg('break', [{ type: 'text', text: 'answer' }], structured ? 'assistant' : 'user'), - b - ] - const registry = roots - draw(splitRows, { suspend: true, working: true }) - expect(projected[1]).not.toBe(original) - expect(owners[1]).toBe(original) - expect(roots).toBe(registry) - expect(store.runScroll.get(oldKey)?.top).toBe(111) - const tentative = [...projected] - draw(splitRows, { working: true }) - const split = [owners[1], owners[3]] - expect(new Set([original, ...split]).size).toBe(3) - expect(owners).toEqual(tentative) - const reused = roots.frame(`run:${split[0]}`)! - reader(reused, 40) - draw([user, a, b]) - expect([original, ...split]).not.toContain(owners[1]) - expect(store.read(oldKey)).toBe(false) - expect(store.runScroll.get(oldKey)?.top).toBe(111) - expect(roots.frame(`run:${owners[1]}`)).toBe(reused) - expect(reused.scrollTop).toBe(40) - expect(store.runScroll.get(`run:${owners[1]}`)?.followsEnd).toBe(false) - } -) - -it('releases on close/scope change, and separates work-follow from reader chaining', async () => { - const draw = mount() - draw([user, a]) - const run = container.querySelector('[data-chat-scroll-root]')! - const detail = run.querySelector('[data-chat-scroll-root]')! - vi.stubGlobal('navigator', { userAgent: 'AppleWebKit Chrome' }) - const pageMotion = new MobileNativeChatScrollMotion() - const detach = pageMotion.attach(page) - pageMotion.reconciled(100, 1000) - reader(run, 100) - reader(detail, 35) - await vi.advanceTimersByTimeAsync(160) - reader(run, run.scrollHeight - run.clientHeight - 20) - await vi.advanceTimersByTimeAsync(160) - const parked = run.scrollTop - run.setAttribute('data-growth', '60') - roots.restoreAll() - expect(run.scrollTop).toBe(parked) - draw([user, a, b]) - expect(run.scrollTop).toBe(run.scrollHeight - run.clientHeight) - run.dispatchEvent(new Event('scroll')) - await vi.advanceTimersByTimeAsync(160) - expect(pageMotion.scrolled(100, 1000, () => false).by).toBe('none') - run.dispatchEvent(new WheelEvent('wheel', { deltaY: -10, bubbles: true })) - expect(pageMotion.scrolled(90, 1000, () => false).by).toBe('reader') - pageMotion.release() - act(() => container.querySelector('[data-live]')!.click()) - expect(run.hasAttribute('data-chat-scroll-root')).toBe(false) - draw([user, a], { scope: 'intermediate' }) - draw([user, a], { scope: 'other' }) - vi.stubGlobal('navigator', { userAgent: 'AppleWebKit Safari' }) - draw([user, a], { scope: 'live', open: false, working: true }) - act(() => container.querySelector('[data-live]')!.click()) - const key = `run:${owners[1]}` - const live = roots.frame(key)! - const end = live.scrollTop - expect(end).toBe(live.scrollHeight - live.clientHeight) - reader(live, end - 100) - draw([user, a], { scope: 'live', open: false, working: true, shift: 40 }) - expect(roots.frame(key)).toBe(live) - expect(live.scrollTop).toBe(end - 100) - expect(store.runScroll.get(key)?.followsEnd).toBe(false) - reader(live, live.scrollHeight - live.clientHeight - 20) - await vi.advanceTimersByTimeAsync(160) - draw([user, a, b], { scope: 'live', open: false, working: true, shift: 40 }) - expect(live.scrollTop).toBe(live.scrollHeight - live.clientHeight) - draw([user, a, b], { scope: 'live', open: false, working: true, shown: false, shift: 40 }) - store.runScroll.set(key, { top: 37, followsEnd: false }) - draw([user, a, b], { scope: 'live', open: false, working: true, shift: 40 }) - expect(roots.frame(key)?.scrollTop).toBe(37) - detach() - pageMotion.release() -}) - -it('keeps the actual changed task checklist through eviction, isolated by chat', () => { - const draw = mount() - const tasks = msg( - 'tasks', - [false, true].map((done) => ({ - type: 'tool-call', - callId: String(done), - name: 'TodoWrite', - input: { - todos: [ - { content: 'Remember', status: done ? 'completed' : 'pending', activeForm: 'Remembering' } - ] - } - })) - ) - draw([user, tasks]) - const count = () => container.textContent?.match(/Remember/g)?.length ?? 0 - const before = count() - const disclosure = Array.from(container.querySelectorAll('div')).findLast( - (node) => node.textContent === 'Full task list' - ) - if (!disclosure) { - throw new Error('missing changed-task disclosure') - } - act(() => disclosure.click()) - expect(count()).toBe(before + 1) - draw([user, tasks], { shown: false }) - draw([user, tasks]) - expect(count()).toBe(before + 1) - draw([user, tasks], { scope: 'different' }) - expect(count()).toBe(before) -}) it("forgets a closed tool line's nested command and output positions, not its neighbours'", () => { const at = { top: 30, followsEnd: false } @@ -485,86 +12,3 @@ it("forgets a closed tool line's nested command and output positions, not its ne new MobileNativeChatScrollRoots(memory, 10).forget('line:a') expect([...memory.keys()]).toEqual(['run:o', 'run:o/line:ab:command', 'diff:src/line:a.ts']) }) - -it.each([10, 100])( - 'bounds expanded notice scroll work and releases collapsed/unmounted roots (%i notices)', - (count) => { - const draw = mount() - const notices = Array.from({ length: count }, (_, i) => - msg( - `notice:${i}`, - [ - { - type: 'text', - text: `Diagnostic ${i}`, - tone: i % 2 === 0 ? 'warning' : 'error', - providerFrame: { - provider: i % 2 === 0 ? 'codex' : 'claude', - kind: - i % 2 === 0 ? 'notification:guardianWarning' : 'message:system:permission_denied', - payload: { head: '{}', byteLength: 2, digest: 'synthetic', truncated: false } - } - } - ], - 'system' - ) - ) - const register = vi.spyOn(MobileNativeChatScrollRoots.prototype, 'register') - draw(notices) - expect(register).not.toHaveBeenCalled() - const observer = { observe: vi.fn(), unobserve: vi.fn(), disconnect: vi.fn() } - roots.observeWith(observer) - const toggles = Array.from(container.querySelectorAll('div')).filter( - (node) => node.childElementCount === 0 && node.textContent?.includes('View details.') - ) - expect(toggles).toHaveLength(count) - act(() => toggles.forEach((toggle) => toggle.click())) - expect(register).toHaveBeenCalledTimes(count) - expect(observer.observe).toHaveBeenCalledTimes(2 * count) - const viewports = Array.from(container.querySelectorAll('[data-chat-scroll-root]')) - expect(viewports).toHaveLength(count) - const ids = viewports.map((node) => mobileNativeChatScrollRootKey(node)!) - expect(new Set(ids).size).toBe(count) - draw([...notices]) - viewports.forEach((node) => reader(node, 35)) - act(() => vi.advanceTimersByTime(160)) - - const memoryWrites = vi.spyOn(store.runScroll, 'set') - const queries = vi.spyOn(Element.prototype, 'querySelectorAll') - const geometry = vi.spyOn(Element.prototype, 'getBoundingClientRect') - const capture = vi.spyOn(roots, 'capture') - const restore = vi.spyOn(roots, 'restoreAll') - register.mockClear() - draw([...notices]) - expect(capture).toHaveBeenCalledOnce() - expect(restore).toHaveBeenCalledOnce() - expect(memoryWrites).toHaveBeenCalledTimes(2 * count) - expect(queries.mock.calls.length).toBeLessThanOrEqual(12 * count) - expect(geometry.mock.calls.length).toBeLessThanOrEqual(8 * count) - expect(register.mock.calls.length).toBeLessThanOrEqual(count) - expect(observer.observe).toHaveBeenCalledTimes(2 * count) - expect(viewports.map((node) => node.scrollTop)).toEqual(Array(count).fill(35)) - - act(() => toggles.slice(0, count / 2).forEach((toggle) => toggle.click())) - expect(observer.unobserve).toHaveBeenCalledTimes(count) - ids.forEach((id, i) => expect(roots.frame(id)).toBe(i < count / 2 ? undefined : viewports[i])) - draw(notices, { shown: false }) - expect(observer.unobserve).toHaveBeenCalledTimes(2 * count) - for (const node of viewports) { - expect(node.hasAttribute('data-chat-scroll-root')).toBe(false) - expect(mobileNativeChatScrollRootKey(node)).toBeUndefined() - expect(observer.unobserve).toHaveBeenCalledWith(node) - expect(observer.unobserve).toHaveBeenCalledWith(node.firstElementChild) - } - ids.forEach((id) => expect(roots.frame(id)).toBeUndefined()) - memoryWrites.mockClear() - queries.mockClear() - geometry.mockClear() - roots.capture(new Set(), false) - roots.restoreAll() - viewports.forEach((node) => reader(node, 50)) - expect(memoryWrites).not.toHaveBeenCalled() - expect(queries).not.toHaveBeenCalled() - expect(geometry).not.toHaveBeenCalled() - } -) diff --git a/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-root-handle.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-root-handle.ts index 4ee32f3c66b..14b3901af0e 100644 --- a/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-root-handle.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-root-handle.ts @@ -1,5 +1,5 @@ -import type { MobileNativeChatScrollMotion } from '../../mobile-native-chat-scroll-motion' -import type { MobileNativeChatScrollAnchoring } from '../../mobile-native-chat-scroll-anchoring' +import type { MobileNativeChatScrollMotion } from './mobile-native-chat-scroll-motion' +import type { MobileNativeChatScrollAnchoring } from './mobile-native-chat-scroll-anchoring' export type MobileNativeChatRootPosition = { top: number diff --git a/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-roots.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-roots.ts index 7d612ef882a..1d46dcb42a5 100644 --- a/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-roots.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-scroll-roots.ts @@ -1,8 +1,5 @@ -import { - MobileNativeChatScrollMotion, - scrollKeepsPlace -} from '../../mobile-native-chat-scroll-motion' -import { MobileNativeChatScrollAnchoring } from '../../mobile-native-chat-scroll-anchoring' +import { MobileNativeChatScrollMotion, scrollKeepsPlace } from './mobile-native-chat-scroll-motion' +import { MobileNativeChatScrollAnchoring } from './mobile-native-chat-scroll-anchoring' import { mobileNativeChatScrollRootAttribute as ROOT, mobileNativeChatScrollRootOwners as owners, diff --git a/mobile/src/session/native-chat/transcript/mobile-native-chat-send-text-owner.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-send-text-owner.ts index 997c1a11062..a075b12f3ed 100644 --- a/mobile/src/session/native-chat/transcript/mobile-native-chat-send-text-owner.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-send-text-owner.ts @@ -1,5 +1,5 @@ -import type { MobileNativeChatSendIntent } from '../mobile-native-chat-send' -import type { MobileNativeChatSendOrigin } from '../mobile-native-chat-pending-echo' +import type { MobileNativeChatSendIntent } from '../composer/mobile-native-chat-send' +import type { MobileNativeChatSendOrigin } from './mobile-native-chat-pending-echo' type Restore = ( origin: MobileNativeChatSendOrigin, diff --git a/mobile/src/session/native-chat/mobile-native-chat-stream-frame.test.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-stream-frame.test.ts similarity index 91% rename from mobile/src/session/native-chat/mobile-native-chat-stream-frame.test.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-stream-frame.test.ts index 29a44951f12..59938201fe1 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-stream-frame.test.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-stream-frame.test.ts @@ -2,8 +2,8 @@ import { describe, expect, it } from 'vitest' import { createNativeChatMerger, replaceList -} from '../../../../src/shared/native-chat/native-chat-merge' -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' +} from '../../../../../src/shared/native-chat/native-chat-merge' +import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' import { applyMobileNativeChatStreamFrame } from './mobile-native-chat-stream-frame' function message(id: string): NativeChatMessage { diff --git a/mobile/src/session/native-chat/mobile-native-chat-stream-frame.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-stream-frame.ts similarity index 91% rename from mobile/src/session/native-chat/mobile-native-chat-stream-frame.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-stream-frame.ts index b80ec6ce347..bc38755de03 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-stream-frame.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-stream-frame.ts @@ -1,8 +1,8 @@ -import { applyAppend, replaceList } from '../../../../src/shared/native-chat/native-chat-merge' -import { translate } from '../../i18n/mobile-i18n' -import type { NativeChatMerger } from '../../../../src/shared/native-chat/native-chat-merge' -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' -import type { NativeChatTranscriptFrame } from '../../../../src/shared/native-chat/native-chat-transcript-frames' +import { applyAppend, replaceList } from '../../../../../src/shared/native-chat/native-chat-merge' +import { translate } from '../../../i18n/mobile-i18n' +import type { NativeChatMerger } from '../../../../../src/shared/native-chat/native-chat-merge' +import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' +import type { NativeChatTranscriptFrame } from '../../../../../src/shared/native-chat/native-chat-transcript-frames' type SnapshotFrame = Extract diff --git a/mobile/src/session/native-chat/mobile-native-chat-transcript-cache.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-transcript-cache.ts similarity index 85% rename from mobile/src/session/native-chat/mobile-native-chat-transcript-cache.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-transcript-cache.ts index 7ea01a40f66..6a913f955b1 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-transcript-cache.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-transcript-cache.ts @@ -1,6 +1,6 @@ -import { setBoundedScopeCacheEntry } from '../../../../src/shared/native-chat/native-chat-scope-cache' -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' -import type { NativeChatResumePoint } from '../../../../src/shared/rpc-contract/native-chat-params' +import { setBoundedScopeCacheEntry } from '../../../../../src/shared/native-chat/native-chat-scope-cache' +import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' +import type { NativeChatResumePoint } from '../../../../../src/shared/rpc-contract/native-chat-params' import { peekStoredChatTranscript } from './mobile-native-chat-transcript-store' const MAX_CACHED_TRANSCRIPTS = 8 diff --git a/mobile/src/session/native-chat/mobile-native-chat-transcript-encode.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-transcript-encode.ts similarity index 93% rename from mobile/src/session/native-chat/mobile-native-chat-transcript-encode.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-transcript-encode.ts index daeeb767d09..779de03d547 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-transcript-encode.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-transcript-encode.ts @@ -2,10 +2,10 @@ import { Gzip, strToU8 } from 'fflate' import { trimRetainedItems, mergeSubmissions -} from '../../../../src/shared/agent-session/view/structured-agent-session-item-retention' -import { agentSessionHasOlderTranscript } from '../../../../src/shared/agent-session/agent-session-context-clear' -import { DEVICE_STORE_MAX_VALUE_LENGTH } from '../../device-store/device-store-value-codec' -import { encodeBase64Bytes } from '../../transport/encryption/base64-byte-codec' +} from '../../../../../src/shared/agent-session/view/structured-agent-session-item-retention' +import { agentSessionHasOlderTranscript } from '../../../../../src/shared/agent-session/agent-session-context-clear' +import { DEVICE_STORE_MAX_VALUE_LENGTH } from '../../../device-store/device-store-value-codec' +import { encodeBase64Bytes } from '../../../transport/encryption/base64-byte-codec' import { STORED_TRANSCRIPT_VERSION, type StoredChatTranscript, diff --git a/mobile/src/session/native-chat/mobile-native-chat-transcript-store.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-transcript-store.ts similarity index 89% rename from mobile/src/session/native-chat/mobile-native-chat-transcript-store.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-transcript-store.ts index b3c59746c44..fb091e1f10a 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-transcript-store.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-transcript-store.ts @@ -1,12 +1,15 @@ import { sha256 } from '@noble/hashes/sha256' import { bytesToHex } from '@noble/hashes/utils' -import { setBoundedScopeCacheEntry } from '../../../../src/shared/native-chat/native-chat-scope-cache' -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' -import { encodeNativeChatTranscriptIdentity } from '../../../../src/shared/native-chat/transcript/native-chat-transcript-retention' -import type { StructuredAgentSessionState } from '../../../../src/shared/agent-session/structured-agent-session-reducer' -import { decodeDeviceStoreValue } from '../../device-store/device-store-value-codec' -import { readPageDeviceStore } from '../../mobile-web-shell/bridge/page-device-store' -import { resolveMobileNativeChat, type MobileNativeChatTab } from './mobile-native-chat-eligibility' +import { setBoundedScopeCacheEntry } from '../../../../../src/shared/native-chat/native-chat-scope-cache' +import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' +import { encodeNativeChatTranscriptIdentity } from '../../../../../src/shared/native-chat/transcript/native-chat-transcript-retention' +import type { StructuredAgentSessionState } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' +import { decodeDeviceStoreValue } from '../../../device-store/device-store-value-codec' +import { readPageDeviceStore } from '../../../mobile-web-shell/bridge/page-device-store' +import { + resolveMobileNativeChat, + type MobileNativeChatTab +} from '../mobile-native-chat-eligibility' // Bump when a stored shape changes: other versions read as a miss. export const STORED_TRANSCRIPT_VERSION = 1 diff --git a/mobile/src/session/native-chat/mobile-native-chat-transcript-writer.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-transcript-writer.ts similarity index 95% rename from mobile/src/session/native-chat/mobile-native-chat-transcript-writer.ts rename to mobile/src/session/native-chat/transcript/mobile-native-chat-transcript-writer.ts index a500287955f..630532cc6f3 100644 --- a/mobile/src/session/native-chat/mobile-native-chat-transcript-writer.ts +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-transcript-writer.ts @@ -1,16 +1,16 @@ -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' -import { onPageAppInactive } from '../../mobile-web-shell/bridge/bridge-app-inactive' +import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' +import { onPageAppInactive } from '../../../mobile-web-shell/bridge/bridge-app-inactive' import { EMPTY_STRUCTURED_AGENT_SESSION, reduceStructuredAgentSession, type StructuredAgentSessionAction, type StructuredAgentSessionState -} from '../../../../src/shared/agent-session/structured-agent-session-reducer' +} from '../../../../../src/shared/agent-session/structured-agent-session-reducer' import { MAX_RETAINED_ITEMS, MAX_RETAINED_OWN_ITEMS -} from '../../../../src/shared/agent-session/view/structured-agent-session-item-retention' -import { readPageDeviceStore } from '../../mobile-web-shell/bridge/page-device-store' +} from '../../../../../src/shared/agent-session/view/structured-agent-session-item-retention' +import { readPageDeviceStore } from '../../../mobile-web-shell/bridge/page-device-store' import { chatTranscriptStoreKey, peekStoredChatTranscript, diff --git a/mobile/src/session/native-chat/transcript/mobile-native-chat-turn-diff.test-fixture.tsx b/mobile/src/session/native-chat/transcript/mobile-native-chat-turn-diff.test-fixture.tsx deleted file mode 100644 index 31a7a6e29d1..00000000000 --- a/mobile/src/session/native-chat/transcript/mobile-native-chat-turn-diff.test-fixture.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import './mobile-agent-message-renderer.test-fixture' -import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' -import type { ReactTestInstance } from 'react-test-renderer' -import { vi } from 'vitest' -import { useMobileNativeChatTurnDisclosure } from './use-mobile-native-chat-turn-disclosure' -import { MobileNativeChatRowContent } from './MobileNativeChatRowItemSource' -import { findAllByHostType } from '../../../test-support/react-test-renderer-host-nodes' - -vi.mock('@react-native-async-storage/async-storage', () => ({ - default: { getItem: async () => null, setItem: async () => {}, removeItem: async () => {} } -})) - -export const messages: NativeChatMessage[] = [ - { - id: 'u', - role: 'user', - source: 'transcript', - timestamp: 1, - blocks: [{ type: 'text', text: 'Fix the greeting' }] - }, - { - id: 'edit', - role: 'assistant', - source: 'transcript', - timestamp: 2, - blocks: [ - { - type: 'tool-call', - name: 'Bash', - state: 'completed', - input: { command: 'inspect-diagnostic' } - }, - { type: 'tool-result', output: 'diagnostic-output' }, - { - type: 'tool-call', - name: 'Edit', - state: 'completed', - input: { - file_path: '/repo/greeting.ts', - old_string: 'helloOld()', - new_string: 'helloNew()' - } - }, - { type: 'tool-result', output: 'The file /repo/greeting.ts has been updated successfully.' }, - { type: 'tool-call', name: 'Diff', input: { path: 'status.ts' } }, - { type: 'tool-result', output: '@@ -1 +1 @@\n-statusOld()\n+statusNew()' } - ] - }, - { - id: 'answer', - role: 'assistant', - source: 'transcript', - timestamp: 3, - blocks: [{ type: 'text', text: 'Updated the greeting.' }] - } -] -const settled = new Map([['u', { startedAt: 1, workedSeconds: 2 }]]) -export function Transcript({ - rows = messages, - working = false -}: { - rows?: NativeChatMessage[] - working?: boolean -}) { - const turns = useMobileNativeChatTurnDisclosure({ - messages: rows, - enabled: true, - isWorking: working, - settledTurns: working ? undefined : settled, - scopeKey: 'test' - }) - return ( - <> - {turns.listMessages.map((message, index) => ( - - ))} - - ) -} -export function textIn(node: ReactTestInstance): string[] { - return findAllByHostType(node, 'Text').map((text) => String(text.children.join(''))) -} diff --git a/mobile/src/session/native-chat-receipt-copy.ts b/mobile/src/session/native-chat/transcript/native-chat-receipt-copy.ts similarity index 89% rename from mobile/src/session/native-chat-receipt-copy.ts rename to mobile/src/session/native-chat/transcript/native-chat-receipt-copy.ts index 63093240a36..4dba5e0df58 100644 --- a/mobile/src/session/native-chat-receipt-copy.ts +++ b/mobile/src/session/native-chat/transcript/native-chat-receipt-copy.ts @@ -1,4 +1,4 @@ -import type { Translate } from '../i18n/mobile-i18n' +import type { Translate } from '../../../i18n/mobile-i18n' export function nativeChatReceiptCopy(t: Translate, device?: string) { return { diff --git a/mobile/src/session/native-chat/transcript/native-chat-tool-run-words.test.ts b/mobile/src/session/native-chat/transcript/native-chat-tool-run-words.test.ts deleted file mode 100644 index 3258cc79084..00000000000 --- a/mobile/src/session/native-chat/transcript/native-chat-tool-run-words.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import type { SupportedUiLocale } from '../../../../../src/shared/ui-locale' -import { - joinNativeChatToolRunClauses, - nativeChatToolRunSentence -} from '../../../../../src/shared/native-chat/tools/native-chat-tool-run-sentence' -import { getMobileUiLocale } from '../../../i18n/mobile-i18n' -import { nativeChatToolRunWords } from './native-chat-tool-run-words' - -vi.mock('../../../i18n/mobile-i18n', () => ({ - getMobileUiLocale: vi.fn(() => 'en') -})) - -const joiners = { - pair: (first: string, second: string) => `${first} | ${second}`, - list: (leading: readonly string[], last: string) => [...leading, last].join(' | ') -} - -function mobileWords(locale: SupportedUiLocale) { - vi.mocked(getMobileUiLocale).mockReturnValue(locale) - return { ...nativeChatToolRunWords((_key, fallback) => fallback), ...joiners } -} - -describe('mobile tool-run sentence continuations', () => { - it('keeps German noun capitalization through the sentence formatter', () => { - const words = mobileWords('de') - expect( - nativeChatToolRunSentence( - [ - { type: 'tool-call', name: 'read', input: {} }, - { type: 'tool-call', name: 'Bash', input: { command: 'orca snapshot --page p1' } } - ], - {}, - { - ...words, - clause: (category) => (category === 'browser' ? 'Browser verwendet' : 'Datei gelesen') - } - ) - ).toBe('Datei gelesen | Browser verwendet') - }) - - it('uses Turkish casing for both dotted and dotless I in later clauses', () => { - expect(joinNativeChatToolRunClauses(['Başladı', 'İnceledi', 'Isındı'], mobileWords('tr'))).toBe( - 'Başladı | inceledi | ısındı' - ) - }) -}) diff --git a/mobile/src/session/native-chat/transcript/native-chat-turn-draw-order-scaling.test.ts b/mobile/src/session/native-chat/transcript/native-chat-turn-draw-order-scaling.test.ts deleted file mode 100644 index 33e322c37ea..00000000000 --- a/mobile/src/session/native-chat/transcript/native-chat-turn-draw-order-scaling.test.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { expect, it } from 'vitest' -import { nativeChatTurnDrawOrder } from '../../../../../src/shared/native-chat/transcript/native-chat-turn-grouping' -import { nativeChatTurnMembership } from '../../../../../src/shared/native-chat/transcript/native-chat-turn-membership' -import type { - AgentJournalItemBody, - AgentJournalRenderItem -} from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' - -it.each([10, 100])( - 'reads turn ownership linearly for %i queued openers and earlier-turn rows', - (count) => { - const messages = [ - { id: 'first', role: 'user' as const }, - ...Array.from({ length: count }, (_, index) => ({ - id: `queued-${index}`, - role: 'user' as const - })), - ...Array.from({ length: count }, (_, index) => ({ - id: `tail-${index}`, - role: 'assistant' as const - })), - ...Array.from({ length: count }, (_, index) => ({ - id: `answer-${index}`, - role: 'assistant' as const - })) - ] - const keys = [ - 'first', - ...Array.from({ length: count }, (_, index) => `queued-${index}`), - ...Array.from({ length: count }, () => 'first'), - ...Array.from({ length: count }, (_, index) => `queued-${index}`) - ] - const openers = new Set(keys.slice(0, count + 1)) - let reads = 0 - keys.forEach((key, index) => { - Object.defineProperty(keys, index, { - get: () => { - reads += 1 - return key - } - }) - }) - const order = nativeChatTurnDrawOrder(messages, keys, openers) - const visits = reads - expect(order?.map((index) => messages[index]?.id)).toEqual([ - 'first', - ...Array.from({ length: count }, (_, index) => `tail-${index}`), - ...Array.from({ length: count }, (_, index) => [`queued-${index}`, `answer-${index}`]).flat() - ]) - const journalItems: AgentJournalRenderItem[] = [] - const append = (itemId: string, body: AgentJournalItemBody, turnItemId: string) => { - const sequence = journalItems.length + 1 - journalItems.push({ - itemId, - body, - revision: 0, - sequence, - observedAt: sequence, - turnScope: { kind: 'turn', turnItemId } - }) - } - append('first', { kind: 'message', role: 'user', blocks: [] }, 'turn-first') - append( - 'turn-first', - { kind: 'turn', turnId: 'first', state: 'completed', userItemId: 'first' }, - 'turn-first' - ) - for (let index = 0; index < count; index += 1) { - append(`queued-${index}`, { kind: 'message', role: 'user', blocks: [] }, `turn-${index}`) - } - for (let index = 0; index < count; index += 1) { - append(`tail-${index}`, { kind: 'message', role: 'assistant', blocks: [] }, 'turn-first') - } - for (let index = 0; index < count; index += 1) { - append( - `turn-${index}`, - { kind: 'turn', turnId: `t${index}`, state: 'completed', userItemId: `queued-${index}` }, - `turn-${index}` - ) - append(`answer-${index}`, { kind: 'message', role: 'assistant', blocks: [] }, `turn-${index}`) - } - const membership = nativeChatTurnMembership(messages, { items: journalItems, submissions: [] }) - expect(membership.turnKeys).toEqual(keys) - expect(membership.drawOrder).toEqual(order) - expect(visits).toBeLessThanOrEqual(messages.length * 4) - } -) diff --git a/mobile/src/session/native-chat/native-chat-turn-status-copy.ts b/mobile/src/session/native-chat/transcript/native-chat-turn-status-copy.ts similarity index 94% rename from mobile/src/session/native-chat/native-chat-turn-status-copy.ts rename to mobile/src/session/native-chat/transcript/native-chat-turn-status-copy.ts index 4f30ef74bab..27b4d095a10 100644 --- a/mobile/src/session/native-chat/native-chat-turn-status-copy.ts +++ b/mobile/src/session/native-chat/transcript/native-chat-turn-status-copy.ts @@ -1,8 +1,8 @@ -import type { Translate } from '../../i18n/mobile-i18n' +import type { Translate } from '../../../i18n/mobile-i18n' import { describeNativeChatActiveTurnLabel, describeNativeChatTurnStatus -} from '../../../../src/shared/native-chat/transcript/native-chat-turn-status' +} from '../../../../../src/shared/native-chat/transcript/native-chat-turn-status' export function formatMobileNativeChatDuration(seconds: number, t: Translate): string { const totalSeconds = Number.isFinite(seconds) ? Math.max(0, Math.floor(seconds)) : 0 diff --git a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-detail.ts b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-detail.ts index 12fcaca7552..a3fb9ec98f9 100644 --- a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-detail.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-detail.ts @@ -4,7 +4,7 @@ import { type NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' import { projectStructuredItemToNativeChat } from '../../../../../src/shared/agent-session/view/structured-agent-session-projection' -import { readMobileNativeChatItem } from '../mobile-native-chat-item-read' +import { readMobileNativeChatItem } from './mobile-native-chat-item-read' import type { MobileNativeChatVisualSource } from '../visual/mobile-native-chat-visual-read' export type MobileNativeChatMessageDetail = { diff --git a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.ts b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.ts index 0740f24ceec..c3c2803f169 100644 --- a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.ts @@ -8,11 +8,11 @@ import { typeMobileNativeChatCommandWithOutcome, type MobileNativeChatSendIntent, type MobileNativeChatSendOutcome -} from '../mobile-native-chat-send' +} from '../composer/mobile-native-chat-send' import type { CatalogCommandDelivery } from '../../../../../src/shared/agent-session/options/agent-session-option-catalog-types' import { isSlashCommandDraft } from '../../../../../src/shared/native-chat/input/native-chat-slash-commands' -import { healMobileNativeChatStaleInput } from '../mobile-native-chat-stale-input' -import { classifyMobileNativeChatSend } from '../mobile-native-chat-send-classification' +import { healMobileNativeChatStaleInput } from '../composer/mobile-native-chat-stale-input' +import { classifyMobileNativeChatSend } from '../composer/mobile-native-chat-send-classification' import { readMobileNativeChatSkillOrigin } from '../composer/mobile-native-chat-draft-store' import { nativeChatSendTextOwner } from './mobile-native-chat-send-text-owner' import { @@ -22,12 +22,12 @@ import { import { acquireMobileNativeChatTerminalWrite, releaseMobileNativeChatTerminalWrite -} from '../mobile-native-chat-terminal-write-lock' -import type { MobileNativeChatSendOrigin } from '../mobile-native-chat-pending-echo' +} from '../composer/mobile-native-chat-terminal-write-lock' +import type { MobileNativeChatSendOrigin } from './mobile-native-chat-pending-echo' import { UNCONFIRMED_SEND_MESSAGE, UNCONFIRMED_SEND_RESTORED_MESSAGE -} from '../use-mobile-native-chat-unconfirmed-sends' +} from '../composer/use-mobile-native-chat-unconfirmed-sends' import type { MobileNativeChatLaunchDraftSeed } from '../composer/use-mobile-native-chat-launch-draft-seed' import { buildNativeChatPasteBytes } from '../../../../../src/shared/native-chat/input/native-chat-paste-bytes' diff --git a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-paced-text.ts b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-paced-text.ts index b6067a1d7f7..e20e514a785 100644 --- a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-paced-text.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-paced-text.ts @@ -13,7 +13,7 @@ import { type NativeChatTextRevealFrames } from '../../../../../src/shared/native-chat/transcript/native-chat-text-reveal' import { MobileNativeChatReplyRevealsContext } from './mobile-native-chat-reply-reveals' -import { MobileNativeChatGrowthHoldContext } from '../../mobile-native-chat-growth-hold' +import { MobileNativeChatGrowthHoldContext } from './mobile-native-chat-growth-hold' /** Phones spread each arrival over less time than desktop, so new words show sooner. */ const REVEAL_MS = 180 diff --git a/mobile/src/session/use-mobile-native-chat-terminal-turn.ts b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-terminal-turn.ts similarity index 86% rename from mobile/src/session/use-mobile-native-chat-terminal-turn.ts rename to mobile/src/session/native-chat/transcript/use-mobile-native-chat-terminal-turn.ts index 73f07177b30..2fda3b75901 100644 --- a/mobile/src/session/use-mobile-native-chat-terminal-turn.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-terminal-turn.ts @@ -1,13 +1,13 @@ import { useCallback, useMemo, useState } from 'react' -import type { AgentStatusEntry } from '../../../src/shared/agent-status/contracts/agent-status-types' -import type { NativeChatMessage } from '../../../src/shared/native-chat/native-chat-types' -import type { NativeChatSettledTurns } from '../../../src/shared/native-chat/transcript/native-chat-turn-status' +import type { AgentStatusEntry } from '../../../../../src/shared/agent-status/contracts/agent-status-types' +import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' +import type { NativeChatSettledTurns } from '../../../../../src/shared/native-chat/transcript/native-chat-turn-status' import { mergeNativeChatLiveSession, nativeChatHookHasWorkingSubagents, resolveNativeChatHookState -} from '../../../src/shared/native-chat/native-chat-live-status' -import { shouldClearNativeChatWorkingSuppression } from '../../../src/shared/native-chat/native-chat-working-suppression' +} from '../../../../../src/shared/native-chat/native-chat-live-status' +import { shouldClearNativeChatWorkingSuppression } from '../../../../../src/shared/native-chat/native-chat-working-suppression' import { nativeChatHookLatestTurnWorkedSeconds, nativeChatHookTurnStartedAt, @@ -16,16 +16,16 @@ import { nativeChatTranscriptSettledTurns, resolveNativeChatTerminalTurn, type NativeChatTerminalTurn -} from '../../../src/shared/native-chat/native-chat-terminal-turn' -import { deriveNativeChatStreamingText } from '../../../src/shared/native-chat/native-chat-streaming' +} from '../../../../../src/shared/native-chat/native-chat-terminal-turn' +import { deriveNativeChatStreamingText } from '../../../../../src/shared/native-chat/native-chat-streaming' import { useThrottledLatestValue } from './use-throttled-latest-value' -import type { MobileNativeChatSession } from './native-chat/use-mobile-native-chat-session' -import type { MobileNativeChatResolution } from './native-chat/mobile-native-chat-eligibility' +import type { MobileNativeChatSession } from '../use-mobile-native-chat-session' +import type { MobileNativeChatResolution } from '../mobile-native-chat-eligibility' import { pendingSendsAsMessages, type NativeChatPendingSend -} from '../../../src/shared/native-chat/transcript/native-chat-pending-sends' +} from '../../../../../src/shared/native-chat/transcript/native-chat-pending-sends' const NO_MESSAGES: NativeChatMessage[] = [] diff --git a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-transient-data.ts b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-transient-data.ts index a99c895969f..359db10fe05 100644 --- a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-transient-data.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-transient-data.ts @@ -2,7 +2,7 @@ import { useState } from 'react' import { buildMobileNativeChatTransientData, type MobileNativeChatPendingItem -} from '../mobile-native-chat-render-data' +} from './mobile-native-chat-render-data' import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' import { orderNativeChatDisplayMessages } from '../../../../../src/shared/native-chat/transcript/native-chat-message-order' diff --git a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-turn-disclosure.ts b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-turn-disclosure.ts index 2ca97644e53..097d5428f36 100644 --- a/mobile/src/session/native-chat/transcript/use-mobile-native-chat-turn-disclosure.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-native-chat-turn-disclosure.ts @@ -23,7 +23,7 @@ import { nativeChatMessagesWaitingBehindLiveTurn } from '../../../../../src/shar import { NATIVE_CHAT_STREAMING_ID } from '../../../../../src/shared/native-chat/native-chat-streaming' import type { NativeChatResolvedPrompt } from '../../../../../src/shared/native-chat/native-chat-resolution-receipt' import { useMobileNativeChatTranscriptRows } from './use-mobile-native-chat-transcript-rows' -import type { MobileNativeChatRunPresentation } from '../mobile-native-chat-run-descriptors' +import type { MobileNativeChatRunPresentation } from './mobile-native-chat-run-descriptors' import { nativeChatRowsInDrawOrder, nativeChatTurnBarRows diff --git a/mobile/src/session/use-mobile-older-page-loader.ts b/mobile/src/session/native-chat/transcript/use-mobile-older-page-loader.ts similarity index 96% rename from mobile/src/session/use-mobile-older-page-loader.ts rename to mobile/src/session/native-chat/transcript/use-mobile-older-page-loader.ts index 7ac4a25ab1b..41c0615413b 100644 --- a/mobile/src/session/use-mobile-older-page-loader.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-older-page-loader.ts @@ -1,5 +1,5 @@ import { useCallback, useRef, useState } from 'react' -import { RPC_REQUEST_MIN_ACK_MS } from '../transport/rpc/rpc-request-budget' +import { RPC_REQUEST_MIN_ACK_MS } from '../../../transport/rpc/rpc-request-budget' /** One tap's whole wait, connect included, shared by every page it reads. */ export const OLDER_PAGE_BUDGET_MS = 15_000 diff --git a/mobile/src/session/use-mobile-structured-agent-turn-timing.ts b/mobile/src/session/native-chat/transcript/use-mobile-structured-agent-turn-timing.ts similarity index 67% rename from mobile/src/session/use-mobile-structured-agent-turn-timing.ts rename to mobile/src/session/native-chat/transcript/use-mobile-structured-agent-turn-timing.ts index 1dddcdde3b5..e010ef7b5ca 100644 --- a/mobile/src/session/use-mobile-structured-agent-turn-timing.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-structured-agent-turn-timing.ts @@ -2,16 +2,16 @@ import { useMemo, useState } from 'react' import type { AgentJournalRenderItem, AgentJournalSubmission -} from '../../../src/shared/agent-session/journal/agent-session-journal-types' -import type { NativeChatSettledTurns } from '../../../src/shared/native-chat/transcript/native-chat-turn-status' -import type { AgentSessionLatestTurn } from '../../../src/shared/agent-session/agent-session-wire' -import type { NativeChatTurnJournal } from '../../../src/shared/native-chat/transcript/native-chat-turn-membership' -import type { StructuredAgentHostClock } from '../../../src/shared/agent-session/structured-agent-session-reducer' -import { selectStructuredAgentTurnBars } from '../../../src/shared/agent-session/view/structured-agent-session-turn-timing' +} from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' +import type { NativeChatSettledTurns } from '../../../../../src/shared/native-chat/transcript/native-chat-turn-status' +import type { AgentSessionLatestTurn } from '../../../../../src/shared/agent-session/agent-session-wire' +import type { NativeChatTurnJournal } from '../../../../../src/shared/native-chat/transcript/native-chat-turn-membership' +import type { StructuredAgentHostClock } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' +import { selectStructuredAgentTurnBars } from '../../../../../src/shared/agent-session/view/structured-agent-session-turn-timing' import { stepStructuredAgentTurnClock, type StructuredAgentTurnClockLatch -} from '../../../src/shared/structured-agent-turn-clock-anchor' +} from '../../../../../src/shared/structured-agent-turn-clock-anchor' // Use journal durations and latch the host-to-phone start conversion once per turn so counters remain skew-free. export function useMobileStructuredAgentTurnTiming( diff --git a/mobile/src/session/use-mobile-structured-transcript.ts b/mobile/src/session/native-chat/transcript/use-mobile-structured-transcript.ts similarity index 60% rename from mobile/src/session/use-mobile-structured-transcript.ts rename to mobile/src/session/native-chat/transcript/use-mobile-structured-transcript.ts index f4fa032ca3c..8023c0336f5 100644 --- a/mobile/src/session/use-mobile-structured-transcript.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-structured-transcript.ts @@ -3,14 +3,15 @@ import { agentSessionContextClearOutstanding, agentSessionTranscriptRows, latestAgentSessionContextClearSequence -} from '../../../src/shared/agent-session/agent-session-context-clear' -import type { StructuredAgentSessionState } from '../../../src/shared/agent-session/structured-agent-session-reducer' -import { projectStructuredAgentSessionMessages } from '../../../src/shared/agent-session/view/structured-agent-session-message-projection' -import { tuiAgentDisplayName } from '../../../src/shared/agent-launch/catalog/tui-agent-display-names' -import { withNativeChatCutTurnNotices } from '../../../src/shared/native-chat/transcript/native-chat-cut-turn-notice' -import { omitNativeChatThreadGoalRows } from '../../../src/shared/native-chat/transcript/native-chat-thread-goal-rows' -import { createStructuredQuestionProjection } from '../../../src/shared/structured-agent-question-projection' -import { projectStructuredAgentStartItem } from '../../../src/shared/structured-agent-start-projection' +} from '../../../../../src/shared/agent-session/agent-session-context-clear' +import type { StructuredAgentSessionState } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' +import type { StructuredAgentSessionOptimisticMessage } from '../../../../../src/shared/agent-session/view/structured-agent-session-message-projection' +import { createStructuredAgentSessionMessageProjection } from '../../../../../src/shared/agent-session/view/structured-agent-session-message-stream' +import { tuiAgentDisplayName } from '../../../../../src/shared/agent-launch/catalog/tui-agent-display-names' +import { withNativeChatCutTurnNotices } from '../../../../../src/shared/native-chat/transcript/native-chat-cut-turn-notice' +import { omitNativeChatThreadGoalRows } from '../../../../../src/shared/native-chat/transcript/native-chat-thread-goal-rows' +import { createStructuredQuestionProjection } from '../../../../../src/shared/structured-agent-question-projection' +import { projectStructuredAgentStartItem } from '../../../../../src/shared/structured-agent-start-projection' const mobileStructuredTranscript = createStructuredQuestionProjection( projectStructuredAgentStartItem @@ -22,7 +23,7 @@ const mobileStructuredTranscript = createStructuredQuestionProjection( export function useMobileStructuredTranscript( agent: string | null, state: Pick, - optimistic: Parameters[1], + optimistic: readonly StructuredAgentSessionOptimisticMessage[], sessionKey: string ) { const [clearSent, setClearSent] = useState<{ @@ -61,24 +62,22 @@ export function useMobileStructuredTranscript( }), [agent, floor, state.items] ) + const projectMessages = useMemo( + () => createStructuredAgentSessionMessageProjection(mobileStructuredTranscript.messages), + [] + ) + const questionTranscript = useMemo(() => mobileStructuredTranscript.stream(), []) const messages = useMemo( () => // The goal strip on the composer shows goal state, as on desktop. - omitNativeChatThreadGoalRows( - projectStructuredAgentSessionMessages( - transcriptItems, - optimistic, - state.submissions, - mobileStructuredTranscript.messages - ) - ), - [transcriptItems, optimistic, state.submissions] + omitNativeChatThreadGoalRows(projectMessages(transcriptItems, optimistic, state.submissions)), + [transcriptItems, optimistic, state.submissions, projectMessages] ) return { clearing, onClearSent, transcriptItems, messages, - receipts: mobileStructuredTranscript.transcript(transcriptItems).receipts + receipts: questionTranscript(transcriptItems).receipts } } diff --git a/mobile/src/session/use-mobile-structured-turn-indicator.ts b/mobile/src/session/native-chat/transcript/use-mobile-structured-turn-indicator.ts similarity index 73% rename from mobile/src/session/use-mobile-structured-turn-indicator.ts rename to mobile/src/session/native-chat/transcript/use-mobile-structured-turn-indicator.ts index 6274d7c509c..73be344024e 100644 --- a/mobile/src/session/use-mobile-structured-turn-indicator.ts +++ b/mobile/src/session/native-chat/transcript/use-mobile-structured-turn-indicator.ts @@ -1,14 +1,14 @@ import { useMemo } from 'react' -import type { StructuredAgentSessionState } from '../../../src/shared/agent-session/structured-agent-session-reducer' -import type { NativeChatLiveTurnIndicator } from '../../../src/shared/native-chat/transcript/native-chat-turn-status' -import { isStructuredAgentSessionThinking } from '../../../src/shared/agent-session/view/structured-agent-session-live-turn' -import { selectStructuredAgentTurnActivity } from '../../../src/shared/native-chat/transcript/native-chat-turn-activity' -import { agentStopDisplayStatus } from '../../../src/shared/agent-status/lifecycle/agent-stop-display-status' -import { mobileStructuredSendQueues } from './mobile-structured-send-queue-rule' +import type { StructuredAgentSessionState } from '../../../../../src/shared/agent-session/structured-agent-session-reducer' +import type { NativeChatLiveTurnIndicator } from '../../../../../src/shared/native-chat/transcript/native-chat-turn-status' +import { isStructuredAgentSessionThinking } from '../../../../../src/shared/agent-session/view/structured-agent-session-live-turn' +import { selectStructuredAgentTurnActivity } from '../../../../../src/shared/native-chat/transcript/native-chat-turn-activity' +import { agentStopDisplayStatus } from '../../../../../src/shared/agent-status/lifecycle/agent-stop-display-status' +import { mobileStructuredSendQueues } from '../composer/mobile-structured-send-queue-rule' import { nativeChatSendFollowUp, type NativeChatSendFollowUp -} from '../../../src/shared/native-chat/input/native-chat-follow-up-behavior' +} from '../../../../../src/shared/native-chat/input/native-chat-follow-up-behavior' export function useMobileStructuredTurnIndicator(input: { state: StructuredAgentSessionState diff --git a/mobile/src/session/native-chat/use-stored-chat-transcript.ts b/mobile/src/session/native-chat/transcript/use-stored-chat-transcript.ts similarity index 100% rename from mobile/src/session/native-chat/use-stored-chat-transcript.ts rename to mobile/src/session/native-chat/transcript/use-stored-chat-transcript.ts diff --git a/mobile/src/session/use-throttled-latest-value.ts b/mobile/src/session/native-chat/transcript/use-throttled-latest-value.ts similarity index 100% rename from mobile/src/session/use-throttled-latest-value.ts rename to mobile/src/session/native-chat/transcript/use-throttled-latest-value.ts diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-controller.ts b/mobile/src/session/native-chat/use-mobile-native-chat-controller.ts index ec49ba67457..b90f76fb88f 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-controller.ts +++ b/mobile/src/session/native-chat/use-mobile-native-chat-controller.ts @@ -3,21 +3,21 @@ import { useCallback, useLayoutEffect, useMemo, useRef, type MutableRefObject } import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import type { ConnectionState } from '../../transport/connection/connection-state' import type { MobileNativeChatTab } from './mobile-native-chat-eligibility' -import type { StructuredAgentSessionHostSupport } from '../mobile-structured-agent-session-host-support' +import type { StructuredAgentSessionHostSupport } from './agent-session/mobile-structured-agent-session-host-support' import { useMobileNativeChatDrafts } from './composer/use-mobile-native-chat-drafts' import { useMobileNativeChatWorkspaceCatalog } from './composer/use-mobile-native-chat-workspace-catalog' import { useMobileNativeChatMessageSend } from './transcript/use-mobile-native-chat-message-send' import { useMobileNativeChatSessionOptionController } from './input/use-mobile-native-chat-session-option-controller' import { useMobileNativeChatSessionLane } from './use-mobile-native-chat-session-lane' -import { useMobileStructuredNativeChatSendBridge } from '../use-mobile-structured-native-chat-send-bridge' -import { useMobileNativeChatTerminalTurn } from '../use-mobile-native-chat-terminal-turn' +import { useMobileStructuredNativeChatSendBridge } from './composer/use-mobile-structured-native-chat-send-bridge' +import { useMobileNativeChatTerminalTurn } from './transcript/use-mobile-native-chat-terminal-turn' import type { MobileNativeChatController } from './mobile-native-chat-controller-contract' -import { useMobileBridgeChatPromptWrites } from '../use-mobile-bridge-chat-prompt-writes' +import { useMobileBridgeChatPromptWrites } from './input/use-mobile-bridge-chat-prompt-writes' import { useMobileNativeChatActiveResolution } from './use-mobile-native-chat-active-resolution' -import { useMobileNativeChatPromptController } from '../use-mobile-native-chat-prompt-controller' +import { useMobileNativeChatPromptController } from './input/use-mobile-native-chat-prompt-controller' import { nativeChatPendingSendPlacement } from '../../../../src/shared/native-chat/transcript/native-chat-pending-sends' import { mobileNativeChatScopeKey } from './mobile-native-chat-scope-key' -import { useMobileNativeChatCiResultLines } from '../use-mobile-native-chat-ci-result-lines' +import { useMobileNativeChatCiResultLines } from './preferences/use-mobile-native-chat-ci-result-lines' export function useMobileNativeChatController(args: { client: RpcClient | null diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-markdown-links.ts b/mobile/src/session/native-chat/use-mobile-native-chat-markdown-links.ts index 8865ab41830..d8ad6f990d2 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-markdown-links.ts +++ b/mobile/src/session/native-chat/use-mobile-native-chat-markdown-links.ts @@ -21,7 +21,7 @@ import { type MobileMarkdownLinks } from '../../components/mobile-markdown-links-context' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' -import type { RpcOperationSender } from '../../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../../transport/rpc/unvalidated-rpc-request-port' import { isMobileMethodUnavailableError } from '../../transport/rpc/mobile-method-unavailable' import { isFilePathCodeSpan } from '../../components/markdown-file-path-detection' import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rpc/rpc-operation' @@ -42,7 +42,7 @@ const chatPathsExistRead = bindDeferredRpcOperation( /** Paths in a chat's text, checked in batches against the chat's workspace on its host. */ export function createMobileNativeChatFileLinkExistence( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, worktreePath: string ): NativeChatFileLinkExistence { diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-session-lane.ts b/mobile/src/session/native-chat/use-mobile-native-chat-session-lane.ts index d61614a79a7..0ce1245b017 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-session-lane.ts +++ b/mobile/src/session/native-chat/use-mobile-native-chat-session-lane.ts @@ -1,13 +1,13 @@ import { useCallback } from 'react' import type { MobileComposerWriter } from './composer/mobile-native-chat-draft-store' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' -import type { StructuredAgentSessionHostSupport } from '../mobile-structured-agent-session-host-support' +import type { StructuredAgentSessionHostSupport } from './agent-session/mobile-structured-agent-session-host-support' import type { ConnectionState } from '../../transport/connection/connection-state' import { useMobileNativeChatSession } from './use-mobile-native-chat-session' -import { useMobileStructuredAgentSession } from '../use-mobile-structured-agent-session' -import { useMobileStructuredSessionCommands } from '../use-mobile-structured-session-commands' +import { useMobileStructuredAgentSession } from './agent-session/use-mobile-structured-agent-session' +import { useMobileStructuredSessionCommands } from './composer/use-mobile-structured-session-commands' import type { MobileNativeChatResolution } from './mobile-native-chat-eligibility' -import type { MobileNativeChatSendErrorReporter } from './use-mobile-native-chat-send-error' +import type { MobileNativeChatSendErrorReporter } from './composer/use-mobile-native-chat-send-error' // Run both hooks in fixed order and starve the inactive lane’s identity so flips preserve cached transcripts. export function useMobileNativeChatSessionLane({ diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-session.test.ts b/mobile/src/session/native-chat/use-mobile-native-chat-session.test.ts index 8d9f0705af2..5a5db4d94a0 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-session.test.ts +++ b/mobile/src/session/native-chat/use-mobile-native-chat-session.test.ts @@ -5,8 +5,8 @@ import type { NativeChatMessage } from '../../../../src/shared/native-chat/nativ import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import { stubRpcClient } from '../../transport/rpc/rpc-client-test-stub' import { publishPageDeviceStore } from '../../mobile-web-shell/bridge/page-device-store' -import { mobileNativeChatTranscriptCache } from './mobile-native-chat-transcript-cache' -import { encodeStoredChatTranscript } from './mobile-native-chat-transcript-encode' +import { mobileNativeChatTranscriptCache } from './transcript/mobile-native-chat-transcript-cache' +import { encodeStoredChatTranscript } from './transcript/mobile-native-chat-transcript-encode' import { useMobileNativeChatSession, type MobileNativeChatSession @@ -164,62 +164,6 @@ describe('useMobileNativeChatSession', () => { expect(state?.messages.at(-1)?.id).toBe('live-1') }) - it('keeps the rows it shows when a replay window has moved past them', async () => { - const sendRequest = vi.fn(() => new Promise(() => {})) - const window = Array.from({ length: 40 }, (_unused, index) => message(`win-${index}`)) - const subscribe: RpcClient['subscribe'] = vi.fn((_method, _params, onData) => { - emit = onData - onData({ type: 'snapshot', messages: window, hasMore: false, beforeOffset: 0 }) - return () => {} - }) - await mount({ sendRequest, subscribe } as unknown as RpcClient) - - await act(async () => - emit({ - type: 'snapshot', - messages: [...window.slice(1), message('live-1')], - hasMore: true, - beforeOffset: 10 - }) - ) - - expect(state?.messages.map((entry) => entry.id)).toEqual([ - ...window.map((entry) => entry.id), - 'live-1' - ]) - expect(state?.hasMore).toBe(false) - }) - - it('drops paged rows that an authoritative replay says were removed', async () => { - const sendRequest = vi.fn().mockResolvedValue({ - ok: true, - result: { - messages: Array.from({ length: 60 }, (_unused, index) => message(`paged-${index}`)), - hasMore: false, - beforeOffset: 40 - } - }) - const window = Array.from({ length: 40 }, (_unused, index) => message(`win-${index}`)) - const subscribe: RpcClient['subscribe'] = vi.fn((_method, _params, onData) => { - emit = onData - onData({ type: 'snapshot', messages: window, hasMore: true, beforeOffset: 100 }) - return () => {} - }) - await mount({ sendRequest, subscribe } as unknown as RpcClient) - await act(async () => { - state?.loadEarlier() - await Promise.resolve() - }) - expect(state?.messages).toHaveLength(100) - - await act(async () => - emit({ type: 'snapshot', messages: window, hasMore: false, beforeOffset: 0 }) - ) - - expect(state?.messages).toEqual(window) - expect(state?.hasMore).toBe(false) - }) - it('fences an in-flight older page when a merging replay re-cuts the byte cursor', async () => { let resolveEarlier: (response: unknown) => void = () => {} const sendRequest = vi.fn( @@ -272,35 +216,6 @@ describe('useMobileNativeChatSession', () => { expect(state?.messages.map((entry) => entry.id)).toEqual(['early-b', 'base-c']) }) - - it('keeps every row it shows while live output outgrows the first window', async () => { - let resolvePage: (response: unknown) => void = () => {} - const sendRequest = vi - .fn() - .mockImplementationOnce(() => new Promise((resolve) => (resolvePage = resolve))) - .mockImplementation(() => new Promise(() => {})) - const window = Array.from({ length: 40 }, (_unused, index) => message(`window-${index}`)) - const subscribe: RpcClient['subscribe'] = vi.fn((_method, _params, onData) => { - emit = onData - onData({ type: 'snapshot', messages: window, hasMore: true, beforeOffset: 100 }) - return () => {} - }) - await mount({ sendRequest, subscribe } as unknown as RpcClient) - const shown = window.map((entry) => entry.id) - - act(() => state?.loadEarlier()) - await act(async () => emit({ type: 'appended', messages: [message('live-1')] })) - expect(state?.messages.map((entry) => entry.id)).toEqual([...shown, 'live-1']) - - await act(async () => { - resolvePage({ - ok: true, - result: { messages: [message('older-page')], hasMore: true, beforeOffset: 50 } - }) - await Promise.resolve() - }) - expect(state?.messages.map((entry) => entry.id)).toEqual(['older-page', ...shown, 'live-1']) - }) }) describe('useMobileNativeChatSession transcriptLoading', () => { diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-session.ts b/mobile/src/session/native-chat/use-mobile-native-chat-session.ts index 978f859a8f3..0e2d53c95b5 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-session.ts +++ b/mobile/src/session/native-chat/use-mobile-native-chat-session.ts @@ -15,21 +15,23 @@ import { nativeChatSessionPageRead } from './agent-session/mobile-native-chat-pa import { applyMobileNativeChatStreamFrame, type MobileNativeChatStreamFrame -} from './mobile-native-chat-stream-frame' +} from './transcript/mobile-native-chat-stream-frame' import { randomV4Uuid } from '../../platform/random-v4-uuid' -import { useMobileOlderPageLoader, type OlderPagePhase } from '../use-mobile-older-page-loader' +import { + useMobileOlderPageLoader, + type OlderPagePhase +} from './transcript/use-mobile-older-page-loader' import { cacheMobileNativeChatTranscript, heldMobileNativeChatTranscript, mobileNativeChatResumePoint, mobileNativeChatTranscriptCache -} from './mobile-native-chat-transcript-cache' -import { terminalChatTranscriptIdentity } from './mobile-native-chat-transcript-store' -import { noteChatTranscript } from './mobile-native-chat-transcript-writer' -import { useStoredChatTranscript } from './use-stored-chat-transcript' +} from './transcript/mobile-native-chat-transcript-cache' +import { terminalChatTranscriptIdentity } from './transcript/mobile-native-chat-transcript-store' +import { noteChatTranscript } from './transcript/mobile-native-chat-transcript-writer' +import { useStoredChatTranscript } from './transcript/use-stored-chat-transcript' import type { MobileNativeChatStatus } from './mobile-native-chat-session-status' -export type { MobileNativeChatStatus } from './mobile-native-chat-session-status' export type MobileNativeChatSession = { messages: NativeChatMessage[] diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts b/mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts index daa4e74a737..084b090f152 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts +++ b/mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts @@ -5,19 +5,13 @@ import { useMobileNativeChatTerminalStream } from './use-mobile-native-chat-term describe('useMobileNativeChatTerminalStream', () => { let renderer: ReactTestRenderer | null = null - let harnessRenderCount = 0 const subscriptionsRef = { current: new Map void>() } const subscribingRef = { current: new Set() } const leaseOnlyRef = { current: new Set() } const webReadyRef = { current: new Set(['terminal-1']) } - let subscribeOpensLeaseOnly = false const registerSubscription = (handle: string): boolean => { subscriptionsRef.current.set(handle, () => {}) - if (subscribeOpensLeaseOnly) { - leaseOnlyRef.current.add(handle) - } else { - leaseOnlyRef.current.delete(handle) - } + leaseOnlyRef.current.delete(handle) return true } const subscribe = vi.fn(registerSubscription) @@ -25,7 +19,6 @@ describe('useMobileNativeChatTerminalStream', () => { subscriptionsRef.current.delete(handle) leaseOnlyRef.current.delete(handle) }) - const notifyWebReadyRef = { current: (_handle: string, _wasAlreadyReady: boolean): void => {} } const notifyListedHandlesRef = { current: (_liveHandles: ReadonlySet): void => {} } const hasTabsRecoveryNeedRef = { current: (): boolean => false } @@ -33,9 +26,7 @@ describe('useMobileNativeChatTerminalStream', () => { subscriptionsRef.current = new Map([['terminal-1', () => {}]]) subscribingRef.current = new Set() leaseOnlyRef.current = new Set() - subscribeOpensLeaseOnly = false webReadyRef.current = new Set(['terminal-1']) - harnessRenderCount = 0 subscribe.mockClear() unsubscribe.mockClear() }) @@ -56,7 +47,6 @@ describe('useMobileNativeChatTerminalStream', () => { leaseReady?: boolean streamRevision?: number }): null { - harnessRenderCount += 1 const stream = useMobileNativeChatTerminalStream({ showNativeChat, activeHandle, @@ -70,7 +60,6 @@ describe('useMobileNativeChatTerminalStream', () => { subscribe, unsubscribe }) - notifyWebReadyRef.current = stream.notifyWebReady notifyListedHandlesRef.current = stream.notifyListedHandles hasTabsRecoveryNeedRef.current = stream.hasTabsRecoveryNeed return null @@ -95,244 +84,6 @@ describe('useMobileNativeChatTerminalStream', () => { }) } - // A synchronous tab switch still sees old chat coverage and opens the incoming terminal as lease-only. - function handOffToTerminalTwo(): void { - subscribeOpensLeaseOnly = true - subscribe('terminal-2') - subscribeOpensLeaseOnly = false - subscribe.mockClear() - unsubscribe.mockClear() - } - - it('trades a lease-only stream for output when a chat tab hands off to a terminal tab', async () => { - webReadyRef.current.add('terminal-2') - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - handOffToTerminalTwo() - - await act(async () => { - renderer?.update( - createElement(Harness, { showNativeChat: false, activeHandle: 'terminal-2' }) - ) - }) - - expect(unsubscribe).toHaveBeenCalledWith('terminal-2') - expect(subscribe).toHaveBeenCalledWith('terminal-2') - expect(leaseOnlyRef.current.has('terminal-2')).toBe(false) - }) - - it('repairs a lease-only stream once its WebView reports ready', async () => { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - handOffToTerminalTwo() - await act(async () => { - renderer?.update( - createElement(Harness, { showNativeChat: false, activeHandle: 'terminal-2' }) - ) - }) - - // A cold WebView must wait; its normal ready path skips already-live lease subscriptions. - expect(subscribe).not.toHaveBeenCalled() - - await act(async () => { - webReadyRef.current.add('terminal-2') - notifyWebReadyRef.current('terminal-2', false) - }) - - expect(unsubscribe).toHaveBeenCalledWith('terminal-2') - expect(subscribe).toHaveBeenCalledWith('terminal-2') - }) - - it.each([true, false])( - 'stops rearming a handle whose stream never comes back (covered: %s, #10681)', - async (showNativeChat) => { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat })) - }) - subscribe.mockClear() - // Dead PTYs answer subscribed/end repeatedly; rearm must stop rather than loop through host waits. - for (let revision = 1; revision <= 6; revision += 1) { - subscriptionsRef.current.delete('terminal-1') - await act(async () => { - renderer?.update( - createElement(Harness, { - showNativeChat, - leaseReady: false, - streamRevision: revision - }) - ) - }) - } - - expect(subscribe.mock.calls.length).toBeLessThanOrEqual(3) - } - ) - - it('does not charge the rearm budget for a subscribe its own gates turned away', async () => { - try { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - subscribe.mockClear() - // Locally rejected subscribes never reached the host and must not spend real attempts. - subscribe.mockImplementation(() => false) - for (let revision = 1; revision <= 5; revision += 1) { - subscriptionsRef.current.delete('terminal-1') - await act(async () => { - renderer?.update( - createElement(Harness, { - showNativeChat: true, - leaseReady: false, - streamRevision: revision - }) - ) - }) - } - - expect(subscribe).toHaveBeenCalledTimes(5) - } finally { - subscribe.mockImplementation(registerSubscription) - } - }) - - it('charges the rearm budget for a subscribe the bridge refused before returning', async () => { - try { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: false })) - }) - subscribe.mockClear() - // A synchronous refusal ends the stream inside subscribe, so no ref ever shows it was sent. - subscribe.mockImplementation(() => true) - for (let revision = 1; revision <= 5; revision += 1) { - subscriptionsRef.current.delete('terminal-1') - await act(async () => { - renderer?.update( - createElement(Harness, { - showNativeChat: false, - leaseReady: false, - streamRevision: revision - }) - ) - }) - } - - expect(subscribe).toHaveBeenCalledTimes(3) - } finally { - subscribe.mockImplementation(registerSubscription) - } - }) - - it.each([true, false])( - 'refills the rearm budget when terminal.list reports the handle again (covered: %s, #10681)', - async (showNativeChat) => { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat })) - }) - for (let revision = 1; revision <= 5; revision += 1) { - subscriptionsRef.current.delete('terminal-1') - await act(async () => { - renderer?.update( - createElement(Harness, { - showNativeChat, - leaseReady: false, - streamRevision: revision - }) - ) - }) - } - subscribe.mockClear() - await act(async () => { - renderer?.update( - createElement(Harness, { showNativeChat, leaseReady: false, streamRevision: 6 }) - ) - }) - expect(subscribe).not.toHaveBeenCalled() - - // Still-listed dead handles must not refill on every inventory refresh. - await act(async () => { - notifyListedHandlesRef.current(new Set(['terminal-1'])) - notifyListedHandlesRef.current(new Set(['terminal-1'])) - }) - expect(subscribe).not.toHaveBeenCalled() - - await act(async () => { - notifyListedHandlesRef.current(new Set()) - notifyListedHandlesRef.current(new Set(['terminal-1'])) - }) - - expect(subscribe).toHaveBeenCalledWith('terminal-1') - } - ) - - it('does not let a dead PTY buy a new budget with its own `subscribed` ack', async () => { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - subscribe.mockClear() - // Subscribed is only half a dead-PTY reply; clearing attempts there would refill the loop forever. - for (let revision = 1; revision <= 6; revision += 1) { - await playDeadPtyRoundTrip(revision) - } - - expect(subscribe.mock.calls.length).toBeLessThanOrEqual(3) - }) - - it('refills the budget for a rearmed stream that outlives the teardown window', async () => { - vi.useFakeTimers() - try { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - subscribe.mockClear() - for (let revision = 1; revision <= 3; revision += 1) { - await playDeadPtyRoundTrip(revision) - } - expect(subscribe).toHaveBeenCalledTimes(3) - - subscribe.mockClear() - subscriptionsRef.current.set('terminal-1', () => {}) - await act(async () => { - renderer?.update( - createElement(Harness, { showNativeChat: true, leaseReady: true, streamRevision: 4 }) - ) - }) - await act(async () => { - vi.advanceTimersByTime(5_000) - }) - await playDeadPtyRoundTrip(5) - - expect(subscribe).toHaveBeenCalledWith('terminal-1') - } finally { - vi.useRealTimers() - } - }) - - it('keeps an absence marker observed before the budget ran out', async () => { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - for (let revision = 1; revision <= 2; revision += 1) { - await playDeadPtyRoundTrip(revision) - } - // Preserve absence markers until exhaustion actually consumes them; early consumption can permanently lock a still-listed handle. - await act(async () => { - notifyListedHandlesRef.current(new Set()) - notifyListedHandlesRef.current(new Set(['terminal-1'])) - }) - await playDeadPtyRoundTrip(3) - subscribe.mockClear() - await playDeadPtyRoundTrip(4) - expect(subscribe).not.toHaveBeenCalled() - - await act(async () => { - notifyListedHandlesRef.current(new Set(['terminal-1'])) - }) - - expect(subscribe).toHaveBeenCalledWith('terminal-1') - }) - it('keeps asking until a tab snapshot replaces the exhausted handle', async () => { await act(async () => { renderer = create(createElement(Harness, { showNativeChat: true })) @@ -364,25 +115,4 @@ describe('useMobileNativeChatTerminalStream', () => { }) expect(hasTabsRecoveryNeedRef.current()).toBe(false) }) - - it('resumes a cold-start lease-only stream when WebView readiness arrives late', async () => { - webReadyRef.current.clear() - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - await act(async () => { - renderer?.update(createElement(Harness, { showNativeChat: false })) - }) - - expect(unsubscribe).toHaveBeenCalledOnce() - expect(subscribe).toHaveBeenCalledOnce() - - webReadyRef.current.add('terminal-1') - await act(async () => { - notifyWebReadyRef.current('terminal-1', false) - }) - - expect(unsubscribe).toHaveBeenNthCalledWith(2, 'terminal-1') - expect(subscribe).toHaveBeenNthCalledWith(2, 'terminal-1') - }) }) diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-usage-limit.ts b/mobile/src/session/native-chat/use-mobile-native-chat-usage-limit.ts index 400253d479b..443fbf12000 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-usage-limit.ts +++ b/mobile/src/session/native-chat/use-mobile-native-chat-usage-limit.ts @@ -14,12 +14,12 @@ import type { } from '../../../../src/shared/agent-session/journal/agent-session-journal-types' import type { AgentSessionOptionsResult } from '../../../../src/shared/agent-session/options/agent-session-options-result' import type { AgentJournalCursor } from '../../../../src/shared/agent-session/journal/agent-session-journal-identity' -import { mobileStructuredSessionStatusFeed } from '../mobile-structured-session-status-feed' -import { callAgentSession } from '../mobile-structured-agent-session-rpc' +import { mobileStructuredSessionStatusFeed } from './agent-session/mobile-structured-session-status-feed' +import { callAgentSession } from './agent-session/mobile-structured-agent-session-rpc' import type { MobileStructuredAgentSessionArgs, StructuredMobileSession -} from '../mobile-structured-agent-session-contract' +} from './agent-session/mobile-structured-agent-session-contract' /** The usage-limit row the person can act on: the latest cut while nothing is running or sending. */ export type MobileNativeChatUsageLimit = { diff --git a/mobile/src/session/structured-create-wire-types.test.ts b/mobile/src/session/structured-create-wire-types.test.ts deleted file mode 100644 index 14813467cb6..00000000000 --- a/mobile/src/session/structured-create-wire-types.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { describe, expect, expectTypeOf, it } from 'vitest' -import type { z } from 'zod' -import { - structuredAgentSessionCreateParams, - type StructuredAgentSessionFirstMessage -} from '../../../src/shared/agent-session/structured-agent-session-create' -import { CreateIntentParams } from '../../../src/shared/rpc-contract/structured-agent-session-params' - -describe('the shared create builder used by mobile', () => { - it('remains assignable to the strict create request without an opening message', () => { - const params = structuredAgentSessionCreateParams({ - sessionId: 'codex_11111111_2222_3333_4444_555555555555', - worktree: 'id:workspace-1', - agent: 'codex', - randomUuid: () => '11111111-2222-3333-4444-555555555555' - }) - expectTypeOf(params).toExtend>() - expect(CreateIntentParams.safeParse(params).success).toBe(true) - expect(params).not.toHaveProperty('firstMessage') - }) - - it('accepts only user-authored opening messages at the type and wire boundaries', () => { - const firstMessage: StructuredAgentSessionFirstMessage = { - clientMessageId: 'opening-message', - body: { kind: 'message', role: 'user', blocks: [{ type: 'text', text: 'hello' }] } - } - const params = structuredAgentSessionCreateParams({ - sessionId: 'codex_11111111_2222_3333_4444_555555555555', - worktree: 'id:workspace-1', - agent: 'codex', - firstMessage, - randomUuid: () => '11111111-2222-3333-4444-555555555555' - }) - expect(params.firstMessage).toEqual(firstMessage) - expect(CreateIntentParams.safeParse(params).success).toBe(true) - - type AssistantBody = { - kind: 'message' - role: 'assistant' - blocks: { type: 'text'; text: string }[] - } - expectTypeOf().not.toExtend() - expectTypeOf().toEqualTypeOf<'user'>() - expect( - CreateIntentParams.shape.firstMessage.safeParse({ - clientMessageId: 'opening-message', - body: { kind: 'message', role: 'assistant', blocks: [{ type: 'text', text: 'forged' }] } - }).success - ).toBe(false) - }) -}) diff --git a/mobile/src/session/tabs/MobileNewTabSheet.tsx b/mobile/src/session/tabs/MobileNewTabSheet.tsx new file mode 100644 index 00000000000..0f7730ddd75 --- /dev/null +++ b/mobile/src/session/tabs/MobileNewTabSheet.tsx @@ -0,0 +1,183 @@ +import { useRef } from 'react' +import { Pressable, Text, View } from 'react-native' +import { FileText, Globe, SquareTerminal } from 'lucide-react-native' +import type { TuiAgent } from '../../../../src/shared/agent-launch/catalog/tui-agent' +import { ActionSheetContent, type ActionSheetAction } from '../../components/ActionSheetModal' +import { BottomDrawer } from '../../components/bottom-drawer/BottomDrawer' +import { + LIST_LEADING_INSET, + ListGroup, + ListRow, + SectionHeader +} from '../../components/list/ListGroup' +import { MobileAgentIcon } from '../../components/MobileAgentIcon' +import { SheetHeader } from '../../components/nav-bar/SheetHeader' +import { useMobileTranslation } from '../../i18n/use-mobile-translation' +import { colors, radii, spacing } from '../../theme/mobile-theme' +import { themedStyleSheet } from '../../theme/themed-styles' +import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' +import type { MobileNewTabAgentOption } from '../agent-launch/mobile-new-tab-agent-options' + +const AGENT_GRID_COLUMNS = 3 + +type Props = { + visible: boolean + workspaceName: string + agentOptions: readonly MobileNewTabAgentOption[] + /** Loading, none, other-server or error; shown instead of the agent grid. */ + agentStatusRow: ActionSheetAction | null + canCreateBrowser: boolean + canCreateMarkdownNote: boolean + onClose: () => void + onCreateAgent: (agent: TuiAgent) => void + onCreateTerminal: () => void + /** Runs after the sheet has gone, so it may open another modal. */ + onCreateBrowser: () => void + onCreateMarkdownNote: () => void +} + +export function MobileNewTabSheet({ + visible, + workspaceName, + agentOptions, + agentStatusRow, + canCreateBrowser, + canCreateMarkdownNote, + onClose, + onCreateAgent, + onCreateTerminal, + onCreateBrowser, + onCreateMarkdownNote +}: Props) { + useMobileColorScheme() + const t = useMobileTranslation() + // Wait for the iOS sheet window to unmount before presenting another native modal. + const afterCloseRef = useRef<(() => void) | null>(null) + const closeThen = (action: () => void) => { + afterCloseRef.current = action + onClose() + } + const closeAndRun = (action: () => void) => { + onClose() + action() + } + const showAgentGrid = agentStatusRow === null && agentOptions.length > 0 + // Short last rows keep empty slots so every tile stays a third of the row wide. + const agentRows: { options: MobileNewTabAgentOption[]; emptySlots: string[] }[] = [] + for (let start = 0; start < agentOptions.length; start += AGENT_GRID_COLUMNS) { + const options = agentOptions.slice(start, start + AGENT_GRID_COLUMNS) + const emptySlots: string[] = [] + for (let column = options.length; column < AGENT_GRID_COLUMNS; column += 1) { + emptySlots.push(`empty:${column}`) + } + agentRows.push({ options, emptySlots }) + } + const iconColor = colors.textSecondary + return ( + { + const run = afterCloseRef.current + afterCloseRef.current = null + run?.() + }} + dragContentToDismiss + > + + {showAgentGrid || agentStatusRow ? ( + + ) : null} + {agentStatusRow ? : null} + {showAgentGrid ? ( + + {agentRows.map((row) => ( + option.agent).join(':')} style={styles.gridRow}> + {row.options.map((option) => ( + closeAndRun(() => onCreateAgent(option.agent))} + accessibilityRole="button" + accessibilityLabel={option.label} + style={styles.tile} + > + {({ pressed }) => ( + <> + {pressed ? : null} + + + {option.label} + + + )} + + ))} + {row.emptySlots.map((slot) => ( + + ))} + + ))} + + ) : null} + + } + onPress={() => closeAndRun(onCreateTerminal)} + /> + {canCreateBrowser ? ( + } + navigates + onPress={() => closeThen(onCreateBrowser)} + /> + ) : null} + {canCreateMarkdownNote ? ( + } + onPress={() => closeAndRun(onCreateMarkdownNote)} + /> + ) : null} + + + ) +} + +const styles = themedStyleSheet(() => ({ + grid: { gap: spacing.sm }, + gridRow: { flexDirection: 'row', gap: spacing.sm }, + tile: { + flex: 1, + minWidth: 0, + height: 78, + borderRadius: radii.surface, + backgroundColor: colors.sheetGroup, + overflow: 'hidden', + alignItems: 'center', + justifyContent: 'center', + gap: spacing.sm, + paddingHorizontal: spacing.sm + }, + // Same wash as a pressed ListRow, laid over the tile so its own fill stays underneath. + tilePressed: { + position: 'absolute', + top: 0, + right: 0, + bottom: 0, + left: 0, + backgroundColor: colors.translucentFill + }, + tileLabel: { fontSize: 13.5, fontWeight: '600', color: colors.textPrimary, maxWidth: '100%' }, + // Padded like a tile: flex shares space after padding, so a bare spacer would widen its row's tiles. + tileSpacer: { flex: 1, paddingHorizontal: spacing.sm }, + actions: { marginTop: spacing.lg } +})) diff --git a/mobile/src/session/tabs/MobileSessionTabBar.tsx b/mobile/src/session/tabs/MobileSessionTabBar.tsx new file mode 100644 index 00000000000..a9aeb494c8e --- /dev/null +++ b/mobile/src/session/tabs/MobileSessionTabBar.tsx @@ -0,0 +1,361 @@ +import { useMemo, useRef, useState } from 'react' +import { Pressable, Text, View } from 'react-native' +import { Plus } from 'lucide-react-native' +import { Gesture, GestureDetector } from 'react-native-gesture-handler' +import Animated, { + Easing, + ReduceMotion, + useAnimatedStyle, + useSharedValue, + withSequence, + withTiming +} from 'react-native-reanimated' +import { triggerMediumImpact, triggerSelection } from '../../platform/haptics' +import { useMobileTranslation } from '../../i18n/use-mobile-translation' +import { AgentStateDot } from '../../components/AgentStateDot' +import { ArrivalFade } from '../../components/ArrivalFade' +import { useDrawerReducedMotion } from '../../components/bottom-drawer/bottom-drawer-constants' +import { SHEET_CURVE } from '../../components/sheet-motion-values' +import { useReducedMotionEnabled } from '../../platform/use-reduced-motion' +import { useKeyboardPersistingTaps } from '../../platform/keyboard-persisting-taps' +import { useNow } from '../../hooks/use-now' +import { agentStateLabel, type AgentDotState } from '../../worktree/agent-row-display' +import { colors, feedback, radii, spacing } from '../../theme/mobile-theme' +import { themedStyleSheet } from '../../theme/themed-styles' +import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' +import { buildMobileSessionTabRow, type MobileSessionTabRow } from './mobile-session-tab-rows' +import { MobileSessionTabMark } from './MobileSessionTabMark' +import { MobileSessionTabsSheet } from './MobileSessionTabsSheet' +import type { MobileSessionController } from '../use-mobile-session-controller' + +const SWIPE_SETTLE_MS = 250 +// A tab arriving from the side starts this far out, as a share of the tab cell's width. +const SWIPE_ENTRY_SHARE = 0.4 +const FLICK_VELOCITY = 600 +// With no tab on that side, the tab gives only this share of the drag. +const EDGE_RESISTANCE = 0.25 +const DRAG_CLICK_WINDOW_MS = 400 + +// A tab drawn before it had any agent state (from the phone's store) fades its dot in when one lands. +function TabBarDot({ tabId, state }: { tabId: string; state: AgentDotState | undefined }) { + const [startedEmpty] = useState({ tabId, empty: state === undefined }) + if (startedEmpty.tabId === tabId && startedEmpty.empty) { + return + } + return state && state !== 'idle' ? : null +} + +// Mounted with the bare tab, so the motion preference is read before the dot arrives. +function ArrivingTabBarDot({ state }: { state: AgentDotState | undefined }) { + const reducedMotion = useReducedMotionEnabled() + if (!state || state === 'idle') { + return null + } + return ( + + + + ) +} + +/** The tab you're in as one cell: tap for its actions, swipe for the next one; the count shows every tab, + adds one. */ +export function MobileSessionTabBar({ + controller, + inTopBar, + actionsCollapsed = false +}: { + controller: MobileSessionController + inTopBar: boolean + actionsCollapsed?: boolean +}) { + useMobileColorScheme() + const t = useMobileTranslation() + const { + activeSessionTabId, + connState, + createTabBusy, + handleOpenNewTab, + switchSessionTab, + openSessionTabActionSheetAfterKeyboardDismiss, + visibleTabs, + terminals + } = controller + // Why: the first tap must reach the bar with the keyboard open instead of only dismissing it (#5106). + const keepsKeyboard = useKeyboardPersistingTaps('handled') + const now = useNow(60_000) + const rows = useMemo( + () => visibleTabs.map((tab) => buildMobileSessionTabRow(tab, terminals, now)), + [visibleTabs, terminals, now] + ) + const activeIndex = rows.findIndex((row) => row.tab.id === activeSessionTabId) + const active: MobileSessionTabRow | undefined = rows[activeIndex] + const previous = activeIndex > 0 ? rows[activeIndex - 1] : undefined + const next = activeIndex !== -1 ? rows[activeIndex + 1] : undefined + const othersNeedYou = rows.some( + (row) => row.tab.id !== activeSessionTabId && row.group === 'needs-you' + ) + const [sheetOpen, setSheetOpen] = useState(false) + + const reducedMotion = useDrawerReducedMotion() + const offset = useSharedValue(0) + const width = useSharedValue(0) + // On the web, releasing a mouse drag also clicks the tab. + const dragEndedAtRef = useRef(0) + const settle = (to: number) => + withTiming( + to, + reducedMotion + ? { duration: 0, reduceMotion: ReduceMotion.Never } + : { duration: SWIPE_SETTLE_MS, easing: Easing.bezier(...SHEET_CURVE) } + ) + const step = (target: MobileSessionTabRow | undefined, direction: 1 | -1) => { + if (!target) { + offset.value = settle(0) + return + } + triggerSelection() + switchSessionTab(target.tab) + offset.value = withSequence( + withTiming(-direction * width.value * SWIPE_ENTRY_SHARE, { duration: 0 }), + settle(0) + ) + } + // Callbacks run on JS: the session page is a web document, and stepping switches React state. + const pan = Gesture.Pan() + .runOnJS(true) + .enabled(rows.length > 1) + .activeOffsetX([-12, 12]) + .failOffsetY([-10, 10]) + .onUpdate((event) => { + const target = event.translationX > 0 ? previous : next + offset.value = target ? event.translationX : event.translationX * EDGE_RESISTANCE + }) + .onEnd((event) => { + // oxlint-disable-next-line react/purity -- runs when the drag ends, never during render. + dragEndedAtRef.current = Date.now() + const direction = event.translationX > 0 ? 1 : -1 + const flicked = + Math.abs(event.velocityX) > FLICK_VELOCITY && Math.sign(event.velocityX) === direction + if (Math.abs(event.translationX) > width.value / 2 || flicked) { + step(direction === 1 ? previous : next, direction) + return + } + offset.value = settle(0) + }) + // Web has no worklet plugin; mapper hooks need this explicit dependency list. + const contentStyle = useAnimatedStyle( + () => ({ + transform: [{ translateX: offset.value }], + opacity: 1 - Math.min(Math.abs(offset.value) / Math.max(width.value, 1), 1) * 0.6 + }), + [offset, width] + ) + + const status = active?.dotState && active.dotState !== 'idle' ? active.dotState : undefined + const countLabel = + rows.length === 1 + ? t('session.tabBar.oneTab', '1 tab') + : t('session.tabBar.tabCount', '{{count}} tabs', { count: rows.length }) + const tabLabel = [active?.title, status ? agentStateLabel(status) : null] + .filter(Boolean) + .join(', ') + const countAccessibilityLabel = [ + countLabel, + othersNeedYou ? t('session.tabBar.anotherNeedsYou', 'another tab needs you') : null + ] + .filter(Boolean) + .join(', ') + const createDisabled = createTabBusy || connState !== 'connected' + const openTabActions = () => { + // The click a drag release produces on the web belongs to the drag. + if (!active || Date.now() - dragEndedAtRef.current < DRAG_CLICK_WINDOW_MS) { + return + } + openSessionTabActionSheetAfterKeyboardDismiss(active.tab) + } + + return ( + + {/* pan-y keeps vertical touches with the page on the web. */} + + { + width.value = event.nativeEvent.layout.width + }} + > + [styles.tabPress, pressed && styles.cellPressed]} + onPress={openTabActions} + onLongPress={() => { + triggerMediumImpact() + openTabActions() + }} + delayLongPress={400} + disabled={!active} + accessibilityRole="button" + accessibilityLabel={tabLabel || countLabel} + accessibilityHint={t('session.tabBar.actionsHint', 'Shows actions for this tab')} + accessibilityActions={[ + ...(next ? [{ name: 'nextTab', label: t('session.tabBar.next', 'Next tab') }] : []), + ...(previous + ? [{ name: 'previousTab', label: t('session.tabBar.previous', 'Previous tab') }] + : []) + ]} + onAccessibilityAction={(event) => { + const name = event.nativeEvent.actionName + if (name === 'nextTab') { + step(next, -1) + } else if (name === 'previousTab') { + step(previous, 1) + } + }} + > + {/* Only the contents slide, so the cell stays flush with the screen edge. */} + + {active ? ( + <> + + + + + + ) : null} + + {active?.title ?? countLabel} + + + + + + [ + styles.sideCell, + actionsCollapsed && !inTopBar && styles.lastCell, + pressed && styles.cellPressed + ]} + onPress={() => setSheetOpen(true)} + accessibilityRole="button" + accessibilityLabel={countAccessibilityLabel} + accessibilityHint={t('session.tabBar.hint', 'Shows all tabs')} + > + + {rows.length} + + {othersNeedYou ? : null} + + {/* A collapsed bar's + lives in the header's ⋯ menu. */} + {!actionsCollapsed ? ( + [ + styles.sideCell, + !inTopBar && styles.lastCell, + pressed && styles.cellPressed, + createDisabled && styles.cellDisabled + ]} + disabled={createDisabled} + onPress={handleOpenNewTab} + accessibilityRole="button" + accessibilityLabel={t('session.tabStrip.newTab', 'New tab')} + accessibilityState={{ disabled: createDisabled }} + > + + + ) : null} + setSheetOpen(false)} + /> + + ) +} + +const styles = themedStyleSheet(() => ({ + bar: { + height: 44, + flexDirection: 'row', + alignItems: 'stretch', + borderTopWidth: 1, + borderTopColor: colors.borderSubtle + }, + // Cancels the top bar's vertical padding so the cells run the bar's full height. + barInTopBar: { + flex: 1, + minWidth: 0, + flexDirection: 'row', + alignItems: 'stretch', + alignSelf: 'stretch', + marginVertical: -spacing.xs, + marginLeft: spacing.md, + borderLeftWidth: 1, + borderLeftColor: colors.borderSubtle + }, + // The open tab, drawn like the strip's active tab: raised, with a line under it. + tabCell: { + flex: 1, + minWidth: 0, + backgroundColor: colors.bgRaised, + borderBottomWidth: 2, + borderBottomColor: colors.textSecondary, + borderRightWidth: 1, + borderRightColor: colors.borderSubtle, + overflow: 'hidden' + }, + tabPress: { + flex: 1, + justifyContent: 'center', + paddingLeft: spacing.lg, + paddingRight: spacing.sm + }, + tabContent: { flexDirection: 'row', alignItems: 'center', gap: 6 }, + // Keeps web SVGs from shrinking before the title ellipsizes. + mark: { flexShrink: 0 }, + title: { + flexShrink: 1, + minWidth: 0, + fontSize: 14, + fontWeight: '600', + color: colors.textPrimary + }, + sideCell: { + width: 46, + alignItems: 'center', + justifyContent: 'center', + borderRightWidth: 1, + borderRightColor: colors.borderSubtle + }, + // At the screen edge; in the top bar the hairline stays to part the cells from the round buttons. + lastCell: { borderRightWidth: 0 }, + cellPressed: { backgroundColor: colors.translucentFill }, + cellDisabled: { opacity: feedback.disabledOpacity }, + countBox: { + minWidth: 19, + height: 19, + paddingHorizontal: 3, + borderRadius: 6, + borderWidth: 1.8, + borderColor: colors.textPrimary, + alignItems: 'center', + justifyContent: 'center' + }, + countText: { + fontSize: 11, + fontWeight: '700', + color: colors.textPrimary, + fontVariant: ['tabular-nums'] + }, + // Another tab needs you: a red dot on the count's corner, ringed in the bar's colour. + alert: { + position: 'absolute', + top: 8, + right: 9, + width: 9, + height: 9, + borderRadius: radii.pill, + backgroundColor: colors.statusRed, + borderWidth: 2, + borderColor: colors.bgPanel + } +})) diff --git a/mobile/src/session/tabs/MobileSessionTabMark.tsx b/mobile/src/session/tabs/MobileSessionTabMark.tsx new file mode 100644 index 00000000000..67a1d0b3895 --- /dev/null +++ b/mobile/src/session/tabs/MobileSessionTabMark.tsx @@ -0,0 +1,28 @@ +import { File, FileText, Globe, SquareTerminal } from 'lucide-react-native' +import { MobileAgentIcon } from '../../components/MobileAgentIcon' +import { colors } from '../../theme/mobile-theme' +import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' +import type { MobileSessionTabRow } from './mobile-session-tab-rows' + +/** The tab's agent icon, else an icon for what kind of tab it is. */ +export function MobileSessionTabMark({ + row, + size +}: { + row: Pick + size: number +}) { + useMobileColorScheme() + if (row.agentId) { + return + } + const Icon = + row.tab.type === 'browser' + ? Globe + : row.tab.type === 'markdown' + ? FileText + : row.tab.type === 'file' + ? File + : SquareTerminal + return +} diff --git a/mobile/src/session/tabs/MobileSessionTabStrip.tsx b/mobile/src/session/tabs/MobileSessionTabStrip.tsx deleted file mode 100644 index 6455c9bf6f8..00000000000 --- a/mobile/src/session/tabs/MobileSessionTabStrip.tsx +++ /dev/null @@ -1,327 +0,0 @@ -import { useCallback, useMemo, useRef, useState } from 'react' -import { View, Text, ScrollView, Pressable, StyleSheet } from 'react-native' -import { File, FileText, Globe, Plus, SquareTerminal } from 'lucide-react-native' -import { triggerMediumImpact } from '../../platform/haptics' -import { useMobileTranslation } from '../../i18n/use-mobile-translation' -import { MobileAgentIcon } from '../../components/MobileAgentIcon' -import { AgentStateDot } from '../../components/AgentStateDot' -import { ArrivalFade } from '../../components/ArrivalFade' -import { useReducedMotionEnabled } from '../../platform/use-reduced-motion' -import { useNow } from '../../hooks/use-now' -import { - agentDotState, - agentStateLabel, - type AgentDotState -} from '../../worktree/agent-row-display' -import { - getMobileTerminalTabHostAgentIdentity, - getMobileSessionTabTitle, - resolveMobileTerminalTabAgentId -} from '../../terminal/session/mobile-terminal-tab-agent' -import { colors, spacing } from '../../theme/mobile-theme' -import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' -import { NavBarButton } from '../../components/nav-bar/NavBarButton' -import { - resolveTabStripEdgeHint, - resolveTabStripHiddenTabs, - resolveTabStripTapOffset, - type TabStripHiddenTabs -} from './tab-strip-scroll' -import { styles } from '../mobile-session-styles' -import { useKeyboardPersistingTaps } from '../../platform/keyboard-persisting-taps' -import type { MobileSessionController } from '../use-mobile-session-controller' - -const DOUBLE_TAP_RENAME_MS = 300 - -// A tab drawn before it had any agent state (a strip from the phone's store) fades its dot in when one lands. -function SessionTabAgentDot({ state }: { state: AgentDotState | undefined }) { - const [startedEmpty] = useState(state === undefined) - if (startedEmpty) { - return - } - return state && state !== 'idle' ? : null -} - -// Mounted with the bare tab, so the motion preference is read before the dot arrives. -function ArrivingSessionTabAgentDot({ state }: { state: AgentDotState | undefined }) { - const reducedMotion = useReducedMotionEnabled() - if (!state || state === 'idle') { - return null - } - return ( - - - - ) -} - -export function MobileSessionTabStrip({ - controller, - inTopBar, - actionsCollapsed = false -}: { - controller: MobileSessionController - inTopBar: boolean - actionsCollapsed?: boolean -}) { - useMobileColorScheme() - const t = useMobileTranslation() - const { - activeSessionTabId, - activeSessionTabIdRef, - tabStripRef, - tabStripOffsetRef, - tabStripViewportWidthRef, - tabStripContentWidthRef, - tabLayoutsRef, - connState, - createTabBusy, - handleOpenNewTab, - scrollActiveTabIntoView, - holdTabStripReveal, - cancelHeldTabStripReveal, - switchSessionTab, - openSessionTabActionSheetAfterKeyboardDismiss, - setRenameTarget, - activeHandleRef, - visibleTabs, - terminals - } = controller - const tabBarKeepsKeyboard = useKeyboardPersistingTaps('handled') - const lastTabTapRef = useRef<{ id: string; at: number } | null>(null) - const now = useNow(60_000) - const tabStates = useMemo(() => { - const states = new Map() - for (const tab of visibleTabs) { - // Why: a status restored across a host restart is unconfirmed, so like desktop it shows no live state. - if (tab.type === 'terminal' && tab.agentStatus && !tab.agentStatus.restoredUnconfirmed) { - states.set(tab.id, agentDotState(tab.agentStatus, now)) - } else if (tab.type === 'agent-session' && tab.chatStatus) { - states.set(tab.id, agentDotState(tab.chatStatus, now)) - } - } - return states - }, [visibleTabs, now]) - const [hiddenTabs, setHiddenTabs] = useState({ left: [], right: [] }) - const refreshHiddenTabs = () => { - const next = resolveTabStripHiddenTabs({ - layouts: tabLayoutsRef.current, - viewportWidth: tabStripViewportWidthRef.current, - currentOffset: tabStripOffsetRef.current - }) - // Why: scroll fires every frame; re-render only when a tab crosses an edge. - setHiddenTabs((prev) => - prev.left.join('\n') === next.left.join('\n') && - prev.right.join('\n') === next.right.join('\n') - ? prev - : next - ) - } - const leftHint = resolveTabStripEdgeHint(hiddenTabs.left, tabStates) - const rightHint = resolveTabStripEdgeHint(hiddenTabs.right, tabStates) - const pressTab = useCallback( - (t: (typeof visibleTabs)[number]) => { - const at = Date.now() - const lastTap = lastTabTapRef.current - lastTabTapRef.current = { id: t.id, at } - if ( - lastTap?.id === t.id && - at - lastTap.at < DOUBLE_TAP_RENAME_MS && - t.type === 'terminal' && - typeof t.terminal === 'string' - ) { - lastTabTapRef.current = null - triggerMediumImpact() - setRenameTarget({ - handle: t.terminal, - title: t.title, - isActive: t.terminal === activeHandleRef.current - }) - // The first tap's held reveal still runs once the window closes. - return - } - cancelHeldTabStripReveal() - const nextOffset = resolveTabStripTapOffset({ - tabId: t.id, - tabs: visibleTabs, - layouts: tabLayoutsRef.current, - viewportWidth: tabStripViewportWidthRef.current, - contentWidth: tabStripContentWidthRef.current, - currentOffset: tabStripOffsetRef.current - }) - if (nextOffset !== tabStripOffsetRef.current) { - holdTabStripReveal(nextOffset, DOUBLE_TAP_RENAME_MS) - } - switchSessionTab(t) - }, - [ - activeHandleRef, - cancelHeldTabStripReveal, - holdTabStripReveal, - setRenameTarget, - switchSessionTab, - tabLayoutsRef, - tabStripContentWidthRef, - tabStripOffsetRef, - tabStripRef, - tabStripViewportWidthRef, - visibleTabs - ] - ) - const attachTabStrip = useCallback( - (view: ScrollView | null) => { - if (view) { - tabStripOffsetRef.current = 0 - tabStripViewportWidthRef.current = 0 - tabStripContentWidthRef.current = 0 - tabLayoutsRef.current.clear() - } - tabStripRef.current = view - }, - [ - tabStripRef, - tabStripOffsetRef, - tabStripViewportWidthRef, - tabStripContentWidthRef, - tabLayoutsRef - ] - ) - return ( - - {/* Why: tab taps must register on first press with the keyboard open instead of being eaten by dismissal (#5106). */} - - { - tabStripOffsetRef.current = e.nativeEvent.contentOffset.x - refreshHiddenTabs() - }} - onLayout={(e) => { - tabStripViewportWidthRef.current = e.nativeEvent.layout.width - scrollActiveTabIntoView(activeSessionTabIdRef.current, false) - refreshHiddenTabs() - }} - onContentSizeChange={(width) => { - tabStripContentWidthRef.current = width - scrollActiveTabIntoView(activeSessionTabIdRef.current, false) - refreshHiddenTabs() - }} - > - {visibleTabs.map((tab, index) => { - const tabState = tabStates.get(tab.id) - const hostAgentIdentity = getMobileTerminalTabHostAgentIdentity(tab, terminals) - const title = getMobileSessionTabTitle(tab, hostAgentIdentity) - return ( - [ - styles.tab, - index === 0 && !inTopBar && styles.tabFirst, - tab.id === activeSessionTabId && styles.tabActive, - pressed && styles.tabPressed - ]} - onLayout={(e) => { - const { x, width } = e.nativeEvent.layout - tabLayoutsRef.current.set(tab.id, { x, width }) - if (tab.id === activeSessionTabIdRef.current) { - scrollActiveTabIntoView(tab.id, false) - } - refreshHiddenTabs() - }} - onPress={() => pressTab(tab)} - accessibilityRole="tab" - accessibilityLabel={ - tabState && tabState !== 'idle' - ? t('session.tabStrip.tabStatus', '{{title}}, {{status}}', { - title, - status: agentStateLabel(tabState) - }) - : title - } - accessibilityState={{ selected: tab.id === activeSessionTabId }} - onLongPress={() => { - triggerMediumImpact() - openSessionTabActionSheetAfterKeyboardDismiss(tab) - }} - delayLongPress={400} - > - - - - {tab.type === 'browser' && ( - - )} - {tab.type === 'markdown' && ( - - )} - {tab.type === 'file' && ( - - )} - {tab.type === 'agent-session' && ( - - )} - {tab.type === 'terminal' && - (() => { - const agentId = resolveMobileTerminalTabAgentId(tab, hostAgentIdentity) - return agentId ? ( - - ) : ( - - ) - })()} - - - {title} - - - - ) - })} - - {leftHint ? ( - - - - ) : null} - {rightHint ? ( - - - - ) : null} - - {/* Terminal layout and Quick commands live in the header's ⋯ menu. */} - {!actionsCollapsed ? ( - - - - ) : null} - - ) -} - -// The right inset matches the nav bar's, so the + lines up with the ⋯ above it. -const newTabStyles = StyleSheet.create({ - slot: { - paddingLeft: spacing.sm, - paddingRight: spacing.md - } -}) diff --git a/mobile/src/session/tabs/MobileSessionTabsSheet.tsx b/mobile/src/session/tabs/MobileSessionTabsSheet.tsx new file mode 100644 index 00000000000..f8cd5cd1981 --- /dev/null +++ b/mobile/src/session/tabs/MobileSessionTabsSheet.tsx @@ -0,0 +1,220 @@ +import { Fragment, useRef, useState } from 'react' +import { Pressable, Text, View } from 'react-native' +import { Plus, X } from 'lucide-react-native' +import { BottomDrawer } from '../../components/bottom-drawer/BottomDrawer' +import { ListGroup, SectionHeader } from '../../components/list/ListGroup' +import { NavBarButton } from '../../components/nav-bar/NavBarButton' +import { SheetHeader } from '../../components/nav-bar/SheetHeader' +import { SwipeRowActions } from '../../components/SwipeRowActions' +import { AgentStateDot } from '../../components/AgentStateDot' +import { useMobileTranslation } from '../../i18n/use-mobile-translation' +import { useNow } from '../../hooks/use-now' +import { formatTimeAgo } from '../../worktree/agent-row-display' +import { colors, radii, spacing } from '../../theme/mobile-theme' +import { themedStyleSheet } from '../../theme/themed-styles' +import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' +import type { MobileSessionTabGroup, MobileSessionTabRow } from './mobile-session-tab-rows' +import { MobileSessionTabMark } from './MobileSessionTabMark' +import type { MobileSessionController } from '../use-mobile-session-controller' + +const TILE_SIZE = 34 +const TILE_DOT_RING = 2 +const GROUP_ORDER: readonly MobileSessionTabGroup[] = ['needs-you', 'working', 'other'] + +/** Every tab in the workspace, what needs you first; tap one to go there, swipe one to close it. */ +export function MobileSessionTabsSheet({ + controller, + rows, + visible, + onClose +}: { + controller: MobileSessionController + rows: readonly MobileSessionTabRow[] + visible: boolean + onClose: () => void +}) { + useMobileColorScheme() + const t = useMobileTranslation() + const now = useNow(60_000) + const { + activeSessionTabId, + worktreeName, + switchSessionTab, + handleCloseSessionTab, + handleOpenNewTab, + createTabBusy, + connState + } = controller + // Sections hold still while the sheet is open, so a row never moves under a finger. + const [frozenGroups, setFrozenGroups] = useState>() + if (visible && frozenGroups === undefined) { + setFrozenGroups(new Map(rows.map((row) => [row.tab.id, row.group]))) + } + const afterCloseRef = useRef<(() => void) | null>(null) + const sections = GROUP_ORDER.map((group) => ({ + group, + rows: rows.filter((row) => (frozenGroups?.get(row.tab.id) ?? row.group) === group) + })).filter((section) => section.rows.length > 0) + const sectionTitles: Record = { + 'needs-you': t('session.tabsSheet.needsYou', 'Needs you'), + working: t('session.tabsSheet.working', 'Working'), + other: t('session.tabsSheet.everythingElse', 'Everything else') + } + const title = + rows.length === 1 + ? t('session.tabBar.oneTab', '1 tab') + : t('session.tabBar.tabCount', '{{count}} tabs', { count: rows.length }) + + const renderRow = (row: MobileSessionTabRow) => { + const current = row.tab.id === activeSessionTabId + const badge = row.dotState && row.dotState !== 'idle' ? row.dotState : undefined + const time = current + ? t('session.tabsSheet.open', 'Open') + : row.timeAt !== null + ? formatTimeAgo(row.timeAt, now) + : '' + return ( + void handleCloseSessionTab(row.tab) + }} + > + {(guardPress) => ( + { + if (!current) { + switchSessionTab(row.tab) + } + onClose() + })} + > + {({ pressed }) => ( + <> + {current || pressed ? : null} + + + {badge ? ( + + + + ) : null} + + + + {row.title} + + + {row.detail} + + + {time ? ( + {time} + ) : null} + + )} + + )} + + ) + } + + return ( + { + setFrozenGroups(undefined) + const afterClose = afterCloseRef.current + afterCloseRef.current = null + afterClose?.() + }} + > + + + + { + // The new-tab sheet is its own drawer; open it once this one is gone. + afterCloseRef.current = handleOpenNewTab + onClose() + }} + /> + + + + {sections.map((section, index) => ( + + {sections.length > 1 ? ( + + ) : null} + + {section.rows.map(renderRow)} + + + ))} + + + ) +} + +const styles = themedStyleSheet(() => ({ + // Over the sheet header's empty trailing side, centred in its 52pt row. + newTab: { position: 'absolute', top: 8, right: spacing.xs }, + body: { paddingBottom: spacing.lg }, + // Opaque so a swipe's action stays hidden until the row slides off it. + row: { + minHeight: 60, + flexDirection: 'row', + alignItems: 'center', + gap: spacing.md, + paddingHorizontal: spacing.lg, + paddingVertical: spacing.sm, + backgroundColor: colors.sheetGroup + }, + // The tab you're in, or a pressed row, washed like a picked segment on a sheet group. + wash: { + position: 'absolute', + top: 0, + right: 0, + bottom: 0, + left: 0, + backgroundColor: colors.translucentFill + }, + tile: { + width: TILE_SIZE, + height: TILE_SIZE, + borderRadius: radii.tile, + backgroundColor: colors.translucentFill, + alignItems: 'center', + justifyContent: 'center' + }, + // The state dot on the tile's corner, ringed in the group's colour. + tileBadge: { + position: 'absolute', + top: -4, + right: -4, + padding: TILE_DOT_RING, + borderRadius: radii.pill, + backgroundColor: colors.sheetGroup + }, + text: { flex: 1, minWidth: 0, gap: 2 }, + title: { fontSize: 15, fontWeight: '600', color: colors.textPrimary }, + detail: { fontSize: 13, color: colors.textSecondary }, + time: { fontSize: 12, color: colors.textMuted, fontVariant: ['tabular-nums'] }, + timeCurrent: { fontWeight: '600', color: colors.accentBlue } +})) diff --git a/mobile/src/session/tabs/mobile-session-tab-read-operations.ts b/mobile/src/session/tabs/mobile-session-tab-read-operations.ts index fe0c2f30db2..c1a9bb6ffc8 100644 --- a/mobile/src/session/tabs/mobile-session-tab-read-operations.ts +++ b/mobile/src/session/tabs/mobile-session-tab-read-operations.ts @@ -2,13 +2,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rp import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' import '../../terminal/terminal-reply-schema' import { sessionForwardedReplySchema } from '../../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../agent-launch/mobile-agent-detection-reply-schema' -import '../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../terminal/session/mobile-session-terminal-reply-schema' -import '../../worktree/session-worktree-record-reply-schema' -import '../native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../../terminal/quick-commands/mobile-quick-command-reply-schema' -import '../../files/workspace-file-paths-reply-schema' // Leave replies raw until the controller’s generation, barrier and application-revision guards pass. export const sessionTabsListRead = bindDeferredRpcOperation( diff --git a/mobile/src/session/tabs/mobile-session-tab-rows.ts b/mobile/src/session/tabs/mobile-session-tab-rows.ts new file mode 100644 index 00000000000..1b2854512f6 --- /dev/null +++ b/mobile/src/session/tabs/mobile-session-tab-rows.ts @@ -0,0 +1,121 @@ +import { agentListPreview } from '../../agents/agent-list-row-text' +import { agentStatusGroup } from '../../agents/agent-list-rows' +import { translate } from '../../i18n/mobile-i18n' +import { + getMobileSessionTabTitle, + getMobileTerminalTabHostAgentIdentity, + resolveMobileTerminalTabAgentId +} from '../../terminal/session/mobile-terminal-tab-agent' +import { + agentDotState, + agentRowTimeAt, + agentStateLabel, + type AgentDotState +} from '../../worktree/agent-row-display' +import type { MobileSessionTab } from './mobile-session-tabs' + +export type MobileSessionTabGroup = 'needs-you' | 'working' | 'other' + +export type MobileSessionTabRow = { + tab: MobileSessionTab + title: string + /** The agent whose icon marks the tab; null draws the tab kind's icon. */ + agentId: string | null + dotState: AgentDotState | undefined + group: MobileSessionTabGroup + /** The second line: the state, then what the tab is doing or showing. */ + detail: string + timeAt: number | null +} + +export function mobileSessionTabDotState( + tab: MobileSessionTab, + now: number +): AgentDotState | undefined { + // Why: a status restored across a host restart is unconfirmed, so like desktop it shows no live state. + if (tab.type === 'terminal' && tab.agentStatus && !tab.agentStatus.restoredUnconfirmed) { + return agentDotState(tab.agentStatus, now) + } + if (tab.type === 'agent-session' && tab.chatStatus) { + return agentDotState(tab.chatStatus, now) + } + return undefined +} + +function tabGroup(state: AgentDotState | undefined): MobileSessionTabGroup { + if (!state) { + return 'other' + } + const group = agentStatusGroup(state) + return group === 'needs-you' || group === 'working' ? group : 'other' +} + +function tabContent( + tab: MobileSessionTab, + title: string, + dotState: AgentDotState | undefined +): string { + switch (tab.type) { + case 'terminal': { + const status = tab.agentStatus + if (!status || !dotState) { + return '' + } + return agentListPreview(status, agentStatusGroup(dotState), title) + } + case 'browser': + return tab.url === title ? '' : tab.url + case 'markdown': + case 'file': + return tab.relativePath === title ? '' : tab.relativePath + case 'agent-session': + return '' + } +} + +function tabKindLabel(tab: MobileSessionTab): string { + switch (tab.type) { + case 'browser': + return translate('session.tabRows.browser', 'Browser') + case 'markdown': + return translate('session.tabRows.markdown', 'Markdown note') + case 'file': + return translate('session.tabRows.file', 'File') + case 'agent-session': + return translate('session.tabRows.chat', 'Chat') + case 'terminal': + return translate('session.tabRows.terminal', 'Terminal') + } +} + +export function buildMobileSessionTabRow( + tab: MobileSessionTab, + terminals: readonly { handle: string; agentIdentity?: string }[], + now: number +): MobileSessionTabRow { + const hostAgentIdentity = getMobileTerminalTabHostAgentIdentity(tab, terminals) + const title = getMobileSessionTabTitle(tab, hostAgentIdentity) + const dotState = mobileSessionTabDotState(tab, now) + const stateWord = dotState && dotState !== 'idle' ? agentStateLabel(dotState) : '' + const content = tabContent(tab, title, dotState) + const timeAt = + tab.type === 'terminal' && tab.agentStatus && !tab.agentStatus.restoredUnconfirmed + ? agentRowTimeAt(tab.agentStatus) + : tab.type === 'agent-session' && tab.chatStatus + ? tab.chatStatus.updatedAt + : null + return { + tab, + title, + agentId: + tab.type === 'agent-session' + ? tab.agent + : tab.type === 'terminal' + ? resolveMobileTerminalTabAgentId(tab, hostAgentIdentity) + : null, + dotState, + group: tabGroup(dotState), + detail: [stateWord, content].filter(Boolean).join(' · ') || tabKindLabel(tab), + timeAt + } +} diff --git a/mobile/src/session/tabs/mobile-session-tab-write-operations.ts b/mobile/src/session/tabs/mobile-session-tab-write-operations.ts index a450d1f6a6e..856c3323fa8 100644 --- a/mobile/src/session/tabs/mobile-session-tab-write-operations.ts +++ b/mobile/src/session/tabs/mobile-session-tab-write-operations.ts @@ -1,7 +1,5 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rpc/rpc-operation' import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' -import '../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../worktree/session-worktree-record-reply-schema' import '../../terminal/terminal-reply-schema' import { sessionCreatedTerminalTabSchema } from '../../terminal/session/mobile-session-terminal-reply-schema' import { sessionTabCloseReplySchema } from './mobile-session-tab-write-reply-schema' diff --git a/mobile/src/session/tabs/mobile-session-tab-write-reply-schema.ts b/mobile/src/session/tabs/mobile-session-tab-write-reply-schema.ts index 245fe3f5f02..009b0d95835 100644 --- a/mobile/src/session/tabs/mobile-session-tab-write-reply-schema.ts +++ b/mobile/src/session/tabs/mobile-session-tab-write-reply-schema.ts @@ -1,5 +1,4 @@ import * as z from 'zod' -import '../../../../src/shared/zod-salvage' // Bare legacy success and delegated closes do not prove permanent retirement. export const sessionTabCloseReplySchema = z diff --git a/mobile/src/session/tabs/mobile-session-tabs.ts b/mobile/src/session/tabs/mobile-session-tabs.ts index 17c8db01caf..e998fc5aaf1 100644 --- a/mobile/src/session/tabs/mobile-session-tabs.ts +++ b/mobile/src/session/tabs/mobile-session-tabs.ts @@ -42,6 +42,10 @@ export type MobileSessionTab = RuntimeMobileSessionTerminalTab, | 'parentTabId' | 'leafId' + | 'customTitle' + | 'quickCommandLabel' + | 'aiVaultTitle' + | 'generatedTitle' | 'agentStatus' | 'launchAgent' | 'launchDraft' diff --git a/mobile/src/session/tabs/tab-strip-scroll.ts b/mobile/src/session/tabs/tab-strip-scroll.ts index 9b9dd9ce99b..e7d6c85e416 100644 --- a/mobile/src/session/tabs/tab-strip-scroll.ts +++ b/mobile/src/session/tabs/tab-strip-scroll.ts @@ -1,5 +1,3 @@ -import type { AgentDotState } from '../../worktree/agent-row-display' - export type TabStripScrollInput = { tabX: number tabWidth: number @@ -36,98 +34,3 @@ export function resolveTabStripScrollOffset({ return Math.min(Math.max(0, nextOffset), maxOffset) } - -type TabLayouts = ReadonlyMap - -export function resolveTabStripTapOffset(args: { - tabId: string - tabs: readonly { id: string }[] - layouts: TabLayouts - viewportWidth: number - contentWidth: number - currentOffset: number -}): number { - const { tabs, layouts, viewportWidth, contentWidth, currentOffset } = args - const index = tabs.findIndex((tab) => tab.id === args.tabId) - const selected = layouts.get(args.tabId) - if (index === -1 || !selected || viewportWidth <= 0) { - return currentOffset - } - const selectedOnly = resolveTabStripScrollOffset({ - tabX: selected.x, - tabWidth: selected.width, - viewportWidth, - contentWidth, - currentOffset - }) - if (selectedOnly === currentOffset) { - return currentOffset - } - const left = selected.x + selected.width / 2 < currentOffset + viewportWidth / 2 - const neighbor = tabs[index + (left ? -1 : 1)] - const layout = neighbor ? layouts.get(neighbor.id) : undefined - let start = selected.x - let end = selected.x + selected.width - if (layout) { - const gap = left ? selected.x - (layout.x + layout.width) : layout.x - end - // Keep the tapped tab whole while revealing as much of its neighbor as fits within both margins. - const peek = Math.min(layout.width, Math.max(0, viewportWidth - 24 - selected.width - gap)) - if (left) { - start -= gap + peek - } else { - end += gap + peek - } - } - return resolveTabStripScrollOffset({ - tabX: start, - tabWidth: end - start, - viewportWidth, - contentWidth, - currentOffset - }) -} - -export type TabStripHiddenTabs = { left: readonly string[]; right: readonly string[] } - -export function resolveTabStripHiddenTabs(args: { - layouts: TabLayouts - viewportWidth: number - currentOffset: number -}): TabStripHiddenTabs { - const left: string[] = [] - const right: string[] = [] - if (args.viewportWidth > 0) { - for (const [tabId, layout] of args.layouts) { - const center = layout.x + layout.width / 2 - if (center < args.currentOffset) { - left.push(tabId) - } else if (center > args.currentOffset + args.viewportWidth) { - right.push(tabId) - } - } - } - return { left, right } -} - -// Lower ranks win when several hidden tabs share an edge; other states get no edge hint. -const EDGE_HINT_RANK: Partial> = { - blocked: 0, - waiting: 0, - working: 1, - monitoring: 1 -} - -export function resolveTabStripEdgeHint( - tabIds: readonly string[], - tabStates: ReadonlyMap -): AgentDotState | null { - let hint: AgentDotState | null = null - for (const tabId of tabIds) { - const state = tabStates.get(tabId) - const rank = state ? EDGE_HINT_RANK[state] : undefined - if (state && rank !== undefined && (hint === null || rank < (EDGE_HINT_RANK[hint] ?? 0))) { - hint = state - } - } - return hint -} diff --git a/mobile/src/session/tabs/use-mobile-session-close-actions.test.tsx b/mobile/src/session/tabs/use-mobile-session-close-actions.test.tsx index a9077c5e1e9..f7c61750b6f 100644 --- a/mobile/src/session/tabs/use-mobile-session-close-actions.test.tsx +++ b/mobile/src/session/tabs/use-mobile-session-close-actions.test.tsx @@ -14,7 +14,14 @@ import { readMobileNativeChatDraftInputs, updateMobileNativeChatDraftInputs } from '../native-chat/composer/mobile-native-chat-draft-inputs' -import { resetMobileNativeChatDraftStoreForTests } from '../native-chat/composer/mobile-native-chat-draft-store' +import { closeMobileNativeChatTabDraft } from '../native-chat/composer/mobile-native-chat-draft-store' + +import { loadMobileNativeChatDrafts } from '../native-chat/composer/mobile-native-chat-draft-persistence' + +vi.mock('@react-native-async-storage/async-storage', async () => { + const { createInMemoryAsyncStorage } = await import('../../test-support/in-memory-async-storage') + return { default: createInMemoryAsyncStorage() } +}) const initial: Terminal[] = ['a', 'b', 'c'].map((handle) => ({ handle, @@ -24,10 +31,16 @@ const initial: Terminal[] = ['a', 'b', 'c'].map((handle) => ({ describe('legacy terminal close acknowledgments', () => { let renderer: ReactTestRenderer | null = null - afterEach(() => { + let queries: ReturnType | null = null + afterEach(async () => { act(() => renderer?.unmount()) renderer = null - resetMobileNativeChatDraftStoreForTests() + await queries?.end() + queries = null + await loadMobileNativeChatDrafts('host', 'workspace') + closeMobileNativeChatTabDraft('queued-editor') + closeMobileNativeChatTabDraft('host\0workspace\0closed') + await loadMobileNativeChatDrafts('host', 'workspace') }) async function mount(renameTarget: Terminal | null = null) { @@ -127,8 +140,9 @@ describe('legacy terminal close acknowledgments', () => { } return null } + queries = documentQueryClient() await act(async () => { - renderer = create(documentQueryClient().wrap(createElement(Harness))) + renderer = create(queries!.wrap(createElement(Harness))) }) return { read() { diff --git a/mobile/src/session/tabs/use-mobile-session-tab-reconciliation.ts b/mobile/src/session/tabs/use-mobile-session-tab-reconciliation.ts index 58fa5c9e731..5d3e7d7d66b 100644 --- a/mobile/src/session/tabs/use-mobile-session-tab-reconciliation.ts +++ b/mobile/src/session/tabs/use-mobile-session-tab-reconciliation.ts @@ -6,7 +6,7 @@ import { MOBILE_AI_VAULT_CAPABILITY } from '../../agent-history/agent-history-ca import '../../../../src/shared/protocol-version' import { TERMINAL_QUERY_REPLY_INPUT_RUNTIME_CAPABILITY } from '../../../../src/shared/terminal/runtime-policy/terminal-runtime-capabilities' import { PROGRAM_STATUS_RUNTIME_CAPABILITY } from '../../../../src/shared/program-status/protocol' -import { structuredAgentSessionHostSupport } from '../mobile-structured-agent-session-host-support' +import { structuredAgentSessionHostSupport } from '../native-chat/agent-session/mobile-structured-agent-session-host-support' import { runAcceptedMobileSessionTabsEffects } from './mobile-session-tabs-accepted-effects' import type { SessionTabsStreamSource } from './mobile-session-tabs-stream-health' import { useMobileSessionTabsFetchReporting } from './use-mobile-session-tabs-fetch-reporting' diff --git a/mobile/src/session/use-missing-worktree-bounce.test.ts b/mobile/src/session/use-missing-worktree-bounce.test.ts index a697bbfb905..49600fd89d8 100644 --- a/mobile/src/session/use-missing-worktree-bounce.test.ts +++ b/mobile/src/session/use-missing-worktree-bounce.test.ts @@ -1,12 +1,6 @@ -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { WorktreeShowResolution } from '../worktree/worktree-show-resolution' +import { describe, expect, it } from 'vitest' import { isSyntheticWorkspaceRoute } from './synthetic-workspace-route' -import { - shouldBounceMissingWorktree, - useMissingWorktreeBounce -} from './use-missing-worktree-bounce' +import { shouldBounceMissingWorktree } from './use-missing-worktree-bounce' describe('shouldBounceMissingWorktree', () => { it('bounces only a host-proven missing worktree', () => { @@ -21,60 +15,3 @@ describe('shouldBounceMissingWorktree', () => { expect(shouldBounceMissingWorktree('global-floating-terminal', 'missing')).toBe(false) }) }) - -describe('useMissingWorktreeBounce', () => { - let renderer: ReactTestRenderer | null = null - const bounce = vi.fn() - - beforeEach(() => { - bounce.mockReset() - renderer = null - }) - - function Harness(props: { worktreeId: string; resolution: WorktreeShowResolution }): null { - useMissingWorktreeBounce({ - hostId: 'host-1', - worktreeId: props.worktreeId, - resolution: props.resolution, - bounce - }) - return null - } - - function render(worktreeId: string, resolution: WorktreeShowResolution): void { - act(() => { - const element = createElement(Harness, { worktreeId, resolution }) - if (renderer) { - renderer.update(element) - } else { - renderer = create(element) - } - }) - } - - it('bounces exactly once per worktree even across re-renders', () => { - render('repo::wt', 'unknown') - expect(bounce).not.toHaveBeenCalled() - - render('repo::wt', 'missing') - expect(bounce).toHaveBeenCalledExactlyOnceWith('host-1') - - // Why: navigation lands after the render, so the pre-unmount renders must not re-fire. - render('repo::wt', 'missing') - render('repo::wt', 'unknown') - render('repo::wt', 'missing') - expect(bounce).toHaveBeenCalledTimes(1) - act(() => renderer?.unmount()) - }) - - it('re-arms for a different worktree on the reused screen', () => { - render('repo::wt-1', 'missing') - expect(bounce).toHaveBeenCalledTimes(1) - - render('repo::wt-2', 'unknown') - expect(bounce).toHaveBeenCalledTimes(1) - render('repo::wt-2', 'missing') - expect(bounce).toHaveBeenCalledTimes(2) - act(() => renderer?.unmount()) - }) -}) diff --git a/mobile/src/session/use-mobile-agent-message-navigation.ts b/mobile/src/session/use-mobile-agent-message-navigation.ts index d054bb3a7a7..fc4916220ae 100644 --- a/mobile/src/session/use-mobile-agent-message-navigation.ts +++ b/mobile/src/session/use-mobile-agent-message-navigation.ts @@ -7,8 +7,8 @@ import { type StructuredSessionOpenFailure } from '../../../src/shared/open-structured-agent-session' import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import { mobileStructuredSessionOpenMessage } from './mobile-structured-session-open-message' -import { openMobileStructuredSession } from './open-mobile-structured-session' +import { mobileStructuredSessionOpenMessage } from './native-chat/agent-session/mobile-structured-session-open-message' +import { openMobileStructuredSession } from './native-chat/agent-session/open-mobile-structured-session' import { openMobileAgentMessageTerminal } from '../terminal/session/mobile-agent-message-terminal' import type { MobileSessionKeyboardStateModel } from '../terminal/session/use-mobile-session-keyboard-state' diff --git a/mobile/src/session/use-mobile-default-session-view-preference.test.ts b/mobile/src/session/use-mobile-default-session-view-preference.test.ts index 084164b6a40..53891f46444 100644 --- a/mobile/src/session/use-mobile-default-session-view-preference.test.ts +++ b/mobile/src/session/use-mobile-default-session-view-preference.test.ts @@ -68,52 +68,6 @@ describe('useMobileDefaultSessionViewPreference', () => { expect(saveDefaultSessionView).toHaveBeenCalledWith('chat') }) - it('submits every change immediately so shared persistence preserves event order', async () => { - const firstSave = deferred() - vi.mocked(saveDefaultSessionView) - .mockImplementationOnce(() => firstSave.promise) - .mockResolvedValue(undefined) - await mount() - - act(() => preference?.setDefaultView('chat')) - await act(async () => { - await Promise.resolve() - }) - act(() => preference?.setDefaultView('terminal')) - act(() => preference?.setDefaultView('chat')) - await act(async () => { - await Promise.resolve() - }) - expect(saveDefaultSessionView).toHaveBeenCalledTimes(3) - expect(saveDefaultSessionView).toHaveBeenNthCalledWith(2, 'terminal') - expect(saveDefaultSessionView).toHaveBeenNthCalledWith(3, 'chat') - - await act(async () => { - firstSave.resolve() - await firstSave.promise - await Promise.resolve() - }) - expect(saveDefaultSessionView).toHaveBeenCalledTimes(3) - }) - - it('reloads the persisted value when the latest write fails', async () => { - vi.mocked(loadDefaultSessionView) - .mockResolvedValueOnce('terminal') - .mockResolvedValueOnce('terminal') - vi.mocked(saveDefaultSessionView).mockRejectedValue(new Error('storage unavailable')) - await mount() - - await act(async () => { - preference?.setDefaultView('chat') - await Promise.resolve() - await Promise.resolve() - await Promise.resolve() - }) - - expect(preference?.defaultView).toBe('terminal') - expect(loadDefaultSessionView).toHaveBeenCalledTimes(2) - }) - it('does not let an older failed write roll back a newer choice', async () => { const recoveryLoad = deferred() vi.mocked(loadDefaultSessionView) @@ -140,27 +94,4 @@ describe('useMobileDefaultSessionViewPreference', () => { expect(preference?.defaultView).toBe('terminal') expect(saveDefaultSessionView).toHaveBeenNthCalledWith(2, 'terminal') }) - - it('submits the latest write before the Settings route unmounts', async () => { - const firstSave = deferred() - vi.mocked(saveDefaultSessionView) - .mockImplementationOnce(() => firstSave.promise) - .mockResolvedValueOnce(undefined) - await mount() - - act(() => preference?.setDefaultView('chat')) - await act(async () => { - await Promise.resolve() - }) - act(() => preference?.setDefaultView('terminal')) - expect(saveDefaultSessionView).toHaveBeenNthCalledWith(2, 'terminal') - act(() => renderer?.unmount()) - renderer = null - - await act(async () => { - firstSave.resolve() - await firstSave.promise - await Promise.resolve() - }) - }) }) diff --git a/mobile/src/session/use-mobile-send-completion-generation.test.ts b/mobile/src/session/use-mobile-send-completion-generation.test.ts deleted file mode 100644 index 0776ca717c6..00000000000 --- a/mobile/src/session/use-mobile-send-completion-generation.test.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { createElement, Suspense } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { describe, expect, it, vi } from 'vitest' -import { useMobileSendCompletionGeneration } from './use-mobile-send-completion-generation' - -let focusCleanup: (() => void) | undefined - -vi.mock('expo-router', () => ({ - useFocusEffect: (effect: () => void | (() => void)) => { - focusCleanup = effect() ?? undefined - } -})) - -describe('mobile send completion generation', () => { - it('invalidates completions on a surface change and retained-route blur', () => { - const onBlur = vi.fn() - let getGeneration: (() => number) | null = null - let renderer: ReactTestRenderer - - function Harness({ surfaceKey }: { surfaceKey: string }): null { - getGeneration = useMobileSendCompletionGeneration({ onBlur, surfaceKey }) - return null - } - - act(() => { - renderer = create(createElement(Harness, { surfaceKey: 'tab-a' })) - }) - const initialGeneration = getGeneration!() - act(() => { - renderer.update(createElement(Harness, { surfaceKey: 'tab-b' })) - }) - expect(getGeneration!()).toBeGreaterThan(initialGeneration) - - const surfaceGeneration = getGeneration!() - act(() => focusCleanup?.()) - expect(getGeneration!()).toBeGreaterThan(surfaceGeneration) - expect(onBlur).toHaveBeenCalledTimes(1) - - act(() => renderer.unmount()) - }) - - it('does not invalidate the committed surface during a suspended render', () => { - const never = new Promise(() => undefined) - let getGeneration: (() => number) | null = null - let renderer: ReactTestRenderer - - function Harness({ surfaceKey, suspend }: { surfaceKey: string; suspend: boolean }): null { - getGeneration = useMobileSendCompletionGeneration({ onBlur: vi.fn(), surfaceKey }) - if (suspend) { - throw never - } - return null - } - - act(() => { - renderer = create( - createElement( - Suspense, - { fallback: null }, - createElement(Harness, { surfaceKey: 'tab-a', suspend: false }) - ) - ) - }) - const committedGeneration = getGeneration!() - act(() => { - renderer.update( - createElement( - Suspense, - { fallback: null }, - createElement(Harness, { surfaceKey: 'tab-b', suspend: true }) - ) - ) - }) - - expect(getGeneration!()).toBe(committedGeneration) - act(() => renderer.unmount()) - }) -}) diff --git a/mobile/src/session/use-mobile-session-dictation-setup.ts b/mobile/src/session/use-mobile-session-dictation-setup.ts index a1c46e002b8..0a6ee25c923 100644 --- a/mobile/src/session/use-mobile-session-dictation-setup.ts +++ b/mobile/src/session/use-mobile-session-dictation-setup.ts @@ -9,6 +9,11 @@ import { } from '../dictation/mobile-dictation-setup' import type { MobileSessionFeedbackCapabilitiesModel } from './use-mobile-session-feedback-capabilities' import type { DictationTerm } from '../../../src/shared/dictation-dictionary' +import { + DEFAULT_STOP_AFTER_SILENCE_SECONDS, + stopAfterSilenceSeconds, + type StopAfterSilenceSeconds +} from '../../../src/shared/dictation-silence-stop' // The computer's dictation settings as this session reads them: mic shown, mode, filler switch, and whether setup is needed first. export function useMobileSessionDictationSetup(scope: MobileSessionFeedbackCapabilitiesModel) { @@ -19,6 +24,9 @@ export function useMobileSessionDictationSetup(scope: MobileSessionFeedbackCapab // The host's filler switch and this worktree's terms, kept from its last setup read; fillers on until one says otherwise. const [removeFillerWords, setRemoveFillerWords] = useState(true) const [dictationTerms, setDictationTerms] = useState(undefined) + const [silenceSeconds, setSilenceSeconds] = useState( + DEFAULT_STOP_AFTER_SILENCE_SECONDS + ) // Only a host setup read sets this; while false, the host's start refusal decides (older hosts, first tap before the read). const dictationNeedsSetupRef = useRef(false) @@ -35,6 +43,7 @@ export function useMobileSessionDictationSetup(scope: MobileSessionFeedbackCapab setDictationMode(setup.dictationMode) setRemoveFillerWords(setup.removeFillerWords !== false) setDictationTerms(setup.dictationTerms) + setSilenceSeconds(stopAfterSilenceSeconds(setup)) setDictationEnabled(!dictationMicHidden(setup)) dictationNeedsSetupRef.current = dictationNeedsSetup(setup) } @@ -70,6 +79,7 @@ export function useMobileSessionDictationSetup(scope: MobileSessionFeedbackCapab phoneDictation, removeFillerWords, dictationTerms, + silenceSeconds, dictationNeedsSetupRef, closeDictationSetup, refreshDictationMode diff --git a/mobile/src/session/use-mobile-session-dictation.ts b/mobile/src/session/use-mobile-session-dictation.ts index 9212ed7d75d..4bbdfad37d7 100644 --- a/mobile/src/session/use-mobile-session-dictation.ts +++ b/mobile/src/session/use-mobile-session-dictation.ts @@ -22,7 +22,9 @@ import { import { useMobileDictationLeaveHold } from '../dictation/mobile-dictation-leave-hold' import { useMobileDictationHost } from '../dictation/mobile-dictation-host' import { mobileDictationShownOnScreen } from '../dictation/mobile-dictation-shown' +import { useDictationComputerName } from '../dictation/use-mobile-dictation-live' import { nativeChatDictationCopy } from '../dictation/mobile-session-native-chat-dictation-copy' +import { dictationAnnounceCopy } from '../dictation/mobile-dictation-announce-copy' import { useWorkspaceExecutionHost, workspaceRouteHref @@ -54,6 +56,7 @@ export function useMobileSessionDictation( } = scope const { showNativeChat, showNativeChatRef } = nativeChatController const host = useMobileDictationHost() + const computerName = useDictationComputerName(hostId) const { start: startHost } = host const executionHost = useWorkspaceExecutionHost() const sessionKey = JSON.stringify([hostId, executionHost ?? null, worktreeId]) @@ -93,12 +96,17 @@ export function useMobileSessionDictation( ) const clipboard = useClipboardWriter() + // The screen's toast is not read on the page, so where the words went is also spoken. + const tell = (message: string) => { + showToast(message) + host.announce(message) + } // A transcript its target refused must not vanish: keep it on the clipboard and say so. const keepUndeliveredDictation = (text: string) => { triggerError() void clipboard.writeText(text).then( - () => showToast(nativeChatDictationCopy.insertFailedCopied()), - () => showToast(nativeChatDictationCopy.insertFailed()) + () => tell(nativeChatDictationCopy.insertFailedCopied()), + () => tell(nativeChatDictationCopy.insertFailed()) ) } @@ -106,7 +114,9 @@ export function useMobileSessionDictation( // Chat dictation is inserted locally; a terminal's words are typed into it live, while it is the active one. const insertHere = (text: string): boolean => { if (destination.landsInChat(showNativeChatRef.current)) { - if (!destination.insertInChat(text)) { + if (destination.insertInChat(text)) { + host.announce(dictationAnnounceCopy.inserted()) + } else { keepUndeliveredDictation(text) } return true @@ -124,7 +134,7 @@ export function useMobileSessionDictation( (await sendLiveTerminalInput(insertHandle, text)) // Live input lands in a terminal the keyboard may cover, so say where the words went. if (sent) { - showToast(nativeChatDictationCopy.inserted()) + tell(nativeChatDictationCopy.inserted()) } else { keepUndeliveredDictation(text) } @@ -186,6 +196,7 @@ export function useMobileSessionDictation( phoneDictation, removeFillerWords, dictationTerms, + silenceSeconds, dictationNeedsSetupRef, closeDictationSetup, refreshDictationMode @@ -235,11 +246,14 @@ export function useMobileSessionDictation( executionHost ), dictationMode: scope.dictationMode, + silenceSeconds, removeFillerWords, dictationTerms, - worktreeId + worktreeId, + computerName }) }, [ + computerName, activeHandle, activeSessionTab, busyElsewhere, @@ -254,6 +268,7 @@ export function useMobileSessionDictation( phoneDictation.readyRef, removeFillerWords, dictationTerms, + silenceSeconds, scope.dictationMode, sessionKey, setShowDictationSetup, diff --git a/mobile/src/session/use-mobile-session-feedback-capabilities.ts b/mobile/src/session/use-mobile-session-feedback-capabilities.ts index 7ccc7863841..d7861707160 100644 --- a/mobile/src/session/use-mobile-session-feedback-capabilities.ts +++ b/mobile/src/session/use-mobile-session-feedback-capabilities.ts @@ -3,7 +3,7 @@ import { Animated, Easing, Platform } from 'react-native' import { translate } from '../i18n/mobile-i18n' import { reconcileMobileSessionCreateWarningState } from './tabs/mobile-session-create-warning-state' import type { MobileSessionTerminalRuntimeModel } from '../terminal/session/use-mobile-session-terminal-runtime' -import type { StructuredAgentSessionHostSupport } from './mobile-structured-agent-session-host-support' +import type { StructuredAgentSessionHostSupport } from './native-chat/agent-session/mobile-structured-agent-session-host-support' // A strong ease-out both ways; the presentation turns this fade into a short rise. const TOAST_EASING = Easing.bezier(0.23, 1, 0.32, 1) diff --git a/mobile/src/session/use-mobile-session-foundation.ts b/mobile/src/session/use-mobile-session-foundation.ts index 6ecb5ae9870..cdc21bbabb0 100644 --- a/mobile/src/session/use-mobile-session-foundation.ts +++ b/mobile/src/session/use-mobile-session-foundation.ts @@ -52,6 +52,7 @@ export function useMobileSessionFoundation() { name: worktreeName, path: worktreePath, hostId: worktreeHostId, + branch: worktreeBranch, resolution: worktreeResolution } = useLiveWorktreeName({ client, @@ -115,6 +116,7 @@ export function useMobileSessionFoundation() { worktreeName, worktreePath, worktreeHostId, + worktreeBranch, worktreeResolution, isWideLayout, activePanel, diff --git a/mobile/src/session/use-mobile-session-lifecycle.ts b/mobile/src/session/use-mobile-session-lifecycle.ts index e7ea01a8e54..0db31f4d6b9 100644 --- a/mobile/src/session/use-mobile-session-lifecycle.ts +++ b/mobile/src/session/use-mobile-session-lifecycle.ts @@ -4,8 +4,11 @@ import { settleSessionPreferenceRead } from './session-preference-read' import { useEffect, useRef, useCallback, useState } from 'react' import { AppState, type AppStateStatus, Platform } from 'react-native' import { useFocusEffect } from 'expo-router' -import { loadHosts } from '../transport/hosts/host-store' -import { loadTerminalAccessoryLayout } from '../terminal/terminal-accessory-layout' +import { loadHosts } from '../host-catalog/host-store' +import { + loadTerminalAccessoryLayout, + saveTerminalSmartRail +} from '../terminal/terminal-accessory-layout' import { recoverActiveTerminalAfterForeground, shouldRecoverTerminalOnAppStateChange @@ -25,6 +28,7 @@ export function useMobileSessionLifecycle(scope: MobileSessionTabReconciliationM setCustomKeys, setVisibleBuiltInIds, setDirectionPadEnabled, + setSmartRailEnabled, setHostEndpoint, setHostName, connStateRef, @@ -101,6 +105,7 @@ export function useMobileSessionLifecycle(scope: MobileSessionTabReconciliationM if (layout) { setVisibleBuiltInIds(layout.visibleBuiltInIds) setDirectionPadEnabled(layout.directionPadEnabled !== false) + setSmartRailEnabled(layout.smartRail === true) } setAccessoryLayoutLoaded(true) } @@ -112,6 +117,19 @@ export function useMobileSessionLifecycle(scope: MobileSessionTabReconciliationM } }, [padAvailable, shellStorage]) + const handleSmartRailChange = useCallback( + (enabled: boolean) => { + // A read that started before the toggle must not flip it back. + layoutReadRevisionRef.current += 1 + setSmartRailEnabled(enabled) + saveTerminalSmartRail(enabled, padAvailable).catch((error: unknown) => { + console.warn('[terminal-keys] the store would not take the Smart rail setting', error) + setSmartRailEnabled(!enabled) + }) + }, + [padAvailable] + ) + useFocusEffect( useCallback(() => { const releaseKeys = refreshCustomKeys() @@ -195,6 +213,7 @@ export function useMobileSessionLifecycle(scope: MobileSessionTabReconciliationM }, [connState, scheduleDelayedAction, subscribeToTerminal, terminalResume, unsubscribeTerminal]) return { accessoryPreferencesReady: customKeysLoaded && accessoryLayoutLoaded, + handleSmartRailChange, pendingForegroundRecoveryRef } } diff --git a/mobile/src/session/use-mobile-session-native-chat-dictation.ts b/mobile/src/session/use-mobile-session-native-chat-dictation.ts index d339e2a6c63..4bf5a7279b9 100644 --- a/mobile/src/session/use-mobile-session-native-chat-dictation.ts +++ b/mobile/src/session/use-mobile-session-native-chat-dictation.ts @@ -2,8 +2,8 @@ import { useEffect } from 'react' import { useMobileSessionDictation } from './use-mobile-session-dictation' import { useMobileNativeChatController } from './native-chat/use-mobile-native-chat-controller' import { useMobileNativeChatReadability } from './native-chat/transcript/use-mobile-native-chat-readability' -import { useMobileNativeChatInputLease } from './native-chat/use-mobile-native-chat-input-lease' -import { useMobileNativeChatSendError } from './native-chat/use-mobile-native-chat-send-error' +import { useMobileNativeChatInputLease } from './native-chat/composer/use-mobile-native-chat-input-lease' +import { useMobileNativeChatSendError } from './native-chat/composer/use-mobile-native-chat-send-error' import { mobileNativeChatScopeKey } from './native-chat/mobile-native-chat-scope-key' import { mobileNativeChatOverlayInputLockReason } from './native-chat/mobile-native-chat-overlay-lock-reason' import { useMobileSendCompletionGeneration } from './use-mobile-send-completion-generation' diff --git a/mobile/src/session/use-mobile-session-panel-route-actions.tsx b/mobile/src/session/use-mobile-session-panel-route-actions.tsx index 6cd74e382eb..c4ae529e4a8 100644 --- a/mobile/src/session/use-mobile-session-panel-route-actions.tsx +++ b/mobile/src/session/use-mobile-session-panel-route-actions.tsx @@ -7,7 +7,7 @@ import { shouldShowSessionHeaderChecksAction, panelRouteDescriptor } from './session-panel-host' -import { MobileAgentIcon } from '../components/MobileAgentIcon' +import type { ActionSheetAction } from '../components/ActionSheetModal' import { useMobileTranslation } from '../i18n/use-mobile-translation' import { useWorkspaceExecutionHost, @@ -49,127 +49,81 @@ export function useMobileSessionPanelRouteActions(scope: MobileSessionPresentati quickCommandsSupported, showToast } = scope - const otherRuntimeAgentRow = { - id: 'otherServerAgents', - label: t('session.usePanelRouteActions.otherServerAgents', 'Agents on Another Server'), - hint: t('session.usePanelRouteActions.pairServerHint', 'Pair that server directly'), - icon: Bot, - disabled: true, - onPress: () => {} - } - const createTabAgentActions = + const agentStatusRow = (errorHint: string): ActionSheetAction | null => createTabAgentLoadState === 'loading' - ? [ - { - id: 'detectingAgents', - label: t('session.usePanelRouteActions.detectingAgents', 'Detecting Agents'), - icon: Bot, - disabled: true, - loading: true, - onPress: () => {} - } - ] + ? { + id: 'detectingAgents', + label: t('session.usePanelRouteActions.detectingAgents', 'Detecting Agents'), + icon: Bot, + disabled: true, + loading: true, + onPress: () => {} + } : createTabAgentOptions.length > 0 - ? createTabAgentOptions.map((option) => ({ - id: `agent:${option.agent}`, - label: option.label, - renderIcon: () => , - onPress: () => { - setShowCreateTabDrawer(false) - void handleCreateTerminal(option.agent) - } - })) + ? null : createTabAgentLoadState === 'loaded' - ? [ - { - id: 'noEnabledAgents', - label: t('session.usePanelRouteActions.noEnabledAgents', 'No Enabled Agents'), + ? { + id: 'noEnabledAgents', + label: t('session.usePanelRouteActions.noEnabledAgents', 'No Enabled Agents'), + icon: Bot, + disabled: true, + onPress: () => {} + } + : createTabAgentLoadState === 'other-runtime' + ? { + id: 'otherServerAgents', + label: t( + 'session.usePanelRouteActions.otherServerAgents', + 'Agents on Another Server' + ), + hint: t('session.usePanelRouteActions.pairServerHint', 'Pair that server directly'), icon: Bot, disabled: true, onPress: () => {} } - ] - : createTabAgentLoadState === 'other-runtime' - ? [otherRuntimeAgentRow] : createTabAgentLoadState === 'error' - ? [ - { - id: 'presetsUnavailable', - label: t( - 'session.usePanelRouteActions.presetsUnavailable', - 'Agent Presets Unavailable' - ), - hint: t( - 'session.usePanelRouteActions.checkHostHint', - 'Check the host connection' - ), - icon: Bot, - disabled: true, - onPress: () => {} - } - ] - : [] - const sendDiffNotesAgentActions = - pendingDiffNotesDelivery === null - ? [] - : createTabAgentLoadState === 'loading' - ? [ - { - id: 'detectingAgents', - label: t('session.usePanelRouteActions.detectingAgents', 'Detecting Agents'), - icon: Bot, - disabled: true, - loading: true, - onPress: () => {} - } - ] - : createTabAgentOptions.length > 0 - ? createTabAgentOptions.map((option) => ({ - id: `agent:${option.agent}`, - label: option.label, - hint: t('session.usePanelRouteActions.newSessionHint', 'New agent session'), - icon: Bot, - onPress: () => { - const delivery = pendingDiffNotesDelivery - setPendingDiffNotesDelivery(null) - if (!delivery) { - return - } - void sendDiffNotesToNewAgent(delivery, async () => { - await handleCreateTerminal(option.agent, { - initialPrompt: delivery.prompt, - onPromptSent: () => void clearDeliveredDiffComments(delivery.comments) - }) - }) - } - })) - : createTabAgentLoadState === 'loaded' - ? [ - { - id: 'noEnabledAgents', - label: t('session.usePanelRouteActions.noEnabledAgents', 'No Enabled Agents'), + ? { + id: 'presetsUnavailable', + label: t( + 'session.usePanelRouteActions.presetsUnavailable', + 'Agent Presets Unavailable' + ), + hint: errorHint, icon: Bot, disabled: true, onPress: () => {} } - ] - : createTabAgentLoadState === 'other-runtime' - ? [otherRuntimeAgentRow] - : createTabAgentLoadState === 'error' - ? [ - { - id: 'presetsUnavailable', - label: t( - 'session.usePanelRouteActions.presetsUnavailable', - 'Agent Presets Unavailable' - ), - hint: t('session.usePanelRouteActions.copyNotesHint', 'Copy notes instead'), - icon: Bot, - disabled: true, - onPress: () => {} - } - ] - : [] + : null + const createTabAgentStatusRow = agentStatusRow( + t('session.usePanelRouteActions.checkHostHint', 'Check the host connection') + ) + const sendDiffNotesStatusRow = agentStatusRow( + t('session.usePanelRouteActions.copyNotesHint', 'Copy notes instead') + ) + const sendDiffNotesAgentActions: ActionSheetAction[] = + pendingDiffNotesDelivery === null + ? [] + : sendDiffNotesStatusRow + ? [sendDiffNotesStatusRow] + : createTabAgentOptions.map((option) => ({ + id: `agent:${option.agent}`, + label: option.label, + hint: t('session.usePanelRouteActions.newSessionHint', 'New agent session'), + icon: Bot, + onPress: () => { + const delivery = pendingDiffNotesDelivery + setPendingDiffNotesDelivery(null) + if (!delivery) { + return + } + void sendDiffNotesToNewAgent(delivery, async () => { + await handleCreateTerminal(option.agent, { + initialPrompt: delivery.prompt, + onPromptSent: () => void clearDeliveredDiffComments(delivery.comments) + }) + }) + } + })) const handleSessionContentRowLayout = useCallback((event: LayoutChangeEvent) => { const width = Math.round(event.nativeEvent.layout.width) @@ -235,7 +189,7 @@ export function useMobileSessionPanelRouteActions(scope: MobileSessionPresentati ) } return { - createTabAgentActions, + createTabAgentStatusRow, sendDiffNotesAgentActions, handleSessionContentRowLayout, handlePanelTap, diff --git a/mobile/src/session/use-mobile-session-presentation.ts b/mobile/src/session/use-mobile-session-presentation.ts index 374e1db46e8..8f4b3c23331 100644 --- a/mobile/src/session/use-mobile-session-presentation.ts +++ b/mobile/src/session/use-mobile-session-presentation.ts @@ -76,11 +76,8 @@ export function useMobileSessionPresentation(scope: MobileSessionBulkCloseModel) presentedConnState === 'connected' ? showLoadingState && visibleTabs.length === 0 ? t('session.presentation.loadingTabs', 'Loading tabs') - : visibleTabs.length === 1 - ? t('session.presentation.oneTab', '1 tab') - : t('session.presentation.tabCount', '{{tabCount}} tabs', { - tabCount: visibleTabs.length - }) + : // The tab count lives in the tab bar, so the header names the branch instead. + (scope.worktreeBranch ?? MOBILE_SESSION_STATUS_LABELS.connected) : showConnectionRetry ? t('session.presentation.tapToRetry', '{{status}} — tap to retry', { status: verdictDisplayLabel(connectionVerdict) diff --git a/mobile/src/session/use-mobile-session-screen-state.ts b/mobile/src/session/use-mobile-session-screen-state.ts index eb0f7d28b74..45fd4a9d886 100644 --- a/mobile/src/session/use-mobile-session-screen-state.ts +++ b/mobile/src/session/use-mobile-session-screen-state.ts @@ -1,7 +1,7 @@ import { useState, useRef, useMemo } from 'react' import { useTerminalSplitLayout } from '../terminal/session/use-terminal-split-layout' import { createLiveInputCapture } from '../terminal/session/live-input-capture' -import { Animated, type ScrollView } from 'react-native' +import { Animated } from 'react-native' import type { MobileTerminalLinkOpenMode } from '../storage/preferences' import type { TerminalKeyboardAvoidanceMetrics } from '../terminal/terminal-webview-contract' import { @@ -46,11 +46,6 @@ export function useMobileSessionScreenState(scope: MobileSessionFoundationModel) const activeSessionTabIdRef = useRef(null) // Preserve an explicit phone tab pick while a host snapshot is transiently incomplete. const selectedSessionTabIdRef = useRef(null) - const tabStripRef = useRef(null) - const tabStripOffsetRef = useRef(0) - const tabStripViewportWidthRef = useRef(0) - const tabStripContentWidthRef = useRef(0) - const tabLayoutsRef = useRef>(new Map()) const [markdownDocs, setMarkdownDocs] = useState>(new Map()) const markdownDocsRef = useRef>(new Map()) const [fileDocs, setFileDocs] = useState>(new Map()) @@ -82,6 +77,7 @@ export function useMobileSessionScreenState(scope: MobileSessionFoundationModel) const [renameTarget, setRenameTarget] = useState(null) const [customKeys, setCustomKeys] = useState([]) const [directionPadEnabled, setDirectionPadEnabled] = useState(true) + const [smartRailEnabled, setSmartRailEnabled] = useState(false) const [visibleBuiltInIds, setVisibleBuiltInIds] = useState( getDefaultTerminalAccessoryBuiltInIds ) @@ -133,11 +129,6 @@ export function useMobileSessionScreenState(scope: MobileSessionFoundationModel) setActiveSessionTabId, activeSessionTabIdRef, selectedSessionTabIdRef, - tabStripRef, - tabStripOffsetRef, - tabStripViewportWidthRef, - tabStripContentWidthRef, - tabLayoutsRef, markdownDocs, setMarkdownDocs, markdownDocsRef, @@ -182,6 +173,8 @@ export function useMobileSessionScreenState(scope: MobileSessionFoundationModel) setCustomKeys, directionPadEnabled, setDirectionPadEnabled, + smartRailEnabled, + setSmartRailEnabled, visibleBuiltInIds, setVisibleBuiltInIds, showCustomKeyModal, diff --git a/mobile/src/session/use-mobile-session-stored-chat-tab.ts b/mobile/src/session/use-mobile-session-stored-chat-tab.ts index 6a88579b9a2..1c17a2c0a94 100644 --- a/mobile/src/session/use-mobile-session-stored-chat-tab.ts +++ b/mobile/src/session/use-mobile-session-stored-chat-tab.ts @@ -7,7 +7,7 @@ import { peekStoredChatTranscript, readStoredChatTranscript, storedTabChatTranscriptIdentity -} from './native-chat/mobile-native-chat-transcript-store' +} from './native-chat/transcript/mobile-native-chat-transcript-store' import type { MobileSessionKeyboardStateModel } from '../terminal/session/use-mobile-session-keyboard-state' /** diff --git a/mobile/src/session/use-mobile-session-view-mode.test.ts b/mobile/src/session/use-mobile-session-view-mode.test.ts index ad3edfa01bb..a0bb2a5fc72 100644 --- a/mobile/src/session/use-mobile-session-view-mode.test.ts +++ b/mobile/src/session/use-mobile-session-view-mode.test.ts @@ -146,19 +146,6 @@ describe('useMobileSessionViewMode', () => { expect(controller?.ready).toBe(true) }) - it('toggles from the effective view and persists the override', async () => { - await mount({ defaultView: 'chat' }) - - await act(async () => { - controller?.toggleTabChatView('t1') - await Promise.resolve() - }) - - expect(updateSessionViewOverride).toHaveBeenLastCalledWith('h', 'w', 't1', 'terminal') - expect(controller?.isTabChatView('t1')).toBe(false) - expect(readSessionViewOverridesPreference).toHaveBeenCalledTimes(1) - }) - it('toggles a terminal-default tab into chat', async () => { await mount({ defaultView: 'terminal' }) @@ -293,108 +280,6 @@ describe('useMobileSessionViewMode', () => { }) }) - it('submits rapid mutations in event order', async () => { - await mount({ defaultView: 'terminal' }) - act(() => controller?.toggleTabChatView('t1')) - act(() => controller?.toggleTabChatView('t2')) - - expect(updateSessionViewOverride).toHaveBeenNthCalledWith(1, 'h', 'w', 't1', 'chat') - expect(updateSessionViewOverride).toHaveBeenNthCalledWith(2, 'h', 'w', 't2', 'chat') - }) - - it('reconciles the latest optimistic override when persistence fails', async () => { - vi.mocked(updateSessionViewOverride).mockRejectedValue(new Error('storage unavailable')) - vi.mocked(readSessionViewOverridesPreference) - .mockResolvedValueOnce({ - overrides: new Map([['t1', 'terminal']]), - loaded: true - }) - .mockResolvedValueOnce({ - overrides: new Map([['t1', 'terminal']]), - loaded: true - }) - await mount({ - defaultView: 'terminal', - overrides: new Map([['t1', 'terminal']]) - }) - - await act(async () => { - controller?.toggleTabChatView('t1') - await Promise.resolve() - await Promise.resolve() - }) - - expect(controller?.isTabChatView('t1')).toBe(false) - expect(readSessionViewOverridesPreference).toHaveBeenCalledTimes(2) - }) - - it('does not let an older failed override roll back a newer choice', async () => { - const recoveryLoad = deferred>() - vi.mocked(updateSessionViewOverride) - .mockRejectedValueOnce(new Error('storage unavailable')) - .mockResolvedValueOnce(undefined) - await mount({ defaultView: 'terminal' }) - vi.mocked(readSessionViewOverridesPreference).mockReturnValueOnce( - recoveryLoad.promise.then((overrides) => ({ overrides, loaded: true })) - ) - - await act(async () => { - controller?.toggleTabChatView('t1') - await Promise.resolve() - }) - act(() => controller?.toggleTabChatView('t1')) - - await act(async () => { - recoveryLoad.resolve(new Map([['t1', 'chat']])) - await recoveryLoad.promise - await Promise.resolve() - }) - - expect(controller?.isTabChatView('t1')).toBe(false) - expect(updateSessionViewOverride).toHaveBeenNthCalledWith(2, 'h', 'w', 't1', 'terminal') - }) - - it('fails closed when both an override write and its recovery read fail', async () => { - vi.mocked(loadDefaultSessionView).mockResolvedValue('chat') - vi.mocked(updateSessionViewOverride).mockRejectedValue(new Error('storage unavailable')) - vi.mocked(readSessionViewOverridesPreference) - .mockResolvedValueOnce({ - overrides: new Map([['t1', 'terminal']]), - loaded: true - }) - .mockResolvedValueOnce({ overrides: new Map(), loaded: false }) - await mount({ - defaultView: 'chat', - overrides: new Map([['t1', 'terminal']]) - }) - - await act(async () => { - controller?.toggleTabChatView('t1') - await Promise.resolve() - await Promise.resolve() - }) - - expect(controller?.isTabChatView('t1')).toBe(false) - expect(readSessionViewOverridesPreference).toHaveBeenCalledTimes(2) - }) - - it('does not reload a failed override after the route unmounts', async () => { - const failedWrite = deferred() - vi.mocked(updateSessionViewOverride).mockReturnValue(failedWrite.promise) - await mount({ defaultView: 'terminal' }) - - act(() => controller?.toggleTabChatView('t1')) - act(() => renderer?.unmount()) - renderer = null - await act(async () => { - failedWrite.reject(new Error('storage unavailable')) - await Promise.resolve() - await Promise.resolve() - }) - - expect(readSessionViewOverridesPreference).toHaveBeenCalledTimes(1) - }) - it('fails closed to terminal when overrides cannot be read under a chat default', async () => { vi.mocked(loadDefaultSessionView).mockResolvedValue('chat') vi.mocked(readSessionViewOverridesPreference).mockResolvedValue({ diff --git a/mobile/src/session/use-mobile-structured-agent-options.chat-return.test.ts b/mobile/src/session/use-mobile-structured-agent-options.chat-return.test.ts deleted file mode 100644 index 0aa3feb9be5..00000000000 --- a/mobile/src/session/use-mobile-structured-agent-options.chat-return.test.ts +++ /dev/null @@ -1,107 +0,0 @@ -// One phone chat view serves every chat tab, so returning to a chat must not wait on its next read. - -import { act } from 'react-test-renderer' -import { expect, it } from 'vitest' -import type { AgentSessionOptionsResult } from '../../../src/shared/agent-session/options/agent-session-options-result' -import { - BASE, - OPTIONS, - accepted, - currentValueOf, - deferred, - mountOptions, - optionsClient, - recordingMutate, - settle -} from './use-mobile-structured-agent-options.test-fixture' - -const COMMAND = 'compact' -const CHAT_A: AgentSessionOptionsResult = { - ...OPTIONS, - acceptsImages: true, - conversationCommands: [COMMAND], - current: { - model: 'gpt-fast', - effort: 'low', - permissionMode: 'own', - reportedPermissionMode: 'ask', - acceptedInputSources: { model: 'saved', effort: 'saved' } - } -} -const CHAT_B: AgentSessionOptionsResult = { - ...OPTIONS, - acceptsImages: false, - current: { model: 'gpt-live', effort: 'high', permissionMode: 'ask' } -} - -/** Host replies per chat; later reads for chat A wait until the test answers them. */ -function chats() { - const later: ReturnType>[] = [] - let readsOfA = 0 - let readingB = false - const client = optionsClient(() => { - if (readingB) { - return Promise.resolve(CHAT_B) - } - if (readsOfA++ === 0) { - return Promise.resolve(CHAT_A) - } - const reply = deferred() - later.push(reply) - return reply.promise - }) - const send = client.client.sendRequest - client.client.sendRequest = (method, params, options) => { - if (method === 'agentSession.options') { - readingB = JSON.stringify(params).includes('chat-b') - } - return send(method, params, options) - } - return { client, later } -} - -it("shows a chat's last answer on return, without its reports, until its new read lands", async () => { - const { client, later } = chats() - const { mutate } = recordingMutate(async () => accepted({ key: 'model', value: 'x' }, true)) - const harness = await mountOptions({ - ...BASE, - sessionId: 'chat-a', - fence: 1, - client: client.client, - mutate, - permissionOwn: true, - sendSelection: true - }) - await harness.rerender({ sessionId: 'chat-b', fence: 7 }) - expect(currentValueOf(harness.current().optionSnapshot, 'model')).toBe('gpt-live') - const commitsOnB = harness.commits.length - await harness.rerender({ sessionId: 'chat-a', fence: 2 }) - expect(later).toHaveLength(1) - // From the first commit on return, not only after a later effect catches up. - for (const commit of harness.commits.slice(commitsOnB)) { - expect(currentValueOf(commit.optionSnapshot, 'model')).toBe('gpt-fast') - } - const shown = harness.current() - expect(currentValueOf(shown.optionSnapshot, 'model')).toBe('gpt-fast') - expect(currentValueOf(shown.optionSnapshot, 'effort')).toBe('low') - expect(shown.conversationCommands).toEqual([COMMAND]) - expect(shown.acceptsImages).toBe(true) - // Saved permission intent survives a restart independently of runtime reports. - expect(currentValueOf(shown.optionSnapshot, 'permissionMode')).toBe('own') - expect(shown.sendSelection()).toEqual({ selection: {} }) - - await act(async () => { - later[0].resolve({ - ...CHAT_A, - conversationCommands: [], - current: { ...CHAT_A.current, model: 'gpt-live' } - }) - }) - await settle() - const answered = harness.current() - expect(currentValueOf(answered.optionSnapshot, 'model')).toBe('gpt-live') - expect(currentValueOf(answered.optionSnapshot, 'permissionMode')).toBe('own') - expect(answered.conversationCommands).toEqual([]) - expect(answered.sendSelection()).toEqual({ selection: { model: 'gpt-live', effort: 'low' } }) - await harness.unmount() -}) diff --git a/mobile/src/session/use-mobile-structured-agent-turn-timing.test.tsx b/mobile/src/session/use-mobile-structured-agent-turn-timing.test.tsx deleted file mode 100644 index c1b7ea7c7e3..00000000000 --- a/mobile/src/session/use-mobile-structured-agent-turn-timing.test.tsx +++ /dev/null @@ -1,160 +0,0 @@ -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, describe, expect, it, vi } from 'vitest' -import type { - AgentJournalRenderItem, - AgentJournalSubmission, - AgentJournalTurnLifecycle -} from '../../../src/shared/agent-session/journal/agent-session-journal-types' -import { agentJournalTurnBody } from '../../../src/shared/agent-session/lifecycle/agent-session-turn-record' -import { useMobileStructuredAgentTurnTiming } from './use-mobile-structured-agent-turn-timing' - -// Skew the host clock by an hour so unconverted timestamp leakage is obvious. -const HOST_START = 3_600_000_000 -const CLIENT_NOW = 12_345_000 - -function user(itemId: string, sequence: number): AgentJournalRenderItem { - return { - itemId, - revision: 0, - sequence, - observedAt: HOST_START + sequence, - body: { kind: 'message', role: 'user', blocks: [{ type: 'text', text: itemId }] } - } -} - -function lifecycle( - turnId: string, - sequence: number, - turn: Omit, - observedAt: number -): AgentJournalRenderItem { - return { - itemId: `lifecycle-${turnId}`, - revision: 1, - sequence, - observedAt, - body: agentJournalTurnBody({ turnId, ...turn }) - } -} - -type Timing = ReturnType -const NO_SUBMISSIONS: readonly AgentJournalSubmission[] = [] - -const SUBMISSIONS: AgentJournalSubmission[] = [ - { - clientMessageId: 'first', - fence: 1, - payloadFingerprint: 'fp', - dispatchState: 'accepted', - providerItemId: 'codex:thread:t1:0', - reason: null, - submittedAt: 1, - resolvedAt: 2 - } -] - -describe('useMobileStructuredAgentTurnTiming', () => { - let renderer: ReactTestRenderer | null = null - let timing: Timing | null = null - - function Harness({ - items, - submissions = NO_SUBMISSIONS, - turnId, - hostClock - }: { - items: readonly AgentJournalRenderItem[] - submissions?: readonly AgentJournalSubmission[] - turnId: string | null - hostClock?: { hostNow: number; receivedAt: number } - }): null { - timing = useMobileStructuredAgentTurnTiming({ items, submissions, hostClock }, turnId) - return null - } - - afterEach(() => { - act(() => renderer?.unmount()) - renderer = null - timing = null - vi.useRealTimers() - }) - - it('hands settled host durations through and anchors the live counter locally, once per turn', () => { - vi.useFakeTimers() - vi.setSystemTime(CLIENT_NOW) - const items = [ - user('orca:first', 1), - lifecycle( - 't1', - 2, - { - state: 'interrupted', - startedAt: HOST_START, - completedAt: HOST_START + 61_000, - userItemId: 'codex:thread:t1:0' - }, - HOST_START + 5 - ), - user('u2', 3), - lifecycle( - 't2', - 4, - { state: 'running', startedAt: HOST_START + 100_000 }, - HOST_START + 102_500 - ) - ] - const submissions = SUBMISSIONS - act(() => { - renderer = create(createElement(Harness, { items, submissions, turnId: 't2' })) - }) - expect(timing?.workingStartedAt).toBe(CLIENT_NOW - 2_500) - expect([...timing!.settledTurns]).toEqual([ - ['orca:first', { startedAt: HOST_START, workedSeconds: 61, verdict: 'interruption' }], - ['u2', null] - ]) - - vi.setSystemTime(CLIENT_NOW + 30_000) - act(() => - renderer?.update(createElement(Harness, { items: [...items], submissions, turnId: 't2' })) - ) - expect(timing?.workingStartedAt).toBe(CLIENT_NOW - 2_500) - - act(() => renderer?.update(createElement(Harness, { items, turnId: null }))) - expect(timing?.workingStartedAt).toBeNull() - - // Convert host age through elapsed receipt time rather than either clock’s absolute timestamp. - vi.setSystemTime(CLIENT_NOW + 60_000) - const next = [ - ...items, - user('u3', 5), - lifecycle( - 't3', - 6, - { state: 'running', startedAt: HOST_START + 150_000 }, - HOST_START + 150_100 - ) - ] - act(() => - renderer?.update( - createElement(Harness, { - items: next, - turnId: 't3', - hostClock: { hostNow: HOST_START + 185_000, receivedAt: CLIENT_NOW + 55_000 } - }) - ) - ) - expect(timing?.workingStartedAt).toBe(CLIENT_NOW + 60_000 - 40_000) - }) - - it('leaves the anchor null when an older host records no start', () => { - vi.useFakeTimers() - vi.setSystemTime(CLIENT_NOW) - const items = [user('u1', 1), lifecycle('t1', 2, { state: 'running' }, HOST_START)] - act(() => { - renderer = create(createElement(Harness, { items, turnId: 't1' })) - }) - expect(timing?.workingStartedAt).toBeNull() - expect(timing?.settledTurns.size).toBe(0) - }) -}) diff --git a/mobile/src/session/use-mobile-structured-native-chat-send-bridge.test.ts b/mobile/src/session/use-mobile-structured-native-chat-send-bridge.test.ts deleted file mode 100644 index 70cac00aeb4..00000000000 --- a/mobile/src/session/use-mobile-structured-native-chat-send-bridge.test.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { mobileNativeChatDraftDestination } from './native-chat/composer/mobile-native-chat-draft-inputs' -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { StructuredAgentId } from '../../../src/shared/agent-session/lifecycle/agent-session-provider-handle' -import type { MobileNativeChatSendOrigin } from './native-chat/mobile-native-chat-pending-echo' -import type { MobileNativeChatSendIntent } from './native-chat/mobile-native-chat-send' -import { useMobileStructuredNativeChatSendBridge } from './use-mobile-structured-native-chat-send-bridge' -import { - editMobileNativeChatDraft, - recordMobileNativeChatSkillPick, - readMobileNativeChatPickedSkills, - resetMobileNativeChatDraftStoreForTests -} from './native-chat/composer/mobile-native-chat-draft-store' - -const ORIGIN: MobileNativeChatSendOrigin = { - draftKey: 'draft', - draftDestination: mobileNativeChatDraftDestination('draft'), - draftEditGeneration: 0, - pendingKey: 'pending', - normalizedText: 'command', - boundary: { afterMessageId: null }, - sentAt: 0 -} - -describe('useMobileStructuredNativeChatSendBridge', () => { - let renderer: ReactTestRenderer | null = null - let sendWithOutcome: ReturnType['sendWithOutcome'] - const captureSendOrigin = vi.fn(() => ORIGIN) - const clearDraftForSend = vi.fn() - const onSendError = vi.fn() - const restoreRejectedDraft = vi.fn() - const sendStructured = vi.fn() - const holdUnconfirmed = vi.fn<(clientMessageId: string, onUnconfirmed: () => void) => void>() - - function Harness({ agent }: { agent: StructuredAgentId }): null { - sendWithOutcome = useMobileStructuredNativeChatSendBridge({ - agent, - captureSendOrigin, - clearDraftForSend, - onSendError, - restoreRejectedDraft, - sendStructured, - holdUnconfirmed - }).sendWithOutcome - return null - } - - function mount(agent: StructuredAgentId): void { - act(() => { - renderer = create(createElement(Harness, { agent })) - }) - } - - beforeEach(() => { - vi.clearAllMocks() - }) - - afterEach(() => { - act(() => renderer?.unmount()) - renderer = null - resetMobileNativeChatDraftStoreForTests() - }) - - it('hands back an unconfirmed send with its skills beside newer picks only at the deadline', async () => { - recordMobileNativeChatSkillPick(ORIGIN.draftKey, { - token: '$review', - path: '/skills/review/SKILL.md' - }) - sendStructured.mockImplementation( - async ( - ...args: [unknown, unknown, unknown, unknown, unknown, MobileNativeChatSendIntent] - ) => { - args[5].onCreated?.('lost-id') - editMobileNativeChatDraft(ORIGIN.draftKey, '$newer work') - recordMobileNativeChatSkillPick(ORIGIN.draftKey, { - token: '$newer', - path: '/skills/newer/SKILL.md' - }) - return 'unknown' - } - ) - mount('codex') - - await expect(sendWithOutcome('/review')).resolves.toBe('unknown') - - expect(restoreRejectedDraft).not.toHaveBeenCalled() - expect(onSendError).not.toHaveBeenCalled() - expect(holdUnconfirmed).toHaveBeenCalledWith('lost-id', expect.any(Function)) - act(() => holdUnconfirmed.mock.calls[0]![1]()) - expect(restoreRejectedDraft).toHaveBeenCalledWith(ORIGIN, '/review') - expect(onSendError).toHaveBeenCalledWith('Not confirmed. Restored to the box.') - expect(readMobileNativeChatPickedSkills(ORIGIN.draftKey).map((skill) => skill.name)).toEqual([ - 'newer', - 'review' - ]) - }) - - it('puts a host command whose reply was lost back in the box', async () => { - sendStructured.mockResolvedValue('unknown') - mount('codex') - - await expect(sendWithOutcome('/compact')).resolves.toBe('unknown') - - expect(holdUnconfirmed).not.toHaveBeenCalled() - expect(restoreRejectedDraft).toHaveBeenCalledWith(ORIGIN, '/compact', { - preserveConversationCommands: true - }) - }) - - it('sends a queued message with its own skills and leaves the composer alone when refused', async () => { - recordMobileNativeChatSkillPick(ORIGIN.draftKey, { - token: '$draft', - path: '/skills/draft/SKILL.md' - }) - sendStructured.mockResolvedValue('rejected') - mount('codex') - const queuedSkill = { name: 'review', path: '/skills/review/SKILL.md' } - - await expect( - sendWithOutcome('$review the PR', undefined, undefined, undefined, undefined, { - queued: { - id: 'queued-1', - images: [], - files: [], - skills: [queuedSkill], - skillOrigin: '$review' - } - }) - ).resolves.toBe('rejected') - - expect(sendStructured.mock.calls[0]![4]).toEqual([queuedSkill]) - expect(clearDraftForSend).not.toHaveBeenCalled() - expect(restoreRejectedDraft).not.toHaveBeenCalled() - }) -}) diff --git a/mobile/src/session/use-mobile-structured-session-opening.ts b/mobile/src/session/use-mobile-structured-session-opening.ts index e7932042c0d..d3f03a6e134 100644 --- a/mobile/src/session/use-mobile-structured-session-opening.ts +++ b/mobile/src/session/use-mobile-structured-session-opening.ts @@ -5,9 +5,9 @@ import { useWorkspaceRouteHandoff } from '../navigation/workspace-route-handoff' import { openMobileStructuredSession, mobileStructuredSessionHref -} from './open-mobile-structured-session' +} from './native-chat/agent-session/open-mobile-structured-session' import type { StructuredSessionOpenSource } from '../../../src/shared/open-structured-agent-session' -import { mobileStructuredSessionOpenMessage } from './mobile-structured-session-open-message' +import { mobileStructuredSessionOpenMessage } from './native-chat/agent-session/mobile-structured-session-open-message' import { isStructuredAgentId } from '../../../src/shared/agent-session/lifecycle/agent-session-provider-handle-encoding' import type { MobileSessionTab } from './tabs/mobile-session-tabs' import type { useMobileSessionTabSwitching } from './tabs/use-mobile-session-tab-switching' diff --git a/mobile/src/session/use-throttled-latest-value.test.ts b/mobile/src/session/use-throttled-latest-value.test.ts deleted file mode 100644 index b439f394d77..00000000000 --- a/mobile/src/session/use-throttled-latest-value.test.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { useThrottledLatestValue } from './use-throttled-latest-value' - -describe('useThrottledLatestValue', () => { - let renderer: ReactTestRenderer | null = null - let latest: string | undefined - - function Harness({ value }: { value: string | undefined }): null { - latest = useThrottledLatestValue(value, 50) - return null - } - - function render(value: string | undefined): void { - act(() => { - renderer = create(createElement(Harness, { value })) - }) - } - - function update(value: string | undefined): void { - act(() => renderer?.update(createElement(Harness, { value }))) - } - - beforeEach(() => { - vi.useFakeTimers() - latest = undefined - }) - - afterEach(() => { - act(() => renderer?.unmount()) - renderer = null - vi.useRealTimers() - }) - - it('emits the first frame immediately', () => { - render('a') - expect(latest).toBe('a') - }) - - it('holds rapid updates but eventually emits the latest value', () => { - render('a') - update('ab') - update('abc') - expect(latest).toBe('a') - act(() => { - vi.advanceTimersByTime(50) - }) - expect(latest).toBe('abc') - }) - - it('clears immediately and drops the trailing emit when the value goes undefined', () => { - render('a') - update('ab') - expect(latest).toBe('a') - update(undefined) - expect(latest).toBeUndefined() - act(() => { - vi.advanceTimersByTime(50) - }) - expect(latest).toBeUndefined() - }) -}) diff --git a/mobile/src/settings/notification-display-test.tsx b/mobile/src/settings/notification-display-test.tsx index 51280f27047..ecb737e0e5c 100644 --- a/mobile/src/settings/notification-display-test.tsx +++ b/mobile/src/settings/notification-display-test.tsx @@ -1,7 +1,7 @@ import { useEffect, useRef, useState } from 'react' import { ListRow } from '../components/list/ListGroup' import { useAllHostClients } from '../transport/connection/use-all-host-clients' -import { loadHostCatalog } from '../transport/hosts/host-store' +import { loadHostCatalog } from '../host-catalog/host-store' import { pushDeliveryTest } from '../notifications/mobile-push-delivery-test-operations' import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' import { useMobileTranslation } from '../i18n/use-mobile-translation' diff --git a/mobile/src/settings/pending-credential-cleanup-card.tsx b/mobile/src/settings/pending-credential-cleanup-card.tsx index af0a91ce081..0ef2d84df8e 100644 --- a/mobile/src/settings/pending-credential-cleanup-card.tsx +++ b/mobile/src/settings/pending-credential-cleanup-card.tsx @@ -9,8 +9,8 @@ import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' import { loadPendingHostCredentialCleanup, subscribePendingHostCredentialCleanup -} from '../transport/hosts/host-credential-cleanup' -import { retryPendingHostCredentialCleanup } from '../transport/hosts/host-store' +} from '../host-credentials/host-credential-cleanup' +import { retryPendingHostCredentialCleanup } from '../host-catalog/host-store' import { useMobileTranslation } from '../i18n/use-mobile-translation' import { SettingsSection } from './settings-screen-frame' diff --git a/mobile/src/source-control/MobileSourceControlRoutePanel.tsx b/mobile/src/source-control/MobileSourceControlRoutePanel.tsx index f82fd2915e9..a6096584cee 100644 --- a/mobile/src/source-control/MobileSourceControlRoutePanel.tsx +++ b/mobile/src/source-control/MobileSourceControlRoutePanel.tsx @@ -10,6 +10,8 @@ export function MobileSourceControlRoutePanel(props: MobileSourceControlPanelPro if (parseWorkspaceKey(props.worktreeId)?.type === 'folder') { return ( void> + onCreate: (repo: Repo, target: FolderRepoTarget, client: RpcClient, name: string) => void + bottomInset: number +} + +/** A folder with no attached worktrees: desktop's copy, then one create card per repository. */ +export function MobileFolderEmptyState(props: Props) { + const { hostId, folder, desktopCapabilities, folderHostCapabilities, observing, refreshers } = + props + const t = useMobileTranslation() + const { client: desktopClient, state } = useHostClient(hostId) + // A relayed server's folder is created on that server, through the desktop. + const routeHost = workspaceRouteExecutionHost(desktopClient, desktopCapabilities, folder.hostId) + const server = routeHost?.startsWith('runtime:') ? routeHost : undefined + // Only exact-name creates land as named; a server's rows also need a desktop new enough to relay its folder lineage. + const canCreate = + state === 'connected' && + routeHost !== null && + folderHostCapabilities.includes(WORKTREE_CREATE_EXACT_NAME_RUNTIME_CAPABILITY) && + (!server || desktopCapabilities.includes(WORKTREE_CREATE_EXACT_NAME_RUNTIME_CAPABILITY)) + const createClient = useMemo( + () => + desktopClient && server + ? scopeRpcClientToExecutionHost(desktopClient, server) + : desktopClient, + [desktopClient, server] + ) + const catalog = useHostQuery( + server ? serverFolderSourceCatalogQuery : folderSourceCatalogQuery, + { hostId, client: canCreate ? createClient : null }, + { exec: server ?? 'local' }, + NO_INPUT, + { enabled: canCreate, subscribed: observing } + ) + const refetchCatalog = catalog.refetch + useEffect(() => { + if (!canCreate) { + return + } + const refresh = () => void refetchCatalog() + refreshers.add(refresh) + return () => { + refreshers.delete(refresh) + } + }, [canCreate, refetchCatalog, refreshers]) + const repos = useMemo( + () => + canCreate + ? selectFolderSourceRepos(catalog.data, projectGroupIdFromRepoId(folder.repoId)) + : [], + [canCreate, catalog.data, folder.repoId] + ) + const name = folder.displayName.trim() + const catalogFailed = canCreate && catalog.data === undefined && catalog.error !== null + + return ( + + void refetchCatalog() + } + : null + } + bottomInset={props.bottomInset} + > + {repos.length > 0 && createClient && name ? ( + + + + {repos.map((repo) => { + const target: FolderRepoTarget = { + hostId, + executionHost: server, + folderWorktreeId: folder.worktreeId, + repoId: repo.id + } + return ( + props.onCreate(repo, target, createClient, name)} + /> + ) + })} + + + ) : null} + + + ) +} + +function FolderRepoCreateCard(props: { + target: FolderRepoTarget + repo: Repo + onPress: () => void +}) { + const t = useMobileTranslation() + const busy = useSyncExternalStore(subscribeFolderRepoCreates, () => + isFolderRepoCreateBusy(props.target) + ) + return ( + + } + accessory={ + busy ? ( + + ) : ( + + ) + } + busy={busy} + onPress={props.onPress} + accessibilityRole="button" + accessibilityLabel={t('sourceControl.folder.createIn', 'Create a worktree in {{repo}}', { + repo: props.repo.displayName + })} + /> + + ) +} + +const styles = themedStyleSheet(() => ({ + scroll: { flexGrow: 1 }, + cards: { gap: spacing.sm } +})) diff --git a/mobile/src/source-control/folder/MobileFolderSourceControlPanel.tsx b/mobile/src/source-control/folder/MobileFolderSourceControlPanel.tsx index f27ba094d7b..e3d21ea0539 100644 --- a/mobile/src/source-control/folder/MobileFolderSourceControlPanel.tsx +++ b/mobile/src/source-control/folder/MobileFolderSourceControlPanel.tsx @@ -24,9 +24,14 @@ import { getWorktreeRowIdentity } from '../../worktree/worktree-host-row-identit import { MobileSourceControlHeader } from '../MobileSourceControlHeader' import { MobileSourceControlPanel } from '../MobileSourceControlPanel' import { styles as sourceControlStyles } from '../mobile-source-control-styles' +import { MobileFolderEmptyState } from './MobileFolderEmptyState' +import { useFolderCreateFlow } from './use-folder-create-flow' import { MobileFolderWorktreeRow } from './MobileFolderWorktreeRow' +import { useOptionalHostProtocolGates } from '../../components/host-protocol-gates-context' import { useMobileFolderAttachedWorktrees } from './use-mobile-folder-attached-worktrees' +const NO_CAPABILITIES: readonly string[] = [] + type Props = { hostId: string folderWorktreeId: string @@ -61,8 +66,22 @@ export function MobileFolderSourceControlPanel({ const observing = focused && !pageOpen const { folder, worktrees, desktopCapabilities, serverHosts, connState, loadError, refetch } = useMobileFolderAttachedWorktrees(hostId, folderWorktreeId, observing) + // In a server's scope these are the server's own; otherwise the desktop's. + const folderHostGates = useOptionalHostProtocolGates() const forceReconnect = useForceReconnect() const [refreshers] = useState(() => new Set<() => void>()) + const createFlow = useFolderCreateFlow({ + hostId, + folderWorktreeId, + executionHost: folder?.hostId?.startsWith('runtime:') ? folder.hostId : undefined, + desktopCapabilities, + members: worktrees, + observing, + refetch, + bottomInset: insets.bottom + }) + // Rows and repositories under a create form wait; the folder's members stay live so creates still reconcile. + const statusObserving = observing && !createFlow.covered const refresh = () => { refetch() for (const refreshNow of refreshers) { @@ -118,13 +137,17 @@ export function MobileFolderSourceControlPanel({ title={t('sourceControl.panel.unavailableTitle', 'Source Control Unavailable')} /> ) : worktrees.length === 0 ? ( - + void createFlow.onCreate(repo, target, client, createName) + } + bottomInset={insets.bottom} /> ) : ( // One card per attached worktree, as desktop shows them. @@ -141,7 +164,7 @@ export function MobileFolderSourceControlPanel({ serverHosts.find((server) => server.hostId === worktree.hostId)?.relay === 'update-needed' } - subscribed={observing} + subscribed={statusObserving} refreshers={refreshers} onOpen={open} /> @@ -160,6 +183,8 @@ export function MobileFolderSourceControlPanel({ )} {/* Every state shares the sheet surface the cards sit on, as the phone's option sheets do. */} {body} + {createFlow.toastElement} + {createFlow.composerElement} ) return ( diff --git a/mobile/src/source-control/folder/folder-repo-worktree-create.test.ts b/mobile/src/source-control/folder/folder-repo-worktree-create.test.ts new file mode 100644 index 00000000000..e89ca544001 --- /dev/null +++ b/mobile/src/source-control/folder/folder-repo-worktree-create.test.ts @@ -0,0 +1,332 @@ +import { afterEach, describe, expect, it, vi } from 'vitest' +import { FakeSession } from '../../transport/connection/mobile-endpoint-supervisor-test-fakes' +import { markRpcDeliveryUnknown } from '../../transport/rpc/rpc-delivery-ambiguity' +import type { RpcResponse } from '../../transport/rpc/rpc-wire-types' +import { + beginFolderComposerSubmission, + createFolderRepoWorktree, + isFolderRepoCreateBusy, + reconcileFolderRepoCreates, + releaseFolderComposerReservation, + type FolderRepoTarget +} from './folder-repo-worktree-create' + +const idempotency = vi.hoisted(() => { + const state: { support: { dedupeTtlMs: number } | false } = { support: false } + return state +}) +vi.mock('../../tasks/worktree-create-capability', () => ({ + readNewWorktreeRuntimeCapabilities: async () => ({ + worktreeCreateIdempotency: idempotency.support + }) +})) + +const FOLDER = 'folder:f-1' +const TAKEN = 'Branch payments already exists\nworktree_create_exact_name_taken' + +afterEach(() => { + vi.useRealTimers() + idempotency.support = false +}) + +let repoCount = 0 +// Each test's own repository: the registry is shared, as it is across screens. +function target(executionHost?: string): FolderRepoTarget { + repoCount += 1 + return { hostId: 'host-1', executionHost, folderWorktreeId: FOLDER, repoId: `repo-${repoCount}` } +} + +function refused(message: string): RpcResponse { + return { id: '1', ok: false, error: { code: 'x', message }, _meta: { runtimeId: 'r' } } +} + +const CREATED: RpcResponse = { + id: '1', + ok: true, + result: { worktree: { id: 'repo::/w/payments', displayName: 'payments' } }, + _meta: { runtimeId: 'r' } +} + +function host(...replies: (RpcResponse | Error)[]): FakeSession { + const client = new FakeSession('connected') + for (const reply of replies) { + if (reply instanceof Error) { + client.sendRequest.mockRejectedValueOnce(reply) + } else { + client.sendRequest.mockResolvedValueOnce(reply) + } + } + return client +} + +const create = (repo: FolderRepoTarget, client: FakeSession) => + createFolderRepoWorktree({ target: repo, client, name: 'payments' }) + +describe('createFolderRepoWorktree', () => { + it('sends one exact-name create attached to the folder', async () => { + const repo = target() + const client = host(CREATED) + + await expect(create(repo, client)).resolves.toEqual({ kind: 'created', name: 'payments' }) + expect(client.sendRequest.mock.calls).toEqual([ + [ + 'worktree.create', + { + repo: `id:${repo.repoId}`, + name: 'payments', + displayName: 'payments', + displayNameKind: 'user', + branchIntent: 'create-exact', + setupDecision: 'inherit', + parentWorkspace: FOLDER, + parentWorkspaceOrigin: 'manual' + }, + expect.anything() + ] + ]) + }) + + it('sends nothing for a second tap while the first create runs', async () => { + const repo = target() + const client = new FakeSession('connected') + let answer: (response: RpcResponse) => void = () => {} + client.sendRequest.mockReturnValue(new Promise((resolve) => (answer = resolve))) + + const first = create(repo, client) + await expect(create(repo, client)).resolves.toEqual({ kind: 'already-running' }) + answer(CREATED) + await first + expect(client.sendRequest).toHaveBeenCalledTimes(1) + }) + + it.each([ + ['the name is taken', TAKEN], + ['the repo asks about setup', 'Setup decision required for this repository'] + ])('keeps the repository for the composer when %s', async (_case, message) => { + const repo = target() + const outcome = await create(repo, host(refused(message))) + + expect(outcome.kind).toBe('needs-composer') + expect(isFolderRepoCreateBusy(repo)).toBe(true) + if (outcome.kind === 'needs-composer') { + releaseFolderComposerReservation(repo, outcome.reservation) + } + expect(isFolderRepoCreateBusy(repo)).toBe(false) + }) + + it('treats a lost reply as possibly created, past the busy backstop, and never offers the composer', async () => { + vi.useFakeTimers({ toFake: ['setTimeout'] }) + const repo = target() + const lost = markRpcDeliveryUnknown(new Error('connection lost')) + + await expect(create(repo, host(lost))).resolves.toEqual({ kind: 'maybe-created' }) + expect(isFolderRepoCreateBusy(repo)).toBe(true) + await expect(create(repo, host(CREATED))).resolves.toEqual({ kind: 'already-running' }) + + // The list never showed it; the card takes taps again but the create is still unresolved. + vi.advanceTimersByTime(60_000) + expect(isFolderRepoCreateBusy(repo)).toBe(false) + const retry = host(refused(TAKEN)) + await expect(create(repo, retry)).resolves.toEqual({ kind: 'maybe-created' }) + expect(retry.sendRequest).toHaveBeenCalledTimes(1) + }) + + it('retries an unconfirmed create as the name it was sent as, even after the folder is renamed', async () => { + vi.useFakeTimers({ toFake: ['setTimeout'] }) + const repo = target() + await create(repo, host(markRpcDeliveryUnknown(new Error('connection lost')))) + vi.advanceTimersByTime(60_000) + + const retry = host(refused(TAKEN)) + await createFolderRepoWorktree({ target: repo, client: retry, name: 'billing' }) + expect(retry.sendRequest.mock.calls[0]?.[1]).toMatchObject({ name: 'payments' }) + }) + + it('asks for setup when an unconfirmed create is refused for it, and resends the same exact name', async () => { + vi.useFakeTimers({ toFake: ['setTimeout'] }) + const repo = target() + await create(repo, host(markRpcDeliveryUnknown(new Error('connection lost')))) + vi.advanceTimersByTime(60_000) + + const asked = await create(repo, host(refused('Setup decision required for this repository'))) + expect(asked.kind).toBe('needs-setup-choice') + expect(isFolderRepoCreateBusy(repo)).toBe(false) + const hold = asked.kind === 'needs-setup-choice' ? asked.hold : -1 + + const resent = host(refused(TAKEN)) + await expect( + createFolderRepoWorktree({ + target: repo, + client: resent, + name: 'billing', + skipSetupFor: hold + }) + ).resolves.toEqual({ kind: 'maybe-created' }) + expect(resent.sendRequest.mock.calls[0]?.[1]).toMatchObject({ + name: 'payments', + branchIntent: 'create-exact', + setupDecision: 'skip' + }) + }) + + it('sends nothing for a setup choice once its create is listed or replaced', async () => { + vi.useFakeTimers({ toFake: ['setTimeout'] }) + const ask = async (repo: FolderRepoTarget) => { + await create(repo, host(markRpcDeliveryUnknown(new Error('connection lost')))) + vi.advanceTimersByTime(60_000) + const asked = await create(repo, host(refused('Setup decision required for this repository'))) + return asked.kind === 'needs-setup-choice' ? asked.hold : -1 + } + const listed = target() + const listedHold = await ask(listed) + const folder = { hostId: 'host-1', executionHost: undefined, folderWorktreeId: FOLDER } + reconcileFolderRepoCreates(folder, [{ repoId: listed.repoId }]) + const replaced = target() + const replacedHold = await ask(replaced) + await ask(replaced) + + const late = host(CREATED) + for (const [repo, hold] of [ + [listed, listedHold], + [replaced, replacedHold] + ] as const) { + await expect( + createFolderRepoWorktree({ + target: repo, + client: late, + name: 'billing', + skipSetupFor: hold + }) + ).resolves.toEqual({ kind: 'checking' }) + } + expect(late.sendRequest).not.toHaveBeenCalled() + }) +}) + +describe('createFolderRepoWorktree after a lost reply on a host that dedupes', () => { + it.each([ + ['answers with the worktree', CREATED, { kind: 'created', name: 'payments' }], + ['refuses the name as taken', refused(TAKEN), { kind: 'maybe-created' }] + ])('resends the same create once reconnected; the host %s', async (_case, replay, expected) => { + idempotency.support = { dedupeTtlMs: 60_000 } + const repo = target() + const client = new FakeSession('connected') + client.sendRequest + .mockImplementationOnce(async () => { + client.publishState('reconnecting') + setTimeout(() => client.publishState('connected'), 0) + throw markRpcDeliveryUnknown(new Error('connection lost')) + }) + .mockResolvedValueOnce(replay) + + await expect(create(repo, client)).resolves.toEqual(expected) + const [first, second] = client.sendRequest.mock.calls.map(([, params]) => params) + expect(second).toEqual(first) + expect(first).toHaveProperty('clientMutationId') + }) +}) + +describe('reconcileFolderRepoCreates', () => { + it('forgets a create once the folder lists its worktree on the same host, not another', async () => { + const repo = target('runtime:env-1') + await create(repo, host(CREATED)) + const folder = { hostId: 'host-1', executionHost: 'runtime:env-1', folderWorktreeId: FOLDER } + + reconcileFolderRepoCreates(folder, [{ repoId: repo.repoId, hostId: 'runtime:env-2' }]) + expect(isFolderRepoCreateBusy(repo)).toBe(true) + reconcileFolderRepoCreates(folder, [{ repoId: repo.repoId, hostId: 'runtime:env-1' }]) + expect(isFolderRepoCreateBusy(repo)).toBe(false) + }) + + it('keeps a create still on its way even if the list already shows the repository', async () => { + const repo = target() + const client = new FakeSession('connected') + let answer: (response: RpcResponse) => void = () => {} + client.sendRequest.mockReturnValue(new Promise((resolve) => (answer = resolve))) + const folder = { hostId: 'host-1', executionHost: undefined, folderWorktreeId: FOLDER } + const members = [{ repoId: repo.repoId }] + + const pending = create(repo, client) + reconcileFolderRepoCreates(folder, members) + expect(isFolderRepoCreateBusy(repo)).toBe(true) + answer(CREATED) + await pending + reconcileFolderRepoCreates(folder, members) + expect(isFolderRepoCreateBusy(repo)).toBe(false) + }) + + it("doesn't let an earlier create's timer end a newer one", async () => { + vi.useFakeTimers({ toFake: ['setTimeout'] }) + const repo = target() + await create(repo, host(markRpcDeliveryUnknown(new Error('lost')))) + vi.advanceTimersByTime(10_000) + const folder = { hostId: 'host-1', executionHost: undefined, folderWorktreeId: FOLDER } + reconcileFolderRepoCreates(folder, [{ repoId: repo.repoId }]) + await create(repo, host(CREATED)) + + vi.advanceTimersByTime(10_000) + expect(isFolderRepoCreateBusy(repo)).toBe(true) + }) +}) + +describe('beginFolderComposerSubmission', () => { + async function composing() { + const repo = target() + const outcome = await create(repo, host(refused(TAKEN))) + if (outcome.kind !== 'needs-composer') { + throw new Error('expected the composer') + } + return { repo, launch: { target: repo, reservation: outcome.reservation, name: 'payments' } } + } + + it('admits one create per repository while it is out, even after the form closes', async () => { + const { repo, launch } = await composing() + let formOpen = true + const submission = beginFolderComposerSubmission(repo, launch, () => formOpen) + + expect(submission).not.toBeNull() + formOpen = false + releaseFolderComposerReservation(repo, launch.reservation) + expect(beginFolderComposerSubmission(repo, launch, () => true)).toBeNull() + expect(await create(repo, host(CREATED))).toEqual({ kind: 'already-running' }) + + submission?.settle('uncertain') + expect(isFolderRepoCreateBusy(repo)).toBe(true) + }) + + it('gives a refused create back to the open form, and a same-host switch its own admission', async () => { + const { repo, launch } = await composing() + const other = { ...repo, repoId: `${repo.repoId}-other` } + + beginFolderComposerSubmission(repo, launch, () => true)?.settle('failed') + expect(isFolderRepoCreateBusy(repo)).toBe(true) + const switched = beginFolderComposerSubmission(other, launch, () => true) + expect(switched).not.toBeNull() + expect(beginFolderComposerSubmission(other, launch, () => true)).toBeNull() + switched?.settle('created') + releaseFolderComposerReservation(repo, launch.reservation) + expect(isFolderRepoCreateBusy(repo)).toBe(false) + expect(isFolderRepoCreateBusy(other)).toBe(true) + }) + it("never sends anything from a card for a form's unconfirmed create, whatever name it used", async () => { + vi.useFakeTimers({ toFake: ['setTimeout'] }) + const { repo, launch } = await composing() + // The form may have sent another name or branch than the card's. + beginFolderComposerSubmission(repo, launch, () => true)?.settle('uncertain') + vi.advanceTimersByTime(60_000) + + expect(beginFolderComposerSubmission(repo, launch, () => true)).toBeNull() + const tap = host(CREATED) + await expect(create(repo, tap)).resolves.toEqual({ kind: 'checking' }) + await expect( + createFolderRepoWorktree({ + target: repo, + client: tap, + name: 'payments', + skipSetupFor: 0 + }) + ).resolves.toEqual({ kind: 'checking' }) + expect(tap.sendRequest).not.toHaveBeenCalled() + expect(isFolderRepoCreateBusy(repo)).toBe(false) + }) +}) diff --git a/mobile/src/source-control/folder/folder-repo-worktree-create.ts b/mobile/src/source-control/folder/folder-repo-worktree-create.ts new file mode 100644 index 00000000000..f4828651a62 --- /dev/null +++ b/mobile/src/source-control/folder/folder-repo-worktree-create.ts @@ -0,0 +1,310 @@ +import { WORKTREE_CREATE_EXACT_NAME_TAKEN_CODE } from '../../../../src/shared/new-workspace/worktree-create-collision' +import { hasRuntimeRpcErrorCode } from '../../../../src/shared/runtime-rpc-error-code' +import type { RpcClient } from '../../transport/rpc/rpc-client-contract' +import { isRpcDeliveryUnknown } from '../../transport/rpc/rpc-delivery-ambiguity' +import { readNewWorktreeRuntimeCapabilities } from '../../tasks/worktree-create-capability' +import { createWorktreeWithNameRetry } from '../../tasks/worktree-create-retry' + +// The host's refusal before creating, when the repo asks to run or skip setup; desktop matches the same text. +const SETUP_DECISION_REQUIRED = 'Setup decision required for this repository' + +// How long a created or unconfirmed card stays busy waiting for the list; the outcome itself is kept until it shows. +const HELD_BUSY_MS = 15_000 + +/** One repository of one folder on one host. */ +export type FolderRepoTarget = { + hostId: string + /** The folder's server; undefined for the paired desktop's own. */ + executionHost: string | undefined + /** `folder:`. */ + folderWorktreeId: string + repoId: string +} + +type Phase = + /** The direct exact-name create is out. */ + | 'creating' + /** Refused before creating; a composer for it is open and nothing has been sent from it. */ + | 'composing' + /** The composer sent its create. */ + | 'submitting' + /** Created, or possibly created: kept until the folder's members show it. */ + | 'held' + +/** + * `name` is the exact name a direct create was sent as, so an unresolved one is retried as itself. + * A composer's create may have used another name or branch, so it is never resent from a card. + */ +type Operation = FolderRepoTarget & { + id: number + phase: Phase + busy: boolean + name: string + origin: 'direct' | 'composer' +} + +// In memory and shared across screens, so a remount or a reopened composer can't send a second create. +const operations = new Map() +const listeners = new Set<() => void>() +let nextId = 1 +let version = 0 + +function notify(): void { + version += 1 + listeners.forEach((listener) => listener()) +} + +export function folderRepoCreateKey(target: FolderRepoTarget): string { + return [target.hostId, target.executionHost ?? '', target.folderWorktreeId, target.repoId].join( + '\0' + ) +} + +export function subscribeFolderRepoCreates(listener: () => void): () => void { + listeners.add(listener) + return () => listeners.delete(listener) +} + +export function getFolderRepoCreatesVersion(): number { + return version +} + +/** The card shows a spinner and takes no taps while its repository's create is busy. */ +export function isFolderRepoCreateBusy(target: FolderRepoTarget): boolean { + return operations.get(folderRepoCreateKey(target))?.busy === true +} + +function start( + target: FolderRepoTarget, + phase: Phase, + name: string, + origin: Operation['origin'] +): Operation { + const operation = { ...target, id: nextId++, phase, busy: true, name, origin } + operations.set(folderRepoCreateKey(target), operation) + notify() + return operation +} + +function isCurrent(operation: Operation): boolean { + return operations.get(folderRepoCreateKey(operation))?.id === operation.id +} + +function release(operation: Operation): void { + if (isCurrent(operation)) { + operations.delete(folderRepoCreateKey(operation)) + notify() + } +} + +function hold(operation: Operation, busy = true): number | undefined { + if (!isCurrent(operation)) { + return undefined + } + // A new identity, so an earlier hold's timer can't end this one. + const held = { ...operation, id: nextId++, phase: 'held' as const, busy } + operations.set(folderRepoCreateKey(held), held) + notify() + if (!busy) { + return held.id + } + setTimeout(() => { + if (isCurrent(held)) { + operations.set(folderRepoCreateKey(held), { ...held, busy: false }) + notify() + } + }, HELD_BUSY_MS) + return held.id +} + +/** Whether `hold` is still this repository's unconfirmed direct create, waiting for a setup choice. */ +export function isFolderRepoHoldPending(target: FolderRepoTarget, hold: number): boolean { + const operation = operations.get(folderRepoCreateKey(target)) + return operation?.id === hold && operation.phase === 'held' && operation.origin === 'direct' +} + +/** Forgets created or unconfirmed creates once the folder lists a worktree from that repository on that host. */ +export function reconcileFolderRepoCreates( + folder: Pick, + members: readonly { repoId: string; hostId?: string }[] +): void { + let changed = false + for (const [key, operation] of operations) { + if ( + operation.phase === 'held' && + operation.hostId === folder.hostId && + operation.executionHost === folder.executionHost && + operation.folderWorktreeId === folder.folderWorktreeId && + members.some( + (member) => + member.repoId === operation.repoId && + (member.hostId?.startsWith('runtime:') ? member.hostId : undefined) === + operation.executionHost + ) + ) { + operations.delete(key) + changed = true + } + } + if (changed) { + notify() + } +} + +export type FolderRepoCreateOutcome = + | { kind: 'created'; name: string; warning?: string } + /** Refused before creating: a branch with that name exists, or the repo asks to run or skip setup. The repository stays reserved for the composer. */ + | { kind: 'needs-composer'; reservation: number } + /** The host may have created it: the reply was lost, or a resend was refused as taken. */ + | { kind: 'maybe-created' } + /** An unconfirmed create's resend needs a setup choice; it is resent as the same exact name with it. */ + | { kind: 'needs-setup-choice'; hold: number } + /** A composer's create is unconfirmed: nothing is sent, the folder is checked until it lists it. */ + | { kind: 'checking' } + | { kind: 'failed'; message: string } + | { kind: 'already-running' } + +/** + * Creates a worktree named after the folder in one of its repositories, attached to the folder, the + * way desktop's empty state does. Only for hosts that advertise exact-name creation. + */ +export async function createFolderRepoWorktree(args: { + target: FolderRepoTarget + /** The client that creates: the desktop's own, or scoped to the folder's server. */ + client: RpcClient + name: string + /** Resends this unconfirmed hold without setup; nothing is sent once the folder shows it or it is replaced. */ + skipSetupFor?: number +}): Promise { + const existing = operations.get(folderRepoCreateKey(args.target)) + const staleResend = + args.skipSetupFor !== undefined && !isFolderRepoHoldPending(args.target, args.skipSetupFor) + if (!staleResend && existing && (existing.phase !== 'held' || existing.busy)) { + return { kind: 'already-running' } + } + if (staleResend || existing?.origin === 'composer') { + return { kind: 'checking' } + } + // An unconfirmed create is retried as the same exact name, even after a rename: a taken name may be its own. + const unresolved = existing !== undefined + const name = existing?.name ?? args.name + const operation = start(args.target, 'creating', name, 'direct') + const settleUnresolved = (outcome: FolderRepoCreateOutcome): FolderRepoCreateOutcome => { + hold(operation) + return outcome + } + try { + const result = await createWorktreeWithNameRetry({ + client: args.client, + baseName: name, + // One exact name: a numbered suffix would be a worktree the user didn't ask for. + maxAttempts: 1, + branchIntentSupported: true, + worktreeCreateIdempotency: readNewWorktreeRuntimeCapabilities(args.client).then( + (capabilities) => capabilities?.worktreeCreateIdempotency ?? false + ), + buildParams: (name) => ({ + repo: `id:${args.target.repoId}`, + name, + displayName: name, + displayNameKind: 'user', + branchIntent: 'create-exact', + setupDecision: args.skipSetupFor === undefined ? 'inherit' : 'skip', + parentWorkspace: args.target.folderWorktreeId, + parentWorkspaceOrigin: 'manual' + }) + }) + if (!('error' in result)) { + hold(operation) + return { + kind: 'created', + name: result.name, + ...(result.warning ? { warning: result.warning } : {}) + } + } + const taken = hasRuntimeRpcErrorCode(result.error, WORKTREE_CREATE_EXACT_NAME_TAKEN_CODE) + if (taken && (result.replayed || unresolved)) { + return settleUnresolved({ kind: 'maybe-created' }) + } + const needsSetup = result.error.includes(SETUP_DECISION_REQUIRED) + if (unresolved && needsSetup) { + // That refusal did no git work, but says nothing about the earlier create; it stays unconfirmed. + const held = hold(operation, false) + return held === undefined + ? { kind: 'maybe-created' } + : { kind: 'needs-setup-choice', hold: held } + } + if (unresolved) { + return settleUnresolved({ kind: 'failed', message: result.error }) + } + if (taken || needsSetup) { + const reserved = { ...operation, phase: 'composing' as const } + operations.set(folderRepoCreateKey(reserved), reserved) + notify() + return { kind: 'needs-composer', reservation: reserved.id } + } + release(operation) + return { kind: 'failed', message: result.error } + } catch (error) { + // Delivery unknown: the host may have created it, and a fresh create would be refused as taken. + if (isRpcDeliveryUnknown(error) || unresolved) { + return settleUnresolved({ kind: 'maybe-created' }) + } + release(operation) + return { kind: 'failed', message: error instanceof Error ? error.message : String(error) } + } +} + +/** A composer closed before sending anything gives its repository back. */ +export function releaseFolderComposerReservation( + target: FolderRepoTarget, + reservation: number +): void { + const operation = operations.get(folderRepoCreateKey(target)) + if (operation?.id === reservation && operation.phase === 'composing') { + release(operation) + } +} + +export type FolderComposerSubmission = { + /** `created` and `uncertain` are kept until the folder shows them; `failed` and `cancelled` give the repository back. */ + settle: (outcome: 'created' | 'uncertain' | 'failed' | 'cancelled') => void +} + +/** + * Admits the composer's create for the repository it actually picked, before anything is sent. + * Null while another create for that repository is out. + */ +export function beginFolderComposerSubmission( + target: FolderRepoTarget, + launch: { target: FolderRepoTarget; reservation: number; name: string }, + /** Whether the composer is still open to retry a refused create. */ + formOpen: () => boolean +): FolderComposerSubmission | null { + const key = folderRepoCreateKey(target) + const existing = operations.get(key) + const ownsReservation = + key === folderRepoCreateKey(launch.target) && + existing?.id === launch.reservation && + existing.phase === 'composing' + if (existing && !ownsReservation) { + return null + } + const operation = start(target, 'submitting', launch.name, 'composer') + return { + settle: (outcome) => { + if (outcome === 'created' || outcome === 'uncertain') { + hold(operation) + return + } + // A refusal leaves the form to try again; the reservation is back with the launch's repository. + if (ownsReservation && formOpen() && isCurrent(operation)) { + const reserved = { ...operation, phase: 'composing' as const, id: launch.reservation } + operations.set(key, reserved) + notify() + return + } + release(operation) + } + } +} diff --git a/mobile/src/source-control/folder/folder-source-repos-query.test.ts b/mobile/src/source-control/folder/folder-source-repos-query.test.ts new file mode 100644 index 00000000000..89c1dcda79d --- /dev/null +++ b/mobile/src/source-control/folder/folder-source-repos-query.test.ts @@ -0,0 +1,56 @@ +import { describe, expect, it, vi } from 'vitest' +import { FakeSession } from '../../transport/connection/mobile-endpoint-supervisor-test-fakes' +import { + serverFolderSourceCatalogQuery, + selectFolderSourceRepos +} from './folder-source-repos-query' + +vi.mock('react-native', () => ({ AppState: {} })) + +const GROUP = { + id: 'group-1', + name: 'payments', + parentPath: '/src/payments', + parentGroupId: null, + createdFrom: 'folder', + tabOrder: 0, + isCollapsed: false, + color: null, + createdAt: 1, + updatedAt: 1 +} + +function hostWith(repos: unknown[]): FakeSession { + const client = new FakeSession('connected') + client.sendRequest.mockImplementation(async (method: string) => ({ + id: '1', + ok: true, + result: method === 'repo.list' ? { repos } : { groups: [GROUP] }, + _meta: { runtimeId: 'r' } + })) + return client +} + +const repo = (id: string, path: string) => ({ + id, + path, + displayName: id, + kind: 'git', + badgeColor: 'gray', + addedAt: 1 +}) + +describe('folder source repositories', () => { + it("offers a relayed server's repos in its folder", async () => { + const client = hostWith([repo('api', '/src/payments/api'), repo('elsewhere', '/src/other')]) + const catalog = await serverFolderSourceCatalogQuery.fetch!( + client, + { exec: 'runtime:env-1' }, + {}, + undefined, + { live: false, previousFromStore: false } + ) + + expect(selectFolderSourceRepos(catalog, 'group-1').map((found) => found.id)).toEqual(['api']) + }) +}) diff --git a/mobile/src/source-control/folder/folder-source-repos-query.ts b/mobile/src/source-control/folder/folder-source-repos-query.ts new file mode 100644 index 00000000000..777b3c8fc26 --- /dev/null +++ b/mobile/src/source-control/folder/folder-source-repos-query.ts @@ -0,0 +1,73 @@ +import type { Repo } from '../../../../src/shared/repo-types' +import type { ProjectGroup } from '../../../../src/shared/project-group-types' +import { getFolderSourceRepos } from '../../../../src/shared/folder-workspaces/folder-workspace-source-repos' +import { + LOCAL_EXECUTION_HOST_ID, + getRepoExecutionHostId, + getSshTargetIdForExecutionHost +} from '../../../../src/shared/execution-host' +import { defineHostQuery } from '../../query/host-query' +import type { HostQueryTarget } from '../../query/host-query-key' +import type { RpcClient } from '../../transport/rpc/rpc-client-contract' +import { hostProjectGroupsRead } from '../../worktree/project-sections-operations' +import { listHostRepos, listServerRepos } from '../../worktree/server-repos' + +export type FolderSourceCatalog = { repos: Repo[]; groups: ProjectGroup[] } + +const NO_REPOS: Repo[] = [] + +const fetchFolderSourceCatalog = async ( + client: RpcClient, + target: HostQueryTarget +): Promise => { + const server = target.exec === LOCAL_EXECUTION_HOST_ID ? null : target.exec + const [repos, groupsRead] = await Promise.all([ + server ? listServerRepos(server, client) : listHostRepos(client), + hostProjectGroupsRead.request(client).then((reply) => hostProjectGroupsRead.interpret(reply)) + ]) + if (!repos || !groupsRead.accepted) { + throw new Error('Folder repositories unavailable') + } + // Repos from a server come stamped with it; its groups must match, or the host check drops every repo. + const groups = server + ? groupsRead.value.map((group) => ({ ...group, executionHostId: server })) + : groupsRead.value + return { repos, groups } +} + +/** The paired desktop's own repositories and project groups, re-read when its repos change. */ +export const folderSourceCatalogQuery = defineHostQuery, FolderSourceCatalog>( + { + family: 'folder.sourceCatalog', + fetch: fetchFolderSourceCatalog, + staleTime: 60_000, + refetchOnWindowFocus: true, + signal: { events: ['reposChanged'] } + } +) + +// A relayed server's changes are not signalled, so its reads hold no event stream; focus and refresh read again. +export const serverFolderSourceCatalogQuery = defineHostQuery< + Record, + FolderSourceCatalog +>({ + family: 'folder.sourceCatalog.server', + fetch: fetchFolderSourceCatalog, + staleTime: 60_000, + refetchOnWindowFocus: true +}) + +/** The folder's repositories a worktree can be created in, as desktop's empty state lists them. */ +export function selectFolderSourceRepos( + catalog: FolderSourceCatalog | undefined, + projectGroupId: string | null +): Repo[] { + if (!catalog || !projectGroupId) { + return NO_REPOS + } + const group = catalog.groups.find((candidate) => candidate.id === projectGroupId) ?? null + // Direct SSH hosts can't create worktrees from here (managed hosts route as runtimes). + return getFolderSourceRepos(catalog.repos, catalog.groups, group).filter( + (repo) => !getSshTargetIdForExecutionHost(getRepoExecutionHostId(repo)) + ) +} diff --git a/mobile/src/source-control/folder/mobile-folder-attached-worktrees.ts b/mobile/src/source-control/folder/mobile-folder-attached-worktrees.ts index 5fbae1707b5..6ce2e8040b4 100644 --- a/mobile/src/source-control/folder/mobile-folder-attached-worktrees.ts +++ b/mobile/src/source-control/folder/mobile-folder-attached-worktrees.ts @@ -11,7 +11,7 @@ import { serializeFolderLineage } from './folder-lineage-serialization' /** What a folder list row shows of a host row. */ export type FolderListRow = Pick< Worktree, - 'worktreeId' | 'hostId' | 'repo' | 'displayName' | 'branch' + 'worktreeId' | 'hostId' | 'repoId' | 'repo' | 'displayName' | 'branch' > type FolderLineageRow = MobileLineageRow & Pick @@ -36,6 +36,7 @@ export function toFolderListRow(row: Worktree): FolderListRow { listRow = { worktreeId: row.worktreeId, hostId: row.hostId, + repoId: row.repoId, repo: row.repo, displayName: row.displayName, branch: row.branch diff --git a/mobile/src/source-control/folder/use-folder-create-flow.test.tsx b/mobile/src/source-control/folder/use-folder-create-flow.test.tsx new file mode 100644 index 00000000000..c59d2644858 --- /dev/null +++ b/mobile/src/source-control/folder/use-folder-create-flow.test.tsx @@ -0,0 +1,343 @@ +import { createElement, Fragment } from 'react' +import { act, create, type ReactTestRenderer } from 'react-test-renderer' +import { afterEach, describe, expect, it, vi } from 'vitest' +import { FakeSession } from '../../transport/connection/mobile-endpoint-supervisor-test-fakes' +import { markRpcDeliveryUnknown } from '../../transport/rpc/rpc-delivery-ambiguity' +import type { RpcResponse } from '../../transport/rpc/rpc-wire-types' +import type { NewWorktreeModalProps } from '../../components/new-worktree-modal-types' +import type { FolderListRow } from './mobile-folder-attached-worktrees' +import { isFolderRepoCreateBusy, type FolderRepoTarget } from './folder-repo-worktree-create' +import { useFolderCreateFlow, type FolderCreateRepo } from './use-folder-create-flow' + +const seen = vi.hoisted(() => { + const state: { + composer: NewWorktreeModalProps | null + confirm: { visible: boolean; onConfirm?: () => void; onCancel: () => void } | null + toasts: string[] + haptics: number + } = { composer: null, confirm: null, toasts: [], haptics: 0 } + return state +}) +vi.mock('react-native', () => ({ AppState: {} })) +vi.mock('../../components/NewWorktreeModalController', () => ({ + NewWorktreeModalController: (props: NewWorktreeModalProps) => { + seen.composer = props + return null + } +})) +vi.mock('../../components/ConfirmModal', () => ({ + ConfirmModal: (props: { visible: boolean; onConfirm?: () => void; onCancel: () => void }) => { + seen.confirm = props + return null + } +})) +vi.mock('../../components/TransientToast', () => ({ + TransientToast: () => null, + useTransientToast: () => ({ + message: null, + showToast: (text: string) => seen.toasts.push(text) + }) +})) +vi.mock('../../platform/haptics', () => ({ + triggerSuccess: () => (seen.haptics += 1), + triggerError: () => (seen.haptics += 1) +})) +vi.mock('../../platform/external-link', () => ({ openExternalLink: () => {} })) +vi.mock('../../transport/connection/host-client-hooks', () => ({ + useHostClient: () => ({ client: null, state: 'connected' }) +})) +vi.mock('../../tasks/worktree-create-capability', () => ({ + readNewWorktreeRuntimeCapabilities: async () => ({ worktreeCreateIdempotency: false }) +})) +vi.mock('../../i18n/use-mobile-translation', () => ({ + useMobileTranslation: () => (_key: string, fallback: string) => fallback +})) + +const FOLDER = 'folder:f-1' +const TAKEN = 'Branch payments already exists\nworktree_create_exact_name_taken' +const CREATED: RpcResponse = { + id: '1', + ok: true, + result: { worktree: { id: 'repo::/w/payments', displayName: 'payments' } }, + _meta: { runtimeId: 'r' } +} + +let repoCount = 0 +function repoIn(): { repo: FolderCreateRepo; target: FolderRepoTarget } { + repoCount += 1 + const repoId = `flow-repo-${repoCount}` + return { + repo: { id: repoId, displayName: repoId }, + target: { hostId: 'host-1', executionHost: undefined, folderWorktreeId: FOLDER, repoId } + } +} + +function replying(reply: RpcResponse) { + const client = new FakeSession('connected') + let answer: () => void = () => {} + client.sendRequest.mockReturnValue( + new Promise((resolve) => (answer = () => resolve(reply))) + ) + return { client, answer: () => answer() } +} + +type Flow = ReturnType +let renderer: ReactTestRenderer | null = null + +function mountFlow(refetch: () => void) { + const flow: { current: Flow | null } = { current: null } + let members: FolderListRow[] = [] + function Harness() { + flow.current = useFolderCreateFlow({ + hostId: 'host-1', + folderWorktreeId: FOLDER, + executionHost: undefined, + desktopCapabilities: [], + members, + observing: true, + refetch, + bottomInset: 0 + }) + return createElement(Fragment, null, flow.current.composerElement) + } + act(() => { + renderer = create(createElement(Harness)) + }) + return { + flow, + rerender: (next: FolderListRow[]) => { + members = next + act(() => renderer?.update(createElement(Harness))) + } + } +} + +const composer = (): NewWorktreeModalProps => { + if (!seen.composer) { + throw new Error('the composer never rendered') + } + return seen.composer +} + +afterEach(() => { + vi.useRealTimers() + act(() => renderer?.unmount()) + renderer = null + seen.composer = null + seen.confirm = null + seen.toasts = [] + seen.haptics = 0 +}) + +describe('useFolderCreateFlow', () => { + it("keeps an open form when another repository's create lands", async () => { + const { flow, rerender } = mountFlow(() => {}) + const b = repoIn() + const refusal = replying({ id: '1', ok: false, error: { code: 'x', message: TAKEN } }) + const opening = flow.current!.onCreate(b.repo, b.target, refusal.client, 'payments') + refusal.answer() + await act(() => opening) + expect(composer().folderLaunch?.repoId).toBe(b.target.repoId) + + const a = repoIn() + const creating = replying(CREATED) + const created = flow.current!.onCreate(a.repo, a.target, creating.client, 'payments') + creating.answer() + await act(() => created) + rerender([ + { + worktreeId: 'a-child', + repoId: a.target.repoId, + repo: 'a', + displayName: 'payments', + branch: 'payments' + } + ]) + + expect(composer().visible).toBe(true) + expect(composer().folderLaunch?.repoId).toBe(b.target.repoId) + }) + + it('shows nothing for a create that lands after the screen is left, and still refreshes', async () => { + const refetch = vi.fn() + const { flow } = mountFlow(refetch) + const a = repoIn() + const creating = replying(CREATED) + const created = flow.current!.onCreate(a.repo, a.target, creating.client, 'payments') + + act(() => renderer?.unmount()) + renderer = null + creating.answer() + await created + + expect(refetch).toHaveBeenCalled() + expect(seen.toasts).toEqual([]) + expect(seen.haptics).toBe(0) + }) + + async function openComposer(flow: { current: Flow | null }, repo = repoIn()) { + const refusal = replying({ id: '1', ok: false, error: { code: 'x', message: TAKEN } }) + const opening = flow.current!.onCreate(repo.repo, repo.target, refusal.client, 'payments') + refusal.answer() + await act(() => opening) + return composer() + } + + it("doesn't let an earlier form's close end a newer one", async () => { + const { flow } = mountFlow(() => {}) + const open = () => openComposer(flow) + const first = await open() + act(() => first.onClose()) + const second = await open() + + act(() => first.onClose()) + expect(composer().visible).toBe(true) + expect(composer().folderLaunch?.repoId).toBe(second.folderLaunch?.repoId) + }) + it("shows nothing for an earlier form's create once a newer form is open", async () => { + const { flow } = mountFlow(() => {}) + const first = await openComposer(flow) + act(() => first.onClose()) + const second = await openComposer(flow) + + expect(first.folderLaunch?.submit.presenting()).toBe(false) + act(() => first.onCreated('repo::/w/payments-2', 'payments-2')) + expect(seen.toasts).toEqual([]) + expect(second.folderLaunch?.submit.presenting()).toBe(true) + }) + + it('gives the repository back when the screen is left with an unsent form', async () => { + const { flow } = mountFlow(() => {}) + const repo = repoIn() + await openComposer(flow, repo) + expect(isFolderRepoCreateBusy(repo.target)).toBe(true) + + act(() => renderer?.unmount()) + renderer = null + expect(isFolderRepoCreateBusy(repo.target)).toBe(false) + }) + it('resends an unconfirmed create without setup once the user agrees', async () => { + vi.useFakeTimers({ toFake: ['setTimeout'] }) + const { flow } = mountFlow(() => {}) + const a = repoIn() + const lost = new FakeSession('connected') + lost.sendRequest.mockRejectedValueOnce(markRpcDeliveryUnknown(new Error('connection lost'))) + await act(() => flow.current!.onCreate(a.repo, a.target, lost, 'payments')) + vi.advanceTimersByTime(60_000) + + const retry = new FakeSession('connected') + retry.sendRequest + .mockResolvedValueOnce({ + id: '1', + ok: false, + error: { code: 'x', message: 'Setup decision required for this repository' } + }) + .mockResolvedValueOnce(CREATED) + await act(() => flow.current!.onCreate(a.repo, a.target, retry, 'payments')) + expect(seen.confirm?.visible).toBe(true) + + await act(async () => seen.confirm?.onConfirm?.()) + expect(retry.sendRequest.mock.calls[1]?.[1]).toMatchObject({ + name: 'payments', + branchIntent: 'create-exact', + setupDecision: 'skip' + }) + }) + it("refreshes the folder when a form's create may have landed", async () => { + const refetch = vi.fn() + const { flow } = mountFlow(refetch) + const b = repoIn() + const form = await openComposer(flow, b) + + form.folderLaunch?.submit.begin({ ...b.repo, path: '/w/b' })?.settle('uncertain') + expect(refetch).toHaveBeenCalledTimes(1) + }) + async function setupRefusedRetry(flow: { current: Flow | null }) { + const a = repoIn() + const lost = new FakeSession('connected') + lost.sendRequest.mockRejectedValueOnce(markRpcDeliveryUnknown(new Error('connection lost'))) + await act(() => flow.current!.onCreate(a.repo, a.target, lost, 'payments')) + vi.advanceTimersByTime(60_000) + const retry = replying({ + id: '1', + ok: false, + error: { code: 'x', message: 'Setup decision required for this repository' } + }) + return { a, pending: flow.current!.onCreate(a.repo, a.target, retry.client, 'payments'), retry } + } + + it("doesn't open a setup choice over another form, and the repository can retry after", async () => { + vi.useFakeTimers({ toFake: ['setTimeout'] }) + const { flow } = mountFlow(() => {}) + const { a, pending, retry } = await setupRefusedRetry(flow) + const form = await openComposer(flow) + retry.answer() + await act(() => pending) + + expect(seen.confirm?.visible).toBe(false) + expect(composer().folderLaunch?.repoId).toBe(form.folderLaunch?.repoId) + expect(isFolderRepoCreateBusy(a.target)).toBe(false) + }) + + it("doesn't open a composer over a setup choice, and covers the list while it is open", async () => { + vi.useFakeTimers({ toFake: ['setTimeout'] }) + const { flow } = mountFlow(() => {}) + const { pending, retry } = await setupRefusedRetry(flow) + retry.answer() + await act(() => pending) + expect(seen.confirm?.visible).toBe(true) + expect(flow.current!.covered).toBe(true) + + const b = repoIn() + const refusal = replying({ id: '1', ok: false, error: { code: 'x', message: TAKEN } }) + const opening = flow.current!.onCreate(b.repo, b.target, refusal.client, 'payments') + refusal.answer() + await act(() => opening) + expect(composer().visible).toBe(false) + expect(isFolderRepoCreateBusy(b.target)).toBe(false) + + act(() => seen.confirm?.onCancel()) + expect(flow.current!.covered).toBe(false) + }) + it('closes a setup choice once the folder lists its create, and its stale confirm sends nothing', async () => { + vi.useFakeTimers({ toFake: ['setTimeout'] }) + const { flow, rerender } = mountFlow(() => {}) + const { a, pending, retry } = await setupRefusedRetry(flow) + retry.answer() + await act(() => pending) + const staleConfirm = seen.confirm?.onConfirm + expect(seen.confirm?.visible).toBe(true) + + rerender([ + { + worktreeId: 'a-child', + repoId: a.target.repoId, + repo: 'a', + displayName: 'payments', + branch: 'payments' + } + ]) + expect(seen.confirm?.visible).toBe(false) + await act(async () => staleConfirm?.()) + expect(retry.client.sendRequest).toHaveBeenCalledTimes(1) + expect(seen.composer?.visible).toBe(false) + }) + + it("shows nothing for an older form's create once a setup choice opens, and still refreshes", async () => { + vi.useFakeTimers({ toFake: ['setTimeout'] }) + const refetch = vi.fn() + const { flow } = mountFlow(refetch) + const form = await openComposer(flow) + act(() => form.onClose()) + const { pending, retry } = await setupRefusedRetry(flow) + retry.answer() + await act(() => pending) + expect(seen.confirm?.visible).toBe(true) + refetch.mockClear() + + expect(form.folderLaunch?.submit.presenting()).toBe(false) + act(() => form.onCreated('repo::/w/payments', 'payments')) + expect(seen.toasts).toEqual([]) + expect(refetch).toHaveBeenCalledTimes(1) + }) +}) diff --git a/mobile/src/source-control/folder/use-folder-create-flow.tsx b/mobile/src/source-control/folder/use-folder-create-flow.tsx new file mode 100644 index 00000000000..899a510ea38 --- /dev/null +++ b/mobile/src/source-control/folder/use-folder-create-flow.tsx @@ -0,0 +1,284 @@ +import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react' +import type { Repo } from '../../../../src/shared/repo-types' +import { getRepoExecutionHostId } from '../../../../src/shared/execution-host' +import { ConfirmModal } from '../../components/ConfirmModal' +import { NewWorktreeModalController } from '../../components/NewWorktreeModalController' +import type { MobileWorkspaceRepo } from '../../components/new-worktree-modal-types' +import { TransientToast, useTransientToast } from '../../components/TransientToast' +import { useMobileTranslation } from '../../i18n/use-mobile-translation' +import { openExternalLink } from '../../platform/external-link' +import { triggerError, triggerSuccess } from '../../platform/haptics' +import { useHostClient } from '../../transport/connection/host-client-hooks' +import type { RpcClient } from '../../transport/rpc/rpc-client-contract' +import type { FolderListRow } from './mobile-folder-attached-worktrees' +import { + beginFolderComposerSubmission, + createFolderRepoWorktree, + getFolderRepoCreatesVersion, + isFolderRepoHoldPending, + reconcileFolderRepoCreates, + releaseFolderComposerReservation, + subscribeFolderRepoCreates, + type FolderRepoTarget +} from './folder-repo-worktree-create' + +const NO_LABELS = new Map() + +/** What a create reads of a repository: its id, name and host. */ +export type FolderCreateRepo = Pick + +type SetupChoice = { + /** The unconfirmed create it resends; once that is gone the dialog closes and sends nothing. */ + hold: number + repo: FolderCreateRepo + target: FolderRepoTarget + client: RpcClient + name: string +} + +type ComposerLaunch = { + target: FolderRepoTarget + reservation: number + executionHostId: ReturnType + name: string +} + +/** + * The folder screen's creates: direct exact-name creates, the composer they fall back to, and their + * toasts. Kept above the empty state, so another repository's new card can't close a form being edited. + */ +export function useFolderCreateFlow(args: { + hostId: string + folderWorktreeId: string + /** The folder's server; undefined for the paired desktop's own. */ + executionHost: string | undefined + desktopCapabilities: readonly string[] + members: readonly FolderListRow[] + observing: boolean + refetch: () => void + bottomInset: number +}) { + const { hostId, folderWorktreeId, executionHost, members, observing, refetch } = args + const t = useMobileTranslation() + const { client: desktopClient } = useHostClient(hostId) + const { message, showToast } = useTransientToast() + const [composer, setComposer] = useState(null) + const [setupChoice, setSetupChoice] = useState(null) + // The one form on screen, composer or setup choice. Set as forms open and close, not after render, so + // two answers landing together can't both open one. + const openRef = useRef(null) + // The newest form opened, still set after it closes: an older form's late answer shows nothing over it. + const latestRef = useRef(null) + // Late answers show nothing once this screen is left or covered; the create itself still settles. + const presentingRef = useRef(observing) + useEffect(() => { + presentingRef.current = observing + }, [observing]) + useEffect( + () => () => { + presentingRef.current = false + latestRef.current = null + const open = openRef.current + openRef.current = null + // Left without sending from the form: its repository takes taps again. + if (open && 'reservation' in open) { + releaseFolderComposerReservation(open.target, open.reservation) + } + }, + [] + ) + const presenting = useCallback(() => presentingRef.current, []) + + // A created or unconfirmed create is done once the folder lists a worktree from its repository. + const createsVersion = useSyncExternalStore( + subscribeFolderRepoCreates, + getFolderRepoCreatesVersion + ) + useEffect(() => { + reconcileFolderRepoCreates({ hostId, executionHost, folderWorktreeId }, members) + }, [createsVersion, executionHost, folderWorktreeId, hostId, members]) + + const onCreate = useCallback( + async ( + repo: FolderCreateRepo, + target: FolderRepoTarget, + client: RpcClient, + name: string, + skipSetupFor?: number + ) => { + const outcome = await createFolderRepoWorktree({ target, client, name, skipSetupFor }) + if ( + outcome.kind === 'created' || + outcome.kind === 'maybe-created' || + outcome.kind === 'checking' + ) { + refetch() + } + const opensForm = outcome.kind === 'needs-composer' || outcome.kind === 'needs-setup-choice' + if (opensForm && (!presenting() || openRef.current)) { + // Left, or another form is open: keep that form and leave this repository to try again. + if (outcome.kind === 'needs-composer') { + releaseFolderComposerReservation(target, outcome.reservation) + } + return + } + if (!presenting()) { + return + } + if (outcome.kind === 'created') { + triggerSuccess() + showToast( + outcome.warning ?? + t('sourceControl.folder.created', 'Created worktree {{name}} in {{repo}}', { + name: outcome.name, + repo: repo.displayName + }) + ) + } else if (outcome.kind === 'checking') { + showToast( + t( + 'sourceControl.folder.checking', + 'A worktree from {{repo}} may already have been created. Checking the folder…', + { repo: repo.displayName } + ) + ) + } else if (outcome.kind === 'needs-setup-choice') { + const choice = { hold: outcome.hold, repo, target, client, name } + openRef.current = choice + latestRef.current = choice + setSetupChoice(choice) + } else if (outcome.kind === 'needs-composer') { + const launch = { + target, + reservation: outcome.reservation, + executionHostId: getRepoExecutionHostId(repo), + name + } + openRef.current = launch + latestRef.current = launch + setComposer(launch) + } else if (outcome.kind === 'failed') { + triggerError() + showToast( + outcome.message || + t('sourceControl.folder.createFailed', 'Could not create a worktree in {{repo}}.', { + repo: repo.displayName + }) + ) + } + }, + [presenting, refetch, showToast, t] + ) + + const launch = composer + const presentingLaunch = (opened: ComposerLaunch | null) => + presenting() && opened !== null && latestRef.current === opened + const composerElement = ( + { + const submission = beginFolderComposerSubmission( + { ...launch.target, repoId: repo.id }, + launch, + () => openRef.current === launch + ) + return ( + submission && { + settle: (outcome) => { + submission.settle(outcome) + // A lost reply may have created it: the list shows it, or the form keeps it from being sent twice. + if (outcome === 'uncertain') { + refetch() + } + } + } + ) + }, + presenting: () => presentingLaunch(launch) + } + } + } + : {})} + onCreated={(_worktreeId, createdName, warning) => { + refetch() + if (presentingLaunch(launch)) { + showToast( + warning ?? + t('sourceControl.folder.createdNamed', 'Created worktree {{name}}', { + name: createdName + }) + ) + } + }} + onClose={() => { + // Only this opening's close: an older submission settling can't close a newer form. + if (launch) { + releaseFolderComposerReservation(launch.target, launch.reservation) + if (openRef.current === launch) { + openRef.current = null + } + } + setComposer((current) => (current === launch ? null : current)) + }} + /> + ) + const choice = setupChoice + // Only this dialog's own answer: it closes itself and nothing newer. + const closeChoice = useCallback((closing: SetupChoice | null) => { + if (openRef.current === closing) { + openRef.current = null + } + setSetupChoice((current) => (current === closing ? null : current)) + }, []) + // The folder showed it, or another create replaced it: there is nothing left to retry. + useEffect(() => { + if (choice && !isFolderRepoHoldPending(choice.target, choice.hold)) { + closeChoice(choice) + } + }, [choice, closeChoice, createsVersion]) + const setupChoiceElement = ( + { + if (choice && openRef.current === choice) { + closeChoice(choice) + void onCreate(choice.repo, choice.target, choice.client, choice.name, choice.hold) + } + }} + onCancel={() => closeChoice(choice)} + /> + ) + const toastElement = + return { + onCreate, + /** A form covers the screen: the list under it waits. */ + covered: composer !== null || setupChoice !== null, + composerElement: ( + <> + {composerElement} + {setupChoiceElement} + + ), + toastElement + } +} diff --git a/mobile/src/source-control/mobile-branch-base-ref.ts b/mobile/src/source-control/mobile-branch-base-ref.ts index 49723877146..af5338c8344 100644 --- a/mobile/src/source-control/mobile-branch-base-ref.ts +++ b/mobile/src/source-control/mobile-branch-base-ref.ts @@ -3,7 +3,7 @@ import { refusedRpcMessageOrFallback } from '../transport/rpc/rpc-refusal-messag import { getRepoIdFromWorktreeId } from '../../../src/shared/worktree/id' import { isMobileGitUnavailableReply } from './mobile-git-status' import { repoBaseRefListRead, repoDefaultBaseRefRead } from './mobile-repo-base-ref-operations' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import type { RpcResponse } from '../transport/rpc/rpc-wire-types' import { worktreeSummaryRead } from './mobile-worktree-metadata-operations' import { @@ -18,7 +18,7 @@ export type MobileBranchCompareTarget = { } export async function resolveMobileBranchCompareBaseRef( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, compare?: MobileBranchCompareTarget, // A `worktree.show` reply the caller already asked for, so one open reads the worktree once. @@ -36,7 +36,7 @@ export type MobileBranchBaseRefs = { // Desktop's pair: the compare base can be the upstream, while PRs and rebases target the effective base. export async function resolveMobileBranchBaseRefs( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, compare?: MobileBranchCompareTarget, worktreeShow?: Promise @@ -84,7 +84,7 @@ export async function resolveMobileBranchBaseRefs( } async function readDefaultBaseRef( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, repoId: string ): Promise { const defaultReply = await repoDefaultBaseRefRead.request(client, { repo: `id:${repoId}` }) diff --git a/mobile/src/source-control/mobile-branch-compare-outcome.ts b/mobile/src/source-control/mobile-branch-compare-outcome.ts index ae5ea1d6a01..d7294be1806 100644 --- a/mobile/src/source-control/mobile-branch-compare-outcome.ts +++ b/mobile/src/source-control/mobile-branch-compare-outcome.ts @@ -1,5 +1,5 @@ import { translate } from '../i18n/mobile-i18n' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import { refusedRpcMessageOrFallback } from '../transport/rpc/rpc-refusal-message' import { resolveMobileBranchBaseRefs, @@ -22,7 +22,7 @@ export type BranchCompareAttempt = BranchCompareOutcome & { // Return failures because callers void this load. export async function readBranchCompareOutcome( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, compare?: MobileBranchCompareTarget ): Promise { @@ -40,7 +40,7 @@ export async function readBranchCompareOutcome( } async function readCompare( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, baseRef: string | null ): Promise { diff --git a/mobile/src/source-control/mobile-commit-message-ai.ts b/mobile/src/source-control/mobile-commit-message-ai.ts index d0710dbd32a..11521f5e667 100644 --- a/mobile/src/source-control/mobile-commit-message-ai.ts +++ b/mobile/src/source-control/mobile-commit-message-ai.ts @@ -5,13 +5,13 @@ import { gitGenerateCommitMessageRun, type MobileGenerateCommitMessageResult } from './mobile-git-mutation-operations' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' export type { MobileGenerateCommitMessageResult } // Collapse refusals and malformed payloads to the same failed-generation verdict. export async function requestMobileCommitMessage( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string ): Promise { const reply = await gitGenerateCommitMessageRun.request(client, { @@ -34,7 +34,7 @@ export async function requestMobileCommitMessage( } export async function cancelMobileCommitMessage( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string ): Promise { const reply = await gitCancelGenerateCommitMessageRun.request(client, { diff --git a/mobile/src/source-control/mobile-git-history.ts b/mobile/src/source-control/mobile-git-history.ts index f51514fa65e..e1a5bf7ce2c 100644 --- a/mobile/src/source-control/mobile-git-history.ts +++ b/mobile/src/source-control/mobile-git-history.ts @@ -7,7 +7,7 @@ import type { } from './git-history-reply-schema' import { refusedRpcMessageOrFallback } from '../transport/rpc/rpc-refusal-message' import { gitHistoryRead } from './mobile-git-read-operations' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' export const MOBILE_GIT_HISTORY_PAGE_SIZE = 50 @@ -89,7 +89,7 @@ export type MobileGitHistoryPageRequest = { } export async function fetchMobileGitHistory( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, page?: MobileGitHistoryPageRequest ): Promise { diff --git a/mobile/src/source-control/mobile-hosted-review-create-intent-runner.ts b/mobile/src/source-control/mobile-hosted-review-create-intent-runner.ts index 4d663ce8d19..f57c7d4f0e2 100644 --- a/mobile/src/source-control/mobile-hosted-review-create-intent-runner.ts +++ b/mobile/src/source-control/mobile-hosted-review-create-intent-runner.ts @@ -10,7 +10,7 @@ import { prepareMobileHostedReviewCreateIntent, type MobileHostedReviewCreateIntentProgress } from './mobile-hosted-review-create-intent' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' type RunInput = { branch: string @@ -50,7 +50,7 @@ export function isMobileHostedReviewCommitFailure( } export async function runMobileHostedReviewCreateIntent( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, input: RunInput ): Promise { diff --git a/mobile/src/source-control/mobile-hosted-review-create-intent.ts b/mobile/src/source-control/mobile-hosted-review-create-intent.ts index 93d8a3bb50c..00e33f2943d 100644 --- a/mobile/src/source-control/mobile-hosted-review-create-intent.ts +++ b/mobile/src/source-control/mobile-hosted-review-create-intent.ts @@ -12,7 +12,7 @@ import { stageMobileHostedReviewPaths } from './mobile-hosted-review-git-preparation' import { applyMobileHostedReviewRemotePrerequisite } from './mobile-hosted-review-remote-prerequisite' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' export { mobileHostedReviewCreateIntentProgressMessage } from './hosted-review-copy' @@ -60,7 +60,7 @@ function hasUnresolvedConflicts(status: MobileGitStatusResult | null): boolean { } async function resolvePrefillFromStatus( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, input: Pick, status: MobileGitStatusResult | null @@ -74,7 +74,7 @@ async function resolvePrefillFromStatus( } async function ensureLocalChangesCommitted( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, input: PrepareInput, currentStatus: MobileGitStatusResult | null @@ -211,7 +211,7 @@ async function ensureLocalChangesCommitted( } export async function prepareMobileHostedReviewCreateIntent( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, input: PrepareInput ): Promise { diff --git a/mobile/src/source-control/mobile-hosted-review-git-preparation.ts b/mobile/src/source-control/mobile-hosted-review-git-preparation.ts index 94c4c652a16..b6d1c40d04c 100644 --- a/mobile/src/source-control/mobile-hosted-review-git-preparation.ts +++ b/mobile/src/source-control/mobile-hosted-review-git-preparation.ts @@ -13,7 +13,7 @@ import { } from './mobile-git-mutation-operations' import { gitStatusProjectionRead } from './mobile-git-read-operations' import type { MobileGitStatusResult } from './mobile-git-status' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' export type MobileHostedReviewStatusReadResult = | { ok: true; status: MobileGitStatusResult | null } @@ -22,7 +22,7 @@ export type MobileHostedReviewStatusReadResult = export type MobileHostedReviewMutationResult = { ok: true } | { ok: false; error: string } export async function readMobileHostedReviewGitStatus( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string ): Promise { const reply = await gitStatusProjectionRead.request(client, { worktree: `id:${worktreeId}` }) @@ -71,7 +71,7 @@ async function settleMobileHostedReviewMutation( } export function pushMobileHostedReviewBranch( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, params: RpcSendParams<'git.push'>, fallback: string ): Promise { @@ -83,7 +83,7 @@ export function pushMobileHostedReviewBranch( } export function fastForwardMobileHostedReviewBranch( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string ): Promise { return settleMobileHostedReviewMutation( @@ -97,7 +97,7 @@ export function fastForwardMobileHostedReviewBranch( } export function stageMobileHostedReviewPaths( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, filePaths: string[] ): Promise { @@ -109,7 +109,7 @@ export function stageMobileHostedReviewPaths( } export async function commitMobileHostedReviewStagedChanges( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, message: string ): Promise { diff --git a/mobile/src/source-control/mobile-hosted-review-remote-prerequisite.ts b/mobile/src/source-control/mobile-hosted-review-remote-prerequisite.ts index e3226f56593..d44b7a8acc9 100644 --- a/mobile/src/source-control/mobile-hosted-review-remote-prerequisite.ts +++ b/mobile/src/source-control/mobile-hosted-review-remote-prerequisite.ts @@ -8,7 +8,7 @@ import { pushMobileHostedReviewBranch } from './mobile-hosted-review-git-preparation' import { readBranchCompareOutcome } from './mobile-branch-compare-outcome' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' type RemotePrerequisiteInput = { status: MobileGitStatusResult | null @@ -17,7 +17,7 @@ type RemotePrerequisiteInput = { // Desktop publishes only a branch with commits beyond its base; read them only when that decides it. async function readBranchCommitsAhead( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string ): Promise { const compare = await readBranchCompareOutcome(client, worktreeId) @@ -27,7 +27,7 @@ async function readBranchCommitsAhead( } export async function applyMobileHostedReviewRemotePrerequisite( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, prefill: MobilePrPrefill, input: RemotePrerequisiteInput diff --git a/mobile/src/source-control/mobile-hosted-review-service.ts b/mobile/src/source-control/mobile-hosted-review-service.ts index 46f4f35a546..34c5d7111f6 100644 --- a/mobile/src/source-control/mobile-hosted-review-service.ts +++ b/mobile/src/source-control/mobile-hosted-review-service.ts @@ -11,7 +11,7 @@ import { } from './mobile-hosted-review-operations' import { pushMobileHostedReviewBranch } from './mobile-hosted-review-git-preparation' import { linkMobileHostedReview } from './mobile-pr-link' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' // Mobile ids combine repo::path; hosted-review RPCs need separate selectors. export function mobileRepoSelectorFromWorktreeId(worktreeId: string): string { @@ -30,7 +30,7 @@ export type MobileHostedReviewEligibilityInput = { } export async function fetchMobileHostedReviewEligibility( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, input: MobileHostedReviewEligibilityInput ): Promise { @@ -67,7 +67,7 @@ export type MobileHostedReviewPrefill = { } export async function resolveMobileHostedReviewPrefill( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { branch: string | undefined @@ -166,7 +166,7 @@ export type MobileHostedReviewCreateOutcome = // The form intentionally uses one actionable fallback for all push failures. async function pushMobileBranchBeforeCreate( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string ): Promise<{ ok: true } | { ok: false; error: string }> { const error = translate( @@ -200,7 +200,7 @@ function formatMobileHostedReviewCreateError( } async function finishMobileHostedReviewCreateSuccess( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, input: MobileHostedReviewCreateInput, result: { number: number; url: string }, @@ -221,7 +221,7 @@ async function finishMobileHostedReviewCreateSuccess( } export async function createMobileHostedReview( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, input: MobileHostedReviewCreateInput ): Promise { diff --git a/mobile/src/source-control/mobile-pr-create-draft.ts b/mobile/src/source-control/mobile-pr-create-draft.ts index 66efde5aa68..d2431ffabde 100644 --- a/mobile/src/source-control/mobile-pr-create-draft.ts +++ b/mobile/src/source-control/mobile-pr-create-draft.ts @@ -1,6 +1,6 @@ import { translate } from '../i18n/mobile-i18n' import { refusedRpcMessageOrFallback } from '../transport/rpc/rpc-refusal-message' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import { resolveCreateReviewSeedFromCommits } from '../../../src/shared/source-control/hosted-review/hosted-review-create-seed' import { normalizeCreateReviewBaseSearchResults, @@ -41,7 +41,7 @@ const HOSTED_PROVIDERS: readonly HostedReviewProvider[] = [ // The host's prefill decides provider, base and blockers; the branch's commits seed the text. export async function loadMobilePrCreateDraft( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, input: { branch: string; status: MobileGitStatusResult | null; commitsAhead?: number | null } ): Promise { @@ -84,7 +84,7 @@ function commitBody(message: string | undefined): string { } export async function generateMobilePrFields( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, input: { base: string; title: string; body: string; draft: boolean; provider: string } ): Promise { @@ -116,7 +116,7 @@ export async function generateMobilePrFields( // The host runs one generation per lane, so an abandoned one would delay the next. export async function cancelMobilePrFields( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string ): Promise { const reply = await gitCancelGeneratePullRequestFieldsRun.request(client, { @@ -126,7 +126,7 @@ export async function cancelMobilePrFields( } export async function searchMobilePrBaseRefs( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, query: string ): Promise { diff --git a/mobile/src/source-control/mobile-pr-link.ts b/mobile/src/source-control/mobile-pr-link.ts index ceef26f3649..90b7673f6b8 100644 --- a/mobile/src/source-control/mobile-pr-link.ts +++ b/mobile/src/source-control/mobile-pr-link.ts @@ -2,7 +2,7 @@ import { translate } from '../i18n/mobile-i18n' import type { RpcSendParams } from '../../../src/shared/rpc-contract/rpc-send-params' import { CLEARED_HOSTED_REVIEW_SELECTION_UPDATES } from '../../../src/shared/worktree/hosted-review-links' import { refusedRpcMessageOrFallback } from '../transport/rpc/rpc-refusal-message' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import { worktreeLinkSet, worktreeSummaryRead, @@ -54,7 +54,7 @@ export function buildWorktreeSetHostedReviewLinkParams( // Refusal without a message uses screen copy; transport errors retain their own message. async function setWorktreeReviewLink( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, params: RpcSendParams<'worktree.set'>, fallback: string ): Promise { @@ -73,7 +73,7 @@ async function setWorktreeReviewLink( } export function linkMobilePr( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, prNumber: number ): Promise { @@ -88,7 +88,7 @@ export function linkMobilePr( } export async function linkMobileHostedReview( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, provider: string, number: number, @@ -108,7 +108,7 @@ export async function linkMobileHostedReview( // Like desktop, suppress the unlinked PR so branch discovery does not bring it straight back. export function unlinkMobilePr( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, prNumber: number ): Promise { @@ -130,7 +130,7 @@ const NO_GITHUB_PR_LINK: WorktreeGitHubPRLink = { // Desktop's durable clear for a link the branch has moved past; a failed write only repeats the check next load. export async function clearMobileWorktreeReviewLink( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, shouldApply: (worktree: MobileWorktreeSummary) => boolean ): Promise { @@ -151,14 +151,14 @@ export async function clearMobileWorktreeReviewLink( // Persisted links recover closed/merged PRs that branch lookup no longer returns. export async function fetchWorktreeGitHubPRLink( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string ): Promise { return (await readWorktreeSummary(client, worktreeId)) ?? NO_GITHUB_PR_LINK } async function readWorktreeSummary( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string ): Promise { try { diff --git a/mobile/src/source-control/review/github-pr-draft-mutations.ts b/mobile/src/source-control/review/github-pr-draft-mutations.ts index 0839693ff53..58326da4894 100644 --- a/mobile/src/source-control/review/github-pr-draft-mutations.ts +++ b/mobile/src/source-control/review/github-pr-draft-mutations.ts @@ -1,11 +1,11 @@ -import type { RpcOperationSender } from '../../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../../transport/rpc/unvalidated-rpc-request-port' import { githubPrRequestParams, type GitHubPrRepoSlug } from './github-pr-repo-slug' import { githubPrDraftMark, githubPrReadyForReviewMark } from './github-pr-mutation-operations' import { settleGithubPrMutation, type GitHubPrMutationOutcome } from './github-pr-mutation-outcome' // Ready for review and Mark as draft: the same toggle on GitHub, one RPC each. export function fetchMarkPRReadyForReview( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number; prRepo?: GitHubPrRepoSlug | null } ): Promise { @@ -23,7 +23,7 @@ export function fetchMarkPRReadyForReview( } export function fetchMarkPRDraft( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number; prRepo?: GitHubPrRepoSlug | null } ): Promise { diff --git a/mobile/src/source-control/review/github-pr-mutations.ts b/mobile/src/source-control/review/github-pr-mutations.ts index d31ed5f29f1..0c2ba0cd587 100644 --- a/mobile/src/source-control/review/github-pr-mutations.ts +++ b/mobile/src/source-control/review/github-pr-mutations.ts @@ -24,11 +24,11 @@ import { githubPrRequestParams, type GitHubPrRepoSlug } from './github-pr-repo-slug' -import type { RpcOperationSender } from '../../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../../transport/rpc/unvalidated-rpc-request-port' import { translate } from '../../i18n/mobile-i18n' export function fetchMergePR( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number; method?: GitHubPRMergeMethod; prRepo?: GitHubPrRepoSlug | null } ): Promise { @@ -47,7 +47,7 @@ export function fetchMergePR( } export function fetchUpdatePRTitle( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number; title: string; prRepo?: GitHubPrRepoSlug | null } ): Promise { @@ -66,7 +66,7 @@ export function fetchUpdatePRTitle( } export function fetchUpdatePRBody( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number; body: string; prRepo?: GitHubPrRepoSlug | null } ): Promise { @@ -81,7 +81,7 @@ export function fetchUpdatePRBody( } export function fetchSetPRAutoMerge( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number @@ -105,7 +105,7 @@ export function fetchSetPRAutoMerge( } export function fetchUpdatePRState( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number; state: 'open' | 'closed'; prRepo?: GitHubPrRepoSlug | null } ): Promise { @@ -123,7 +123,7 @@ export function fetchUpdatePRState( } export function fetchRequestPRReviewers( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number; reviewers: string[]; prRepo?: GitHubPrRepoSlug | null } ): Promise { @@ -141,7 +141,7 @@ export function fetchRequestPRReviewers( } export function fetchRemovePRReviewers( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number; reviewers: string[]; prRepo?: GitHubPrRepoSlug | null } ): Promise { @@ -159,7 +159,7 @@ export function fetchRemovePRReviewers( } export function fetchRerunPRChecks( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number @@ -186,7 +186,7 @@ export function fetchRerunPRChecks( } export function fetchAddPRReviewCommentReply( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number @@ -223,7 +223,7 @@ export function fetchAddPRReviewCommentReply( } export function fetchAddIssueComment( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number; body: string; prRepo?: GitHubPrRepoSlug | null } ): Promise { @@ -244,7 +244,7 @@ export function fetchAddIssueComment( // Thread resolution returns boolean confirmation; do not apply status-envelope void-success semantics. export function fetchResolveReviewThread( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { threadId: string; resolve: boolean; prRepo?: GitHubPrRepoSlug | null } ): Promise { @@ -269,7 +269,7 @@ export function fetchResolveReviewThread( // Issue comment edits use owner/repo/commentId rather than worktree-scoped params. export function fetchUpdateIssueComment( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, args: { owner: string; repo: string; host?: string; commentId: number; body: string } ): Promise { return settleGithubPrMutation(githubPrIssueCommentEdit, () => @@ -282,7 +282,7 @@ export function fetchUpdateIssueComment( } export function fetchDeleteIssueComment( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, args: { owner: string; repo: string; host?: string; commentId: number } ): Promise { return settleGithubPrMutation(githubPrIssueCommentDelete, () => diff --git a/mobile/src/source-control/review/github-pr-review-line-mutations.ts b/mobile/src/source-control/review/github-pr-review-line-mutations.ts index a7ccdc46fde..574ef37470a 100644 --- a/mobile/src/source-control/review/github-pr-review-line-mutations.ts +++ b/mobile/src/source-control/review/github-pr-review-line-mutations.ts @@ -5,14 +5,14 @@ import { type GitHubPrMutationOutcome } from './github-pr-mutation-outcome' import { githubPrRequestParams, type GitHubPrRepoSlug } from './github-pr-repo-slug' -import type { RpcOperationSender } from '../../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../../transport/rpc/unvalidated-rpc-request-port' import { translate } from '../../i18n/mobile-i18n' // The diff screen's writes on a PR file: a new line comment and its viewed mark. // A new line comment on the PR's head commit; GitHub only accepts lines inside the file's diff hunks. export function fetchAddPRReviewComment( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number @@ -45,7 +45,7 @@ export function fetchAddPRReviewComment( } export function fetchSetPRFileViewed( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { pullRequestId: string diff --git a/mobile/src/source-control/review/github-pr-rpc.ts b/mobile/src/source-control/review/github-pr-rpc.ts index 0b46be0adc6..5c5e340a562 100644 --- a/mobile/src/source-control/review/github-pr-rpc.ts +++ b/mobile/src/source-control/review/github-pr-rpc.ts @@ -28,7 +28,7 @@ import { } from './github-pr-read-operations' import type { GitHubPrSettleableOperation } from './github-pr-mutation-outcome' import { githubPrRequestParams, type GitHubPrRepoSlug } from './github-pr-repo-slug' -import type { RpcOperationSender } from '../../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../../transport/rpc/unvalidated-rpc-request-port' import { translate } from '../../i18n/mobile-i18n' export type GitHubPrReadOutcome = { ok: true; result: T } | { ok: false; error: string } @@ -64,7 +64,7 @@ async function settleGithubPrRead( // Gate the PR icon on a GitHub remote independently of whether this branch has an open PR. export function fetchGithubRepoSlug( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string ): Promise> { return settleGithubPrRead(githubPrRepoSlugRead, () => @@ -76,7 +76,7 @@ export function fetchGithubRepoSlug( } export function fetchHostedReviewForBranch( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { branch: string; linkedGitHubPR?: number | null } ): Promise> { @@ -94,7 +94,7 @@ export function fetchHostedReviewForBranch( // Raise decoded upstream-error here so the sidebar retains host text; it is not a protocol decode failure. export async function fetchPRForBranch( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { branch: string @@ -224,7 +224,7 @@ export async function fetchWorkItemDetails( } export function fetchPRChecks( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { prNumber: number @@ -251,7 +251,7 @@ export function fetchPRChecks( } export function fetchPRCheckDetails( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, worktreeId: string, args: { checkRunId?: number diff --git a/mobile/src/source-control/review/mobile-diff-lines.test.ts b/mobile/src/source-control/review/mobile-diff-lines.test.ts new file mode 100644 index 00000000000..4f1514b71bf --- /dev/null +++ b/mobile/src/source-control/review/mobile-diff-lines.test.ts @@ -0,0 +1,26 @@ +import { describe, expect, it } from 'vitest' +import { buildMobileDiffLines } from './mobile-diff-lines' + +describe('buildMobileDiffLines', () => { + it('shows only the edited lines of a file too large for the LCS table', () => { + const original = Array.from({ length: 450 }, (_, index) => `line-${index + 1}`) + const modified = ['changed-first', ...original.slice(1, -1), 'changed-last'] + + const { lines, truncated } = buildMobileDiffLines( + `${original.join('\n')}\n`, + `${modified.join('\n')}\n` + ) + + expect(truncated).toBe(false) + expect(lines).toHaveLength(452) + expect(lines.slice(0, 3)).toEqual([ + { kind: 'delete', text: 'line-1', oldLineNumber: 1 }, + { kind: 'add', text: 'changed-first', newLineNumber: 1 }, + { kind: 'context', text: 'line-2', oldLineNumber: 2, newLineNumber: 2 } + ]) + expect(lines.slice(-2)).toEqual([ + { kind: 'delete', text: 'line-450', oldLineNumber: 450 }, + { kind: 'add', text: 'changed-last', newLineNumber: 450 } + ]) + }) +}) diff --git a/mobile/src/source-control/review/mobile-diff-lines.ts b/mobile/src/source-control/review/mobile-diff-lines.ts index d3652de8b96..aa6c0b27c9e 100644 --- a/mobile/src/source-control/review/mobile-diff-lines.ts +++ b/mobile/src/source-control/review/mobile-diff-lines.ts @@ -1,3 +1,5 @@ +import { diffArrays, type ArrayChange } from 'diff' + export type MobileDiffLineKind = 'context' | 'add' | 'delete' export type MobileDiffLine = { @@ -8,6 +10,9 @@ export type MobileDiffLine = { } const MAX_DIFF_CELLS = 200_000 +// Why: Myers cost grows with the edit count; past this a mass rewrite falls back +// to prefix/suffix, at about the cost of a full-size LCS table on Hermes. +const MAX_EDIT_LENGTH = 250 const MAX_MOBILE_DIFF_LINES = 2_500 const MAX_BUILT_DIFF_LINES = MAX_MOBILE_DIFF_LINES + 1 const TRUNCATED_LINE: MobileDiffLine = { @@ -29,12 +34,12 @@ export function buildMobileDiffLines( const modifiedKeys = options?.ignoreTrimWhitespace ? modifiedLines.map((line) => line.trim()) : modifiedLines - // Why: the LCS table is quadratic. Large generated files still need a - // responsive mobile preview, so fall back to prefix/suffix diffing. + // Why: the LCS table is quadratic, so large files use a Myers diff bounded by + // edit count, which keeps small edits in big files exact. const lines = originalLines.length * modifiedLines.length <= MAX_DIFF_CELLS ? buildLcsDiffLines(originalLines, modifiedLines, originalKeys, modifiedKeys) - : buildPrefixSuffixDiffLines(originalLines, modifiedLines, originalKeys, modifiedKeys) + : buildBoundedMyersDiffLines(originalLines, modifiedLines, originalKeys, modifiedKeys) return finalizeMobileDiffLines(lines) } @@ -141,6 +146,61 @@ function buildLcsDiffLines( return lines } +function buildBoundedMyersDiffLines( + originalLines: string[], + modifiedLines: string[], + originalKeys: string[], + modifiedKeys: string[] +): MobileDiffLine[] { + const changes = diffArrays(originalKeys, modifiedKeys, { maxEditLength: MAX_EDIT_LENGTH }) + return changes + ? buildChangeDiffLines(changes, originalLines, modifiedLines) + : buildPrefixSuffixDiffLines(originalLines, modifiedLines, originalKeys, modifiedKeys) +} + +function buildChangeDiffLines( + changes: ArrayChange[], + originalLines: string[], + modifiedLines: string[] +): MobileDiffLine[] { + const lines: MobileDiffLine[] = [] + let originalIndex = 0 + let modifiedIndex = 0 + for (const change of changes) { + for (let i = 0; i < change.count; i += 1) { + let line: MobileDiffLine + if (change.removed) { + line = { + kind: 'delete', + text: originalLines[originalIndex] ?? '', + oldLineNumber: originalIndex + 1 + } + originalIndex += 1 + } else if (change.added) { + line = { + kind: 'add', + text: modifiedLines[modifiedIndex] ?? '', + newLineNumber: modifiedIndex + 1 + } + modifiedIndex += 1 + } else { + line = { + kind: 'context', + text: modifiedLines[modifiedIndex] ?? '', + oldLineNumber: originalIndex + 1, + newLineNumber: modifiedIndex + 1 + } + originalIndex += 1 + modifiedIndex += 1 + } + if (!appendDiffLine(lines, line)) { + return lines + } + } + } + return lines +} + function buildPrefixSuffixDiffLines( originalLines: string[], modifiedLines: string[], diff --git a/mobile/src/source-control/review/mobile-review-notes-operations.ts b/mobile/src/source-control/review/mobile-review-notes-operations.ts index ed7d8688140..3a70976f334 100644 --- a/mobile/src/source-control/review/mobile-review-notes-operations.ts +++ b/mobile/src/source-control/review/mobile-review-notes-operations.ts @@ -1,11 +1,7 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rpc/rpc-operation' import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' import { sessionWorktreeRecordSchema } from '../../worktree/session-worktree-record-reply-schema' -import '../../files/session-documents/mobile-markdown-tab-reply-schema' import '../../terminal/terminal-reply-schema' -import '../../terminal/session/mobile-session-terminal-reply-schema' -import '../../session/tabs/mobile-session-tab-write-reply-schema' -import '../../transport/rpc/rpc-uninterpreted-reply-schemas' import '../../terminal/quick-commands/mobile-quick-command-operations' // Preserve host refusal text for optimistic rollback; the reply's record carries the host's merged notes. diff --git a/mobile/src/source-control/review/pr-check-observation-contract.ts b/mobile/src/source-control/review/pr-check-observation-contract.ts index 432cbd30dab..761c6486c7a 100644 --- a/mobile/src/source-control/review/pr-check-observation-contract.ts +++ b/mobile/src/source-control/review/pr-check-observation-contract.ts @@ -1,7 +1,9 @@ import * as z from 'zod' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' -import type { SendRequestOptions } from '../../transport/rpc/unvalidated-rpc-request-port' -import type { RpcOperationSender } from '../../transport/rpc/rpc-operation-sender' +import type { + SendRequestOptions, + UnvalidatedRpcRequestPort +} from '../../transport/rpc/unvalidated-rpc-request-port' import { captureGitHubInvocation, supportsExactGitHubOperations } from './github-target-invocation' import { readRuntimeStatusProbe, @@ -97,7 +99,7 @@ function statusFor(client: RpcClient, refresh: boolean): Promise { const { worktreeId, prRepo, write } = vars diff --git a/mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts b/mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts index 0850cb6d148..503eec21acc 100644 --- a/mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts +++ b/mobile/src/source-control/review/use-mobile-diff-review-send-actions.ts @@ -11,7 +11,7 @@ import { reviewTerminalListRead, reviewTerminalSendRun } from './mobile-review-t import type { MobileReviewTerminalTab } from './review-terminal-reply-schema' import { launchAgentWithPrompt } from './pr-ai-triage-launch' import { interpretOrThrowRefusalMessage } from '../../transport/rpc/rpc-refusal-message' -import { healMobileNativeChatStaleInput } from '../../session/native-chat/mobile-native-chat-stale-input' +import { healMobileNativeChatStaleInput } from '../../session/native-chat/composer/mobile-native-chat-stale-input' import type { ReviewScreenState } from './mobile-diff-review-screen-model' import type { ReviewSheetIntents } from './mobile-diff-review-sheets' diff --git a/mobile/src/source-control/review/use-mobile-pr-actions.ts b/mobile/src/source-control/review/use-mobile-pr-actions.ts index 2bd5b017177..740864512d4 100644 --- a/mobile/src/source-control/review/use-mobile-pr-actions.ts +++ b/mobile/src/source-control/review/use-mobile-pr-actions.ts @@ -12,7 +12,7 @@ import { } from './github-pr-mutations' import { fetchMarkPRDraft, fetchMarkPRReadyForReview } from './github-pr-draft-mutations' import type { GitHubPrRepoSlug } from './github-pr-repo-slug' -import type { RpcOperationSender } from '../../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../../transport/rpc/unvalidated-rpc-request-port' import { PrActionsEngine, type PrActionBusyKey } from './pr-actions-engine' import './pr-action-mutation-contract' import type { PrActionMutations } from './pr-action-mutation-contract' @@ -28,7 +28,7 @@ export type PrActionsInput = { mutations?: PrActionMutations } -function realMutations(client: RpcOperationSender, worktreeId: string): PrActionMutations { +function realMutations(client: UnvalidatedRpcRequestPort, worktreeId: string): PrActionMutations { return { mergePR: (args) => fetchMergePR(client, worktreeId, args), setPRAutoMerge: (args) => fetchSetPRAutoMerge(client, worktreeId, args), diff --git a/mobile/src/tasks/blank-workspace-create.ts b/mobile/src/tasks/blank-workspace-create.ts index 5cffd77a7db..05ad977ad21 100644 --- a/mobile/src/tasks/blank-workspace-create.ts +++ b/mobile/src/tasks/blank-workspace-create.ts @@ -1,6 +1,10 @@ import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { RpcClient } from '../transport/rpc/rpc-client-contract' -import { createWorktreeWithNameRetry, type WorktreeCreateResult } from './worktree-create-retry' +import { + createWorktreeWithNameRetry, + type WorktreeCreateParent, + type WorktreeCreateResult +} from './worktree-create-retry' import type { WorktreeCreateAgentLaunch } from './agent-launch-request' import type { WorktreeCreateIdempotencyProbe } from './worktree-create-idempotency-policy' import { @@ -20,6 +24,7 @@ export async function createBlankWorkspace(args: { nameWasGenerated: boolean worktreeCreateIdempotency: WorktreeCreateIdempotencyProbe agentLaunchSupported: WorktreeCreateAgentLaunch['supported'] + parent?: WorktreeCreateParent }): Promise { const agentLaunch: WorktreeCreateAgentLaunch | undefined = args.createdWithAgentId ? { agent: args.createdWithAgentId, supported: args.agentLaunchSupported } @@ -28,6 +33,7 @@ export async function createBlankWorkspace(args: { client: args.client, baseName: args.baseName, nameWasGenerated: args.nameWasGenerated, + parent: args.parent, worktreeCreateIdempotency: args.worktreeCreateIdempotency, ...(agentLaunch ? { agentLaunch } : {}), buildParams: (name) => { diff --git a/mobile/src/tasks/composer-work-item-task.ts b/mobile/src/tasks/composer-work-item-task.ts new file mode 100644 index 00000000000..faaa71adb3b --- /dev/null +++ b/mobile/src/tasks/composer-work-item-task.ts @@ -0,0 +1,55 @@ +import type { MobileLinkedWorkItem } from './mobile-composer-source-types' +import type { WorkspaceCreateTaskItem } from './workspace-create-params' + +/** The composer's linked issue, PR or ticket, as the host's task-workspace source. */ +export function toTaskItem( + item: MobileLinkedWorkItem, + targetRepoId: string +): WorkspaceCreateTaskItem { + if (item.provider === 'github') { + return { + provider: 'github', + source: { + type: item.type === 'pr' ? 'pr' : 'issue', + repoId: item.repoId ?? targetRepoId, + number: item.number, + title: item.title, + url: item.url + } + } + } + if (item.provider === 'gitlab') { + return { + provider: 'gitlab', + source: { + type: item.type === 'mr' ? 'mr' : 'issue', + repoId: item.repoId ?? targetRepoId, + number: item.number, + title: item.title, + url: item.url + } + } + } + if (item.provider === 'jira') { + return { + provider: 'jira', + source: { + key: item.jiraIdentifier ?? '', + title: item.title, + url: item.url + } + } + } + return { + provider: 'linear', + source: { + identifier: item.linearIdentifier ?? '', + title: item.title, + url: item.url, + ...(item.linearWorkspaceId ? { workspaceId: item.linearWorkspaceId } : {}), + ...(item.linearOrganizationUrlKey + ? { organizationUrlKey: item.linearOrganizationUrlKey } + : {}) + } + } +} diff --git a/mobile/src/tasks/jira-mobile-connection.ts b/mobile/src/tasks/jira-mobile-connection.ts index 0bd5fefac7b..d461d07d48c 100644 --- a/mobile/src/tasks/jira-mobile-connection.ts +++ b/mobile/src/tasks/jira-mobile-connection.ts @@ -1,5 +1,5 @@ import type { JiraSite, JiraSiteSelection } from '../../../src/shared/jira/jira-types' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import type { RpcResponse } from '../transport/rpc/rpc-wire-types' import { jiraConnectionStatusSchema } from './jira-reply-schema' import { jiraConnectionStatusProbe, jiraConnectionStatusRead } from './mobile-jira-operations' @@ -88,7 +88,7 @@ function resolveJiraSiteSelection( // Explicit refreshes surface failures instead of presenting a setup prompt. export async function readJiraConnection( - client: RpcOperationSender + client: UnvalidatedRpcRequestPort ): Promise { return extractJiraConnection( jiraConnectionStatusRead.interpret(await jiraConnectionStatusRead.request(client)) diff --git a/mobile/src/tasks/jira-mobile-url-lookup.test.ts b/mobile/src/tasks/jira-mobile-url-lookup.test.ts index 22a2163fd24..30c5e2cbee9 100644 --- a/mobile/src/tasks/jira-mobile-url-lookup.test.ts +++ b/mobile/src/tasks/jira-mobile-url-lookup.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import type { JiraIssue, JiraSite } from '../../../src/shared/jira/jira-types' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import { lookupJiraIssueByUrl } from './jira-mobile-url-lookup' const acme: JiraSite = { @@ -29,7 +29,7 @@ function issue(overrides: Partial = {}): JiraIssue { } } -function clientReturning(result: unknown, sendRequest = vi.fn()): RpcOperationSender { +function clientReturning(result: unknown, sendRequest = vi.fn()): UnvalidatedRpcRequestPort { sendRequest.mockResolvedValue({ ok: true, result }) return { sendRequest } } diff --git a/mobile/src/tasks/jira-mobile-url-lookup.ts b/mobile/src/tasks/jira-mobile-url-lookup.ts index e2155e6b330..0db57d4197b 100644 --- a/mobile/src/tasks/jira-mobile-url-lookup.ts +++ b/mobile/src/tasks/jira-mobile-url-lookup.ts @@ -4,12 +4,12 @@ import { isResolvedJiraIssueMatch, parseJiraIssueUrl } from '../../../src/shared/jira/jira-issue-url' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import { jiraIssueRead } from './mobile-jira-operations' // Match a connected site before resolving keys that may exist on several sites. export async function lookupJiraIssueByUrl( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, value: string, sites: readonly JiraSite[] ): Promise { diff --git a/mobile/src/tasks/mobile-jira-task-source.ts b/mobile/src/tasks/mobile-jira-task-source.ts index ae640eeede6..f0d44602ffd 100644 --- a/mobile/src/tasks/mobile-jira-task-source.ts +++ b/mobile/src/tasks/mobile-jira-task-source.ts @@ -3,7 +3,7 @@ import type { JiraIssueFilter, JiraSiteSelection } from '../../../src/shared/jira/jira-types' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import { toJiraDetailComments } from './jira-mobile-issue-read' import { jiraIssueCommentsRead, @@ -18,7 +18,7 @@ const DETAIL_TIMEOUT_MS = 30_000 // Raw JQL replaces the selected preset, matching desktop. export async function fetchJiraTaskIssues( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, args: { jql: string; filter: JiraIssueFilter; siteId: JiraSiteSelection | null } ): Promise { const jql = args.jql.trim() @@ -41,7 +41,7 @@ export async function fetchJiraTaskIssues( } export async function fetchJiraIssueDetail( - client: RpcOperationSender, + client: UnvalidatedRpcRequestPort, args: { key: string; siteId?: string } ): Promise<{ issue: JiraIssue; comments: ReturnType }> { const params = { key: args.key, siteId: args.siteId } diff --git a/mobile/src/tasks/mobile-tasks-dependencies.ts b/mobile/src/tasks/mobile-tasks-dependencies.ts index 3ebbcbc47da..6ec046746c3 100644 --- a/mobile/src/tasks/mobile-tasks-dependencies.ts +++ b/mobile/src/tasks/mobile-tasks-dependencies.ts @@ -145,5 +145,6 @@ export type { SshConnectionState } from '../../../src/shared/ssh-types' export { githubProjectHost, - githubProjectIdentityKey as githubProjectKey + githubProjectIdentityKey as githubProjectKey, + toGitHubProjectIdentity } from '../../../src/shared/github/project-identity' diff --git a/mobile/src/tasks/mobile-tasks-github-project-pickers.tsx b/mobile/src/tasks/mobile-tasks-github-project-pickers.tsx index 00972f482c6..56b373428bb 100644 --- a/mobile/src/tasks/mobile-tasks-github-project-pickers.tsx +++ b/mobile/src/tasks/mobile-tasks-github-project-pickers.tsx @@ -13,6 +13,7 @@ import { ActivityIndicator, githubProjectKey, PickerModal, + toGitHubProjectIdentity, type GitHubProjectRef } from './mobile-tasks-dependencies' import { ListGroup, SectionHeader, ListRow } from '../components/list/ListGroup' @@ -253,11 +254,7 @@ export function renderMobileTasksGitHubProjectPicker(model: ConnectionPresentati ...githubProjectSettings, pinned: [ ...githubProjectSettings.pinned, - { - owner: project.owner, - ownerType: project.ownerType, - number: project.number - } + toGitHubProjectIdentity(project) ].slice(0, 20) }) ) @@ -284,7 +281,7 @@ export function renderMobileTasksGitHubProjectPicker(model: ConnectionPresentati ) : ( {browseGitHubProjects.map((project) => - projectRow(project.id, project, project.title, undefined) + projectRow(`browse:${githubProjectKey(project)}`, project, project.title, undefined) )} )} @@ -295,20 +292,21 @@ export function renderMobileTasksGitHubProjectPicker(model: ConnectionPresentati } export function renderMobileTasksGitHubProjectViewPicker(model: ConnectionPresentationModel) { + const pending = model.pendingGitHubProjectViewSelection return ( { - const view = model.githubProjectViews.find((candidate) => candidate.id === viewId) + const view = (pending?.views ?? model.githubProjectViews).find( + (candidate) => candidate.id === viewId + ) if (view && view.layout !== 'TABLE_LAYOUT') { model.setGithubProjectError( translate( @@ -318,8 +316,8 @@ export function renderMobileTasksGitHubProjectViewPicker(model: ConnectionPresen ) return } - if (model.pendingGitHubProjectViewSelection) { - model.commitGitHubProjectView(model.pendingGitHubProjectViewSelection, viewId) + if (pending) { + model.commitGitHubProjectView(pending.project, viewId, pending.views) model.setPendingGitHubProjectViewSelection(null) return } @@ -330,7 +328,7 @@ export function renderMobileTasksGitHubProjectViewPicker(model: ConnectionPresen }} onClose={() => { model.setShowGitHubProjectViewPicker(false) - if (model.pendingGitHubProjectViewSelection) { + if (pending) { model.setPendingGitHubProjectViewSelection(null) } }} diff --git a/mobile/src/tasks/mobile-tasks-host-subtitle.tsx b/mobile/src/tasks/mobile-tasks-host-subtitle.tsx index e6cf9004e64..07d2a20cc03 100644 --- a/mobile/src/tasks/mobile-tasks-host-subtitle.tsx +++ b/mobile/src/tasks/mobile-tasks-host-subtitle.tsx @@ -1,7 +1,7 @@ import { StyleSheet, Text } from 'react-native' import { hostScreenStyles } from '../host-screen/host-screen-styles' -import { useHostProfile } from '../transport/hosts/use-host-profile' -import { useHostDisplay } from '../transport/hosts/use-host-display' +import { useHostProfile } from '../host-catalog/use-host-profile' +import { useHostDisplay } from '../host-descriptors/use-host-display' import { useMobileColorScheme } from './mobile-tasks-dependencies' export function MobileTasksHostSubtitle({ hostId }: { hostId: string }) { diff --git a/mobile/src/tasks/mobile-tasks-list-state.tsx b/mobile/src/tasks/mobile-tasks-list-state.tsx index b190e73ba31..35879dcb433 100644 --- a/mobile/src/tasks/mobile-tasks-list-state.tsx +++ b/mobile/src/tasks/mobile-tasks-list-state.tsx @@ -9,8 +9,8 @@ import { } from '../components/MobileStateView' import { useForceReconnect } from '../transport/connection/host-client-hooks' import { isConnectionOutage } from '../transport/connection/connection-health' -import { useHostDisplay } from '../transport/hosts/use-host-display' -import { useHostProfile } from '../transport/hosts/use-host-profile' +import { useHostDisplay } from '../host-descriptors/use-host-display' +import { useHostProfile } from '../host-catalog/use-host-profile' import { spacing } from '../theme/mobile-theme' import { translate } from '../i18n/mobile-i18n' import type { ConnectionPresentationModel } from './use-mobile-tasks-connection-presentation' diff --git a/mobile/src/tasks/source-workspace-create.ts b/mobile/src/tasks/source-workspace-create.ts index d86844b6058..50368bbd580 100644 --- a/mobile/src/tasks/source-workspace-create.ts +++ b/mobile/src/tasks/source-workspace-create.ts @@ -1,20 +1,21 @@ import type { TuiAgent } from '../../../src/shared/agent-launch/catalog/tui-agent' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import { resolveComposerMrBase, resolveComposerPrBase } from './composer-source-base-resolve' -import type { - MobileComposerCreateSelection, - MobileLinkedWorkItem -} from './mobile-composer-source-types' +import type { MobileComposerCreateSelection } from './mobile-composer-source-types' import { resolveMobileWorkspaceCreateName } from './mobile-workspace-name' import type { WorkspaceAgentChoice } from './workspace-agent-selection' +import { toTaskItem } from './composer-work-item-task' import { startupAgentCreateFields, buildTaskWorkspaceCreateParams, type WorkspaceCreateParams, - type WorkspaceCreateSetupDecision, - type WorkspaceCreateTaskItem + type WorkspaceCreateSetupDecision } from './workspace-create-params' -import { createWorktreeWithNameRetry, type WorktreeCreateResult } from './worktree-create-retry' +import { + createWorktreeWithNameRetry, + type WorktreeCreateParent, + type WorktreeCreateResult +} from './worktree-create-retry' import type { WorktreeCreateAgentLaunch } from './agent-launch-request' import type { WorktreeCreateIdempotencyProbe } from './worktree-create-idempotency-policy' import { getClientWorktreeCreateCandidate } from '../../../src/shared/new-workspace/worktree-create-retry-policy' @@ -36,6 +37,7 @@ export type CreateWorkspaceFromComposerArgs = { worktreeCreateIdempotency: WorktreeCreateIdempotencyProbe agentLaunchSupported: WorktreeCreateAgentLaunch['supported'] branchIntentSupported?: boolean | Promise + parent?: WorktreeCreateParent } export async function createWorkspaceFromComposerSource( @@ -57,55 +59,6 @@ function resolveComposerAgentLaunch( return agentId ? { agent: agentId, supported } : undefined } -function toTaskItem(item: MobileLinkedWorkItem, targetRepoId: string): WorkspaceCreateTaskItem { - if (item.provider === 'github') { - return { - provider: 'github', - source: { - type: item.type === 'pr' ? 'pr' : 'issue', - repoId: item.repoId ?? targetRepoId, - number: item.number, - title: item.title, - url: item.url - } - } - } - if (item.provider === 'gitlab') { - return { - provider: 'gitlab', - source: { - type: item.type === 'mr' ? 'mr' : 'issue', - repoId: item.repoId ?? targetRepoId, - number: item.number, - title: item.title, - url: item.url - } - } - } - if (item.provider === 'jira') { - return { - provider: 'jira', - source: { - key: item.jiraIdentifier ?? '', - title: item.title, - url: item.url - } - } - } - return { - provider: 'linear', - source: { - identifier: item.linearIdentifier ?? '', - title: item.title, - url: item.url, - ...(item.linearWorkspaceId ? { workspaceId: item.linearWorkspaceId } : {}), - ...(item.linearOrganizationUrlKey - ? { organizationUrlKey: item.linearOrganizationUrlKey } - : {}) - } - } -} - async function createWorkItemWorkspace(args: { client: RpcClient selection: Extract @@ -116,6 +69,7 @@ async function createWorkItemWorkspace(args: { nameIsAutoManaged?: boolean note: string | undefined worktreeCreateIdempotency: WorktreeCreateIdempotencyProbe + parent?: WorktreeCreateParent }): Promise { const { client, selection, targetRepoId, setupDecision, agent, workspaceName, note } = args const item = selection.item @@ -157,6 +111,7 @@ async function createWorkItemWorkspace(args: { const baseName = String(params.name) // Keep linked work items on terminals: structured sessions cannot hold their unsent URL draft and would submit it as a turn. return createWorktreeWithNameRetry({ + parent: args.parent, client, baseName, worktreeCreateIdempotency: args.worktreeCreateIdempotency, @@ -176,6 +131,7 @@ async function createBranchWorkspace(args: { worktreeCreateIdempotency: WorktreeCreateIdempotencyProbe agentLaunchSupported: WorktreeCreateAgentLaunch['supported'] branchIntentSupported?: boolean | Promise + parent?: WorktreeCreateParent }): Promise { const { client, @@ -206,6 +162,7 @@ async function createBranchWorkspace(args: { fallback: selection.localBranchName }) return createWorktreeWithNameRetry({ + parent: args.parent, client, baseName, worktreeCreateIdempotency: args.worktreeCreateIdempotency, @@ -232,6 +189,7 @@ async function createBranchWorkspace(args: { fallback: selection.branchNameOverride || selection.localBranchName }) return createWorktreeWithNameRetry({ + parent: args.parent, client, baseName, worktreeCreateIdempotency: args.worktreeCreateIdempotency, @@ -270,6 +228,7 @@ async function createNewBranchWorkspace(args: { note: string | undefined worktreeCreateIdempotency: WorktreeCreateIdempotencyProbe agentLaunchSupported: WorktreeCreateAgentLaunch['supported'] + parent?: WorktreeCreateParent }): Promise { const { client, @@ -287,6 +246,7 @@ async function createNewBranchWorkspace(args: { const comment = note?.trim() // Preserve typed git branch names, including slashes; sanitize only the folder, and retry suffixes against the branch name. return createWorktreeWithNameRetry({ + parent: args.parent, client, baseName: selection.branchName, worktreeCreateIdempotency: args.worktreeCreateIdempotency, diff --git a/mobile/src/tasks/use-mobile-tasks-picker-projection.tsx b/mobile/src/tasks/use-mobile-tasks-picker-projection.tsx index c8015b4ea9b..19040fb2808 100644 --- a/mobile/src/tasks/use-mobile-tasks-picker-projection.tsx +++ b/mobile/src/tasks/use-mobile-tasks-picker-projection.tsx @@ -49,6 +49,7 @@ export function useMobileTasksPickerProjection(model: DetailCommentRenderersMode items, jiraConnection, linearTeams, + pendingGitHubProjectViewSelection, provider, reposById, selectedHostedRepos, @@ -223,7 +224,7 @@ export function useMobileTasksPickerProjection(model: DetailCommentRenderersMode ) const githubProjectViewOptions = useMemo[]>( () => - githubProjectViews.map((view) => ({ + (pendingGitHubProjectViewSelection?.views ?? githubProjectViews).map((view) => ({ value: view.id, label: view.name, subtitle: @@ -232,7 +233,7 @@ export function useMobileTasksPickerProjection(model: DetailCommentRenderersMode : t('tasks.pickerProjection.unsupportedLayout', 'Unsupported layout on mobile'), disabled: view.layout !== 'TABLE_LAYOUT' })), - [githubProjectViews, t] + [githubProjectViews, pendingGitHubProjectViewSelection, t] ) return Object.assign(model, { createTargetOptions, diff --git a/mobile/src/tasks/use-mobile-tasks-project-loading-actions.tsx b/mobile/src/tasks/use-mobile-tasks-project-loading-actions.tsx index 3d2d11b60e5..f3555c5400b 100644 --- a/mobile/src/tasks/use-mobile-tasks-project-loading-actions.tsx +++ b/mobile/src/tasks/use-mobile-tasks-project-loading-actions.tsx @@ -8,7 +8,9 @@ import { githubProjectHost, githubProjectKey, parseProjectInput, - useCallback + toGitHubProjectIdentity, + useCallback, + useRef } from './mobile-tasks-dependencies' import type { GitHubProjectTable } from './mobile-tasks-legacy-foundation' import { @@ -47,6 +49,8 @@ export function useMobileTasksProjectLoadingActions(model: TaskPaginationActions taskStateHydrated, tasksSupported } = model + // Each pick bumps this, so a late views reply for an earlier pick cannot overwrite a newer one. + const projectSelectionRef = useRef(0) const loadGitHubProjects = useCallback(async (): Promise => { if (!client || connState !== 'connected' || !tasksSupported) { return @@ -80,9 +84,7 @@ export function useMobileTasksProjectLoadingActions(model: TaskPaginationActions throw new Error(result.error.message) } // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the schema requires the `id` a view is selected by and types `number`/`name`/`layout` without requiring them, because a layout arm this build has not heard of must reach the "no supported views" test rather than drop the row. - const views = result.views as GitHubProjectViewSummary[] - setGithubProjectViews(views) - return views + return result.views as GitHubProjectViewSummary[] }, [client, connState, taskStateHydrated, tasksSupported] ) @@ -153,19 +155,23 @@ export function useMobileTasksProjectLoadingActions(model: TaskPaginationActions ) const commitGitHubProjectView = useCallback( - (project: GitHubProjectRef, viewId: string): void => { - const projectKey = githubProjectKey(project) + (project: GitHubProjectRef, viewId: string, views?: GitHubProjectViewSummary[]): void => { + const ref = toGitHubProjectIdentity(project) + const projectKey = githubProjectKey(ref) const nextSettings: GitHubProjectSettings = { ...githubProjectSettings, recent: [ - { ...project, lastOpenedAt: new Date().toISOString() }, + { ...ref, lastOpenedAt: new Date().toISOString() }, ...githubProjectSettings.recent.filter((entry) => githubProjectKey(entry) !== projectKey) ].slice(0, 10), lastViewByProject: { ...githubProjectSettings.lastViewByProject, [projectKey]: { viewId } }, - activeProject: project + activeProject: ref + } + if (views) { + setGithubProjectViews(views) } persistGitHubProjectSettings(nextSettings) setAppliedGithubProjectSearch(undefined) @@ -180,51 +186,47 @@ export function useMobileTasksProjectLoadingActions(model: TaskPaginationActions if (!tasksSupported || !taskStateHydrated) { return } + const selection = ++projectSelectionRef.current setGithubProjectLoading(true) setGithubProjectError('') try { const views = await loadGitHubProjectViews(project) - const projectKey = githubProjectKey(project) - const rememberedView = githubProjectSettings.lastViewByProject[projectKey]?.viewId + if (selection !== projectSelectionRef.current) { + return + } const explicitView = typeof options.viewNumber === 'number' ? views.find((view) => view.number === options.viewNumber) : undefined - if (options.viewNumber !== undefined && !explicitView) { - // Stale view URLs prompt for a replacement view, matching desktop. - const supportedViews = views.filter((view) => view.layout === 'TABLE_LAYOUT') - if (supportedViews.length === 0) { - throw new Error('This project has no supported views.') - } - setPendingGitHubProjectViewSelection(project) - setShowGitHubProjectViewPicker(true) - return - } if (explicitView && explicitView.layout !== 'TABLE_LAYOUT') { throw new Error("Orca doesn't support this GitHub Project layout yet.") } - if (!explicitView && !rememberedView) { - // Ask for the first Project view; do not silently choose the first table. - const supportedViews = views.filter((view) => view.layout === 'TABLE_LAYOUT') - if (supportedViews.length === 0) { - throw new Error('This project has no supported views.') - } - setPendingGitHubProjectViewSelection(project) - setShowGitHubProjectViewPicker(true) - return - } + // A remembered Board or Roadmap view (desktop renders those) cannot open here. + const rememberedViewId = + options.viewNumber === undefined + ? githubProjectSettings.lastViewByProject[githubProjectKey(project)]?.viewId + : undefined const selectedView = explicitView ?? - views.find((view) => view.id === rememberedView && view.layout === 'TABLE_LAYOUT') ?? - undefined - if (!selectedView) { + views.find((view) => view.id === rememberedViewId && view.layout === 'TABLE_LAYOUT') + if (selectedView) { + commitGitHubProjectView(project, selectedView.id, views) + return + } + if (!views.some((view) => view.layout === 'TABLE_LAYOUT')) { throw new Error('This project has no supported views.') } - commitGitHubProjectView(project, selectedView.id) + // Ask for a view, matching desktop: never silently choose the first table. + setPendingGitHubProjectViewSelection({ project, views }) + setShowGitHubProjectViewPicker(true) } catch (err) { - setGithubProjectError(err instanceof Error ? err.message : 'Failed to select project') + if (selection === projectSelectionRef.current) { + setGithubProjectError(err instanceof Error ? err.message : 'Failed to select project') + } } finally { - setGithubProjectLoading(false) + if (selection === projectSelectionRef.current) { + setGithubProjectLoading(false) + } } }, [ diff --git a/mobile/src/tasks/use-mobile-tasks-workspace-and-project-state.tsx b/mobile/src/tasks/use-mobile-tasks-workspace-and-project-state.tsx index c557bd86ec4..2faf539fc36 100644 --- a/mobile/src/tasks/use-mobile-tasks-workspace-and-project-state.tsx +++ b/mobile/src/tasks/use-mobile-tasks-workspace-and-project-state.tsx @@ -125,8 +125,11 @@ export function useMobileTasksWorkspaceAndProjectState(model: RouteAndItemStateM const [showGitHubProjectPicker, setShowGitHubProjectPicker] = useState(false) const [showGitHubProjectViewPicker, setShowGitHubProjectViewPicker] = useState(false) const [showGitHubProjectFieldsPicker, setShowGitHubProjectFieldsPicker] = useState(false) - const [pendingGitHubProjectViewSelection, setPendingGitHubProjectViewSelection] = - useState(null) + // The project being picked keeps its own views, so cancelling leaves the active project's list intact. + const [pendingGitHubProjectViewSelection, setPendingGitHubProjectViewSelection] = useState<{ + project: GitHubProjectRef + views: GitHubProjectViewSummary[] + } | null>(null) const [projectRowItem, setProjectRowItem] = useState(null) const [projectRowDetail, setProjectRowDetail] = useState(null) const [projectRowDetailLoading, setProjectRowDetailLoading] = useState(false) diff --git a/mobile/src/tasks/use-task-host-repos.ts b/mobile/src/tasks/use-task-host-repos.ts index 2fa9010fd1a..e91ef7df7d3 100644 --- a/mobile/src/tasks/use-task-host-repos.ts +++ b/mobile/src/tasks/use-task-host-repos.ts @@ -1,7 +1,7 @@ import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react' import type { ExecutionHostId } from '../../../src/shared/execution-host' import type { HostContextLabelSources } from '../../../src/shared/worktree/host-context-labels' -import { useHostDescriptor } from '../transport/hosts/host-descriptor-store' +import { useHostDescriptor } from '../host-descriptors/host-descriptor-store' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import type { ConnectionState } from '../transport/connection/connection-state' import { withServerHosts } from '../worktree/server-workspaces' diff --git a/mobile/src/tasks/worktree-create-retry.test.ts b/mobile/src/tasks/worktree-create-retry.test.ts new file mode 100644 index 00000000000..175cd7c9860 --- /dev/null +++ b/mobile/src/tasks/worktree-create-retry.test.ts @@ -0,0 +1,148 @@ +import { describe, expect, it } from 'vitest' +import { FakeSession } from '../transport/connection/mobile-endpoint-supervisor-test-fakes' +import type { RpcClient } from '../transport/rpc/rpc-client-contract' +import type { RpcResponse } from '../transport/rpc/rpc-wire-types' +import { markRpcDeliveryUnknown } from '../transport/rpc/rpc-delivery-ambiguity' + +import { createWorktreeWithNameRetry } from './worktree-create-retry' + +type Attempt = { method: string; params: unknown } + +function scriptedClient( + outcomes: ({ id: string; displayName?: string; warning?: string } | { errorMessage: string })[], + attempts: Attempt[] +): RpcClient { + let call = 0 + const client = new FakeSession('connected') + client.sendRequest.mockImplementation(async (method: string, params?: unknown) => { + attempts.push({ method, params: params ?? {} }) + const outcome = outcomes[Math.min(call, outcomes.length - 1)]! + call += 1 + if ('errorMessage' in outcome) { + return { + id: '1', + ok: false, + error: { code: 'x', message: outcome.errorMessage }, + _meta: { runtimeId: 'r' } + } + } + return { + id: '1', + ok: true, + result: { + worktree: { + id: outcome.id, + ...(outcome.displayName !== undefined ? { displayName: outcome.displayName } : {}) + }, + ...(outcome.warning !== undefined ? { warning: outcome.warning } : {}) + }, + _meta: { runtimeId: 'r' } + } + }) + return client +} + +describe('createWorktreeWithNameRetry parent', () => { + it('attaches every collision candidate to the same parent', async () => { + const attempts: Attempt[] = [] + const client = scriptedClient( + [{ errorMessage: 'already exists locally' }, { id: 'wt-child' }], + attempts + ) + + await createWorktreeWithNameRetry({ + client, + baseName: 'topic', + buildParams: (name) => ({ repo: 'id:r', name }), + parent: { parentWorkspace: 'folder:f-1', parentWorkspaceOrigin: 'manual' }, + worktreeCreateIdempotency: false + }) + + expect(attempts.map((attempt) => attempt.params)).toEqual([ + { + repo: 'id:r', + name: 'topic', + parentWorkspace: 'folder:f-1', + parentWorkspaceOrigin: 'manual' + }, + { + repo: 'id:r', + name: 'topic-2', + parentWorkspace: 'folder:f-1', + parentWorkspaceOrigin: 'manual' + } + ]) + }) +}) + +describe('createWorktreeWithNameRetry after a lost reply', () => { + it('tries no other name when the resend is refused as taken', async () => { + const client = new FakeSession('connected') + client.sendRequest + .mockImplementationOnce(async () => { + client.publishState('reconnecting') + setTimeout(() => client.publishState('connected'), 0) + throw markRpcDeliveryUnknown(new Error('connection lost')) + }) + .mockResolvedValue({ + id: '1', + ok: false, + error: { code: 'x', message: 'already exists locally' }, + _meta: { runtimeId: 'r' } + }) + + const result = await createWorktreeWithNameRetry({ + client, + baseName: 'topic', + buildParams: (name) => ({ repo: 'id:r', name }), + worktreeCreateIdempotency: { dedupeTtlMs: 60_000 } + }) + + expect(result).toMatchObject({ replayed: true }) + expect(client.sendRequest.mock.calls.map(([, params]) => params)).toEqual([ + expect.objectContaining({ name: 'topic' }), + expect.objectContaining({ name: 'topic' }) + ]) + }) + it('tries no other name when a fallback create after a refused agent launch is resent and refused', async () => { + const client = new FakeSession('connected') + const taken: RpcResponse = { + id: '1', + ok: false, + error: { code: 'x', message: 'already exists locally' }, + _meta: { runtimeId: 'r' } + } + client.sendRequest + .mockResolvedValueOnce({ + id: '1', + ok: false, + error: { code: 'method_not_found', message: 'Unknown method' }, + _meta: { runtimeId: 'r' } + }) + .mockImplementationOnce(async () => { + client.publishState('reconnecting') + setTimeout(() => client.publishState('connected'), 0) + throw markRpcDeliveryUnknown(new Error('connection lost')) + }) + .mockResolvedValue(taken) + + const result = await createWorktreeWithNameRetry({ + client, + baseName: 'topic', + buildParams: (name) => ({ repo: 'id:r', name }), + worktreeCreateIdempotency: { dedupeTtlMs: 60_000 }, + agentLaunch: { agent: 'claude', supported: { replay: false } } + }) + + expect(result).toMatchObject({ replayed: true }) + expect(client.sendRequest.mock.calls.map(([method]) => method)).toEqual([ + 'agent.launch', + 'worktree.create', + 'worktree.create' + ]) + expect(client.sendRequest.mock.calls.slice(1).map(([, params]) => params)).toEqual([ + expect.objectContaining({ name: 'topic' }), + expect.objectContaining({ name: 'topic' }) + ]) + }) +}) diff --git a/mobile/src/tasks/worktree-create-retry.ts b/mobile/src/tasks/worktree-create-retry.ts index 943ff260096..187a68096d6 100644 --- a/mobile/src/tasks/worktree-create-retry.ts +++ b/mobile/src/tasks/worktree-create-retry.ts @@ -20,7 +20,7 @@ import { type WorktreeCreateAgentLaunch } from './agent-launch-request' import { isAgentLaunchReplayUnsupportedRefusal } from '../../../src/shared/agent-launch/contracts/agent-launch-replay-refusal' -import { structuredSessionOperationId } from '../session/structured-session-operation-id' +import { structuredSessionOperationId } from '../session/native-chat/agent-session/structured-session-operation-id' import { WORKTREE_CREATE_TIMEOUT_MS } from './workspace-create-timeout' import type { WorkspaceCreateParams } from './workspace-create-params' import type { @@ -35,7 +35,12 @@ import { // Branches and remote PRs outlive worktrees and escape local preflight dedupe; retry host collision errors with numeric suffixes. export type WorktreeCreateResult = | { worktreeId: string; name: string; warning?: string } - | { error: string } + /** `replayed`: the refusal answered a resend after a lost reply, so the first send may have created it. */ + | { error: string; replayed?: true } + +export type WorktreeCreateParent = Required< + Pick +> export type CreateWorktreeWithNameRetryArgs = { client: RpcClient @@ -46,6 +51,8 @@ export type CreateWorktreeWithNameRetryArgs = { branchIntentSupported?: boolean | Promise agentLaunch?: WorktreeCreateAgentLaunch maxAttempts?: number + /** The workspace the new worktree is attached to, on every attempt. */ + parent?: WorktreeCreateParent mintMutationId?: () => string mintLaunchOperationId?: () => string } @@ -62,11 +69,12 @@ export async function createWorktreeWithNameRetry( const mintMutationId = args.mintMutationId ?? defaultWorktreeCreateMutationId const mintLaunchOperationId = args.mintLaunchOperationId ?? structuredSessionOperationId let lastError: string | null = null + let lastReplayed = false for (let attempt = 0; attempt < maxAttempts; attempt += 1) { const candidateName = args.nameWasGenerated ? getGeneratedWorktreeCreateRetryCandidate(baseName, attempt) : getClientWorktreeCreateCandidate(baseName, attempt) - const candidateParams = buildParams(candidateName, attempt) + const candidateParams = { ...buildParams(candidateName, attempt), ...args.parent } if (attempt === 0 && candidateParams.branchIntent) { if ((await args.branchIntentSupported) !== true) { return { @@ -90,6 +98,7 @@ export async function createWorktreeWithNameRetry( worktreeCreateIdempotency ) let response = sent.response + let replayed = sent.replayed if ( !response.ok && !sent.replayed && @@ -100,9 +109,15 @@ export async function createWorktreeWithNameRetry( ) { // Method refusal can mean the client advertisement lagged the probe; downgrade permanently for this create. launch = null - response = ( - await sendWorktreeCreateResilient(client, null, null, params, worktreeCreateIdempotency) - ).response + const fallback = await sendWorktreeCreateResilient( + client, + null, + null, + params, + worktreeCreateIdempotency + ) + response = fallback.response + replayed = fallback.replayed } // Ledger refusal may follow creation; never retry unnamed. Inspect raw refusal messages for legacy collision handling. if (response.ok) { @@ -118,7 +133,10 @@ export async function createWorktreeWithNameRetry( break } lastError = response.error.message + lastReplayed = replayed + // A replayed refusal may follow a create whose reply was lost; another name could be a second worktree. if ( + replayed || candidateParams.branchIntent === 'open-existing-v2' || launch?.replay || !isRetryableWorktreeCreateConflict(lastError ?? '') @@ -128,7 +146,9 @@ export async function createWorktreeWithNameRetry( } return { error: - lastError ?? translate('tasks.worktreeCreateRetry.createFailed', 'Failed to create workspace') + lastError ?? + translate('tasks.worktreeCreateRetry.createFailed', 'Failed to create workspace'), + ...(lastReplayed ? { replayed: true as const } : {}) } } diff --git a/mobile/src/terminal/TerminalWebView.web.tsx b/mobile/src/terminal/TerminalWebView.web.tsx index 3c6db3d6f7c..97249b03cc6 100644 --- a/mobile/src/terminal/TerminalWebView.web.tsx +++ b/mobile/src/terminal/TerminalWebView.web.tsx @@ -6,7 +6,7 @@ import type { TerminalWebViewHandle, TerminalWebViewProps } from './terminal-web import { TerminalWebViewEngineErrorOverlay } from './terminal-webview-engine-error-state' import { TERMINAL_WEBVIEW_FRAME_STYLES } from './terminal-webview-frame-styles' import type { TerminalWebViewCommand } from './terminal-webview-messages' -import { mountTerminalWebDocument, type TerminalWebDocument } from './terminal-web-document-mount' +import type { TerminalWebDocument } from './terminal-web-document-mount' import { useTerminalWebViewController } from './use-terminal-webview-controller' type Props = TerminalWebViewProps @@ -68,27 +68,52 @@ export const TerminalWebView = forwardRef( if (!(host instanceof HTMLElement)) { return } - let live - try { - live = mountTerminalWebDocument(host, (message) => receiveRef.current?.(message), atMount) - } catch (error) { + let live: TerminalWebDocument | null = null + let disposed = false + const reportStartupFailure = (error: unknown) => { // Startup failure has no handle or later error notify; report its cause now instead of waiting for readiness timeout. receiveRef.current?.({ type: 'error', fatal: true, message: describeTerminalDocumentStartupError(error) }) - return } - documentRef.current = live - // Replay the pre-handle ready flush; theme/scale also ride init today, but future commands may not. - for (const command of beforeMountRef.current) { - live.send(command) - } - beforeMountRef.current = [] + // Load xterm with the first terminal so chat-only sessions never parse it; posts queue in beforeMountRef meanwhile. + void import('./terminal-web-document-mount').then( + ({ mountTerminalWebDocument }) => { + if (disposed) { + return + } + try { + live = mountTerminalWebDocument( + host, + (message) => receiveRef.current?.(message), + atMount + ) + documentRef.current = live + // Replay the pre-handle ready flush; theme/scale also ride init today, but future commands may not. + for (const command of beforeMountRef.current) { + live.send(command) + } + beforeMountRef.current = [] + } catch (error) { + // A throw here would escape the promise unseen; ready already stopped the watchdog, so show the overlay. + documentRef.current = null + live?.dispose() + live = null + reportStartupFailure(error) + } + }, + (error: unknown) => { + if (!disposed) { + reportStartupFailure(error) + } + } + ) return () => { + disposed = true documentRef.current = null - live.dispose() + live?.dispose() } // Mount once per generation; callback-driven controller changes must not discard terminal scrollback. }, [atMount, generation]) diff --git a/mobile/src/terminal/document/selection-mode.ts b/mobile/src/terminal/document/selection-mode.ts index 9bfa4041bc5..a463b5be93c 100644 --- a/mobile/src/terminal/document/selection-mode.ts +++ b/mobile/src/terminal/document/selection-mode.ts @@ -3,7 +3,7 @@ import { notify } from './host-notify' import { repositionOverlay, stopEdgeScroll } from './selection-overlay' import { seedWordSelection } from './selection-range' import { resetSmoothScrollOffset } from './normal-buffer-smooth-scroll' -import { stopSurfaceTouchGestures } from './surface-touch-gestures' +import { stopSurfaceTouchGestures } from './surface-touch-gesture-stop' // Keep overlay transitions outside range math to avoid an overlay import cycle. diff --git a/mobile/src/terminal/document/surface-touch-gesture-stop.ts b/mobile/src/terminal/document/surface-touch-gesture-stop.ts new file mode 100644 index 00000000000..7be26e3ccdd --- /dev/null +++ b/mobile/src/terminal/document/surface-touch-gesture-stop.ts @@ -0,0 +1,26 @@ +import type { TerminalDocumentScope } from './document-scope' +import { cancelDocumentFrame } from './document-frame-registry' +import { emitKeyboardAvoidanceMetrics } from './keyboard-avoidance-metrics' +import { updateTransform } from './viewport-transform' + +// Leaf module so selection mode can end gestures without importing the gesture handlers. +export function stopSurfaceTouchGestures(scope: TerminalDocumentScope) { + const interruptedPinch = scope.touchGesture.isPinching + scope.touchGesture.active = false + if (scope.touchGesture.momentumId !== null) { + cancelDocumentFrame(scope, scope.touchGesture.momentumId) + scope.touchGesture.momentumId = null + } + scope.touchGesture.velY = 0 + scope.touchGesture.accumDelta = 0 + scope.touchGesture.isPinching = false + if (interruptedPinch) { + scope.userScale = 1 + scope.panX = 0 + scope.panY = 0 + if (scope.surface) { + updateTransform(scope) + } + emitKeyboardAvoidanceMetrics(scope) + } +} diff --git a/mobile/src/terminal/document/surface-touch-gestures.ts b/mobile/src/terminal/document/surface-touch-gestures.ts index 8d12e3ee4bd..6dc83231bf1 100644 --- a/mobile/src/terminal/document/surface-touch-gestures.ts +++ b/mobile/src/terminal/document/surface-touch-gestures.ts @@ -4,7 +4,6 @@ import { cancelDocumentFrame, scheduleDocumentFrame } from './document-frame-reg import { touchesInRoot } from './document-host-seams' import { clampPan } from './fit-scale' import { notify } from './host-notify' -import { emitKeyboardAvoidanceMetrics } from './keyboard-avoidance-metrics' import { attachSurfaceMouseClickDragHandler } from './mouse-click-drag' import { routeScrollLines, shouldRouteScrollToTerminalInput } from './mouse-input-encoding' import { @@ -22,6 +21,9 @@ import { import { updateTransform } from './viewport-transform' import { viewportPoint } from './viewport-cell' import { attachSurfaceWheelHandler } from './wheel-scroll' +import { stopSurfaceTouchGestures } from './surface-touch-gesture-stop' + +export { stopSurfaceTouchGestures } const RELEASE_VELOCITY_MAX_AGE_MS = 100 @@ -306,24 +308,3 @@ export function attachSurfaceEventHandlers( export function startSurfaceTouchGestures(scope: TerminalDocumentScope) { attachSurfaceEventHandlers(scope, scope.surface!) } - -export function stopSurfaceTouchGestures(scope: TerminalDocumentScope) { - const interruptedPinch = scope.touchGesture.isPinching - scope.touchGesture.active = false - if (scope.touchGesture.momentumId !== null) { - cancelDocumentFrame(scope, scope.touchGesture.momentumId) - scope.touchGesture.momentumId = null - } - scope.touchGesture.velY = 0 - scope.touchGesture.accumDelta = 0 - scope.touchGesture.isPinching = false - if (interruptedPinch) { - scope.userScale = 1 - scope.panX = 0 - scope.panY = 0 - if (scope.surface) { - updateTransform(scope) - } - emitKeyboardAvoidanceMetrics(scope) - } -} diff --git a/mobile/src/terminal/mobile-terminal-query-reply.ts b/mobile/src/terminal/mobile-terminal-query-reply.ts index c6e5d6c1e6a..7273a2225db 100644 --- a/mobile/src/terminal/mobile-terminal-query-reply.ts +++ b/mobile/src/terminal/mobile-terminal-query-reply.ts @@ -1,6 +1,6 @@ import { isTerminalQueryReply } from '../../../src/shared/terminal/protocol/queries/terminal-query-reply' import { PROGRAM_STATUS_OSC_PREFIX } from '../../../src/shared/program-status/protocol' -import type { RpcOperationSender } from '../transport/rpc/rpc-operation-sender' +import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import { terminalInputSend } from './mobile-terminal-operations' type TerminalSubscriptionRegistry = { @@ -9,7 +9,7 @@ type TerminalSubscriptionRegistry = { type MobileTerminalQueryReplyOptions = { bytes: string - client: RpcOperationSender | null + client: UnvalidatedRpcRequestPort | null clientId: string | null connected: boolean handle: string diff --git a/mobile/src/terminal/quick-commands/QuickCommandRow.test.ts b/mobile/src/terminal/quick-commands/QuickCommandRow.test.ts deleted file mode 100644 index 3728dff5c4f..00000000000 --- a/mobile/src/terminal/quick-commands/QuickCommandRow.test.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { TerminalQuickCommand } from '../../../../src/shared/terminal/quick-commands/terminal-quick-command-types' -import { QuickCommandRow } from './QuickCommandRow' - -const clipboard = vi.hoisted(() => ({ setStringAsync: vi.fn(() => Promise.resolve(true)) })) -const haptics = vi.hoisted(() => ({ notificationAsync: vi.fn(() => Promise.resolve()) })) - -vi.mock('react-native', () => ({ - Platform: { OS: 'ios' }, - Pressable: 'Pressable', - StyleSheet: { create: (styles: T) => styles, hairlineWidth: 1 }, - Text: 'Text', - View: 'View' -})) - -vi.mock('lucide-react-native', () => ({ - Check: 'Check', - Copy: 'Copy', - Pencil: 'Pencil', - Play: 'Play', - Trash2: 'Trash2' -})) - -vi.mock('expo-clipboard', () => clipboard) - -vi.mock('expo-haptics', () => ({ - ...haptics, - performAndroidHapticsAsync: vi.fn(() => Promise.resolve()), - AndroidHaptics: { Reject: 'reject' }, - NotificationFeedbackType: { Error: 'error', Success: 'success' } -})) - -vi.mock('../../components/MobileAgentIcon', () => ({ MobileAgentIcon: 'MobileAgentIcon' })) - -const COMMAND: TerminalQuickCommand = { - id: 'qc-1', - label: 'Run tests', - command: 'run the tests', - appendEnter: true -} - -// Require visible error feedback and haptics when clipboard writes reject; a failed write must never show Copied. -describe('the quick-command row when the pasteboard refuses the text', () => { - let renderer: ReactTestRenderer | null = null - - beforeEach(() => { - clipboard.setStringAsync.mockReset() - haptics.notificationAsync.mockReset() - haptics.notificationAsync.mockImplementation(() => Promise.resolve()) - }) - - afterEach(() => { - act(() => renderer?.unmount()) - renderer = null - }) - - // Find by every copy-state label so feedback transitions cannot make the control disappear from assertions. - const COPY_LABELS = new Set([ - `Copy ${COMMAND.label}`, - 'Copied', - "Couldn't copy", - 'Nothing to copy' - ]) - - function copyButton() { - const button = renderer!.root - .findAll((node) => node.props.accessibilityRole === 'button') - .find((node) => COPY_LABELS.has(String(node.props.accessibilityLabel))) - if (button === undefined) { - throw new Error('the row has no copy button') - } - return button - } - - function rowProps() { - return { - command: COMMAND, - first: true, - onLaunch: vi.fn(), - onEdit: vi.fn(), - onDelete: vi.fn(), - disabled: false - } - } - - it('emits nothing at all when the row is gone before the refusal arrives', async () => { - // Unmount before rejection; feedback without a surviving row would buzz with no explanation. - let refuse: ((error: Error) => void) | undefined - clipboard.setStringAsync.mockImplementation( - () => - new Promise((_resolve, reject) => { - refuse = reject - }) - ) - await act(async () => { - renderer = create(createElement(QuickCommandRow, rowProps())) - }) - await act(async () => { - copyButton().props.onPress() - }) - act(() => renderer?.unmount()) - renderer = null - await act(async () => { - refuse?.(new Error('pasteboard refused')) - }) - expect(haptics.notificationAsync).not.toHaveBeenCalled() - }) -}) diff --git a/mobile/src/terminal/quick-commands/mobile-quick-command-operations.ts b/mobile/src/terminal/quick-commands/mobile-quick-command-operations.ts index c019aa7e9c2..f3f9eee7fb8 100644 --- a/mobile/src/terminal/quick-commands/mobile-quick-command-operations.ts +++ b/mobile/src/terminal/quick-commands/mobile-quick-command-operations.ts @@ -2,13 +2,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rp import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' import '../terminal-reply-schema' import { terminalQuickCommandsSchema } from './mobile-quick-command-reply-schema' -import '../../session/agent-launch/mobile-agent-detection-reply-schema' -import '../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../session/mobile-session-terminal-reply-schema' -import '../../worktree/session-worktree-record-reply-schema' -import '../../session/native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../../files/workspace-file-paths-reply-schema' export const quickCommandsReader = rpcResultVariant( 'terminal-quick-commands', @@ -26,8 +19,6 @@ export const quickCommandsRead = bindDeferredRpcOperation( }) ) -import '../../session/tabs/mobile-session-tab-write-reply-schema' - export const quickCommandsWrite = bindDeferredRpcOperation( defineRpcOperation({ name: 'settings.quick-commands-write', diff --git a/mobile/src/terminal/quick-commands/mobile-quick-command-reply-schema.ts b/mobile/src/terminal/quick-commands/mobile-quick-command-reply-schema.ts index fb6a6ac66c1..2be3e0b35ca 100644 --- a/mobile/src/terminal/quick-commands/mobile-quick-command-reply-schema.ts +++ b/mobile/src/terminal/quick-commands/mobile-quick-command-reply-schema.ts @@ -1,5 +1,4 @@ import * as z from 'zod' -import '../../../../src/shared/zod-salvage' // Preserve null for unreadable canonical command lists so load/save cannot erase host commands with an invented empty list. export const terminalQuickCommandsSchema = z diff --git a/mobile/src/terminal/session/MobileSessionAccessoryKeys.tsx b/mobile/src/terminal/session/MobileSessionAccessoryKeys.tsx index f88d4d336c7..737327fab48 100644 --- a/mobile/src/terminal/session/MobileSessionAccessoryKeys.tsx +++ b/mobile/src/terminal/session/MobileSessionAccessoryKeys.tsx @@ -21,6 +21,17 @@ import { styles as sessionStyles } from '../../session/mobile-session-styles' import { useKeyboardPersistingTaps } from '../../platform/keyboard-persisting-taps' import type { MobileSessionController } from '../../session/use-mobile-session-controller' import { useMobileSessionKeyboardLift } from './use-mobile-session-keyboard-lift' +import { + AGENT_SMART_KEY_STEP_MS, + type AgentSmartKey +} from '../../../../src/shared/terminal/input/agent-smart-keys' +import type { TerminalAccessoryKey } from '../terminal-accessory-keys' +import { resolveMobileTerminalTabSmartKeys } from './mobile-terminal-tab-agent' +import { MobileSessionSmartKeys } from './MobileSessionSmartKeys' +import { MobileSessionLatchKeys } from './MobileSessionLatchKeys' +import { isAccessibilityClick, useTerminalKeyRowTouch } from './use-terminal-key-row-touch' + +type PreparedPress = ReturnType // The terminal's key row above the live input; every key goes straight to the terminal. export function MobileSessionAccessoryKeys({ @@ -46,10 +57,26 @@ export function MobileSessionAccessoryKeys({ stopAccessoryRepeat, cancelAccessoryRepeat, prepareAccessoryPress, - handlePaste + handlePaste, + dockKeys, + activeSessionTab, + terminals, + smartRailEnabled } = controller const keyboardLift = useMobileSessionKeyboardLift(controller.dockBottomInset) - const accessoryPresses = useRef(new Map>()) + const accessoryPresses = useRef(new Map()) + const scrollRef = useRef(null) + const latestSmartKeys = useMemo( + () => + smartRailEnabled ? resolveMobileTerminalTabSmartKeys(activeSessionTab, terminals) : null, + [smartRailEnabled, activeSessionTab, terminals] + ) + const touch = useTerminalKeyRowTouch({ + scrollRef, + latest: latestSmartKeys, + cancelAccessoryRepeat + }) + const smartKeys = touch.shown const keepsKeyboard = useKeyboardPersistingTaps('always') // An unmounting Pressable never fires onPressOut, so a held key would outlive its row. useEffect(() => cancelAccessoryRepeat, [cancelAccessoryRepeat]) @@ -70,8 +97,57 @@ export function MobileSessionAccessoryKeys({ ] const sendKeyLabel = (label: string) => t('session.accessoryKeys.sendKey', 'Send {{label}}', { label }) + // Held Shift, Ctrl or Alt turn a key into its combo and are used up when it sends; keys that take none send as they are. + const prepareBuiltInPress = (key: TerminalAccessoryKey): PreparedPress => { + const chord = dockKeys.chordInput(key.id) + const press = prepareAccessoryPress(chord ?? createTerminalLiveAccessoryInput(key)) + const takeChord = () => { + if (chord) { + dockKeys.takeModifiers() + } + } + return { + tap: () => { + takeChord() + return press.tap() + }, + hold: (firstRepeatDelayMs) => { + takeChord() + press.hold(firstRepeatDelayMs) + } + } + } + // Later writes belong to the same press, so a scroll after release mustn't drop them; a tab switch does. + const sendSmartKey = (key: AgentSmartKey) => { + const handle = controller.activeHandleRef.current + void (async () => { + for (const [index, bytes] of key.writes.entries()) { + if (index > 0) { + await new Promise((resolve) => setTimeout(resolve, AGENT_SMART_KEY_STEP_MS)) + } + if (controller.activeHandleRef.current !== handle) { + return + } + if (!(await prepareAccessoryPress({ bytes }).tap())) { + return + } + } + })() + } + const latchIndex = builtInKeys.findIndex((key) => key.id === 'tab') + 1 + const latchKeys = ( + touch.arm('latch')} + onPress={(modifier, event) => + touch.fire('latch', event, () => dockKeys.tapModifier(modifier)) + } + /> + ) return ( - + {/* Why: fixed keyboard escape hatch; outside the ScrollView so it can't scroll away (#5106). */} {keyboardLift > 0 && ( + {smartKeys ? ( + touch.arm(`smart:${key.id}`)} + onPress={(key, event) => touch.fire(`smart:${key.id}`, event, () => sendSmartKey(key))} + /> + ) : null} { - if (activeHandle) { - void toggleDisplayMode(activeHandle) - } - }} + onPressIn={() => touch.arm('displayMode')} + onPress={(event) => + touch.fire('displayMode', event, () => { + if (activeHandle) { + void toggleDisplayMode(activeHandle) + } + }) + } accessibilityRole="button" accessibilityLabel={ phoneDisplay @@ -133,7 +222,8 @@ export function MobileSessionAccessoryKeys({ style={keyStyle} disabled={!canSend} hitSlop={TERMINAL_KEY_HIT_SLOP} - onPress={() => void handlePaste()} + onPressIn={() => touch.arm('paste')} + onPress={(event) => touch.fire('paste', event, () => void handlePaste())} accessibilityRole="button" accessibilityLabel={t( 'session.accessoryKeys.pasteFromClipboard', @@ -143,20 +233,22 @@ export function MobileSessionAccessoryKeys({ {t('session.accessoryKeys.paste', 'Paste')} )} - {builtInKeys.map((key) => ( + {latchIndex === 0 ? latchKeys : null} + {builtInKeys.flatMap((key, index) => [ { + touch.arm(key.id) if (!key.repeatable) { return } - const press = prepareAccessoryPress(createTerminalLiveAccessoryInput(key)) - accessoryPresses.current.set(key.id, press) + const prepared = prepareBuiltInPress(key) + accessoryPresses.current.set(key.id, prepared) if (event.type === 'keydown') { - press.hold(TERMINAL_ACCESSORY_REPEAT_DELAY_MS) + prepared.hold(TERMINAL_ACCESSORY_REPEAT_DELAY_MS) } }} onPressOut={() => { @@ -165,23 +257,23 @@ export function MobileSessionAccessoryKeys({ } }} onPress={(event) => { - if (key.repeatable) { - // Accessibility clicks have no touch-down to prepare a sender. - const accessibilityClick = - event.type === 'click' && - 'detail' in event.nativeEvent && - event.nativeEvent.detail === 0 - const press = - (!accessibilityClick && accessoryPresses.current.get(key.id)) || - prepareAccessoryPress(createTerminalLiveAccessoryInput(key)) - accessoryPresses.current.delete(key.id) - void press.tap() - return - } - void handleAccessoryKey(createTerminalLiveAccessoryInput(key)) + // Accessibility clicks have no touch-down to prepare a sender. + const prepared = + (key.repeatable && + !isAccessibilityClick(event) && + accessoryPresses.current.get(key.id)) || + prepareBuiltInPress(key) + accessoryPresses.current.delete(key.id) + touch.fire(key.id, event, () => void prepared.tap()) }} onLongPress={ - key.repeatable ? () => accessoryPresses.current.get(key.id)?.hold() : undefined + key.repeatable + ? () => { + if (touch.stillArmed(key.id)) { + accessoryPresses.current.get(key.id)?.hold() + } + } + : undefined } delayLongPress={TERMINAL_ACCESSORY_REPEAT_DELAY_MS} // A web