Tighten tagged ref routing and anchor presets

This commit is contained in:
2026-08-28 15:45:22 +00:00
parent ddd7dbb5af
commit e29d01ad24
4 changed files with 56 additions and 19 deletions
+29
View File
@@ -407,6 +407,22 @@ class DumasH3LongVideosHelperTests(unittest.TestCase):
)
self.assertEqual(dropped, [])
def test_resolve_prompt_refs_where_tagged_mode_stays_tag_only(self):
refs = [
{"kind": "character", "image": "img1", "name": "Mara"},
{"kind": "location", "image": "img2", "name": "Hangar"},
]
text, references, dropped = self.module.resolve_prompt_refs(
"Mara waits in the hangar near <Picture 2>.",
refs,
include_named=False,
)
self.assertEqual(text, "Mara waits in the hangar near <Picture 1>.")
self.assertEqual([self.module._reference_image(ref) for ref in references], ["img2"])
self.assertEqual(dropped, [])
def test_shot_references_uses_all_connected_sparse_slots(self):
refs = [
None,
@@ -522,6 +538,19 @@ class DumasH3LongVideosHelperTests(unittest.TestCase):
self.assertIn("Location context for Hangar: wet concrete floor.", context)
self.assertIn("Location notes for Hangar: cold industrial lighting.", context)
def test_reference_context_skips_ambiguous_name_matches(self):
refs = [
{"kind": "character", "image": "img1", "name": "Alex", "description": "short dark hair"},
{"kind": "character", "image": "img2", "name": "Alex", "description": "tall blond hair"},
]
context = self.module._reference_context_for_text(
"[Generation 1] Alex enters the room.",
refs,
)
self.assertEqual(context, "")
def test_run_uses_legacy_ref_image_inputs_when_new_slots_are_empty(self):
calls = {}
original_parse_resolution = self.module.parse_resolution