Name the reload exit for what it checks, gate --help only on a typed task, drop the outlived todo caveat

This commit is contained in:
2026-09-26 13:39:09 +02:00
parent a64461f2c1
commit 805eb868db
3 changed files with 9 additions and 11 deletions
+7 -6
View File
@@ -10,9 +10,10 @@ interrupt: `claude --resume` on the terminal, every worktree first marked truste
An unfinished chunk resumes the same session next cycle; a finished one starts a fresh session.
Cycles continue until that interrupt or Ctrl-C. Words: ~/.claude/CLAUDE.md → "Vocabulary".
Exit 1: no task, not inside a checkout, no premises, claude leaves no transcript, a reload handing
over no task, or the worker or the judge fails three times running. A worker fails when claude exits non-zero, is killed, or ends
without a result event; a judge when its verdict misses a field or quotes nothing in the transcript.
Exit 1: no task, not inside a checkout, no premises, claude leaves no transcript, a reload whose
state it cannot read, or the worker or the judge fails three times running. A worker fails when
claude exits non-zero, is killed, or ends without a result event; a judge when its verdict misses a
field or quotes nothing in the transcript.
Exit 2: the human is needed and stdin or stdout is not a terminal, or the interrupt ended without
them typing anything. Rerunning resumes any open session.
@@ -390,10 +391,10 @@ def main():
state = reloaded_state(argv[1:])
else:
state = {"cycle_number": 0, "failures": 0, "root": "", "task": " ".join(argv)}
if state["task"] in ("", "-h", "--help"):
print(__doc__.strip())
sys.exit(0 if state["task"] else 1)
task = state["task"]
if task in ("", "-h", "--help"):
print(__doc__.strip())
sys.exit(0 if task else 1)
root = state["root"] or checkout_root()
cycle_number, failures = state["cycle_number"], state["failures"]
while True:
+1 -4
View File
@@ -348,13 +348,10 @@ class Reload(unittest.TestCase):
environment = dict(os.environ)
with unittest.mock.patch.object(loop, "__file__", script), unittest.mock.patch("os.execv") as execv:
loop.reload_if_edited("/r", "do it", cycle_number=1, failures=2)
execv.assert_called_once_with(sys.executable, [sys.executable, script, loop.RELOAD_FLAG, STATE])
execv.assert_called_once_with(sys.executable, [sys.executable, script, loop.RELOAD_FLAG, json.dumps({"cycle_number": 1, "failures": 2, "root": "/r", "task": "do it"})])
self.assertEqual(dict(os.environ), environment)
STATE = json.dumps({"cycle_number": 1, "failures": 2, "root": "/r", "task": "do it"})
class Main(unittest.TestCase):
def test_exits_naming_the_reload_when_it_hands_over_anything_but_the_state_with_a_task(self):
for handed in (["3", "2", "/r", "do it"], ["3"], ["[1]"], [json.dumps({"cycle_number": 3, "failures": 0, "root": "/r"})], [json.dumps({"cycle_number": 3, "failures": 0, "root": "/r", "task": ""})]):
+1 -1
View File
@@ -2,7 +2,7 @@
## 0.1.0
Bar the reload item, ordered by how many seats of the 2026-09-25 scoring panel (`docs/decisions.md`) named the place; each is one chunk.
Ordered by how many seats of the 2026-09-25 scoring panel (`docs/decisions.md`) named the place; each is one chunk.
- Name `end_session` for what it does, today it deletes the session's transcript files.
- Define looping reviewer and round cap under `CLAUDE.md` → "Vocabulary", today inline at `agents/review-protocol.md`.