Skip to content

refactor(mobile): send six screen-mounted call sites through typed RpcOperations (step 4, wave 3) - #20919

Merged
Jinwoo-H merged 11 commits into
mainfrom
wave3-screens
Sep 16, 2026
Merged

Jinwoo-H merged 11 commits into
mainfrom
wave3-screens

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​28 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13
Prod 689 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8177 $\color{#cf222e}{\Huge{\mathbf{−}}}$​739 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7438

Step 4, wave 3 (screen-mounted holdouts): six of the nine sites that were held out of step 4 because their sends live inside, or are reachable only through, a React Native screen now send through typed RpcOperations, using #20884's screen mounting. 8 references → 0 across 6 files; the remaining 3 files (6 refs) stay with their reasons rewritten to what is true now. No wire change, zero golden bodies moved.

Diff composition (head ae3cd857a9, vs 0869d997c8)

Part Files Added Deleted What it is
Goldens, header re-digest 641 +641 -641 every existing golden, recorderSha256 only (five members added to screen-native-substitutes.ts); zero body lines, lead-reproduced through the value pool
Goldens, newly recorded 13 +6,508 -0 6 new families + 7 reply-matrix goldens, recorded at main's pin before the refactor
pilot-scenarios.json 1 +367 -0
Product source 11 +164 -72 the migration: 5 new operations, 2 reused; inventory lines deleted or rewritten
Tests 2 +26 -16
Recorder adapters + substitutes + mutants 8 +469 -3 5 adapter modules (the file explorer reuses the pre-existing file-explorer-screen-mount-adapters.ts) + registry, 5 substitute members, 4 family mutants
Total 676 +8,175 -732

Commit order (the contract)

  1. f51518ed55 — scenarios + goldens for the six sites, recorded at the pin e7206f62a8 against pre-migration source.
  2. 86a8c0e215 — types the linear workspace picker's model fixture (adapter only; one golden's adapterSha256).
  3. 78c3a2b0e3 — the refactor. Product only. Touches no golden.
  4. ae3cd857a9 — reply-matrix goldens for the six families.

Inventory

Pending list 28 files / 44 refs → 22 / 36 by this branch alone; 16 files / 26 refs at head after merging main's #20915 (a disjoint 6 files / 10 refs). Reached zero: MobileFileExplorerPanel.tsx 2, mobile-home-host-requests.ts 2, MobileAgentSessionHistoryPanel.tsx 1, notification-display-test.tsx 1, mobile-tasks-filter-pickers.tsx 1, use-mobile-tasks-route-and-item-state.tsx 1.

Kept, reason rewritten to what is true now:

  • app/h/[hostId]/accounts.tsx (2): the screen mounts, but its second mount effect opens accounts.subscribe, the request-only runner refuses it, and the crash boundary takes the tree before the refresh control and account rows that carry accounts.list / accounts.select* exist. Step 6.
  • app/terminal-settings.tsx (3): renders to completion under inert reanimated + gesture-handler substitutes, then sends nothing: loadHosts() joins a device token held in the keychain (expo-secure-store), and a scenario can declare async storage and the tray, not a credential. Measured loadHosts() → [] under a declared deviceStore. Those substitutes were reverted since no recording reads them.
  • src/host-screen/host-screen-overlays.tsx (1): worktree.sleep is an onPress inside ActionSheetContent, which renders only inside an open BottomDrawer; reanimated's timing driver decides when children exist and Gesture.Pan is a fluent builder. Needs a driven drawer substitute.

Readers and policies

5 new operations, 2 reused (worktreeCatalogRead for worktree.ps, newTabRepoListRead for repo.list). One method needs a second reader: files.list, because the existing files.list-or-skip reads the files member alone and the explorer also needs truncated. New acceptance policies: 0.

Substitute members added (5), each with the recording that reads it, verified by removal

react-native-safe-area-context.useSafeAreaInsets and expo-router.useLocalSearchParams → tasks.route-repo-list (useLocalSearchParams answers one pinned route, documented like the pinned window size; the screen sends repo.list, which takes no params). react-native.TextInput, .SectionList, .RefreshControl → aiVault.history-screen.

