Repository navigation
refactor(mobile): send the last session-route raw-port calls as operations (step 6, migration 2) - #21083
Conversation
…ilies
Three mount adapters and ten scenarios for the last raw-port sends in the
session route, recorded at the pinned main baseline before any product edit.
The three hooks were listed as blocked on a WebView-ref substitute. They are
not: none imports the terminal WebView, and all three send with no ref. The
display-mode toggle reads a `{cols, rows}` cell and a device-token cell; the
create path calls scope callbacks; the startup effect drives scope callbacks
only. Each stub is an effect sink, shapes no param and swallows no throw.
One scenario reaches both `worktree.activate` sites the way the product does:
the auto-create clears `created` off the route, the effect re-runs on the same
mount and takes the other branch, so the reply matrix drives both.
The create adapter mounts in its factory rather than as a scripted step. React
draws one `Math.random()` lazily the first time `enqueueTask` runs, and the
runner flushes through `await act` after every step, so a scripted mount would
make `clientMutationId` the second draw of the seeded sequence on the first
recording in a process and the first on every later one. The two determinism
runs caught it.
Recorded through the pinned-baseline worktree recipe, because main has moved
past `a28085adbf` in `src/shared` and this branch does not repin. 705 existing
goldens byte-identical, 15 added, 0 moved, 0 deleted.
Mutation census against the raw-port code, applied and reverted by hand, all
twelve killed: wrong method at each of the four sites; acceptance verdict
swapped at each of the four verdict-reading sites; dropped `unsubscribeTerminal`
on replace; the two activation branches swapped; a delayed `fetchTerminals` pass
dropped; the viewport pair not forwarded on `terminal.setDisplayMode`.
Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…tions Four references, three files, no behaviour change. Proven by replay: the fifteen goldens recorded at the pin before this commit pass unchanged, so no re-record. - `use-mobile-session-startup.ts` both `worktree.activate` sends reuse host-screen's `worktreeActivate`. Its skip verdict was never read before; the startup effect is its first reader, and it reads exactly what main read off the envelope — whether an accepted reply says the host is headless. - `use-mobile-session-terminal-create-actions.ts` `session.tabs.createTerminal` gets `sessionTabCreateTerminal`, a single-reader operation beside the other session-screen writes. `require-result-or-throw-message` replaces the `if (response.ok)` branch because the throw lands in the catch that already reported the host's message, character for character, including the empty message falling back to the screen's own copy. The reader stays the unguarded `.tab` read, because that policy rethrows a reader's exception rather than converting it, which is what keeps a null or absent result failing where it failed before. - `use-mobile-session-terminal-stream-display.ts` `terminal.setDisplayMode` gets `terminalDisplayModeSet`, a skip whose verdict the caller does not read, the way `terminalBufferClear` already works: the server does the resize and reports it on the terminal's existing subscription, so main looked at nothing in the envelope and only a transport rejection was ever a failure. The prompt `terminal.send` in the create path stays on the raw port. It is the only `terminal.send` caller that falls back to its own copy when the host refuses with an empty message, so no existing operation carries its acceptance and a new one is a fourth method outside this migration's scope. It is recorded either way. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…ute pins Pending raw-port inventory: two entries deleted and one lowered, 12 files / 21 references to 10 / 17. The startup and display-mode entries reach zero; the create entry keeps the prompt `terminal.send` and states its own reason. Three stale comments corrected. The startup, create and display-mode entries claimed a WebView-ref or subscription wall that measurement did not find: none of the three hooks imports the terminal WebView, the display-mode write is not gated on an open subscription, and the create path's `subscribeToTerminal` is a scope callback rather than a `client.subscribe`. The accounts screen's entry said the runner is request-only, which stopped being true when `ScenarioStep` gained `frame`; what actually blocks it is that no scenario has been written for `accounts.subscribe`, so its entry now says that instead. Unchecked-reader inventory: `mobile-session-write-operations.ts` 8 to 10 for the two readers the migration added, named in the header the way #20954's three are. Route parity: four pins refreshed with their reasons — the callback bodies for the display-mode toggle, the effects for the startup activation pair, the nested function bodies for the create, and the runtime strings, whose count falls 535 to 531 as four more method literals move to their operations' definitions. The startup source pins now name `worktreeActivate` and still hold what they held: the plain activation is fired rather than awaited, and it goes out before the tab load. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…holds Post-refactor census survivor, measured rather than assumed: swapping `terminalDisplayModeSet`'s acceptance for `require-result-or-throw-message` moves none of the fifteen goldens. The call site reads no verdict and its own `catch` swallows a throw either way, so no policy is observable there. The method, the params and the viewport pair are what the goldens hold at that site. The six other operation-level mutations all kill. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Four raw-port sends migrated to typed operations — the startup effect's two
worktree.activatesends now reuse the host screen'sworktreeActivate; the New Tab create and the terminal menu's display-mode toggle get newsessionTabCreateTerminal/terminalDisplayModeSetinmobile-session-write-operations.ts. Operation names, methods and readers follow the established conventions, andbindDeferredRpcOperation.requestforwards the same params bytes the raw port did. - Startup reads the operation verdict, not the envelope —
reportActivationOutcometakesworktreeActivate.interpret(...)and testsaccepted && headlessActivationNeedsHostRenderer(value). Forsuccess-result-or-skipthat is exactlyresponse.ok ? response.result : null, and both sites map a dropped reply to{ accepted: false }, so the "open Orca on the host" toast gating is unchanged. - Create path's failure branch folded into the existing
catch—require-result-or-throw-messagethrows the host's message on refusal and rethrows the nativetabproperty-read exception on a null result; both reachreportCreateFailure(error.message), which is what the oldif (response.ok) … elsedid. ThescheduleDelayedAction(fetchSessionTabs)stays on the success path only. - Recording oracle and provenance — commit
9f18985be0adds only the manifest, adapters and 15 goldens (allbaseline: a28085adbf…, onerecorderSha256); commit82d3866526is product source only and touches nothing undermobile/rpc-foundation. The three mount adapters match how the product reaches each hook — no WebView ref is substituted, and the create adapter mounts in its factory to pin theMath.random()sequence. - Inventories and pins updated honestly — raw-port inventory lowered 12/21 → 10/17 with the prompt
terminal.sendkept as a documented holdout; unchecked-reader inventory names the two new readers; the route-parity and startup-source pins are refreshed with comments explaining each moved hash; the three stale step-6 blocker comments are corrected to the real (no scenario) reason.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (17)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe change adds typed RPC operations for worktree activation, terminal creation, and terminal display-mode updates. It migrates the related mobile session flows and updates parity checks and RPC inventories. It adds recording adapters, scenario inputs, mutation witnesses, and corpus documentation. It adds Darwin golden recordings for startup, terminal creation, prompt sending, display-mode changes, refusals, transport failures, lifecycle effects, and pending states. Priority: ⬇️ Low Merge Risk: 🔵 Low · up to Startup scenario recordings can include route-reset effects that are not caused by the created-route transition itself. Stabilize the fixture dependencies to keep the recording corpus accurate; this is bounded to test infrastructure. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 15 files. (12 skipped: 12 unsupported.) Full details: Description checkExplanation The description gives detailed change, rationale, implementation, coverage, and validation information. However, it does not follow the required template and omits the required Linked Issue, Visual Proof or explicit N/A, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. Resolution Add the required template sections and complete them. Include a valid issue reference after ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 1e819798-e81b-475b-83cb-3066ce5b47de
📒 Files selected for processing (29)
mobile/rpc-foundation/goldens/matrix-session.create-terminal-session.tabs.createterminal-1.jsonmobile/rpc-foundation/goldens/matrix-session.create-terminal-terminal.send-1.jsonmobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-1.jsonmobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-2.jsonmobile/rpc-foundation/goldens/matrix-session.terminal-display-mode-terminal.setdisplaymode-1.jsonmobile/rpc-foundation/goldens/session-create-terminal-refused.jsonmobile/rpc-foundation/goldens/session-create-terminal-replaces-active.jsonmobile/rpc-foundation/goldens/session-create-terminal-with-prompt.jsonmobile/rpc-foundation/goldens/session-create-terminal-without-handle.jsonmobile/rpc-foundation/goldens/session-startup-both-activation-sites.jsonmobile/rpc-foundation/goldens/session-startup-floating-route-skips-activation.jsonmobile/rpc-foundation/goldens/session-startup-keeps-terminals-visible-on-reconnect.jsonmobile/rpc-foundation/goldens/session-terminal-display-mode-auto-take-floor.jsonmobile/rpc-foundation/goldens/session-terminal-display-mode-drops-second-toggle.jsonmobile/rpc-foundation/goldens/session-terminal-display-mode-to-desktop.jsonmobile/rpc-foundation/pilot-scenarios.jsonmobile/src/host-screen/host-screen-operations.tsmobile/src/session/mobile-session-route-parity.test.tsmobile/src/session/mobile-session-startup-source.test.tsmobile/src/session/mobile-session-write-operations.tsmobile/src/session/use-mobile-session-startup.tsmobile/src/session/use-mobile-session-terminal-create-actions.tsmobile/src/session/use-mobile-session-terminal-stream-display.tsmobile/src/test-support/rpc-recording/adapters/mounted-operation-modules.tsmobile/src/test-support/rpc-recording/adapters/session-startup-mount-adapters.tsmobile/src/test-support/rpc-recording/adapters/session-terminal-create-mount-adapters.tsmobile/src/test-support/rpc-recording/adapters/session-terminal-display-mode-mount-adapters.tsmobile/src/transport/unchecked-rpc-reader-inventory.tsmobile/src/transport/unvalidated-rpc-request-port-inventory.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| bufferedTerminalDraftState: { | ||
| resetDrafts: () => effect('reset-drafts', {}), | ||
| clearPendingRestorations: () => effect('clear-pending-restorations', {}) | ||
| }, | ||
| clearPendingLiveInputCommit: () => effect('clear-pending-live-input-commit', {}), | ||
| clearDelayedActionTimers: () => effect('clear-delayed-action-timers', {}), | ||
| showToast: (message: string, durationMs?: number) => | ||
| effect('toast', { message, durationMs: durationMs ?? null }), | ||
| clearTerminalCache: () => effect('clear-terminal-cache', {}), | ||
| fetchTerminals: async (options) => { | ||
| effect('fetch-terminals', { allowEmptyLoaded: options?.allowEmptyLoaded ?? null }) | ||
| return true | ||
| }, | ||
| ensureSessionTabs: async () => { | ||
| effect('ensure-session-tabs', {}) | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '32,146p' mobile/src/test-support/rpc-recording/adapters/session-startup-mount-adapters.ts
sed -n '1,230p' mobile/src/session/use-mobile-session-startup.ts
rg -n "bufferedTerminalDraftState|clearPendingLiveInputCommit|clearDelayedActionTimers|showToast|clearTerminalCache|fetchTerminals|ensureSessionTabs|useEffect" mobile/src/session/use-mobile-session-startup.tsRepository: stablyai/orca
Length of output: 13344
🏁 Script executed:
set -eu
printf '%s\n' '--- hookMount definitions/usages ---'
rg -n --glob '*.ts' --glob '*.tsx' "function hookMount|const hookMount|hookMount\\s*=|export .*hookMount|hook\\.update\\(\\)" mobile/src/test-support mobile/src | head -160
printf '%s\n' '--- nearby adapter fixture patterns ---'
rg -n --glob '*.ts' --glob '*.tsx' "bufferedTerminalDraftState|sessionStartupMountAdapters|mountFixture<|const .* = \\(.*\\) => effect" mobile/src/test-support | head -220
printf '%s\n' '--- candidate harness files ---'
fd -i 'hook|record|mount' mobile/src/test-support | head -120Repository: stablyai/orca
Length of output: 21384
🏁 Script executed:
set -eu
rg -n --glob '*.ts' --glob '*.tsx' "function hookMount|const hookMount|hookMount\\s*=|export .*hookMount|hook\\.update\\(\\)" mobile/src/test-support mobile/src | head -200
rg -n --glob '*.ts' --glob '*.tsx' "bufferedTerminalDraftState|sessionStartupMountAdapters|mountFixture<|effect\\('" mobile/src/test-support | head -240
fd -i 'hook|record|mount' mobile/src/test-support | head -140Repository: stablyai/orca
Length of output: 38391
🏁 Script executed:
set -eu
printf '%s\n' '--- hook-mount.ts ---'
cat -n mobile/src/test-support/rpc-recording/hook-mount.ts
printf '%s\n' '--- recorder-fixture-shape.ts ---'
sed -n '1,55p' mobile/src/test-support/rpc-recording/recorder-fixture-shape.tsRepository: stablyai/orca
Length of output: 4363
Keep fixture callback identities stable.
hookMount.update() reruns the Harness, and mountFixture does not stabilize its values. consume-created-route therefore creates new callback and bufferedTerminalDraftState identities even though it changes only created.
These identities are dependencies of both useMobileSessionStartup effects. React consequently cleans up and reruns both effects, including the route-reset effect.
Hoist the dependency callbacks and bufferedTerminalDraftState outside the hookMount render callback. The update should change only created.
Three session sends are gated on a cell every existing scenario filled: the
display-mode toggle carries `viewport` only once a surface has measured one and
`client` only once the phone holds a device token, and the startup sequence
swallows a refused tab load before loading terminals behind it. Every recording
declared those cells full, so the arm each guard exists for was never on the
wire and dropping the guard moved no golden.
The two device cells become scenario arguments rather than adapter constants, so
a scenario can declare them empty; the tab load may now be declared to reject,
which is the only way a refused scope callback is reachable at all. Declared, not
shaped: the stubs build no param and swallow no throw.
Three scenarios take the empty arm. The token and viewport ones send `auto`,
which is the direction both members ride, and the startup one records that the
terminal loads and the activation timer still run behind a refused tab load.
Recorded at the pinned baseline through the detached-pin worktree recipe, since
this branch may not repin. 705 goldens identical, 0 body moved, 3 added, 0
deleted; the 15 header-only moves are `adapterSha256` on the three edited
families and `scenarioSha256` on the four scenarios that now declare their token.
The create adapter's determinism comment now names the draw it works around:
React's lazy `("require" + Math.random())` in `enqueueTask`, the scheduler line
that seeds the sequence, and the mismatch a misplaced mount reports. #21088
retires the workaround.
Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
… pinned Each mutation is the guard deleted: the display-mode send carries `client` with an empty id, carries `viewport` before anything measured one, and the startup sequence lets a refused tab load reject it so the terminal loads and activation timer behind it never run. All three survived the whole suite before the scenarios above; the witness asserts each is killed by its scenario and that every other scenario of the same family still cannot see it. A mutation that changes a param the scenario completes aborts at the transport's params assertion instead of producing a divergent recording. That is the scenario detecting it, so the witness reads that one message as a kill, narrowed to it and taken only after the anchor is proved applied. The README gains the class as its fifth bounding fact: a value an adapter holds as a constant is a cell no scenario can empty, so the arm that reads it empty is unreachable until the constant becomes an argument. Corpus counts refreshed to what the suite measures. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
`TerminalCreateResult` wrapped the created tab for the old `sendRequest` reply shape. The migrated call site reads the tab off the operation and names the tab type directly, leaving the wrapper with zero readers repo-wide. Using it at the cast site would have kept the cast and only renamed it, so it goes. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run covers the three commits pushed since the prior pullfrog review at c73ef53d5c — all test-support plus one dead-type deletion; no product behavior moves.
- Recorded the empty arm of three session guards —
session-terminal-display-mode-auto-without-viewport(token declared, no viewport),-auto-without-device-token(viewport declared, no token), andsession-startup-refused-tab-load-still-loads-terminals(tabLoadRejects: true). The display-mode and create adapters now takedeviceToken(andviewport) as scenario arguments rather than adapter constants, so a scenario can declare a cell empty. Each new scenario declares the other cell, so it isolates one guard and correctly survives the sibling's mutation. - Added the three mutations and tightened the witness —
display-mode-unconditional-client,display-mode-unmeasured-viewport,startup-tab-load-rejects-sequence, whosebeforestrings match the product source verbatim.probe-hole-witness.test.ts'sverdicthelper now maps a transportRequest params mismatch:(only afterassertMutationApplied()) tokilled, because the two display-mode mutants abort at the params assertion instead of diverging a recording. The startup mutant diverges through the effect sequence as before. - Refreshed the README's fifth bounding fact and corpus counts — the constant-is-an-unfillable-cell lesson, and counts (364 scenarios / 723 goldens / 853 tests) that match the on-disk corpus exactly.
- Deleted
TerminalCreateResult— the migration left it with zero readers repo-wide, and a repo-wide grep confirms none remain.
Verification in this sandbox: probe-hole-witness.test.ts 32 passed; golden-header-digest, derived-goldens, and mutant-seam 8 passed; oxlint clean on the changed source. The full recording suite exceeded the sandbox's 2-minute shell cap, but the new goldens replay inside the witness run.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…n the wire The terminal-create adapter decided four of the members its own goldens hold: the worktree, the tab a new one is inserted after, and every launch option but the prompt and its two toasts. A value an adapter supplies itself is a cell no scenario can empty, so `afterTabId`'s omission arm — the arm a fresh session and a last-tab close both take — was unreachable, and the quick-command members were recorded only as absent. All of it now comes from the scenario, and the mount moves to the first action so the arguments are in place before the hook reads them. It stays out of a scripted mount step for the determinism reason above it. Four scenarios follow the new arguments: a create with no active tab, a shell quick command, an agent quick command, and a second tap while the host is still answering the first. The refused scenario stops declaring an `errorToast` the adapter dropped: forwarding the toast independently of the prompt is what the product does, so that golden now records the failure toast it always showed. Recorded at the branch's pin, so 705 goldens stay byte-identical to the merge base; five headers move on adapter and scenario digests and one body moves, the refused create's new toast effect. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…pinned Each of the three new create scenarios closes a mutation that survived all 853 tests before it: putting the active tab on the wire as `null` instead of omitting it, swapping the `command` and `agentPrompt` members the host reads, and dropping the in-flight guard so a second tap opens a terminal nobody asked for. The witness asserts the hole and the closure together, as the others do. The params-mismatch abort the witness reads as a kill now rests on an assertion rather than on an argument: no scenario in the manifest completes a request after its last checkpoint, so a send whose params stopped matching always suppressed an observation a golden holds. Known-open holes loses its prose count and becomes a list that names the site, the mutant and why no scenario can see it. Two entries join it: the display-mode acceptance, which no call site reads, and the startup timer's attached-terminal guard, which needs an adapter that can attach a terminal mid-scenario. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
`reportActivationOutcome` took a verdict, which left the timer site hand-building
`{ accepted: false }` for the case where there is no reply to interpret at all.
Taking `RpcResponse | null` and interpreting inside puts the operation's own
policy at both sites and spells the absent reply as absence. Nothing is lost:
`worktreeActivate` reads an unchecked payload and admits every success, so its
`interpret` cannot throw on a reply either site can receive.
No golden moves; the effect digest is repinned.
Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run covers the three commits pushed since the prior pullfrog review at 65e9dadae5 — the round-2 test-support work plus one behavior-preserving refactor.
- The create family's wire members became scenario arguments —
worktreeId,activeSessionTabId, the four launch options, the device token andagentnow come from the scenario manifest rather than adapter constants, anderrorToastis forwarded independently of the prompt.session-create-terminal-refusedconsequently gains the failure-toast effect its scenario always declared — the one body-moved golden in the delta, and the intended consequence of the adapter fix. - Four scenarios and their goldens reach the arms those arguments open — a create with no active tab, a shell quick command, an agent quick command, and a second tap while the first create is in flight. The corpus now reads 368 scenarios / 727 goldens, matching the refreshed README counts.
- Three create mutants and the witness that keeps them closed —
create-after-tab-id-null,create-quick-command-keys,create-second-tap-in-flight, each with aprobe-hole-witnessentry that asserts the closing scenario kills it and the rest of the family still cannot see it. Theverdicthelper's abort-as-kill reading now rests on a manifest-wide invariant test (never completes a request after the last checkpoint), which I verified holds by parsingpilot-scenarios.jsondirectly. reportActivationOutcometakes the reply and interprets it itself —dabaec9b9fretires the hand-built{ accepted: false }the timer site passed when it had no reply, and both sites now feed the rawRpcResponse | null. Forsuccess-result-or-skipthe resulting gate is exactly main'sresponse.ok ? response.result : nullplus theresultread, so the sleeping-agent toast is unchanged.- The README's known-open holes list grew to four entries — the display-mode acceptance (unobservable at a call site that reads no verdict) and the 1800 ms attached-terminal guard join the two existing entries; prose counts that could not fail were replaced with the list.
The remaining notes are unchanged and non-blocking: the prompt terminal.send stays on the raw port with its stated reason, and the display-mode acceptance policy is unpinnable at its current call site (both documented in code and the README).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Takes main's recorder corpus wholesale: the 705 goldens main re-recorded at its new pin 9add08b arrive byte-for-byte, and the manifest merge is main's 351 scenarios untouched beside this branch's 17. This branch's 22 goldens are still recorded at the old pin a28085a and are re-recorded in a later commit. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The create adapter mounted inside its first action so the create would run ahead of the flush that made React pay its one lazy `Math.random()` draw. #21088 pays that draw in the scheduler before it installs the seed, so the position of the mount no longer decides which seeded value `clientMutationId` reads, and the family goes back to the shape every other one uses: a declared `mount` step carrying the cells the hook reads as it renders — the worktree, the active tab, the device token — and a `create` step carrying the launch options it passes. The display-mode family keeps mounting from its `mount` action, which is that same declared shape and never was the workaround. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Recorded at main's baseline in a detached-pin worktree with this branch's recorder, adapters and manifest. Main's own recorder on that pin reproduces main's 705 goldens byte-for-byte first, and this run reproduces the same 705 beside the 22 this branch adds, so the corpus is main's plus this family. Every body moved against the branch's previous recording: main replaced the `sent` request count with the shared write ordinal, which stamps every sender call, payload and effect. Six goldens moved headers only, all of them scenarios that send nothing and write nothing, so they had no entry to stamp. Counts follow the corpus: 727 goldens, 888 tests. The corpus still carries no `reply-salvage` effect — the 22 added goldens contribute no checked read at all, since this family's readers are the unchecked ones the inventory lists. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run covers the three commits pushed since the prior pullfrog review at dabaec9b9f — the merge of origin/main, a test-support mount-step refactor, and a golden re-record. No product source moves in the delta.
- Merged
origin/main— no main commit touches the branch's six product files, so the merge is a clean union. Main's 705 goldens arrive byte-identical and the branch's 22 sit beside them:git diff 533b0bd02e..HEAD -- mobile/rpc-foundation/goldensis exactly the branch's 22 additions, andorigin/mainhas not changed anything undermobile/rpc-foundationsince the merge tip. - Restored the create family's declared
mountstep — the adapter no longer mounts inside its first action; the scenario declaresworktreeId,activeSessionTabIdanddeviceTokenonmount, while the launch options stay oncreate. That is only sound because main'svitest-recording-scheduler.start()pays React's one lazyMath.random()draw before installing the seed, which I verified in-tree and whichvitest-recording-scheduler.test.tspins as the first-in-process oracle. All eight create pilots declaremountfirst. - Re-recorded the 22 branch goldens at main's pin
9add08bb59— every body moved versus the branch's prior recording because main replaced thesentrequest count with the shared writeordinal. All 727 goldens now share onebaseline,recorderSha256andlockfileSha256, and the manifestbaselineequalsorigin/main's. The README counts (368 scenarios / 727 goldens / 888 tests) match the corpus on disk, and thesalvage-observation.test.tscomment follows to 727.
The remaining notes are unchanged and non-blocking: the prompt terminal.send stays on the raw port with its stated reason, and the display-mode acceptance policy is unpinnable at its current call site (both documented in code and the README).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Integration only, no behaviour: #21083's two new session-write readers (`created-terminal-tab`, `terminal-display-mode-set`) come in exactly as main wrote them, and the inventory carries the line for them under this file's own merge rule. The next commit converts both and the session block is empty again. Goldens and the manifest take main's bytes for every path main has — 727 goldens and all 368 scenarios byte-identical, `baseline` left at main's 9add08b — with this branch's 31 goldens and 11 scenarios beside them. Hand-resolved besides the inventory: `mobile-session-write-operations.ts` keeps both sides' readers, `operation-mutations.ts` unions both mutant sets, and `mobile-session-route-parity.test.ts` unions the two refresh notes and repins all three body digests over the merged source. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Step 7 empties the session block of the unchecked-reader inventory, and #21083 landed two readers into it after that: the New Tab create's member read of `tab`, and the display-mode toggle's payload. Converting them is what keeps the claim true — a session line reappearing would mean the domain is not migrated. `created-terminal-tab` requires `tab.id` and `tab.type === 'terminal'`, because the strip keys the new tab on the id and spreads the rest into a union whose arm `type` picks. `terminal`, `title` and `terminalTheme` stay optional behind main's own guards, and unknown members pass through. `terminal-display-mode-set` reads nothing, so it takes the same `z.unknown()` the other five unread writes take. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
All 736 goldens this branch already had move on `baseline` alone, and #21083's 22 arrive beside them. One of the 22 moves against main's own recording: `matrix-session.create-terminal-session.tabs.createterminal-1`, where the New Tab create's five malformed partitions read `Cannot read properties of undefined (reading 'tab')` and now read the method's own message. Two of them also stop unsubscribing the terminal the user was watching before the property read threw, so a create that never happened no longer costs the live pane its subscription. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…7) (#21089) * test(mobile): record main's session reply behaviour at every unrecorded read site Step 7 for the session domain changes how 51 RPC readers read a *malformed* reply. Eleven of the session read sites had no recording family, so main's answer to a malformed reply at those sites was undocumented and the reader change would have had nothing to move. This commit is the before picture, taken from main's own tree with no product edit in it. Ten new families, twelve scenarios, twenty-five goldens: - `session.review-file-diff` / `session.review-branch-diff` — `git.diff` and `git.branchDiff` read through the review projection, which the Changes screen's verbatim readers do not cover. - `session.review-git-mutations` — the single-file `git.stage` / `git.discard` and the bulk stage sweep's second `git.stage`. - `session.review-send-sheet` — `session.tabs.list` read for the agent terminals the send sheet lists, the third reader on that method. Needs an `open-send-sheet` action on the review-action adapter, which re-digests that family's eight goldens on `adapterSha256` and nothing else. - `session.browser-tab-create` — `browser.tabCreate`. - `agentSession.structured-create` — `agentSession.create`, whose family base only ever covered the support probe. - `session.tab-rename` / `session.tab-close-session` — `terminal.rename` and `session.tabs.close`. - `settings.new-tab-local-agents` — `preflight.detectAgents`, the arm the new-tab loader takes for a workspace with no connection. `baseline` is repinned to main's tip because two commits (#20659, #21004) touched a fenced path after the pilot's pin, so `--record` refuses on main's own tree until it moves. The repin is what rewrites `baseline` on all 705 existing goldens; nothing else about them moves. Decoded against origin/main through the value pool: 705 header-only (`baseline` on every one, `adapterSha256` on the eight review-action goldens), 0 body-moved, 25 added, 0 deleted. Not covered, with the reason: the chunked clipboard upload's `appendImageUploadChunk`, `commitImageUpload` and `abortImageUpload` cannot be matrixed, because `replyMatrixSites` takes every completion in the base scenario and the chain's later params carry the `uploadId` the start reply named. Driving `clipboard.startImageUpload#1` therefore makes main send an append whose params no scripted step matches, and the recorder raises `Request params mismatch: clipboard.appendImageUploadChunk#1` instead of recording. The two families were written, probed and removed. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): checked reply readers for the session domain (step 7) Fifty-one unchecked reply readers across nine files become checked zod readers, so a malformed host reply surfaces as one readable error at the operation boundary instead of a downstream `TypeError`, a rendered `undefined`, or a screen left ready over garbage. Deliberately a behaviour change on malformed replies only. Eight schema modules, one per reply family, each recording the consumer line behind every requirement and the host handler that publishes it: - `clipboard-image-reply-schema.ts` — the upload slot's `uploadId`, the commit and single-frame path strings, and the two legs whose body nothing reads. - `github-pr-mutation-reply-schema.ts` — the `{ ok, error }` status envelope as two variants, and the bare-boolean confirmation. - `github-pr-entity-reply-schema.ts` / `github-pr-read-reply-schema.ts` — the seven PR sidebar reads. Every identity requirement the hand parsers had is kept, so a payload that degraded to null still degrades to null; what changes is a payload that is not the declared container at all. - `diff-review-reply-schema.ts` — the normalized branch compare, the review notes on the worktree record, the three file-diff arms, and the file-level git mutations. - `review-terminal-reply-schema.ts`, `session-launch-reply-schema.ts`, `session-read-reply-schema.ts`, `session-write-reply-schema.ts` — the review send sheet, the launch paths, the session screen's reads and its writes. Requirements are exactly the members a consumer reads unguarded, everything else is a salvaged optional with main's own default applied in the transform, and no schema is `.strict()`: a member a newer host adds passes through untouched. Enum arm sets that a reader compares against pass through or degrade to the arm the reader handles most conservatively; the two closed sets — the committed change status and the diff kind — are closed because main *dropped* an arm it did not know rather than passing it through, and degrading them would draw a row or render a diff main never did. No member is coerced on the way back to the host. `github-pr-parsers.ts`, `github-pr-comment-parsers.ts` and `github-pr-value-readers.ts` are gone; their suite is now the parity record for the schemas that replaced them, with the four cases that refuse rather than degrade marked as such. Twelve call-site casts are deleted, and three dead "response was invalid" branches with them: the reader refuses those replies now, so the error names its method. The nine session files come off `unchecked-rpc-reader-inventory.ts` entirely rather than being lowered. `git show --stat` on this commit touches nothing under `mobile/rpc-foundation`. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): unit-pin every session reply schema's decision Three kinds of case, one per kind of decision the schemas encode: a member a consumer reads unguarded is required and its absence refuses, an arm set a reader compares against degrades to the arm that reader handles most conservatively, and a reply whose arms need different members is declared as variants and each arm is read. The last suite is the wire-compatibility claim: a member no reader knows passes straight through, on the markdown document, the upload slot and the terminal inventory alike, so a newer host is never refused for a field mobile does not read. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): refresh the corpus for the session domain's checked readers Repins `baseline` to the last commit touching a fenced path and re-records all 730 goldens, which is the disclosed behaviour change taken as an observation. Decoded through the value pool against the pre-refactor tree on this branch: 688 header-only with `baseline` the only key that moved, 42 body-moved, 0 added, 0 deleted. The 42 are seven named scenarios and thirty-five matrix goldens, and every moved checkpoint's own reply is malformed or refused. Three `normal` partitions appear in the list and none of them reads a well-formed reply differently: the review file-diff family's base scenario drives three legs and its third is scripted `{ kind: 'unknown' }`, so that leg's checkpoint moves in every variant, the varied leg included. The same append-only-history effect puts `pr-read-upstream-error`'s `no-pr` checkpoint in the list for the malformed PR recorded before it. What the corpus now records, in one sentence: a property read on null, a V8 destructuring message shown to the user, and four hand-written "response was invalid" strings are replaced by one message that names the method, and four screens that published a malformed payload as ready state now show an error instead. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): split the expanded check run out of the PR read schemas `github-pr-read-reply-schema.ts` was 328 code lines against the 300-line cap. The expanded check run and the annotations, jobs and steps listed under it are one reply with no reader in common with the other six, so they move to `github-pr-check-reply-schema.ts` whole. A move, not an edit: no schema changes and no golden moves. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the corpus to the branch's last fenced-path commit The schema-module split touched `mobile/src`, so `--record` refuses on the pin the previous refresh left behind. Repins to that commit and re-records. Decoded against the previous corpus: 730 header-only with `baseline` the only key that moved, 0 body-moved, 0 added, 0 deleted — the split is a move, and the corpus says so. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): drop the worktree display-name cast's type import The live-title read is typed by its schema now, so the cast it annotated is gone and the import it needed with it. oxlint flags the leftover. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the corpus to the branch tip The unused-import removal touched a fenced path, so the pin moves with it. Decoded against the previous corpus: 730 header-only on `baseline` alone, 0 body-moved, 0 added, 0 deleted. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): contain a refused prChecks reply to the checks section The checks read was the one phase-1 dependency that could take the whole PR sidebar down. `loadPrSidebarData` routed `!checksOutcome.ok` through `failureState`, so a host whose `github.prChecks` shape drifted cost the user the title, body, comments, reviewers and merge controls — everything they opened the sidebar for — over a section that renders a row of icons. Main never noticed because its unchecked reader answered `[]` for the same reply; this branch's reader refuses it, which is correct, and which is what makes the containment necessary. Contained the way phase 2 already is: a failed read keeps `kind: 'ready'`, empties `checks`, and carries the message in a new `checksError` so the checks section can say what happened. The sidebar can no longer reach `error` or `blocked` on the checks read alone. Also pins the enum departure this PR makes deliberately. The degrading arm sets go through `salvagedOptional(name, z.enum(...))` rather than `openEnum` because `openEnum` refuses a non-string where main mapped it to the conservative arm; nothing held that, and all 2477 tests stayed green against the swap. Six cases now hold both halves: a non-string degrades on the three open sets, and an unknown arm drops the row on the closed ones. Four deletions the reviewer found: a reaction-token alias with no importers, the `errorType`/`fetchedAt` the branch-lookup reader fabricated to satisfy a type whose only consumer reads neither, two bare schema aliases, and a quick-commands pass-through with two callers. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the corpus to the containment commit `--record` refuses unless the product tree equals `baseline`, so the fix above moves the pin. The corpus re-recorded in place against it: 730 goldens, every one header-only on `baseline`, no observation moved. No observation moved because no family reaches the code the fix changed. The `github.pr-read` family calls the seven wrapper reads directly and records their `{ ok, error }` outcomes; `loadPrSidebarData` sits a layer above that and no scenario mounts it. The prChecks outcome is identical before and after — what changed is what the sidebar does with it — so the unit suite is the only oracle for the containment. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): record the PR sidebar's checks containment The containment landed with no golden: no scenario mounted `loadPrSidebarData`, so the row in the delta table rested on unit tests alone. `PrSidebarLoadDeps` is five client-taking functions, so a new adapter drives phase 1 directly and records the `PrSidebarState` it resolves to — no React host, and no edit to an existing adapter, so no recorded golden moves. Two scenarios: a normal load, and one whose checks leg answers a shape the reader refuses. The matrix over the base then drives all eleven partitions at `github.prChecks#1`, and every one of them records `ready` with a `checksError` where main took the whole sidebar to `error`. `pr-sidebar-checks-failure-state` is the mutant that routes the refusal back through `failureState`; it moves both `pr-sidebar-checks-refused` and the prChecks matrix golden. Also pins two closed-and-required enum decisions that were free to become defaults — an unknown check-summary state drops the summary block, an unknown reaction content drops the reaction — deletes four exported type aliases and five enum constants with no reader outside their own file, makes `PRChecksSection`'s `checksError` required so a second caller cannot silently lose the message, and stops the header reading "No checks" when the checks were unreadable rather than absent. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the corpus to the pr-sidebar family commit Six new goldens — two pilots and the four matrix sites the base scenario scripts — and `baseline` on the 730 that already existed. No body moved and no `adapterSha256`: the family is a new adapter module, so nothing recorded through another one re-digests. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record the corpus against the merged main Repins `baseline` to the merge commit and re-records all 736 goldens in place. Against `origin/main` the 705 shared goldens move only on `baseline` (672 of them header-only), leaving the same 33 body moves and the same partitions the branch carried before the merge, plus its 31 added goldens. Every body also takes main's recorder shape from #21088: `sent` becomes `ordinal` over one interleaved write counter, subscriptions record a cleanup checkpoint, and a salvaging read now reports a `reply-salvage` effect naming what it dropped. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): keep an explicit null on the two tri-state PR flags `autoMergeAllowed` and `mergeQueueRequired` carry three answers, not two: `null` is GitHub saying auto-merge is not allowed, `undefined` is the host not carrying the member at all. The readers coalesced the null away, so a well-formed reply read differently from the parsers they replaced, which preserved it explicitly. Both shared types already declare `boolean | null`. No consumer separates the two today — `pull-request-auto-merge-availability` compares with `=== true` and `!== false` — so this is parity, not a visible fix, which is exactly why it needed a test. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the corpus to the tri-state flag commit All 736 goldens move on `baseline` alone: no scenario scripts an explicit null on either flag, so preserving it changes no recorded screen. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): check the two session-write readers #21083 brought Step 7 empties the session block of the unchecked-reader inventory, and #21083 landed two readers into it after that: the New Tab create's member read of `tab`, and the display-mode toggle's payload. Converting them is what keeps the claim true — a session line reappearing would mean the domain is not migrated. `created-terminal-tab` requires `tab.id` and `tab.type === 'terminal'`, because the strip keys the new tab on the id and spreads the rest into a union whose arm `type` picks. `terminal`, `title` and `terminalTheme` stay optional behind main's own guards, and unknown members pass through. `terminal-display-mode-set` reads nothing, so it takes the same `z.unknown()` the other five unread writes take. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin and re-record over #21083's corpus All 736 goldens this branch already had move on `baseline` alone, and #21083's 22 arrive beside them. One of the 22 moves against main's own recording: `matrix-session.create-terminal-session.tabs.createterminal-1`, where the New Tab create's five malformed partitions read `Cannot read properties of undefined (reading 'tab')` and now read the method's own message. Two of them also stop unsubscribing the terminal the user was watching before the property read threw, so a create that never happened no longer costs the live pane its subscription. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * docs(mobile): say what carries a refused create reply to the catch Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…tions (step 6, migration 2) (stablyai#21083) * test(mobile): record the session startup, create and display-mode families Three mount adapters and ten scenarios for the last raw-port sends in the session route, recorded at the pinned main baseline before any product edit. The three hooks were listed as blocked on a WebView-ref substitute. They are not: none imports the terminal WebView, and all three send with no ref. The display-mode toggle reads a `{cols, rows}` cell and a device-token cell; the create path calls scope callbacks; the startup effect drives scope callbacks only. Each stub is an effect sink, shapes no param and swallows no throw. One scenario reaches both `worktree.activate` sites the way the product does: the auto-create clears `created` off the route, the effect re-runs on the same mount and takes the other branch, so the reply matrix drives both. The create adapter mounts in its factory rather than as a scripted step. React draws one `Math.random()` lazily the first time `enqueueTask` runs, and the runner flushes through `await act` after every step, so a scripted mount would make `clientMutationId` the second draw of the seeded sequence on the first recording in a process and the first on every later one. The two determinism runs caught it. Recorded through the pinned-baseline worktree recipe, because main has moved past `a28085adbf` in `src/shared` and this branch does not repin. 705 existing goldens byte-identical, 15 added, 0 moved, 0 deleted. Mutation census against the raw-port code, applied and reverted by hand, all twelve killed: wrong method at each of the four sites; acceptance verdict swapped at each of the four verdict-reading sites; dropped `unsubscribeTerminal` on replace; the two activation branches swapped; a delayed `fetchTerminals` pass dropped; the viewport pair not forwarded on `terminal.setDisplayMode`. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): send the last session-route raw-port calls as operations Four references, three files, no behaviour change. Proven by replay: the fifteen goldens recorded at the pin before this commit pass unchanged, so no re-record. - `use-mobile-session-startup.ts` both `worktree.activate` sends reuse host-screen's `worktreeActivate`. Its skip verdict was never read before; the startup effect is its first reader, and it reads exactly what main read off the envelope — whether an accepted reply says the host is headless. - `use-mobile-session-terminal-create-actions.ts` `session.tabs.createTerminal` gets `sessionTabCreateTerminal`, a single-reader operation beside the other session-screen writes. `require-result-or-throw-message` replaces the `if (response.ok)` branch because the throw lands in the catch that already reported the host's message, character for character, including the empty message falling back to the screen's own copy. The reader stays the unguarded `.tab` read, because that policy rethrows a reader's exception rather than converting it, which is what keeps a null or absent result failing where it failed before. - `use-mobile-session-terminal-stream-display.ts` `terminal.setDisplayMode` gets `terminalDisplayModeSet`, a skip whose verdict the caller does not read, the way `terminalBufferClear` already works: the server does the resize and reports it on the terminal's existing subscription, so main looked at nothing in the envelope and only a transport rejection was ever a failure. The prompt `terminal.send` in the create path stays on the raw port. It is the only `terminal.send` caller that falls back to its own copy when the host refuses with an empty message, so no existing operation carries its acceptance and a new one is a fourth method outside this migration's scope. It is recorded either way. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): lower the raw-port inventory and refresh the session route pins Pending raw-port inventory: two entries deleted and one lowered, 12 files / 21 references to 10 / 17. The startup and display-mode entries reach zero; the create entry keeps the prompt `terminal.send` and states its own reason. Three stale comments corrected. The startup, create and display-mode entries claimed a WebView-ref or subscription wall that measurement did not find: none of the three hooks imports the terminal WebView, the display-mode write is not gated on an open subscription, and the create path's `subscribeToTerminal` is a scope callback rather than a `client.subscribe`. The accounts screen's entry said the runner is request-only, which stopped being true when `ScenarioStep` gained `frame`; what actually blocks it is that no scenario has been written for `accounts.subscribe`, so its entry now says that instead. Unchecked-reader inventory: `mobile-session-write-operations.ts` 8 to 10 for the two readers the migration added, named in the header the way stablyai#20954's three are. Route parity: four pins refreshed with their reasons — the callback bodies for the display-mode toggle, the effects for the startup activation pair, the nested function bodies for the create, and the runtime strings, whose count falls 535 to 531 as four more method literals move to their operations' definitions. The startup source pins now name `worktreeActivate` and still hold what they held: the plain activation is fired rather than awaited, and it goes out before the tab load. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * docs(mobile): say which part of the display-mode operation no golden holds Post-refactor census survivor, measured rather than assumed: swapping `terminalDisplayModeSet`'s acceptance for `require-result-or-throw-message` moves none of the fifteen goldens. The call site reads no verdict and its own `catch` swallows a throw either way, so no policy is observable there. The method, the params and the viewport pair are what the goldens hold at that site. The six other operation-level mutations all kill. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): record the empty cells the session guards are written for Three session sends are gated on a cell every existing scenario filled: the display-mode toggle carries `viewport` only once a surface has measured one and `client` only once the phone holds a device token, and the startup sequence swallows a refused tab load before loading terminals behind it. Every recording declared those cells full, so the arm each guard exists for was never on the wire and dropping the guard moved no golden. The two device cells become scenario arguments rather than adapter constants, so a scenario can declare them empty; the tab load may now be declared to reject, which is the only way a refused scope callback is reachable at all. Declared, not shaped: the stubs build no param and swallow no throw. Three scenarios take the empty arm. The token and viewport ones send `auto`, which is the direction both members ride, and the startup one records that the terminal loads and the activation timer still run behind a refused tab load. Recorded at the pinned baseline through the detached-pin worktree recipe, since this branch may not repin. 705 goldens identical, 0 body moved, 3 added, 0 deleted; the 15 header-only moves are `adapterSha256` on the three edited families and `scenarioSha256` on the four scenarios that now declare their token. The create adapter's determinism comment now names the draw it works around: React's lazy `("require" + Math.random())` in `enqueueTask`, the scheduler line that seeds the sequence, and the mismatch a misplaced mount reports. stablyai#21088 retires the workaround. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): witness the three session guards the recordings had not pinned Each mutation is the guard deleted: the display-mode send carries `client` with an empty id, carries `viewport` before anything measured one, and the startup sequence lets a refused tab load reject it so the terminal loads and activation timer behind it never run. All three survived the whole suite before the scenarios above; the witness asserts each is killed by its scenario and that every other scenario of the same family still cannot see it. A mutation that changes a param the scenario completes aborts at the transport's params assertion instead of producing a divergent recording. That is the scenario detecting it, so the witness reads that one message as a kill, narrowed to it and taken only after the anchor is proved applied. The README gains the class as its fifth bounding fact: a value an adapter holds as a constant is a cell no scenario can empty, so the arm that reads it empty is unreachable until the constant becomes an argument. Corpus counts refreshed to what the suite measures. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): drop the terminal-create result type nothing reads `TerminalCreateResult` wrapped the created tab for the old `sendRequest` reply shape. The migrated call site reads the tab off the operation and names the tab type directly, leaving the wrapper with zero readers repo-wide. Using it at the cast site would have kept the cast and only renamed it, so it goes. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): let the create scenarios declare what the create puts on the wire The terminal-create adapter decided four of the members its own goldens hold: the worktree, the tab a new one is inserted after, and every launch option but the prompt and its two toasts. A value an adapter supplies itself is a cell no scenario can empty, so `afterTabId`'s omission arm — the arm a fresh session and a last-tab close both take — was unreachable, and the quick-command members were recorded only as absent. All of it now comes from the scenario, and the mount moves to the first action so the arguments are in place before the hook reads them. It stays out of a scripted mount step for the determinism reason above it. Four scenarios follow the new arguments: a create with no active tab, a shell quick command, an agent quick command, and a second tap while the host is still answering the first. The refused scenario stops declaring an `errorToast` the adapter dropped: forwarding the toast independently of the prompt is what the product does, so that golden now records the failure toast it always showed. Recorded at the branch's pin, so 705 goldens stay byte-identical to the merge base; five headers move on adapter and scenario digests and one body moves, the refused create's new toast effect. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): witness the three create guards the recordings had not pinned Each of the three new create scenarios closes a mutation that survived all 853 tests before it: putting the active tab on the wire as `null` instead of omitting it, swapping the `command` and `agentPrompt` members the host reads, and dropping the in-flight guard so a second tap opens a terminal nobody asked for. The witness asserts the hole and the closure together, as the others do. The params-mismatch abort the witness reads as a kill now rests on an assertion rather than on an argument: no scenario in the manifest completes a request after its last checkpoint, so a send whose params stopped matching always suppressed an observation a golden holds. Known-open holes loses its prose count and becomes a list that names the site, the mutant and why no scenario can see it. Two entries join it: the display-mode acceptance, which no call site reads, and the startup timer's attached-terminal guard, which needs an adapter that can attach a terminal mid-scenario. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): interpret the activation reply where it is reported `reportActivationOutcome` took a verdict, which left the timer site hand-building `{ accepted: false }` for the case where there is no reply to interpret at all. Taking `RpcResponse | null` and interpreting inside puts the operation's own policy at both sites and spells the absent reply as absence. Nothing is lost: `worktreeActivate` reads an unchecked payload and admits every success, so its `interpret` cannot throw on a reply either site can receive. No golden moves; the effect digest is repinned. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): give the create family its mount step back The create adapter mounted inside its first action so the create would run ahead of the flush that made React pay its one lazy `Math.random()` draw. stablyai#21088 pays that draw in the scheduler before it installs the seed, so the position of the mount no longer decides which seeded value `clientMutationId` reads, and the family goes back to the shape every other one uses: a declared `mount` step carrying the cells the hook reads as it renders — the worktree, the active tab, the device token — and a `create` step carrying the launch options it passes. The display-mode family keeps mounting from its `mount` action, which is that same declared shape and never was the workaround. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record the corpus at main's pin 9add08b Recorded at main's baseline in a detached-pin worktree with this branch's recorder, adapters and manifest. Main's own recorder on that pin reproduces main's 705 goldens byte-for-byte first, and this run reproduces the same 705 beside the 22 this branch adds, so the corpus is main's plus this family. Every body moved against the branch's previous recording: main replaced the `sent` request count with the shared write ordinal, which stamps every sender call, payload and effect. Six goldens moved headers only, all of them scenarios that send nothing and write nothing, so they had no entry to stamp. Counts follow the corpus: 727 goldens, 888 tests. The corpus still carries no `reply-salvage` effect — the 22 added goldens contribute no checked read at all, since this family's readers are the unchecked ones the inventory lists. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…7) (stablyai#21089) * test(mobile): record main's session reply behaviour at every unrecorded read site Step 7 for the session domain changes how 51 RPC readers read a *malformed* reply. Eleven of the session read sites had no recording family, so main's answer to a malformed reply at those sites was undocumented and the reader change would have had nothing to move. This commit is the before picture, taken from main's own tree with no product edit in it. Ten new families, twelve scenarios, twenty-five goldens: - `session.review-file-diff` / `session.review-branch-diff` — `git.diff` and `git.branchDiff` read through the review projection, which the Changes screen's verbatim readers do not cover. - `session.review-git-mutations` — the single-file `git.stage` / `git.discard` and the bulk stage sweep's second `git.stage`. - `session.review-send-sheet` — `session.tabs.list` read for the agent terminals the send sheet lists, the third reader on that method. Needs an `open-send-sheet` action on the review-action adapter, which re-digests that family's eight goldens on `adapterSha256` and nothing else. - `session.browser-tab-create` — `browser.tabCreate`. - `agentSession.structured-create` — `agentSession.create`, whose family base only ever covered the support probe. - `session.tab-rename` / `session.tab-close-session` — `terminal.rename` and `session.tabs.close`. - `settings.new-tab-local-agents` — `preflight.detectAgents`, the arm the new-tab loader takes for a workspace with no connection. `baseline` is repinned to main's tip because two commits (stablyai#20659, stablyai#21004) touched a fenced path after the pilot's pin, so `--record` refuses on main's own tree until it moves. The repin is what rewrites `baseline` on all 705 existing goldens; nothing else about them moves. Decoded against origin/main through the value pool: 705 header-only (`baseline` on every one, `adapterSha256` on the eight review-action goldens), 0 body-moved, 25 added, 0 deleted. Not covered, with the reason: the chunked clipboard upload's `appendImageUploadChunk`, `commitImageUpload` and `abortImageUpload` cannot be matrixed, because `replyMatrixSites` takes every completion in the base scenario and the chain's later params carry the `uploadId` the start reply named. Driving `clipboard.startImageUpload#1` therefore makes main send an append whose params no scripted step matches, and the recorder raises `Request params mismatch: clipboard.appendImageUploadChunk#1` instead of recording. The two families were written, probed and removed. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): checked reply readers for the session domain (step 7) Fifty-one unchecked reply readers across nine files become checked zod readers, so a malformed host reply surfaces as one readable error at the operation boundary instead of a downstream `TypeError`, a rendered `undefined`, or a screen left ready over garbage. Deliberately a behaviour change on malformed replies only. Eight schema modules, one per reply family, each recording the consumer line behind every requirement and the host handler that publishes it: - `clipboard-image-reply-schema.ts` — the upload slot's `uploadId`, the commit and single-frame path strings, and the two legs whose body nothing reads. - `github-pr-mutation-reply-schema.ts` — the `{ ok, error }` status envelope as two variants, and the bare-boolean confirmation. - `github-pr-entity-reply-schema.ts` / `github-pr-read-reply-schema.ts` — the seven PR sidebar reads. Every identity requirement the hand parsers had is kept, so a payload that degraded to null still degrades to null; what changes is a payload that is not the declared container at all. - `diff-review-reply-schema.ts` — the normalized branch compare, the review notes on the worktree record, the three file-diff arms, and the file-level git mutations. - `review-terminal-reply-schema.ts`, `session-launch-reply-schema.ts`, `session-read-reply-schema.ts`, `session-write-reply-schema.ts` — the review send sheet, the launch paths, the session screen's reads and its writes. Requirements are exactly the members a consumer reads unguarded, everything else is a salvaged optional with main's own default applied in the transform, and no schema is `.strict()`: a member a newer host adds passes through untouched. Enum arm sets that a reader compares against pass through or degrade to the arm the reader handles most conservatively; the two closed sets — the committed change status and the diff kind — are closed because main *dropped* an arm it did not know rather than passing it through, and degrading them would draw a row or render a diff main never did. No member is coerced on the way back to the host. `github-pr-parsers.ts`, `github-pr-comment-parsers.ts` and `github-pr-value-readers.ts` are gone; their suite is now the parity record for the schemas that replaced them, with the four cases that refuse rather than degrade marked as such. Twelve call-site casts are deleted, and three dead "response was invalid" branches with them: the reader refuses those replies now, so the error names its method. The nine session files come off `unchecked-rpc-reader-inventory.ts` entirely rather than being lowered. `git show --stat` on this commit touches nothing under `mobile/rpc-foundation`. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): unit-pin every session reply schema's decision Three kinds of case, one per kind of decision the schemas encode: a member a consumer reads unguarded is required and its absence refuses, an arm set a reader compares against degrades to the arm that reader handles most conservatively, and a reply whose arms need different members is declared as variants and each arm is read. The last suite is the wire-compatibility claim: a member no reader knows passes straight through, on the markdown document, the upload slot and the terminal inventory alike, so a newer host is never refused for a field mobile does not read. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): refresh the corpus for the session domain's checked readers Repins `baseline` to the last commit touching a fenced path and re-records all 730 goldens, which is the disclosed behaviour change taken as an observation. Decoded through the value pool against the pre-refactor tree on this branch: 688 header-only with `baseline` the only key that moved, 42 body-moved, 0 added, 0 deleted. The 42 are seven named scenarios and thirty-five matrix goldens, and every moved checkpoint's own reply is malformed or refused. Three `normal` partitions appear in the list and none of them reads a well-formed reply differently: the review file-diff family's base scenario drives three legs and its third is scripted `{ kind: 'unknown' }`, so that leg's checkpoint moves in every variant, the varied leg included. The same append-only-history effect puts `pr-read-upstream-error`'s `no-pr` checkpoint in the list for the malformed PR recorded before it. What the corpus now records, in one sentence: a property read on null, a V8 destructuring message shown to the user, and four hand-written "response was invalid" strings are replaced by one message that names the method, and four screens that published a malformed payload as ready state now show an error instead. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): split the expanded check run out of the PR read schemas `github-pr-read-reply-schema.ts` was 328 code lines against the 300-line cap. The expanded check run and the annotations, jobs and steps listed under it are one reply with no reader in common with the other six, so they move to `github-pr-check-reply-schema.ts` whole. A move, not an edit: no schema changes and no golden moves. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the corpus to the branch's last fenced-path commit The schema-module split touched `mobile/src`, so `--record` refuses on the pin the previous refresh left behind. Repins to that commit and re-records. Decoded against the previous corpus: 730 header-only with `baseline` the only key that moved, 0 body-moved, 0 added, 0 deleted — the split is a move, and the corpus says so. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): drop the worktree display-name cast's type import The live-title read is typed by its schema now, so the cast it annotated is gone and the import it needed with it. oxlint flags the leftover. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the corpus to the branch tip The unused-import removal touched a fenced path, so the pin moves with it. Decoded against the previous corpus: 730 header-only on `baseline` alone, 0 body-moved, 0 added, 0 deleted. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): contain a refused prChecks reply to the checks section The checks read was the one phase-1 dependency that could take the whole PR sidebar down. `loadPrSidebarData` routed `!checksOutcome.ok` through `failureState`, so a host whose `github.prChecks` shape drifted cost the user the title, body, comments, reviewers and merge controls — everything they opened the sidebar for — over a section that renders a row of icons. Main never noticed because its unchecked reader answered `[]` for the same reply; this branch's reader refuses it, which is correct, and which is what makes the containment necessary. Contained the way phase 2 already is: a failed read keeps `kind: 'ready'`, empties `checks`, and carries the message in a new `checksError` so the checks section can say what happened. The sidebar can no longer reach `error` or `blocked` on the checks read alone. Also pins the enum departure this PR makes deliberately. The degrading arm sets go through `salvagedOptional(name, z.enum(...))` rather than `openEnum` because `openEnum` refuses a non-string where main mapped it to the conservative arm; nothing held that, and all 2477 tests stayed green against the swap. Six cases now hold both halves: a non-string degrades on the three open sets, and an unknown arm drops the row on the closed ones. Four deletions the reviewer found: a reaction-token alias with no importers, the `errorType`/`fetchedAt` the branch-lookup reader fabricated to satisfy a type whose only consumer reads neither, two bare schema aliases, and a quick-commands pass-through with two callers. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the corpus to the containment commit `--record` refuses unless the product tree equals `baseline`, so the fix above moves the pin. The corpus re-recorded in place against it: 730 goldens, every one header-only on `baseline`, no observation moved. No observation moved because no family reaches the code the fix changed. The `github.pr-read` family calls the seven wrapper reads directly and records their `{ ok, error }` outcomes; `loadPrSidebarData` sits a layer above that and no scenario mounts it. The prChecks outcome is identical before and after — what changed is what the sidebar does with it — so the unit suite is the only oracle for the containment. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): record the PR sidebar's checks containment The containment landed with no golden: no scenario mounted `loadPrSidebarData`, so the row in the delta table rested on unit tests alone. `PrSidebarLoadDeps` is five client-taking functions, so a new adapter drives phase 1 directly and records the `PrSidebarState` it resolves to — no React host, and no edit to an existing adapter, so no recorded golden moves. Two scenarios: a normal load, and one whose checks leg answers a shape the reader refuses. The matrix over the base then drives all eleven partitions at `github.prChecks#1`, and every one of them records `ready` with a `checksError` where main took the whole sidebar to `error`. `pr-sidebar-checks-failure-state` is the mutant that routes the refusal back through `failureState`; it moves both `pr-sidebar-checks-refused` and the prChecks matrix golden. Also pins two closed-and-required enum decisions that were free to become defaults — an unknown check-summary state drops the summary block, an unknown reaction content drops the reaction — deletes four exported type aliases and five enum constants with no reader outside their own file, makes `PRChecksSection`'s `checksError` required so a second caller cannot silently lose the message, and stops the header reading "No checks" when the checks were unreadable rather than absent. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the corpus to the pr-sidebar family commit Six new goldens — two pilots and the four matrix sites the base scenario scripts — and `baseline` on the 730 that already existed. No body moved and no `adapterSha256`: the family is a new adapter module, so nothing recorded through another one re-digests. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record the corpus against the merged main Repins `baseline` to the merge commit and re-records all 736 goldens in place. Against `origin/main` the 705 shared goldens move only on `baseline` (672 of them header-only), leaving the same 33 body moves and the same partitions the branch carried before the merge, plus its 31 added goldens. Every body also takes main's recorder shape from stablyai#21088: `sent` becomes `ordinal` over one interleaved write counter, subscriptions record a cleanup checkpoint, and a salvaging read now reports a `reply-salvage` effect naming what it dropped. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): keep an explicit null on the two tri-state PR flags `autoMergeAllowed` and `mergeQueueRequired` carry three answers, not two: `null` is GitHub saying auto-merge is not allowed, `undefined` is the host not carrying the member at all. The readers coalesced the null away, so a well-formed reply read differently from the parsers they replaced, which preserved it explicitly. Both shared types already declare `boolean | null`. No consumer separates the two today — `pull-request-auto-merge-availability` compares with `=== true` and `!== false` — so this is parity, not a visible fix, which is exactly why it needed a test. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the corpus to the tri-state flag commit All 736 goldens move on `baseline` alone: no scenario scripts an explicit null on either flag, so preserving it changes no recorded screen. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): check the two session-write readers stablyai#21083 brought Step 7 empties the session block of the unchecked-reader inventory, and stablyai#21083 landed two readers into it after that: the New Tab create's member read of `tab`, and the display-mode toggle's payload. Converting them is what keeps the claim true — a session line reappearing would mean the domain is not migrated. `created-terminal-tab` requires `tab.id` and `tab.type === 'terminal'`, because the strip keys the new tab on the id and spreads the rest into a union whose arm `type` picks. `terminal`, `title` and `terminalTheme` stay optional behind main's own guards, and unknown members pass through. `terminal-display-mode-set` reads nothing, so it takes the same `z.unknown()` the other five unread writes take. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin and re-record over stablyai#21083's corpus All 736 goldens this branch already had move on `baseline` alone, and stablyai#21083's 22 arrive beside them. One of the 22 moves against main's own recording: `matrix-session.create-terminal-session.tabs.createterminal-1`, where the New Tab create's five malformed partitions read `Cannot read properties of undefined (reading 'tab')` and now read the method's own message. Two of them also stop unsubscribing the terminal the user was watching before the property read threw, so a create that never happened no longer costs the live pane its subscription. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * docs(mobile): say what carries a refused create reply to the catch Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

Step 6, migration PR 2: the last four raw-port references in the session route — the startup effect's two
worktree.activatesends, the New Tab terminal create and the terminal menu's display-mode toggle — now send through typedRpcOperations. No-behaviour-change contract proven by goldens recorded at the pin before the refactor and replayed unchanged after it.The block these three files were listed under does not exist. All three were held back as "unrecorded, blocked on a WebView-ref substitute". None of them imports the terminal WebView, and all three send with no ref at all: the display toggle reads a
{cols, rows}cell and a device-token cell, the create path calls scope callbacks, and the startup effect calls scope callbacks. The ref lives one layer down inuse-mobile-session-terminal-subscription.ts, which none of the three imports. No substitute is added here; that decision belongs to whoever recordsterminal.subscribe.Diff composition (vs
origin/main)Commit order (the contract)
9f18985be0adapters, scenarios and goldens, recorded at the pina28085adbfbefore any product edit.82d3866526the refactor: product source only.git show --stat 82d3866526 -- mobile/rpc-foundationis empty.6ac6429cfainventories and the route-parity pins.c73ef53d5cone comment, naming the census survivor in the operation it belongs to.043522e2f6review round 1: the three scenarios that reach the empty arm of a guard, recorded at the same pin.a4aa079225the three mutations those scenarios kill, and the README's fifth bounding fact.65e9dadae5TerminalCreateResultdeleted; the migration left it with zero readers.8fa72af89dreview round 2: the create family's wire members become scenario arguments, with the four scenarios that reach the arms they open, recorded at the same pin.5a7cb845fbthe three mutations those scenarios kill, the manifest property the witness's abort-as-kill rests on, and the known-open-holes list.dabaec9b9freportActivationOutcometakes the reply and interprets it itself.8e4e5b128bthe single merge oforigin/main: main's 705 goldens and its 351 scenarios arrive untouched, this branch's 22 and 17 sit beside them.7ed55efcb1the determinism workaround comes out; the create family gets its declaredmountstep back.9e78b27840the corpus re-recorded at main's pin9add08bb59, and the two counts that follow the corpus.Migration (4 refs, 3 files)
use-mobile-session-startup.ts×2worktree.activateworktreeActivate(worktree.activate-or-skip)accepted && headlessActivationNeedsHostRenderer(value)is what main asked ofresponse.ok ? response.result : null.use-mobile-session-terminal-create-actions.tssession.tabs.createTerminalsessionTabCreateTerminal, beside the other session-screen writesrequire-result-or-throw-message. The throw lands in thecatchthat already calledreportCreateFailurewith the host's message, including an empty message falling back to the screen's own copy. The reader is the unguarded.tabread, because that policy rethrows a reader's exception instead of converting it, which keeps a null or absent result failing where it failed.use-mobile-session-terminal-stream-display.tsterminal.setDisplayModeterminalDisplayModeSetsuccess-result-or-skip, verdict unread, the wayterminalBufferClearalready works. Main awaited the envelope and looked at nothing in it; only a transport rejection was ever a failure.Not reused:
reviewTerminalCreateRundeclares the same method and policy but creates a throwaway terminal for a review prompt and reads the handle to address a send, while this one adopts the tab into the session strip. Sharing would let either reply contract reach the other screen — the rulesessionWorktreeNotesWritealready states forworktree.set.No new acceptance policies. No substitute member added anywhere.
The count was five, not six
The memo and the brief both say six raw references in these three files. The AST scanner says five: startup 2, create 2, display 1. Four are the methods in scope. The fifth is the prompt
terminal.sendthe create drops into the terminal it just made, and it stays on the raw port with its own stated reason: it is the onlyterminal.sendcaller that falls back to its own copy when the host refuses with an empty message, so none of the three existingterminal.sendoperations carries its acceptance, and a fourth method is outside this migration. It is recorded either way —matrix-session.create-terminal-terminal.send-1drives all eleven partitions at it — so whoever migrates it inherits the parity oracle.Pending raw-port inventory 12 files / 21 refs → 10 / 17.
Recorded from the pin, because this branch does not repin
--recordrefuses any product tree that is notbaseline, and this branch's tree is the migration itself. The README's detached-pin worktree recipe is the only one that runs here: a worktree at the pin, this branch'srpc-recording/and manifest laid over it, goldens to a scratch directory, result copied back. All four recording passes used it, and the goldens then replay clean against this branch's tree, which is itself the proof that the migration moves no recorded observation.The last pass records at main's own pin,
9add08bb59, whichbaselinehas said since main repinned it. The control ran first: main's recorder, on that same pin worktree, reproduces main's 705 goldens byte-for-byte. The branch's recorder then reproduces the same 705 beside its own 22, so the corpus on this branch is main's corpus plus one family.baselineis never repinned here; the merge brought main's value in.A determinism hazard the two runs caught, and what retired it
clientMutationIdmixesDate.now()andMath.random(). Both are pinned by the scheduler, and that was still not enough: React draws oneMath.random()of its own insideenqueueTask—("require" + Math.random()).slice(0, 7), evaluated once per process to hide arequirefrom bundlers — andrunRecordingflushes throughawait actafter every step. With a scriptedmountstep, the create's draw was the second of the seeded sequence on the first recording in a process and the first on every later one, so the recorded key depended on test ordering and the two determinism runs disagreed:Request params mismatch: session.tabs.createTerminal#1, onclientMutationIdalone. Until #21088 the create adapter mounted from its first action instead, ahead of any flush, which made its draw the first of the sequence whether React was warm or cold.#21088 pays that draw in the scheduler, before it installs the seed. The workaround is gone: the create family mounts from a declared
mountstep like every other family, and the step carries the cells the hook reads as it renders — the worktree, the active tab, the device token — while the launch options stay on thecreatethat passes them. The display-mode family always mounted from its own declaredmountaction, which is that same shape and was never the workaround, so nothing was deleted there.Census
Applied and reverted by hand. Twelve against the raw-port code, before the refactor, plus one ordering mutation measured after it, each naming a golden it failed:
worktree.activateplain sitesession-startup-both-activation-sitesworktree.activatenewly-created sitesession-startup-both-activation-sitessession.tabs.createTerminalsession-create-terminal-replaces-activeterminal.setDisplayModesession-terminal-display-mode-to-desktopworktree.activateplain sitematrix-session.startup-worktree.activate-2worktree.activatenewly-created sitematrix-session.startup-worktree.activate-1session.tabs.createTerminalsession-create-terminal-refusedterminal.sendsession-create-terminal-with-promptunsubscribeTerminalon replacesession-create-terminal-replaces-activesession-startup-keeps-terminals-visible-on-reconnectfetchTerminalspasssession-startup-floating-route-skips-activationsetDisplayModesession-terminal-display-mode-auto-take-floorensureSessionTabssession-startup-keeps-terminals-visible-on-reconnectTwo notes on how these were framed, because the brief's wording did not fit the code:
worktree.activatesends" is not reachable as written: the two sites are mutually exclusive per pass, one oncreated !== '1'and one oncreated === '1'. What is reachable is swapping which branch each belongs to, and that is the twelfth row. The orderable pair that does exist is the plain send againstensureSessionTabs, andsenton the effect list pins it: moving the send after the tab load takesensure-session-tabsfromsent: 1tosent: 0. That is the thirteenth row, and it kills.sleepingAgentWake: "unsupported-headless"before the census was finalised; it kills now. That is the scenario gap the census exists to find.Seven more against the migrated code, after the refactor. Six kill: wrong method at all three operations,
sessionTabCreateTerminal's acceptance and its reader, andworktreeActivate's acceptance.Survivors
Seven mutations survived the suite as it stood before review. Six were guards or wire members, and each is now killed by a scenario that declares the cell it reads as empty; they live in
mutants/operation-mutations.tsandmutants/probe-hole-witness.test.ts, which asserts the kill and that every other scenario of the same family still cannot see it.viewportRef.current &&dropped,use-mobile-session-terminal-stream-display.tssession-terminal-display-mode-auto-without-viewportdisplay-mode-unmeasured-viewportDEVICE_TOKENwas an adapter constant, so no scenario could empty the cellsession-terminal-display-mode-auto-without-device-tokendisplay-mode-unconditional-client.catch(() => null)dropped onensureSessionTabs(),use-mobile-session-startup.tssession-startup-refused-tab-load-still-loads-terminalsstartup-tab-load-rejects-sequenceafterTabId: activeSessionTabId ?? undefinedsendingnull,use-mobile-session-terminal-create-actions.tssession-create-terminal-without-active-tabcreate-after-tab-id-nullcommandandagentPromptmembers swappedsession-create-terminal-runs-a-quick-command,session-create-terminal-launches-an-agent-quick-commandcreate-quick-command-keyscreatingTerminalRef.currentdropped from the create guardsession-create-terminal-ignores-a-second-create-in-flightcreate-second-tap-in-flightterminalDisplayModeSet's acceptance swapped forrequire-result-or-throw-messageThe seventh is a property of the call site, not a gap in the recordings: the toggle reads no verdict and its own
catchswallows a throw, so no acceptance policy is observable there and no scenario can make one so.c73ef53d5csays that in the operation itself. The first caller that reads a verdict is what makes it pinnable. The method, the params and the two conditional members are what the goldens do hold at that site.Four of the six closures are detected at the transport's params assertion rather than as a golden divergence, because the mutant changes a param the scenario completes. The witness reads that one message as a kill, narrowed to it and taken only after the anchor is proved applied — and that reading now rests on an assertion over the whole manifest rather than on an argument: no scenario completes a request after its last checkpoint, so an aborted send always suppressed an observation a golden holds.
One more survivor is disclosed rather than closed, in the recorder README's known-open holes: deleting the
activeHandleRef.currentguard from the startup effect's 1800 ms created-session timer. Nothing a scenario can drive attaches a terminal between the mount and that timer, so the arm the guard exists for cannot occur here; in the product it can, and the mutant then sends a secondworktree.activatefor a live session. That section no longer states a count in prose — it is a list, and each entry names the site, the mutant and why no scenario sees it.Scenarios and coverage
Seventeen scenarios, three families, twenty-two goldens (seventeen pilots, five reply matrices).
session.startupdrives both activation sites in one scenario, the way the product does: the auto-create clearscreatedoff the route, the effect re-runs on the same mount and takes the other branch. That is what gives the matrix two sites instead of one. The others pin the floating-route gate, which sends nothing, the reconnect path that keeps the terminals visible, and a refused tab load that must not stop the terminal loads behind it.session.create-terminaldrives the prompt path as its base, so both the create and the prompt send get a matrix. The other six pin the plain replace, the host refusal, a create that returns no handle, a create on a session with no active tab, the two quick-command launch shapes — a shell command with its delivery and an agent prompt with its agent — and a second tap while the host is still answering the first.session.terminal-display-modepins both toggle directions — theautodirection is the one that forwards the viewport — the in-flight set dropping a second toggle, and the twoautosends a phone makes before it has measured itself or been given a device token.The viewport pair, the device token, the tab-load outcome, the worktree, the active tab and the four launch options are scenario arguments, not adapter constants, so every member on the wire traces to a line in the manifest. A stub may reject where the product awaits it, on the scenario's instruction; it shapes no param and swallows no throw. The create's
errorToastis now forwarded independently of the prompt, which is what the product does — the refused scenario had been declaring a toast the adapter dropped, and its golden recorded no effect for it.Inventory changes
unvalidated-rpc-request-port-inventory.ts: startup and display-mode entries deleted, create lowered 2 → 1 with its own reason. 12 files / 21 refs → 10 / 17.ScenarioStepgainedframe; it now says what actually blocks it, which is that no scenario has been written foraccounts.subscribe.unchecked-rpc-reader-inventory.ts:mobile-session-write-operations.ts8 → 10, named in the header the way refactor(mobile): send the subscription-gated holdouts through typed RpcOperations (step 6, migration 1) #20954's three are.rpc-subscription-inventory.ts: unchanged. None of the three files callsclient.subscribe; what they call are scope callbacks.TerminalCreateResultdeleted. Reusing it at the cast site would have kept the cast and only renamed it.Evidence
adapterSha256on all fifteen because their modules were edited, andscenarioSha256on the seven derived from a scenario that now declares its device token. No body moved, which is the point — declaring the token changed no param.adapterSha256andscenarioSha256. The one body issession-create-terminal-refused, which gains the failure toast its scenario always declared and the adapter had been dropping. Against the branch point the corpus reads 705 identical, 22 added, 0 moved, 0 deleted.origin/main: 705 identical, 0 header-only, 0 body moved, 22 added, 0 deleted. Every golden main owns arrives from the merge and survives the recording untouched.dabaec9b9f, the same pass reads 0 identical, 6 header-only, 721 body moved, 0 added, 0 deleted — main's work, not this branch's. Main replaced thesentrequest count with one shared write ordinal stamped on every sender call, payload and effect, so every golden carrying any of the three moved in body. The six that moved headers only are the scenarios that send nothing and write nothing:aivault-resume-prepare-skipped,clipboard-image-attachment-cancelled,native-chat-image-upload-cancelled,native-chat-session-option-pick-empty,sc-prerequisite-skipped,terminal-query-reply-unsubscribed. Headers moved on all 727 forbaselineandrecorderSha256, on 45 foradapterSha256(35 of them main's shared client-context exposure, 10 this family's restored mount) and on 10 forscenarioSha256, all 10 the create scenarios that gained the mount step.baseline: 9add08bb59, main's own value, arrived through the merge.baselineis not repinned anywhere on this branch.82d3866526touches no file undermobile/rpc-foundation, and the recording suite passes unchanged across it.Gates
All with
ORCA_BACKGROUND_LAUNCH=1.One thing to know for anyone repeating this: running a root-level package-manager script in a
node_modules-symlinked worktree triggers a pnpm lifecycle rebuild of the native deps in the shared tree. The root typecheck and quality gates above were run by invoking their scripts withnodedirectly to avoid it. Nothing changed in the shared install or the lockfile.