Repository navigation
fix(lint): replace Reflect.get with typed property access in mounting substitutes - #20874
Conversation
…ounting substitutes main's tip fails `pnpm run audit:anti-slop` (the `static analysis` CI gate) on `no-reflect-get` in mobile/src/test-support/rpc-recording/native-mounting-substitutes.ts, blocking every open PR. The Proxy get trap's key is `string | symbol`; branch on that to keep typed bracket access for strings and a symbol-indexed cast for symbols, preserving the existing throw-on-unsubstituted-member behavior exactly.
|
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; 9 remain after this review. 📝 WalkthroughWalkthroughThe Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This refactor preserves native-module property reads and introduces no supported merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the implementation, reason, behavior preservation, and verification results. However, it does not follow most required template sections, including ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing checkboxes, Review, Notes, and Checklist. Resolution Update the description to include all required template sections. Add the linked issue under
✨ 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.
Important
The as cast this PR adds reintroduces a blocking CI failure in a different gate than the one it fixes: pnpm run check:code-quality:changed reports typescript(consistent-type-assertions) on added line 48, so the Enforce changed-code quality step fails. The anti-slop fix itself is correct; only the assertion needs to go.
Reviewed changes
Reflect.getreplaced in thepartialNativeModuleProxy trap — thegettrap now branches ontypeof key, readingtarget[key]for string keys and(target as Record<symbol, unknown>)[key]for symbol keys, while preserving the__esModulebypass and the unsubstituted-member throw. Runtime behavior against these plain-object targets is equivalent toReflect.get.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| if (typeof key === 'string') { | ||
| if (key !== '__esModule' && !(key in target)) { | ||
| throw new Error(`Unsubstituted native member: ${module}.${key}`) | ||
| } | ||
| return target[key] | ||
| } | ||
| return Reflect.get(target, key) | ||
| return (target as Record<symbol, unknown>)[key] |
There was a problem hiding this comment.
This cast fails a different blocking gate than the one the PR fixes. The casting code quality scan in pnpm run check:code-quality:changed (which enforces assertionStyle: never) flags this added line, so the Enforce changed-code quality step at .github/workflows/pr.yml:164 exits 1 — verified locally, one finding on line 48. Dropping the assertion keeps behavior: these targets are plain object literals with no symbol properties, so the symbol read already resolved to undefined under Reflect.get, and an early undefined return preserves that while leaving the __esModule/unsubstituted-member checks intact.
Technical details
# Remove the type assertion on the symbol read
## Affected sites
- `mobile/src/test-support/rpc-recording/native-mounting-substitutes.ts:48` — `(target as Record<symbol, unknown>)[key]`
## Evidence
- `node config/scripts/check-changed-code-quality.mjs origin/main` → `casting code quality: 1 new finding(s)` … `line 48 … Do not use any type assertions.`
- The same gate also runs `config/oxlint-code-quality-casting.json`, whose `typescript/consistent-type-assertions` is `["error", { "assertionStyle": "never" }]`.
## Required outcome
- The symbol branch reads the target without a type assertion so `check:code-quality:changed` passes, while `anti-slop(no-reflect-get)` stays satisfied.
## Suggested approach
- Option A (inline suggestion): return `undefined` for `typeof key === 'symbol'`. Equivalent here because the targets carry no symbol members.
- Option B: widen the `members` parameter to `Record<PropertyKey, unknown>` and restore the single-condition body ending in `return target[key]`; this preserves symbol reads exactly.
- Both were verified to pass `tsc --strict`, `config/oxlint-code-quality-casting.json`, and `audit:anti-slop`.| if (typeof key === 'string') { | |
| if (key !== '__esModule' && !(key in target)) { | |
| throw new Error(`Unsubstituted native member: ${module}.${key}`) | |
| } | |
| return target[key] | |
| } | |
| return Reflect.get(target, key) | |
| return (target as Record<symbol, unknown>)[key] | |
| if (typeof key === 'symbol') { | |
| return undefined | |
| } | |
| if (key !== '__esModule' && !(key in target)) { | |
| throw new Error(`Unsubstituted native member: ${module}.${key}`) | |
| } | |
| return target[key] |
native-mounting-substitutes.ts changed bytes, so recorderSha256 (which pins every non-adapter file under this directory into every golden's header) moved. Re-recorded all 509 goldens; only recorderSha256 differs in any of them, confirming the checkpoint content is unchanged.
|
Too many files changed for review (510 files, 100 file limit). |
There was a problem hiding this comment.
ℹ️ No new issues in the golden re-record itself — one sequencing note below.
Reviewed changes
The only change since the prior pullfrog review at 2a6c0b6 is one commit that re-records the golden headers after the recorder source edit shifted their pinned digest.
- Re-recorded all 509
rpc-foundationgoldens — every golden'srecorderSha256moves fromfc1f0b1f…toe044443e…, and nothing else in any file changes (noscenarioSha256,adapterSha256, or recorded observation). I recomputed the digest from the checked-out source and it matchese044443e…, so the re-record is internally consistent.
ℹ️ The re-record is pinned to a source that will shift again
recorderSha256 digests the raw bytes of every pinned file under mobile/src/test-support/rpc-recording, and native-mounting-substitutes.ts is one of them. This commit re-records all 509 goldens against the source as it stands, but that source still carries the assertion the previous review flagged, so whichever fix lands for it edits a pinned file and shifts recorderSha256 a second time — forcing a second full re-record and a fresh 509-file conflict surface. Landing the assertion fix first, then re-recording once, avoids the extra churn.
Technical details
# Order the golden re-record after the source stops changing
## Affected sites
- `mobile/rpc-foundation/goldens/*.json` (509 files) — every header is pinned to `e044443e…`, the `recorderSha256` of the current source.
- `mobile/src/test-support/rpc-recording/native-mounting-substitutes.ts:48` — the assertion; removing or suppressing it rewrites the file, which re-digests every golden.
## Evidence
- `recorderSha256` (`mobile/src/test-support/rpc-recording/recorder-digest.ts:55`) digests every non-markdown file under `RECORDER_DIRECTORY` except `adapters/` and `mutants/`, and `native-mounting-substitutes.ts` is included.
- Recomputing the digest from the checked-out source yields `e044443e01f282566a5e0eff110d0861d2a1047ca8d8696a2e7ff914f51957f3`, matching the re-recorded headers.
- `golden-header-digest.test.ts:248` ("re-digests every golden when an engine file changes") asserts this all-goldens movement.
## Required outcome
- One re-record, against a source that no longer needs a follow-up edit.
## Open questions for the human
- Intentional to land the golden churn ahead of the assertion fix, or should the fix land first?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Review verdict: correct, verified, mergeableBehavioral correctness of the
This is a materially different (and correct) approach vs. the sibling fix in Throw semantics for Empirical confirmation: regenerated all 509 golden recordings against the fixed source and diffed every one against the pre-fix originals — the only line that changed in any of the 509 files is the Root cause of the CI failure this PR hit: Scope: confirmed via diff against the true merge-base ( Verification performed at PR head (
Remaining gaps (not defects, just noting): the Merge verdict: clean to merge. |
…'s engine digest #20874 re-digested `recorderSha256` on all 509 goldens, so the six goldens mounted through the worktree catalog adapter had to be recorded again from the pin rather than merged. Bodies and `adapterSha256` are unchanged from the pre-merge recording. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
… RPC recorder (#20873) * test(rpc-recording): record the real worktree catalog snapshot result `worktree.catalog-snapshot`'s action returned `WorktreeCatalogSnapshotClient.fetch`'s raw result. That value nests the live `RpcClient` under `pending.client`, so `captureValue` threw `Unsupported observation: function`: both goldens baked an `unhandled-rejection` effect and left the action's settlement `pending`, proving nothing about what the fetch returns. Project the result through `projectObservable` on the settlement path, the same way `state()` already shows it and the same way #20667 fixed `transport.pairing-race`. Rejections still propagate unchanged, so the two transport-rejection matrix partitions keep their recorded errors. The matrix golden now discriminates all eleven reply partitions: a full admission, six invalid ones, three `request_failed` codes and two rejections. `recorderSha256` does not move; `adapterSha256` moves on the six goldens mounted through this adapter module, four of which have no other change. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(rpc-recording): fail the suite when a golden records a recorder failure A projection refusal settles as data, not as a failed run: `captureValue` throws inside the action, the recorder captures it as an `unhandled-rejection` effect, and `--record` writes a green golden whose action never settled. The class has landed twice — `transport.pairing-race` in #20667 and `worktree.catalog-snapshot` in the previous commit — and reverting either one plus a re-record would go green with the broken golden back. Read every golden and fail on an `unhandled-rejection` effect or on either of `captureValue`'s refusal texts in any observation field. A positive control in the same case asserts both detectors fire, so the absence claim is load-bearing rather than vacuous. Not a recording driver, so `recorderSha256` excludes it and no golden moves. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(rpc-recording): ban only the recorder's own refusals, not product bugs The gate also failed on any effect named `unhandled-rejection`, which bans a real observation: detached-rejection capture exists to pin a main bug in a golden, and `unhandled-recording.test.ts` pins the capture precisely because no golden carries one today. Banning the name would make recording a genuine product failure a test failure. Drop that detector. `refusalText` alone catches all seven checkpoints of the worktree-catalog regression, because the refusal is the message of the captured error rather than the effect's name. The positive control now seeds that shape — the refusal inside a recorded error under `effects` — so the surviving detector is still proven to fire. Vacuity guards on golden and checkpoint counts are unchanged. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(rpc-recording): re-record the worktree catalog goldens over main's engine digest #20874 re-digested `recorderSha256` on all 509 goldens, so the six goldens mounted through the worktree catalog adapter had to be recorded again from the pin rather than merged. Bodies and `adapterSha256` are unchanged from the pre-merge recording. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
main adopted anti-slop's `no-reflect-get` in #20874 and fixed the copy that lived in `native-mounting-substitutes.ts`. This branch moved both traps into `native-module-traps.ts`, so the rule lands here instead and the static-analysis gate is red without the same narrowing. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Takes main's typed property access in the native traps (#20874) and main's `baseline` repin to e7206f6 (#20895); pre-existing goldens take main's side and are re-recorded in the next commit. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…tate in the RPC recorder (#20884) * test(mobile): mount screens, declared device stores and declared OS state in the RPC recorder Three recorder capabilities, each with a test, plus four holdout sites recorded against main's product code to prove them. No product source changes. - JSX compiles through the automatic runtime, which is what product sources use; the classic `React.createElement` emit threw `React is not defined` on the first render of every screen. - An unlisted package answers `__esModule` as undefined, so a default import loads and the refusal defers to the first real member read instead of killing the module at load. - The substitutes table gains the inert view packages a screen needs, split into `screen-native-substitutes.ts` behind the same rule: only what a screen reads is listed. - A scenario may declare `deviceStore` and `deviceState.notificationTray`. Reads resolve the declaration or null and never a write; writes are recorded as effects. Undeclared is unchanged. - `screenMount` mounts a component with a crash boundary, so a reply partition that takes a screen down is a recording rather than a suite failure. Every pre-existing golden re-records byte-identical except `recorderSha256`, recorded from a detached worktree at the pinned baseline. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): declare the crash boundary's state type instead of asserting it The changed-code casting gate counts `null as string | null` as a type assertion. Re-records every golden from the pinned baseline, because the edit moves `recorderSha256`. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): refuse an unlisted native package by the member a mount reads Both emitted interop helpers short-circuit on `__esModule`, so answering `true` hands the refusing trap back unwrapped to `__importDefault` and `__importStar`. All three import forms now load the importer and throw the named refusal at the first member read, instead of a namespace import silently yielding `undefined` and failing later at the call. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): run a task deferred past interactions instead of dropping it An inert `runAfterInteractions` swallows whatever send the screen deferred, and the recording then claims the screen sends nothing. It runs the task on a microtask and returns the RN-shaped handle, so a cancel before the task runs still prevents it. `Alert.alert` stays inert. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record every golden for the two recorder engine changes Only `recorderSha256` moves, from c58067de to a59b30e7. Recorded from a detached worktree at the pinned baseline c6a7216 with this branch's recorder and scenario file overlaid, so no golden body is a claim about migrated source. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): stop exporting three recorder symbols with no importer `projectScreenTree`, `DeviceEffect` and `DeclaredNotification` are only used by the file that declares them. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record every golden for the dropped exports Only `recorderSha256` moves, from a59b30e7 to 4df43aef. Recorded from a detached worktree at the pinned baseline c6a7216 with this branch's recorder and scenario file overlaid. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): list only the native members a recording is known to read Instrumenting `partialNativeModule` across all 522 recordings found 68 declared members and 23 read. The unread ones are gone: the whole react-native-svg, react-native-reanimated and react-native-gesture-handler entries, two expo-router hooks, and twelve react-native members including `InteractionManager` and `Alert`. A member listed before a recording reads it turns a refusal that would have forced a decision into a silent stand-in, which is how an inert scheduler swallows a deferred send. Wave 3 re-adds each one with the recording that reads it. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): order each effect against the sends with a send count Sender and effects are two independent lists, so a send reordered ahead of a device write moved neither. Scheduling the codex journal write on a timer instead of awaiting it left all 520 goldens byte-identical; with `sent` it moves two. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): report a boundary crash through the effect sink A hook mount projects the hook's own value and never a crash, so an adapter that never reads `crash()` recorded a screen that quietly stopped rendering. The boundary now reports to the effect sink as well, which forces a cleanup checkpoint and puts the crash in the golden with no adapter cooperation. Two reply-matrix goldens gain the effect. Also folds the two near-identical tree walkers into one `walk(tree, visit)`. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): state the __esModule interop rule once It was restated at four sites with four different answers. The canonical paragraph is in `native-module-traps.ts`; the loader and the declared tray point at it in a line. The loader comment also said the refusal names the member the product read, which for a default import is `.default` instead. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record for the send ordinal, the crash effect and the pruned table `recorderSha256` moves on all 520. Of the 509 pre-existing goldens, 260 are header-only and 249 gain `sent` on their effects and nothing else; two of this branch's own reply-matrix goldens also gain a `screen.crash` effect. Recorded from a detached worktree at the pinned baseline c6a7216. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(lint): drop Reflect.get from the native traps main adopted anti-slop's `no-reflect-get` in #20874 and fixed the copy that lived in `native-mounting-substitutes.ts`. This branch moved both traps into `native-module-traps.ts`, so the rule lands here instead and the static-analysis gate is red without the same narrowing. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record for the Reflect.get narrowing `recorderSha256` only, 8ca81bc6 to 0ddc0dc4. No golden body moves, which is the claim the narrowing makes: the trap reads the same member it always did. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record every golden at main's new baseline pin One record from a detached worktree at `e7206f62a8` — main's pin since #20895 — with this branch's `rpc-recording/`, `pilot-scenarios.json` and `scripts/rpc-recording.mts` laid over it, so the goldens are recorded against main's product tree rather than a branch that edits the engine. All 520 goldens now share one `recorderSha256` (`0ddc0dc472e2efbe58004c6dfaf5360e368fed321e40dfe15c11a9ad1817dea4`) and one `baseline`. Against main, 262 move on the header alone and 247 also gain the `sent` ordinal on an effect, which is the whole of the body change; the nine goldens #20895 re-digested carry a byte-identical body, and the six the new worktree catalog adapter (#20873) recorded keep main's observation. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Picks up #20874 (6c03bb6), which removes the Reflect.get this branch was carrying as an inherited anti-slop error. The file arrives from main untouched - its blob here is now main's 6a85b39 - and audit:anti-slop reports zero findings for the first time on this branch. Twelve settings goldens conflicted, the same set as before and for the same reason: main moved recorderSha256 while this branch owns adapterSha256, so neither side's header describes the merged tree. Resolved by re-recording from the merged sources so both digests derive from what is actually there. Unlike the previous merge, the BODIES changed too, and that is correct rather than a regression: main rewrote the recording harness and run-recording.ts now projects a `sent` counter on every effect. The re-recorded bodies gain only `sent` lines - pure additions, no deletions, no modifications - matching the ~629 goldens that took main's side cleanly. The header delta is baseline (main repinned it) and recorderSha256; adapterSha256 is unchanged because this branch already held the right one. The golden set is unchanged in both directions at 641.
… substitutes (stablyai#20874) * fix(lint): replace Reflect.get with typed property access in native mounting substitutes main's tip fails `pnpm run audit:anti-slop` (the `static analysis` CI gate) on `no-reflect-get` in mobile/src/test-support/rpc-recording/native-mounting-substitutes.ts, blocking every open PR. The Proxy get trap's key is `string | symbol`; branch on that to keep typed bracket access for strings and a symbol-indexed cast for symbols, preserving the existing throw-on-unsubstituted-member behavior exactly. * test(rpc-recording): re-record goldens for the recorderSha256 shift native-mounting-substitutes.ts changed bytes, so recorderSha256 (which pins every non-adapter file under this directory into every golden's header) moved. Re-recorded all 509 goldens; only recorderSha256 differs in any of them, confirming the checkpoint content is unchanged.
… RPC recorder (stablyai#20873) * test(rpc-recording): record the real worktree catalog snapshot result `worktree.catalog-snapshot`'s action returned `WorktreeCatalogSnapshotClient.fetch`'s raw result. That value nests the live `RpcClient` under `pending.client`, so `captureValue` threw `Unsupported observation: function`: both goldens baked an `unhandled-rejection` effect and left the action's settlement `pending`, proving nothing about what the fetch returns. Project the result through `projectObservable` on the settlement path, the same way `state()` already shows it and the same way stablyai#20667 fixed `transport.pairing-race`. Rejections still propagate unchanged, so the two transport-rejection matrix partitions keep their recorded errors. The matrix golden now discriminates all eleven reply partitions: a full admission, six invalid ones, three `request_failed` codes and two rejections. `recorderSha256` does not move; `adapterSha256` moves on the six goldens mounted through this adapter module, four of which have no other change. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(rpc-recording): fail the suite when a golden records a recorder failure A projection refusal settles as data, not as a failed run: `captureValue` throws inside the action, the recorder captures it as an `unhandled-rejection` effect, and `--record` writes a green golden whose action never settled. The class has landed twice — `transport.pairing-race` in stablyai#20667 and `worktree.catalog-snapshot` in the previous commit — and reverting either one plus a re-record would go green with the broken golden back. Read every golden and fail on an `unhandled-rejection` effect or on either of `captureValue`'s refusal texts in any observation field. A positive control in the same case asserts both detectors fire, so the absence claim is load-bearing rather than vacuous. Not a recording driver, so `recorderSha256` excludes it and no golden moves. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(rpc-recording): ban only the recorder's own refusals, not product bugs The gate also failed on any effect named `unhandled-rejection`, which bans a real observation: detached-rejection capture exists to pin a main bug in a golden, and `unhandled-recording.test.ts` pins the capture precisely because no golden carries one today. Banning the name would make recording a genuine product failure a test failure. Drop that detector. `refusalText` alone catches all seven checkpoints of the worktree-catalog regression, because the refusal is the message of the captured error rather than the effect's name. The positive control now seeds that shape — the refusal inside a recorded error under `effects` — so the surviving detector is still proven to fire. Vacuity guards on golden and checkpoint counts are unchanged. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(rpc-recording): re-record the worktree catalog goldens over main's engine digest stablyai#20874 re-digested `recorderSha256` on all 509 goldens, so the six goldens mounted through the worktree catalog adapter had to be recorded again from the pin rather than merged. Bodies and `adapterSha256` are unchanged from the pre-merge recording. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…tate in the RPC recorder (stablyai#20884) * test(mobile): mount screens, declared device stores and declared OS state in the RPC recorder Three recorder capabilities, each with a test, plus four holdout sites recorded against main's product code to prove them. No product source changes. - JSX compiles through the automatic runtime, which is what product sources use; the classic `React.createElement` emit threw `React is not defined` on the first render of every screen. - An unlisted package answers `__esModule` as undefined, so a default import loads and the refusal defers to the first real member read instead of killing the module at load. - The substitutes table gains the inert view packages a screen needs, split into `screen-native-substitutes.ts` behind the same rule: only what a screen reads is listed. - A scenario may declare `deviceStore` and `deviceState.notificationTray`. Reads resolve the declaration or null and never a write; writes are recorded as effects. Undeclared is unchanged. - `screenMount` mounts a component with a crash boundary, so a reply partition that takes a screen down is a recording rather than a suite failure. Every pre-existing golden re-records byte-identical except `recorderSha256`, recorded from a detached worktree at the pinned baseline. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): declare the crash boundary's state type instead of asserting it The changed-code casting gate counts `null as string | null` as a type assertion. Re-records every golden from the pinned baseline, because the edit moves `recorderSha256`. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): refuse an unlisted native package by the member a mount reads Both emitted interop helpers short-circuit on `__esModule`, so answering `true` hands the refusing trap back unwrapped to `__importDefault` and `__importStar`. All three import forms now load the importer and throw the named refusal at the first member read, instead of a namespace import silently yielding `undefined` and failing later at the call. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): run a task deferred past interactions instead of dropping it An inert `runAfterInteractions` swallows whatever send the screen deferred, and the recording then claims the screen sends nothing. It runs the task on a microtask and returns the RN-shaped handle, so a cancel before the task runs still prevents it. `Alert.alert` stays inert. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record every golden for the two recorder engine changes Only `recorderSha256` moves, from c58067de to a59b30e7. Recorded from a detached worktree at the pinned baseline c6a7216 with this branch's recorder and scenario file overlaid, so no golden body is a claim about migrated source. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): stop exporting three recorder symbols with no importer `projectScreenTree`, `DeviceEffect` and `DeclaredNotification` are only used by the file that declares them. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record every golden for the dropped exports Only `recorderSha256` moves, from a59b30e7 to 4df43aef. Recorded from a detached worktree at the pinned baseline c6a7216 with this branch's recorder and scenario file overlaid. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): list only the native members a recording is known to read Instrumenting `partialNativeModule` across all 522 recordings found 68 declared members and 23 read. The unread ones are gone: the whole react-native-svg, react-native-reanimated and react-native-gesture-handler entries, two expo-router hooks, and twelve react-native members including `InteractionManager` and `Alert`. A member listed before a recording reads it turns a refusal that would have forced a decision into a silent stand-in, which is how an inert scheduler swallows a deferred send. Wave 3 re-adds each one with the recording that reads it. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): order each effect against the sends with a send count Sender and effects are two independent lists, so a send reordered ahead of a device write moved neither. Scheduling the codex journal write on a timer instead of awaiting it left all 520 goldens byte-identical; with `sent` it moves two. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): report a boundary crash through the effect sink A hook mount projects the hook's own value and never a crash, so an adapter that never reads `crash()` recorded a screen that quietly stopped rendering. The boundary now reports to the effect sink as well, which forces a cleanup checkpoint and puts the crash in the golden with no adapter cooperation. Two reply-matrix goldens gain the effect. Also folds the two near-identical tree walkers into one `walk(tree, visit)`. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): state the __esModule interop rule once It was restated at four sites with four different answers. The canonical paragraph is in `native-module-traps.ts`; the loader and the declared tray point at it in a line. The loader comment also said the refusal names the member the product read, which for a default import is `.default` instead. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record for the send ordinal, the crash effect and the pruned table `recorderSha256` moves on all 520. Of the 509 pre-existing goldens, 260 are header-only and 249 gain `sent` on their effects and nothing else; two of this branch's own reply-matrix goldens also gain a `screen.crash` effect. Recorded from a detached worktree at the pinned baseline c6a7216. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(lint): drop Reflect.get from the native traps main adopted anti-slop's `no-reflect-get` in stablyai#20874 and fixed the copy that lived in `native-mounting-substitutes.ts`. This branch moved both traps into `native-module-traps.ts`, so the rule lands here instead and the static-analysis gate is red without the same narrowing. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record for the Reflect.get narrowing `recorderSha256` only, 8ca81bc6 to 0ddc0dc4. No golden body moves, which is the claim the narrowing makes: the trap reads the same member it always did. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-record every golden at main's new baseline pin One record from a detached worktree at `e7206f62a8` — main's pin since stablyai#20895 — with this branch's `rpc-recording/`, `pilot-scenarios.json` and `scripts/rpc-recording.mts` laid over it, so the goldens are recorded against main's product tree rather than a branch that edits the engine. All 520 goldens now share one `recorderSha256` (`0ddc0dc472e2efbe58004c6dfaf5360e368fed321e40dfe15c11a9ad1817dea4`) and one `baseline`. Against main, 262 move on the header alone and 247 also gain the `sent` ordinal on an effect, which is the whole of the body change; the nine goldens stablyai#20895 re-digested carry a byte-identical body, and the six the new worktree catalog adapter (stablyai#20873) recorded keep main's observation. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

main's tip currently fails
pnpm run audit:anti-slop(thestatic analysisCI gate), blocking every open PR:The Proxy
gettrap'skeyisstring | symbol, while the target isRecord<string, unknown>—Reflect.getwas used to read both key shapes without a cast. This replaces it by branching ontypeof key: typed bracket access (target[key]) for the string case, and a symbol-indexed cast ((target as Record<symbol, unknown>)[key]) for the symbol case. Both are ordinary property reads with identical semantics toReflect.get(target, key)for this plain-object target, so behavior (including the__esModuleand unsubstituted-member throw checks) is unchanged.Verified:
pnpm run audit:anti-slopexits 0,pnpm tcclean, mobiletypecheckclean,oxfmt --checkclean, and the file's consumer test suites (native-mounting-substitutes.test.ts,recording-runner.test.ts,adapter-seam.test.ts,adapter-load-deferral.test.ts— 30 tests) pass.