Evidence

  • Refactor commit touches 0 files under mobile/rpc-foundation/. vs main, decoded through the value pool: 641 M all header-only (recorderSha256 only), 0 body, 13 A, 0 D; one recorderSha256 / baseline / lockfileSha256 across all 654; refusal texts absent. Lead-reproduced; recording + boundary suites 18 files / 769 passed; mobile typecheck 0.
  • Mutation census (applied / run / reverted): wrong method files.readDir → files.read killed (5 tests / 3 files); acceptance swap on the explorer's directory read killed (5 / 3); retry of a lost mutating reply in the filter pickers killed (2 / 2). Two survivors, each a finding not a gap: the workspace-switch acceptance swap is unobservable because main chains loadLinearContext off the send without reading ok (ticketed, preserved); no site in this bucket interprets across a multi-request barrier, so interpretAtRpcBarrier is unused here. Delivery-unknown class has no site (the one mutating send reads no mark); the retry mutation above is the rule that class protects.
  • Family mutants: home-accounts-envelope, push-test-envelope, task-screen-repo-envelope, linear-workspace-context-reload, all killed (36 mutant tests). aiVault.history-screen carries none: every change to what worktree.ps publishes also moves the scopePaths the next scripted completion asserts, so a mutant aborts the sequence instead of diverging (two tried: one threw Missing or completed request: status.get#2, one survived); its evidence is the reply matrix at worktree.ps#1.

Tickets owed, not fixed here

  • app/terminal-settings.tsx reads ms off the reply envelope instead of its result at three sites (get / set / get-retry), so the auto-restore value is always undefined. Kept deliberately.
  • mobile-tasks-filter-pickers.tsx: a refused linear.selectWorkspace reloads the context exactly as an accepted one does because the reply's ok is never read.

Measurements

77 min worktree-to-green. Goldens 641 → 654 files, 11.65 → 11.80 MiB.

Gates

ORCA_BACKGROUND_LAUNCH=1: mobile typecheck 0; mobile test 593 files / 5536 passed; recording suite 17 files / 761 passed; pnpm tc 0; check:code-quality:changed 0 new across 21 files; check:react-doctor:changed 0; audit:anti-slop 0; oxfmt --check . from mobile/ clean; oxlint on all 21 changed files 0.

Landing note

#20915 (native-state bucket) lands first; this branch then merges main and re-records once (its substitute edit re-digests #20915's 13 new goldens).

Review round 1 (2026-09-16)

Ship as-is; three comment-accuracy fixes applied in a follow-up commit: the worktree.ps caller census (three readers, not two), the newTabRepoListRead census and purpose (two callers, the pickers read the whole list), and the aiVault history-panel mutant note, which credited the reply matrix with a distinction it cannot make at that checkpoint (normal projects byte-identically to every non-inner refusal partition; the real oracles are the crash channel and the next request's params, both verified to kill). Reviewer reproduced the contract claims; no code change, no golden movement.

Then merged main (dad7f77b05, after #20915 landed: pilot-scenarios.json merged by scenario id to 340 entries with both sides' six kept byte-equal, the repo.list note keeps main's throw/skip grouping plus the tasks route, mutant maps unioned, inventory takes both sides' deletions; no golden conflicts because #20915 touched only adapters/ and mutants/, which the recorder digest excludes) and re-recorded once at the unchanged pin e7206f62a8 (3026ba71d0). Lead-reproduced against main through the value pool: 654 M all header-only on recorderSha256, 13 A, 0 D, one recorderSha256 / baseline / lockfileSha256 across all 667.

Review round 2 (2026-09-16, fresh reviewer)

Ship as-is; no correctness defect. Reviewer verified the merge resolution is exact (scenario manifest the true union at 340 ids with every shared entry unchanged; inventory the exact union of both sides' deletions; mutant maps unioned), acceptance parity at all six migrated sites (the RpcFailure casts are sound: under success-result-or-skip an unaccepted verdict implies a refused envelope), all five substitute members load-bearing by removal, no fixture swallowing a throw, and no scenario letting one send's golden mask another. Oracle census: matrices distinguish accepted from refused at repo.list, notifications.testPush, accounts.list and both explorer sites; worktree.ps only via the crash channel and the next request's scopePaths (as the round-1 fix says); linear.selectWorkspace has no oracle at all, the pre-existing ticketed gap.

Cleanups applied in a follow-up commit pair: two holdout reasons corrected (accounts.tsx does not mount today: expo-router.useFocusEffect and react-native.ScrollView are unsubstituted before the accounts.subscribe effect is reached; host-screen-overlays' real gap is missing reanimated/gesture-handler substitutes, not a timing-gated child tree), and the dead reload-repos action branch deleted from the tasks-route adapter with one re-record (header-only on that family's adapterSha256). Deferred to the next engine PR: the exports.recorderHostClientContext = Ctx; source string in four adapters pins a module-private local no type checker sees; one exported engine constant fixes it but would re-digest every golden here.

Five new mount adapters and six scenarios, recorded against the pinned baseline's
product code so the goldens are main's behaviour, not the refactor's.

Each site is a screen the recorder could not previously mount:

- `home.host-accounts` mounts `fetchMobileHomeAccounts`, whose decoder is
  re-exported through `AccountUsage.tsx`. That module loads under the mount
  loader, so the inventory's "no recording can load it" was already stale.
- `notifications.display-test-screen` mounts the settings push probe and presses
  its button by reading the handler back off the rendered inert `Pressable`.
- `aiVault.history-screen` mounts the history panel, which is where the last
  `worktree.ps` lives. Split in two: the base stops once the worktree list has
  seeded the scopes, because a reply partition there changes the scopePaths the
  downstream `aiVault.listSessions` carries, and a matrix variant cannot assert
  params it moved. The full chain is a second scenario, driven as a pilot only.
- `tasks.route-repo-list` mounts the tasks screen-root hook and calls its own
  `ensureLoaded`, which is the only thing that fires `repo.list`.
- `linear.select-workspace-picker` calls the render helper the tasks surface
  calls and invokes the `onSelect` on the element it returns. The picker draws
  inside `BottomDrawer`, whose reanimated timing driver and gesture builder the
  recorder would have to impersonate for a row to exist; the closure is the same
  either way, and the workspace a selection carries comes from the scenario.

Five substitute members are added, each with the recording that reads it:
`react-native-safe-area-context.useSafeAreaInsets` and
`expo-router.useLocalSearchParams` for `tasks.route-repo-list`, and
`react-native.TextInput`, `.SectionList` and `.RefreshControl` for
`aiVault.history-screen` once its list renders. `useLocalSearchParams` answers one
pinned route for the same reason the window size is pinned: a screen's own address
is not a device reading, and the one screen that reads it sends `repo.list`, which
takes no params.

Touching the substitute table moves `recorderSha256`, so all 641 existing goldens
are re-recorded. Recorded from a detached worktree at the pinned baseline with this
branch's recorder laid over it: every pre-existing golden is header-only, verified
by resolving both sides through the value pool — 641 header-only, 0 body, 0 deleted,
one distinct `recorderSha256`, `baseline` and `lockfileSha256` across all of them.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
`mobile/tsconfig.json` covers the recorder, and the fixture's setters were written
with the argument the product happens to pass rather than the `SetStateAction` the
model declares. Typing them moves `adapterSha256` on the two goldens recorded through
this module, so they are re-recorded here rather than in the refactor commit, which
must move none.

Re-recorded at the pinned baseline: `linear-select-workspace` and its reply matrix,
header-only, bodies unchanged.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…cOperations

Nine references off the raw request port, across six files. Every one is proven
against the goldens recorded in the previous commit from the pinned baseline's
product code: this commit moves no file under mobile/rpc-foundation/goldens.

Reused rather than redefined:

- `worktree.ps` in the history panel sends through `worktreeCatalogRead`. Same
  question, same acceptance — a refused list leaves the screen on what it holds.
- `repo.list` in the tasks screen-root hook sends through `newTabRepoListRead`.
  Its policy raises the host's message and its reader takes `repos` off the payload
  while preserving the property-read exception a null result used to throw at the
  cast, which is what this call site did by hand. Its name still says new-tab; a
  third consumer does not make renaming it this bucket's business.

Four operations are new, each because no existing reader on the method takes this
consumer's input:

- `files.read-directory-or-skip` and `files.legacy-explorer-list-or-skip` for the
  explorer. Both skip, because neither refusal is the operation's to decide: the
  readDir refusal code selects the legacy fallback and the list refusal supplies the
  message. The existing `files.list-or-skip` reads the `files` member alone, and the
  explorer also needs `truncated` for the "Showing first 5000" note.
- `accounts.home-snapshot-or-skip` for the Home card, decoded by
  `decodeAccountsSnapshot` at the call site as before.
- `notifications.test-push-or-skip` for the settings probe, whose `forbidden` and
  `method_not_found` refusals mean "try the next desktop".
- `linear.select-workspace-or-skip` for the filter sheet.

Two behaviours are preserved rather than repaired, both recorded:

- The workspace switch never read its reply. `.then(() => loadLinearContext())` runs
  on a refusal exactly as on a success, so only a transport rejection reaches the
  error copy. Interpreting the operation here would surface a refused switch for the
  first time; that is a product change with its own re-record.
- `app/terminal-settings.tsx` still reads `ms` off the reply envelope instead of off
  its result, so the value is always undefined. It did not migrate, and the inventory
  now carries the defect as its own note.

Four mutants are added, one per new family that admits a state-only one:
the Home snapshot, the push test result and the tasks repo list each decoded one
level above the envelope, and the workspace switch with its context reload dropped.
`aiVault.history-screen` gets none and says why in the suite: everything
`worktree.ps` publishes also moves the `scopePaths` the next scripted completion
asserts, so a mutant aborts the sequence instead of diverging from it. Its evidence
is the reply matrix at that request.

The tasks source-parity ratchet moves with the family it guards: hook, statement,
declaration, render and style counts are unchanged, and the semantic source is a pure
deletion of four lines — two `rpc:` call signatures and the two method literals they
carried.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
One golden per scripted reply, eleven partitions each, recorded at the pinned
baseline alongside the pilots. Seven sites: `accounts.list`, `notifications.testPush`,
`repo.list`, `linear.selectWorkspace`, and all three of the history screen's —
`worktree.ps` and the two `status.get` reads its scan chains off the worktree list.

The history matrix is also that family's defect evidence in place of a mutant: every
partition at `worktree.ps` changes the `scopePaths` the downstream `aiVault.listSessions`
carries, and the sender args are recorded with it.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one defer-able cleanup note below.

Reviewed changes

Step 4, wave 3 of the mobile typed-RpcOperation migration: six screen-mounted call sites now send through declared operations, backed by recordings made against the pre-migration pin.

  • Six product call sites migrated — MobileFileExplorerPanel, mobile-home-host-requests, MobileAgentSessionHistoryPanel, notification-display-test, mobile-tasks-filter-pickers, and use-mobile-tasks-route-and-item-state; the six inventory entries reach zero and are deleted.
  • Five new operations, two reused — files.read-directory-or-skip, files.legacy-explorer-list-or-skip (a second files.list reader so truncated survives), accounts.home-snapshot-or-skip, notifications.test-push-or-skip, linear.select-workspace-or-skip; worktreeCatalogRead and newTabRepoListRead are reused unchanged.
  • Recorder evidence — 6 new family goldens + 7 reply-matrix goldens recorded at pin e7206f62a8, 641 existing goldens re-digested (recorderSha256 only), 6 mount adapters, 5 substitute members, and 4 family mutants.

I traced each migrated site against its operation's acceptance policy and reader: the success-result-or-skip + rpcUncheckedPayloadReader pairs reproduce response.ok/response.result exactly (including the files.list fallback's message chain), newTabRepoListRead reproduces the screen-root hook's throw new Error(response.error.message) / response.result.repos, and the single-flight key and omitted params are unchanged. The linear.selectWorkspace path stays uninterpreted as documented, and the linear-workspace-context-reload mutant pins the chained reload. No semantic differences found.

ℹ️ Nitpicks

  • isSuccess in mobile/src/tasks/mobile-tasks-item-mapping.ts:22 lost its only caller and import in this PR (use-mobile-tasks-route-and-item-state.tsx) and is now unreferenced. Deleting it — and the RpcSuccess type import it alone uses — would finish the cleanup. Defer-able.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment-only, no product behaviour and no golden movement.

- `worktreeCatalogRead` says two readers; there are three. Names the third
  (the agent-history panel's `scopePaths` seed) and drops the stale count from
  the module header, which described call sites rather than the two operations.
- `newTabRepoListRead`'s census counted the two operations over `repo.list`, not
  its own two callers, and claimed both read a workspace's connection id. The
  tasks route keeps the whole list for its repo pickers. The split from
  `nativeChatRepoListRead` stays where it belongs: acceptance.
- The `aiVault.history-screen` mutant note pointed at the reply matrix as the
  accepted-vs-refused oracle. Decoding
  `matrix-aivault.history-screen-worktree.ps-1.json` through the value pool
  shows `normal`'s projected state is identical to all seven non-crashing
  partitions (spinner, two labels, zero rows). The real oracles are the next
  request's `scopePaths` (`["/repo/feature"]` vs `[]`) and the crash channel the
  three `inner-*` partitions land in.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Comment-only, no product behaviour and no golden movement.

`legacyFileListRead` claimed "the member reader rejects this consumer's
input". Nothing rejects: `rpcUncheckedMemberReader` returns the member,
and reusing it here would simply drop `truncated`. The reason the explorer
declares its own operation is the other direction. Widening
`files.list-or-skip` to a payload reader would split the `workspace-files`
variant it shares with `nativeChatFileSearchRead` over
`files.searchPaths`, whose only caller feeds both through one
`extractPaths` in `use-mobile-native-chat-file-search.ts`, so the member
read would move into that hook rather than disappear.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Four conflicts, all unions or deletions taken from both sides.

- `pilot-scenarios.json`: merged by scenario id, not by hunk. 328 shared
  entries untouched, main's 6 terminal-input and paste scenarios and this
  branch's 6 screen-mount scenarios all kept, 340 total, no id collision and
  no entry modified on either side. Both sides' entries verified byte-equal
  after the splice.
- `mobile-session-read-operations.ts`: main widened the `repo.list` note with
  the terminal accessory and the new-workspace dialog; this branch had
  corrected the claim that every consumer reads one connection id. Kept
  main's throw/skip grouping and added the tasks route, which keeps the whole
  list for its pickers.
- `pilot-mutants.test.ts`: both mutant maps unioned, 6 new entries.
- `unvalidated-rpc-request-port-inventory.ts`: both sides' deletions taken.
  This branch removes the agent-history panel line, main removes the two
  `src/components/` lines and rewrote that group's note.

Goldens did not conflict. Main's recorder digest never moved, because #20915
touched only `adapters/` and `mutants/`, which `recorderSha256` excludes. Its
13 new goldens therefore arrive on this branch's older digest and are the
only ones the re-record has to move.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The conflict on `pilot-scenarios.json` was resolved by id rather than by
hunk, splicing this branch's six entries into main's text at the array's
close. The splice started at the entry's `{` instead of at its line, so
those six lines lost their indentation. oxfmt's only change is those six
lines; the parsed document is identical, and the recording suite still
matches all 667 goldens, so no scenario digest depends on the raw text.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
One record for the whole merged tree, at the unchanged baseline
e7206f6, through a detached worktree reset
to that pin with this branch's rpc-recording tree, scenarios and recorder
script overlaid. Product source in that worktree was proven identical to the
baseline before the run, so the recordings describe the pre-refactor product.

13 goldens move, all of them the ones #20915 added. They arrived carrying the
recorder digest from before this branch edited `screen-native-substitutes.ts`,
and `recorderSha256` is the only key that moves on any of them; every
recording body is identical after decoding through the value pool. The other
654 were re-recorded byte-for-byte and are not in this commit.

All 667 goldens now carry one `recorderSha256`, one `baseline` and one
`lockfileSha256`.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Re-review of the five commits since the prior Pullfrog review (ae3cd857a9): comment corrections, a merge of main, a scenario indentation fix, and a mechanical golden re-record. The migrated call sites themselves are unchanged from run 1.

  • Three operation/mutant comments corrected — newTabRepoListRead's census, worktreeCatalogRead's third reader (the agent-history panel's scopePaths seed), and the aiVault.history-screen mutant note, which now points at the next request's scopePaths and the crash channel rather than the reply matrix.
  • legacyFileListRead's rationale rewritten — the second files.list reader is declared because widening files.list-or-skip to a payload reader would split the shared workspace-files variant and only move the member read into the caller, not because the member reader rejects its input.
  • origin/main merged (#20915) and goldens re-recorded once — the 13 branch-only goldens were re-digested to the merged recorder digest, and six pilot-scenarios.json entries spliced during the conflict were re-indented (parse-identical).

I verified the post-merge state is internally consistent: all 667 goldens carry a single recorderSha256 (9f19bd48…); pilot-scenarios.json parses with 340 scenarios, no duplicate ids, and every branch and #20915 id present; operation-mutations.ts/pilot-mutants.test.ts and mounted-operation-modules.ts hold both PRs' mutants, adapters, and substitutes; and the merge preserved every branch product and recorder change byte-for-byte (per-file stat parity with the pre-merge diff). The corrected comments match the code: newTabRepoListRead has three throw-policy callers plus two skip-policy consumers on nativeChatRepoListRead, and the aiVault.history-screen matrix has exactly three inner-* partitions landing in a distinct crash state with the other seven non-inner partitions projecting normal's state.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment-only, no product behaviour and no golden movement.

The accounts route said "the screen now mounts". It does not, at this
commit: it reads `expo-router.useFocusEffect` and `react-native.ScrollView`,
neither is a substituted member, and the trap refuses before any effect
runs. The note now names that as the first gate and the `accounts.subscribe`
effect as the second, and says why the two members are not added here.

The host-screen overlay note blamed a "reanimated timing driver" for
deciding when the drawer's children exist. Nothing gates them:
`resolveBottomDrawerMounted` returns `visible || mounted`, `BottomDrawer`
renders `MountedBottomDrawer` on that, and that component renders its
children unconditionally inside its `Modal`. The blocker is the module's
own imports of reanimated and gesture-handler, neither substituted.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
No scenario names `reload-repos`, and no schedule driver can generate it:
the drivers emit only disconnect, cutover, reset, unmount, blur and remount.
Every other action on this adapter is reached by a scenario. Deleting the
branch leaves the remount and unmount branches, which are driven.

Re-recorded once at the pin e7206f6 with
the product source in that worktree proven identical to the baseline first.
Two goldens move, both in the `tasks.route-repo-list` family, with
`adapterSha256` the only moved key and both recording bodies identical after
decoding through the value pool. The other 665 re-recorded byte-for-byte.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
@Jinwoo-H
Jinwoo-H merged commit b8d4cde into main Sep 16, 2026
21 of 22 checks passed
@Jinwoo-H
Jinwoo-H deleted the wave3-screens branch September 16, 2026 02:10
ivanvykopal pushed a commit to ivanvykopal/orca that referenced this pull request Sep 20, 2026
…cOperations (step 4, wave 3) (stablyai#20919)

* test(mobile): record six screen-mounted call sites before migrating them

Five new mount adapters and six scenarios, recorded against the pinned baseline's
product code so the goldens are main's behaviour, not the refactor's.

Each site is a screen the recorder could not previously mount:

- `home.host-accounts` mounts `fetchMobileHomeAccounts`, whose decoder is
  re-exported through `AccountUsage.tsx`. That module loads under the mount
  loader, so the inventory's "no recording can load it" was already stale.
- `notifications.display-test-screen` mounts the settings push probe and presses
  its button by reading the handler back off the rendered inert `Pressable`.
- `aiVault.history-screen` mounts the history panel, which is where the last
  `worktree.ps` lives. Split in two: the base stops once the worktree list has
  seeded the scopes, because a reply partition there changes the scopePaths the
  downstream `aiVault.listSessions` carries, and a matrix variant cannot assert
  params it moved. The full chain is a second scenario, driven as a pilot only.
- `tasks.route-repo-list` mounts the tasks screen-root hook and calls its own
  `ensureLoaded`, which is the only thing that fires `repo.list`.
- `linear.select-workspace-picker` calls the render helper the tasks surface
  calls and invokes the `onSelect` on the element it returns. The picker draws
  inside `BottomDrawer`, whose reanimated timing driver and gesture builder the
  recorder would have to impersonate for a row to exist; the closure is the same
  either way, and the workspace a selection carries comes from the scenario.

Five substitute members are added, each with the recording that reads it:
`react-native-safe-area-context.useSafeAreaInsets` and
`expo-router.useLocalSearchParams` for `tasks.route-repo-list`, and
`react-native.TextInput`, `.SectionList` and `.RefreshControl` for
`aiVault.history-screen` once its list renders. `useLocalSearchParams` answers one
pinned route for the same reason the window size is pinned: a screen's own address
is not a device reading, and the one screen that reads it sends `repo.list`, which
takes no params.

Touching the substitute table moves `recorderSha256`, so all 641 existing goldens
are re-recorded. Recorded from a detached worktree at the pinned baseline with this
branch's recorder laid over it: every pre-existing golden is header-only, verified
by resolving both sides through the value pool — 641 header-only, 0 body, 0 deleted,
one distinct `recorderSha256`, `baseline` and `lockfileSha256` across all of them.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

* test(mobile): type the linear workspace picker's model fixture

`mobile/tsconfig.json` covers the recorder, and the fixture's setters were written
with the argument the product happens to pass rather than the `SetStateAction` the
model declares. Typing them moves `adapterSha256` on the two goldens recorded through
this module, so they are re-recorded here rather than in the refactor commit, which
must move none.

Re-recorded at the pinned baseline: `linear-select-workspace` and its reply matrix,
header-only, bodies unchanged.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

* refactor(mobile): send six screen-mounted call sites through typed RpcOperations

Nine references off the raw request port, across six files. Every one is proven
against the goldens recorded in the previous commit from the pinned baseline's
product code: this commit moves no file under mobile/rpc-foundation/goldens.

Reused rather than redefined:

- `worktree.ps` in the history panel sends through `worktreeCatalogRead`. Same
  question, same acceptance — a refused list leaves the screen on what it holds.
- `repo.list` in the tasks screen-root hook sends through `newTabRepoListRead`.
  Its policy raises the host's message and its reader takes `repos` off the payload
  while preserving the property-read exception a null result used to throw at the
  cast, which is what this call site did by hand. Its name still says new-tab; a
  third consumer does not make renaming it this bucket's business.

Four operations are new, each because no existing reader on the method takes this
consumer's input:

- `files.read-directory-or-skip` and `files.legacy-explorer-list-or-skip` for the
  explorer. Both skip, because neither refusal is the operation's to decide: the
  readDir refusal code selects the legacy fallback and the list refusal supplies the
  message. The existing `files.list-or-skip` reads the `files` member alone, and the
  explorer also needs `truncated` for the "Showing first 5000" note.
- `accounts.home-snapshot-or-skip` for the Home card, decoded by
  `decodeAccountsSnapshot` at the call site as before.
- `notifications.test-push-or-skip` for the settings probe, whose `forbidden` and
  `method_not_found` refusals mean "try the next desktop".
- `linear.select-workspace-or-skip` for the filter sheet.

Two behaviours are preserved rather than repaired, both recorded:

- The workspace switch never read its reply. `.then(() => loadLinearContext())` runs
  on a refusal exactly as on a success, so only a transport rejection reaches the
  error copy. Interpreting the operation here would surface a refused switch for the
  first time; that is a product change with its own re-record.
- `app/terminal-settings.tsx` still reads `ms` off the reply envelope instead of off
  its result, so the value is always undefined. It did not migrate, and the inventory
  now carries the defect as its own note.

Four mutants are added, one per new family that admits a state-only one:
the Home snapshot, the push test result and the tasks repo list each decoded one
level above the envelope, and the workspace switch with its context reload dropped.
`aiVault.history-screen` gets none and says why in the suite: everything
`worktree.ps` publishes also moves the `scopePaths` the next scripted completion
asserts, so a mutant aborts the sequence instead of diverging from it. Its evidence
is the reply matrix at that request.

The tasks source-parity ratchet moves with the family it guards: hook, statement,
declaration, render and style counts are unchanged, and the semantic source is a pure
deletion of four lines — two `rpc:` call signatures and the two method literals they
carried.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

* test(mobile): matrix the six new screen families' replies

One golden per scripted reply, eleven partitions each, recorded at the pinned
baseline alongside the pilots. Seven sites: `accounts.list`, `notifications.testPush`,
`repo.list`, `linear.selectWorkspace`, and all three of the history screen's —
`worktree.ps` and the two `status.get` reads its scan chains off the worktree list.

The history matrix is also that family's defect evidence in place of a mutant: every
partition at `worktree.ps` changes the `scopePaths` the downstream `aiVault.listSessions`
carries, and the sender args are recorded with it.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

* docs(mobile): correct three operation and mutant comments

Comment-only, no product behaviour and no golden movement.

- `worktreeCatalogRead` says two readers; there are three. Names the third
  (the agent-history panel's `scopePaths` seed) and drops the stale count from
  the module header, which described call sites rather than the two operations.
- `newTabRepoListRead`'s census counted the two operations over `repo.list`, not
  its own two callers, and claimed both read a workspace's connection id. The
  tasks route keeps the whole list for its repo pickers. The split from
  `nativeChatRepoListRead` stays where it belongs: acceptance.
- The `aiVault.history-screen` mutant note pointed at the reply matrix as the
  accepted-vs-refused oracle. Decoding
  `matrix-aivault.history-screen-worktree.ps-1.json` through the value pool
  shows `normal`'s projected state is identical to all seven non-crashing
  partitions (spinner, two labels, zero rows). The real oracles are the next
  request's `scopePaths` (`["/repo/feature"]` vs `[]`) and the crash channel the
  three `inner-*` partitions land in.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

* docs(mobile): give the second files.list reader its real reason

Comment-only, no product behaviour and no golden movement.

`legacyFileListRead` claimed "the member reader rejects this consumer's
input". Nothing rejects: `rpcUncheckedMemberReader` returns the member,
and reusing it here would simply drop `truncated`. The reason the explorer
declares its own operation is the other direction. Widening
`files.list-or-skip` to a payload reader would split the `workspace-files`
variant it shares with `nativeChatFileSearchRead` over
`files.searchPaths`, whose only caller feeds both through one
`extractPaths` in `use-mobile-native-chat-file-search.ts`, so the member
read would move into that hook rather than disappear.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

* style(mobile): indent the six scenario entries spliced during the merge

The conflict on `pilot-scenarios.json` was resolved by id rather than by
hunk, splicing this branch's six entries into main's text at the array's
close. The splice started at the entry's `{` instead of at its line, so
those six lines lost their indentation. oxfmt's only change is those six
lines; the parsed document is identical, and the recording suite still
matches all 667 goldens, so no scenario digest depends on the raw text.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

* test(mobile): re-record the merged goldens once at the pin

One record for the whole merged tree, at the unchanged baseline
e7206f6, through a detached worktree reset
to that pin with this branch's rpc-recording tree, scenarios and recorder
script overlaid. Product source in that worktree was proven identical to the
baseline before the run, so the recordings describe the pre-refactor product.

13 goldens move, all of them the ones stablyai#20915 added. They arrived carrying the
recorder digest from before this branch edited `screen-native-substitutes.ts`,
and `recorderSha256` is the only key that moves on any of them; every
recording body is identical after decoding through the value pool. The other
654 were re-recorded byte-for-byte and are not in this commit.

All 667 goldens now carry one `recorderSha256`, one `baseline` and one
`lockfileSha256`.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

* docs(mobile): state the real gates on two screen holdouts

Comment-only, no product behaviour and no golden movement.

The accounts route said "the screen now mounts". It does not, at this
commit: it reads `expo-router.useFocusEffect` and `react-native.ScrollView`,
neither is a substituted member, and the trap refuses before any effect
runs. The note now names that as the first gate and the `accounts.subscribe`
effect as the second, and says why the two members are not added here.

The host-screen overlay note blamed a "reanimated timing driver" for
deciding when the drawer's children exist. Nothing gates them:
`resolveBottomDrawerMounted` returns `visible || mounted`, `BottomDrawer`
renders `MountedBottomDrawer` on that, and that component renders its
children unconditionally inside its `Modal`. The blocker is the module's
own imports of reanimated and gesture-handler, neither substituted.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

* test(mobile): drop the tasks route adapter's unreachable reload action

No scenario names `reload-repos`, and no schedule driver can generate it:
the drivers emit only disconnect, cutover, reset, unmount, blur and remount.
Every other action on this adapter is reached by a scenario. Deleting the
branch leaves the remount and unmount branches, which are driven.

Re-recorded once at the pin e7206f6 with
the product source in that worktree proven identical to the baseline first.
Two goldens move, both in the `tasks.route-repo-list` family, with
`adapterSha256` the only moved key and both recording bodies identical after
decoding through the value pool. The other 665 re-recorded byte-for-byte.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant