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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user