Skip to content

Add snapshot tests for serialised brief payloads #130

Description

@coderabbitai

Problem

PR #117 adds unit tests for serialisation functions in episodic/canonical/profile_templates/_brief_serializers.py and related modules, but no snapshot tests exist to validate the complete structured JSON output of those serialisers. Without snapshot coverage, incidental formatting drift or unintended key-set changes in serialised brief payloads can go undetected.

Required resolution

  1. Introduce a snapshot testing library (e.g. syrupy) as a development dependency.
  2. Add snapshot tests for the serialised outputs of:
    • _serialize_profile_for_brief
    • _serialize_episode_template_for_brief
    • _serialize_reference_document_for_brief
  3. Explicitly redact or freeze non-deterministic fields (UUIDs, timestamps) in each snapshot to prevent spurious failures.
  4. Add compile-time tests (e.g. TypedDict or assert_type checks) confirming the return types of serialisers are assignable to JsonMapping.

References

/cc @leynos

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions