Say the reload cannot read the loop's state in one wording across the message, --help and the changelog

This commit was merged in pull request #56.
This commit is contained in:
2026-09-26 13:42:32 +02:00
parent 805eb868db
commit 99dd74c55b
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
- `loop-claude` archives each session's transcript under `~/.claude/loop-claude-transcripts/`, one folder per project; `LOOP_CLAUDE_TRANSCRIPTS` overrides the root.
- `loop-claude` runs at the checkout root wherever inside the checkout it is started.
- `loop-claude` says why when it cannot read `~/.claude.json` before an interrupt, and the interrupt then lands in Claude Code's trust dialog.
- `loop-claude` takes an edit to itself at the next cycle boundary once the edited file answers `--help`, and exits 1 naming the reload when the edited file cannot read the running loop's state.
- `loop-claude` takes an edit to itself at the next cycle boundary once the edited file answers `--help`, and exits 1 when the edited file cannot read the running loop's state.
- `loop-claude --help` names the Claude Code version its transcript, session and trust handling were observed on; check it first when an upgrade breaks a cycle.
- `loop-claude` runs the model each project's settings pick; `LOOP_CLAUDE_WORKER_MODEL` and `LOOP_CLAUDE_JUDGE_MODEL` override it.
- `settings.json`, the agents and the status line run on any machine unedited; the status line shows reset times in the machine's own time zone.
+5 -5
View File
@@ -10,10 +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 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 1: no task, not inside a checkout, no premises, claude leaves no transcript, a reload with
unreadable state, 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.
@@ -381,7 +381,7 @@ def reload_if_edited(root, task, cycle_number, failures):
def reloaded_state(handed):
state = parse(handed[0]) if len(handed) == 1 else None
if not state or {"cycle_number", "failures", "root"} - state.keys() or not isinstance(state.get("task"), str) or not state["task"]:
sys.exit(f"the reload handed {handed}, not the loop's state with a task; rerun loop-claude <task>")
sys.exit(f"the reload cannot read the loop's state from {handed}; rerun loop-claude <task>")
return state
+1 -1
View File
@@ -357,7 +357,7 @@ class Main(unittest.TestCase):
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": ""})]):
with self.subTest(handed=handed), unittest.mock.patch.object(sys, "argv", ["loop-claude", loop.RELOAD_FLAG, *handed]), self.assertRaises(SystemExit) as stopped:
loop.main()
self.assertEqual(stopped.exception.code, f"the reload handed {handed}, not the loop's state with a task; rerun loop-claude <task>")
self.assertEqual(stopped.exception.code, f"the reload cannot read the loop's state from {handed}; rerun loop-claude <task>")
def test_resumes_the_root_and_counters_a_reload_handed_over(self):
patches = [unittest.mock.patch.object(loop, name) for name in ("checkout_root", "read_premises", "reload_if_edited", "run_cycle")]