Add typed action route metadata

This commit is contained in:
2026-06-27 10:27:25 +02:00
parent 2b221463ee
commit 6abd17b165
5 changed files with 126 additions and 24 deletions
+29
View File
@@ -2445,6 +2445,19 @@ def smoke_row_route_metadata_policy() -> None:
_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")
route_result = row_route_metadata.resolve_action_position_route_result(
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_result.as_dict() == route, "Typed action/position route should match legacy dict route")
_expect(route_result.position_key == "kneeling", "Typed action/position route lost first position key")
delegated = pb._action_position_route_metadata(
is_pose_category=True,
@@ -2458,6 +2471,18 @@ def smoke_row_route_metadata_policy() -> None:
item_axis_values={"position": "kneeling oral position"},
)
_expect(delegated == route, "Prompt builder route wrapper should delegate to row_route_metadata")
typed_delegated = pb._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(typed_delegated == route_result, "Prompt builder typed route wrapper should delegate to row_route_metadata")
fallback = row_route_metadata.resolve_action_position_route(
is_pose_category=True,
@@ -2485,6 +2510,10 @@ def smoke_row_route_metadata_policy() -> None:
pose="standing pose",
)
_expect(empty == row_route_metadata.empty_action_position_route(), "Non-pose route should return empty route metadata")
_expect(
row_route_metadata.empty_action_position_route_result().as_dict() == empty,
"Typed empty action/position route should match legacy dict route",
)
def smoke_category_library_route() -> None: