Name the stream that is not a terminal, and the rerun after exit 2
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
- Track the authored configuration: `CLAUDE.md`, `AGENTS.md`, `settings.json`, `statusline.sh`, agents, skills and principles. Credentials, transcripts and memory files stay untracked.
|
||||
- `loop-claude <task>` runs a project's next chunk cycle after cycle, interrupting only for a decision that is yours or a release ready to cut.
|
||||
- `loop-claude` exits 1 when the judge fails three times running; a verdict missing a field or quoting nothing in the transcript is a failure.
|
||||
- `loop-claude` exits 2 saying which ended the interrupt: no terminal attached, or nothing typed.
|
||||
- `loop-claude` exits 2 when an interrupt gets no answer, saying why: stdin or stdout is not a terminal, or nothing was typed. Rerunning resumes the session.
|
||||
- `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; `WORKER_MODEL` and `JUDGE_MODEL` override it. This repo runs on Fable 5.1.
|
||||
- Reviewers share one protocol for verdicts, severities, rounds and declines: `agents/review-protocol.md`.
|
||||
|
||||
+5
-6
@@ -10,10 +10,10 @@ unfinished chunk resumes the same session next cycle; a finished one starts a fr
|
||||
continue until that interrupt or Ctrl-C.
|
||||
|
||||
Exit 1: no task, no premises, claude leaves no transcript, or the worker or the judge fails three
|
||||
times running, a verdict missing a field or quoting nothing in the transcript being a judge failure;
|
||||
rerunning resumes the session. Exit 2: the human is needed and no terminal is attached, or the
|
||||
interrupt ended without them typing anything. Before an interrupt every worktree is marked trusted in
|
||||
~/.claude.json.
|
||||
times running, a verdict missing a field or quoting nothing in the transcript being a judge failure.
|
||||
Exit 2: the human is needed and stdin or stdout is not a terminal, or the interrupt ended without
|
||||
them typing anything. Rerunning resumes the session after either. Before an interrupt every worktree
|
||||
is marked trusted in ~/.claude.json.
|
||||
|
||||
Each project has one session, "A ~/code/<path> auto-mode" (the absolute path outside ~/code),
|
||||
deleted when the chunk finishes. Its transcript is archived under $AUTO_MODE_TRANSCRIPTS (default
|
||||
@@ -134,7 +134,6 @@ def end_session(path):
|
||||
|
||||
|
||||
def session_open(session_id):
|
||||
"""The transcript outlives its cycle until end_session removes it: present means the chunk is unfinished."""
|
||||
return bool(session_file(session_id))
|
||||
|
||||
|
||||
@@ -311,7 +310,7 @@ def judge(task, premises, transcript):
|
||||
def interrupt(session_id, path, question):
|
||||
print(f"\n{question}", file=sys.stderr)
|
||||
if not (sys.stdin.isatty() and sys.stdout.isatty()):
|
||||
return "the human is needed and no terminal is attached"
|
||||
return "stdin or stdout is not a terminal"
|
||||
trust(checkouts())
|
||||
before = human_turns(entries(path))
|
||||
subprocess.run(["claude", "--permission-mode", "bypassPermissions", "--resume", str(session_id)])
|
||||
|
||||
@@ -145,7 +145,7 @@ class Interrupt(unittest.TestCase):
|
||||
transcript = os.path.join(root, "session.jsonl")
|
||||
open(transcript, "w").write("{}\n")
|
||||
with unittest.mock.patch("sys.stdin.isatty", return_value=False):
|
||||
self.assertEqual(loop.interrupt(SESSION_ID, transcript, "q?"), "the human is needed and no terminal is attached")
|
||||
self.assertEqual(loop.interrupt(SESSION_ID, transcript, "q?"), "stdin or stdout is not a terminal")
|
||||
with (
|
||||
unittest.mock.patch("sys.stdin.isatty", return_value=True),
|
||||
unittest.mock.patch("sys.stdout.isatty", return_value=True),
|
||||
@@ -218,7 +218,7 @@ class RunCycle(unittest.TestCase):
|
||||
self.assertEqual(stopped.exception.code, 2)
|
||||
said = "".join(str(call.args[0]) for call in stderr.write.call_args_list)
|
||||
self.assertIn("transcript:", said)
|
||||
self.assertIn("no terminal is attached", said)
|
||||
self.assertIn("not a terminal", said)
|
||||
for plan in ("fail fail fail", "unquoted unquoted unquoted"):
|
||||
open(verdicts, "w").write(plan)
|
||||
with self.assertRaises(SystemExit) as stopped:
|
||||
|
||||
@@ -11,4 +11,5 @@ Ordered by how many seats of the 2026-09-24 scoring panel (`docs/decisions.md`)
|
||||
- Pin every `CLAUDE.md` heading the agents and skills cite with a test that resolves each citation.
|
||||
- Define chunk, plan and release inside `JUDGE_RULES`; the judge reads nothing else.
|
||||
- Name the `set -u` empty-array idiom and the `@sh` eval in `statusline.sh`, one line each.
|
||||
- Make `CLAUDE.md`'s comment rules say an invariant earns a line only where the code cannot show it, state the one-line rule once, and scope the docstring exemption to what a tool consumes; today a reviewer finds two sentences saying keep and one saying delete.
|
||||
- Re-run the four-seat scoring panel and record the score in `docs/decisions.md`; the target is every dimension at 7.0 or above.
|
||||
|
||||
Reference in New Issue
Block a user