Name human_needed.py for the exit-2 stops it holds
This commit was merged in pull request #126.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
@@ -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}\": \"<model>\"}} into {saved}"):
|
||||
if stop := human_needed.off_terminal(f"pick {name}'s model, or merge {{\"{name}\": \"<model>\"}} 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()):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user