|
|
|
@@ -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:
|
|
|
|
|