Inherit hardcore template metadata

This commit is contained in:
2026-06-27 14:56:08 +02:00
parent 29e5e65e5f
commit a8d69083cd
7 changed files with 244 additions and 6 deletions
+11 -2
View File
@@ -309,6 +309,7 @@ def compose_item(
) -> tuple[str, str, dict[str, str], dict[str, Any]]:
templates = category_policy.template_list(category, subcategory, item, "item_templates")
axes = category_policy.merged_axes(category, subcategory, item)
inherited_metadata = template_policy.inherited_template_metadata(category, subcategory, item)
if templates and axes:
template_entry = weighted_choice(rng, category_policy.compatible_entries(templates, women_count, men_count))
template = entry_text(template_entry)
@@ -339,5 +340,13 @@ def compose_item(
axis_values[name] = entry_text(weighted_choice(rng, values))
item_prompt = _format(template, axis_values).strip()
name = item_name(item) or subcategory["name"]
return item_prompt, name, axis_values, template_policy.template_metadata(template_entry)
return item_text(item), item_name(item), {}, template_policy.template_metadata(item)
return (
item_prompt,
name,
axis_values,
template_policy.merge_template_metadata(inherited_metadata, template_policy.template_metadata(template_entry)),
)
return item_text(item), item_name(item), {}, template_policy.merge_template_metadata(
inherited_metadata,
template_policy.template_metadata(item),
)