Skip to content

feat(sessions): add replay session manifest types and serialization helpers#98

Merged
dgarson merged 1 commit intofeat/deterministic-replayfrom
barry/replay-session-manifest
Feb 23, 2026
Merged

feat(sessions): add replay session manifest types and serialization helpers#98
dgarson merged 1 commit intofeat/deterministic-replayfrom
barry/replay-session-manifest

Conversation

@dgarson
Copy link
Copy Markdown
Owner

@dgarson dgarson commented Feb 23, 2026

What

Add session-level replay manifest types in src/sessions/replay-manifest.ts that are distinct from the replay bundle format in src/replay/types.ts (Nate's work in PR #92).

Types Added

  • ReplaySessionManifest: Session metadata for replay-capable sessions
  • ReplaySessionEvent: Session-level events in the replay lifecycle
  • ReplaySessionEventLog: Collection of session events
  • ReplaySessionStats: Summary statistics for a replay session

Functions Added

  • Serialization helpers: parseReplaySessionManifest, serializeReplaySessionManifest, etc.
  • Factory functions: createReplaySessionId, createReplaySessionManifest, createReplaySessionEvent
  • exportSessionManifest stub: Placeholder for future storage integration (no risky integration)

Why

This provides a separate session-level concern for managing replay sessions. While Nate's work in PR #92 focuses on the replay bundle format (the file format for saving/loading replays), this work focuses on session-level metadata - tracking and managing individual replay-capable sessions.

How to Test

  • pnpm vitest run src/sessions/replay-manifest.test.ts — 43 tests pass
  • pnpm build — builds successfully

Edge Cases Considered

  • Invalid schema inputs are properly rejected with descriptive errors
  • Optional fields are handled correctly
  • Serialization round-trips work correctly
  • Factory functions produce valid manifests

Related Issues

…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
@dgarson
Copy link
Copy Markdown
Owner Author

dgarson commented Feb 23, 2026

Architecture Review (Tim)

Target: feat/deterministic-replay ✓ — Correctly targeted.

Content Review:

  • Clean TypeScript type definitions for replay session state, events, and manifests
  • Proper Zod schema validation with comprehensive test coverage (480 lines of tests)
  • Serialization helpers (parse/serialize) for JSON interchange
  • Factory functions (createReplaySessionId, createReplaySessionManifest, etc.) provide good ergonomics

Code Quality:

  • Schema versioning included (REPLAY_SCHEMA_VERSION)
  • Idempotency keys properly structured
  • Stats aggregation by category is useful for observability
  • Test coverage is thorough — covers validation, parsing, serialization edge cases

Verdict:LGTM — Well-structured foundational types for the replay system. Ready to merge.

Merging now.

@dgarson dgarson merged commit ed00ab7 into feat/deterministic-replay Feb 23, 2026
2 of 9 checks passed
@dgarson dgarson deleted the barry/replay-session-manifest branch February 23, 2026 14:22
dgarson added a commit that referenced this pull request Feb 24, 2026
…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
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant