Add deterministic repro bundle recording and headless replay#58
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 726381bd46
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ), | ||
| ); | ||
|
|
||
| if (!bundle.eventCapture.batches.some((batch) => batch.resizeEvents.length > 0)) { |
There was a problem hiding this comment.
Inject bootstrap resize when first batch lacks viewport event
This condition only prepends a synthetic resize when no batch in the bundle has resize metadata, so bundles that contain a resize later (but start with key/text input) are replayed without an initial committed viewport. In that scenario createApp cannot build the first frame before the later resize arrives, so early routable events are dropped and the harness reports action mismatches for otherwise valid recordings (for example, captures started after app bootstrap).
Useful? React with 👍 / 👎.
| while ( | ||
| replayBackend.state.releasedRealBatches.value < replayBackend.totalRealBatches && | ||
| fatal === null && | ||
| spins < 4000 | ||
| ) { |
There was a problem hiding this comment.
Replace fixed spin cap with replay-completion waiting
The harness exits the drain loop after spins < 4000 even if batches are still being processed, then turns that into ZR_REPLAY_TIMEOUT. Because capture bounds are configurable and scheduler throughput is workload-dependent, larger or slower replays can fail with a timeout despite making forward progress, which creates false FAIL results unrelated to routing correctness.
Useful? React with 👍 / 👎.
Summary
rezi-repro-v1schema with strict validation and deterministic stable serialization in@rezi-ui/corecreateReproRecorderin@rezi-ui/nodeto capture bounded backend event batches (maxBatches,maxEvents,maxBytes) with deterministic truncation metadata and return bundle object/bytes without filesystem writescreateAppusing a stub backend, captures routed actions, and reports PASS/FAIL with structured mismatchespackages/testkit/fixtures/repro/replay_resize_tab_text.json) and deterministic replay tests (PASS path + failure diff path + invariant checks)docs/guide/record-replay.mdWhy
This makes bug reports reproducible in CI by recording deterministic input/resize sessions and replaying them headlessly with assertable routing outcomes.
Validation
npm run lintnpm run typechecknpm run buildnpm testnpm run test:e2enpm run test:e2e:reducednpm run test:native:smoke