Sanitize hard pair scene continuity

This commit is contained in:
2026-06-27 15:36:57 +02:00
parent bb7df8ad77
commit d0f2670d9c
5 changed files with 61 additions and 5 deletions
+36
View File
@@ -4711,6 +4711,12 @@ def smoke_pair_options_policy() -> None:
"creator-shot" in pair_clothing.body_exposure_scene_text("outfit-check framing"),
"Pair clothing body exposure scene cleanup should replace outfit-check wording",
)
sanitized_closet_scene = pair_clothing.body_exposure_scene_text(
"full-length closet mirror with outfit racks, shoe shelves, and soft boutique lighting"
).lower()
_expect("outfit racks" not in sanitized_closet_scene, "Pair clothing body exposure scene cleanup should remove outfit racks")
_expect("shoe shelves" not in sanitized_closet_scene, "Pair clothing body exposure scene cleanup should remove shoe shelves")
_expect("mirror shelves" in sanitized_closet_scene, "Pair clothing body exposure scene cleanup should keep neutral mirror detail")
_expect(
pair_clothing.softcore_outfit_sentence("Man A", "wears hoodie and joggers")
== "Man A wears hoodie and joggers",
@@ -5012,6 +5018,19 @@ def smoke_pair_route_policy() -> None:
_expect(clothing_route.as_dict() == clothing_legacy, "Typed pair clothing route should match legacy dict route")
_expect(clothing_route.woman_access == "lower", "Typed pair clothing route lost lower-access detection")
_expect(clothing_route.requires_body_exposure_scene is True, "Typed pair clothing route lost exposure-scene flag")
partial_common = {**clothing_common, "mode": "partially_removed"}
partial_route = pair_clothing.resolve_hardcore_pair_clothing_result(**partial_common)
_expect(partial_route.requires_body_exposure_scene is True, "Partial lower-access clothing should request scene cleanup")
oral_common = {
**clothing_common,
"hard_row": {
"role_graph": "the woman takes the man's penis in her mouth",
"item": "standing oral test item",
},
"mode": "partially_removed",
}
oral_route = pair_clothing.resolve_hardcore_pair_clothing_result(**oral_common)
_expect(oral_route.requires_body_exposure_scene is True, "Man lower-access clothing should request scene cleanup")
def smoke_pair_builder_policy() -> None:
@@ -5138,6 +5157,12 @@ def smoke_insta_pair() -> None:
def smoke_krea_pair_clothing_state() -> None:
forced_location = pb.build_location_pool_json(
enabled=True,
combine_mode="replace",
preset="custom_only",
custom_locations="closet_scene: full-length closet mirror with outfit racks, shoe shelves, and soft boutique lighting",
)
pair = pb.build_insta_of_pair(
row_number=1,
start_index=1,
@@ -5151,6 +5176,7 @@ def smoke_krea_pair_clothing_state() -> None:
options_json=_insta_options(hardcore_clothing_continuity="partially_removed"),
character_cast=_character_cast(),
hardcore_position_config=_action_filter("penetration_only"),
location_config=forced_location,
)
_expect_pair(pair, "krea_pair_clothing_state")
typed_route = krea_pair_formatter.format_insta_pair_result(
@@ -5174,6 +5200,16 @@ def smoke_krea_pair_clothing_state() -> None:
_expect("softcore outfit" not in lower and "teaser outfit" not in lower, "Krea clothing route leaked softcore outfit label")
_expect("lower body is clear" in lower, "Krea clothing route lost generated clothing continuity")
_expect("the man keeps" in lower, "Krea clothing route lost partner clothing continuity")
_expect("outfit racks" not in lower and "shoe shelves" not in lower, "Krea pair formatter leaked unsanitized hard scene")
hard_scene = _clean_key(pair["hardcore_row"].get("scene_text"))
_expect("outfit racks" not in hard_scene and "shoe shelves" not in hard_scene, "Pair builder leaked outfit-check scene clutter into hardcore row")
_expect("mirror shelves" in hard_scene, "Pair builder lost neutralized scene anchor")
caption_text, _caption_method = caption_naturalizer.naturalize_caption("", metadata_json=_json(pair), target="hardcore")
caption_lower = caption_text.lower()
_expect("outfit racks" not in caption_lower and "shoe shelves" not in caption_lower, "Caption pair formatter leaked unsanitized hard scene")
sdxl = sdxl_formatter.format_sdxl_prompt("", metadata_json=_json(pair), target="hardcore")
sdxl_lower = sdxl.get("sdxl_prompt", "").lower()
_expect("outfit racks" not in sdxl_lower and "shoe shelves" not in sdxl_lower, "SDXL pair formatter leaked unsanitized hard scene")
def smoke_insta_pair_pov() -> None: