Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
test(effects,audio,compose,curate): drop duplicate tests; each curator JS grid runs in one node process
Soohong Kim68216dcf76b2
diff --git a/tests/audio/test_sound.py b/tests/audio/test_sound.pyindex 060e761..f4a014a 100644--- a/tests/audio/test_sound.py+++ b/tests/audio/test_sound.py@@ -134,12 +134,13 @@ def test_the_rule_needs_a_peak_reason_and_never_relaxes_the_peak():assert not processing.meets(float('-inf'), -50, -18)[email protected]('case', ['headroom', 'hot'])-def test_export_refuses_a_quiet_file_with_headroom_and_a_hot_peak(tmp_path, monkeypatch, case):+def test_export_refuses_a_quiet_file_with_headroom_and_a_hot_peak(tmp_path, monkeypatch):+ # One file that fails meets() is enough: every failure reaches the same raise, and+ # the quiet-with-headroom and hot-peak conditions are pinned on meets() itself in+ # test_the_rule_needs_a_peak_reason_and_never_relaxes_the_peak.t = np.arange(48000) / 48000- pcm = np.stack([np.sin(2*np.pi*440*t)]*2, axis=1) * (.01 if case == 'headroom' else .1365)- if case == 'hot':- pcm[24000:24048] = .94 # about -18 LUFS with a -0.5 dBTP spike+ pcm = np.stack([np.sin(2*np.pi*440*t)]*2, axis=1) * .1365+ pcm[24000:24048] = .94 # about -18 LUFS with a -0.5 dBTP spikestats = processing.measure(pcm)record = {'pcm_lufs': stats['lufs'], 'pcm_true_peak_dbtp': stats['true_peak']}decode = processing.decode@@ -149,10 +150,7 @@ def test_export_refuses_a_quiet_file_with_headroom_and_a_hot_peak(tmp_path, monkwith pytest.raises(ValueError, match='ogg failed loudness/peak check') as refusal:processing.export(tmp_path/'source', tmp_path, target_lufs=-18, loop=False, crossfade=0)lufs, peak = map(float, re.search(r'\(([-\d.]+) LUFS, ([-\d.]+) dBTP', str(refusal.value)).groups())- if case == 'headroom':- assert lufs < -30 and peak < -30- else:- assert abs(lufs + 18) <= 1 and peak > -1+ assert abs(lufs + 18) <= 1 and peak > -1@pytest.mark.parametrize('seconds', [0, .3])@@ -238,8 +236,7 @@ def test_provider_contract_and_safe_retry(monkeypatch, capsys):'model_id':'music_v1', 'force_instrumental':True}[email protected]('status,body', [(500, {}), (429, {'detail':{'status':'quota_exceeded'}}),- (429, {'detail':{'status':'unknown'}}), (422, {})])[email protected]('status,body', [(500, {}), (429, {'detail':{'status':'quota_exceeded'}})])def test_unproven_refusals_are_not_retried(status, body):assert retry.again_after('elevenlabs', 'POST', status, body, {}, 1) is None@@ -440,8 +437,7 @@ def test_missing_ffprobe_preflights_before_generation(tmp_path, monkeypatch):cache_dir=tmp_path/'cache', out_dir=tmp_path/'out')[email protected]('old_version', [1, 2, 3])-def test_old_processed_output_is_rejected_but_raw_cache_survives(tmp_path, monkeypatch, old_version):+def test_old_processed_output_is_rejected_but_raw_cache_survives(tmp_path, monkeypatch):calls = []monkeypatch.setattr(provider, 'generate', lambda req: (calls.append(req) or wav_bytes(), {}))kw = dict(kind='bgm', prompt='synthetic', duration=3, event='music',@@ -449,7 +445,8 @@ def test_old_processed_output_is_rejected_but_raw_cache_survives(tmp_path, monkeresult = sound.generate(**kw)assert result['version'] == 2assert result['recipe']['processing_version'] == 4- old = {**result, 'version': old_version, 'recipe': {**result['recipe'], 'processing_version': old_version}}+ # One old version is enough: any recipe that differs is refused by the same check.+ old = {**result, 'version': 3, 'recipe': {**result['recipe'], 'processing_version': 3}}(kw['out_dir']/'sound.json').write_text(json.dumps(old))with pytest.raises(ValueError, match='different sound'):sound.generate(**kw)diff --git a/tests/compose/test_game_pack.py b/tests/compose/test_game_pack.pyindex bd508da..e297673 100644--- a/tests/compose/test_game_pack.py+++ b/tests/compose/test_game_pack.py@@ -45,7 +45,7 @@ def pixels(out, result, animation):return found[email protected]("scale,resample", [(0.16, None), (0.5, "lanczos"), (0.75, None)])[email protected]("scale,resample", [(0.16, None), (0.5, "lanczos")])def test_scaled_cutout_carries_no_colour_its_source_did_not_have(tmp_path, scale, resample):src = figure()src.save(tmp_path / "hero.png")diff --git a/tests/compose/test_game_pack_audio.py b/tests/compose/test_game_pack_audio.pyindex 3c40982..7bb6fe3 100644--- a/tests/compose/test_game_pack_audio.py+++ b/tests/compose/test_game_pack_audio.py@@ -170,16 +170,16 @@ def test_a_version_3_sound_is_packed_by_the_target_it_was_made_for(tmp_path):assert -20 < file['true_peak_dbfs'] <= -1[email protected]('defect', ['quiet', 'peak-limited', 'hot', 'timescale', 'recipe2', 'recipe1'])+# A processing_version that is neither 3 nor 4 is refused before any version 3 measuring;+# test_broken_audio_cannot_publish_a_partial_pack[recipe2] and [norecipe] own that.[email protected]('defect', ['quiet', 'peak-limited', 'hot', 'timescale'])def test_a_version_3_sound_that_misses_its_rule_is_refused(tmp_path, defect):path = version_3_bundle(tmp_path, lufs=-21.5 if defect in ('quiet', 'peak-limited') else -18.,spike=.94 if defect == 'hot' else None, # -0.5 dBTP while its manifest says -2timescale=1000 if defect == 'timescale' else 48000, # the millisecond AAC duration of version 2- **({'normalization':{'pcm_lufs':-21.5, 'pcm_true_peak_dbtp':-2}} if defect == 'peak-limited' else {}),- **({'recipe':{'processing_version':int(defect[-1])}} if defect.startswith('recipe') else {}))+ **({'normalization':{'pcm_lufs':-21.5, 'pcm_true_peak_dbtp':-2}} if defect == 'peak-limited' else {}))with pytest.raises(ValueError, match={'quiet':'does not match', 'peak-limited':'does not match',- 'hot':'does not match', 'timescale':'container duration',- 'recipe2':'version 3 or 4', 'recipe1':'version 3 or 4'}[defect]):+ 'hot':'does not match', 'timescale':'container duration'}[defect]):pack(path, tmp_path/'bad')assert not (tmp_path/'bad').exists()diff --git a/tests/compose/test_game_pack_v2.py b/tests/compose/test_game_pack_v2.pyindex 8d489e6..6cbc644 100644--- a/tests/compose/test_game_pack_v2.py+++ b/tests/compose/test_game_pack_v2.py@@ -230,7 +230,6 @@ def test_version_2_output_is_deterministic(tmp_path):@pytest.mark.parametrize("change,message", [- ({"version": 1}, "version 2"),({"version": 3}, "version must be 1 or 2"),({"images": [{"id": "pillar", "source": "pillar.png", "display": {"body_height": 30}}]}, "width or height"),({"images": [{"id": "a", "source": "pillar.png", "display": {"height": 9}},@@ -335,14 +334,6 @@ def test_a_fill_is_stored_at_its_frames_content_area(tmp_path, scale):assert all(tuple(map(tuple, stored[:, x])) in middle for x in range(left, rect["w"] - right))-def test_a_report_without_fills_packs_as_before(tmp_path):- ui_kit_report(tmp_path / "ui")- request = write_json(tmp_path / "game.json", {"version": 2, "ui": {"kit": "ui/ui-kit.json", "scale": 0.5}})- result = game_pack.pack(request, tmp_path / "out")- assert all(set(entry) == {"frame", "size", "stretch", "insets", "padding"}- for entry in result["ui"]["nine_slice"].values())--@pytest.mark.parametrize("change,message", [({"inside": "mana_bar_frame"}, "hp_bar_fill: inside names mana_bar_frame, which is not a frame of this report"),({"inside": "hp_bar_fill"}, "hp_bar_fill: inside names hp_bar_fill, which is not a frame of this report"),diff --git a/tests/compose/test_layer_compose.py b/tests/compose/test_layer_compose.pyindex e7d39cb..1998a24 100644--- a/tests/compose/test_layer_compose.py+++ b/tests/compose/test_layer_compose.py@@ -144,20 +144,6 @@ def _layers_dir(run_dir: Path) -> Path:# ------------------------------------------------------------------ 1. the bake-def test_composite_bake_is_byte_identical_across_runs(tmp_path: Path) -> None:- """Same run, same bytes — the determinism claim the whole feature rests on."""- run_dir = _build_run(tmp_path)-- compose_layers.bake(run_dir)- first = {path.name: _digest(path) for path in sorted(_layers_dir(run_dir).iterdir())}- compose_layers.bake(run_dir)- second = {path.name: _digest(path) for path in sorted(_layers_dir(run_dir).iterdir())}-- assert set(first) == {"walk_with_can.png", "walk_with_can.manifest.json",- "layers.report.json"}- assert first == second--def test_element_is_placed_at_the_declared_integer_pivot_offset(tmp_path: Path) -> None:"""`to - from`, composed onto the body — recomputed here from the frames on disk."""run_dir = _build_run(tmp_path)@@ -184,7 +170,7 @@ def test_element_is_placed_at_the_declared_integer_pivot_offset(tmp_path: Path)assert element["clipped_pixels"] == 0[email protected]("value", [0, 1, 2, 63, 127, 128, 200, 254, 255])[email protected]("value", [0, 128, 255])def test_mask_alpha_arithmetic_is_the_published_formula(value: int) -> None:"""Every (alpha, mask) pair, not just the opaque ones.@@ -259,28 +245,13 @@ def test_identical_composite_cells_share_one_column(tmp_path: Path) -> None:def test_composite_manifest_keeps_the_runtime_manifest_shape(tmp_path: Path) -> None:- """A runtime reads a composite with the code it already has, plus provenance."""- run_dir = _build_run(tmp_path)- assert run_script("compose_sprite_atlas.py", "--run-dir", str(run_dir)).returncode == 0- base = json.loads((run_dir / "manifest.json").read_text(encoding="utf-8"))+ """A runtime reads a composite with the code it already has, plus provenance.- compose_layers.bake(run_dir)- manifest = json.loads(- (_layers_dir(run_dir) / "walk_with_can.manifest.json").read_text(encoding="utf-8"))+ The base manifest gains `rig` and `track` only for a rig run: landmarks reach the+ runtime as atlas-absolute integers, one per play position.- assert set(manifest) == (set(base) - {"rig"}) | {"layers"}- assert manifest["game_input"] == "walk_with_can.png"- assert manifest["animation"]["rows"]["walk_with_can"]["frames"] == 2- assert manifest["animation"]["rows"]["walk_with_can"]["track"] == "composite"- assert [element["state"] for element in manifest["layers"]["stack"]] == ["walk", "can"]- assert manifest["layers"]["stack"][1]["track"] == "prop_effect"---def test_a_composite_states_it_has_no_alpha_report_instead_of_naming_another_kind(- tmp_path: Path) -> None:- """`sprite_sheet_alpha_report` names THIS sheet's alpha report — a composite has none.-- The key stays (key-set parity above) but resolves to nothing, because+ `sprite_sheet_alpha_report` names THIS sheet's alpha report — a composite has none.+ The key stays (key-set parity) but resolves to nothing, because`layers.report.json` is the bake's provenance record for every composite andnot this sheet's alpha report: a consumer that opened it through this fieldwould be reading a different kind of document. The provenance pointer has its@@ -292,12 +263,31 @@ def test_a_composite_states_it_has_no_alpha_report_instead_of_naming_another_kinbase_report = json.loads((run_dir / base["sprite_sheet_alpha_report"]).read_text(encoding="utf-8"))+ assert base["rig"]["profile"] == "humanoid_biped"+ for state in ("walk", "hold", "can"):+ rects = base["frame_layout"]["rows"][state]+ entries = base["rig"]["landmarks"][state]+ assert len(entries) == len(rects), state+ for index, (rect, entry) in enumerate(zip(rects, entries)):+ declared = LANDMARKS[state][str(index)]+ assert entry == {name: [rect["x"] + point[0], rect["y"] + point[1]]+ for name, point in declared.items()}+ assert base["animation"]["rows"]["can"]["track"] == "prop_effect"+ assert base["animation"]["rows"]["walk"]["track"] == "base"+compose_layers.bake(run_dir)manifest = json.loads((_layers_dir(run_dir) / "walk_with_can.manifest.json").read_text(encoding="utf-8"))provenance = json.loads((_layers_dir(run_dir) / manifest["layers"]["report"]).read_text(encoding="utf-8"))+ assert set(manifest) == (set(base) - {"rig"}) | {"layers"}+ assert manifest["game_input"] == "walk_with_can.png"+ assert manifest["animation"]["rows"]["walk_with_can"]["frames"] == 2+ assert manifest["animation"]["rows"]["walk_with_can"]["track"] == "composite"+ assert [element["state"] for element in manifest["layers"]["stack"]] == ["walk", "can"]+ assert manifest["layers"]["stack"][1]["track"] == "prop_effect"+assert manifest["sprite_sheet_alpha_report"] is Noneassert manifest["layers"]["report"] == compose_layers.REPORT_NAMEassert provenance["kind"] == compose_layers.REPORT_KIND@@ -340,25 +330,6 @@ def test_a_bake_publishes_its_whole_set_in_one_transaction(tmp_path: Path,assert after == before-def test_base_manifest_gains_rig_and_track_only_for_a_rig_run(tmp_path: Path) -> None:- """Landmarks reach the runtime as atlas-absolute integers, one per play position."""- run_dir = _build_run(tmp_path)- assert run_script("compose_sprite_atlas.py", "--run-dir", str(run_dir)).returncode == 0- manifest = json.loads((run_dir / "manifest.json").read_text(encoding="utf-8"))-- assert manifest["rig"]["profile"] == "humanoid_biped"- for state in ("walk", "hold", "can"):- rects = manifest["frame_layout"]["rows"][state]- entries = manifest["rig"]["landmarks"][state]- assert len(entries) == len(rects), state- for index, (rect, entry) in enumerate(zip(rects, entries)):- declared = LANDMARKS[state][str(index)]- assert entry == {name: [rect["x"] + point[0], rect["y"] + point[1]]- for name, point in declared.items()}- assert manifest["animation"]["rows"]["can"]["track"] == "prop_effect"- assert manifest["animation"]["rows"]["walk"]["track"] == "base"--# ---------------------------------------------------------- 2. the diagnostics@@ -620,7 +591,9 @@ def test_the_cli_bakes_and_summarizes_the_declared_composites(tmp_path: Path) ->def test_two_cli_bakes_in_separate_processes_are_byte_identical(tmp_path: Path) -> None:- """Determinism across the process boundary, not just inside one interpreter."""+ """Same run, same bytes — the determinism claim the whole feature rests on.++ Across the process boundary, not just inside one interpreter."""run_dir = _build_run(tmp_path)assert _cli(run_dir).returncode == 0@@ -628,6 +601,8 @@ def test_two_cli_bakes_in_separate_processes_are_byte_identical(tmp_path: Path)assert _cli(run_dir).returncode == 0second = {path.name: _digest(path) for path in sorted(_layers_dir(run_dir).iterdir())}+ assert set(first) == {"walk_with_can.png", "walk_with_can.manifest.json",+ "layers.report.json"}assert first == second@@ -646,24 +621,25 @@ def test_the_cli_bakes_only_the_named_composites(tmp_path: Path) -> None:assert [entry["name"] for entry in report["composites"]] == ["walk_alone"][email protected]("value", ["", "walk_with_can,", "a,,b", " "])-def test_the_cli_refuses_a_malformed_names_list(tmp_path: Path, value: str) -> None:- """An empty entry is a typo, never "all" — silently dropping it bakes another set."""+def test_the_cli_refuses_a_malformed_names_list(tmp_path: Path) -> None:+ """An empty entry is a typo, never "all" — silently dropping it bakes another set.++ One shape is enough: an empty list, a trailing comma and a blank all split into an+ empty entry and reach the same `any(not name)` refusal."""run_dir = _build_run(tmp_path)- result = _cli(run_dir, "--names", value)+ result = _cli(run_dir, "--names", "a,,b")assert result.returncode != 0assert "--names expects a comma-separated list" in result.stderrassert not _layers_dir(run_dir).exists()[email protected]("value", ["walk_with_can,walk_with_can", "nope,walk_with_can,nope"])-def test_the_cli_refuses_a_repeated_name(tmp_path: Path, value: str) -> None:+def test_the_cli_refuses_a_repeated_name(tmp_path: Path) -> None:"""Same class as an empty entry: the selection is the caller's to fix, not ours to guess."""run_dir = _build_run(tmp_path)- result = _cli(run_dir, "--names", value)+ result = _cli(run_dir, "--names", "walk_with_can,walk_with_can")assert result.returncode != 0assert "named more than once" in result.stderr@@ -682,19 +658,3 @@ def test_the_cli_reports_every_violation_at_once_and_writes_nothing(tmp_path: Paassert "miss required landmark 'crown'" in result.stderrassert "layers.walk_with_can.fps must be a positive integer" in result.stderrassert not _layers_dir(run_dir).exists()---def test_the_cli_refuses_a_non_layer_run_by_name(tmp_path: Path) -> None:- """"Not a layer run" and "nothing to compose" are different answers."""- request = _request()- del request["rig"]- del request["layers"]- for entry in request["states"].values():- entry.pop("track")- run_dir = _build_run(tmp_path, request)-- result = _cli(run_dir)-- assert result.returncode != 0- assert "not a layer run" in result.stderr- assert not _layers_dir(run_dir).exists()diff --git a/tests/compose/test_layer_contract.py b/tests/compose/test_layer_contract.pyindex e68d217..e40774d 100644--- a/tests/compose/test_layer_contract.py+++ b/tests/compose/test_layer_contract.py@@ -71,10 +71,6 @@ def _request(**overrides) -> dict:# ---------------------------------------------------------------- 1. contract-def test_valid_stack_has_no_errors() -> None:- assert layers.validate_layer_request(_request()) == []--def test_validation_is_idempotent() -> None:request = _request()request["states"]["walk"]["track"] = "nonsense"@@ -91,22 +87,6 @@ def test_request_without_layer_keys_is_not_a_layer_run() -> None:assert layers.state_track(plain, "idle") == "base"-def test_unknown_track_kind_is_rejected() -> None:- request = _request()- request["states"]["walk"]["track"] = "torso_only"-- errors = layers.validate_layer_request(request)- assert any("states.walk.track" in e for e in errors)---def test_humanoid_requires_crown_on_every_frame() -> None:- request = _request()- del request["rig"]["landmarks"]["walk"]["1"]["crown"]-- errors = layers.validate_layer_request(request)- assert any("crown" in e and "[1]" in e for e in errors)--@pytest.mark.parametrize("profile", ["quadruped", "blob_or_tentacle", "prop"])def test_non_humanoid_profiles_do_not_require_crown(profile: str) -> None:request = _request()@@ -154,8 +134,10 @@ def test_a_prop_row_still_requires_its_own_root() -> None:for e in errors), errors[email protected]("profile", sorted(layers.PROFILES))-def test_required_landmarks_reads_profile_and_track_together(profile: str) -> None:+def test_required_landmarks_reads_profile_and_track_together() -> None:+ # One non-humanoid profile is enough: the override is one `.get(track, name)` line,+ # and for the other tracks this compares PROFILES with itself.+ profile = "quadruped"for track in layers.TRACKS:expected = ("root",) if track == "prop_effect" else layers.PROFILES[profile]["required"]assert layers.required_landmarks(profile, track) == expected@@ -167,13 +149,12 @@ def test_required_landmarks_reads_profile_and_track_together(profile: str) -> No# `prop_effect` row can never borrow the `prop` profile out of a run that# declared no valid profile at all.+# One string outside PROFILES and one unhashable JSON shape: `known_profile` is+# `isinstance(str) and in PROFILES`, so null, numbers, bools and objects take the+# same two branches.UNKNOWN_PROFILES = [pytest.param("mecha", id="unknown-string"),- pytest.param(None, id="null"),- pytest.param(3, id="number"),- pytest.param(True, id="bool"),pytest.param(["humanoid_biped"], id="list-unhashable"),- pytest.param({"profile": "humanoid_biped"}, id="dict-unhashable"),]@@ -261,8 +242,7 @@ def test_non_integer_and_out_of_cell_landmarks_are_rejected() -> None:assert any("outside the 64x64 cell" in e for e in errors)[email protected]("coordinate", [[True, 8], [32, False]])-def test_boolean_landmark_coordinates_are_rejected(coordinate: list) -> None:+def test_boolean_landmark_coordinates_are_rejected() -> None:"""JSON `true` is not the integer 1 here.`bool` is an `int` subclass in Python, so a coordinate check written as@@ -272,19 +252,12 @@ def test_boolean_landmark_coordinates_are_rejected(coordinate: list) -> None:on a different branch."""request = _request()- request["rig"]["landmarks"]["walk"]["0"]["crown"] = coordinate+ request["rig"]["landmarks"]["walk"]["0"]["crown"] = [True, 8]errors = layers.validate_layer_request(request)assert any("crown" in e and "integers" in e for e in errors), errors-def test_unknown_profile_is_rejected() -> None:- request = _request()- request["rig"]["profile"] = "mecha"-- assert any("rig.profile" in e for e in layers.validate_layer_request(request))--def test_stack_needs_exactly_one_body_element() -> None:request = _request()request["states"]["can"]["track"] = "base"@@ -404,8 +377,7 @@ def test_a_malformed_revision_pin_is_rejected(pin) -> None:assert any("revision" in e for e in layers.validate_layer_request(request))[email protected]("key,value", [("fps", "8"), ("fps", 0), ("fps", True),- ("loop", "yes"), ("loop", 1)])[email protected]("key,value", [("fps", "8"), ("fps", 0), ("fps", True), ("loop", 1)])def test_composite_playback_keys_are_typed(key: str, value) -> None:"""`fps` / `loop` are copied into the composite manifest, so they are typed here."""request = _request()@@ -438,17 +410,6 @@ NON_LAYER_MANIFEST_KEYS = {}-def test_prepare_emits_the_documented_non_layer_request_surface(tmp_path: Path) -> None:- out_dir = tmp_path / "run"- result = run_script("prepare_sprite_run.py", "--out-dir", str(out_dir),- "--character-id", "rigbot")- assert result.returncode == 0, result.stdout + result.stderr-- request = json.loads((out_dir / "sprite-request.json").read_text(encoding="utf-8"))- assert set(request) == NON_LAYER_REQUEST_KEYS- assert layers.has_layer_contract(request) is False--def _prepare(tmp_path: Path, request: dict, *args: str):out_dir = tmp_path / "run"result = run_script("prepare_sprite_run.py", "--out-dir", str(out_dir),diff --git a/tests/curate/test_anchor_selection.py b/tests/curate/test_anchor_selection.pyindex 27c55e4..532f229 100644--- a/tests/curate/test_anchor_selection.py+++ b/tests/curate/test_anchor_selection.py@@ -232,27 +232,15 @@ def _cli(run_dir: Path, *args: str):capture_output=True, text=True, cwd=str(ROOT))[email protected]("args,needle", [- (("--for-state", "down_walk"), "generate and extract"),- (("--direction", "down"), "generate and extract"),-])-def test_cli_pending_failure_prints_the_guidance(ungenerated_run: Path, args, needle) -> None:- proc = _cli(ungenerated_run, *args)+def test_cli_pending_failure_prints_the_guidance(ungenerated_run: Path) -> None:+ """`--for-state` 는 위 in-process 테스트가 같은 예외로 지킨다 — 여기서는 `--direction` 한 길만+ 프로세스 경계까지 본다. 메시지가 stderr 로 흐르는 장치(`AnchorUnavailable.__init__`)는 하나다."""+ proc = _cli(ungenerated_run, "--direction", "down")assert proc.returncode != 0- assert needle in proc.stderr, proc.stderr+ assert "generate and extract" in proc.stderr, proc.stderrassert proc.stderr.strip() not in anchor_mod.AnchorUnavailable.PENDING_KINDS-def test_cli_broken_pin_failure_prints_the_guidance(direction_run: Path) -> None:- _save_curation(direction_run, {"down_idle": {"deleted": [3], "selected": [0, 1, 2]}},- anchors={"down": {"state": "down_idle", "index": 3}})- proc = _cli(direction_run, "--for-state", "down_walk")- assert proc.returncode != 0- assert "no longer exists" in proc.stderr, proc.stderr- assert "re-pick the anchor frame" in proc.stderr- assert proc.stderr.strip() != "pick-missing"--def test_all_bakes_every_bakeable_direction_before_failing(tmp_path: Path) -> None:"""벌크(`--all`)는 끝까지 돌고 한 번에 보고한다 — 중간에 죽으면 재실행 지점이 모호하다."""run_dir = _build_direction_run(tmp_path, extract_states="side_idle")@@ -497,20 +485,6 @@ def test_pin_survives_when_every_curated_row_is_dropped(direction_run: Path) ->assert anchor_choices(doc)["down"]["stale"] is True-def test_cli_clear_does_not_resurrect_dropped_curation(direction_run: Path) -> None:- from sprite_gen.curate.curation import load_curation_report-- run_dir = direction_run- _save_curation(run_dir, {"down_idle": {"deleted": [0], "selected": [1, 2, 3]}},- anchors={"side": {"state": "side_idle", "index": 1}})- _regenerate_row(run_dir, "down", "idle", seed=777)- assert "down_idle" in load_curation_report(run_dir)[1]["dropped"]- assert anchor_mod.run(run_dir=run_dir, clear=True, direction="side") == 0- doc = load_curation_report(run_dir)[0] or {}- assert "down_idle" not in (doc.get("states") or {})- assert _pins(doc) == {}--# --- 사용자 지정 ---------------------------------------------------------------def test_picked_frame_overrides_the_default_including_another_row(direction_run: Path) -> None:@@ -542,6 +516,7 @@ def test_picked_frame_that_vanished_fails_loud(direction_run: Path) -> None:with pytest.raises(SystemExit) as excinfo:anchor_mod.resolve_anchor(request, load_curation(run_dir), "down")assert "no longer exists" in str(excinfo.value)+ assert "re-pick the anchor frame" in str(excinfo.value)# 뷰는 죽지 않고 이유를 보여준다status = anchor_mod.anchor_status(run_dir, request, load_curation(run_dir), "down")assert status["state"] is None and "no longer exists" in status["error"]diff --git a/tests/curate/test_pixel_snap.py b/tests/curate/test_pixel_snap.pyindex f48b711..eb4c8cb 100644--- a/tests/curate/test_pixel_snap.py+++ b/tests/curate/test_pixel_snap.py@@ -13,7 +13,7 @@ import randomfrom PIL import Imageimport sprite_gen.frames.extract as extract_module-from sprite_gen.curate.curation import apply_transform, pixel_snap_scale+from sprite_gen.curate.curation import apply_transformMAGENTA = (255, 0, 255)@@ -83,15 +83,6 @@ def test_default_keeps_native_logical_size(tmp_path) -> None:assert extract_module.run(run_dir=run_dir) == 0height = _walk_frame0_height(run_dir)assert height > 30, f"native size squeezed by default: {height}"-def test_pixel_snap_scale_resolution() -> None:- assert pixel_snap_scale({"cell": {"size": 64}}) is None # no fit- assert pixel_snap_scale({"cell": {"size": 64}, "fit": {"resample": "kcentroid"}}) is None- base = {"cell": {"width": 64, "height": 64, "safe_margin_x": 6, "safe_margin_y": 6}}- assert pixel_snap_scale({**base, "fit": {"pixel_unfake": True, "logical_height": 48}}) == 1- assert pixel_snap_scale({**base, "fit": {"pixel_unfake": True, "logical_height": 32}}) == 2- assert pixel_snap_scale({**base, "fit": {"pixel_unfake": True}}) == 1 # logical = cell--def _blocks_uniform(image: Image.Image, scale: int) -> bool:px = image.load()for by in range(image.height // scale):diff --git a/tests/curate/test_pixel_unfake_migration.py b/tests/curate/test_pixel_unfake_migration.pyindex 3570890..4d1008a 100644--- a/tests/curate/test_pixel_unfake_migration.py+++ b/tests/curate/test_pixel_unfake_migration.py@@ -77,24 +77,6 @@ def test_both_request_keys_present_fails_loud(tmp_path) -> None:assert "two truths" in str(excinfo.value)-def test_reading_is_unaffected_by_a_pipeline_writer_lock(tmp_path) -> None:- """락이 있든 없든 읽기 결과는 같다 — 읽기가 쓰지 않으니 락을 볼 이유가 없다.-- 예전엔 로더가 락 유무로 재기록 여부를 갈랐고, 그래서 "락이 없을 때만 파일이 바뀐다" 는- 상태 의존 부작용이 조회 경로에 있었다."""- from sprite_gen.spec.runio import LOCK_FILENAME-- run_dir = tmp_path / "run"- _write_request(run_dir, {"pixel_perfect": True})- unlocked = load_request(run_dir)-- (run_dir / LOCK_FILENAME).write_text("held by another writer", encoding="utf-8")- assert load_request(run_dir) == unlocked- assert unlocked["fit"]["pixel_unfake"] is True- assert "pixel_perfect" in json.loads(- (run_dir / "sprite-request.json").read_text(encoding="utf-8"))["fit"]--def _write_curation(run_dir, doc: dict) -> None:"""현재 세대 도장을 찍어 둔다 — 스탬프 없는 사이드카는 세대 게이트가 (정상적으로) 드롭해서이관 여부를 볼 수 없다. 여기서 검증하려는 건 이관이고 세대 판정이 아니다."""@@ -259,7 +241,10 @@ def test_no_production_path_reads_the_request_outside_the_gate() -> None:파일을 가리키면서(`REQUEST_FILENAME` 또는 리터럴 파일명) `json.load(s)` 를 호출하면 그것이게이트 우회다. 쓰기 경로는 `json.dumps` 를 쓰므로 걸리지 않는다.- 테스트 코드는 예외다: 테스트는 "디스크에 실제로 무엇이 쓰였는가" 를 검사해야 한다."""+ 테스트 코드는 예외다: 테스트는 "디스크에 실제로 무엇이 쓰였는가" 를 검사해야 한다.++ 두 트리를 **재귀로** 훑는다 — `glob` 은 최상위만 봐서 `reroll.py` 같은 하위 패키지+ 모듈이 통째로 그물 밖이었다."""import astfrom pathlib import Path as _Path@@ -275,7 +260,7 @@ def test_no_production_path_reads_the_request_outside_the_gate() -> None:root = _Path(__file__).resolve().parents[2]offenders: list[str] = []- for path in sorted(list((root / "sprite_gen").glob("*.py")) + list((root / "scripts").glob("*.py"))):+ for path in sorted(list((root / "sprite_gen").rglob("*.py")) + list((root / "scripts").rglob("*.py"))):if path.name == "runio.py": # 게이트 자신이 사는 곳continuetree = ast.parse(path.read_text(encoding="utf-8"))diff --git a/tests/curate/test_transform_resample.py b/tests/curate/test_transform_resample.pyindex cd504d2..607be1a 100644--- a/tests/curate/test_transform_resample.py+++ b/tests/curate/test_transform_resample.py@@ -15,11 +15,11 @@ from keyed_figure import colour_outside_mapped, figurefrom sprite_gen.curate.curation import apply_transform, normalize_transform, transform_matrixfrom sprite_gen.util.resample import transform_cell+# Every transform kind goes through the one affine map into `transform_cell`, so a pure+# sub-pixel move and a combined scale + rotation cover it; the shrink direction is held by+# tests/video/test_gait_fallback_resample.py.TRANSFORMS = {"move half a pixel": {"dx": 0.5, "dy": -0.5},- "rotate": {"rotate": 10},- "shrink": {"scale": 0.75},- "shear": {"shx": 0.2, "shy": -0.1},"grow and rotate": {"scale": 1.3, "rotate": 15},}diff --git a/tests/effects/test_breathe.py b/tests/effects/test_breathe.pyindex 3c757e0..9d569a8 100644--- a/tests/effects/test_breathe.py+++ b/tests/effects/test_breathe.py@@ -102,15 +102,15 @@ def _frames(image: Image.Image, count: int = 12, cfg: dict | None = None):# ── 1. 강체 구간 항등 ───────────────────────────────────────────────[email protected]("build", [_humanoid, _winged, lambda: _dome(with_face=True)],- ids=["humanoid", "winged", "dome-with-face"])[email protected]("build", [_humanoid, _winged], ids=["humanoid", "winged"])def test_rigid_region_is_bit_identical_across_frames(build) -> None:"""강체 구간은 프레임 간 비트 동일하다.**얼굴 없는 돔(`_dome()`)은 이 계약을 태울 수 없다** — 경계가 4행이고 테이퍼 밴드가5행이라 강체 구간 높이가 음수다. 병목도 얼굴도 없는 실루엣은 지킬 강체 구간이 애초에없고, 그건 결함이 아니라 그 분기의 성질이다 (validator note 2026-07-25). 그래서 여기서는- 강체 구간이 실재하는 3종만 태운다."""+ 강체 구간이 실재하는 도형만 태운다 — 얼굴 있는 돔은+ `test_face_on_the_body_pushes_the_boundary_below_the_face` 가 같은 루프로 본다."""src = build()anat = analyze(src)frames, _ = _frames(src)@@ -382,11 +382,6 @@ def test_feet_stay_planted_and_loop_length_is_preserved() -> None:assert len(frames) == 12 and len(phases) == 12for i, frame in enumerate(frames):assert solid_alpha_bbox(frame)[3] == baseline, f"frame {i}: 발이 떴다"---def test_breathing_actually_moves_the_body() -> None:- src = _humanoid()- frames, _ = _frames(src, count=12)heights = {solid_alpha_bbox(f)[3] - solid_alpha_bbox(f)[1] for f in frames}assert len(heights) > 1, "봉투 워프가 높이를 전혀 안 바꿨다"@@ -434,15 +429,6 @@ def test_row_strain_over_the_cap_raises_instead_of_clamping() -> None:# ── 5. 수동 override 와 자가 복구 ───────────────────────────────────-def test_manual_rigid_row_overrides_detection_and_is_observable() -> None:- src = _humanoid()- auto = analyze(src)- manual = analyze(src, rigid_row=auto.rigid_row + 6)- assert manual.rigid_row == auto.rigid_row + 6- assert manual.rigid_source == "manual"- assert any("rigid-row-override" in w for w in manual.warnings)--def test_stale_frozen_anatomy_self_heals() -> None:src = _humanoid()cfg = dict(CFG)@@ -495,9 +481,10 @@ def test_smoothness_hint_scales_with_breath_count() -> None:# ── 7. 폐기된 분할선 스키마는 요란하게 거부된다 ─────────────────────[email protected]("retired", [{"splits": [0.55]}, {"amplitude": 2}, {"subpixel": True}])-def test_retired_split_schema_is_rejected_loudly(retired: dict) -> None:- curation = {"states": {"idle": {"breathe": {**retired, "breaths": 1}}}}+def test_retired_split_schema_is_rejected_loudly() -> None:+ from sprite_gen.curate.curation import RETIRED_BREATHE_KEYS+ assert {"splits", "amplitude", "subpixel", "hold"} <= set(RETIRED_BREATHE_KEYS)+ curation = {"states": {"idle": {"breathe": {"splits": [0.55], "breaths": 1}}}}with pytest.raises(SystemExit) as err:state_breathe(curation, "idle")message = str(err.value)@@ -587,21 +574,6 @@ def test_repeated_phases_are_bit_identical_so_atlas_cells_can_be_shared() -> Nonassert pattern[i] == pattern[j], f"슬롯 {i}/{j}: 같은 위상인데 double 이 다르다"-def test_repeated_phases_render_byte_identical_frames() -> None:- """위상이 같으면 구워진 픽셀도 같아야 칸 공유가 정당하다."""- src = _humanoid()- cfg = dict(CFG)- cfg["anatomy"] = freeze_anatomy(src, cfg, _key())- frames, phases = bake_breathe_sequence([src] * 18, {**cfg, "breaths": 3})- by_phase: dict[float, bytes] = {}- for frame, phase in zip(frames, phases):- data = frame.tobytes()- if phase in by_phase:- assert by_phase[phase] == data, f"위상 {phase}: 같은 위상인데 픽셀이 다르다"- by_phase[phase] = data- assert len(by_phase) == 6, f"18슬롯 3호흡의 유니크 위상은 6이어야 한다 (got {len(by_phase)})"--def test_manual_rigid_row_beats_a_frozen_anatomy() -> None:"""`rigid_row` 는 사람의 의도(입력)고 `anatomy` 는 파생 캐시다 — 의도가 이긴다.@@ -678,22 +650,6 @@ def test_out_of_range_values_are_refused_instead_of_clamped() -> None:assert ok["breaths"] == BREATHE_BREATHS_MAX-def test_the_curator_ui_cap_matches_the_schema_bound() -> None:- """UI 컨트롤 상한과 스키마 상한이 갈리면 UI 가 만든 값을 굽기가 거부한다."""- from sprite_gen.curate.curation import BREATHE_BREATHS_MAX, BREATHE_DEPTH_MAX, BREATHE_LAG_MAX- import re- from sprite_gen.serve.serve_curation import CURATOR_DIR- js = (CURATOR_DIR / "src" / "breathe.js").read_text(encoding="utf-8")- for name, want in (("BREATHE_BREATHS_MAX", BREATHE_BREATHS_MAX),- ("BREATHE_DEPTH_MAX", BREATHE_DEPTH_MAX),- ("BREATHE_LAG_MAX", BREATHE_LAG_MAX)):- # 값을 숫자로 파싱해서 비교한다 — 문자열 포함 검사는 0.2 가 0.25 에도 걸린다- m = re.search(rf"^const {name} = ([0-9.]+);", js, re.M)- assert m, f"{name} 미러 상수가 breathe.js 에 없다"- assert float(m.group(1)) == float(want), \- f"{name} 미러 {m.group(1)} != 파이썬 {want} — UI 가 만든 값을 굽기가 거부한다"--def _reaches_further(base):"""같은 줄의 다른 프레임 — **워프가 실제로 쓰는 값**이 갈리게 만든다.diff --git a/tests/effects/test_breathe_js_mirror.py b/tests/effects/test_breathe_js_mirror.pyindex e574da3..294ca90 100644--- a/tests/effects/test_breathe_js_mirror.py+++ b/tests/effects/test_breathe_js_mirror.py@@ -83,18 +83,19 @@ def _rgba(image):@pytest.mark.skipif(shutil.which("node") is None, reason="node 가 없어 JS 미러를 실행할 수 없다")@pytest.mark.parametrize("build,overrides", [- (_humanoid, {}), (_winged, {}), (_dome, {}),+ (_humanoid, {}), (_winged, {}),# 다듬기(_thin_outline_1px/breatheThinOutline)가 **실제로 픽셀을 치환하는** 유일한- # 픽스처 — 기본 3종은 depth 0.06 에서 다듬기가 0바이트라, 이 케이스가 없으면+ # 픽스처 — 기본 도형은 depth 0.06 에서 다듬기가 0바이트라, 이 케이스가 없으면# JS 다듬기 미러가 파이썬과 갈라져도 패리티 스위트가 못 잡는다# (validator 지정 2026-07-30: depth 0.08 24위상에서 294바이트 치환 실측).(_small_outlined, {"depth": 0.08, "breaths": 3}),# 가로/세로 진폭 분리 + 수동 밴드 (2026-07-30): 가로 강함 / 가로 항등 / 밴드 앵커 보호.# 이 케이스들이 없으면 JS 의 depthX 해석·수동 protect 앵커가 파이썬과 갈라져도 못 잡는다.+ # 기본값 돔은 따로 두지 않는다 — 날개처럼 자동 램프를 타고, 아래 돔 3칸이 돔을 태운다.(_dome, {"depth_x": 0.12}),(_dome, {"depth": 0.10, "depth_x": 0.0}),(_dome, {"depth": 0.10, "torso_half": 6}),-], ids=["humanoid", "winged", "dome", "small-outlined-thinning",+], ids=["humanoid", "winged", "small-outlined-thinning","dome-depth-x", "dome-depth-x-zero", "dome-manual-band"])def test_curator_mirror_is_byte_identical_to_the_bake(build, overrides, tmp_path):src = build()@@ -131,15 +132,14 @@ def test_curator_mirror_is_byte_identical_to_the_bake(build, overrides, tmp_path@pytest.mark.skipif(shutil.which("node") is None, reason="node 가 없어 JS 미러를 실행할 수 없다")[email protected]("build", [_humanoid, _winged, _dome], ids=["humanoid", "winged", "dome"])-def test_the_mirror_refuses_exactly_what_the_bake_refuses(build, tmp_path):+def test_the_mirror_refuses_exactly_what_the_bake_refuses(tmp_path):"""굽기가 `SystemExit` 으로 거부하는 프레임은 미러도 만들어 주면 안 된다.미러가 조용히 잘라 내보내면 (a) 프리뷰는 멀쩡한데 굽기가 죽고 (b) `row-export` 의WebM/MP4 는 서버를 안 거치므로 **잘린 영상이 사용자 손에 들어간다** (validator 실측2026-07-25: 여백 0 셀에서 불투명 73px 소실, 오류 0건). 여기서 여백을 없애 그 상황을- 강제로 만든다."""- src = build()+ 강제로 만든다. 거부는 도형과 무관한 `clipped` 계수 하나라 한 도형이면 된다."""+ src = _humanoid()src = src.crop(solid_alpha_bbox(src)) # 여백 0 — 늘어나면 반드시 잘린다cfg = dict(CFG)cfg["anatomy"] = freeze_anatomy(src, cfg, _key())@@ -169,15 +169,14 @@ def test_the_mirror_refuses_exactly_what_the_bake_refuses(build, tmp_path):for phase, got in zip(PHASES, js):py_refused = phase in refused_pyassert got["ok"] != py_refused, (- f"{build.__name__} 위상 {phase:.4f}: 굽기 거부={py_refused} 인데 "+ f"위상 {phase:.4f}: 굽기 거부={py_refused} 인데 "f"미러는 {'거부' if not got['ok'] else '통과'} — 계약이 한쪽에만 있다")if not got["ok"]:assert got["refused"], f"BreatheRefused 가 아닌 예외로 죽었다: {got['message']}"@pytest.mark.skipif(shutil.which("node") is None, reason="node 가 없어 JS 미러를 실행할 수 없다")[email protected]("build", [_humanoid, _winged], ids=["humanoid", "winged"])-def test_the_mirror_matches_on_frames_other_than_the_frozen_one(build, tmp_path):+def test_the_mirror_matches_on_frames_other_than_the_frozen_one(tmp_path):"""줄의 **다른** 프레임에서도 굽기와 미러가 같아야 한다.사이드카에는 해부가 한 벌뿐이고 미러는 그걸 그대로 쓴다. 굽기가 프레임마다 다시@@ -187,7 +186,7 @@ def test_the_mirror_matches_on_frames_other_than_the_frozen_one(build, tmp_path)기존 미러 테스트는 `freeze_anatomy(src)` 한 프레임만 비교해 이 경로가 통째로그물 밖이었다."""- frozen_src = build()+ frozen_src = _humanoid()cfg = dict(CFG)cfg["anatomy"] = freeze_anatomy(frozen_src, cfg, _key())@@ -225,7 +224,7 @@ def test_the_mirror_matches_on_frames_other_than_the_frozen_one(build, tmp_path)assert got["ok"], f"위상 {phase:.4f}: JS 가 거부했다 — {got['message']}"py = _rgba(phase_frame(other, cfg, phase, anat)) # 줄 해부 한 벌로 굽는다diff = sum(1 for a, b in zip(py, got["data"]) if a != b)- assert diff == 0, f"{build.__name__} 위상 {phase:.4f}: 얼린 프레임 밖에서 {diff}바이트 갈렸다"+ assert diff == 0, f"위상 {phase:.4f}: 얼린 프레임 밖에서 {diff}바이트 갈렸다"@pytest.mark.skipif(shutil.which("node") is None, reason="node 가 없어 JS 미러를 실행할 수 없다")@@ -391,22 +390,16 @@ def test_the_mirror_refuses_a_stale_reference_frame(tmp_path):@pytest.mark.skipif(shutil.which("node") is None, reason="node 가 없어 JS 미러를 실행할 수 없다")[email protected]("anatomy_shape", ["fingerprint-null", "fingerprint-missing"],- ids=["null", "missing"])-def test_the_mirror_refuses_when_it_cannot_verify(anatomy_shape, tmp_path):+def test_the_mirror_refuses_when_it_cannot_verify(tmp_path):"""지문이 없으면 "확인 불가" 이지 "괜찮음" 이 아니다.`refreshAnatomy` 가 실패하면 지문만 무효화한 해부가 남는데, 미러가 그걸 조용히통과시켜 낡은 숫자로 그렸다 — 굽기와 164바이트, 불투명 픽셀 수까지 불일치(validator 실측 2026-07-26). `row-export` 가 같은 함수를 쓰므로 WebM/MP4 가 GIF 와- 다른 애니메이션으로 나갔다."""+ 다른 애니메이션으로 나갔다. 지문이 null 이든 키째 없든 `!anat.fingerprint` 한 줄이 받는다."""src = _humanoid()cfg = dict(CFG)- frozen = freeze_anatomy(src, cfg, _key())- if anatomy_shape == "fingerprint-null":- frozen = {**frozen, "fingerprint": None}- else:- frozen = {k: v for k, v in frozen.items() if k != "fingerprint"}+ frozen = {**freeze_anatomy(src, cfg, _key()), "fingerprint": None}cfg["anatomy"] = frozenharness = tmp_path / "fresh.cjs"@@ -435,4 +428,4 @@ def test_the_mirror_refuses_when_it_cannot_verify(anatomy_shape, tmp_path):assert proc.returncode == 0, f"node 하네스 실패:\n{proc.stderr}"got = json.loads((tmp_path / "out.json").read_text(encoding="utf-8"))assert not got["ok"] and got["refused"], (- f"지문 {anatomy_shape} 인데 미러가 신선하다고 판정했다 — 확인 불가는 괜찮음이 아니다")+ "지문이 null 인데 미러가 신선하다고 판정했다 — 확인 불가는 괜찮음이 아니다")diff --git a/tests/effects/test_breathe_off_state.py b/tests/effects/test_breathe_off_state.pyindex f02e43a..72385e6 100644--- a/tests/effects/test_breathe_off_state.py+++ b/tests/effects/test_breathe_off_state.py@@ -36,8 +36,6 @@ validator 검증 2026-07-25).import refrom pathlib import Path-import pytest-from sprite_gen.serve.serve_curation import CURATOR_DIRROOT = Path(__file__).resolve().parent.parent.parent@@ -248,21 +246,18 @@ def _call_sites():yield name, lineno, text-def test_there_are_call_sites_to_guard():- """호출부 **인벤토리**가 그대로여야 한다.+def test_every_breathe_composite_call_is_gated_on_enabled():+ """호출부 **인벤토리**가 그대로이고, 그 호출부가 **전부** 켜짐 여부로 게이트돼 있다."비어있지 않다" 만 보면 한 자리가 줄바꿈 한 번으로 증발해도 통과한다 — 신호는- "테스트가 하나 줄었다" 뿐이고, 그건 이 플랜이 두 번 1급 계약으로 올린 실패 모드다."""- _assert_inventory("breatheComposite 호출부", _inventory(_call_sites()), EXPECTED_CALL_SITES)--[email protected]("site", list(_call_sites()), ids=lambda s: f"{s[0]}:{s[1]}")-def test_every_breathe_composite_call_is_gated_on_enabled(site):- name, lineno, line = site- assert any(guard in line for guard in GUARDS), (- f"{name}:{lineno} 가 켜짐 여부로 게이트되지 않았다 — 꺼진 줄이 워프된다.\n"- f" {line}\n"- f" 허용 형태: {', '.join(GUARDS)}")+ "테스트가 하나 줄었다" 뿐이고, 그건 이 플랜이 두 번 1급 계약으로 올린 실패 모드다.+ 게이트가 빠진 자리는 `파일:줄` 로 전부 보고한다."""+ sites = list(_call_sites())+ _assert_inventory("breatheComposite 호출부", _inventory(sites), EXPECTED_CALL_SITES)+ ungated = [f"{name}:{lineno} 가 켜짐 여부로 게이트되지 않았다 — 꺼진 줄이 워프된다.\n"+ f" {line}"+ for name, lineno, line in sites if not any(guard in line for guard in GUARDS)]+ assert not ungated, "\n".join(ungated) + f"\n 허용 형태: {', '.join(GUARDS)}"# ── 파이썬 굽기 소비자 ──────────────────────────────────────────────@@ -291,12 +286,7 @@ def _py_call_sites():yield rel, lineno, line.strip(), guard-def test_there_are_python_bake_call_sites():- assert list(_py_call_sites()), "굽기 소비자에서 호흡 호출부가 사라졌다 — 계약 위치 확인"--[email protected]("site", list(_py_call_sites()), ids=lambda s: f"{s[0].split('/')[-1]}:{s[1]}")-def test_python_bake_never_skips_a_phase(site):+def test_python_bake_never_skips_a_phase():"""굽기가 **위상 값으로** 워프 여부를 가르면 안 된다.`if breathe_cfg and breathe_phase:` 는 위상 0 슬롯을 건너뛰어 그 칸만 원본이 되고,@@ -306,10 +296,13 @@ def test_python_bake_never_skips_a_phase(site):이 그물이 필요한 이유: validator가 변이 테스트로 확인했다 — `compose_atlas` 의 가드를옛 형태로 되돌려도 `pytest -k "atlas or breathe"` 40개가 **전부 통과**했다.JS 쪽엔 그물이 있었고 파이썬 쪽만 비어 있었다 (2026-07-25)."""- rel, lineno, line, guard = site- assert "phase" not in guard.replace("breathe_cfg", ""), (- f"{rel}:{lineno} 의 가드가 위상 값을 본다 — 위상 0 이 안 구워진다.\n"- f" 가드: {guard}\n 호출: {line}")+ sites = list(_py_call_sites())+ assert sites, "굽기 소비자에서 호흡 호출부가 사라졌다 — 계약 위치 확인"+ phase_gated = [f"{rel}:{lineno} 의 가드가 위상 값을 본다 — 위상 0 이 안 구워진다.\n"+ f" 가드: {guard}\n 호출: {line}"+ for rel, lineno, line, guard in sites+ if "phase" in guard.replace("breathe_cfg", "")]+ assert not phase_gated, "\n".join(phase_gated)# ── 줄 단위 신선도 검사가 실제로 걸리는가 ──────────────────────────@@ -329,36 +322,36 @@ def _preview_call_sites():yield name, lineno, text, m.group(1)-def test_there_are_preview_call_sites():- _assert_inventory("프리뷰 호출부",- _inventory(_preview_call_sites()), EXPECTED_PREVIEW_SITES)--[email protected]("site", list(_preview_call_sites()), ids=lambda s: f"{s[0]}:{s[1]}")-def test_every_preview_call_passes_a_freshness_reference(site):+def test_every_preview_call_passes_a_freshness_reference():"""프리뷰 호출부는 **전부** 기준 프레임을 넘겨야 한다.round-7 은 `reference` 를 선택 인자로 뒀고 5곳 중 2곳만 넘겼다. 나머지 3곳은`if (reference)` 를 통째로 건너뛰어, 같은 웹뷰의 두 화면이 정반대로 행동했다 —줄 카드는 거부하는데 호흡 편집 모달은 낡은 숫자로 조용히 그렸다 (validator 실측2026-07-26: 12/12 위상 갈림, 알림 0건). round-2 가 켜짐 게이트를 호출부 전수- 파라미터화로 고정한 것과 같은 형태의 그물이다."""- name, lineno, line, args = site- # `breatheComposeForPreview(a, b, c, ref)` — 인자 4개여야 한다- depth = 0- parts, cur = [], ""- for ch in args:- if ch in "([{":- depth += 1- elif ch in ")]}":- depth -= 1- if ch == "," and depth == 0:- parts.append(cur.strip()); cur = ""- else:- cur += ch- parts.append(cur.strip())- assert len(parts) >= 4 and parts[3], (- f"{name}:{lineno} 가 기준 프레임을 안 넘긴다 — 신선도 검사가 건너뛰어진다.\n {line}")+ 파라미터화로 고정한 것과 같은 형태의 그물이다. 호출부 인벤토리도 여기서 못박고,+ 기준 프레임을 안 넘기는 자리는 `파일:줄` 로 전부 보고한다."""+ sites = list(_preview_call_sites())+ _assert_inventory("프리뷰 호출부", _inventory(sites), EXPECTED_PREVIEW_SITES)+ unreferenced = []+ for name, lineno, line, args in sites:+ # `breatheComposeForPreview(a, b, c, ref)` — 인자 4개여야 한다+ depth = 0+ parts, cur = [], ""+ for ch in args:+ if ch in "([{":+ depth += 1+ elif ch in ")]}":+ depth -= 1+ if ch == "," and depth == 0:+ parts.append(cur.strip()); cur = ""+ else:+ cur += ch+ parts.append(cur.strip())+ if not (len(parts) >= 4 and parts[3]):+ unreferenced.append(+ f"{name}:{lineno} 가 기준 프레임을 안 넘긴다 — 신선도 검사가 건너뛰어진다.\n {line}")+ assert not unreferenced, "\n".join(unreferenced)# ── 파일을 만드는 자리는 전부 신선도를 본다 ────────────────────────@@ -450,18 +443,31 @@ def _file_producing_functions():EXPECTED_FILE_PRODUCERS = {"compare.js": 1, "row-export.js": 1}+RESAMPLE_NOTICE = re.compile(r"breatheResamplesDifferently\s*\(")++def test_every_file_producing_path_checks_freshness():"""파일을 만드는 자리는 **전부** 기준 프레임 신선도를 확인해야 한다.`row-export` 는 예외를 올려 파일 생성 전에 멈췄는데 `compare.js` 의 영상다운로드는 프리뷰 래퍼를 거쳐 거부를 삼켰다 — 같은 조건에서 두 내보내기가- **정반대로** 행동했고, 호흡 없는 파일이 나간 뒤 초록 "완료" 알림까지 떴다."""+ **정반대로** 행동했고, 호흡 없는 파일이 나간 뒤 초록 "완료" 알림까지 떴다.++ 같은 자리는 **고칠 수 없는 차이도 말해야** 한다. 회전·확대가 걸린 줄은 프리뷰와+ 굽기의 픽셀이 다르다: 굽기는 `apply_transform` 에서 BICUBIC(`snap_scale` 없는 런 =+ 기본 런 전부), 웹뷰는 `imageSmoothingEnabled=false` 캔버스라 NEAREST 다. 실측+ (validator 2026-07-26, 96px 픽스처, 신선도는 통과시킨 상태): rotate 3° 에서 12/12 위상+ 최대 1803px 상이, scale 1.03 에서 최대 1699px. 원인은 표시 파이프라인이라 호흡이 고칠+ 수 있는 게 아니지만, `row-export` 와 비교뷰 다운로드는 **이 캔버스로 파일을 굽는다** —+ 조용히 두면 사용자는 GIF 와 다른 파일을 받고도 모른다 (원칙 6). "고칠 수 없으니+ 말하지 않는다" 는 이 플랜에서 금지된 형태다."""sites = _file_producing_functions()_assert_inventory("파일 생성 경로", _inventory(sites), EXPECTED_FILE_PRODUCERS)- missing = [(n, ln) for n, ln, body in sites if not FRESH.search(body)]- assert not missing, (- "파일을 만드는데 신선도를 안 본다 — 낡은 해부로 구운 파일이 사용자에게 간다:\n"- + "\n".join(f" {n}:{ln}" for n, ln in missing))+ broken = [f" {n}:{ln} 신선도를 안 본다 — 낡은 해부로 구운 파일이 사용자에게 간다"+ for n, ln, body in sites if not FRESH.search(body)]+ broken += [f" {n}:{ln} 리샘플러 차이를 안 알린다 — 사용자는 GIF 와 다른 파일을 받고도 모른다"+ for n, ln, body in sites if not RESAMPLE_NOTICE.search(body)]+ assert not broken, "파일을 만드는 자리가 계약을 어긴다:\n" + "\n".join(broken)# ── 호흡은 굽기가 읽는 파일로 그린다 ───────────────────────────────@@ -744,21 +750,7 @@ def _breathe_image_sites():EXPECTED_IMAGE_SITES = {"cards.js": 1, "compare.js": 1, "zoom-editor.js": 4, "row-export.js": 1}-def test_there_are_breathe_image_sites():- sites = list(_breathe_image_sites())- assert sites, "호흡 이미지 소스 지점이 사라졌다 — 계약 위치 확인"- got = {}- for name, _, _ in sites:- got[name] = got.get(name, 0) + 1- assert got == EXPECTED_IMAGE_SITES, (- f"호흡 이미지 사이트 인벤토리가 달라졌다.\n 기대: {EXPECTED_IMAGE_SITES}\n"- f" 실제: {got}\n"- " 선언 키워드·대입 모양을 바꾸면 사이트가 조용히 증발한다 — 파일 존재만 보면 "- "여러 사이트를 가진 파일의 상실을 못 본다(워프 base 스캐너가 그렇게 뚫렸다).")--[email protected]("site", list(_breathe_image_sites()), ids=lambda s: f"{s[0]}:{s[1]}")-def test_breathe_draws_from_the_file_the_bake_reads(site):+def test_breathe_draws_from_the_file_the_bake_reads():"""워프 base 도 신선도 기준도 **굽기가 읽는 파일**에서 와야 한다.`frameUrl` 은 표시용이라 pp OFF 에서 `orig/` 고해상 트윈을 준다 — 굽기(`row_frame_rel`)@@ -767,8 +759,18 @@ def test_breathe_draws_from_the_file_the_bake_reads(site):그리면 pp OFF 줄에서 굽기와 다른 그림이 나간다 (validator 2026-07-26: 같은 캔버스를다른 해부로 워프해 4위상에서 최대 114바이트).- 이 그물이 없던 동안 `frameUrl` → `f.url` 로 되돌려도 111개 테스트가 전부 통과했다."""- name, lineno, line = site+ 이 그물이 없던 동안 `frameUrl` → `f.url` 로 되돌려도 111개 테스트가 전부 통과했다.++ 사이트 인벤토리도 여기서 못박고, 굽기 파일이 아닌 분기를 가진 자리는 `파일:줄` 로+ 전부 보고한다."""+ sites = list(_breathe_image_sites())+ assert sites, "호흡 이미지 소스 지점이 사라졌다 — 계약 위치 확인"+ got = _inventory(sites)+ assert got == EXPECTED_IMAGE_SITES, (+ f"호흡 이미지 사이트 인벤토리가 달라졌다.\n 기대: {EXPECTED_IMAGE_SITES}\n"+ f" 실제: {got}\n"+ " 선언 키워드·대입 모양을 바꾸면 사이트가 조용히 증발한다 — 파일 존재만 보면 "+ "여러 사이트를 가진 파일의 상실을 못 본다(워프 base 스캐너가 그렇게 뚫렸다).")# 판정은 **`_bake_only` 하나**가 소유한다 — 형제 스캐너(워프 base)와 같은 판정기다.## 앞선 판은 여기서만 옛 관대함을 들고 있었다: (a) 줄에서 첫 `img(` 인자 **한 심볼**만@@ -779,34 +781,19 @@ def test_breathe_draws_from_the_file_the_bake_reads(site):## 판정기를 좁히면 **모든 호출부가 같이 좁아져야** 한다. 한 곳만 고치면 다음 우회가# 안 고친 쪽으로 간다 — 이 플랜에서 여섯 라운드 반복된 형태다.- rhs = line.split("=", 1)[1].strip().rstrip(";") if "=" in line else line- assert _bake_only(name, lineno, rhs), (- f"{name}:{lineno} 의 어떤 분기가 굽기 파일이 아니다.\n {line}\n"- f" `bakeFrameUrl(state, frame)` 또는 그걸 거치는 store 헬퍼를 써라 "- f"(frameUrl 은 표시용, f.url 은 캐노니컬).")+ not_bake = []+ for name, lineno, line in sites:+ rhs = line.split("=", 1)[1].strip().rstrip(";") if "=" in line else line+ if not _bake_only(name, lineno, rhs):+ not_bake.append(f"{name}:{lineno} 의 어떤 분기가 굽기 파일이 아니다.\n {line}")+ assert not not_bake, (+ "\n".join(not_bake) + "\n"+ " `bakeFrameUrl(state, frame)` 또는 그걸 거치는 store 헬퍼를 써라 "+ "(frameUrl 은 표시용, f.url 은 캐노니컬).")# ── 고칠 수 없는 차이도 관측 가능해야 한다 ──────────────────────────--RESAMPLE_NOTICE = re.compile(r"breatheResamplesDifferently\s*\(")---def test_file_producing_paths_report_the_resampler_gap():- """회전·확대가 걸린 줄은 프리뷰와 굽기의 **픽셀이 다르다** — 말은 해야 한다.-- 굽기는 `apply_transform` 에서 BICUBIC(`snap_scale` 없는 런 = 기본 런 전부),- 웹뷰는 `imageSmoothingEnabled=false` 캔버스라 NEAREST 다. 실측 (validator 2026-07-26,- 96px 픽스처, 신선도는 통과시킨 상태): rotate 3° 에서 12/12 위상 최대 1803px 상이,- scale 1.03 에서 최대 1699px. 원인은 표시 파이프라인이라 호흡이 고칠 수 있는 게- 아니지만, `row-export` 와 비교뷰 다운로드는 **이 캔버스로 파일을 굽는다** —- 조용히 두면 사용자는 GIF 와 다른 파일을 받고도 모른다 (원칙 6).-- "고칠 수 없으니 말하지 않는다" 는 이 플랜에서 금지된 형태다."""- for name, line, body in _file_producing_functions():- assert RESAMPLE_NOTICE.search(body), (- f"{name}:{line} 이 파일을 만들면서 리샘플러 차이를 안 알린다 — "- "사용자는 GIF 와 다른 파일을 받고도 모른다")-+# (파일 생성 경로의 리샘플러 알림은 `test_every_file_producing_path_checks_freshness` 가 본다)def test_the_warn_notice_has_a_visible_style():"""`warn` 알림이 스타일 없이 나가면 '알렸다' 가 사실상 거짓이 된다."""@@ -854,24 +841,6 @@ def _warp_base_sites():yield name, lineno, m.group(2).strip()-def test_the_warp_base_inventory_is_intact():- """워프 base 사이트가 **파일마다 몇 곳인지까지** 그대로여야 한다.-- 존재만 보는 못은 사이트가 여럿인 파일에서 상실을 못 본다 — 하나가 사라져도 나머지가- 파일을 커버한다. 조용한 커버리지 상실은 이 플랜이 이미 두 번 1급 계약으로 올린- 실패 모드이고, 이건 그 다음 granularity 다.-- 개수가 바뀌면 실패하는 게 **의도다**: 워프 base 를 늘리거나 줄이는 변경은 사람이- 한 번 보고 이 표를 같이 고쳐야 한다."""- got = {}- for name, _, _ in _warp_base_sites():- got[name] = got.get(name, 0) + 1- assert got == EXPECTED_WARP_BASES, (- f"워프 base 인벤토리가 달라졌다.\n 기대: {EXPECTED_WARP_BASES}\n 실제: {got}\n"- " 줄었으면 사이트가 조용히 증발한 것이고(캔버스·ctx·호출 이름 변경), "- "늘었으면 새 워프 base 가 계약에 들어온 것이다 — 어느 쪽이든 표를 같이 고쳐라.")--def test_the_warp_base_never_falls_back_to_a_display_file():"""호흡 워프의 base 는 **굽기가 읽는 파일 하나**다 — 폴백을 두지 않는다.@@ -882,9 +851,20 @@ def test_the_warp_base_never_falls_back_to_a_display_file():준비 안 됐으면 워프하지 않는다(`zoom-editor`·`compare`·`row-export` 가 쓰는 형태).판정은 도달도 선언도 아닌 **분기 전수 + 재대입 금지**다 (`_bake_only`): 세 번의 탈출이- 각각 분기·흐름·사이트 수집을 노렸다."""+ 각각 분기·흐름·사이트 수집을 노렸다.++ 워프 base 사이트는 **파일마다 몇 곳인지까지** 그대로여야 한다. 존재만 보는 못은+ 사이트가 여럿인 파일에서 상실을 못 본다 — 하나가 사라져도 나머지가 파일을 커버한다.+ 조용한 커버리지 상실은 이 플랜이 이미 두 번 1급 계약으로 올린 실패 모드이고, 이건+ 그 다음 granularity 다. 개수가 바뀌면 실패하는 게 **의도다**: 워프 base 를 늘리거나+ 줄이는 변경은 사람이 한 번 보고 이 표를 같이 고쳐야 한다."""sites = list(_warp_base_sites())assert sites, "워프 base 자리를 하나도 못 찾았다 — 스캐너가 고장났다"+ got = _inventory(sites)+ assert got == EXPECTED_WARP_BASES, (+ f"워프 base 인벤토리가 달라졌다.\n 기대: {EXPECTED_WARP_BASES}\n 실제: {got}\n"+ " 줄었으면 사이트가 조용히 증발한 것이고(캔버스·ctx·호출 이름 변경), "+ "늘었으면 새 워프 base 가 계약에 들어온 것이다 — 어느 쪽이든 표를 같이 고쳐라.")for name, line, arg in sites:assert _bake_only(name, line, arg), (f"{name}:{line} 워프 base {arg!r} 의 어떤 분기가 굽기 파일이 아니다.\n"diff --git a/tests/effects/test_breathe_reference_key.py b/tests/effects/test_breathe_reference_key.pyindex 8928fbb..2ce5dea 100644--- a/tests/effects/test_breathe_reference_key.py+++ b/tests/effects/test_breathe_reference_key.py@@ -152,55 +152,80 @@ from tests.effects.test_breathe_anatomy_route import CELL, run_dir # noqa: E402STORE_HARNESS = r"""const fs = require("fs"), vm = require("vm");const payload = JSON.parse(fs.readFileSync(process.argv[1], "utf8"));-const sandbox = {- console, TextEncoder, Set, Map, setTimeout,- document: { createElement: () => ({ getContext: () => ({}), style: {} }),- addEventListener() {}, querySelectorAll: () => [] },- window: {}, fetch: () => {}, setStatus() {}, t: () => "", STR: {}, lang: "ko",- scheduleSave() {}, flushSave: async () => {}, rebuildState() {},- URL: { createObjectURL() {}, revokeObjectURL() {} },-};-sandbox.globalThis = sandbox;-vm.createContext(sandbox);-for (const f of payload.scripts) vm.runInContext(fs.readFileSync(f, "utf8"), sandbox);+const sources = payload.scripts.map((f) => fs.readFileSync(f, "utf8"));++// 부팅 하나 = 새 vm 컨텍스트 하나. 여러 부팅을 node 한 프로세스에 묶어도+// `run`·`entries`·`unfakeStates` 가 다음 부팅으로 새지 않는다.+function boot(one) {+ const sandbox = {+ console, TextEncoder, Set, Map, setTimeout,+ document: { createElement: () => ({ getContext: () => ({}), style: {} }),+ addEventListener() {}, querySelectorAll: () => [] },+ window: {}, fetch: () => {}, setStatus() {}, t: () => "", STR: {}, lang: "ko",+ scheduleSave() {}, flushSave: async () => {}, rebuildState() {},+ URL: { createObjectURL() {}, revokeObjectURL() {} },+ };+ sandbox.globalThis = sandbox;+ vm.createContext(sandbox);+ for (const src of sources) vm.runInContext(src, sandbox);++ // 서버 페이로드를 웹뷰 상태로 — store.js 가 읽는 필드만.+ //+ // `let run`/`let entries` 는 컨텍스트의 **렉시컬 바인딩**이라 sandbox 객체에 대입해도+ // 스크립트가 못 본다. 컨텍스트 안에서 대입해야 한다.+ sandbox.__payload = one;+ vm.runInContext(`+ run = __payload.run;+ entries = {};+ // **손으로 unfakeStates 를 먹이지 않는다.** 웹뷰가 서버 페이로드에서 변종을 스스로+ // 골라내는지가 이 하네스의 요점이다 — 시드를 밖에 두면 그 질문을 영영 못 묻는다+ // (validator 실측 2026-07-26: 변종 불일치가 그 공백으로 한 라운드를 살아남았다).+ seedUnfakeState(__payload.run);+ for (const [name, v] of Object.entries(__payload.ppOverride || {})) unfakeStates[name] = v;+ for (const [name, e] of Object.entries(__payload.entries)) {+ entries[name] = { order: e.order, sel: new Set(e.sel), transforms: e.transforms || {},+ pixels: e.pixels || {}, clones: e.clones || {},+ unlinked: new Set(e.unlinked || []) };+ }+ __out = {};+ for (const q of __payload.queries) {+ if (q.kind === "key") __out[q.id] = breatheReferenceKey(q.state);+ if (q.kind === "geometry") __out[q.id] = breatheGeometryFrame(q.state, q.fallback);+ if (q.kind === "variant") __out[q.id] = bakeVariant(q.state);+ }+ `, sandbox);+ return sandbox.__out;+}-// 서버 페이로드를 웹뷰 상태로 — store.js 가 읽는 필드만.-//-// `let run`/`let entries` 는 컨텍스트의 **렉시컬 바인딩**이라 sandbox 객체에 대입해도-// 스크립트가 못 본다. 컨텍스트 안에서 대입해야 한다.-sandbox.__payload = payload;-vm.runInContext(`- run = __payload.run;- entries = {};- // **손으로 unfakeStates 를 먹이지 않는다.** 웹뷰가 서버 페이로드에서 변종을 스스로- // 골라내는지가 이 하네스의 요점이다 — 시드를 밖에 두면 그 질문을 영영 못 묻는다- // (validator 실측 2026-07-26: 변종 불일치가 그 공백으로 한 라운드를 살아남았다).- seedUnfakeState(__payload.run);- for (const [name, v] of Object.entries(__payload.ppOverride || {})) unfakeStates[name] = v;- for (const [name, e] of Object.entries(__payload.entries)) {- entries[name] = { order: e.order, sel: new Set(e.sel), transforms: e.transforms || {},- pixels: e.pixels || {}, clones: e.clones || {},- unlinked: new Set(e.unlinked || []) };- }- __out = {};- for (const q of __payload.queries) {- if (q.kind === "key") __out[q.id] = breatheReferenceKey(q.state);- if (q.kind === "geometry") __out[q.id] = breatheGeometryFrame(q.state, q.fallback);- if (q.kind === "variant") __out[q.id] = bakeVariant(q.state);- }-`, sandbox);-process.stdout.write(JSON.stringify(sandbox.__out));+// 부팅 하나가 터져도 나머지 부팅은 돈다 — 실패는 그 부팅 자리에 `error` 로 남는다.+process.stdout.write(JSON.stringify(payload.boots.map((one) => {+ try { return { out: boot(one) }; }+ catch (e) { return { error: String((e && e.stack) || e) }; }+})));"""+def _boot(run_payload, entries, queries, pp_override=None):+ return {"run": run_payload, "entries": entries, "ppOverride": pp_override or {},+ "queries": queries}+++def _webview_boots(boots):+ """웹뷰 부팅 여러 개를 node **한 프로세스**에서 돌린다 (부팅마다 새 vm 컨텍스트).++ 결과는 부팅마다 `{"out": 질의 결과}` 또는 `{"error": 스택}` — 한 부팅의 실패가+ 나머지를 가리지 않는다."""+ return _node(STORE_HARNESS, {+ "scripts": [str(SRC / "breathe.js"), str(SRC / "store.js")], "boots": boots})++def _webview(run_payload, entries, queries, pp_override=None):"""웹뷰를 서버 페이로드로 부팅해 질의한다 — `unfakeStates` 는 `seedUnfakeState` 가 짓는다.`pp_override` 는 사용자가 화면에서 토글을 누른 상태를 흉내낼 때만 쓴다."""- return _node(STORE_HARNESS, {- "scripts": [str(SRC / "breathe.js"), str(SRC / "store.js")],- "run": run_payload, "entries": entries, "ppOverride": pp_override or {},- "queries": queries})+ [got] = _webview_boots([_boot(run_payload, entries, queries, pp_override)])+ assert "error" not in got, f"웹뷰 부팅 실패:\n{got['error']}"+ return got["out"]@pytest.fixture()@@ -312,27 +337,16 @@ def web_run_plain(web_run):return web_run-def test_the_webview_agrees_on_the_plain_variant_too(web_run_plain):- """pp OFF 줄에서도 웹뷰 키 == 라우트 키.-- 변종이 갈리면 서로 다른 **파일**을 기준으로 삼는다 — 이 줄이 정확히 그 경로다."""- import sprite_gen.serve.serve_curation as serve_curation- _, route_key = serve_curation._breathe_source_frame(web_run_plain, "idle")- assert "|plain|" in route_key, f"라우트가 plain 변종을 안 골랐다: {route_key}"- payload = _server_payload(web_run_plain)- got = _webview(payload, {"idle": {"order": [0, 1, 2, 3], "sel": [0, 1, 2, 3]}},- [{"id": "k", "kind": "key", "state": "idle"}])- assert got["k"] == route_key, (- f"pp OFF 줄에서 갈렸다\n 라우트: {route_key}\n 웹뷰 : {got['k']}")--def test_a_rotated_row_stays_fresh(web_run_plain):"""**R1 회귀 그물.** 회전이 걸린 pp OFF 줄이 신선하다고 판정돼야 한다.옛 지문(변형 결과 RGBA 해시)에서는 이 줄이 영구 불일치라 프리뷰가 영원히 원본으로떨어지고 영상 내보내기가 영구 차단됐다 — 그리고 안내대로 해부를 갱신해도 라우트가또 BICUBIC 프레임으로 같은 숫자를 만들어 **절대 안 풀렸다** (validator 실측 2026-07-26:- rotate 3° 에서 555px 상이)."""+ rotate 3° 에서 555px 상이).++ pp OFF 줄에서도 웹뷰 키 == 라우트 키인지를 같이 본다 — 변종이 갈리면 서로 다른+ **파일**을 기준으로 삼는다."""import sprite_gen.serve.serve_curation as serve_curationfrom sprite_gen.effects.breathe import freeze_anatomycuration = json.loads((web_run_plain / "curation.json").read_text(encoding="utf-8"))@@ -340,6 +354,7 @@ def test_a_rotated_row_stays_fresh(web_run_plain):_write_curation(web_run_plain, curation)frame, route_key = serve_curation._breathe_source_frame(web_run_plain, "idle")+ assert "|plain|" in route_key, f"라우트가 plain 변종을 안 골랐다: {route_key}"frozen = freeze_anatomy(frame, {}, route_key) # 라우트가 사이드카에 얼리는 값payload = _server_payload(web_run_plain)got = _webview(payload,@@ -370,8 +385,7 @@ def _variant_id(case):return f"twin{'있음' if twin else '없음'}-own{fmt[own]}-wide{fmt[wide]}"[email protected]("twin,own,wide", VARIANT_CASES, ids=[_variant_id(c) for c in VARIANT_CASES])-def test_the_webview_resolves_the_bake_variant_like_the_server(twin, own, wide):+def test_the_webview_resolves_the_bake_variant_like_the_server():"""웹뷰의 굽기 변종 == 파이썬 `frame_variant` — 해소표 전수.`unfakeOn` 은 **표시 렌즈**다: boot 시드가 트윈 없는 줄을 기본 OFF 로 놓는데 그 값은@@ -381,26 +395,41 @@ def test_the_webview_resolves_the_bake_variant_like_the_server(twin, own, wide):(validator 실측 2026-07-26).한 칸씩 메우지 않고 표를 통째로 건다 — 같은 실패 모드가 축만 바꿔(파일 → 리샘플러- → 변종 이름) 세 번 되돌아왔다."""+ → 변종 이름) 세 번 되돌아왔다.++ 18칸은 node 한 프로세스에서 돈다 — 칸마다 새 vm 컨텍스트로 부팅하므로 칸끼리 상태가+ 안 샌다. 칸은 하나도 줄이지 않고, 갈린 칸은 제 이름(`_variant_id`)으로 전부 보고한다."""from sprite_gen.curate.curation import frame_variant- curation = {"states": {}}- if own is not None:- curation["states"]["idle"] = {"pixel_unfake": own}- if wide is not None:- curation["pixel_unfake"] = wide- frames = [{"index": 0, "present": True, "url": "/f0.png", "stamp": "1:1"}]- if twin:- frames[0]["plainUrl"] = "/f0.plain.png"- frames[0]["plainBakeUrl"] = "/f0.plain.png"- frames[0]["plainBakeStamp"] = "2:2"- payload = {"requestStamp": "9:9", "curation": curation,- "states": [{"name": "idle", "frames": frames}]}- got = _webview(payload, {"idle": {"order": [0], "sel": [0]}},- [{"id": "v", "kind": "variant", "state": "idle"}])- assert got["v"] == frame_variant(curation, "idle"), (- f"트윈{twin} per-state{own} 전역{wide}: "- f"웹뷰 {got['v']!r} vs 서버 {frame_variant(curation, 'idle')!r}")+ curations, boots = [], []+ for twin, own, wide in VARIANT_CASES:+ curation = {"states": {}}+ if own is not None:+ curation["states"]["idle"] = {"pixel_unfake": own}+ if wide is not None:+ curation["pixel_unfake"] = wide+ frames = [{"index": 0, "present": True, "url": "/f0.png", "stamp": "1:1"}]+ if twin:+ frames[0]["plainUrl"] = "/f0.plain.png"+ frames[0]["plainBakeUrl"] = "/f0.plain.png"+ frames[0]["plainBakeStamp"] = "2:2"+ payload = {"requestStamp": "9:9", "curation": curation,+ "states": [{"name": "idle", "frames": frames}]}+ curations.append(curation)+ boots.append(_boot(payload, {"idle": {"order": [0], "sel": [0]}},+ [{"id": "v", "kind": "variant", "state": "idle"}]))+ results = _webview_boots(boots)+ assert len(results) == len(VARIANT_CASES)++ failures = []+ for case, curation, got in zip(VARIANT_CASES, curations, results):+ want = frame_variant(curation, "idle")+ if "error" in got:+ failures.append(f"[{_variant_id(case)}] 웹뷰 부팅 실패:\n{got['error']}")+ elif got["out"]["v"] != want:+ failures.append(f"[{_variant_id(case)}] 웹뷰 {got['out']['v']!r} vs 서버 {want!r}")+ assert not failures, (+ f"해소표 {len(VARIANT_CASES)}칸 중 {len(failures)}칸이 갈렸다:\n" + "\n".join(failures))def test_the_saved_sidecar_is_what_the_variant_resolves_from():@@ -580,14 +609,13 @@ def test_a_plain_variant_without_a_twin_refuses_instead_of_falling_back():f"지오메트리가 굽기가 못 읽는 파일을 가리킨다: {got['g']['url']!r}")[email protected]("shape", ["null", "empty", "missing"])-def test_the_mirror_refuses_when_the_key_cannot_be_built(shape):+def test_the_mirror_refuses_when_the_key_cannot_be_built():"""키를 못 만들면 "확인 불가" 이지 "괜찮음" 이 아니다.형제 분기(지문 없음)는 round-10 R3 이후 그물이 있는데 이쪽만 비어 있었다 —`throw` 를 `return` 으로 바꿔도 529 전부 통과했다 (validator note 2026-07-26).- 키가 없는 상태는 트윈 없는 plain 줄·빈 재생목록·스탬프 없는 프레임에서 실제로 나온다."""- key = {"null": None, "empty": "", "missing": None}[shape]+ 키가 없는 상태는 트윈 없는 plain 줄·빈 재생목록·스탬프 없는 프레임에서 실제로 나온다+ — 셋 다 null 이다. 빈 문자열·undefined 도 같은 `!referenceKey` 한 줄이 받는다."""harness = r"""const fs = require("fs"), vm = require("vm");const P = JSON.parse(fs.readFileSync(process.argv[1], "utf8"));@@ -597,8 +625,7 @@ sb.globalThis = sb; vm.createContext(sb);vm.runInContext(fs.readFileSync(P.script, "utf8"), sb);let out;try {- if (P.shape === "missing") sb.breatheAssertFresh(undefined, P.cfg);- else sb.breatheAssertFresh(P.key, P.cfg);+ sb.breatheAssertFresh(P.key, P.cfg);out = { ok: true };} catch (e) {out = { ok: false, refused: e.constructor.name === "BreatheRefused", message: e.message };@@ -607,8 +634,7 @@ process.stdout.write(JSON.stringify(out));"""cfg = {"depth": 0.06, "breaths": 1, "lag": 0.1,"anatomy": {"height": 50, "rigid_row": 12, "fingerprint": "pixel:0:deadbeef"}}- got = _node(harness, {"script": str(SRC / "breathe.js"), "key": key,- "shape": shape, "cfg": cfg})+ got = _node(harness, {"script": str(SRC / "breathe.js"), "key": None, "cfg": cfg})assert not got["ok"] and got["refused"], (- f"키가 {shape} 인데 미러가 신선하다고 판정했다 — 낡은 해부로 그리고, "+ f"키가 null 인데 미러가 신선하다고 판정했다 — 낡은 해부로 그리고, "f"`row-export` 는 그 캔버스로 파일을 굽는다 ({got})")diff --git a/tests/effects/test_breathe_sidecar_roundtrip.py b/tests/effects/test_breathe_sidecar_roundtrip.pyindex c4ef47e..dddbc9a 100644--- a/tests/effects/test_breathe_sidecar_roundtrip.py+++ b/tests/effects/test_breathe_sidecar_roundtrip.py@@ -24,7 +24,7 @@ ROOT = Path(__file__).resolve().parent.parent.parentsys.path.insert(0, str(ROOT))from sprite_gen.effects.breathe import fit_breathe_pattern # noqa: E402-from sprite_gen.curate.curation import RETIRED_BREATHE_KEYS, state_breathe # noqa: E402+from sprite_gen.curate.curation import state_breathe # noqa: E402from sprite_gen.serve.serve_curation import CURATOR_DIR # noqa: E402CURATOR = CURATOR_DIR / "src"@@ -33,21 +33,38 @@ node = pytest.mark.skipif(shutil.which("node") is None, reason="node 가 없어HARNESS = r"""const fs = require("fs"), vm = require("vm");const P = process.argv[2] + "/";-const sb = { console, document: { createElement: () => ({ getContext: () => ({}) }) },- window: {}, __status: [], setStatus: (m, k) => sb.__status.push([k || "", String(m)]),- t: () => "", fetch: () => {}, alert: () => {}, lang: "ko", STR: { ko: {} },- entries: {}, anchorPicks: {}, previews: {} };-sb.globalThis = sb; vm.createContext(sb);-for (const f of ["util.js", "store.js", "persistence.js"]) {- try { vm.runInContext(fs.readFileSync(P + f, "utf8"), sb); } catch (e) {}+const SOURCES = ["util.js", "store.js", "persistence.js"].map((f) => fs.readFileSync(P + f, "utf8"));++// 왕복 하나 = 새 vm 컨텍스트 하나. 여러 왕복을 node 한 프로세스에 묶어도+// `run`·`entries`·상태 알림이 다음 왕복으로 새지 않는다.+function boot() {+ const sb = { console, document: { createElement: () => ({ getContext: () => ({}) }) },+ window: {}, __status: [], setStatus: (m, k) => sb.__status.push([k || "", String(m)]),+ t: () => "", fetch: () => {}, alert: () => {}, lang: "ko", STR: { ko: {} },+ entries: {}, anchorPicks: {}, previews: {} };+ sb.globalThis = sb; vm.createContext(sb);+ for (const src of SOURCES) {+ try { vm.runInContext(src, sb); } catch (e) {}+ }+ return sb;}+const input = JSON.parse(fs.readFileSync(process.argv[3], "utf8"));if (input.mode === "roundtrip") {- vm.runInContext(`run = ${JSON.stringify(input.run)};`, sb);- sb.seedEntries();- const payload = sb.buildPayload();- fs.writeFileSync(input.out, JSON.stringify({ payload, status: sb.__status }));+ // 한 왕복이 터져도 나머지 왕복은 돈다 — 실패는 그 자리에 `error` 로 남는다.+ const out = input.runs.map((run) => {+ try {+ const sb = boot();+ vm.runInContext(`run = ${JSON.stringify(run)};`, sb);+ sb.seedEntries();+ return { payload: sb.buildPayload(), status: sb.__status };+ } catch (e) {+ return { error: String((e && e.stack) || e) };+ }+ });+ fs.writeFileSync(input.out, JSON.stringify(out));} else {+ const sb = boot();vm.runInContext(fs.readFileSync(P + "breathe.js", "utf8"), sb);const out = input.cases.map((c) => sb.breathePattern({ breaths: c.breaths }, c.seq));fs.writeFileSync(input.out, JSON.stringify(out));@@ -67,126 +84,69 @@ def _run(payload, tmp_path):return json.loads(Path(payload["out"]).read_text(encoding="utf-8"))+def _roundtrips(runs, tmp_path):+ """웹뷰 왕복 여러 개를 node 한 프로세스에서 — 왕복마다 새 vm 컨텍스트.++ 결과는 왕복마다 `{"payload", "status"}` 또는 `{"error"}`."""+ return _run({"mode": "roundtrip", "runs": runs}, tmp_path)+++def _roundtrip(run, tmp_path):+ [got] = _roundtrips([run], tmp_path)+ assert "error" not in got, f"왕복이 터졌다:\n{got['error']}"+ return got++@node[email protected]("retired_key", sorted(RETIRED_BREATHE_KEYS))-def test_curator_preserves_a_retired_breathe_sidecar(retired_key, tmp_path):- """구 스키마 키가 있는 사이드카를 웹뷰가 읽고 되쓰면 그 키가 그대로 남아야 한다."""- breathe = {retired_key: {"splits": [0.55], "amplitude": 2,- "subpixel": True, "hold": 2}[retired_key], "breaths": 3}+def test_curator_preserves_a_retired_breathe_sidecar(tmp_path):+ """구 스키마 키가 있는 사이드카를 웹뷰가 읽고 되쓰면 그 키가 그대로 남아야 한다.+ 조용히 넘어가지도 않는다 — 마이그레이션 경로를 화면에 알린다.++ 폐기 키 하나로 충분하다: 큐레이터는 키 목록 `RETIRED_BREATHE_KEYS.filter` 한 줄로+ 거르고, 그 목록이 파이썬과 같은지는+ `test_breathe_reference_key.py::test_the_mirrored_limits_are_the_same_numbers` 가 본다."""+ breathe = {"splits": [0.55], "breaths": 3}run = {"schemaVersion": 1, "fps": 6,"states": [{"name": "idle", "fps": 6,"frames": [{"index": 0, "present": True}, {"index": 1, "present": True}]}],"curation": {"states": {"idle": {"selected": [0, 1], "breathe": breathe}}}}- got = _run({"mode": "roundtrip", "run": run}, tmp_path)+ got = _roundtrip(run, tmp_path)saved = got["payload"]["states"]["idle"].get("breathe")- assert saved is not None, f"{retired_key}: 저장 payload 에서 breathe 가 통째로 사라졌다"- assert retired_key in saved, f"{retired_key}: 폐기 키가 삭제됐다 — migrate 근거가 파괴된다"+ assert saved is not None, "splits: 저장 payload 에서 breathe 가 통째로 사라졌다"+ assert "splits" in saved, "splits: 폐기 키가 삭제됐다 — migrate 근거가 파괴된다"assert saved == breathe, "폐기 사이드카는 정규화도 하지 않고 원본 그대로여야 한다"# 굽기 쪽 loud reject 가 여전히 걸리는지 (계약이 왕복 후에도 성립)with pytest.raises(SystemExit):state_breathe({"states": {"idle": {"breathe": saved}}}, "idle")---@node-def test_curator_tells_the_user_about_a_retired_sidecar(tmp_path):- """조용히 넘어가지 않는다 — 마이그레이션 경로를 화면에 알린다."""- run = {"schemaVersion": 1, "fps": 6,- "states": [{"name": "idle", "fps": 6, "frames": [{"index": 0, "present": True}]}],- "curation": {"states": {"idle": {"selected": [0],- "breathe": {"splits": [0.55], "breaths": 1}}}}}- got = _run({"mode": "roundtrip", "run": run}, tmp_path)errs = [m for kind, m in got["status"] if kind == "err"]assert errs, "폐기 스키마를 만났는데 아무 알림도 없다"assert any("migrate-breathe" in m for m in errs), f"마이그레이션 경로 안내가 없다: {errs}"-@node[email protected]("seq,breaths", [(18, 3), (30, 7), (12, 2), (12, 4), (7, 2), (20, 5)])-def test_js_phase_pattern_is_bit_identical_to_python(seq, breaths, tmp_path):- """위상식 미러 — 부동소수 표현까지 같아야 프리뷰가 굽기와 안 갈린다."""- got = _run({"mode": "pattern", "cases": [{"seq": seq, "breaths": breaths}]}, tmp_path)[0]- want = fit_breathe_pattern(seq, {"breaths": breaths})- assert len(got) == len(want)- for i, (a, b) in enumerate(zip(want, got)):- assert a == b, f"seq={seq} breaths={breaths} slot {i}: py={a!r} js={b!r}"- assert len(set(got)) == len(set(want)), "유니크 위상 개수가 다르다 (표현 노이즈)"---@node[email protected]("bad", [- {"depth": 0.5, "breaths": 12, "lag": 0.9},- {"depth": 0},- {"breaths": 12},-], ids=["all-three", "depth-zero", "breaths-over"])-def test_the_curator_never_clamps_an_out_of_range_sidecar(bad, tmp_path):- """굽기가 요란하게 거부하는 값을 웹뷰가 조용히 깎아 되쓰면 원본이 파괴된다.-- 실측 (validator 2026-07-25): `depth 0.5 / breaths 12 / lag 0.9` 를 웹뷰가 `0.2 / 8 / 0.45`- 로 조용히 로드하고(status 0건) 첫 autosave 가 그 값으로 사이드카를 갈아치웠다 —- loud reject 자체가 사라진다. round-3 A(폐기 키 삼킴)와 같은 경로다."""- breathe = {"depth": 0.06, "breaths": 1, "lag": 0.1, **bad}- run = {"schemaVersion": 1, "fps": 6,- "states": [{"name": "idle", "fps": 6,- "frames": [{"index": 0, "present": True}, {"index": 1, "present": True}]}],- "curation": {"states": {"idle": {"selected": [0, 1], "breathe": breathe}}}}- got = _run({"mode": "roundtrip", "run": run}, tmp_path)-- saved = got["payload"]["states"]["idle"].get("breathe")- assert saved == breathe, f"웹뷰가 범위 밖 사이드카를 바꿔 썼다: {saved}"- errs = [m for kind, m in got["status"] if kind == "err"]- assert errs, "범위 밖인데 아무 알림도 없다"-- # 굽기 쪽 게이트가 왕복 후에도 그대로 걸린다- with pytest.raises(SystemExit):- state_breathe({"states": {"idle": {"breathe": saved}}}, "idle")+PATTERN_CASES = [(18, 3), (30, 7), (12, 2), (12, 4), (7, 2), (20, 5)]@node-def test_the_curator_accepts_what_the_bake_accepts(tmp_path):- """굽기가 받는 값(숫자 문자열 포함)을 웹뷰도 호흡 켜짐으로 읽어야 한다.-- `typeof !== "number"` 게이트는 `"0.08"` 을 호흡 없음으로 읽고 저장에서 breathe 키를- 통째로 지웠다 — 굽기는 정상 수용하는 값이라 켜짐/꺼짐 자체가 반대였다."""- breathe = {"depth": "0.08", "breaths": 3, "lag": 0.1}- run = {"schemaVersion": 1, "fps": 6,- "states": [{"name": "idle", "fps": 6, "frames": [{"index": 0, "present": True}]}],- "curation": {"states": {"idle": {"selected": [0], "breathe": breathe}}}}- got = _run({"mode": "roundtrip", "run": run}, tmp_path)- saved = got["payload"]["states"]["idle"].get("breathe")- assert saved is not None, "굽기가 받는 값을 웹뷰가 호흡 없음으로 읽고 지웠다"- assert float(saved["depth"]) == 0.08- assert state_breathe({"states": {"idle": {"breathe": saved}}}, "idle")["depth"] == 0.08---@node[email protected]("sidecar", [- {"breaths": 2},- {"breaths": 2, "lag": 0.1},- {"depth": 0.06, "breaths": 2},-], ids=["depth-omitted", "depth-omitted-with-lag", "depth-explicit"])-def test_an_omitted_depth_survives_the_round_trip(sidecar, tmp_path):- """`depth` 생략은 굽기에서 기본값 0.06 이다 — 왕복이 그걸 파괴하면 안 된다.-- `Number(undefined)` 는 NaN 이고 `JSON.stringify(NaN)` 은 `null` 이라, 기본값 분기가- 없으면 첫 autosave 가 사이드카에 `depth: null` 을 박는다. 그러면 **굽기가 정상 수용하던- 사이드카를 큐레이터로 한 번 여는 것만으로 굽기가 죽는 사이드카로 바꿔놓고 아무 말도- 안 한다** (validator 실측 2026-07-26). `SKILL.md` 가 문서화한 "뷰 없이 에이전트가 breathe- 만 쓴 런" 이 정확히 이 모양이다."""- before = state_breathe({"states": {"idle": {"breathe": sidecar}}}, "idle")- assert before is not None, "이 사이드카는 굽기가 받아야 의미가 있다"-- run = {"schemaVersion": 1, "fps": 6,- "states": [{"name": "idle", "fps": 6,- "frames": [{"index": 0, "present": True}, {"index": 1, "present": True}]}],- "curation": {"states": {"idle": {"selected": [0, 1], "breathe": sidecar}}}}- got = _run({"mode": "roundtrip", "run": run}, tmp_path)- saved = got["payload"]["states"]["idle"].get("breathe")- assert saved is not None, "왕복이 호흡 설정을 통째로 지웠다"- assert saved.get("depth") is not None, f"왕복이 depth 를 null 로 박았다: {saved}"-- after = state_breathe({"states": {"idle": {"breathe": saved}}}, "idle")- assert after["depth"] == before["depth"], "왕복이 굽기가 쓰는 값을 바꿨다"- assert after["breaths"] == before["breaths"]+def test_js_phase_pattern_is_bit_identical_to_python(tmp_path):+ """위상식 미러 — 부동소수 표현까지 같아야 프리뷰가 굽기와 안 갈린다.++ 여섯 칸을 node 한 번에 돌린다(하네스가 원래 `cases` 를 받는다). 갈린 칸은+ `seq-breaths` 이름으로 전부 보고한다."""+ got_all = _run({"mode": "pattern",+ "cases": [{"seq": seq, "breaths": breaths} for seq, breaths in PATTERN_CASES]},+ tmp_path)+ assert len(got_all) == len(PATTERN_CASES)+ failures = []+ for (seq, breaths), got in zip(PATTERN_CASES, got_all):+ want = fit_breathe_pattern(seq, {"breaths": breaths})+ if len(got) != len(want):+ failures.append(f"[{seq}-{breaths}] 길이가 다르다: py={len(want)} js={len(got)}")+ continue+ failures += [f"[{seq}-{breaths}] slot {i}: py={a!r} js={b!r}"+ for i, (a, b) in enumerate(zip(want, got)) if a != b]+ if len(set(got)) != len(set(want)):+ failures.append(f"[{seq}-{breaths}] 유니크 위상 개수가 다르다 (표현 노이즈)")+ assert not failures, "위상식 미러가 갈렸다:\n" + "\n".join(failures)# ── 왕복 계약 전수 매트릭스 ─────────────────────────────────────────@@ -251,23 +211,17 @@ def _bake_verdict(sidecar):return False, None-@node[email protected]("shape", sorted(_VALUE_SHAPES))[email protected]("key", MATRIX_KEYS)-def test_the_curator_agrees_with_the_bake_on_every_value_shape(key, shape, tmp_path):- """굽기가 거부하는 사이드카는 큐레이터도 **원본 그대로 두고 알린다**.- 굽기가 받는 사이드카는 큐레이터도 받고, 왕복해도 굽기가 쓰는 값이 안 바뀐다.+def _matrix_run(sidecar):+ return {"schemaVersion": 1, "fps": 6,+ "states": [{"name": "idle", "fps": 6,+ "frames": [{"index": 0, "present": True}, {"index": 1, "present": True}]}],+ "curation": {"states": {"idle": {"selected": [0, 1], "breathe": sidecar}}}}- 어느 쪽이든 **첫 autosave 가 사용자의 원래 숫자를 바꾸면 안 된다** — 그게 이- 플랜에서 네 번 반복된 실패 모드다(굽기가 거부하던 근거가 조용히 사라진다)."""- sidecar = _sidecar_for(key, shape)- accepted, before = _bake_verdict(sidecar)- run = {"schemaVersion": 1, "fps": 6,- "states": [{"name": "idle", "fps": 6,- "frames": [{"index": 0, "present": True}, {"index": 1, "present": True}]}],- "curation": {"states": {"idle": {"selected": [0, 1], "breathe": sidecar}}}}- got = _run({"mode": "roundtrip", "run": run}, tmp_path)+def _check_matrix_cell(key, shape, sidecar, got):+ """매트릭스 한 칸의 판정 — 어긋나면 `AssertionError` 로 그 칸의 사유를 말한다."""+ assert "error" not in got, f"{key}={shape}: 왕복이 터졌다\n{got.get('error')}"+ accepted, before = _bake_verdict(sidecar)saved = got["payload"]["states"]["idle"].get("breathe")errs = [m for kind, m in got["status"] if kind == "err"]@@ -288,6 +242,34 @@ def test_the_curator_agrees_with_the_bake_on_every_value_shape(key, shape, tmp_pf"{key}={shape}: 왕복이 굽기가 쓰는 값을 바꿨다\n 전={before}\n 후={after}")+@node+def test_the_curator_agrees_with_the_bake_on_every_value_shape(tmp_path):+ """굽기가 거부하는 사이드카는 큐레이터도 **원본 그대로 두고 알린다**.+ 굽기가 받는 사이드카는 큐레이터도 받고, 왕복해도 굽기가 쓰는 값이 안 바뀐다.++ 어느 쪽이든 **첫 autosave 가 사용자의 원래 숫자를 바꾸면 안 된다** — 그게 이+ 플랜에서 네 번 반복된 실패 모드다(굽기가 거부하던 근거가 조용히 사라진다).+ 범위 밖 값 깎기(`huge`/`zero`), 숫자 문자열 수용(`depth-string`), `depth`·`lag`+ 생략(`*-omitted`)도 이 표의 칸이다.++ 키 × 값 모양 36칸은 node 한 프로세스에서 돈다 — 칸마다 새 vm 컨텍스트라 칸끼리+ 상태가 안 샌다. 칸은 하나도 줄이지 않고, 갈린 칸은 제 이름(`key-shape`)으로+ 전부 보고한다."""+ cells = [(key, shape, _sidecar_for(key, shape))+ for key in MATRIX_KEYS for shape in sorted(_VALUE_SHAPES)]+ results = _roundtrips([_matrix_run(sidecar) for _, _, sidecar in cells], tmp_path)+ assert len(results) == len(cells)++ failures = []+ for (key, shape, sidecar), got in zip(cells, results):+ try:+ _check_matrix_cell(key, shape, sidecar, got)+ except Exception as exc: # 한 칸의 실패가 나머지 칸을 가리면 안 된다+ failures.append(f"[{key}-{shape}] {type(exc).__name__}: {exc}")+ assert not failures, (+ f"매트릭스 {len(cells)}칸 중 {len(failures)}칸이 갈렸다:\n" + "\n\n".join(failures))++@nodedef test_a_valid_anatomy_survives_the_round_trip_verbatim(tmp_path):"""서버가 얼린 해부는 왕복에서 **한 글자도** 안 바뀐다.@@ -305,7 +287,7 @@ def test_a_valid_anatomy_survives_the_round_trip_verbatim(tmp_path):"states": [{"name": "idle", "fps": 6,"frames": [{"index": 0, "present": True}, {"index": 1, "present": True}]}],"curation": {"states": {"idle": {"selected": [0, 1], "breathe": sidecar}}}}- got = _run({"mode": "roundtrip", "run": run}, tmp_path)+ got = _roundtrip(run, tmp_path)saved = got["payload"]["states"]["idle"].get("breathe")assert saved.get("anatomy") == anatomy, (f"왕복이 해부를 바꿨다 — 신선도 판정의 근거가 사라진다\n"diff --git a/tests/effects/test_recolor_docs.py b/tests/effects/test_recolor_docs.pyindex 311df33..8d91828 100644--- a/tests/effects/test_recolor_docs.py+++ b/tests/effects/test_recolor_docs.py@@ -3,8 +3,8 @@An external user who only reads the docs must be able to bake colourways. Theimplementation is already covered by `test_recolor_bake` / `test_recolor_curation_view`;-this file only asserts that the hub and the leaf teach the same commands, that the-curation sidecar field is named, and that the changelog records the feature.+this file only pins minimal anchors — the leaf names both commands, the hub and the+README link the leaf, and the curation doc names the sidecar field — not the prose.Internal project names and absolute personal paths must not appear in the new leaf(open-source vocabulary rule for this repo)."""@@ -42,56 +42,15 @@ def _read(rel: str) -> str:return (ROOT / rel).read_text(encoding="utf-8")-def test_recolor_leaf_doc_exists_and_teaches_both_commands() -> None:- text = _read("docs/recolor.md")- assert "sprite-gen recolor" in text- assert "sprite-gen recolor-palette" in text- assert "sprite-gen-recolor" in text # spec kind- assert "sprite-gen-recolor-report" in text # report kind- assert "variants/" in text- assert "recolor.picked" in text- assert "curation.json" in text- # Exact is the default; tolerance is opt-in — both must be named.- assert "exact" in text- assert "tolerance" in text- assert "No Silent Fallback" in text or "passthrough" in text---def test_skill_hub_routes_recolor_triggers_and_points_at_leaf() -> None:- text = _read("SKILL.md")- # Frontmatter description carries the trigger vocabulary for skill routers.- assert "palette swap" in text or "팔레트 스왑" in text- assert "recolor" in text- assert "docs/recolor.md" in text- assert "sprite-gen recolor" in text- assert "recolor-palette" in text- # Docs topology branch.- assert "COLOURWAYS" in text or "docs/recolor.md" in text- # Wrapper listed among required scripts.- assert "scripts/recolor.py" in text---def test_curation_and_run_contract_name_the_sidecar_and_folder() -> None:- curation = _read("docs/curation.md")- assert "recolor" in curation- assert "picked" in curation- assert "recolor.md" in curation-- run_contract = _read("docs/run-contract.md")- assert "variants/" in run_contract- assert "recolor" in run_contract---def test_readme_and_changelog_surface_the_feature() -> None:- readme = _read("README.md")- assert "recolor" in readme- assert "docs/recolor.md" in readme-- changelog = _read("CHANGELOG.md")- # The Unreleased recolor section must exist before a version pin is cut.- assert "palette-swap" in changelog or "palette swap" in changelog.lower() or "recolor" in changelog- assert "recolor-palette" in changelog- assert "recolor.picked" in changelog or "colourway" in changelog.lower() or "colorway" in changelog.lower()+def test_the_docs_teach_recolor() -> None:+ leaf = _read("docs/recolor.md")+ assert "sprite-gen recolor" in leaf+ assert "sprite-gen recolor-palette" in leaf+ # The hub and the README route readers to the leaf.+ assert "docs/recolor.md" in _read("SKILL.md")+ assert "docs/recolor.md" in _read("README.md")+ # The curation doc names the sidecar field the curator writes.+ assert "picked" in _read("docs/curation.md")# Every file this feature adds to the published tree. The leak found in review was@@ -108,13 +67,10 @@ RECOLOR_SURFACE = ()-def test_recolor_leaf_stays_open_source_vocabulary() -> None:+def test_recolor_surface_carries_no_operator_context() -> None:lowered = _read("docs/recolor.md").lower()for token in FORBIDDEN_LITERALS_IN_RECOLOR_LEAF:assert token.lower() not in lowered, f"docs/recolor.md must not mention {token!r}"---def test_recolor_surface_carries_no_operator_context() -> None:for rel in RECOLOR_SURFACE:raw = _read(rel)for pattern, what in FORBIDDEN_PATTERNS_IN_RECOLOR_LEAF:diff --git a/tests/effects/test_shadow.py b/tests/effects/test_shadow.pyindex 199a276..7330c52 100644--- a/tests/effects/test_shadow.py+++ b/tests/effects/test_shadow.py@@ -46,13 +46,12 @@ def _in_world(image, anchor, size=(1024, 1024)):return np.asarray(world.getchannel("A"))[email protected]("shear", [-2.0, 0.0, 2.0])-def test_foot_anchor_is_a_stationary_point(shear):+def test_foot_anchor_is_a_stationary_point():image = Image.new("RGBA", (40, 40))ImageDraw.Draw(image).rectangle((17, 27, 23, 33), fill=(255, 255, 255, 255))anchor = (20.5, 30.5)shadow, shadow_anchor = project_shadow(- image, anchor, squash=0.5, shear=shear, opacity=1, blur=0)+ image, anchor, squash=0.5, shear=2.0, opacity=1, blur=0)center = _center_of_alpha(shadow)assert center[0] - shadow_anchor[0] == pytest.approx(0, abs=0.6)assert center[1] - shadow_anchor[1] == pytest.approx(0, abs=0.6)@@ -69,9 +68,9 @@ def test_positive_shear_falls_left_and_negative_falls_right(shear):assert center[1] - anchor[1] == pytest.approx(-15, abs=0.7)[email protected]("anchor", [(0, 0), (0, 48), (32, 48), (7.5, 31.5)])[email protected]("shear", [-2.0, 2.0])[email protected]("blur", [0, 3, 9])[email protected]("anchor,shear,blur", [+ ((0, 0), -2.0, 9), ((32, 48), 2.0, 9), ((0, 48), 2.0, 0), ((7.5, 31.5), -2.0, 0),+])def test_canvas_does_not_crop_even_at_offcenter_anchors(anchor, shear, blur):source = _silhouette()shadow, shadow_anchor = project_shadow(@@ -113,7 +112,7 @@ def test_opacity_is_monotonic_and_does_not_change_geometry():assert low.sum() < high.sum()[email protected]("mode", ["RGBA", "RGB", "L", "P"])[email protected]("mode", ["RGBA", "P"])def test_source_is_unchanged_and_output_is_rgba(mode):source = _silhouette().convert(mode)original = source.tobytes(), source.mode, source.size, source.getpalette()@@ -129,23 +128,21 @@ def test_empty_silhouette_stays_transparent():@pytest.mark.parametrize("name,value", [- ("squash", 0), ("squash", -1), ("squash", 2), ("squash", 1e-100),+ ("squash", 2), ("squash", 1e-100),("shear", 10000), ("shear", -10000),("opacity", -0.1), ("opacity", 1.1),("blur", -1), ("blur", 10000),- *[(name, value) for name in ["squash", "shear", "opacity", "blur"]- for value in [float("nan"), float("inf"), float("-inf"), True, "bad"]],+ ("squash", float("nan")), ("shear", float("inf")),+ ("opacity", True), ("blur", "bad"),("color", (1, 2)), ("color", (-1, 2, 3)), ("color", (1, 2, 256)),- ("color", (1, 2, 3.5)), ("color", (1, 2, float("nan"))),- ("color", (True, 2, 3)), ("color", "red"), ("color", None),+ ("color", (1, 2, 3.5)), ("color", (True, 2, 3)), ("color", "red"),])def test_invalid_parameters_are_rejected(name, value):with pytest.raises(ValueError):project_shadow(_silhouette(), (16, 48), **{name: value})[email protected]("anchor", [None, (1,), (1, 2, 3), (float("nan"), 2),- (1, float("inf")), (True, 2), (1e12, 2)])[email protected]("anchor", [None, (1,), (float("nan"), 2), (True, 2), (1e12, 2)])def test_invalid_anchor_is_rejected(anchor):with pytest.raises(ValueError):project_shadow(_silhouette(), anchor)@@ -196,32 +193,26 @@ def test_run_publishes_loadable_sequence_strip_timing_anchor_and_preserves_sourcassert not (out_dir / runio.LOCK_FILENAME).exists()[email protected]("source_kind", ["png", "descriptor", "loop", "atlas"])[email protected]("source_kind", ["png", "atlas"])def test_run_uses_shared_loader_for_all_source_types(tmp_path, source_kind):source = _asset_files(tmp_path)state = Noneif source_kind == "png":source = tmp_path / "source-0.png"- elif source_kind in ("loop", "atlas"):+ else:sheet = Image.new("RGBA", (64, 48))for index in range(2):with Image.open(tmp_path / f"source-{index}.png") as frame:sheet.paste(frame, (index * 32, 0))- if source_kind == "loop":- sheet.save(tmp_path / "motion.strip.png")- source = tmp_path / "motion.strip.json"- data = {"frames": 2, "w": 32, "h": 48, "delay_ms": 150}- else:- sheet.save(tmp_path / "atlas.png")- source = tmp_path / "atlas.json"- state = "walk"- data = {- "sprite_sheet_alpha": "atlas.png",- "frame_layout": {"rows": {"walk": [- {"x": index * 32, "y": 0, "w": 32, "h": 48} for index in range(2)]}},- "animation": {"rows": {"walk": {"durations_ms": [70, 230], "loop": True}}},- }- source.write_text(json.dumps(data))+ sheet.save(tmp_path / "atlas.png")+ source = tmp_path / "atlas.json"+ state = "walk"+ source.write_text(json.dumps({+ "sprite_sheet_alpha": "atlas.png",+ "frame_layout": {"rows": {"walk": [+ {"x": index * 32, "y": 0, "w": 32, "h": 48} for index in range(2)]}},+ "animation": {"rows": {"walk": {"durations_ms": [70, 230], "loop": True}}},+ }))original = load_asset(source, state=state)fingerprints = original.fingerprints()out_dir = tmp_path / "shadows"@@ -243,10 +234,8 @@ def test_run_honors_fps_and_anchor_overrides(tmp_path):@pytest.mark.parametrize("kwargs", [- {"opacity": float("nan")}, {"squash": 0}, {"shear": float("inf")},- {"blur": -1}, {"color": (300, 0, 0)},- {"anchor_x": 12}, {"anchor_y": 32}, {"anchor_x": 0, "anchor_y": float("nan")},- {"fps": 0}, {"fps": -1}, {"fps": float("nan")}, {"fps": float("inf")},+ {"opacity": float("nan")}, {"anchor_x": 12},+ {"anchor_x": 0, "anchor_y": float("nan")}, {"fps": 0},])def test_invalid_cli_values_do_not_create_output(tmp_path, kwargs):source = tmp_path / "source.png"