Conversation
…elpers 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
…elpers (#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
…elpers 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
…elpers (#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
…ot into feat/deterministic-replay
|
@codex review plz |
|
To use Codex here, create a Codex account and connect to github. |
dgarson
left a comment
There was a problem hiding this comment.
Summary
This PR adds deterministic replay primitives end-to-end: replay event/manifest schemas, recorder/runner/clock utilities, session-level replay manifest types, JSON/JSONL parsing, hashing/fingerprinting, and test coverage for core happy paths.
What looks good
- Clear modular boundaries (
types,recorder,runner,clock, session manifest layer). - Good schema validation and helpful parse error wrapping.
- Deterministic fingerprint strategy via stable key ordering is a strong choice.
- Test footprint is meaningful for serialization, sequence constraints, and session-manifest helpers.
Concerns
-
getEvents()exposes mutable internal recorder state (src/replay/recorder.ts)- Returning the internal array directly allows external mutation and can invalidate invariants/fingerprints unexpectedly.
- Suggest returning
this.#events.slice()(or frozen copy).
-
Inactive recorder emit path can produce repeated
seqvalues (src/replay/recorder.ts)- When
enabled=false,emit()returns events withseq: this.#nextSeqbut never increments. - If consumers rely on sequence monotonicity even in inactive mode, this is surprising.
- Suggest either incrementing seq consistently or explicitly documenting that inactive emits are synthetic/non-sequenced.
- When
-
Deterministic clock start parsing lacks guardrails (
src/replay/clock.ts)Date.parse(options.start)can yieldNaN; first call then throws ontoISOString().- Suggest explicit validation with clear error message for invalid start input.
Suggestions for follow-up
- Add immutability test for recorder events.
- Add tests for inactive recorder semantics (seq behavior).
- Add one failure-mode test for invalid deterministic clock start string.
- Consider introducing replay bundle export/import integration tests once storage wiring lands.
Overall: good architectural scaffold; recommend tightening these edges before broad adoption.
Summary
Describe the problem and fix in 2–5 bullets:
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.Security Impact (required)
Yes/No)Yes/No)Yes/No)Yes/No)Yes/No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Compatibility / Migration
Yes/No)Yes/No)Yes/No)Failure Recovery (if this breaks)
Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.