Skip to content

test(mobile): make the bridged recording-corpus replay a CI gate and pin the C1 page closure (OTA phase C, C1.6) - #21533

Merged
Jinwoo-H merged 7 commits into
mainfrom
ota-c1-6-gate
Sep 18, 2026
Merged

Jinwoo-H merged 7 commits into
mainfrom
ota-c1-6-gate

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​245 $\color{#cf222e}{\Huge{\mathbf{−}}}$​22 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​223
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​287 $\color{#cf222e}{\Huge{\mathbf{−}}}$​25 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​262

What this is

OTA phase C, C1.6: the bridged replay of the recording corpus becomes a CI gate instead of an opt-in run, and every golden inside the C1 page closure has its bridged verdict pinned by id.

Series: C0.5 (#21485) landed the harness behind RPC_FOUNDATION_BRIDGE=1; C0.8 (#21511) fixed the bridge until 396 goldens replay byte-identical and classified the remaining 391 as recorder observation artifacts with identical wire bytes. This PR turns that verdict into something nobody can forget to run.

How

  • Gate by default. The suite runs under pnpm test; RPC_FOUNDATION_BRIDGE=0 is the only value that skips it (BRIDGED_PARITY_OFF), so an unset or mistyped variable still runs the gate. The dedicated workflow step is removed because pnpm test already collects the file; keeping both ran the same 788 tests twice in one job.
  • Exact pins, not floors. bridgedParityTallyDrift compares the run's identical count and every per-class count against BRIDGED_PARITY_BASELINE in both directions and the summary asserts it reports nothing, so identical is pinned at 396 and each class at its baseline; a golden moving in either direction is an edit to the baseline, never a run that quietly passes. The member-id pins and the unclassified guard from C0.8 stay in force.
  • C1 page closure. bridged-parity/c1-page-closure.ts names 22 families / 103 goldens derived from the value-import closure of the two C1 route modules (with .web.* resolution): 54 byte-identical, 49 in a proven-artifact class (37 result-absent-settlement, 7 params-undefined, 3 result-absent-stream-release, 2 write-ordinal). Membership is checked per family, so a golden newly derived into a closure family is a red test, not a silent absence. mobileWeb.bundle-manifest is excluded on purpose: it reaches the closure only through the shared operation runner and its operation belongs to the shell, not the page.

Cost

run gate off gate on
full mobile suite, 4 workers 186.0 s 220.7 s
full mobile suite, unbounded workers 225.5 s 224.9 s

Vitest schedules the file on a worker beside the rest, so the marginal cost is about 35 s at four workers and nil otherwise. No timeout was touched and no sharding was needed.

Not touched

No recorder-fence file, no golden body, no baseline. Counts and member lists are identical to main's.

Review round 1 (SHIP AFTER FIXES, taken)

Fresh reviewer at e71129bb96 confirmed the gate runs under pnpm test in CI, five mutations bit, the closure derivation matched exactly (282 web-resolved modules; excluding mobileWeb.bundle-manifest is right), nothing fenced moved, and the wall-time cost is about 26 s at four workers. HIGH (also CodeRabbit's Major): the identical assertion derived its expectation from the run's own exclusion count and the per-class checks were upper bounds, so a golden moving from an excluded class to identical passed without touching the baseline (repro: 397/340, exit 0); the "pinned exactly" claim was false upward. Fixed in 3bb28b3209 with bridgedParityTallyDrift, exact in both directions, with the reviewer's mutation encoded as a unit test and reproduced red against the real corpus. LOW: a doc block said result-absent-observation, 7; it is 3. Watch item, no change: pilot goldens run under vitest's default timeout with a ~20x margin. Lead-verified at af2496adcd: tsc, format, both changed-code gates, flag-off skips 789, baseline identical 396→397 fails both the unit test and the summary, full suite 7623 passed.

Review round 2 (SHIP AS-IS, two nits taken)

Fresh reviewer at af2496adcd reproduced the round-1 hole at e71129bb96 (forced excluded golden → identical, exit 0) and its closure at the new head (only the tally assertion fails, proving it carries the load); six further mutations all die (baseline identical up and down, a class count up and down, a member id swapped, the drift function neutered). Closure re-derived independently: 281 web-resolved modules, the 22 pinned families and nothing else. Timeout margins 52x (pilot) and 15x (derived). Nits folded in 617de03e56: a comment said "two checks" where three are blind; the c1PageClosureExclusions() assertion was a weaker duplicate of the one in c1-page-closure.test.ts and is removed from the expensive suite.

… (OTA phase C, C1.6)

`rpc-recording-through-bridge.test.ts` replays all 787 goldens through the page
bridge and pins how far that bridge is from byte-identical. It only ran when
`RPC_FOUNDATION_BRIDGE=1` was set, which CI did in a step of its own. A gate
whose CI job has to remember to set a variable is opt-in, and a branch that
widened the divergence with that step edited away would have been measured by
nobody.

The suite now runs by default and `RPC_FOUNDATION_BRIDGE=0` skips it, for a
local run that does not want the three minutes. `BRIDGED_PARITY_OFF` names the
one value that skips, so an unset or mistyped variable still runs the gate.

The dedicated CI step goes with it: `pnpm test` collects the file already, so
keeping the step would have run the same 788 tests twice in one job. Vitest
gives the file a worker beside the rest of the suite, so the marginal wall time
is a fraction of the ~3 min it takes alone.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
… by id (OTA phase C, C1.6)

The bridged replay certifies the corpus in counts over 787 goldens, and a count
is the wrong instrument for the claim C1 needs. C1 moves one domain to the web:
`app/h/_layout.tsx`, `app/h/[hostId]/index.tsx` and their import closure. A
golden recorded at a call site in there that stopped replaying byte-identically
is paid for by any of the other 684 that started, and every existing assertion
still passes.

`c1-page-closure.ts` names the 22 families and 103 goldens of that closure and
pins each one to the verdict it gives: 54 byte-identical, 49 in four of the five
classes the suite already excludes, all of them recorder observation artifacts
whose wire bytes C0.5 and C0.8 proved identical. Membership is checked per
family, not against the flat id list, so a golden newly derived into a family
this domain owns arrives as a finding instead of being missed for never having
been pinned. A closure golden may only be excluded into a class that carries a
reason in `BRIDGED_PARITY_EXCLUSIONS`.

Two full-corpus assertions go with it. `identical` was a floor; it is now the
exact 787 minus the excluded classes. And the run's own size is pinned to the
corpus: every class is an upper bound, so without that a corpus that lost
goldens outside the identical set satisfied all of them.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…nned to (OTA phase C, C1.6)

The drift test took whichever golden the pin lists first and moved it to
`params-undefined`. Nothing said that golden was not pinned to that class
already, and the day one is, the test asserts a change it never made. Pick the
first golden whose verdict is something else, and assert the pair of verdicts
the line reports rather than just the new one.

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

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 61a52fa3-a436-49a6-9f4e-bed5615921e3

📥 Commits

Reviewing files that changed from the base of the PR and between af2496a and 617de03.

📒 Files selected for processing (1)
  • mobile/src/test-support/rpc-recording/rpc-recording-through-bridge.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The bridge replay now runs in the standard test suite and is skipped only when RPC_FOUNDATION_BRIDGE=0. The change adds a pinned C1 page-closure census for 103 goldens across 22 families, with corpus and drift tests. Replay results now record family and verdict data, enforce exact baseline counts, and validate C1 closure results against the pin.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 617de

The bridge replay is active in mobile CI by default and its pinned checks detect replay-count or C1-closure changes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the main changes, rationale, implementation, scope, testing results, and performance cost. However, it omits several required template sections, including Linked Issue, Visual… Add all missing template sections. Provide the required linked issue after “Fixes #”. Add “Visual Proof” with N/A and a reason if there is no visual or interaction change. Add a “Testing” section with manual-testing status, automated-test…
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 5 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the two primary changes: making bridged recording-corpus replay a CI gate and pinning the C1 page closure. It is specific and related to the changeset, although it is long…
Full details: Description check

Explanation

The description explains the main changes, rationale, implementation, scope, testing results, and performance cost. However, it omits several required template sections, including Linked Issue, Visual Proof or an explicit N/A statement, Testing with platform details, AI Disclosure, Agent skill upstream boundary, Notes, and Checklist. The required issue link is missing.

Resolution

Add all missing template sections. Provide the required linked issue after “Fixes #”. Add “Visual Proof” with N/A and a reason if there is no visual or interaction change. Add a “Testing” section with manual-testing status, automated-test details, and tested platforms. Complete AI Disclosure, Agent skill upstream boundary, Notes, and Checklist sections.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: f0dc328a-00e1-4b32-a3d5-1050350b8a31

📥 Commits

Reviewing files that changed from the base of the PR and between 3336933 and e71129b.

📒 Files selected for processing (6)
  • .github/workflows/mobile.yml
  • mobile/src/test-support/bridged-parity/c1-page-closure.test.ts
  • mobile/src/test-support/bridged-parity/c1-page-closure.ts
  • mobile/src/test-support/bridged-parity/divergence-classes.test.ts
  • mobile/src/test-support/bridged-parity/divergence-classes.ts
  • mobile/src/test-support/rpc-recording/rpc-recording-through-bridge.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No critical issues — one minor claim/enforcement gap inline.

Reviewed changes

Reviewed the full 3-commit diff (6 files, test-only) at e71129bb96.

  • Default gate — rpc-recording-through-bridge.test.ts switches from describe.runIf(env === '1') to describe.skipIf(env === '0'), and .github/workflows/mobile.yml drops the dedicated RPC_FOUNDATION_BRIDGE=1 step because mobile's pnpm test (vitest run, include src/**/*.test.ts) already collects the file.
  • Exact corpus assertion — the aggregate test replaces the identical >= 396 floor with corpus === total(BRIDGED_PARITY_BASELINE) and identical === pinned - excludedCount.
  • C1 page closure pin — new c1-page-closure.ts pins 103 goldens across 22 families to a bridged verdict by id (54 identical, 49 named artifacts), with c1PageClosureDrift checking per-family membership and per-id verdicts; c1-page-closure.test.ts exercises the rule.
  • Flag contract — BRIDGED_PARITY_OFF = '0' is added and the docs/tests updated so only =0 skips.

The C1 closure is the load-bearing part and it is sound: each of the 103 goldens is pinned to a verdict by id, membership is checked per family, and the corpus/class ratchet still catches any golden leaving identical. CI plumbing checks out — the file is collected by pnpm test and no workflow env sets the flag.

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

…xclusions (OTA phase C, C1.6)

`identical: pinned - excludedCount` took `excludedCount` from the run, and the sum
assertion above it already forces `total(counts) === excludedCount`, so the pair
reduced to `corpus === pinned`: only the size of the corpus was pinned. With every
per-class check an upper bound, a golden moving out of an excluded class into
`identical` satisfied all of them.

`bridgedParityTallyDrift` pins every number to `BRIDGED_PARITY_BASELINE` exactly,
`identical` among them, and its own tests encode the mutation: one
`result-absent-settlement` golden reported `identical` is two drift lines, where
before it was a green run.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The number in the prose predates the baseline it describes; `result-absent-observation`
is 3 in `BRIDGED_PARITY_BASELINE` and in the run, and the line above it already says
341 / 3 / 6 / 33 / 8.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…t is gone (OTA phase C, C1.6)

Three comments described the per-class upper bound the tally replaced. What the
exact pin is exact *against* is now `unclassified`, the exclusion sum and the
membership pins, so say those.

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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

Reviewed the delta since the prior pullfrog review at e71129bb96 (3 new commits; all 6 files remain in scope).

  • identical now pinned exactly — new bridgedParityTallyDrift compares identical and every per-class count against BRIDGED_PARITY_BASELINE in both directions, and the aggregate test asserts it reports nothing. This closes the prior review's up-direction gap where an excluded-class-to-identical move passed without a baseline edit.
  • Unit coverage for the fixed direction — divergence-classes.test.ts encodes the excluded-class-to-identical mutation (the reviewer's 397/340 repro) and asserts two drift lines, plus a grown class and a lost golden.
  • Doc corrections — the suite doc's result-absent-observation count is corrected 7→3, and the baseline comment is rewritten from "ratchet/bound" to "pin/exact" so the prose matches enforcement.

The prior review's one open thread is addressed by 3bb28b3209 and has been resolved. Exact pinning is intentional — a class shrinking now requires a baseline edit — and the CI plumbing is unchanged and sound.

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

…y makes (OTA phase C, C1.6)

`c1PageClosureExclusions()` reads `C1_PAGE_CLOSURE` and nothing the run produced, so
asserting on it inside the three-minute replay bought nothing the cheap suite next
door does not already buy. `c1-page-closure.test.ts` makes the same assertion with a
presence precondition on top, which is the stronger of the two.

The comment beside the tally counted two checks above it; there are three, and a
golden that moved out of an excluded class into `identical` is invisible to all of
them: `result-absent-settlement` is past the nameable cap, so membership drift never
looks at it, and lowering it lowers the exclusion sum with it.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
@Jinwoo-H
Jinwoo-H merged commit f2fd18c into main Sep 18, 2026
24 checks passed
@Jinwoo-H
Jinwoo-H deleted the ota-c1-6-gate branch September 18, 2026 23:56
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