Answer prose round 1: 0 🔴, 5 🟡; say the README's rung finds what the project's rung finds again, untangle the replay's help, sort the Tools list, word the decision's title plainly

This commit is contained in:
2026-10-15 21:29:56 +02:00
parent 8705c05043
commit 89a7485684
9 changed files with 23 additions and 21 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ HEADLESS = ["--no-session-persistence", "--output-format", "json", "--permission
def claude_reply(claude: Claude, args: list[str], cwd: str, prompt: str, who: str) -> dict | Failure | Limited:
"""claude's json reply to `claude -p <args>` and HEADLESS, or why there is none; who names the run in the message for a non-zero exit or a reply that is no json, such as the judge."""
"""claude's json reply to `claude -p <args>` and HEADLESS, or why there is none; who, such as "the judge", names the run in the message for a non-zero exit or a reply that is no json."""
try:
proc = claude(["-p", *args, *HEADLESS], cwd, prompt)
except OSError as failure:
+1 -1
View File
@@ -21,7 +21,7 @@ T = typing.TypeVar("T")
@dataclasses.dataclass(frozen=True)
class Miss(typing.Generic[Case, Item, Reply]):
"""An item the reference reproduced in case that a rung's reply did not."""
"""An item of case that the reference reproduced and a rung's reply missed."""
case: Case
item: Item
reply: Reply
+13 -11
View File
@@ -12,14 +12,16 @@ shows the chunk's change. The prompt names the clone in place of the worktree it
chunk has since removed. A round whose code it cannot find in this way is not replayed; stderr
names it and why.
It first replays every round on the reference reviewer, the project's rung, which the reviewer
runs on while the worker runs below it. Findings it does not find may rest on code or rules that
have changed since; either way no rung is held to them. It then replays the rest on each rung
below, highest first, down to the rung the lowest R + C picks, and stops at the first rung that
misses one. The project's rung decides, for each replay, which findings on record it reports as
🔴 or 🟡. The tool prints each finding a rung missed and the lowest rung that missed none. Such a
rung is the evidence to route the stability reviewer onto the worker's rung down to it, which
docs/decisions.md → `routing: the stability reviewer stays on the project's rung` records.
It first replays every round on the project's rung, the reference reviewer. Findings on record
that the reference reviewer does not raise again may rest on code or rules that have changed
since; no rung is held to them. It then replays the rounds where the reference raised any, on each
rung below, highest first, down to the rung the lowest R + C picks, and stops at the first rung
that misses one. For each replay, claude on the project's rung matches the report to the findings
on record, and counts a finding only where the report raises it as 🔴 or 🟡. The tool prints each
finding a rung missed and the lowest rung that, like each rung above it, missed none. That rung is
the evidence for running the stability reviewer on the worker's rung whenever the worker runs at
or above it; docs/decisions.md → `routing: the stability reviewer stays on the project's rung`
records the run.
Like the loop, it tries claude three times running before it counts a reply as failed. A failed
review or match finds nothing. Exit 1, saying why, on bad arguments, an unreadable archive or
@@ -116,7 +118,7 @@ def chunk_rounds(checkout: str, chunk: pathlib.Path) -> list[Round]:
def code_of(found: Round, effects: Effects) -> Code | Failure:
"""The code found's reviewer read, as the archive lets it be found again: the prompt's removed worktree, and the commits authored by then.
"""Where, and at which commits, found's reviewer read the code, as the archive lets it be found again: the prompt's removed worktree, and the commits authored by then.
Recording the reviewed commit at review time would need no such reading, but then no round archived before that change could be replayed. A wrong guess costs no rung: the reference reviewer, replayed on that code, finds fewer findings on record, and no rung is held to those.
"""
@@ -124,7 +126,7 @@ def code_of(found: Round, effects: Effects) -> Code | Failure:
return Failure("the project has no checkout")
path = reviewed_path(found.prompt, found.root, os.path.exists)
if path is None:
return Failure("the prompt names no one worktree")
return Failure("the prompt names neither one removed worktree nor the checkout")
default = git(effects, found.root, "symbolic-ref", "--short", "refs/remotes/origin/HEAD")
if isinstance(default, Failure):
return default
@@ -157,7 +159,7 @@ def findings_found(found: Round, code: Code, rung: Rung, anchor: Rung, effects:
return matched
# The shell: it makes and removes the clone itself, and the tests run it on a temporary home, as judge-replay's do; rounds.py's core takes the filesystem as an argument.
# The shell makes and removes the clone itself, and is tested on a temporary home as judge-replay's is; rounds.py's core takes the filesystem as an argument.
def review(found: Round, code: Code, rung: Rung, effects: Effects) -> str | Failure | Limited:
clone = tempfile.mkdtemp(prefix="stability-replay-")
try:
+1 -1
View File
@@ -85,7 +85,7 @@ def reviewed_path(prompt: str, root: str, exists: typing.Callable[[str], bool])
def authored_by(log: list[tuple[str, float]], seconds: float) -> str | None:
"""The newest commit of log, newest first, authored by then. A rebase keeps author times, so a merged branch's commits still say what it held."""
"""The newest commit in log, which lists newest first, authored at or before seconds. A rebase keeps author times, so a merged branch's commits still say what it held."""
return next((commit for commit, authored in log if authored <= seconds), None)
@@ -282,7 +282,7 @@ class Main(unittest.TestCase):
def test_leaves_out_a_round_whose_prompt_names_no_worktree(self):
self.set_prompt("Review the branch.")
self.assert_left_out("the prompt names no one worktree")
self.assert_left_out("the prompt names neither one removed worktree nor the checkout")
def test_leaves_out_a_round_whose_checkout_names_no_default_branch(self):
run_git(self.checkout, "remote", "set-head", "origin", "-d")