Repository navigation
test(mobile): recorder follow-ups — write ordinal, teardown streams, context anchor, salvage observation, provider pass-through, React draw - #21088
Merged
Conversation
…loads and effects `sent` stamped each payload and effect with the number of requests sent at write time, which orders those two lists against sends but never against each other. A family that sends no requests therefore had every stamp at `0`: moving `host-worktree-refresh.ts`'s two initial snapshot reads from after `client.subscribe` to before it moved none of the 705 goldens. One monotonic counter per recording now stamps requests, payloads and effects alike at the moment each is written, so the three append-only lists are ordered against each other. The same reorder now fails five goldens. A request is stamped at the logical `sendRequest` call rather than when its physical payload is published, so a send that waited for connected carries two distinct stamps. Full re-record from the pinned baseline: 699 bodies moved, 6 header-only, 0 added, 0 deleted; the only moved JSON paths are `sent` leaving and `ordinal` arriving on `sender`, `payloads` and `effects`. Decoding with those two fields stripped leaves all 705 header-only. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Closing a stream only writes to the wire when its method has an unsubscribe builder. `notifications.subscribe` has none, so a cleanup that forgets its local `unsubscribeStream()` leaks a live registry record and nothing on the wire changes. Until now that class was covered by one hand-written scenario per method, which stops the stream and cuts over so the leak reappears as a second subscribe payload. Teardown now asks each session's `RpcClientStreamRegistry` what it still holds, after the product's cleanup and before the transport disposes it, and records a non-empty answer as a `streams-registered-at-teardown` effect carrying each stream's method, subscribe payload and cancelled flag. The set is read off the registry's own map: a mirror kept by the recorder would reproduce the product's bookkeeping rather than observe it. Deleting `unsubscribeStream()` from `mobile-notifications.ts` fails 7 goldens now, against 1 before. Re-record: 4 bodies moved, 701 header-only, 0 added, 0 deleted. All four are the two `runtime.clientEvents.subscribe` matrices, on partitions whose subscribe reply is not a well-formed `ready`: with no subscription id to unsubscribe with, the registry deliberately holds the cancelled record, which is why the observation carries `cancelled`. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
… on the product source Five adapter modules each carried `exports.recorderHostClientContext = Ctx;` inside a source string appended to `client-context.tsx`. `Ctx` is a module-private local, so the reference lives in a string no type checker follows: renaming it typechecks clean and fails a recording with a `ReferenceError` a hundred seconds in, five times over. `hostClientContextExposure` and `loadHostClientContext` are the one copy, and `adapter-seam.test.ts` asserts the declaration the exposure names still exists exactly once in `client-context.tsx` and refuses a sixth inline copy. A rename remains invisible to `tsc` — nothing but editing the fenced product module makes a private local checkable — so the anchor is what turns it into one failure that says what moved. Also splits the subscription tests out of `recording-runner.test.ts`, which items 1 and 2 had pushed past `max-lines`. Re-record: 705 header-only, 0 bodies moved, 0 added, 0 deleted; `recorderSha256` on all 705 and `adapterSha256` on the 23 goldens mounted through the five modules. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
`collectSalvageDrops` builds a report on every decoded reply — which array elements a `salvagingArray` threw away, which members a `salvagedOptional` read as absent — and `classifyRpcReply` puts it on the outcome, where nothing reads it. Which rows a reply lost was therefore visible nowhere, including in a golden. The recorder wraps `classifyRpcReply` on the mounted module, the one seam every checked read passes through and the only one that knows the operation the drop happened under, and records a non-empty report as a `reply-salvage` effect. No product code changes; the report was already being built and discarded. No golden carries one. All 19,384 checked reads in the corpus decode their reply whole, because the reply matrix varies the envelope a host sends rather than the shape of a row inside a result. The observation pins that absence, and moves the first time a narrowed element or member schema drops a recorded row — including where nothing downstream reads it. `salvage-observation.test.ts` is what keeps the observation honest, driving a malformed row and a malformed optional through the real `git.status` reply schema. Re-record: 705 header-only on `recorderSha256`, 0 bodies moved, 0 added, 0 deleted. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…his build does not list `HostedReviewCreate.provider` was a closed `z.enum`, so a client repeating back a provider a newer host named in its own eligibility reply had its create rejected at params validation. Mobile worked around it with a SAFETY-annotated assertion: narrowing to `'unsupported'` before sending would have made the host refuse its own provider, so the token was cast through instead. The schema member is now `z.string()`, and both create handlers narrow through `supportsHostedReviewCreation` before calling the runtime, so an arm this build does not know answers `unsupported_provider` with readable copy rather than a params error the client cannot act on. `createHostedReview`'s own refusal is the single source of that copy. The mobile assertion is deleted. Product change on a fenced path, so the goldens are not re-recorded: the whole recording suite replays green against the corpus committed in the previous commit, 825 passed, zero golden movement. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…refusal test The changed-code quality gate counts a new `as unknown as OrcaRuntimeService` as a finding. A narrower stand-in does not exist: the interface has 1047 members and `Pick` of the three this test uses is not assignable. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…eded run React resolves `enqueueTask` by reading `module['require' + Math.random()]` and memoizes the result, so a process draws exactly one `Math.random()` the first time it awaits `act`. The runner drains through `act` after every step, so that draw landed inside whichever recording ran first and ate the seeded sequence's first value: a family recording a `Math.random()`-derived param recorded one value when it ran alone and a different one when it ran after any other family, and an adapter could only dodge it by drawing in its factory ahead of the first drain. The scheduler now pays that draw once per process, before it installs the seeded generator, so the seeded sequence starts at the same value for every recording. Priming is awaited, which makes `start` async. Goldens re-recorded: 705 header-only, `recorderSha256` alone. No golden carried a first-in-process value, so nothing moved in a body. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Jinwoo-H
added a commit
that referenced
this pull request
Sep 16, 2026
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
Contributor
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes
- Shared monotonic write ordinal —
write-ordinal.tsplusrun-recording.tsandscripted-rpc-transport.tsnow stamp requests, payloads and effects from one per-recording counter, replacing the request countsent; every golden was re-recorded (699 body moved, 6 header-only per the decode). - Teardown stream observation —
registeredStreams()reads each session registry's ownstreamsmap andrun-recording.tsrecords a non-empty answer asstreams-registered-at-teardown; the four goldens that carry it are allcancelled: trueruntime.clientEvents.subscriberetentions. - Single host-client context exposure —
host-client-context-exposure.tsreplaces five inline copies;adapter-seam.test.tsanchorsCtxonclient-context.tsxand refuses a sixth copy. - Salvage observation —
salvage-observation.tswraps the mountedclassifyRpcReply(reached through the loader proxy at call time, sorpc-operation.tschecked reads are covered);salvage-observation.test.tsdrives a real dropped row. - React draw priming —
vitest-recording-scheduler.tspays React's one lazyMath.random()before installing the seed;RecordingScheduler.startis nowasyncand every call site awaits it. - Provider params widening —
HostedReviewCreate.providerisz.string()and both create RPC handlers narrow throughsupportsHostedReviewCreation; the mobile SAFETY assertion is deleted and a host test covers both methods. - Test split — subscription tests moved out of
recording-runner.test.tsintosubscription-recording.test.tsto stay undermax-lines.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
The teardown observation read the registry after `dispose()` returned but before the scheduler drained, so a cleanup that closes its stream on a due 0ms timer had not run yet and was recorded as an uncancelled registration — the one shape this observation reserves for a cleanup that never ran. A deferred close and a stream nobody ever closed were byte-identical. The drain now runs before the read, with the transport still disposed after it. A second drain stays after disposal: tearing the registries down rejects what the product still awaited, and an unhandled rejection is an effect the cleanup checkpoint has to see. Also: the registry size comparison in `registeredStreams()` could never fire, because `size()` returns `this.streams.size` on the same object; `RECORDER_HOST_CLIENT_CONTEXT` is used only in its own module and no longer exported; and `streamPayloads` now says what it holds, which is every frame the registry publishes rather than only subscribes. Goldens are stale in this commit and are re-recorded in the next one. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Main repinned the recording baseline to 97aa5ff in #21092, which rewrote the `baseline` header of all 705 goldens and the manifest. Every golden and the manifest are resolved to main's version: the re-record in the next commit overwrites them, and taking main's side keeps the merge commit itself a faithful copy of the repin rather than a half-merged corpus. No non-golden conflicts. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…eardown drain Recorded from a detached worktree pinned at 97aa5ff with this branch's recorder laid over it, because two fenced product files still differ from the pin: the `hostedReview.create` provider widening in `src/shared` and the mobile assertion it removes. `--record` in place refuses on that, by design. A control run of the same harness with main's own recorder reproduced main's 705 goldens byte-for-byte first, so anything below is attributable to this branch. Against main, with `sent` and `ordinal` stripped: 701 header-only, 4 body moved, 0 added, 0 deleted. The four are the two `runtime.clientEvents.subscribe` matrices already disclosed. Moving the drain above the teardown read moved nothing: every non-empty set in the corpus is a cancelled record waiting on a subscription id no drain can deliver. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Contributor
There was a problem hiding this comment.
ℹ️ No new issues in the follow-up commits — one minor documentation-precision suggestion inline.
Reviewed changes
This pass covers the four commits since the prior pullfrog review: main's baseline repin brought in by the merge, the teardown drain, and the re-recorded corpus.
- Repinned the recording baseline to
97aa5ff19b— merged main's own repin from #21092, which this branch had been missing;pilot-scenarios.jsonand every golden header now name it. - Drained before reading the streams left at teardown —
runRecording's teardown now awaitsscheduler.flush()after the product'sdispose()and beforeregisteredStreams(), so a close deferred to a due timer is no longer recorded as an uncancelled registration; the second flush aftertransport.dispose()stays for rejection effects. - Removed the tautological registry size cross-check in
registeredStreams()(size()returnsstreams.sizeon the same object, so it could never fire) and un-exportedRECORDER_HOST_CLIENT_CONTEXT, which only its own module reads. - Extended the teardown test to
'never' | 'sync' | 'timer'and re-recorded the whole corpus. Spot-checked the larger golden diffs against main: they are value-pool ref rehash fromsent→ordinal, not semantic change.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
`subscription-recording.test.ts` annotated a mount with `RpcClient` without importing it: vitest strips the annotation and mobile's tsconfig excludes `**/*.test.ts`, so neither gate saw it. Typechecking the two moved suites under a throwaway config that includes them also surfaced `sampleGolden` missing the `adapterSha256` header the format has required since version 5. The README's teardown claim is scoped to a due timer, since `flush()` only runs work due at the current virtual time and a later timer is still registered at the read. Neither file feeds `recorderSha256`, so the corpus is unchanged. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The sixth-copy guard read only `adapters/`, so an inline copy appended to an adapter failed and a new file under `adapters/` failed, but the same literal in an engine file passed every assertion. Scan both directories, TypeScript sources only, since the README quotes the string to document it. `host-client-context-exposure.ts` holds the template with its interpolations rather than the literal, so it still cannot match itself; a throwaway engine file carrying the literal fails the test, and the file is otherwise green. Also narrows the register's import statements before reading `moduleSpecifier`, which drops a non-null assertion and the two TS2339 errors the `**/*.test.ts` exclude was hiding. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Jinwoo-H
added a commit
that referenced
this pull request
Sep 16, 2026
#21088 landed product changes on two fenced paths — the mobile hosted-review create params and the shared hosted-review contract — without moving the manifest baseline, so the corpus stayed pinned to 97aa5ff and --record refuses on main with "Product sources or lockfile differ from the pinned main baseline". Repin baseline to 9add08b, main's last commit to touch a fenced path, and re-record the whole corpus in place against it. No behaviour moved: decoding every golden through its own values pool against origin/main classifies all 705 as header-only with baseline the single moved key, and zero body moves, additions or deletions. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Jinwoo-H
added a commit
that referenced
this pull request
Sep 16, 2026
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
Jinwoo-H
added a commit
that referenced
this pull request
Sep 16, 2026
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
Jinwoo-H
added a commit
that referenced
this pull request
Sep 16, 2026
…tions (step 6, migration 2) (#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 #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. #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. #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
Jinwoo-H
added a commit
that referenced
this pull request
Sep 17, 2026
…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
ivanvykopal
pushed a commit
to ivanvykopal/orca
that referenced
this pull request
Sep 20, 2026
…context anchor, salvage observation, provider pass-through, React draw (stablyai#21088) * refactor(mobile-recorder): one shared write ordinal for requests, payloads and effects `sent` stamped each payload and effect with the number of requests sent at write time, which orders those two lists against sends but never against each other. A family that sends no requests therefore had every stamp at `0`: moving `host-worktree-refresh.ts`'s two initial snapshot reads from after `client.subscribe` to before it moved none of the 705 goldens. One monotonic counter per recording now stamps requests, payloads and effects alike at the moment each is written, so the three append-only lists are ordered against each other. The same reorder now fails five goldens. A request is stamped at the logical `sendRequest` call rather than when its physical payload is published, so a send that waited for connected carries two distinct stamps. Full re-record from the pinned baseline: 699 bodies moved, 6 header-only, 0 added, 0 deleted; the only moved JSON paths are `sent` leaving and `ordinal` arriving on `sender`, `payloads` and `effects`. Decoding with those two fields stripped leaves all 705 header-only. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * feat(mobile-recorder): observe streams still registered at teardown Closing a stream only writes to the wire when its method has an unsubscribe builder. `notifications.subscribe` has none, so a cleanup that forgets its local `unsubscribeStream()` leaks a live registry record and nothing on the wire changes. Until now that class was covered by one hand-written scenario per method, which stops the stream and cuts over so the leak reappears as a second subscribe payload. Teardown now asks each session's `RpcClientStreamRegistry` what it still holds, after the product's cleanup and before the transport disposes it, and records a non-empty answer as a `streams-registered-at-teardown` effect carrying each stream's method, subscribe payload and cancelled flag. The set is read off the registry's own map: a mirror kept by the recorder would reproduce the product's bookkeeping rather than observe it. Deleting `unsubscribeStream()` from `mobile-notifications.ts` fails 7 goldens now, against 1 before. Re-record: 4 bodies moved, 701 header-only, 0 added, 0 deleted. All four are the two `runtime.clientEvents.subscribe` matrices, on partitions whose subscribe reply is not a well-formed `ready`: with no subscription id to unsubscribe with, the registry deliberately holds the cancelled record, which is why the observation carries `cancelled`. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile-recorder): one host-client context exposure, anchored on the product source Five adapter modules each carried `exports.recorderHostClientContext = Ctx;` inside a source string appended to `client-context.tsx`. `Ctx` is a module-private local, so the reference lives in a string no type checker follows: renaming it typechecks clean and fails a recording with a `ReferenceError` a hundred seconds in, five times over. `hostClientContextExposure` and `loadHostClientContext` are the one copy, and `adapter-seam.test.ts` asserts the declaration the exposure names still exists exactly once in `client-context.tsx` and refuses a sixth inline copy. A rename remains invisible to `tsc` — nothing but editing the fenced product module makes a private local checkable — so the anchor is what turns it into one failure that says what moved. Also splits the subscription tests out of `recording-runner.test.ts`, which items 1 and 2 had pushed past `max-lines`. Re-record: 705 header-only, 0 bodies moved, 0 added, 0 deleted; `recorderSha256` on all 705 and `adapterSha256` on the 23 goldens mounted through the five modules. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * feat(mobile-recorder): record what a checked read salvaged `collectSalvageDrops` builds a report on every decoded reply — which array elements a `salvagingArray` threw away, which members a `salvagedOptional` read as absent — and `classifyRpcReply` puts it on the outcome, where nothing reads it. Which rows a reply lost was therefore visible nowhere, including in a golden. The recorder wraps `classifyRpcReply` on the mounted module, the one seam every checked read passes through and the only one that knows the operation the drop happened under, and records a non-empty report as a `reply-salvage` effect. No product code changes; the report was already being built and discarded. No golden carries one. All 19,384 checked reads in the corpus decode their reply whole, because the reply matrix varies the envelope a host sends rather than the shape of a row inside a result. The observation pins that absence, and moves the first time a narrowed element or member schema drops a recorded row — including where nothing downstream reads it. `salvage-observation.test.ts` is what keeps the observation honest, driving a malformed row and a malformed optional through the real `git.status` reply schema. Re-record: 705 header-only on `recorderSha256`, 0 bodies moved, 0 added, 0 deleted. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(source-control): let hostedReview.create carry a provider token this build does not list `HostedReviewCreate.provider` was a closed `z.enum`, so a client repeating back a provider a newer host named in its own eligibility reply had its create rejected at params validation. Mobile worked around it with a SAFETY-annotated assertion: narrowing to `'unsupported'` before sending would have made the host refuse its own provider, so the token was cast through instead. The schema member is now `z.string()`, and both create handlers narrow through `supportsHostedReviewCreation` before calling the runtime, so an arm this build does not know answers `unsupported_provider` with readable copy rather than a params error the client cannot act on. `createHostedReview`'s own refusal is the single source of that copy. The mobile assertion is deleted. Product change on a fenced path, so the goldens are not re-recorded: the whole recording suite replays green against the corpus committed in the previous commit, 825 passed, zero golden movement. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(source-control): annotate the runtime stub cast in the provider refusal test The changed-code quality gate counts a new `as unknown as OrcaRuntimeService` as a finding. A narrower stand-in does not exist: the interface has 1047 members and `Pick` of the three this test uses is not assignable. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile-recorder): pay React's lazy Math.random draw before the seeded run React resolves `enqueueTask` by reading `module['require' + Math.random()]` and memoizes the result, so a process draws exactly one `Math.random()` the first time it awaits `act`. The runner drains through `act` after every step, so that draw landed inside whichever recording ran first and ate the seeded sequence's first value: a family recording a `Math.random()`-derived param recorded one value when it ran alone and a different one when it ran after any other family, and an adapter could only dodge it by drawing in its factory ahead of the first drain. The scheduler now pays that draw once per process, before it installs the seeded generator, so the seeded sequence starts at the same value for every recording. Priming is awaited, which makes `start` async. Goldens re-recorded: 705 header-only, `recorderSha256` alone. No golden carried a first-in-process value, so nothing moved in a body. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile-recorder): drain before reading the streams left at teardown The teardown observation read the registry after `dispose()` returned but before the scheduler drained, so a cleanup that closes its stream on a due 0ms timer had not run yet and was recorded as an uncancelled registration — the one shape this observation reserves for a cleanup that never ran. A deferred close and a stream nobody ever closed were byte-identical. The drain now runs before the read, with the transport still disposed after it. A second drain stays after disposal: tearing the registries down rejects what the product still awaited, and an unhandled rejection is an effect the cleanup checkpoint has to see. Also: the registry size comparison in `registeredStreams()` could never fire, because `size()` returns `this.streams.size` on the same object; `RECORDER_HOST_CLIENT_CONTEXT` is used only in its own module and no longer exported; and `streamPayloads` now says what it holds, which is every frame the registry publishes rather than only subscribes. Goldens are stale in this commit and are re-recorded in the next one. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record the corpus after the baseline repin and the teardown drain Recorded from a detached worktree pinned at 97aa5ff with this branch's recorder laid over it, because two fenced product files still differ from the pin: the `hostedReview.create` provider widening in `src/shared` and the mobile assertion it removes. `--record` in place refuses on that, by design. A control run of the same harness with main's own recorder reproduced main's 705 goldens byte-for-byte first, so anything below is attributable to this branch. Against main, with `sent` and `ordinal` stripped: 701 header-only, 4 body moved, 0 added, 0 deleted. The four are the two `runtime.clientEvents.subscribe` matrices already disclosed. Moving the drain above the teardown read moved nothing: every non-empty set in the corpus is a cancelled record waiting on a subscription id no drain can deliver. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): restore the type imports the recorder test split dropped `subscription-recording.test.ts` annotated a mount with `RpcClient` without importing it: vitest strips the annotation and mobile's tsconfig excludes `**/*.test.ts`, so neither gate saw it. Typechecking the two moved suites under a throwaway config that includes them also surfaced `sampleGolden` missing the `adapterSha256` header the format has required since version 5. The README's teardown claim is scoped to a due timer, since `flush()` only runs work due at the current virtual time and a later timer is still registered at the read. Neither file feeds `recorderSha256`, so the corpus is unchanged. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): scan the engine directory for a sixth exposure copy The sixth-copy guard read only `adapters/`, so an inline copy appended to an adapter failed and a new file under `adapters/` failed, but the same literal in an engine file passed every assertion. Scan both directories, TypeScript sources only, since the README quotes the string to document it. `host-client-context-exposure.ts` holds the template with its interpolations rather than the literal, so it still cannot match itself; a throwaway engine file carrying the literal fails the test, and the file is otherwise green. Also narrows the register's import statements before reading `moduleSpecifier`, which drops a non-null assertion and the two TS2339 errors the `**/*.test.ts` exclude was hiding. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
ivanvykopal
pushed a commit
to ivanvykopal/orca
that referenced
this pull request
Sep 20, 2026
… (stablyai#21105) stablyai#21088 landed product changes on two fenced paths — the mobile hosted-review create params and the shared hosted-review contract — without moving the manifest baseline, so the corpus stayed pinned to 97aa5ff and --record refuses on main with "Product sources or lockfile differ from the pinned main baseline". Repin baseline to 9add08b, main's last commit to touch a fenced path, and re-record the whole corpus in place against it. No behaviour moved: decoding every golden through its own values pool against origin/main classifies all 705 as header-only with baseline the single moved key, and zero body moves, additions or deletions. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
ivanvykopal
pushed a commit
to ivanvykopal/orca
that referenced
this pull request
Sep 20, 2026
…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
ivanvykopal
pushed a commit
to ivanvykopal/orca
that referenced
this pull request
Sep 20, 2026
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Recorder follow-up bundle
Six follow-ups owed by earlier rounds of the mobile RPC recording engine, one commit each. Five are
test infrastructure; one is a small product change with no re-record. Item 6 is read here after item
4, where it belongs by subject, but its commit lands last: items 5 and 6 are independent and
reordering committed history is not something this branch does.
Every re-record ran from a detached worktree pinned at the manifest's baseline with this branch's
recorder laid over it, the recipe the README documents for a recorder-only branch.
baselineisnever repinned here; it is
97aa5ff19b, taken from main's own repin in #21092.--recordin placerefuses because two fenced product files still differ from the pin, which is item 5's widening and
the mobile assertion it removes. A control run of the same harness with main's unmodified recorder
reproduced main's 705 goldens byte-for-byte, so every count below is attributable to this branch.
Each item's delta was measured by decoding both corpora: header provenance keys stripped, 12-hex
value-pool refs resolved, then diffed and classified header-only / body / added / deleted, with the
moved JSON paths printed.
1. Shared monotonic write ordinal
sentstamped each payload and effect with the number of requests sent at write time. That ordersthose two lists against sends, never against each other, so a family sending no requests had every
stamp at
0. Found in #20920 round 2: movinghost-worktree-refresh.ts's two initial snapshot readsfrom after
client.subscribeto before it moved no golden at all.One counter per recording now stamps requests, payloads and effects alike at the moment each is
written. A request takes its ordinal at the logical
sendRequestcall rather than when its physicalpayload is published, so a send that waited for connected carries two distinct stamps.
sentleaving and
ordinalarriving onsender,payloadsandeffects. Decoding again with bothfields stripped leaves all 705 header-only, so nothing else moved.
host-worktree-refreshreorder fails 0 goldens on main's recorder and 5 on thisone (the family's own golden and its four matrix variants), both measured against their own corpus.
2. Teardown stream observation
Closing a stream writes to the wire only when its method has an unsubscribe builder.
notifications.subscribehas none, so a cleanup that forgets its localunsubscribeStream()leaks alive registry record and nothing on the wire changes. #20954 closed that with one hand-written
cutover scenario, which is a rule nobody enforces for the next builder-less method.
Teardown now asks each session's
RpcClientStreamRegistrywhat it still holds, after the product'scleanup and before the transport disposes the registries, and records a non-empty answer as a
streams-registered-at-teardowneffect carrying each stream's method, subscribe payload andcancelled flag. The set is read off the registry's own map: a mirror kept by the recorder would
reproduce the product's bookkeeping rather than observe it.
runtime.clientEvents.subscribematrices, on every partition whose subscribe reply is not awell-formed
ready. With nosubscriptionIdto unsubscribe with,disposeServerSubscriptionmarks the record cancelled and holds it until the id arrives, which is the retention the README's
per-session registry paragraph already describes.
cancelledis in the observation so these readas what they are; a cleanup that never ran records
cancelled: false.unsubscribeStream()frommobile-notifications.tsfails 1 golden withoutthe observation and 7 with it.
3.
recorderHostClientContextengine exportFive adapter modules each embedded
exports.recorderHostClientContext = Ctx;in a source stringappended to
client-context.tsx.Ctxis a module-private local, so the reference sits in a stringno type checker follows. Owed from #20919 round 2.
hostClientContextExposureandloadHostClientContextare now the one copy, andadapter-seam.test.tsasserts the declaration the exposure names still exists exactly once andrefuses a sixth inline copy.
recorderSha256on all 705,adapterSha256on the 23 goldens mounted through the five modules.Ctxstill typechecks clean, exit 0. Nothingshort of editing the fenced product module makes a module-private local visible to
tsc, so thetsc proof asked for is not reachable. The anchor check is the substitute: the rename fails
adapter-seam.test.tsimmediately with a named assertion instead of aReferenceErrora hundredseconds into a recording, five times over.
recording-runner.test.ts, which items 1 and 2 pushedpast
max-lines. Those two commits are red onoxlintin isolation; this one restores it.4. Salvage observation
collectSalvageDropsbuilds a report on every decoded reply andclassifyRpcReplyputs it on theoutcome, where no product code reads it. Found in #20950 round 1.
The recorder wraps
classifyRpcReplyon the mounted module, the one seam every checked read passesthrough and the only one that knows the operation the drop happened under, and records a non-empty
report as a
reply-salvageeffect. No product code changes.recorderSha256, 0 body moved, 0 added, 0 deleted.no product change, which is the condition the brief made the fork on. Instrumenting the seam shows
it firing on all 19,384 checked reads in the corpus. It is also fenced product code, so deleting it
would make re-recording impossible on this branch.
reply whole. All eleven reply-matrix partitions vary the envelope a host sends, not the shape of a
row inside a result, so
collectSalvageDropscannot fire anywhere in the corpus today. Theobservation is inert: it pins an absence nothing currently in the corpus is able to move, and it
stays inert until a step-7 domain PR narrows an element or member schema. It is not load-bearing
now. What it buys is that the first such narrow shows up as a golden diff, including where nothing
downstream reads the dropped row.
salvage-observation.test.tsis what keeps the observation honest, driving a malformed row and amalformed optional through the real
git.statusreply schema. Without it a refactor could stopreporting and every golden would still compare clean.
6. React's lazy
Math.random()drawReact resolves
enqueueTaskby readingmodule['require' + Math.random()]and memoizes what itfinds, so a process draws exactly one
Math.random()the first time it awaitsact. The runnerdrains through
actafter every step, so that draw landed inside whichever recording ran first inthe process and consumed the seeded sequence's first value. A family recording a
Math.random()-derived param therefore recorded one value when it ran alone and a different onewhen it ran after any other family. Found by the step 6 migration work on
session.tabs.createTerminal, whose create params carry aclientMutationIddrawn that way.Reproduced before the fix, recording one draw placed after the first drain, twice in one process:
0.23645552527159452is the seeded generator's first value. The first recording got the secondvalue because React had taken the first.
The scheduler now pays that draw once per process before it installs the seeded generator, so the
seeded sequence starts at the same value for every recording. Priming is awaited, which makes
RecordingScheduler.startasync.recorderSha256, 0 body moved, 0 added, 0 deleted. No goldencarried a first-in-process value, and the reason is specific: the one product path on this branch
that draws,
defaultWorktreeCreateMutationId, is never reached, becausetask-workspace-sender-mount-adapters.tsinjects a countingmintMutationId. That injection cannow be dropped and the real generator recorded; doing so is a scenario change and is not part of
this bundle.
Math.randomspy so thedraw comes out of the seeded sequence fails it too. The second one matters, because priming in the
wrong place looks like a fix and is not one.
step6-migration-2'ssession.tabs.createTerminaladapter mounts in its factory ahead of any flush to dodge this. Measured on both sides, a
factory-placed draw records
0.23645552527159452before the fix and after it, so deleting theworkaround moves no golden. That branch is not edited here.
vitest-recording-scheduler.test.tsholds the oracle. Only the process's first recording canwitness the bug, so the test asserts
reactActQueuePrimed()is false before it records: ifanything ever records ahead of it, the test fails loudly instead of passing vacuously.
5. Provider params widening
HostedReviewCreate.providerwas a closedz.enum, so a client repeating back a provider a newerhost named in its own eligibility reply had its create rejected at params validation. Mobile carried
a SAFETY-annotated assertion because narrowing to
'unsupported'before sending would have made thehost refuse its own provider.
The member is now
z.string(), and both create handlers narrow throughsupportsHostedReviewCreationbefore calling the runtime, so an unknown arm answers
unsupported_providerwith readable copy.createHostedReview's own refusal is the single source of that copy. The mobile assertion is deleted.src/shared, which is fenced. Zero golden movement is proven byreplay instead: the whole recording suite runs green against the committed corpus.
hostedReview.createStackedshares the same params schema, so it takes the same narrow. It nowrefuses before
prepareGitHubStackedPullRequestdoes any git work.tc:web,tc:cli,typecheck:nodeall clean).Cumulative delta against main
Decoding the committed corpus against main with
sentandordinalstripped: 701 header-only,4 body moved, 0 added, 0 deleted. The four are item 2's teardown observations. Header keys that moved
are
recorderSha256on all 705 andadapterSha256on 23; no other header key moved on any file.Without the strip the same comparison is 6 header-only and 699 body moved, which is item 1's
sentto
ordinalrename reaching every golden that writes a payload or an effect.Gates
pnpm run typecheck(mobile)pnpm test(mobile)pnpm run format:check(mobile)pnpm tcpnpm run typecheck:nodepnpm run check:code-quality:changedoxlinton changed filesnode config/scripts/check-readme-local-links.mjsnode config/scripts/generate-rpc-params-catalog.mjs --checksrc/main+src/sharedtests for the touched areasRenderer tests under
src/renderercannot be run by path from the root vitest config; they fail on@/alias resolution on the unmodified pinned tree too, so they are not a signal here.README
Updated for items 1, 2, 3, 4 and 6: the
ordinalfield replaces thesentparagraph and its"cannot see" lines, the stream-close blindness bullet now names the teardown observation as its
closure, there are new sections for streams still registered at teardown and for salvaged reads, and
the determinism paragraph now says who pays React's own draw and when.