test(ios): fail when snapshot bridge bounds drift between host and native
Merged
TH
2d ago+62+62+01234567890123456789-10-10-01234567890123456789
Summary
Follow-up to #4089. The host snapshot-source limits mirrored native snapshot-bridge constants only by comment, and the Objective-C fixtures hard-coded 65 and 64. If one side changed, nothing failed.
SnapshotBridgeCapture.hnow exportskMaximumRequestLevels(65) andkMaximumRequestsPerCapture(64).foreground-owner.muses them instead of literals, and derives the expected continuation count from the window.- New
limits.test.tsreads the bridge sources and asserts:MAXIMUM_REQUEST_LEVELSequalskMaximumRequestLevels.resolveSnapshotSourceLimitsaccepts each native bound (kMaximumFrameBytes,kMaximumDepth,kMaximumNodes,kMaximumDurationMs) and rejects one more. This checks through the public boundary, with no new test-only exports.
Why a parity test instead of reporting first-request levels in the recovery counters: the counter route changes the bridge wire (response keys, wire vocabulary, recovery conformance fixtures, source version) to replace one constant. The parity test is one file and leaves native behavior and the wire unchanged. Small scope expansion: frame, node and duration bounds are covered by the same table.
5 files, +61/ā10. No device run: this change touches only constants, fixtures and tests.
Refs #4089
Validation
pnpm check:affected --run --head 281c5ae35eb351b631daebe2e03a53ba73327196: 41/41 passed (fail-open full set).- Mutation check: changing native
kMaximumRequestLevels, nativekMaximumDepth, TSMAXIMUM_DEPTH, or TSMAXIMUM_FRAME_BYTESmakeslimits.test.tsfail. cache-native-runtime.test.ts(compiles the fixtures on macOS): 49/49 passed.- Independent review: nothing blocking. All three non-blocking notes were applied.
š¤ Generated with Claude Code