Repository navigation
test(mobile): pin the agent-history page closure golden by golden (OTA phase C, C5.2) - #21649
Conversation
…C5.2)
The suite next door proves the corpus replays byte-identically or in a named
class, as counts over 787 goldens. A count cannot tell this domain's regression
from another domain's improvement, so the 134 recorded at a call site the
agent-history page owns are pinned by id, the way C1's 103 are.
Re-derived at this base rather than taken from the design: 3510 modules, 370
local, 16 under `src/agent-history`, 27 families, 134 goldens. The design measured
3508 / 368 at `889c2b562f`; the two new local modules are `omp-draft-launch.ts`
and `omp-fresh-launch.ts`, which arrived on main, and no family or golden moved.
The `.web.tsx` sibling is the entry: the native file reaches `MobileWebShellScreen`
and pulls the shell in, which adds 46 local modules and the two `mobileWeb.*`
families the C1 docstring excludes by name — so measuring the wrong one of the two
gives the right pin table and a wrong module count.
C1's 22 families are inherited verbatim rather than re-derived. Deriving them from
C2's classification rule disagrees with the committed file on 10 of its 103 pins,
in three ways that are each a true statement read too far: `tasks.smart-source
-search` is a `params-undefined` family and the rule's list of those is the five
C2 adds, not C1's one; `host-worktree-refresh` carries `write-ordinal` and
`result-absent-stream-release` goldens, classes the rule does not model because no
family C2 adds carries one; and "a scenario scripting `{ ok: true }` with no
result" is a property of the scenario a golden derives from, not of its family, so
reading it family-wide moves `worktree-catalog-snapshot`. The rule decides the
five families C5 adds and nothing else.
`c5PageClosureTotals` is pinned beside the per-id walk, and the gate asserts the
run's own class counts over this closure against it. A per-id walk agrees with a
table that is wrong the same way twice: deriving this file with a reader that
skipped `c1-page-closure.ts`'s wrapped entries produced an empty mismatch list, 53
`result-absent-settlement` and 0 `result-absent-stream-release` where the truth is
50 and 3. Only the counts showed it, so only the counts can guard it.
Both halves proved red, not assumed. A verdict changed in the pin fails the gate
as "aivault-history-scan-fulfilled: pinned params-undefined, ran identical"; a
golden dropped from the pin fails three ways — the drift names it, the totals move
72 to 71, and the census count fails.
Tallies untouched: 787 goldens, 396 / 341 / 3 / 6 / 33 / 8, unclassified 0. No
golden moved and nothing under `mobile/rpc-foundation/` was written.
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 (6)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughAdds shared page-closure types and helpers for exclusions, totals, drift, and reports. Defines a C5 closure with 27 families and 134 goldens. Updates C1 and C5 tests to use the shared APIs and corpus reader. Updates RPC recording tests to use shared closure reporting and validation. Priority: ⬇️ Low 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description gives detailed technical context, rationale, scope, validation results, and review history. However, it omits several required template sections, including the linked issue, explicit ELI5 and Why sections, Visual Proof or an N/A explanation, Testing details with platform coverage, AI Disclosure, the agent skill boundary checkbox, Notes, and the final checklist. Resolution Complete the repository template. Add a linked issue using
✨ 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.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes
- New C5 pin (
c5-page-closure.ts) — pins the 134 goldens in 27 families recorded at a call site inside the agent-history page closure to their bridge verdicts; C1's 22 families are inherited verbatim and five AI Vault families are added. Exports exclusions, totals and a drift reader. - Unit tests (
c5-page-closure.test.ts) — census (27 families / 134 goldens, unique ids), exact class totals (72 / 50 / 7 / 3 / 2), C1 inheritance object-for-object, the five added families, every pinned id'sfamilyread back from the corpus, no phantom ids, and the drift reader's arrival / departure / verdict-change / out-of-closure behaviors. - Bridge gate (
rpc-recording-through-bridge.test.ts) — lifts the C1 output reporter into a sharedreadClosure(name, pinned)and adds the C5 per-id drift plus a run-total assertion.
I validated the pin structurally against the corpus (all 134 ids exist, family labels match, ids unique, totals 72/50/7/3/2). The bridge replay itself was not run here — mobile's expo dependency is absent, so vitest cannot resolve expo/tsconfig.base.json — so verdict correctness for the five added families rests on CI.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| * into a family this domain owns arrives as a finding instead of going unnoticed for being absent | ||
| * from a pin that never mentioned it. | ||
| */ | ||
| export function c5PageClosureDrift( |
There was a problem hiding this comment.
c5PageClosureDrift (and c5PageClosureExclusions, and the BridgedParityVerdict / C5PageClosureObservation types) are verbatim copies of their C1 counterparts — only the constant name differs. With two copies in the tree, a fix or message change to one silently leaves the other behind, and the unit tests assert exact drift strings, so they will disagree. The test file duplicates asPinned, GOLDENS, and four of the five drift tests the same way.
Technical details
# Generalize the page-closure readers instead of copying them per series
## Affected sites
- `mobile/src/test-support/bridged-parity/c5-page-closure.ts:276` — `c5PageClosureDrift` is `c1PageClosureDrift` with `C5_PAGE_CLOSURE` swapped in.
- `mobile/src/test-support/bridged-parity/c5-page-closure.ts:250` — `c5PageClosureExclusions` likewise duplicates `c1PageClosureExclusions`.
- `mobile/src/test-support/bridged-parity/c5-page-closure.ts:44` — `BridgedParityVerdict` redeclared; `c1-page-closure.ts:29` already exports it, and `rpc-recording-through-bridge.test.ts:28` imports it from C1.
- `mobile/src/test-support/bridged-parity/c5-page-closure.test.ts:14-25` — `GOLDENS` / `asPinned` duplicated.
## Required outcome
- One shared implementation for the drift reader and exclusion flattener that takes the pin table as an argument, so each series file is data plus thin named wrappers (e.g. `c1PageClosureDrift(observed)` delegating to `pageClosureDrift(C1_PAGE_CLOSURE, observed)`).
- A single `BridgedParityVerdict` / observation type shared by both series.
## Suggested approach (optional)
- Add a small `page-closure.ts` beside `divergence-classes.ts` holding `pageClosureDrift(pinned, observed)`, `pageClosureExclusions(pinned)`, and the shared types; keep `c1-page-closure.ts` / `c5-page-closure.ts` as the pin tables.
- Move `GOLDENS` and `asPinned` (parameterized by the pin table) into the same shared test helper if the series test files keep growing.
## Open questions for the human (optional)
- Is the per-series duplication deliberate enough to keep (self-contained certification artifacts), or should this be the last copy before a shared module lands?There was a problem hiding this comment.
Addressed in fc0ea6c9e3 and c260928f39: one shared page-closure.ts now holds the types and the drift/exclusions/totals/line helpers, both pin files are their tables alone, and both tests read family through readGolden.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Round 1 on #21649. C5's pin file arrived with C1's type alias, observation type, exclusions walk and drift walk copied across, identical but for the names. The copies are the problem rather than the duplication: these pins are the instrument two domains argue with when a golden moves between families they share, and C5's closure contains C1's 22 families entire — so two spellings of "what drifted" can disagree about the same goldens while both stay green. `page-closure.ts` now holds the types and four helpers, each taking the pins as an argument; `pageClosureTotals` moves there too, since it is a general question and was C5's only real addition. `readPageClosure` joins them: the gate had grown a local helper to print one domain's line, which is the same shape one step later. Both pin files are now their table and nothing else, which is the part that is per series and meant to be read as a diff. Output asserted rather than assumed. The gate's two closure lines are byte- identical before and after — "C1 page closure: 103 goldens in 22 families, 54 byte-identical" and "C5 page closure: 134 goldens in 27 families, 72 byte-identical" — diffed as files, and both pin suites report the same 60 cases with the same verdicts. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Round 1 on #21649. Both pin tests parsed a golden file and asserted its shape in order to read one field, each with a `SAFETY` annotation saying every golden carries `family`. `readGolden` already answers that question properly: it checks the format version and the value pool and throws a named diagnostic otherwise, and returns `family` typed. Both annotations are gone rather than reworded. C1's is fixed in the same commit because it is the same line — the cast arrived in C5's file by being copied from it, and leaving the original would have kept the shape that produced the copy. The assertion is also stronger than it was. Before, a golden whose format version had moved would still be read and its `family` compared; now that file fails with the reader's own message instead of being silently accepted. Checked that it still discriminates rather than assuming: renaming one family in the pin fails two cases, the corpus-family read among them. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed the two commits that landed after the prior pullfrog review (4828906610 → c260928f39), both folds of the one round-1 suggestion.
- Extracted a shared page-closure module —
page-closure.tsnow holdsBridgedParityVerdict,PageClosureObservation,PageClosurePins,pageClosureExclusions,pageClosureTotals,pageClosureDriftandreadPageClosure;c1-page-closure.tsandc5-page-closure.tsare their pin tables alone, and the bridge gate prints both closure lines throughreadPageClosure. - Read a golden's
familythrough the corpus reader — both closure tests now usereadGolden(format-version and value-pool checked) instead of a localJSON.parsebehind aSAFETYcast, so a golden whose format moved fails with the reader's named diagnostic.
I verified the shared helpers reproduce the C1/C5 semantics line for line, the pin tables are unchanged, and the type/import graph is clean: no dangling c1PageClosure*/c5PageClosure* references remain and every new import is used. The mobile suite could not be run here (mobile deps are absent), so the gate replay still rests on CI.
The prior inline suggestion is addressed; I posted a reply on that thread. GitHub GraphQL rate limiting blocked marking the thread resolved from this run, so a later run or a maintainer should resolve it.

What this is
OTA phase C, C5.2: the certification pin for the agent-history page closure, joined to the bridged parity gate the way C1's is. Every golden recorded at a call site inside the page's closure is pinned by id to the verdict it gives at the bridge, so a divergence that joins this domain is a red test here even when the corpus-wide class counts still balance. No golden moves; the tallies (787; 396/341/3/6/33/8) are untouched; nothing under
mobile/rpc-foundation/is written.What the pin holds
Re-derived at this base from the entry esbuild compiles (
agent-history/[worktreeId].web.tsx; the native file pulls the shell in and carries twomobileWeb.*families, which is the tell for measuring the wrong one): 27 golden families, 134 goldens (module counts, 3510 with 370 local by the lane's derivation and 3536/368 by the reviewer's own esbuild closure, depend on the closure options and are not what the pin holds). Against the design's measurement at889c2b562f: two local modules arrived on main (omp-draft-launch.ts,omp-fresh-launch.ts); no family or golden moved; class totals identical, 72 byte-identical / 50 result-absent-settlement / 7 params-undefined / 3 result-absent-stream-release / 2 write-ordinal.C1's 22 families are inherited verbatim from
c1-page-closure.tsand a test asserts them equal object for object, not merely by name. The classification rule from the C2 design is applied only to the five families this domain adds (aiVault.history,aiVault.history-screen,aiVault.resume-launch,aiVault.resume-preparation,settings.resume-metadata). The rule alone does not reproduce C1 (ten of its 103 pins disagree, for three separate reasons), so inheritance is the derivation, and the rule does the small job it was measured on.The class totals are pinned beside the per-id walk and the gate asserts the run's own counts over the closure against them. That guards against the failure met while deriving this: a reader that skipped the pin file's wrapped entries produced an empty mismatch list with 53/0 where the truth is 50/3.
Red-first, both halves: a changed verdict fails by name ("pinned params-undefined, ran identical"); a dropped golden fails three ways (drift names it, the totals move 72 to 71, the census count fails). Gate output: "C5 page closure: 134 goldens in 27 families, 72 byte-identical", beside C1's unchanged line.
What "134 certified" does and does not mean
Each of the five added families has at least one byte-identical golden (asserted), so the pin means more than "the divergence kept its name". One inherited family,
host-worktree-refresh, has no byte-identical golden at all; it is C1's and is carried because this closure counts it. The resume mutation registry's client-mutation-id reuse is exercised by no golden:aiVault.resume-launchhas four non-matrix goldens (sent, create-refused, invalid-tab, locked) and none replays a write twice, so the gate proves nothing about retry after a delivery-unknown create; the C5.1 seam test covers the modes, not the reuse.firstParamreaches this closure throughmobile-source-control-screen-state, which costs exactly two local modules (mobile-source-control-screen-state.tsandmobile-git-status.ts; the icons are in the closure by other paths, so inlining the helper measures 3508/368 against 3510/370); moving it to a navigation-side module is a separate small PR at that cost.Checks
Mobile tsc, tests-typecheck ratchet, root and mobile oxlint, format, both changed-code gates against main, root
config/scriptssuite, full mobile suite including the bridged parity gate with both closure pins.Review round 1 (approve; two folds)
Fresh reviewer at
4828906610re-derived the closure with its own esbuild options (web entry 3510 / 370 / 27 families / 134 goldens, zeromobileWeb.*; native entry 3582 / 416 plusmobileWeb.bundle-fetchandmobileWeb.bundle-manifest), parsed both pin files wrap-aware and found C1's 22 families equal object for object, reproduced C2's rule on all 31 added pins with zero mismatches, confirmed the totals from a text parse and from the imported object, and drove both red-first halves (a flipped inherited verdict fails the standalone test by family name; a dropped plus a flipped golden fail census, totals and drift with the lines verbatim). Gate wiring confirmed on by default with both closure lines printing; tallies untouched. Folded: the C5 pin duplicated C1's types and drift helpers, now one shared module both pins use; the goldenfamilyread goes through the existing checkedreadGoldenin both closure tests instead of aSAFETYcast. Body correction: thefirstParamcost is two local modules, not the icons.Round-1 folds landed as
fc0ea6c9e3(onepage-closure.tsholding the types, the drift and totals helpers and the line printer, each taking the pins as an argument; both pin files are now their table alone; the gate's two lines and both pin suites' 60 verdicts diffed byte-identical before and after) andc260928f39(both closure tests read goldens throughreadGolden, the corpus's own checked reader, so a golden whose format version moved now fails with the reader's named diagnostic instead of being compared anyway; bothSAFETYcasts gone, C1's included, since the copy came from it).Review round 2 (SHIP WITH NITS)
Fresh reviewer at
c260928f39dumped both pin tables at the previous head and at this one (byte-identical, 17740 bytes each), ran a 4000-case differential fuzz of the pre-fold drift, exclusion, totals and printer helpers against the shared module (zero divergences), tried to hide a domain-specific difference through the shared helper (a C1-inherited golden flipped inside C5's table fails three tests by name), confirmed both tests read throughreadGoldenwith no cast left (a format-version drift fails both with the reader's diagnostic), re-verified the inheritance, totals, tallies and every body fact, and reproduced the three-way red for a dropped golden. One nit, folded into the body: absolute module counts vary with closure options; the family and golden counts are the pin.