Skip to content

test(mobile): record RPC goldens without a pinned commit, and check recorded requests against the desktop's params rules - #23732

Merged
brennanb2025 merged 17 commits into
mainfrom
brennanb2025/mobile-rpc-goldens-overhaul
Sep 30, 2026
Merged

brennanb2025 merged 17 commits into
mainfrom
brennanb2025/mobile-rpc-goldens-overhaul

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​483 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1142 $\color{#cf222e}{\Huge{\mathbf{−}}}$​659
Prod 836 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​9977 $\color{#cf222e}{\Huge{\mathbf{−}}}$​16996 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7019

The problem

The mobile app has about 790 "golden" files in mobile/rpc-foundation/goldens/. Each one is a recording of one scripted situation (for example "the phone asks the desktop for AI history and the desktop answers"): every request the phone sent, every reply the scripted desktop gave, and what the phone's state looked like at each step. Every test run replays each situation against the current code and fails if any recorded value differs. That replay is the useful part, and it has caught real regressions.

On top of the recorded values, every golden also carried a 10-line header: the commit it was recorded from (baseline), a lockfile hash, the OS, three version numbers, and three fingerprints (hashes of the recording engine, of that golden's test adapter, and of its scenario). The recording command refused to run unless your code matched baseline, and a CI job (RPC recording pin) failed if baseline was not a commit on main.

That header, not the recordings, is what made the system painful:

Before and after, for a developer

A concrete case: you change one error message the desktop sends. (This exact case was run live for this PR: it fails exactly the 8 goldens that record that message.)

Before After
Recording Refused until you moved baseline in pilot-scenarios.json to your own commit pnpm --dir mobile rpc:record (all) or rpc:record <golden-id> (one), from whatever code you have
Your PR's golden diff ~790 files: every header, plus the 8 real changes The 8 goldens whose recorded values moved, nothing else
Reading that diff Hashes pnpm --dir mobile rpc:diff [<base>] prints, per golden, the step, field and JSON path that moved with old and new values; Mobile Checks puts the same report in its job summary
A failing test The first difference only Every differing field, then the exact command that re-records that golden
After merge RPC recording pin red on main until someone lands a ~790-file repin PR Nothing owed
A golden the scenarios no longer produce Left in place silently Listed on every record; deleted only with rpc:record --prune, which prints each file it removes

What a golden's header looks like:

Before (format 5):

"operation": "aiVault.history-scan",
"family": "aiVault.history",
"namedDeltas": [],
"runnerVersion": 1,
"baseline": "ccdb324b63e4942891942edde1216586a51774bd",
"lockfileSha256": "9317f3a9…",
"recorderSha256": "0317fe2a…",
"adapterSha256": "ec16931c…",
"scenarioSha256": "0431ac82…",
"platform": "darwin",
"scenarioVersion": 1,
"projectionVersion": 2,
"goldenFormatVersion": 5,
"values": { … }

After (format 6):

"goldenFormatVersion": 6,
"operation": "aiVault.history-scan",
"family": "aiVault.history",
"namedDeltas": [],
"values": { … }

The recorded values and recording below the header are unchanged in form.

Why this PR itself changes ~855 files

It removes the header from every golden, so all ~790 change once, here. Only 46 of them change a recorded value, all from fixing fake test inputs (see "New check" below); rpc:diff origin/main lists exactly those 46. The other ~65 files are the recording tools, their tests and CI. After this lands, a PR touches only the goldens whose recorded values moved.

Why the old design existed

It was built for a specific job, one piece at a time:

Why it is safe to drop

  • The migration check still works without a pin. "This refactor changed nothing" now means "this refactor moved no golden", checked against the current code on every PR and every merge to main. That is the same claim, without naming a commit.
  • The fingerprints could never catch a bug. They failed only when an input (engine, adapter or scenario) changed and the recorded values did not, which is exactly the case where behaviour did not change. When behaviour did change, the value comparison already failed.
  • CI already replayed against newer code than the pin. Main keeps moving between repins. Right now it is 4 commits past baseline in mobile/src and src/shared. So the replay was already checking the current code, not the pinned commit, and that was fine because the values still matched.
  • Git already records where each file came from. A per-file copy of the commit added nothing git history does not have.
  • Ordinary snapshot tests work the same way. This repo's vitest .snap files store only the recorded output, with no commit, timestamp or input hash, and compare it.

How we know it still catches regressions

What it no longer flags, on purpose: an edit to the recording engine, an adapter or a scenario that changes no recorded value. Before, that rewrote headers; now it rewrites nothing, because nothing observable changed. Recording from uncommitted code is also no longer refused. CI replays the committed goldens against the committed code, so a bad recording still fails.

Details

The mechanism.

  • Each golden used to carry a recorded-from commit (baseline), a lockfile hash, the OS, three version numbers, and three fingerprints: one of the recording engine, one of that golden's test adapter, one of its scenario. The record script refused to run unless product code matched baseline.
  • Format 6 keeps only the format version, operation, family, namedDeltas, the value pool and the recording. The pin check, the fingerprint modules and their tests, the pin guard script and its CI job, and the unused per-scenario version field are gone.
  • The scenario file reader now refuses baseline and version with a message saying what to remove, so a branch cut before this change finds out at once.
  • Replay now passes only when the committed file is exactly what rpc:record would write for the current recording. The old comparison decoded the file first, so a leftover header key or other hand edit could sit in it unchecked; now it fails with the re-record command. The per-field comparison that names what moved is unchanged, and so are the value pool integrity checks and the census of which goldens should exist.
  • .gitattributes pins the goldens to LF line endings, so a Windows checkout with Git's default line-ending conversion still byte-matches.

New check: every recorded request against the desktop's own params rules.

  • The goldens script the desktop's replies, so a scenario could record a success for a request the real desktop would refuse. A desktop change that tightens a parameter schema moved no golden at all.
  • recorded-request-params.test.ts runs every distinct request in the corpus through the desktop dispatcher's own parse function (parseRpcRequestParams) with the schema the generated params catalog binds to that method.
  • It fails on four things: a method the desktop doesn't have; params it refuses; params sent to a method that takes none (the desktop never reads them); and keys the schema silently drops, unless an entry in its inventory gives a reason. An inventory entry nothing uses fails too.
  • It found 12 requests the desktop would refuse. All 12 came from made-up test values, not product code, and are fixed at their source:
    • git object ids that weren't ids ("base-oid");
    • an iOS push token with no APNs environment, which a real token always has;
    • Linear's assigned filter passed as a GitHub preset;
    • a GitLab project reference given as a string instead of { host, path }.
  • 46 goldens move for those fixes. A decoded comparison of all 46 shows no change except those substitutions.

CI.

  • RPC recording pin is deleted.
  • New job Mobile tests on main runs the whole mobile suite on every merge that touches mobile/, src/shared/, the root lockfile or the desktop RPC paths. The PR-only verify job never ran on main, so two PRs that each passed alone could disagree once merged with nothing noticing.
  • Mobile Checks now runs on every pull request that touches src/shared/** or the root lockfile, replacing a hand-picked list of six shared paths. Mobile imports a few hundred src/shared modules directly and through the recordings and the params check, so a desktop-only change can move a golden or break mobile's typecheck. The desktop author now finds out and re-records in their own PR instead of turning main red. The push-to-main list has the same shape, so there is one path list rather than a separate replay workflow with its own. Cost: about 2 extra runner-minutes on a shared-only PR. The Ruby release checks skip a change that touches only the root lockfile, since they read no root Node dependency.
  • The decoded rpc:diff summary step runs even when Test fails, which is when a reviewer wants it most.

Alternatives considered

  • Keep the provenance in one shared file. Cuts the file count but keeps the repin after every behaviour change.
  • Per-golden fingerprints of the product modules each recording loads. Fails on every refactor that changes nothing.
  • Commit no goldens and diff base vs. head in CI. Doubles CI time, needs a base checkout locally, and leaves the PR with no reviewable diff.
  • No pending/accept step for new recordings. The PR diff and the decoded summary are the review.

Linked Issue

None. Maintainer-internal test infrastructure; the repin PRs (#23535, #23565 and 20 others) are the symptom.

Visual Proof

N/A: test infrastructure and CI only, no app UI or behaviour change.

Testing

  • The format change moves no recorded value: rpc:diff against commit 2's parent reports "No recorded behaviour moved", and each golden only loses its ten header lines.

  • The fixture commit moves exactly 46 goldens. A decoded comparison of each shows only the fixture substitutions.

  • The params check reports the same 12 requests when pointed at the pre-fix corpus (RPC_FOUNDATION_GOLDENS), and each of its four rules is shown firing on a made-up request.

  • rpc:diff reproduces fix(mobile): start AI-button agents through agent.launch, never a bare shell #22762's disclosed change exactly: 1 changed, 8 added, 5 removed.

  • Full mobile suite: 9,792 passed. The only failures are 4 cases in bridge-terminal-output-backlog.test.ts, 5-second timeouts at load average ~65 on a shared machine. That file is untouched here, and it passes when run alone.

  • After rebasing onto current main: the recording, page-bridge, rpc:diff and params suites all pass. That run was at load average ~65. It timed out the params check at the default 5 s (it reads every golden; it now has a 60 s budget and passes) and the existing params-contract boundary test.

  • Root tests that parse the mobile workflows (mobile-test-change-scope, ci-background-step-barriers, mobile-release-check-scope, mobile-launch-contract-workflow, pr-code-change-scope, pr-workflow-parallelism, mobile-web-bundle-packaging-workflow-contract, pr-e2e-gate-contract) all pass.

  • Mobile tsc --noEmit and the tests-typecheck ratchet pass. Full oxlint, oxfmt --check and the changed-lines quality gate pass.

  • Merging origin/main (which carried test(mobile): repin the RPC recording corpus to main after #22762 #23757, another 790-file repin) used this PR's own conflict steps: keep this branch's goldens and scenario file, re-record. rpc:record --prune on the merged tree moved no golden, so that whole repin reduced to nothing here.

  • Live run on a second Mac (not the machine that recorded the goldens), before the review fixes: a full re-record left every golden byte-identical (792 tests); rpc:record <id>, an unknown id and a misspelled flag behave as described; changing one product error string failed exactly the 8 goldens that record it, each naming checkpoint, field path, expected and actual, and ending with the re-record command; rpc:diff then showed the move; --prune removed only a planted orphan; a refused param names the golden, method, params and the host's reason. Under load average 50–136 that run exposed two developer-facing problems that are now fixed: a timed-out full record listed no orphans, and a hand-edited golden failed with a bare pool-hash error and no re-record command.

  • Platforms: macOS locally; CI replays on Linux ARM. Windows recording determinism is unverified, as it was before this change; a Windows checkout's line endings are now pinned (see above).

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Commits, in order:

  1. rpc:diff. It reads both the old and new format, so it can prove the next commit.
  2. The format change, proved by zero value moves.
  3. The params check plus the fixture fixes, proved by exactly those 46 moves.

Commit 1 alone fails every golden's header check, because adding files to the recorder directory changed the old engine fingerprint. That is the problem this PR removes, and the commits squash.

The commits after these three are review fixes (the exact-file replay check, LF pinning, orphan handling on a failed run, streamed record output, the summary step after a red Test, the widened Mobile Checks paths) and one merge of origin/main.

For open mobile PRs (#22954, #23032) after this lands:

  1. Merge origin/main.
  2. In pilot-scenarios.json, take main's version and re-apply only your scenario edits (no baseline, no version).
  3. Run git checkout origin/main -- mobile/rpc-foundation/goldens, restoring from the incoming ref.
  4. Run pnpm --dir mobile rpc:record --prune.
  5. Check that pnpm --dir mobile rpc:diff origin/main lists only the moves the PR already discloses.
  6. The new params check may flag made-up values in new scenarios; fix them in the scenario or adapter.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Cross-platform: recording carries no OS field and CI already replays macOS-recorded goldens on Linux.
  • SSH and remote: not affected.
  • Backwards compatibility: format 5 goldens are refused with a re-record message, and rpc:diff reads both formats.
  • Follow-up: checking recorded requests against released desktops, and shipped phones against the current desktop, is planned as its own pull request.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

The RPC recording goldens are content-addressed JSON, so their raw git diff is
pool hashes. `pnpm --dir mobile rpc:diff [<base>]` decodes both sides and prints,
per golden, the checkpoint, field and JSON path that moved with both values,
grouped across checkpoints, plus added and removed goldens. `--summary <file>`
appends a Markdown report capped for GitHub's step-summary limit.

It reads any pooled format, so it can prove the next commit's format change
moves no recorded value. Checkpoints are matched by occurrence because an id can
repeat within one golden.

This commit adds files under the recorder directory, which moves the header
digest every golden pins; the next commit removes that header.
…ests

Every golden carried a pinned `baseline` commit plus digests of the recorder,
its mount adapter and its scenario, and the record script refused to run unless
the product tree matched the pin. So every behaviour change repinned to its own
branch commit and rewrote all ~790 files, the squash made that commit
unreachable, and main's pin job stayed red until a hand-made repin pull request
landed (22 of them in 12 days). The digests could only fail when an input moved
and the recording did not, which is exactly the change that carries no
information; every run already re-derives each golden from the current tree and
compares it.

Format 6 keeps the format version, operation, family, named deltas, the value
pool and the recording. Removed: the pin and fence, the three digest modules and
their test, the pin guard and its CI job, and the dead scenario `version` field
(the manifest reader now refuses `baseline` and `version` with a message).

- `pnpm --dir mobile rpc:record [<golden-id>...] [--prune]` records all or some
  goldens; orphans are listed, and deleted only with `--prune`. Every derived
  test title now starts with its golden id so an id selects it.
- `compareGolden` reports every difference in one failure (identity fields by
  name, the checkpoint list, each checkpoint/field/path grouped), keeps the
  final byte compare, and ends with the command to re-record that golden.
- `unhandled-recording.test.ts` now drives a detached rejection through
  `runRecording` into a checkpoint and the cleanup checkpoint; no golden carries
  one, and disconnecting the capture passed every suite before.
- Seam rules that existed only to keep a digest honest are gone; the
  mutant-reachability, register-completeness and one-exposure rules stay.
- CI: `Mobile tests on main` runs the whole mobile suite on every merge that
  touches mobile/, src/shared/, the root lockfile or the host RPC paths, since
  `verify` never runs on main. A new `Mobile RPC Recording Replay` workflow
  replays the recordings on pull requests that touch src/shared/ or the root
  lockfile without touching mobile/. `verify` writes the `rpc:diff` report to
  the job summary.

Proof: `rpc:diff` against the parent reports no recorded behaviour moved; each
golden only loses its ten header lines.
…contract

The goldens script the host's replies, so a scenario could record a success
for a request the real host would refuse, and a desktop change that tightens a
params schema moved no golden at all.

`recorded-request-params.test.ts` parses every distinct request the corpus puts
on the wire with the host dispatcher's own `parseRpcRequestParams` and the
schema `rpc-params-catalog.generated.ts` binds to that method. It fails on a
method the host lacks, params it refuses, params sent to a method that takes
none (the dispatcher never reads them), and keys the schema silently strips
unless an inventory entry gives the reason; a stale entry fails too. Each rule
is also shown firing on a made-up request, since the corpus has no instance of
three of them. It imports the desktop dispatcher, so it sits beside the other
Node-side tests outside the RN test program, and the params-contract boundary
now exempts test files, which are never bundled.

It found twelve requests the host would refuse, all from invented fixture
values, not product code, fixed at their source:
- git.branchDiff sent `base-oid`/`head-oid`/`merge-base` where the host needs
  full object ids (diff-review and source-control adapters, and the branch
  compare replies in the manifest that feed them);
- an iOS push registration without `apnsEnvironment`, which a real iOS token
  always carries (`push-token.ts`); the adapter now defaults to `production`;
- `settings.update` given Linear's `assigned` filter as a GitHub preset, which
  the product type forbids; the scenario now picks `my-issues`;
- GitLab `projectRef` as a string where the host and the product type take
  `{ host, path }` (7 methods, 5 adapters and the manifest).

46 goldens move, and a decoded comparison of every one of them shows no change
other than those substitutions; `rpc:diff` lists them.
Under the runner's pipefail, grep -q exiting on its first match SIGPIPEs git
diff on a long file list, so a large pull request touching mobile/ read as
uncovered and replayed the recordings a second time.
… digests

Eleven adapters justified an import rule by the header a golden no longer
carries, and that rule's test is gone. The census failure now names the
rpc:record and --prune commands.
Decoding dropped unknown top-level keys, so an old header left behind by a
hand-resolved merge conflict passed every compare unseen.
A captured run stayed silent for its whole duration and clipped its tail,
where the failure summary sits, past 8 MB.
…step

fef088d gave the summary step an `if: ${{ !cancelled() }}`, and this test lists every gated step in `verify` and expects each to be gated on the Ruby scope.
…rd writes

Replay compared two re-encodings of decoded values, so anything decoding drops (a leftover header
key, a hand edit) sat in the committed file uncompared; a key allow-list covered one case of that.
Replay now passes only if the file text equals the formatted golden for the run, sharing one
formatter with writeGolden, and keeps the field-level report as the failure message. The allow-list
goes; the value-based compareGolden stays for the bridged run, which has no file.
…re-record command

A hand edit to a pooled value failed in decode with only "Golden value <hash> does not hash to its
pool key": no golden id and no command to fix it. readGolden now prefixes parse and decode failures
with the golden id and ends them with the rpc:record command. The rpc:diff header also said it
always exits 0; it exits non-zero when git or a golden cannot be read, and now says so.
…hange

Replaces the replay-only workflow: mobile imports hundreds of shared modules, so a shared edit can
move a golden or break mobile's typecheck, and the full job catches both before merge. A root
lockfile-only change skips the Ruby release checks, which read no root Node dependency.
…run fails

Orphans come from the manifest, not the run, so a failed or timed-out rpc:record still reports
them; the exit code stays non-zero. README: say what a failed replay reports (first differing
path per field, capped groups) and what rpc:diff compares with and without a base.
…still replays

Replay now requires the committed golden text to equal exactly what rpc:record writes, which is
LF. A Windows checkout with core.autocrlf=true converted every golden to CRLF and failed all 790
with "holds the same recording but is not the file rpc:record writes for it".
Kept this branch's header-free goldens and scenario file over #23757's repin
(which only moved the baseline line), then re-recorded on the merged tree:
rpc:record --prune moved no golden.
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: ready for maintainer review (head a9d4b6412ad, still a draft; not merged)

What this PR fixes: every mobile behaviour change used to rewrite all ~790 RPC golden files, and every merge needed a hand-made "repin" PR (22 in 12 days; #23757 landed on main during this review). After this PR, a golden diff is only the goldens whose recorded behaviour moved, nothing is owed after a merge, and a new check validates every recorded request against the desktop's own params parser. It changes only mobile test infrastructure and CI; no app behaviour changes.

Review loops: 8 loops. Loops 4 and 8 came back clean; loop 8 is the final pass on the current head. An architecture review ran after loop 3 because one loop's fix had broken a root CI test. It judged the design right and proposed two changes, both now in. Fixes pushed during review:

  • Replay now passes only when the committed golden file is exactly what rpc:record writes. Before, a leftover old header key or a hand edit could sit in a golden unchecked. This replaced a key allow-list added earlier in the review.
  • .gitattributes pins the goldens to LF. Without it, the exact-file check would have failed every golden on a Windows checkout with Git's default line-ending conversion.
  • Mobile Checks now runs on every src/shared/** and root-lockfile PR. This replaced the separate replay-only workflow, whose "did this PR touch mobile/?" step failed on large diffs and which duplicated part of Mobile Checks' path list. It also catches a mobile typecheck broken by a desktop change before merge, at about 2 runner-minutes per shared-only PR. The Ruby release checks skip a change that touches only the root lockfile.
  • rpc:record streams its test output instead of holding it until the end and clipping it past 8 MB, and it lists or prunes orphaned goldens even when the recording run fails or times out.
  • A corrupt or hand-edited golden fails with the re-record command instead of a bare pool-hash error.
  • The decoded rpc:diff job summary also runs when Test fails. The root contract test that pins which steps have an if: was updated to match.
  • Stale comments describing the deleted header and fingerprints were corrected, and the census failure now names rpc:record --prune.

Migration proof, checked independently with a decoder separate from rpc:diff: the format commit moves 0 recorded values across all 790 goldens. The params commit moves exactly 46 goldens, all fixture substitutions (fake git ids → full ids, GitLab projectRef string → {host, path}, apnsEnvironment added, assigned → my-issues). Against the pre-fix corpus the params check reports exactly the 12 refused requests. Temporarily tightening a desktop schema made it fail while both affected goldens still replayed green, which is the skew the goldens alone can't see.

Merging main used the PR's own conflict steps: keep this branch's goldens and scenario file, then rpc:record --prune. On the merged tree it moved no golden, so #23757's 790-file repin reduced to nothing here.

Live QA on a second Mac (M4Air), final head:

  • rpc:record on a clean tree: 792 passed, no golden changed.
  • Full record with a planted orphan: listed, not deleted. --prune then removed exactly that file.
  • A hand-edited value and a leftover baseline key each fail naming the golden, and end with pnpm --dir mobile rpc:record <id>.
  • rpc:diff origin/main: 46 changed, 0 added, 0 removed.

An earlier QA run (pre-fix head) also covered: re-recording one golden; clear errors for an unknown id and a misspelled flag; a changed product string failing exactly the 8 goldens that record it, with checkpoint, path, expected and actual; and a refused param naming the golden, method and the host's reason.

Checks:

  • Mobile recording, bridged-parity and script suites: 1879 passed.
  • Root workflow and scope contract tests pass.
  • Mobile tsc --noEmit and the tests-typecheck ratchet pass, and the new .mts scripts and the params test typecheck in isolation.
  • oxlint and oxfmt are clean.
  • CI on this head: every check that ran is green, including both Mobile Checks verify runs and all 8 test shards.

Known, not blocking:

  • Recording a golden is byte-identical on macOS, and CI replays on Linux. Byte-identical recording on Windows is still unverified, as it was before this PR.
  • The rpc:record output is noisy. That is pre-existing test diagnostics, now visible because it streams.
  • After a hand edit, the re-record hint says "If the change is intended", which reads oddly for a hand edit.

Found during review, not caused by this PR:

  • The 600 s recording budget.
  • The terse Request params mismatch message from the scripted transport.
  • The Recordings must run sequentially cascade after one timed-out test.

Open mobile PRs (#22954, #23032): follow the rebase steps in the PR body.

@brennanb2025
brennanb2025 marked this pull request as ready for review September 29, 2026 03:01
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Refactors mobile RPC test recording and validation logic.

The PR does not yet appear safe to merge because relay cancellation can end another screen’s live terminal feed on an older desktop.

Findings

  1. P2 Three methods bypass validation ▶
  2. P2 Git reading lacks coverage ▶

Summary

This PR removes pinned provenance headers from mobile RPC goldens, adds decoded recording diffs and desktop-params validation, and broadens mobile CI coverage. The changes since the previous review also revise native-chat stream tokens and direct and relay subscription teardown.

  • Relay terminal teardown has a compatibility race when a newer subscription has been sent but has not taken ownership of its slot.
  • Both earlier Greptile findings remain outstanding.
Diagram
sequenceDiagram
  participant A as Older terminal screen
  participant R as Relay stream manager
  participant H as Older desktop
  R->>H: Subscribe A to slot
  H-->>A: Terminal feed
  R->>H: Send subscribe B to same slot
  Note over R,H: B has sendOrder but is not registered yet
  R->>H: Cancel B with slot unsubscribe
  Note over H: requestId is stripped
  H-->>A: End older feed
Loading

Reviews (3) · Last reviewed commit: "Merge origin/main into brennanb2025/mobi..."

Comment on lines +100 to +102
const where = `${golden}: ${method} ${JSON.stringify(params)}`
if (unshared.has(method)) {
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Three methods bypass validation If a future golden records emulator.install, orchestration.send, or orchestration.taskUpdate, this branch skips its request entirely. These methods have desktop parameter schemas but are absent from the shared catalog. A malformed request could therefore receive a scripted success while this check passes. Validate these requests against their desktop declarations, or fail explicitly when one appears.

Comment on lines +47 to +48
async function readBase(base: string): Promise<Map<string, DecodedGolden>> {
const paths = (await git(['ls-tree', '-z', '--name-only', base, '--', `${GOLDENS}/`]))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Git reading lacks coverage The new diff tests use constructed golden maps, so they never exercise the git tree listing, batch decoding, or base selection used here. CI allows the summary step to fail without failing the job. If this reading path breaks, reviewers lose the decoded golden diff without a failing gate; a test using a small temporary git repository would cover that path.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No critical issues — minor suggestions only.

Reviewed changes

  • Golden format 6 — the provenance header (baseline pin, recorder/adapter/scenario digests, lockfile, platform, runner/projection/scenario versions) is gone from golden-recording.ts; all ~790 goldens are re-recorded in the bulk of the diff.
  • Replay is now an exact-file compare — expectGoldenFile passes only when the committed text equals what rpc:record writes, and falls back to the decoded per-field report otherwise.
  • Pin/digest machinery deleted — the pin guard and its test, recorder-digest/adapter-digest/scenario-digest, golden-header-digest.test.ts, mobile-recording-pin-checkout.test.mjs, the RPC_FOUNDATION_RECORD gate, and the per-scenario version field; scenario-input.ts refuses the retired keys.
  • New tooling — rpc:diff (rpc-diff.mts + rpc-diff-report.ts, reads formats 5 and 6) and a rewritten rpc:record with id selection, --prune, streamed output, and orphan handling.
  • New params check — recorded-request-params.test.ts parses every distinct recorded request with the host dispatcher's own parseRpcRequestParams; the 46 moved goldens are the adapter fixture fixes.
  • CI — recording-pin becomes main-tests (full suite on main), verify widens to src/shared/** and the root lockfile and gains a rpc:diff summary step, and Ruby checks skip a lockfile-only change; .gitattributes pins the goldens to LF.

ℹ️ Two comments still describe the removed header and CI job

mobile/src/test-support/rpc-recording/native-mounting-substitutes.ts:85 still says platform "is golden provenance, not a compared field", and mobile/vitest.config.ts:16 still credits the scripts/** include to "the RPC recording pin". Both concepts are deleted in this PR, so the comments now point at state that does not exist. Neither file is in the diff, so there is nothing to anchor them to; folding them into a follow-up cleanup would be fine.

Technical details
# Stale comments invalidated by the header and pin removal

## Affected sites
- `mobile/src/test-support/rpc-recording/native-mounting-substitutes.ts:85` — "One pinned platform per recording; `platform` is golden provenance, not a compared field." The golden no longer carries `platform`.
- `mobile/vitest.config.ts:16` — "scripts/ too: the CI guards under it (the RPC recording pin) had no runnable test home". The `RPC recording pin` job is deleted; the `scripts/**/*.test.ts` include still has a runnable test (`rpc-diff-report.test.ts`).

## Required outcome
- Comments describe only mechanisms that still exist, or are removed.

## Open questions for the human (optional)
- Whether to keep the `scripts/**/*.test.ts` include rationale at all, now that the pin guard is gone.

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

* this file rather than its own because `recorderSha256` pins every file in this directory and
* `mutant-seam.test.ts` refuses one no recording driver can reach: a compile fence reaches nothing,
* so on its own it would re-digest every golden while being unable to move one.
* this file rather than its own because `mutant-seam.test.ts` refuses a file no recording driver

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The block just above (lines 7-10) still justifies this file's location with two constraints this PR removed: that mobile/scripts/rpc-recording.mts "fences every path under mobile/src except this directory" and that "the seam forbids one adapter importing another". Neither holds now, so the stated reason for the location is stale.

Main's #23720 taught the RPC recording pin guard to find a squash-dropped
pin through its pull request's head. This branch removes the pin, the guard,
its CI job and the pin-checkout test, so the guard, its test, the new
rpc-recording-pin-reachability.mts, the checkout test and the job stay
deleted; nothing in #23720 outlives the pin. #23815's README wording edit
fell inside the deleted pin section and is superseded by this branch's text.
Main's #22939 gives each native chat subscription its own token and
re-recorded the corpus in the stamped format 5. This branch keeps its format 6
goldens and scenario file, takes #22939's two scenario edits (the
subscriptionId now carries the per-subscription token) without its baseline
repin, and re-records with rpc:record --prune. Four native chat goldens move,
each only in its nativeChat.subscribe frame's subscriptionId; rpc:diff
origin/main still lists only this branch's 46 fixture fixes.
@brennanb2025
brennanb2025 merged commit e594cb0 into main Sep 30, 2026
59 of 61 checks passed
brennanb2025 added a commit that referenced this pull request Sep 30, 2026
…r-free format

Main's #23732 dropped the golden header and pin, so the merge took main's goldens whole and
`rpc:record --prune` re-derived them. Only the six desktop-notification recordings this branch
changes move, decoded-identical to their pre-merge recordings, and the obsolete
`unsubscribe-1` matrix golden is pruned.
tisohjung added a commit to tisohjung/orca that referenced this pull request Sep 30, 2026
…-provider

51 conflicts: 48 golden provenance headers plus the corpus counts in
divergence-classes and the through-bridge prose. Took main's side throughout and
re-derived, as with every round of this shape.

Main bumped the golden format from version 5 to 6, so the re-record was doing
more than a provenance refresh this time; the two Jira goldens came along with
it. pilot-scenarios.json did not conflict and kept all ten jira.status steps, so
the recorded bodies regenerate with the Jira partitions intact.

Corpus counts from the run rather than arithmetic: result-absent-settlement
343 -> 345, corpus 794 -> 796. Main's rewrite dropped the sentence explaining the
Jira +2 again, so it is restored.

Verified read-only: 29 files, 1844 passed. The one remaining failure is
recorded-request-params, a test main added in stablyai#23732 that dies on zod's missing
`compile` — the same stale-dependency class as the rest, not this branch.
zpyoung added a commit to zpyoung/orca that referenced this pull request Oct 1, 2026
… ships

The v1.4.218 cut synced mobile.yml from main (with stablyai#23732's workflow change)
but not its tests, so the tag fails its own suite. Mirrors upstream's
e594cb0 for the tests only: the recording-pin checkout test goes (the job
it reads no longer exists) and the gated-step assertion skips the new summary
step. Declared pending-upstream until a tag carries e594cb0.
brennanb2025 added a commit that referenced this pull request Oct 3, 2026
…ort (#23032)

* fix(mobile): release notification and account streams from the transport

* test(mobile): drop the deleted notification-unsubscribe matrix from the bridged-parity tally

* test(mobile): count the bridged-parity corpus at 786 goldens

* chore(mobile): state why the notification stream frame cast is safe

* test(mobile): re-record goldens after the transport took over notification release

Repins the recording baseline to a547d89 and re-records every golden.
780 goldens move only in baseline and recorderSha256 (repin plus a comment
edit in run-recording.ts). Six desktop-notification goldens move in their
body: the notification code no longer issues notifications.unsubscribe as a
request, so its sender-call entries go and only the transport's wire frame
remains; the replayed scenario now also releases sub-1 on the retiring
session at cutover; the subscribe-1-1 matrix records the cancelled
placeholder a non-ready reply leaves. The unsubscribe-1 matrix was removed
earlier because the request it varied no longer exists. The three scenarios
drop their scripted reply to that request.

* test(mobile): bind the subscription inventory to the ready-id release table

Each subscribe site now declares how the phone releases it on the host, and
the boundary test requires the ready-id sites to name exactly the methods in
READY_STREAM_RELEASE_METHODS. A new stream whose host id arrives only in
`ready` is otherwise released on neither connection, and nothing noticed:
that is how direct accounts.subscribe went unreleased.

* test(mobile): correct the settlement class count in the bridged-replay notes

* test(mobile): repin and re-record goldens after merging main

Repins baseline to the merge commit aae9aa7 and re-records the whole
corpus with --record. Against origin/main: 783 goldens move only in
baseline and recorderSha256 (the repin and the recorder comment edit); the
six desktop-notification recordings move in body, byte-identical to this
branch's pre-merge recordings (the transport now sends the stop); the
notifications.unsubscribe matrix golden is deleted because that request no
longer exists. Corpus 789: result-absent-settlement 343 -> 342, and the
comments quoting the corpus size follow.

* fix(mobile): correct stale release notes after merging main

- Drop the unused `connection-close` release kind: agent session feeds
  now stop by params, so no phone stream uses it.
- The notification listener's SAFETY note names the transport's `error`
  frame too.
- The recording README's mutant history is past tense: the transport now
  releases `notifications.subscribe`.

* docs(mobile): keep the notification SAFETY note and teardown README precise

* test(mobile): re-record the desktop notification goldens on the header-free format

Main's #23732 dropped the golden header and pin, so the merge took main's goldens whole and
`rpc:record --prune` re-derived them. Only the six desktop-notification recordings this branch
changes move, decoded-identical to their pre-merge recordings, and the obsolete
`unsubscribe-1` matrix golden is pruned.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant