Answer product-owner round 1: 0 🔴, 0 🟡; grant interactive sessions the reports folder and fall back to the full reply when the Write fails, mark up the summary example, and copy into a replay only reports written since its chunk began

This commit is contained in:
2026-10-18 01:16:26 +02:00
parent d361312edc
commit 2b1d3707c8
5 changed files with 13 additions and 9 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ branch stands at the newest commit authored before the round's chunk began, so a
shows the chunk's change. The prompt names the clone in place of the worktree it named, which the
chunk has since removed. A round whose code it cannot find in this way is not replayed; stderr
names it and why. The prompt also names a copy of the chunk's review folder in place of that
folder, holding only the reports written before the round began. A replay whose prompt still
folder, holding only the reports written after the chunk began and before the round did. A replay whose prompt still
names the review folder finds nothing.
It first replays every round on the project's rung, the reference reviewer. Findings on record
@@ -174,10 +174,10 @@ def review(found: Round, code: Code, rung: Rung, home: pathlib.Path, effects: Ef
def reviewed_in(found: Round, code: Code, rung: Rung, home: pathlib.Path, effects: Effects, clone: str, reports: str) -> str | Failure | Limited:
"""The report of found's reviewer on rung, replayed on code cloned into clone, with its review folder copied into reports."""
# The reviewer writes its report into a copy of the chunk's review folder, so it leaves the chunk's reports as they were and still reads the earlier rounds its prompt names. The copy holds only the reports written before the round began: the round's own report, and later ones, would hand the reviewer the findings it is to find.
# The reviewer writes its report into a copy of the chunk's review folder, so it leaves the chunk's reports as they were and still reads the earlier rounds its prompt names. The copy holds only the reports written after the chunk began and before the round began: the round's own report, later ones, and an earlier attempt's at the item in the same worktree, would hand the reviewer the findings it is to find.
folder = pathlib.Path(review_folder(str(home), code.path))
for written in folder.iterdir() if folder.is_dir() else ():
if written.is_file() and written.stat().st_mtime < found.seconds:
if written.is_file() and found.began <= written.stat().st_mtime < found.seconds:
shutil.copy2(written, reports)
# The folder goes first: for a worktree outside home, its path holds the worktree's, which code.path would otherwise turn into the clone's.
prompt = found.prompt.replace(str(folder), reports).replace(f"~/{folder.relative_to(home)}", reports).replace(code.path, clone)
@@ -234,7 +234,7 @@ class Main(unittest.TestCase):
self.assertTrue(out.endswith("finds: claude-sonnet-5-5 at high effort\n"))
def review_folder_with_round_1(self):
"""The chunk's review folder, holding round 1's report from before the replayed round began at 10:00, and that round's own and a later pass's reports, written after."""
"""The chunk's review folder, holding round 1's report from before the replayed round began at 10:00, that round's own and a later pass's reports, written after, and an earlier attempt's report, from before the chunk began at 09:15."""
folder = self.home / ".local" / "state" / "larv-review" / "code" / "proj-x"
folder.mkdir(parents=True)
(folder / "stability-round-1.md").write_text("round 1\n")
@@ -242,6 +242,9 @@ class Main(unittest.TestCase):
os.utime(folder / "stability-round-1.md", (before, before))
(folder / "stability-round-2.md").write_text("🔴 a.txt:1 wrong\n")
(folder / "prose-round-1.md").write_text("later\n")
(folder / "stability-round-3.md").write_text("🔴 a.txt:1 wrong\n")
attempt = stamp_seconds("2026-10-14T09:00:00Z")
os.utime(folder / "stability-round-3.md", (attempt, attempt))
return folder
def test_points_the_prompts_review_folder_at_a_copy_of_the_reports_from_before_the_round_that_it_removes(self):
@@ -260,10 +263,10 @@ class Main(unittest.TestCase):
named, copied, earlier = seen[0]
self.assertEqual(named.parent, folder.parents[1], "the copy sits in the reports folder, where rule-hook lets the reviewer write")
self.assertNotEqual(named, folder)
self.assertEqual(copied, ["stability-round-1.md"], "the round's own report and later ones would hand the replayed reviewer its findings")
self.assertEqual(copied, ["stability-round-1.md"], "the round's own report, later ones and an earlier attempt's would hand the replayed reviewer its findings")
self.assertEqual(earlier, "round 1\n")
self.assertFalse(named.exists())
self.assertEqual(sorted(path.name for path in folder.iterdir()), ["prose-round-1.md", "stability-round-1.md", "stability-round-2.md"])
self.assertEqual(sorted(path.name for path in folder.iterdir()), ["prose-round-1.md", "stability-round-1.md", "stability-round-2.md", "stability-round-3.md"])
self.assertEqual((folder / "stability-round-2.md").read_text(), "🔴 a.txt:1 wrong\n")
def test_points_the_review_folders_absolute_path_at_the_copy(self):
+1 -1
View File
@@ -222,7 +222,7 @@ Valid while the worker writes the tests that larv-review's reviewers hold to the
2026-10-18, the agent, shipping lilleman's plan item. Serves goal 1.4: a report the worker does not need line by line no longer fills its context. Goal 1.1 holds because the worker reads a finding's full entry before it answers a 🔴 or 🟡.
The worker names each report's file in the reviewer's prompt, per `skills/larv-review/SKILL.md` → "Reports", and `skills/larv-review/review-findings.md` → "Report" sets what the reviewer returns. Each reviewer holds Write for that. Claude Code passes a subagent's type to a PreToolUse hook as `agent_type`, so `bin/rule_hook/reviewer_report.py` refuses a reviewer's Edit, MultiEdit, and Write outside the folder; no marker overrides it. A reviewer's Bash, as stability-reviewer holds, is not confined. The folder is fixed, since loop-claude's headless sessions have no scratchpad. It sits outside every checkout, so no project sees a report. It survives a reboot, unlike `/tmp`, so a resumed chunk still reads its earlier rounds. It is in the user's home, so no other local user plants a symlink that widens the folder, and `larv-review review-folder`, which makes the folder, leaves `~/.local/state/larv-review` readable by the user alone, since a report may quote a secret. A chunk keeps its folder after the merge: `stability-replay` hands a replayed reviewer a copy of the reports written before its round began, so the replay reads the earlier rounds its prompt names, never the findings it is to find, and leaves the chunk's reports as they were. Claude Code's own subagent prompt tells a subagent to return findings rather than write report files; `review-findings.md` → "Report" overrides that, since the file is the worker's input, and a prose-reviewer probed on 2026-10-18 wrote its file. A general-purpose wrapper that launches the reviewer was not tried: Claude Code's documentation says a subagent cannot start another.
The worker names each report's file in the reviewer's prompt, per `skills/larv-review/SKILL.md` → "Reports", and `skills/larv-review/review-findings.md` → "Report" sets what the reviewer returns. Each reviewer holds Write for that. Claude Code passes a subagent's type to a PreToolUse hook as `agent_type`, so `bin/rule_hook/reviewer_report.py` refuses a reviewer's Edit, MultiEdit, and Write outside the folder; no marker overrides it. A reviewer's Bash, as stability-reviewer holds, is not confined. The folder is fixed, since loop-claude's headless sessions have no scratchpad. It sits outside every checkout, so no project sees a report. It survives a reboot, unlike `/tmp`, so a resumed chunk still reads its earlier rounds. It is in the user's home, so no other local user plants a symlink that widens the folder, and `larv-review review-folder`, which makes the folder, leaves `~/.local/state/larv-review` readable by the user alone, since a report may quote a secret. A chunk keeps its folder after the merge: `stability-replay` hands a replayed reviewer a copy of the reports written after its chunk began and before its round did, so the replay reads the earlier rounds its prompt names, never the findings it is to find, and leaves the chunk's reports as they were. Claude Code's own subagent prompt tells a subagent to return findings rather than write report files; `review-findings.md` → "Report" overrides that, since the file is the worker's input, and a prose-reviewer probed on 2026-10-18 wrote its file. A general-purpose wrapper that launches the reviewer was not tried: Claude Code's documentation says a subagent cannot start another.
Before this change, reports took a median 19k tokens per chunk, 8% of the worker's peak context, and lines carrying a severity mark were 9–24% of a report (2026-10-08, over 68 archived transcripts). `stability-replay` still counts each 🔴 and 🟡 by its line in the reviewer's reply, now a one-line summary. todo.md item 186 measures what the worker reads of the reports instead.
+1
View File
@@ -9,6 +9,7 @@
"permissions": {
"defaultMode": "auto",
"additionalDirectories": [
"~/.local/state/larv-review",
"~/code"
]
},
+2 -2
View File
@@ -19,12 +19,12 @@ A finding against a technical principle names it and the file under `~/.claude/p
Write your full report with the Write tool to the file your prompt names. The file is the worker's input, which it searches for each finding's entry, so write it even where your harness says to return findings directly. It holds the verdict, then every finding with its place, its evidence and its fix, as your agent file shapes them. Then return only:
- the verdict line
- one line per finding: its severity mark, its place, what is wrong in one sentence, and the file it breaks where that is `standards/quality.md` or a file under `~/.claude/principles/`, or for a 🔀 the reviewer it names, such as `🟡 bin/rank_todo.py:311 place: a cycle among blockers recurses forever (technical-principles.md)`
- one line per finding: its severity mark, its place, what is wrong in one sentence, and the file it breaks where that is `standards/quality.md` or a file under `~/.claude/principles/`, or for a 🔀 the reviewer it names, such as ``🟡 `bin/rank_todo.py:311` `place`: a cycle among blockers recurses forever (technical-principles.md)``
- for stability-reviewer, whether the tests passed, and at which commit
- `Rerun one rung up`, where your report ends with it
- the report's path
A prompt that names no file gets the full report as your reply.
A prompt that names no file, or a Write that fails, gets the full report as your reply.
## Verdict