Answer stability round 1: 0 🔴, 3 🟡; match the opener at the start of a prompt, always hand the project's rung, and say what the rung spelling carries
This commit is contained in:
@@ -34,13 +34,13 @@ class Rung:
|
||||
return Rung(model, effort)
|
||||
return Rung(family.model, effort) if effort else family
|
||||
|
||||
# The one spelling of a rung; parse reads it back.
|
||||
# The one spelling of a rung. The archive and the worker's environment store it, and parse reads it back, so a change re-routes archived chunks.
|
||||
def __str__(self) -> str:
|
||||
return f"{self.model} at {self.effort} effort" if self.effort else self.model
|
||||
|
||||
@staticmethod
|
||||
def parse(text: str) -> "Rung | None":
|
||||
"""The rung str wrote, whether or not it is on the ladder; None for any other text, such as a model run without an effort."""
|
||||
"""The rung that names an effort, which str wrote, whether or not it is on the ladder; None for any other text, such as a bare model."""
|
||||
found = WORDING.fullmatch(text)
|
||||
return Rung(found["model"], found["effort"]) if found else None
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ class Environment(unittest.TestCase):
|
||||
def test_the_project_and_the_worker_rung_are_named_in_the_environment(self):
|
||||
self.assertEqual(environment(self.PROJECT, self.WORKER), {"LOOP_CLAUDE_PROJECT_RUNG": "claude-opus-5-5 at medium effort", "LOOP_CLAUDE_WORKER_RUNG": "claude-haiku-5-5 at max effort"})
|
||||
|
||||
def test_a_project_off_the_ladder_leaves_its_rung_unset(self):
|
||||
self.assertEqual(environment(None, self.WORKER), {"LOOP_CLAUDE_WORKER_RUNG": "claude-haiku-5-5 at max effort"})
|
||||
def test_a_project_off_the_ladder_is_handed_an_empty_rung_so_none_is_inherited(self):
|
||||
self.assertEqual(environment(None, self.WORKER), {"LOOP_CLAUDE_PROJECT_RUNG": "", "LOOP_CLAUDE_WORKER_RUNG": "claude-haiku-5-5 at max effort"})
|
||||
|
||||
def test_handed_reads_back_what_environment_named(self):
|
||||
self.assertEqual(handed(environment(self.PROJECT, self.WORKER)), (self.PROJECT, self.WORKER))
|
||||
|
||||
@@ -10,8 +10,8 @@ WORKER_RUNG = "LOOP_CLAUDE_WORKER_RUNG"
|
||||
|
||||
|
||||
def environment(project: Rung | None, worker: Rung) -> dict[str, str]:
|
||||
"""The variables a worker's claude starts with; a project off the ladder has no rung to hand."""
|
||||
return ({PROJECT_RUNG: str(project)} if project else {}) | {WORKER_RUNG: str(worker)}
|
||||
"""The variables a worker's claude starts with. A project off the ladder gets an empty rung, so none is inherited from the environment."""
|
||||
return {PROJECT_RUNG: str(project) if project else "", WORKER_RUNG: str(worker)}
|
||||
|
||||
|
||||
def handed(environ: typing.Mapping[str, str]) -> tuple[Rung | None, Rung | None]:
|
||||
|
||||
@@ -34,10 +34,10 @@ def review_kind(given: dict[str, typing.Any]) -> ReviewKind | None:
|
||||
"""What a launch reviews, a reviewer, a comprehension seat or the security pass; None for any other subagent."""
|
||||
if text(given, "subagent_type") in REVIEWERS:
|
||||
return "reviewer"
|
||||
prompt = text(given, "prompt")
|
||||
if SEAT in prompt:
|
||||
opening = text(given, "prompt").lstrip()
|
||||
if opening.startswith(SEAT):
|
||||
return "seat"
|
||||
if SECURITY_OPENER in prompt:
|
||||
if opening.startswith(SECURITY_OPENER):
|
||||
return "security"
|
||||
return None
|
||||
|
||||
|
||||
@@ -217,6 +217,7 @@ class ReviewerRung(unittest.TestCase):
|
||||
self.assertEqual(self.refused({"subagent_type": "Explore", "model": "haiku", "effort": "low", "prompt": "Find the callers of run_worker."}), [])
|
||||
self.assertEqual(self.refused({"prompt": "Note that security-review runs in CI.", "model": "haiku", "effort": "low"}), [])
|
||||
self.assertEqual(self.refused({"prompt": "Find where /security-review is named.", "model": "haiku", "effort": "low"}), [], "a mention without the opening sentence is no launch")
|
||||
self.assertEqual(self.refused({"prompt": "Quote the rule: 'You are the security pass for this chunk.' Then stop.", "model": "haiku", "effort": "low"}), [], "a quote midway is no launch")
|
||||
|
||||
def test_a_claude_loop_claude_did_not_start_is_not_checked(self):
|
||||
self.assertEqual(self.refused({"subagent_type": "stability-reviewer", "model": "haiku", "effort": "low"}, {}), [])
|
||||
|
||||
Reference in New Issue
Block a user