Show the judge the transcript's tail whatever the size of the records, test the forge timeout and decide the merge stop from the pull requests found #651

Merged
lilleman merged 14 commits from item-463 into main 2026-11-20 01:57:18 +01:00
12 changed files with 90 additions and 57 deletions
+1
View File
@@ -2,6 +2,7 @@
## Unreleased
- `loop-claude`'s judge stops, naming how much to cut the records by, rather than judge a prompt that leaves it less than the transcript's last 50,000 characters. A file the project's config names for two records is read once.
- Under `merge = "human"`, `loop-claude` and `chunk-preflight` pass over an item whose ready pull request awaits a person's merge, and `loop-claude` stops, naming those pull requests, once every item left awaits one.
- do-epic reads two new settings from a project's config: `jira-unblocking-statuses` names the statuses at which an issue unblocks the issues it blocks, and `jira-automation-moves-issues` leaves the move out of "In Progress" to the team's own automation.
- The prose standard asks that a sentence about several named things holds for each of them.
+12 -4
View File
@@ -20,6 +20,8 @@ from claude_code.tokens import tokens_of
# At 3 to 4 characters a token, 100,000 to 133,000 tokens, which leaves a 200,000-token context room for the reply; the largest session rendered here was 364,000 characters on 2026-10-03.
JUDGE_PROMPT_CHARS = 400000
# The judge reads the transcript's last 50,000 characters at least, about 15,000 tokens, or all of a shorter one. Where the rest of its prompt leaves less room, the judge doesn't run, since a cut record could hide the rule that makes it interrupt.
TRANSCRIPT_FLOOR = 50000
INTERRUPT_RULES = (
"""Decide whether the human must now be interrupted. ~/.claude/CLAUDE.md → "Working loop", "Ask, don't guess" says """
"which choices are reserved for the human. interrupt=true when any of these appear:\n"
@@ -186,7 +188,10 @@ def judge(root: str, brief: Brief, rung: Rung, effects: Effects, keep: typing.Ca
def judge_once(root: str, brief: Brief, rung: Rung, effects: Effects) -> Verdict | Failure | Limited:
"""One judge run on the brief, as judge retries it; judge-replay replays it."""
prompt, grounds = judge_prompt(brief)
built = judge_prompt(brief)
if isinstance(built, Failure):
return built
prompt, grounds = built
verdict = run_judge(root, judge_args(rung, brief.driver), prompt, grounds, effects)
return verdict if isinstance(verdict, Failure | Limited) else escalation_mark.stamped(verdict, len(brief.entries))
@@ -292,8 +297,8 @@ def answer_checked(verdict: Verdict, quotable: str) -> Verdict:
return verdict
def judge_prompt(brief: Brief) -> tuple[str, Grounds]:
"""The prompt, and what the judge's quotes are checked against."""
def judge_prompt(brief: Brief) -> tuple[str, Grounds] | Failure:
"""The prompt, and what the judge's quotes are checked against; a Failure where the premises, the records, the task and the rules leave room for less than the transcript's last TRANSCRIPT_FLOOR characters, or all of a shorter transcript."""
head = (
f"From the goals file, {brief.premises}\n\n"
f"The records: {brief.records_named}:\n{brief.records or 'none'}\n\n"
@@ -301,8 +306,11 @@ def judge_prompt(brief: Brief) -> tuple[str, Grounds]:
f"{transcript_heading(brief.driver)}"
)
rules = judge_rules(brief.answer_destinations, brief.driver)
room = max(0, JUDGE_PROMPT_CHARS - len(head) - len(rules) - 2)
room = JUDGE_PROMPT_CHARS - len(head) - len(rules) - 2
transcript = escalation_mark.transcript(brief.entries, brief.escalated_at, typed_answer, brief.driver)
needed = min(len(transcript), TRANSCRIPT_FLOOR)
if room < needed:
return Failure(f"the premises, the records, the task and the judge's rules leave {max(0, room):,} of the judge's {JUDGE_PROMPT_CHARS:,} characters for the transcript, less than the last {needed:,} characters of it that the judge must read. Cut the records, which take {len(brief.records):,}, by at least {needed - room:,}.")
# The tail, where an interrupt or a finish lands; the session's transcript grows cycle over cycle.
shown = transcript[max(0, len(transcript) - room):]
grounds = Grounds(
+37 -2
View File
@@ -135,9 +135,9 @@ class Verdict(unittest.TestCase):
class JudgePrompt(unittest.TestCase):
def brief(self, entries, escalated_at, answer_destinations="the plan or a comment"):
def brief(self, entries, escalated_at, answer_destinations="the plan or a comment", records=""):
"""What the judge of a-driver reads of a transcript holding entries."""
return judge.Brief("Do it.", "## Goals", "", "the project's decisions", answer_destinations, kinds(*entries), escalated_at, "a-driver")
return judge.Brief("Do it.", "## Goals", records, "the project's decisions", answer_destinations, kinds(*entries), escalated_at, "a-driver")
def test_shows_the_transcripts_tail_and_returns_what_it_showed(self):
entries = [assistant({"type": "text", "text": "old " + "x" * judge.JUDGE_PROMPT_CHARS}), assistant({"type": "text", "text": "new"})]
@@ -149,6 +149,41 @@ class JudgePrompt(unittest.TestCase):
self.assertEqual(grounds.after_mark, "old " + "x" * judge.JUDGE_PROMPT_CHARS + "\n\nnew")
self.assertEqual(grounds.quotable, "## Goals\n\n")
# A transcript longer than the floor: an old message, then the last one.
LONG = [assistant({"type": "text", "text": "old " + "x" * judge.TRANSCRIPT_FLOOR}), assistant({"type": "text", "text": "Merged."})]
def overhead(self):
"""The characters of the judge's prompt that are neither the records nor the transcript."""
prompt, grounds = judge.judge_prompt(self.brief(self.LONG, 0, records="r"))
return len(prompt) - len(grounds.shown) - 1
def test_fails_naming_the_shortfall_where_the_records_leave_less_than_the_transcripts_floor(self):
failed = judge.judge_prompt(self.brief(self.LONG, 0, records="r" * (judge.JUDGE_PROMPT_CHARS + 1)))
self.assertIsInstance(failed, Failure)
for fact in ("leave 0 of the judge's 400,000", "400,001", f"{judge.TRANSCRIPT_FLOOR:,}", f"by at least {judge.TRANSCRIPT_FLOOR + self.overhead() + 1:,}"):
with self.subTest(fact=fact):
self.assertIn(fact, failed.reason)
def test_judge_once_returns_that_failure_without_starting_claude(self):
failed = judge.judge_once("/r", self.brief(self.LONG, 0, records="r" * judge.JUDGE_PROMPT_CHARS), Rung("judge-model"), FakeEffects(claude=[]).effects())
self.assertIsInstance(failed, Failure)
self.assertIn(f"{judge.TRANSCRIPT_FLOOR:,}", failed.reason)
def test_shows_the_whole_of_a_transcript_longer_than_the_floor_where_the_records_leave_room_for_it(self):
whole = "old " + "x" * judge.TRANSCRIPT_FLOOR + "\n\nMerged."
prompt, grounds = judge.judge_prompt(self.brief(self.LONG, 0, records="r" * (judge.JUDGE_PROMPT_CHARS - self.overhead() - len(whole))))
self.assertEqual(grounds.shown, whole)
self.assertLessEqual(len(prompt), judge.JUDGE_PROMPT_CHARS)
def test_shows_the_floor_where_the_records_leave_exactly_that(self):
at_floor = judge.JUDGE_PROMPT_CHARS - self.overhead() - judge.TRANSCRIPT_FLOOR
self.assertEqual(len(judge.judge_prompt(self.brief(self.LONG, 0, records="r" * at_floor))[1].shown), judge.TRANSCRIPT_FLOOR)
self.assertIsInstance(judge.judge_prompt(self.brief(self.LONG, 0, records="r" * (at_floor + 1))), Failure)
def test_shows_a_transcript_shorter_than_the_floor_whole(self):
_, grounds = judge.judge_prompt(self.brief([assistant({"type": "text", "text": "Merged."})], 0, records="r" * (judge.JUDGE_PROMPT_CHARS - 10000)))
self.assertEqual(grounds.shown, "Merged.")
def test_the_judge_prompt_and_schema_call_the_worker_the_worker(self):
prompt, _ = judge.judge_prompt(self.brief([assistant({"type": "text", "text": "done"})], 1))
self.assertNotRegex(prompt + json.dumps(judge.judge_schema("a-driver")), r"\b[Aa]gent")
+5 -4
View File
@@ -22,7 +22,7 @@ CONSEQUENCE = "the judge cannot read the records"
def read_records(root: str | None, home: pathlib.Path, claude_dir: pathlib.Path, first: tuple[tuple[str, str], ...] = ()) -> str | Failure:
"""The project's `AGENTS.md` and decision log, then the human's rules, CLAUDE.md first, each headed by its name; one that does not exist, or is empty, is left out.
"""The project's `AGENTS.md` and decision log, then the human's rules, CLAUDE.md first, each headed by its name. One that does not exist, or is empty, is left out. A text that several of them hold appears once, headed by all their names.
`AGENTS.md` is read where the config under home of root's project puts it, and the decision log from the store that config names. Each is headed by its name in RECORD_FILES wherever it is kept.
@@ -37,13 +37,14 @@ def read_records(root: str | None, home: pathlib.Path, claude_dir: pathlib.Path,
decisions = store(config, DECISIONS[1]).read()
texts += [(WORKING_RULES[0], file_text(config.paths[WORKING_RULES[1]])), (DECISIONS[0], Failure(f"{decisions.reason} - {CONSEQUENCE}.") if isinstance(decisions, Failure) else decisions)]
texts += [(named(rule, home, claude_dir), file_text(rule)) for rule in rules]
records = []
# Each text, with the names of the records that hold it: a config may keep the working rules in the decision log.
records: dict[str, list[str]] = {}
for heading, text in texts:
if isinstance(text, Failure):
return text
if text.strip():
records.append(f"From {heading}:\n{text.strip()}")
return "\n\n".join(records)
records.setdefault(text.strip(), []).append(heading)
return "\n\n".join(f"From {' and '.join(headings)}:\n{text}" for text, headings in records.items())
def file_text(path: pathlib.Path) -> str | Failure:
+4
View File
@@ -40,6 +40,10 @@ class Records(unittest.TestCase):
pathlib.Path(root, "standards", "quality.md").write_text("# Elsewhere\n")
self.assertTrue(records.read_records(root, claude_md.parents[1], claude_md.parent).endswith(f"From {root}/standards/quality.md:\n# Elsewhere"), "a folder outside home is named in full")
config.write_text(config.read_text().replace('"checkout:AGENTS.md"', '"checkout:docs/decisions.md"'))
self.assertTrue(records.read_records(root, claude_md.parents[1], claude_md.parent).startswith("From AGENTS.md and docs/decisions.md:\n# Decisions\n\nFrom ~/.claude/CLAUDE.md:\n# Global"), "a file the config names for two records appears once")
config.write_text(config.read_text().replace('"checkout:docs/decisions.md"', '"checkout:AGENTS.md"', 1))
config.write_text(config.read_text().replace('"checkout:AGENTS.md"', '"folder:AGENTS.md"').replace('"checkout:docs/decisions.md"', '"folder:log/decisions.md"'))
self.assertTrue(records.read_records(root, claude_md.parents[1], claude_md.parent).startswith("From ~/.claude/CLAUDE.md:\n# Global"), "the checkout's AGENTS.md and docs/decisions.md are its owners'")
pathlib.Path(config.parent, "log").mkdir()
+1
View File
@@ -101,6 +101,7 @@ class JudgeFailures(unittest.TestCase):
("run_judge", "verdict.reason", field),
("run_judge", "checked.reason", "quotes a passage that neither the task nor the transcript holds"),
("misquoted_evidence", "f'the judge quoted {verdict.evidence!r}, which is not in the task or the transcript", "quotes a passage that neither the task nor the transcript holds"),
("judge_prompt", "f\"the premises, the records, the task and the judge's rules leave", f"leave room for less than the last {judge.TRANSCRIPT_FLOOR:,} characters of the transcript, or all of a shorter one"),
("claude_reply", "f'could not start claude:", started),
("claude_reply", "proc.stderr.strip() or f'{who} exited", exited),
("claude_reply", 'f"{who} printed no json reply', unparsed),
+6 -4
View File
@@ -186,10 +186,12 @@ Exit 1, saying why, when:
handover
- the worker or the judge fails three times running, retried a minute apart within the cycle. A
worker fails when claude cannot start, exits non-zero, is killed, or ends without a result event;
a judge when claude cannot start, exits non-zero or prints no json reply, or its reply misses or
mistypes a field, interrupts or quotes an answer without a question, or quotes a passage that
neither the task nor the transcript holds, where each fragment of an elided quote must appear in
order, in the task then the transcript.
a judge when the premises, the records, the task and the judge's rules leave room for less than
the last 50,000 characters of the transcript, or all of a shorter one, when claude cannot start,
exits non-zero or prints no json reply, or when its reply misses or mistypes a field, interrupts
or quotes an answer without a question, or quotes a passage that neither the task nor the
transcript holds, where each fragment of an elided quote must appear in order, in the task then
the transcript.
A usage limit is not a failure, and restarts the count of three: the worker or the judge is
retried 2 minutes after the limit resets, or every 10 minutes when the reset time is unknown or
more than 2 minutes past. The judge's reply gives its reset time only as text, so the judge is
+3 -3
View File
@@ -114,10 +114,10 @@ class StreamingClaude:
return self.proc.wait()
def system_effects(home: pathlib.Path, env: typing.Mapping[str, str], backends: typing.Mapping[Notifier, Backend[typing.Any]] = BACKENDS) -> Effects:
def system_effects(home: pathlib.Path, env: typing.Mapping[str, str], backends: typing.Mapping[Notifier, Backend[typing.Any]] = BACKENDS, forge_timeout: float = FORGE_TIMEOUT) -> Effects:
"""The effects on this machine: the configs of its DM are under home, and tmux runs in env.
A test hands in `backends`, the notifiers loop-claude's DM can go through, that send nowhere.
A test hands in `backends` that don't send anything, in place of the notifiers loop-claude's DM goes through. It hands in a short `forge_timeout`, so a command that outlasts it ends quickly.
"""
return Effects(
claude=lambda args, cwd, stdin: subprocess.run(["claude", *args], capture_output=True, cwd=cwd, input=stdin, text=True),
@@ -125,7 +125,7 @@ def system_effects(home: pathlib.Path, env: typing.Mapping[str, str], backends:
discard_typed=lambda: termios.tcflush(sys.stdin, termios.TCIFLUSH),
dm=lambda text, directory: notify(text, directory, home, backends),
execv=os.execv,
forge=lambda cwd: runner(cwd, FORGE_TIMEOUT),
forge=lambda cwd: runner(cwd, forge_timeout),
git=git_repo.git,
input=input,
local_time=lambda seconds: time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(seconds)),
+5
View File
@@ -14,6 +14,7 @@ import unittest
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from loop_effects import child_shells
from failure import Failure
from loop_effects.effects import run_python, say, start_timer, StreamingClaude, system_effects
NOW = 1790000000
@@ -104,6 +105,10 @@ class ForgeEffect(unittest.TestCase):
with tempfile.TemporaryDirectory() as folder:
self.assertEqual(system_effects(pathlib.Path.home(), os.environ).forge(folder)(["pwd", "-P"]), os.path.realpath(folder) + "\n")
def test_stops_a_command_of_the_forges_cli_that_outlasts_its_timeout(self):
with tempfile.TemporaryDirectory() as folder:
self.assertEqual(system_effects(pathlib.Path.home(), os.environ, forge_timeout=0.1).forge(folder)(["sleep", "5"]), Failure("sleep 5: stopped after 0.1 s"))
class TmuxEffect(unittest.TestCase):
"""Each test runs a fake tmux off its own PATH, without $TMUX, so the human's tmux server is never reached."""
+12 -7
View File
@@ -84,8 +84,8 @@ def planned(read: Plan | Failure, cut: LastCut, default: str, branch: str, outsi
return NoItem(f"{where} holds no item for {upcoming}, and no change is unreleased, so that release is to be planned first.")
first = pick.item
if first is None and pick.release is not None:
merges = awaited_merges(weighed.carried, pick.release)
return NoItem(f"every item of release {version(pick.release)} in {where} waits.{merges}", awaits_merge=bool(merges))
pulls = awaited_merges(weighed.carried, pick.release)
return NoItem(f"every item of release {version(pick.release)} in {where} waits.{merge_stop(pulls)}", awaits_merge=bool(pulls))
if first is None:
return NoItem(f"{where}'s items table holds no item.")
held = weighed.carried
@@ -100,13 +100,18 @@ def planned(read: Plan | Failure, cut: LastCut, default: str, branch: str, outsi
return NextChunk(held, first, f"{first.tagline}\n\n{first.detail}".strip(), branch, over, item_id is not None)
def awaited_merges(found: list[Item], release: Release) -> str:
"""The sentences that stop the working loop where items of release await a person's merge, naming each pull request with the items it finishes; empty where none does."""
pulls: dict[str, list[str]] = {}
def awaited_merges(found: list[Item], release: Release) -> dict[str, list[int]]:
"""Each pull request, as `#<number> <URL>`, that finishes items of release and awaits a person's merge, with those items' IDs."""
pulls: dict[str, list[int]] = {}
for item in found:
if item.release == release and item.awaits_merge:
pulls.setdefault(item.awaits_merge, []).append(str(item.id))
pulls.setdefault(item.awaits_merge, []).append(item.id)
return pulls
def merge_stop(pulls: dict[str, list[int]]) -> str:
"""The sentences that stop the working loop, naming each of pulls, the pull requests that await a person's merge, with the items it finishes; empty where pulls is empty."""
if not pulls:
return ""
named = "; ".join(f"{pull}, which finishes item{'s' if len(ids) > 1 else ''} {listed(ids, 'and')}" for pull, ids in pulls.items())
named = "; ".join(f"{pull}, which finishes item{'s' if len(ids) > 1 else ''} {listed([str(item_id) for item_id in ids], 'and')}" for pull, ids in pulls.items())
return f" Under `merge = \"human\"`, these pull requests await a person's merge: {named}. The working loop stops here. Once a person has merged one, or turned one back into a draft, run loop-claude again."
@@ -475,4 +475,6 @@ class AwaitingMerge(unittest.TestCase):
none = next_chunk.planned(Plan(items), held.cut, "main", "item-{id}")
self.assertEqual(none.why, "every item of release 0.1.0 in main's todo.md waits. Under `merge = \"human\"`, these pull requests await a person's merge: #7 https://github.com/o/r/pull/7, which finishes item 1; #8 https://github.com/o/r/pull/8, which finishes items 2 and 3. The working loop stops here. Once a person has merged one, or turned one back into a draft, run loop-claude again.")
self.assertTrue(none.awaits_merge)
later = dataclasses.replace(items[0], id=9, release=(0, 2, 0), awaits_merge="#10 https://github.com/o/r/pull/10")
self.assertEqual(next_chunk.awaited_merges([*items, later], (0, 1, 0)), {"#7 https://github.com/o/r/pull/7": [1], "#8 https://github.com/o/r/pull/8": [2, 3]}, "a pull request that finishes only a later release's items doesn't count")
self.assertFalse(next_chunk.planned(Plan([dataclasses.replace(item, awaits_merge="", exempt="question") for item in items]), held.cut, "main", "item-{id}").awaits_merge)
+2 -33
View File
@@ -12,13 +12,10 @@
| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 463 | 0.14.0 | | defect | **Show the judge the transcript's tail whatever the size of the records.** | 2 | 2 | 3 | 5 | 3 | 1.2 by 6, 1.5 by 4, 1.4 by 2 | 4.2 |
| 465 | 0.14.0 | | | **Decide loop-claude's awaited-merges stop from the pull requests found, not from whether a sentence is empty.** | 1 | 1 | 2 | 2 | 2 | code health by 2 | 3.5 |
| 449 | 0.14.0 | | | **Record do-epic's repo picks and sub-task summaries in the team's own spelling, such as `core-4` and `core-4: Bygg …`, as its config sets them.** | 2 | 2 | 2 | 4 | 3 | 1.6 by 6 | 2.0 |
| 453 | 0.14.0 | | | **Make the issue types that do-epic and `todo-item add` file in Jira settings, since a Jira project such as TW has no Task type.** | 2 | 2 | 1 | 3 | 2 | 1.6 by 5 | 1.8 |
| 450 | 0.14.0 | | | **Add `do-epic <EPIC-KEY> --dry-run`, which prints every Jira write planning would make and each chunk that would start, and makes none of them.** | 2 | 2 | 2 | 4 | 3 | 1.6 by 5 | 1.6 |
| 454 | 0.14.0 | | | **Start a do-epic chunk's issue as the team's board expects, by settings: assigned to the account do-epic works as, moved by a start transition and added to a board's active sprint.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 4 | 1.1 |
| 464 | 0.14.0 | | | **Fail a test where loop-claude's forge effect runs the forge's CLI without its timeout.** | 1 | 1 | 2 | 2 | 1 | 1.1 by 1 | 0.4 |
| 446 | 0.15.0 | | question | **Kill the process a stuck check names where its verdict is `stuck`, once the human says the recorded verdicts match what they would have done.** | 2 | 2 | 3 | 5 | 3 | 1.5 by 3 | 1.0 |
| 462 | 0.15.0 | | | **Run under `mutate-changes` the tests that today fail in mutmut's copy of the tree, so a mutant of a line only they cover is killed.** | 2 | 1 | 2 | 3 | 3 | code health by 3 | 4.7 |
| 77 | 0.15.0 | | | **Teach `bin/metric-bench` Go and TypeScript, rerun it once two projects' comprehension histories name places, and bring into review only a metric that tracks the panel.** | 4 | 2 | 1 | 5 | 6 | 1.1 by 7, 1.4 by 7 | 2.1 |
@@ -78,28 +75,6 @@
## Details
### 463. Show the judge the transcript's tail whatever the size of the records.
`judge_prompt` in `bin/agent_cycle/judge.py` gives the transcript only what `JUDGE_PROMPT_CHARS = 400000` leaves after the premises, the records and the rules. In claude-config those now take about 519,000 to 523,000 characters, so `room` clamps to 0 and the judge reads the task above an empty transcript. Every judge prompt archived for claude-config since at least 2026-11-19 17:16 shows none:
- The 0.13.0 chunks of items 448, 455 and 451 each stopped after the judge failed three times.
- The chunk of items 458 and 459 drew four `unfinished` verdicts after it had merged, each quoting only the task.
The judge sees neither a merge nor a worker's question, so every chunk here loops until a human ends it. Item 460's fix, letting the judge quote the task, treated a symptom of this.
Keep the transcript's tail a floor of the budget. Where the head leaves less, cut the records or stop with a message that names their size, rather than send a blind prompt. The constant's comment sizes the budget for a 200,000-token context, so raise it only where the judge's model has room. Item 298 cuts the records for cost; this item only guarantees the transcript room. Write first the test that fails today: a brief whose records exceed the budget still shows the transcript's last message.
Touches:
- `bin/agent_cycle/judge.py`: `JUDGE_PROMPT_CHARS` (small), `judge_prompt` (small)
- `bin/agent_cycle/test_judge.py`: `JudgePrompt`
### 465. Decide loop-claude's awaited-merges stop from the pull requests found, not from whether a sentence is empty.
Both seats of item 457's paired ruling voted Locality worse at this place. `planned` in `bin/release_plan/next_chunk.py` sets `NoItem.awaits_merge` to `bool(merges)`, where `merges` is the sentence `awaited_merges` wrote, so the loop's stop hangs on a string's truthiness, and `chunks_to_start` in `bin/loop_claude/loop/chunk_windows.py` reads it two packages away. Have `awaited_merges` return the pull requests it found, with the items each finishes, and build both the sentence and the flag from them, so a reader sees what stops the loop where it is decided.
Touches:
- `bin/release_plan/next_chunk.py`: `planned` (small), `awaited_merges`
- `bin/release_plan/test_release_standing.py`
### 449. Record do-epic's repo picks and sub-task summaries in the team's own spelling, such as `core-4` and `core-4: Bygg …`, as its config sets them.
do-epic writes its own spelling into a team's Jira: a pick as `repo:core-4` and a sub-task's summary as `[core-4] <the item's summary>`. A team with its own convention, such as TW's label `core-4` and summary `core-4: Bygg …` with a capital after the colon, then finds two labels on each issue and summaries in a shape its board doesn't use. Goal 1.6 asks the loop to fit the tracker's conventions, not change them.
@@ -173,14 +148,6 @@ Touches:
- `bin/do_epic/backend/test_jira.py`
- `README.md`: `### Set up a project` (small)
### 464. Fail a test where loop-claude's forge effect runs the forge's CLI without its timeout.
Today no test fails where `system_effects` builds `forge` as `runner(cwd)` instead of `runner(cwd, FORGE_TIMEOUT)`: a mutant of `bin/loop_effects/effects.py:128` that drops the timeout survived item 457's mutation run. A stalled `gh` or `tea` would then hold the loop again, which is what the timeout stops. Let `system_effects` take the timeout as a parameter that defaults to `FORGE_TIMEOUT`, as it takes `backends`, and test that a command outlasting a short one comes back as the `stopped after` Failure.
Touches:
- `bin/loop_effects/effects.py`: `system_effects` (small)
- `bin/loop_effects/test_effects.py`: `ForgeEffect` (small)
### 446. Kill the process a stuck check names where its verdict is `stuck`, once the human says the recorded verdicts match what they would have done.
Item 422 judges a worker that stalls before its result, but only reports: each verdict goes to the terminal and to `stuck-workers.md` in the project's transcript archive. Question for the human: after a few days of verdicts there, do they match what you would have done? Once you say yes, kill only the process a `stuck` verdict names, and only where the pid is below the worker's claude, never the worker or the loop, and record the call in a decision.
@@ -531,6 +498,8 @@ Found by review of PR #317. The black-box test, `bin/loop_claude/test_black_box.
153 `Judge cost:` entries total $109.76, a median of about $0.76 a verdict at every rung, and the cost follows the size of the records, not the transcript: about 76k characters in log and 188k in claude-config. In 224 of 251 recent verdicts (89%) the evidence sits in the worker's final message. A missed interrupt is the costly error, so the bar is zero changed interrupts and zero new rejections across the replay. The judge is about 4.5% of dollars, so the saving is small; each cycle also gets faster.
On 2026-11-20, with docs/decisions.md read once, claude-config's records take 285,754 characters. With a short task they leave the transcript about 107,500 of the judge's 400,000 characters, some 57,500 above the 50,000 it must read. The decision log grows about 4,000 characters a day, so the judge stops on claude-config, naming the shortfall, in about two weeks unless this item ships first.
Touches:
- `bin/agent_cycle/judge.py`: `Brief`, `judge_prompt`, `JUDGE_PROMPT_CHARS`
- `bin/chunk_driver/project/records.py`: `read_records`