Make EasyCom event review wearer anchor first

This commit is contained in:
Xin Wang
2026-09-14 23:30:31 +08:00
parent 06b5e6c385
commit 65347dd75d
12 changed files with 336 additions and 107 deletions

View File

@@ -32,8 +32,8 @@ class EOTINTAdjudicationTests(unittest.TestCase):
self.assertIn("Yes.", prompt)
def test_system_prompt_treats_laughter_as_nonlexical_floor_feedback(self) -> None:
self.assertEqual(PROMPT_VERSION, "easycom-wearer-centric-eot-int-prelabel-v6")
self.assertIn("two immutable anchors", SYSTEM_PROMPT)
self.assertEqual(PROMPT_VERSION, "easycom-wearer-anchor-first-eot-int-prelabel-v7")
self.assertIn("opportunity_options", SYSTEM_PROMPT)
self.assertIn("t_w < t_o < t_y", SYSTEM_PROMPT)
self.assertIn("a transcription consisting of [L] denotes laughter-only vocalization", SYSTEM_PROMPT)
self.assertIn("EOT_WEARER_BACKCHANNEL", SYSTEM_PROMPT)
@@ -72,6 +72,23 @@ class EOTINTAdjudicationTests(unittest.TestCase):
decision = validate_decisions(payload, ["u1"])[0]
self.assertTrue(decision["needs_human_review"])
def test_eot_positive_must_select_one_supplied_release(self) -> None:
item = {
"uid": "u1", "verdict": "POSITIVE", "event_type": "EOT_RESPONSE",
"subtype": None, "selected_opportunity_uid": "release-2",
"confidence": 0.9, "reason": "The wearer answers the second release.",
}
decision = validate_decisions(
{"items": [item]}, ["u1"], {"u1": {"release-1", "release-2"}}
)[0]
self.assertEqual(decision["selected_opportunity_uid"], "release-2")
with self.assertRaisesRegex(ValueError, "select a supplied opportunity"):
validate_decisions(
{"items": [{**item, "selected_opportunity_uid": "invented"}]},
["u1"],
{"u1": {"release-1", "release-2"}},
)
def test_markdown_escaped_uid_is_normalized_but_still_unique(self) -> None:
item = {
"uid": "Session\\_4/wearer\\_onset/00000024",