Replay: harden recorder and deterministic clock edge cases#182
Merged
dgarson merged 1 commit intofeat/deterministic-replayfrom Feb 24, 2026
Merged
Conversation
dgarson
added a commit
that referenced
this pull request
Feb 24, 2026
* feat: scaffold deterministic replay framework * feat(replay): add manifest schema validation helpers * feat(sessions): add replay session manifest types and serialization helpers Add session-level replay manifest types distinct from the replay bundle format in src/replay/types.ts (Nate's work in PR #92). - ReplaySessionManifest: session metadata for replay-capable sessions - ReplaySessionEvent: session-level events in the replay lifecycle - ReplaySessionEventLog: collection of session events - Serialization helpers: parse/serialize functions - Factory functions: createReplaySessionId, createReplaySessionManifest, createReplaySessionEvent - exportSessionManifest stub: placeholder for future storage integration Add 43 focused tests covering: - Schema validation for all types - Serialization round-trips - Factory function behavior - Edge cases and error handling * feat(replay): parse replay events and normalize recording categories * feat(sessions): add replay session manifest types and serialization helpers (#98) Add session-level replay manifest types distinct from the replay bundle format in src/replay/types.ts (Nate's work in PR #92). - ReplaySessionManifest: session metadata for replay-capable sessions - ReplaySessionEvent: session-level events in the replay lifecycle - ReplaySessionEventLog: collection of session events - Serialization helpers: parse/serialize functions - Factory functions: createReplaySessionId, createReplaySessionManifest, createReplaySessionEvent - exportSessionManifest stub: placeholder for future storage integration Add 43 focused tests covering: - Schema validation for all types - Serialization round-trips - Factory function behavior - Edge cases and error handling * docs: add deterministic replay architecture and TDD plan (#108) * feat: scaffold deterministic replay framework * feat(replay): add manifest schema validation helpers * feat(sessions): add replay session manifest types and serialization helpers Add session-level replay manifest types distinct from the replay bundle format in src/replay/types.ts (Nate's work in PR #92). - ReplaySessionManifest: session metadata for replay-capable sessions - ReplaySessionEvent: session-level events in the replay lifecycle - ReplaySessionEventLog: collection of session events - Serialization helpers: parse/serialize functions - Factory functions: createReplaySessionId, createReplaySessionManifest, createReplaySessionEvent - exportSessionManifest stub: placeholder for future storage integration Add 43 focused tests covering: - Schema validation for all types - Serialization round-trips - Factory function behavior - Edge cases and error handling * feat(replay): parse replay events and normalize recording categories * feat(sessions): add replay session manifest types and serialization helpers (#98) Add session-level replay manifest types distinct from the replay bundle format in src/replay/types.ts (Nate's work in PR #92). - ReplaySessionManifest: session metadata for replay-capable sessions - ReplaySessionEvent: session-level events in the replay lifecycle - ReplaySessionEventLog: collection of session events - Serialization helpers: parse/serialize functions - Factory functions: createReplaySessionId, createReplaySessionManifest, createReplaySessionEvent - exportSessionManifest stub: placeholder for future storage integration Add 43 focused tests covering: - Schema validation for all types - Serialization round-trips - Factory function behavior - Edge cases and error handling * docs: add deterministic replay architecture and TDD plan (#108) * Replay: harden recorder and deterministic clock edge cases (#182)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
startinputs to avoid downstream runtime errors.Description
InMemoryReplayRecorder.getEvents()so callers cannot mutate#events(src/replay/recorder.ts).#nextSeqsoseqremains monotonic for disabled-mode emissions (src/replay/recorder.ts).startinput increateDeterministicClockand throw a clear error for invalid timestamps (src/replay/clock.ts).getEvents()behavior, disabled-mode sequence increments, and invalid deterministic clock starts (src/replay/recorder.test.ts,src/replay/clock.test.ts).Testing
pnpm vitest run src/replay/clock.test.ts src/replay/recorder.test.ts src/replay/types.test.ts src/replay/runner.test.ts src/replay/manifest.test.tsand all tests passed.pnpm exec oxfmt --check src/replay/clock.ts src/replay/clock.test.ts src/replay/recorder.ts src/replay/recorder.test.tspassed for the touched files.pnpm checksurfaced an existing unrelated formatting failure insrc/gateway/hitl-request-store.tsthat was not modified by this PR.Codex Task