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:
+7
-6
@@ -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:
|
||||
|
||||
@@ -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": ""})]):
|
||||
|
||||
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user