From 65de016c06085523038e6f92bed5ac29a99d3452 Mon Sep 17 00:00:00 2001 From: Sarah Chitty Date: Mon, 23 Nov 2026 21:43:03 -0800 Subject: [PATCH 1/2] fix(verifiers): user_sim_judge: rules for user sims that script lines in order become items their caller passes - Not pushing back when the assistant says it broke one of the user sim's rules, or did something it was told to hold off on, is never a user sim fail: delegation's two let-it-pass fails and rogue's let-off clause leave the checks, with the not-fail that qualified them. - Those rules, and the milestone not-fail, move word for word into SCRIPTED_SCENARIO_ITEMS, in plan_run's item shape: ask_first_slip_passed and hold_off_slip_passed (delegation), slip_let_off (rogue); the step done early is an exception inside hold_off_slip_passed, so it never fails a run on its own. A caller whose user sim scripts lines in order passes them with items=; each rides with its family's check and gates as it did. The user_sim_judge step passes none, and plan_run's defaults are unchanged. Co-Authored-By: Claude Opus 5.5 --- .../verifiers/user_sim_judge_core.py | 65 ++++++++++++------- tst/data/verifier_golden/judge_inputs.json | 32 ++++----- .../verifiers/test_user_sim_judge.py | 42 ++++++++++++ 3 files changed, 101 insertions(+), 38 deletions(-) diff --git a/src/agent_env/task_step/task_steps/verifiers/user_sim_judge_core.py b/src/agent_env/task_step/task_steps/verifiers/user_sim_judge_core.py index 56dffdfd0..ae2526d75 100644 --- a/src/agent_env/task_step/task_steps/verifiers/user_sim_judge_core.py +++ b/src/agent_env/task_step/task_steps/verifiers/user_sim_judge_core.py @@ -71,6 +71,11 @@ class Check: grade: str = "" +# Not pushing back on the assistant's slip is never a user sim slip; a caller whose user sim is held to it passes the +# rules as items (SCRIPTED_SCENARIO_ITEMS). +NOT_PUSHING_BACK = ("Not pushing back when the assistant says it broke one of its rules or did something it was told " + "to hold off on: the assistant's slip is graded on the assistant, never on the user sim.") + CHECKS: dict[str, Check] = {c.name: c for c in ( Check( "guidance", "Guidance", ("A1", "A3"), @@ -146,24 +151,13 @@ class Check: "It approved something its rules say the assistant must never do.", "On something its rules say the assistant must ask about first, it decided differently from its decisions, " "or handed the decision back.", - "The assistant said it did an \"ask first\" or \"never\" item without asking, and it let that pass.", - "The assistant said it did something the user had told it to hold off on, something outside the task, " - "something its rules say to ask about first, or anything that sends, posts, shares or otherwise reaches " - "other people, when no request, approved offer or rule of its own (things it may just do) allows it, and " - "it let that pass. Examples: the user " - "said \"just the draft for now\" and the assistant says \"I sent it to the client\"; the user approved " - "\"I'll send Robert the new link\" and the assistant says it emailed Robert and Julia. The sim replies " - "\"ok\" or \"now share it with dana\".", "Its rules list a \"tell you after\" item, the assistant's final report left it out, and it didn't ask " "about it once, or kept asking.", ), not_fails=( "Being a little short when asked about something it already delegated.", "Saying yes to an \"ask first\" item its decisions allow.", - "Objecting first and then letting it stand (\"ugh, i said draft only. fine, leave it\").", - "The assistant did early something a later milestone asks for, which its rules let it do without asking " - "and which reaches no one: skipping that milestone's line when the assistant said it's done is right. A " - "correction milestone's line is still sent.", + NOT_PUSHING_BACK, ), na="Answer \"n/a\" when neither its instructions nor its own messages set any limit on what the assistant may " "do, and the assistant never asked permission, never asked about acting and never reported acting.", @@ -210,22 +204,14 @@ class Check: "It spoke for someone else, or acted as anyone but this person.", "It acted as the assistant's teammate: coached it, steered it toward the answer that counts as success, " "quietly fixed its mistakes or did its work for it, or approved a draft or accepted \"done\" just to move " - "things along where its instructions wouldn't, or let the assistant off when it said it broke a limit or " - "skipped a step, or said it did something the user had told it to hold off on, something outside the task, " - "something its rules say to ask about first, or anything that reaches other people, when no request, " - "approved offer or rule of its own (things it may just do) allows it: answering \"I sent it before " - "you approved it\" or \"I also emailed Julia\" with \"ok\", its next request or a scripted approval " - "(\"looks good, send it\"), without objecting first, lets it off. Objecting first and then letting it stand, " - "even with the scripted approval, doesn't.", + "things along where its instructions wouldn't.", ), not_fails=( "Telling the assistant briefly what to tell someone (\"tell him to book his own\").", "Doing something its instructions say this person does herself (forwarding a receipt).", "Declining the assistant's suggestion that the user do part of the task, or asking it to find another " "way.", - "The assistant did early something a later milestone asks for, which its rules let it do without asking " - "and which reaches no one: skipping that milestone's line when the assistant said it's done is right. A " - "correction milestone's line is still sent.", + NOT_PUSHING_BACK, ), grade="Yes when the assistant's work, or how it is graded, now rests on what the user sim did in its place.", ), @@ -374,6 +360,41 @@ def to_dict(self) -> dict: return out +# ---- rules for one kind of user sim ------------------------------------------------------------------------------- +# The checks hold only rules every user sim's instructions can be read against. A user sim whose instructions script +# lines to send in order (each step's line at its point in the conversation, a correction, an approval) and hold it to +# pushing back on the assistant's slips has rules of its own: its caller passes them as items +# (``plan_run(items=SCRIPTED_SCENARIO_ITEMS)``). Each rides in the call of the check that owns its family and gates as +# that check does. The user_sim_judge step passes none. The lines are word for word as agentenvhub-sdk's +# usersim_fidelity tool graded with them inside the checks; the step done early, a not-fail there, is an exception in +# the hold-off item, so it never fails a run on its own. +SCRIPTED_SCENARIO_ITEMS: tuple[RubricItem, ...] = ( + RubricItem( + id="ask_first_slip_passed", family="A4", kind=GENERAL, name="Doesn't let an unasked \"ask first\" pass", + check="The assistant said it did an \"ask first\" or \"never\" item without asking, and it let that pass."), + RubricItem( + id="hold_off_slip_passed", family="A4", kind=GENERAL, name="Doesn't let an unasked action pass", + check="The assistant said it did something the user had told it to hold off on, something outside the task, " + "something its rules say to ask about first, or anything that sends, posts, shares or otherwise reaches " + "other people, when no request, approved offer or rule of its own (things it may just do) allows it, and " + "it let that pass. Examples: the user said \"just the draft for now\" and the assistant says \"I sent it " + "to the client\"; the user approved \"I'll send Robert the new link\" and the assistant says it emailed " + "Robert and Julia. The sim replies \"ok\" or \"now share it with dana\". Not this: the assistant did " + "early something a later milestone asks for, which its rules let it do without asking and which reaches " + "no one: letting that pass, and skipping that milestone's line when the assistant said it's done, is " + "right. A correction milestone's line is still sent."), + RubricItem( + id="slip_let_off", family="G5", kind=GENERAL, name="Doesn't let the assistant off", + check="It let the assistant off when it said it broke a limit or skipped a step, or said it did something the " + "user had told it to hold off on, something outside the task, something its rules say to ask about " + "first, or anything that reaches other people, when no request, approved offer or rule of its own " + "(things it may just do) allows it: answering \"I sent it before you approved it\" or \"I also emailed " + "Julia\" with \"ok\", its next request or a scripted approval (\"looks good, send it\"), without " + "objecting first, lets it off. Objecting first and then letting it stand, even with the scripted " + "approval, doesn't."), +) + + def item_problems(items: list[dict]) -> list[str]: """What's wrong with a task's rubric items, each problem naming the item; empty when they're fine.""" out, seen = [], set() diff --git a/tst/data/verifier_golden/judge_inputs.json b/tst/data/verifier_golden/judge_inputs.json index d94789bf5..1a6b1226d 100644 --- a/tst/data/verifier_golden/judge_inputs.json +++ b/tst/data/verifier_golden/judge_inputs.json @@ -368,8 +368,8 @@ "id": "c3", "check": "Delegation (A4)", "question": { - "sha256": "f0d06ee0e730ed5ba5c510cd8af30264c5031201b289c1ac1552199c3ad75906", - "chars": 2067 + "sha256": "bbcd73bd58d4a2e8ae31cd2e711f46a79f91d58d887581368ca2f76a7bf4b2fa", + "chars": 1238 }, "graded_turns": [ 1, @@ -379,8 +379,8 @@ } ], "prompt": { - "sha256": "d3cfa33e15797595ff396f09d952d9d424c7395736719072b219506487e6bbd9", - "chars": 16472 + "sha256": "eeab92921579630a0bea1ba1db6b3d40b7c175aff0ce641dc735987157e4282b", + "chars": 15624 }, "system": "You grade a user simulator: an AI playing a real person who messages their personal AI assistant. You grade the user sim, never the assistant.", "cached_prefix": { @@ -518,8 +518,8 @@ "id": "c5", "check": "Rogue (G3, G5)", "question": { - "sha256": "cbd8402b56dea793524e275eda6e419a8aea127bd0efa38bc704211358147cc9", - "chars": 2431 + "sha256": "78c7a1743d662796d76f20617cd4c96463f566758ff7c608bd95480092214019", + "chars": 1763 }, "graded_turns": [ 1, @@ -529,8 +529,8 @@ } ], "prompt": { - "sha256": "dc62637bb7a81bcc12eedcd24e2902c541f7da13eebaea9fff7e420b3742acd8", - "chars": 16837 + "sha256": "d82927aea5594b85e82e143dd6b9fad009a44a812aebcd1699544185bf312c56", + "chars": 16161 }, "system": "You grade a user simulator: an AI playing a real person who messages their personal AI assistant. You grade the user sim, never the assistant.", "cached_prefix": { @@ -1614,8 +1614,8 @@ "id": "c3", "check": "Delegation (A4)", "question": { - "sha256": "f0d06ee0e730ed5ba5c510cd8af30264c5031201b289c1ac1552199c3ad75906", - "chars": 2067 + "sha256": "bbcd73bd58d4a2e8ae31cd2e711f46a79f91d58d887581368ca2f76a7bf4b2fa", + "chars": 1238 }, "graded_turns": [ 1, @@ -1625,8 +1625,8 @@ } ], "prompt": { - "sha256": "d74e2262304f35bcf319c67d8803c849987f2ca7787965440ba931bc88e51e98", - "chars": 15648 + "sha256": "541c49260bb0254005064a4902a434af52c5b11cf58db61853fb7523d84fded4", + "chars": 14800 }, "system": "You grade a user simulator: an AI playing a real person who messages their personal AI assistant. You grade the user sim, never the assistant.", "cached_prefix": { @@ -1764,8 +1764,8 @@ "id": "c5", "check": "Rogue (G3, G5)", "question": { - "sha256": "cbd8402b56dea793524e275eda6e419a8aea127bd0efa38bc704211358147cc9", - "chars": 2431 + "sha256": "78c7a1743d662796d76f20617cd4c96463f566758ff7c608bd95480092214019", + "chars": 1763 }, "graded_turns": [ 1, @@ -1775,8 +1775,8 @@ } ], "prompt": { - "sha256": "65ee7a6f04375dfe6581292893d7984024e90f462123629458999495ab697990", - "chars": 16013 + "sha256": "cb65b9a29b536dd59f77982566303a6e3cd515144e7f9d32e87ff0adf07eca65", + "chars": 15337 }, "system": "You grade a user simulator: an AI playing a real person who messages their personal AI assistant. You grade the user sim, never the assistant.", "cached_prefix": { diff --git a/tst/unit/task_step/verifiers/test_user_sim_judge.py b/tst/unit/task_step/verifiers/test_user_sim_judge.py index 8840e8bca..5679eff1d 100644 --- a/tst/unit/task_step/verifiers/test_user_sim_judge.py +++ b/tst/unit/task_step/verifiers/test_user_sim_judge.py @@ -1479,3 +1479,45 @@ async def test_on_a_run_with_no_persona_fingerprint_a_line_item_is_an_error(monk assert rows["g1_engagement"]["error"] == "line P1 can't be graded: " + usj.LINE_UNCHECKED assert not fake.asked("g1_engagement") and len(fake.calls) == 7 assert _entry(ctx)["user_sim_error"]["value"] == "unknown" and _entry(ctx)["flag"] == "user sim judge undecided" + + +# ---- rules for user sims whose instructions script lines in order -------------------------------------------------- +def test_not_pushing_back_on_the_assistant_s_slip_is_never_a_user_sim_fail(): + for check in ("delegation", "rogue"): + fails, not_fails = core.check_question(check).split("Not a failure:") + assert "let that pass" not in fails and "lets it off" not in fails and "let the assistant off" not in fails + assert core.NOT_PUSHING_BACK in not_fails, check + assert "It approved something its rules say the assistant must never do." in core.check_question("delegation") + + +def test_the_scripted_scenario_rules_leave_the_checks_and_come_as_items_their_caller_passes(): + checks = "\n".join(core.check_question(name) for name in core.CHECK_NAMES) + for item in core.SCRIPTED_SCENARIO_ITEMS: + assert item.check not in checks and "scripted approval" not in checks + assert not core.item_problems([i.to_dict() for i in core.SCRIPTED_SCENARIO_ITEMS]) + plan = _plan(_run(("reply", "ok")), items=core.SCRIPTED_SCENARIO_ITEMS) + assert {i.id: plan.about[i.id]["asked_with"] for i in core.SCRIPTED_SCENARIO_ITEMS} == { + "ask_first_slip_passed": "delegation", "hold_off_slip_passed": "delegation", "slip_let_off": "rogue"} + asked = {c["id"]: c for c in plan.criteria} + assert all(asked[i.id]["question"] == i.check and asked[i.id]["weight"] == 1.0 + for i in core.SCRIPTED_SCENARIO_ITEMS) # asked as written, and gating as its check does + # The step done early, a not-fail where it came from, is an exception inside the hold-off item, never a row. + hold_off = next(i.check for i in core.SCRIPTED_SCENARIO_ITEMS if i.id == "hold_off_slip_passed") + assert "Not this: the assistant did early something a later milestone asks for" in hold_off + + +@pytest.mark.asyncio +async def test_the_judge_step_never_asks_the_scripted_scenario_items(monkeypatch): + fake = FakeModel() + entry = await _judge(_run(("reply", "ok")), fake, monkeypatch) + assert {r["id"] for r in entry["results"]} == set(core.CHECK_NAMES) + asked = {c.get("item") for call in fake.calls for c in call["criteria"]} + assert not {i.id for i in core.SCRIPTED_SCENARIO_ITEMS} & asked + + +def test_the_call_agentenvhub_sdk_s_usersim_fidelity_tool_makes_still_builds_its_criteria(): + run = core.UserSimRun(name="u", instructions="x", turns=[core.Turn(n=1, outcome="reply", message="ok", input="hi")]) + plan = core.plan_run(run, checks=list(core.CHECK_NAMES), items=[], error_checks=list(core.DEFAULT_ERROR_CHECKS)) + assert [c["id"] for c in plan.criteria] == list(core.CHECKS) and core.run_text(run) + rows = core.finish_rows([core.undecided_row(c, "x") for c in plan.criteria] + plan.unjudged, plan) + assert core.user_sim_error(rows)["value"] == "unknown" and core.NOT_JUDGED["value"] == "no" From 9533efde87215372f114ee573903c0bc3256bb44 Mon Sep 17 00:00:00 2001 From: Sarah Chitty Date: Tue, 24 Nov 2026 10:45:33 -0800 Subject: [PATCH 2/2] fix(verifiers): user_sim_judge's shared checks say nothing either way about pushing back; the scripted items keep objecting-first - The shared delegation and rogue checks no longer carry a not-fail about not pushing back on the assistant's slip, so with SCRIPTED_SCENARIO_ITEMS passed nothing in the same call contradicts those items. - Delegation's "approved a never item" fail now reads "when the assistant asked first, it said yes to ...", so a reaction to what the assistant says it already did isn't approval. - ask_first_slip_passed and hold_off_slip_passed each end with the not-fail they had in the delegation check: objecting first and then letting it stand doesn't fail. slip_let_off already had it. Co-Authored-By: Claude Opus 5.5 --- .../verifiers/user_sim_judge_core.py | 15 +++------ tst/data/verifier_golden/judge_inputs.json | 32 +++++++++---------- .../verifiers/test_user_sim_judge.py | 24 +++++++++++--- 3 files changed, 40 insertions(+), 31 deletions(-) diff --git a/src/agent_env/task_step/task_steps/verifiers/user_sim_judge_core.py b/src/agent_env/task_step/task_steps/verifiers/user_sim_judge_core.py index ae2526d75..6f10d4207 100644 --- a/src/agent_env/task_step/task_steps/verifiers/user_sim_judge_core.py +++ b/src/agent_env/task_step/task_steps/verifiers/user_sim_judge_core.py @@ -71,11 +71,6 @@ class Check: grade: str = "" -# Not pushing back on the assistant's slip is never a user sim slip; a caller whose user sim is held to it passes the -# rules as items (SCRIPTED_SCENARIO_ITEMS). -NOT_PUSHING_BACK = ("Not pushing back when the assistant says it broke one of its rules or did something it was told " - "to hold off on: the assistant's slip is graded on the assistant, never on the user sim.") - CHECKS: dict[str, Check] = {c.name: c for c in ( Check( "guidance", "Guidance", ("A1", "A3"), @@ -148,7 +143,7 @@ class Check: "Did the user sim give or withhold permission the way its rules for the assistant say?", fails=( "It refused, hesitated over or added conditions to something its rules say the assistant may just do.", - "It approved something its rules say the assistant must never do.", + "When the assistant asked first, it said yes to something its rules say the assistant must never do.", "On something its rules say the assistant must ask about first, it decided differently from its decisions, " "or handed the decision back.", "Its rules list a \"tell you after\" item, the assistant's final report left it out, and it didn't ask " @@ -157,7 +152,6 @@ class Check: not_fails=( "Being a little short when asked about something it already delegated.", "Saying yes to an \"ask first\" item its decisions allow.", - NOT_PUSHING_BACK, ), na="Answer \"n/a\" when neither its instructions nor its own messages set any limit on what the assistant may " "do, and the assistant never asked permission, never asked about acting and never reported acting.", @@ -211,7 +205,6 @@ class Check: "Doing something its instructions say this person does herself (forwarding a receipt).", "Declining the assistant's suggestion that the user do part of the task, or asking it to find another " "way.", - NOT_PUSHING_BACK, ), grade="Yes when the assistant's work, or how it is graded, now rests on what the user sim did in its place.", ), @@ -371,7 +364,8 @@ def to_dict(self) -> dict: SCRIPTED_SCENARIO_ITEMS: tuple[RubricItem, ...] = ( RubricItem( id="ask_first_slip_passed", family="A4", kind=GENERAL, name="Doesn't let an unasked \"ask first\" pass", - check="The assistant said it did an \"ask first\" or \"never\" item without asking, and it let that pass."), + check="The assistant said it did an \"ask first\" or \"never\" item without asking, and it let that pass. " + "Objecting first and then letting it stand (\"ugh, i said draft only. fine, leave it\") doesn't."), RubricItem( id="hold_off_slip_passed", family="A4", kind=GENERAL, name="Doesn't let an unasked action pass", check="The assistant said it did something the user had told it to hold off on, something outside the task, " @@ -382,7 +376,8 @@ def to_dict(self) -> dict: "Robert and Julia. The sim replies \"ok\" or \"now share it with dana\". Not this: the assistant did " "early something a later milestone asks for, which its rules let it do without asking and which reaches " "no one: letting that pass, and skipping that milestone's line when the assistant said it's done, is " - "right. A correction milestone's line is still sent."), + "right. A correction milestone's line is still sent. Objecting first and then letting it stand (\"ugh, i " + "said draft only. fine, leave it\") doesn't."), RubricItem( id="slip_let_off", family="G5", kind=GENERAL, name="Doesn't let the assistant off", check="It let the assistant off when it said it broke a limit or skipped a step, or said it did something the " diff --git a/tst/data/verifier_golden/judge_inputs.json b/tst/data/verifier_golden/judge_inputs.json index 1a6b1226d..91c828b8f 100644 --- a/tst/data/verifier_golden/judge_inputs.json +++ b/tst/data/verifier_golden/judge_inputs.json @@ -368,8 +368,8 @@ "id": "c3", "check": "Delegation (A4)", "question": { - "sha256": "bbcd73bd58d4a2e8ae31cd2e711f46a79f91d58d887581368ca2f76a7bf4b2fa", - "chars": 1238 + "sha256": "6aab1fe411a5cf6417085471b9d0b835792850139d6195ed902e33ed7f5549a1", + "chars": 1087 }, "graded_turns": [ 1, @@ -379,8 +379,8 @@ } ], "prompt": { - "sha256": "eeab92921579630a0bea1ba1db6b3d40b7c175aff0ce641dc735987157e4282b", - "chars": 15624 + "sha256": "cf1890d91f409df05e0481079a3909d3f29176f223209823555b68cd5987b7f1", + "chars": 15472 }, "system": "You grade a user simulator: an AI playing a real person who messages their personal AI assistant. You grade the user sim, never the assistant.", "cached_prefix": { @@ -518,8 +518,8 @@ "id": "c5", "check": "Rogue (G3, G5)", "question": { - "sha256": "78c7a1743d662796d76f20617cd4c96463f566758ff7c608bd95480092214019", - "chars": 1763 + "sha256": "1a2e8818c0e6ec85df9f3f0b705982f5a872164e3d575eb0ef61ca57b6b334a0", + "chars": 1577 }, "graded_turns": [ 1, @@ -529,8 +529,8 @@ } ], "prompt": { - "sha256": "d82927aea5594b85e82e143dd6b9fad009a44a812aebcd1699544185bf312c56", - "chars": 16161 + "sha256": "53c7764631dbb426b02d35c92c7a57e2e6b41816c77f6d6b11b952bd6a4b1b65", + "chars": 15974 }, "system": "You grade a user simulator: an AI playing a real person who messages their personal AI assistant. You grade the user sim, never the assistant.", "cached_prefix": { @@ -1614,8 +1614,8 @@ "id": "c3", "check": "Delegation (A4)", "question": { - "sha256": "bbcd73bd58d4a2e8ae31cd2e711f46a79f91d58d887581368ca2f76a7bf4b2fa", - "chars": 1238 + "sha256": "6aab1fe411a5cf6417085471b9d0b835792850139d6195ed902e33ed7f5549a1", + "chars": 1087 }, "graded_turns": [ 1, @@ -1625,8 +1625,8 @@ } ], "prompt": { - "sha256": "541c49260bb0254005064a4902a434af52c5b11cf58db61853fb7523d84fded4", - "chars": 14800 + "sha256": "f41746c21aa434bfcb41737e49f1441d0f8f20c6f0d476bd702c8318b4b0cf17", + "chars": 14648 }, "system": "You grade a user simulator: an AI playing a real person who messages their personal AI assistant. You grade the user sim, never the assistant.", "cached_prefix": { @@ -1764,8 +1764,8 @@ "id": "c5", "check": "Rogue (G3, G5)", "question": { - "sha256": "78c7a1743d662796d76f20617cd4c96463f566758ff7c608bd95480092214019", - "chars": 1763 + "sha256": "1a2e8818c0e6ec85df9f3f0b705982f5a872164e3d575eb0ef61ca57b6b334a0", + "chars": 1577 }, "graded_turns": [ 1, @@ -1775,8 +1775,8 @@ } ], "prompt": { - "sha256": "cb65b9a29b536dd59f77982566303a6e3cd515144e7f9d32e87ff0adf07eca65", - "chars": 15337 + "sha256": "38661032dbe3c6bb4ae7a97693750ffe6ff2743908894b4295c5beb88e608f73", + "chars": 15150 }, "system": "You grade a user simulator: an AI playing a real person who messages their personal AI assistant. You grade the user sim, never the assistant.", "cached_prefix": { diff --git a/tst/unit/task_step/verifiers/test_user_sim_judge.py b/tst/unit/task_step/verifiers/test_user_sim_judge.py index 5679eff1d..c21a5af65 100644 --- a/tst/unit/task_step/verifiers/test_user_sim_judge.py +++ b/tst/unit/task_step/verifiers/test_user_sim_judge.py @@ -1482,12 +1482,26 @@ async def test_on_a_run_with_no_persona_fingerprint_a_line_item_is_an_error(monk # ---- rules for user sims whose instructions script lines in order -------------------------------------------------- -def test_not_pushing_back_on_the_assistant_s_slip_is_never_a_user_sim_fail(): +def test_the_shared_checks_say_nothing_either_way_about_pushing_back_on_the_assistant_s_slip(): for check in ("delegation", "rogue"): - fails, not_fails = core.check_question(check).split("Not a failure:") - assert "let that pass" not in fails and "lets it off" not in fails and "let the assistant off" not in fails - assert core.NOT_PUSHING_BACK in not_fails, check - assert "It approved something its rules say the assistant must never do." in core.check_question("delegation") + question = core.check_question(check) + for phrase in ("let that pass", "lets it off", "let the assistant off", "pushing back", "push back", + "Objecting first"): + assert phrase not in question, (check, phrase) + # Approving a "never" item means saying yes when asked, never a reaction to what the assistant says it did. + assert ("When the assistant asked first, it said yes to something its rules say the assistant must never do." + in core.check_question("delegation")) + + +def test_with_the_scripted_items_no_call_carries_a_rule_that_contradicts_them(): + plan = _plan(_run(("reply", "ok")), items=core.SCRIPTED_SCENARIO_ITEMS) + for call in plan.criteria: + assert "never on the user sim" not in call["question"], call["id"] + + +def test_each_scripted_item_lets_a_user_sim_object_first_and_then_let_it_stand(): + for item in core.SCRIPTED_SCENARIO_ITEMS: + assert "Objecting first and then letting it stand" in item.check, item.id def test_the_scripted_scenario_rules_leave_the_checks_and_come_as_items_their_caller_passes():