Answer product-owner round 1: 0 🔴, 3 🟡 (0 misread); hold a seat launched as another agent to its rung
This commit is contained in:
@@ -16,8 +16,9 @@ from claude_code.entries import UserText
|
||||
|
||||
# The pass each agent under agents/ reviews.
|
||||
PASS_OF = {agent: kind for kind, agent in REVIEWERS.items()}
|
||||
# The agent under agents/ that every comprehension seat runs as: skills/comprehension-panel/SKILL.md → "The scoring run".
|
||||
# The agent under agents/ that every comprehension seat runs as, and the opening of every seat's prompt, which also marks a seat launched as another agent: skills/larv-review/SKILL.md → "Comprehension check", skills/comprehension-panel/seat-prompts.md → "Opening".
|
||||
SEAT_AGENT = "comprehension-seat"
|
||||
SEAT = "You are one seat of a comprehension panel."
|
||||
# The opening of the security pass's prompt: skills/larv-review/SKILL.md → "Security".
|
||||
SECURITY_OPENER = "You are the security pass for this chunk."
|
||||
SUBJECTS: dict[ReviewKind, str] = {"seat": "a comprehension seat", "security": "the security pass's subagent"}
|
||||
@@ -79,9 +80,10 @@ def review_kind(given: dict[str, typing.Any]) -> ReviewKind | None:
|
||||
"""What a launch reviews, a reviewer's pass, a comprehension seat or the security pass; None for any other subagent."""
|
||||
if pass_reviewed := PASS_OF.get(text(given, "subagent_type")):
|
||||
return pass_reviewed
|
||||
if text(given, "subagent_type") == SEAT_AGENT:
|
||||
opening = text(given, "prompt").lstrip()
|
||||
if text(given, "subagent_type") == SEAT_AGENT or opening.startswith(SEAT):
|
||||
return "seat"
|
||||
if text(given, "prompt").lstrip().startswith(SECURITY_OPENER):
|
||||
if opening.startswith(SECURITY_OPENER):
|
||||
return "security"
|
||||
return None
|
||||
|
||||
|
||||
@@ -324,12 +324,15 @@ class ReviewerRung(unittest.TestCase):
|
||||
self.assertEqual(self.refused({"prompt": "You are the security pass for this chunk. Invoke /security-review over the branch diff.", "model": "sonnet", "effort": "high"}), ["reviewer-rung"])
|
||||
self.assertEqual(self.refused({"prompt": "You are the security pass for this chunk. Run /claude-security scan this branch's changes at high.", "model": "opus", "effort": "medium"}), [])
|
||||
|
||||
def test_a_seat_launched_as_another_agent_is_held_to_the_project_rung_by_its_opening_sentence(self):
|
||||
self.assertEqual(self.refused({"prompt": "You are one seat of a comprehension panel.", "model": "sonnet", "effort": "high"}), ["reviewer-rung"])
|
||||
|
||||
def test_a_seat_named_below_the_project_rung_is_refused(self):
|
||||
self.assertEqual(self.refused({"subagent_type": "comprehension-seat", "prompt": "Score the project.", "model": "sonnet", "effort": "high"}), ["reviewer-rung"])
|
||||
|
||||
def test_any_other_subagent_keeps_its_own_routing(self):
|
||||
self.assertEqual(self.refused({"subagent_type": "Explore", "model": "haiku", "effort": "low", "prompt": "Find the callers of run_worker."}), [])
|
||||
self.assertEqual(self.refused({"prompt": "You are one seat of a comprehension panel.", "model": "haiku", "effort": "low"}), [], "the seat's opening sentence without its agent is no launch")
|
||||
self.assertEqual(self.refused({"subagent_type": "Explore", "model": "haiku", "effort": "low", "prompt": "Quote: 'You are one seat of a comprehension panel.' Then stop."}), [], "a quote midway is no launch")
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user