Define chunk, plan and release in the judge rules

This commit is contained in:
2026-09-25 00:39:25 +02:00
parent 6be3efece2
commit 0fd8872f64
5 changed files with 11 additions and 2 deletions
+2
View File
@@ -49,6 +49,8 @@ RELOAD_FAILURES = "LOOP_CLAUDE_FAILURES"
SESSION_NAMESPACE = uuid.UUID("64fb586b-d926-4bb3-a44c-c903e86d3eec")
JUDGE_RULES = (
"Words: chunk: the unit of work: the smallest PR-able change. plan: `todo.md`. release: a semver version "
"the human cuts.\n"
"Decide whether the human must now be interrupted. ask=true when any of these appear:\n"
"- the agent asks the human anything, seeks approval, or says a decision is the human's\n"
"- it carried on under an assumption that decides the deliverable and that the human could "
+7
View File
@@ -3,6 +3,7 @@ import importlib.util
import json
import os
import pathlib
import re
import stat
import tempfile
import unittest
@@ -91,6 +92,12 @@ class WorkerArgs(unittest.TestCase):
class JudgePrompt(unittest.TestCase):
def test_defines_chunk_plan_and_release_as_claude_md_does(self):
vocabulary = pathlib.Path(__file__).resolve().parents[1] / "CLAUDE.md"
definitions = dict(re.findall(r"^- \*\*(\w+)\*\* — (.+)$", vocabulary.read_text(), re.MULTILINE))
for word in ("chunk", "plan", "release"):
self.assertIn(f"{word}: {definitions[word]}", loop.JUDGE_RULES)
def test_hands_the_judge_the_tail_of_a_long_transcript(self):
prompt = loop.judge_prompt("task", "## Goals\n1. g", "early " * 20000 + "LATE")
self.assertIn("LATE", prompt)