Extract row route metadata policy
This commit is contained in:
@@ -57,6 +57,7 @@ import row_generation # noqa: E402
|
||||
import row_item # noqa: E402
|
||||
import row_location # noqa: E402
|
||||
import row_pools # noqa: E402
|
||||
import row_route_metadata # noqa: E402
|
||||
import server_routes # noqa: E402
|
||||
import sdxl_formatter # noqa: E402
|
||||
import sdxl_presets # noqa: E402
|
||||
@@ -1882,6 +1883,69 @@ def smoke_hardcore_position_config_policy() -> None:
|
||||
_expect(any("invalid formatter_hint" in error for error in invalid_errors), "Template metadata validation missed bad formatter hint value")
|
||||
|
||||
|
||||
def smoke_row_route_metadata_policy() -> None:
|
||||
template_metadata = {
|
||||
"action_family": "oral",
|
||||
"position_family": "oral",
|
||||
"position_keys": ["kneeling", "open_thighs"],
|
||||
}
|
||||
route = row_route_metadata.resolve_action_position_route(
|
||||
is_pose_category=True,
|
||||
subcategory={"slug": "oral_sex"},
|
||||
hardcore_position_config={},
|
||||
item_template_metadata=template_metadata,
|
||||
item_text="mouth contact in kneeling oral position",
|
||||
source_role_graph="the woman kneels in front of the man",
|
||||
source_composition="close kneeling oral composition",
|
||||
pose="kneeling pose",
|
||||
item_axis_values={"position": "kneeling oral position"},
|
||||
)
|
||||
_expect(route["action_family"] == "oral", "Route policy lost template action family")
|
||||
_expect(route["position_family"] == "oral", "Route policy lost template position family")
|
||||
_expect(route["position_key"] == "kneeling", "Route policy did not preserve first template position key")
|
||||
_expect(route["position_keys"] == ["kneeling", "open_thighs"], "Route policy changed template position-key precedence")
|
||||
|
||||
delegated = pb._action_position_route_metadata(
|
||||
is_pose_category=True,
|
||||
subcategory={"slug": "oral_sex"},
|
||||
hardcore_position_config={},
|
||||
item_template_metadata=template_metadata,
|
||||
item_text="mouth contact in kneeling oral position",
|
||||
source_role_graph="the woman kneels in front of the man",
|
||||
source_composition="close kneeling oral composition",
|
||||
pose="kneeling pose",
|
||||
item_axis_values={"position": "kneeling oral position"},
|
||||
)
|
||||
_expect(delegated == route, "Prompt builder route wrapper should delegate to row_route_metadata")
|
||||
|
||||
fallback = row_route_metadata.resolve_action_position_route(
|
||||
is_pose_category=True,
|
||||
subcategory={"slug": "manual_stimulation"},
|
||||
hardcore_position_config={},
|
||||
item_template_metadata={},
|
||||
item_text="manual stimulation while kneeling",
|
||||
source_role_graph="the woman kneels close and uses her hand",
|
||||
source_composition="kneeling manual composition",
|
||||
pose="kneeling pose",
|
||||
item_axis_values={"position": "kneeling manual position"},
|
||||
)
|
||||
_expect(fallback["position_family"] == "manual", "Route policy lost source position-family fallback")
|
||||
_expect(fallback["action_family"] == "foreplay", "Route policy lost source action-family fallback")
|
||||
_expect("kneeling" in fallback["position_keys"], "Route policy lost inferred position key")
|
||||
|
||||
empty = row_route_metadata.resolve_action_position_route(
|
||||
is_pose_category=False,
|
||||
subcategory={"slug": "casual_clothes"},
|
||||
hardcore_position_config={},
|
||||
item_template_metadata=template_metadata,
|
||||
item_text="casual outfit",
|
||||
source_role_graph="",
|
||||
source_composition="",
|
||||
pose="standing pose",
|
||||
)
|
||||
_expect(empty == row_route_metadata.empty_action_position_route(), "Non-pose route should return empty route metadata")
|
||||
|
||||
|
||||
def smoke_category_library_route() -> None:
|
||||
categories = category_library.load_category_library()
|
||||
_expect(len(categories) >= 3, "category library should load JSON categories")
|
||||
@@ -4138,6 +4202,7 @@ SMOKE_CASES: list[tuple[str, Callable[[], None]]] = [
|
||||
("caption_policy", smoke_caption_policy),
|
||||
("sdxl_presets_policy", smoke_sdxl_presets_policy),
|
||||
("hardcore_position_config_policy", smoke_hardcore_position_config_policy),
|
||||
("row_route_metadata_policy", smoke_row_route_metadata_policy),
|
||||
("category_library_route", smoke_category_library_route),
|
||||
("hardcore_category_routes", smoke_hardcore_category_routes),
|
||||
("krea_close_foreplay_route", smoke_krea_close_foreplay_route),
|
||||
|
||||
Reference in New Issue
Block a user