Repository navigation
test(mobile): make the bridged recording-corpus replay a CI gate and pin the C1 page closure (OTA phase C, C1.6) - #21533
Conversation
… (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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe bridge replay now runs in the standard test suite and is skipped only when Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to 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)
✅ Passed checks (4 passed)
Full details: Description checkExplanation 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
✨ Finishing Touches📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: f0dc328a-00e1-4b32-a3d5-1050350b8a31
📒 Files selected for processing (6)
.github/workflows/mobile.ymlmobile/src/test-support/bridged-parity/c1-page-closure.test.tsmobile/src/test-support/bridged-parity/c1-page-closure.tsmobile/src/test-support/bridged-parity/divergence-classes.test.tsmobile/src/test-support/bridged-parity/divergence-classes.tsmobile/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.
There was a problem hiding this comment.
ℹ️ 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.tsswitches fromdescribe.runIf(env === '1')todescribe.skipIf(env === '0'), and.github/workflows/mobile.ymldrops the dedicatedRPC_FOUNDATION_BRIDGE=1step becausemobile'spnpm test(vitest run, includesrc/**/*.test.ts) already collects the file. - Exact corpus assertion — the aggregate test replaces the
identical >= 396floor withcorpus === total(BRIDGED_PARITY_BASELINE)andidentical === pinned - excludedCount. - C1 page closure pin — new
c1-page-closure.tspins 103 goldens across 22 families to a bridged verdict by id (54 identical, 49 named artifacts), withc1PageClosureDriftchecking per-family membership and per-id verdicts;c1-page-closure.test.tsexercises the rule. - Flag contract —
BRIDGED_PARITY_OFF = '0'is added and the docs/tests updated so only=0skips.
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.
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
There was a problem hiding this comment.
✅ 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).
identicalnow pinned exactly — newbridgedParityTallyDriftcomparesidenticaland every per-class count againstBRIDGED_PARITY_BASELINEin both directions, and the aggregate test asserts it reports nothing. This closes the prior review's up-direction gap where an excluded-class-to-identicalmove passed without a baseline edit.- Unit coverage for the fixed direction —
divergence-classes.test.tsencodes the excluded-class-to-identicalmutation (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-observationcount 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.
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

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
pnpm test;RPC_FOUNDATION_BRIDGE=0is 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 becausepnpm testalready collects the file; keeping both ran the same 788 tests twice in one job.bridgedParityTallyDriftcompares the run'sidenticalcount and every per-class count againstBRIDGED_PARITY_BASELINEin both directions and the summary asserts it reports nothing, soidenticalis 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 theunclassifiedguard from C0.8 stay in force.bridged-parity/c1-page-closure.tsnames 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 (37result-absent-settlement, 7params-undefined, 3result-absent-stream-release, 2write-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-manifestis excluded on purpose: it reaches the closure only through the shared operation runner and its operation belongs to the shell, not the page.Cost
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
e71129bb96confirmed the gate runs underpnpm testin CI, five mutations bit, the closure derivation matched exactly (282 web-resolved modules; excludingmobileWeb.bundle-manifestis right), nothing fenced moved, and the wall-time cost is about 26 s at four workers. HIGH (also CodeRabbit's Major): theidenticalassertion 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 toidenticalpassed without touching the baseline (repro: 397/340, exit 0); the "pinned exactly" claim was false upward. Fixed in3bb28b3209withbridgedParityTallyDrift, 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 saidresult-absent-observation, 7; it is 3. Watch item, no change: pilot goldens run under vitest's default timeout with a ~20x margin. Lead-verified ataf2496adcd: tsc, format, both changed-code gates, flag-off skips 789, baselineidentical396→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
af2496adcdreproduced the round-1 hole ate71129bb96(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 (baselineidenticalup 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 in617de03e56: a comment said "two checks" where three are blind; thec1PageClosureExclusions()assertion was a weaker duplicate of the one inc1-page-closure.test.tsand is removed from the expensive suite.