diff --git a/bin/loop_claude/claude_runs/interrupt.py b/bin/loop_claude/claude_runs/interrupt.py index cfff5fc9..dc6ea0d5 100644 --- a/bin/loop_claude/claude_runs/interrupt.py +++ b/bin/loop_claude/claude_runs/interrupt.py @@ -1,7 +1,7 @@ import subprocess import sys -from loop_claude import human +from loop_claude import human_needed from loop_claude.claude_code.transcript import human_turns, read from loop_claude.claude_code.trust import trust from loop_claude.outcome import Failure, Stop @@ -12,7 +12,7 @@ TO = "answer the question above" def interrupt(root, session_id, model, path, question, paths): print(f"\n{question}", file=sys.stderr) - if stop := human.off_terminal(TO): + if stop := human_needed.off_terminal(TO): return stop trust(paths.claude_json, checkouts(root)) entries = read(path) @@ -27,5 +27,5 @@ def interrupt(root, session_id, model, path, question, paths): if isinstance(entries, Failure): return Stop(1, f"could not tell whether you typed anything: {entries.reason}") if human_turns(entries) <= before: - return human.needed(TO, "the interrupt ended with nothing typed") + return human_needed.stop(TO, "the interrupt ended with nothing typed") return None diff --git a/bin/loop_claude/human.py b/bin/loop_claude/human_needed.py similarity index 64% rename from bin/loop_claude/human.py rename to bin/loop_claude/human_needed.py index 2d87aa2f..d976ed57 100644 --- a/bin/loop_claude/human.py +++ b/bin/loop_claude/human_needed.py @@ -3,11 +3,11 @@ import sys from loop_claude.outcome import Stop -def needed(to, but): +def stop(to, but): return Stop(2, f"the human is needed to {to}, but {but}") def off_terminal(to): if sys.stdin.isatty() and sys.stdout.isatty(): return None - return needed(to, "stdin or stdout is not a terminal; rerun loop-claude on a terminal") + return stop(to, "stdin or stdout is not a terminal; rerun loop-claude on a terminal") diff --git a/bin/loop_claude/project/models.py b/bin/loop_claude/project/models.py index 3a75272b..127c0392 100644 --- a/bin/loop_claude/project/models.py +++ b/bin/loop_claude/project/models.py @@ -2,7 +2,7 @@ import dataclasses import json import sys -from loop_claude import human +from loop_claude import human_needed from loop_claude.claude_code.formats import catalog from loop_claude.file_writes import replace_json from loop_claude.outcome import Stop @@ -58,7 +58,7 @@ def read_models(saved): def ask_model(name, saved, folder): - if stop := human.off_terminal(f"pick {name}'s model, or merge {{\"{name}\": \"\"}} into {saved}"): + if stop := human_needed.off_terminal(f"pick {name}'s model, or merge {{\"{name}\": \"\"}} into {saved}"): return stop offered = catalog(folder) print(f"\nThe model to run {name} on, saved in {saved}:", file=sys.stderr) @@ -71,7 +71,7 @@ def ask_model(name, saved, folder): answer = input(f"{'A number, or any' if offered else 'A'} name claude --model takes: ").strip() except EOFError: print(file=sys.stderr) - return human.needed(f"pick {name}'s model", "the input ended") + return human_needed.stop(f"pick {name}'s model", "the input ended") if not answer: continue if not (offered and answer.isdecimal()): diff --git a/todo.md b/todo.md index cf887786..b58af244 100644 --- a/todo.md +++ b/todo.md @@ -8,7 +8,6 @@ The rebuild lifts every dimension, one chunk per item, until the last item opens The places the panel on `rebuild` at 7f9de5c named (`docs/decisions.md`), capping dimension first: -- **Name `human.py` for the exit-2 stops it holds.** One seat looked there for the prompts, which live in `models.py` and `interrupt.py`. - **Score `rebuild` with the four-seat panel at 7.0 or above on every dimension and the overall, none below the last run, and open its PR into main for the human.** ⚠️ Leave that PR ready and unmerged: only the human merges it, after approving the whole rebuild. A dimension under the floor gets its places filed above this item. ## 0.2.0