diff --git a/tests/media_fragment_replay.py b/tests/media_fragment_replay.py index 3bf7c32..c018069 100644 --- a/tests/media_fragment_replay.py +++ b/tests/media_fragment_replay.py @@ -4,9 +4,15 @@ Captures the raw `_generate_html_media` output (BEFORE sanitize) for every media render kind and edge branch, as a SEPARATE oracle layer from the stage-0 feed goldens -(spec §4: "два слоя эталонов, не смешивать"). The 5a refactor (MEDIA_SOURCES table + -renderers) must reproduce these fragments byte-for-byte; 5b intentionally changes two -of them (§3.13 large-file guard is collection-only, §3.14 unclosed-div close). +(spec §4: "два слоя эталонов, не смешивать"). + +`media_fragments.json` is the PRE-REFACTOR BASE reference: it was captured by running +THIS harness against the BASE `post_parser.py` checkout (the pre-refactor code), NOT +against stage-5 code — so it is a genuine base-anchored golden layer, not a circular +self-snapshot of the refactor. The 5a refactor (MEDIA_SOURCES table + renderers) must +reproduce these base fragments byte-for-byte. The ONLY 5b-registered changes vs the base +are the two entries in REGISTERED_DELTAS (§3.14 unclosed-div close); the §3.13 large-file +guard is collection-only and changes no fragment bytes. Cases whose type exists in the recorded corpus could be pulled from it, but the media FRAGMENT is a pure function of a single Message, so deterministic hand-built mocks give @@ -125,6 +131,27 @@ def build_cases(): return cases +# --------------------------------------------------------------------------- # +# Registered 5b deltas vs the pre-refactor base snapshot. +# +# Spec §3.14: the empty
`. These are the ONLY fragments the 5b registered fixes +# change relative to the pre-refactor base — every other case reproduces base bytes. +REGISTERED_DELTAS = { + "file_unique_id_none": { + "collected": [], + "html": "", + }, + "webpage_without_photo": { + "collected": [], + "html": "\n