diff --git a/bin/chunk_pr/main.py b/bin/chunk_pr/main.py index a752c79b..f39efc9c 100644 --- a/bin/chunk_pr/main.py +++ b/bin/chunk_pr/main.py @@ -19,8 +19,8 @@ merge merges the pull request, and only while its head is still the commit ch a merge commit, fast-forward only, a rebase followed by a merge commit, a rebase, a squash. GitHub offers only the merge commit, the rebase and the squash. --gate-passed says the merge gate passed on that commit; without it, chunk-pr refuses. It also refuses where - `larv-review scoring-run-owed` exits 1: the chunk owes a scoring run it has not recorded, - which no flag waives. + `larv-review scoring-run-owed` exits 1, because the chunk owes a scoring run it has not + recorded; no flag waives that. clean acts once the forge reports the branch's pull request merged at the commit checked out, by any merge method. It fetches origin, fast-forwards the main checkout to origin's default branch, removes the chunk's worktree, then deletes the local branch; origin's diff --git a/bin/larv_review/main.py b/bin/larv_review/main.py index 12e2ca7a..28f9ca98 100644 --- a/bin/larv_review/main.py +++ b/bin/larv_review/main.py @@ -2,7 +2,7 @@ usage: larv-review review-folder | ruling-base | round-count | needs-scoring-run [...] | scoring-run-owed | record-ruling | record-scoring [...] | places | agreement | reviewer-header [--rerun] -The comprehension check records how hard a project is to read, two ways, and blocks no merge. In a +The comprehension check records how hard a project is to read, two ways, and no score blocks a merge. In a paired ruling, simulated readers, the seats, read the branch's head beside a base and vote better, same or worse, overall and on each dimension. In a scoring run, four seats score the project from 1 to 10. Each seat names the places it found hard. @@ -11,7 +11,7 @@ Run it inside a project checkout or one of its worktrees. Each command but revie record-ruling, places and agreement first fetches origin, when the checkout has that remote, and takes origin's default branch, or else the local main or master, as the default branch. When the fetch fails, round-count and reviewer-header read origin as last fetched and say so on stderr; the -other three exit 1. +other four exit 1. The history is docs/comprehension-history.md in the checkout. review-folder makes the chunk's review folder, where each reviewer writes its report, and prints its @@ -36,16 +36,18 @@ an item whose tagline names the comprehension floor. It is also due when the chu with no item in the checkout's todo.md, once the shipped items are set aside, and work has landed towards that release; bin/larv_review/plan.py's `work_landed` and `landed_towards` say when. A release the checkout's todo.md marks renamed in its ## Renamed section, as `- 0.2.1 renamed to 0.3.0`, is due none. -It is also due while no scoring run in the default branch's history is newer than the commit of its -second-newest v* tag, so a release cut unmeasured is caught up by the next chunk. +A chunk is also due one while no scoring run in the default branch's history is newer than the +commit of its second-newest v* tag, so a release cut unmeasured is caught up by the next chunk. A project whose +docs/decisions.md opts out of the comprehension check is never due one. -scoring-run-owed prints `No scoring run owed.` or exits 1 saying which scoring runs the chunk owes and -has not recorded. It reads the plan at the moment it runs: the items the default branch's todo.md -holds and the checkout's does not count as shipped, and the due rule is needs-scoring-run's. A chunk -that empties a release owes two runs, any other due chunk one. The branch records a run when its -docs/comprehension-history.md holds a scoring run that the default branch's lacks. A project whose -docs/decisions.md opts out of the comprehension check, or whose checkout has no todo.md, owes none. -chunk-pr merge runs it and refuses to merge on exit 1. +scoring-run-owed prints `No scoring run owed.` or exits 1 naming the runs the chunk owes and has +not recorded. chunk-pr merge runs it and refuses to merge on exit 1, so a due line read earlier in +the chunk can't stand in for it. It applies needs-scoring-run's rule to the branch as committed, against the +merge base with the default branch, so a default branch that has moved on adds nothing: the items +the merge base's todo.md holds and the checkout's does not count as shipped. A chunk that empties a +release owes two runs, any other due chunk one. The chunk has recorded the scoring runs that its +committed docs/comprehension-history.md holds beyond the merge base's. A project that opts out or +has no todo.md items table owes none. A second scoring run of one head names itself ` rerun at `, so record-scoring does not refuse it as a repeat of the first. @@ -120,7 +122,7 @@ missing. Exit 1, saying why, on unknown arguments, an unknown item ID, a seats file it cannot read or that breaks the shape above, a todo.md that fails rank_todo.py after record-scoring records a run, or when git cannot start, finds no checkout or no default branch, cannot fetch origin for ruling-base, -needs-scoring-run or record-scoring, or cannot read or write the history, todo.md or the review +needs-scoring-run, scoring-run-owed or record-scoring, or cannot read or write the history, todo.md or the review folder. """ import pathlib diff --git a/bin/larv_review/owed.py b/bin/larv_review/owed.py index c2467ba8..cf221ecb 100644 --- a/bin/larv_review/owed.py +++ b/bin/larv_review/owed.py @@ -3,42 +3,53 @@ import pathlib from larv_review.plan import EMPTIED_WORDS, plan_reasons from review_rules.comprehension_history import entries, HISTORY from failure import Failure -from git_cli.git_repo import file_at, top -from larv_review.history_commands import history_file -from release_plan.ranking import OPTED_OUT +from git_cli.git_repo import file_at, git, top +from release_plan.todo_table import items, NoItemsTable def owed_scoring_run(default: str) -> Failure | None: """A Failure saying which scoring runs the chunk owes and has not recorded; None where it owes none. - The chunk owes the runs the plan calls (`plan_reasons`, which takes the chunk's shipped items as the plan's removed ones): two where it empties a release, else one. The branch records a run when its history holds a scoring run the default branch's lacks. A project that opts out of the comprehension check, or has no todo.md, owes none. Run at merge time, it reads the plan as it stands then, so a due line that preflight printed from an older plan can't stand in for it. + The chunk owes the runs `plan_reasons` calls, two where it empties a release, else one. It has recorded the scoring runs its committed history holds beyond those at the merge base, so a default branch that has moved on since the branch began counts for nothing. A project with no plan owes none. A missing run blocks the merge and a low score never does, which keeps the decision `review: the comprehension check records …`: it bars only scores from blocking. """ checkout = top() if isinstance(checkout, Failure): return checkout - if not pathlib.Path(checkout, "todo.md").exists(): + if not has_plan(checkout): return None - decisions = file_at(default, "docs/decisions.md", checkout) - if isinstance(decisions, Failure): - return decisions - if OPTED_OUT.search(decisions): - return None - reasons = plan_reasons(default, None) + base = git("merge-base", default, "HEAD", cwd=checkout) + if isinstance(base, Failure): + return base + reasons = plan_reasons(base.strip(), None) if isinstance(reasons, Failure): return reasons if not reasons: return None - base = file_at(default, HISTORY, checkout) - if isinstance(base, Failure): - return base - head = history_file() - if isinstance(head, Failure): - return head - recorded = len(scoring_runs(head[1])) - len(scoring_runs(base)) + before = file_at(base.strip(), HISTORY, checkout) + if isinstance(before, Failure): + return before + after = file_at("HEAD", HISTORY, checkout) + if isinstance(after, Failure): + return after + return shortfall(reasons, len(scoring_runs(after)) - len(scoring_runs(before))) + + +def shortfall(reasons: list[str], recorded: int) -> Failure | None: + """Which scoring runs the plan's reasons call that recorded, the count the branch added to the history, leaves unrecorded; None where it holds them all.""" needed = 2 if any(reason.endswith(EMPTIED_WORDS) for reason in reasons) else 1 if recorded >= needed: return None - return Failure(f"the chunk owes {needed} scoring run{'s' if needed > 1 else ''}, since it {' and '.join(reasons)}, and the branch records {max(recorded, 0)} of {needed}: launch the four seats on the head and record each run with `larv-review record-scoring`, as larv-review's SKILL.md → 'Scoring run' says") + return Failure(f"the chunk owes {needed} scoring run{'s' if needed > 1 else ''} and the branch's committed history records {max(recorded, 0)}: it {' and '.join(reasons)}. larv-review's SKILL.md → 'Scoring run' says how to run and record {'them' if needed > 1 else 'it'}; → 'Second run' says how the second is titled") + + +def has_plan(checkout: str) -> bool: + """Whether the checkout has a todo.md holding an items table. A file that can't be read counts, so `plan_reasons` reports it.""" + try: + return not isinstance(items(pathlib.Path(checkout, "todo.md").read_text(encoding="utf-8")), NoItemsTable) + except FileNotFoundError: + return False + except (OSError, UnicodeDecodeError): + return True def scoring_runs(history: str) -> list[str]: diff --git a/bin/larv_review/plan.py b/bin/larv_review/plan.py index 1bd02a14..5d478e51 100644 --- a/bin/larv_review/plan.py +++ b/bin/larv_review/plan.py @@ -2,14 +2,15 @@ import pathlib from release_plan.release_standing import Cut, default_plan, LastCut, next_release, Unknown from failure import Failure +from git_cli.git_repo import file_at, top from larv_review.scoring import FLOOR_ITEM from release_plan.todo_table import Item, items, NoItemsTable, renames +from release_plan.ranking import OPTED_OUT from release_plan.release import Release, version -from git_cli.git_repo import top from larv_review.unmeasured import unmeasured_cut -# What a reason that a chunk empties a release ends with; such a chunk is due two scoring runs, any other reason one. +# The words that end the reason a chunk empties a release. Such a chunk is due two scoring runs; a chunk with any other reason, one. EMPTIED_WORDS = "with no plan item" @@ -63,10 +64,15 @@ def emptied(before: list[Item], after: list[Item], shipped: list[Item], renamed: def plan_reasons(default: str, ids: list[int] | None) -> list[str] | Failure: - """Why the plan calls a scoring run, from the default branch's todo.md and the checkout's. Where ids is None, the chunk ships each item the default branch's plan holds and the checkout's does not.""" + """Why the plan calls a scoring run, from the default branch's todo.md and the checkout's; empty where the project opts out of the comprehension check. Where ids is None, the chunk ships each item the default branch's plan holds and the checkout's does not.""" checkout = top() if isinstance(checkout, Failure): return checkout + decisions = file_at(default, "docs/decisions.md", checkout) + if isinstance(decisions, Failure): + return decisions + if OPTED_OUT.search(decisions): + return [] held = default_plan(checkout, default) before = held.todo if isinstance(before, Failure): diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index 97430ac7..cf6fa332 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -23,6 +23,7 @@ from release_plan.todo_table import Item, items, NoItemsTable from release_plan.release_standing import LastCut from larv_review.ruling_base import measured_commit from larv_review.seats import score_line, scores, seats_file, SeatsFile +from larv_review.owed import shortfall TOOL = pathlib.Path(__file__).resolve().parents[1] / "larv-review" SCORING = "## 2026-10-08T12:00:00Z, PR #1 at aaaaaaa\n\n| Seat | Overall |\n|---|---|\n| Mean | 7.00 |\n" @@ -425,6 +426,17 @@ class LandedTowards(unittest.TestCase): self.assertEqual(landed_towards(plan, LastCut(Failure("fatal: bad object"), "", 3, [])), Failure("could not tell the next release: the default branch's tags cannot be read: fatal: bad object")) +class Shortfall(unittest.TestCase): + def test_a_chunk_that_empties_a_release_owes_two_runs_and_any_other_reason_one(self): + emptied = ["leaves release 0.1.0 with no plan item"] + floor = ["ships item 2, which names the comprehension floor"] + self.assertIn("owes 2 scoring runs and the branch's committed history records 1", shortfall(emptied + floor, 1).reason) + self.assertIn("owes 1 scoring run and", shortfall(floor, 0).reason) + self.assertIn("records 0:", shortfall(floor, -1).reason) + self.assertIsNone(shortfall(emptied, 2)) + self.assertIsNone(shortfall(floor, 1)) + + class LarvReviewTool(unittest.TestCase): def setUp(self): temp = tempfile.TemporaryDirectory() @@ -508,10 +520,10 @@ class LarvReviewTool(unittest.TestCase): owed = self.run_tool("scoring-run-owed") self.assertEqual(owed.returncode, 1) self.assertIn("leaves release 0.1.0 with no plan item", owed.stderr) - self.assertIn("records 0 of 2", owed.stderr) + self.assertIn("records 0:", owed.stderr) history = "# Comprehension history\n\n" + SCORING self.commit("Record a run", {"docs/comprehension-history.md": history}) - self.assertIn("records 1 of 2", self.run_tool("scoring-run-owed").stderr) + self.assertIn("records 1:", self.run_tool("scoring-run-owed").stderr) self.commit("Record a rerun", {"docs/comprehension-history.md": history + "\n" + SCORING.replace("PR #1 at", "PR #1 rerun at")}) done = self.run_tool("scoring-run-owed") self.assertEqual((done.returncode, done.stdout), (0, "No scoring run owed.\n"), done.stderr) @@ -526,10 +538,28 @@ class LarvReviewTool(unittest.TestCase): self.commit("Record a run", {"docs/comprehension-history.md": "# Comprehension history\n\n" + SCORING}) self.assertEqual(self.run_tool("scoring-run-owed").returncode, 0) - def test_no_scoring_run_is_owed_where_none_is_due_the_project_opts_out_or_it_has_no_plan(self): - self.commit("Ship item 2", {"todo.md": todo("| 1 | 0.1.0 | | **Do it.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |", "| 3 | 0.2.0 | | **And this.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |")}) + ROW = "| 3 | 0.2.0 | | **And this.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |" + + def ship_item_1(self): + self.commit("Ship item 1", {"todo.md": todo(self.ROW)}) + + def test_no_scoring_run_is_owed_where_none_is_due(self): + self.commit("Ship item 2", {"todo.md": todo("| 1 | 0.1.0 | | **Do it.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |", self.ROW)}) self.assertEqual(self.run_tool("scoring-run-owed").stdout, "No scoring run owed.\n") - self.commit("Ship item 1", {"todo.md": todo("| 3 | 0.2.0 | | **And this.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |")}) + self.ship_item_1() + self.assertEqual(self.run_tool("scoring-run-owed").returncode, 1) + + def test_a_run_counts_only_as_committed_and_a_ruling_is_no_run(self): + self.ship_item_1() + (self.checkout / "docs").mkdir() + (self.checkout / "docs" / "comprehension-history.md").write_text("# Comprehension history\n\n" + SCORING) + self.assertIn("records 0", self.run_tool("scoring-run-owed").stderr) + self.commit("Record a ruling", {"docs/comprehension-history.md": "# Comprehension history\n\n" + paired("2026-10-08T12:00:00Z", "better")}) + self.assertIn("records 0", self.run_tool("scoring-run-owed").stderr) + + def test_a_project_that_opts_out_owes_none_and_is_never_due_one_but_a_branch_cannot_opt_itself_out(self): + self.ship_item_1() + self.commit("Opt out on the branch", {"docs/decisions.md": "## review opt-out: the comprehension check\n\n2026-11-10, lilleman.\n"}) self.assertEqual(self.run_tool("scoring-run-owed").returncode, 1) self.git("switch", "-q", "main") self.commit("Opt out", {"docs/decisions.md": "## review opt-out: the comprehension check\n\n2026-11-10, lilleman.\n"}) @@ -537,9 +567,25 @@ class LarvReviewTool(unittest.TestCase): self.git("switch", "-q", "chunk") self.git("merge", "-q", "main") self.assertEqual(self.run_tool("scoring-run-owed").stdout, "No scoring run owed.\n") + self.assertEqual(self.run_tool("needs-scoring-run", "1").stdout, "No scoring run due.\n") + + def test_a_project_with_no_plan_or_no_items_table_owes_none(self): + self.ship_item_1() + self.assertEqual(self.run_tool("scoring-run-owed").returncode, 1) + self.commit("Reshape the plan", {"todo.md": "# Plan\n"}) + self.assertEqual(self.run_tool("scoring-run-owed").stdout, "No scoring run owed.\n") self.git("rm", "-q", "todo.md") self.commit("Drop the plan") - self.assertEqual(self.run_tool("scoring-run-owed").returncode, 0) + self.assertEqual(self.run_tool("scoring-run-owed").stdout, "No scoring run owed.\n") + + def test_a_default_branch_that_moved_on_since_the_branch_began_adds_no_owed_run(self): + self.git("switch", "-q", "main") + self.commit("Plan release 0.3.0", {"todo.md": todo("| 1 | 0.1.0 | | **Do it.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |", "| 2 | 0.2.0 | | **Then this.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |", self.ROW, "| 4 | 0.3.0 | | **Later.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |"), "docs/comprehension-history.md": "# Comprehension history\n\n" + SCORING}) + self.git("push", "-q", "origin", "HEAD:main") + self.git("switch", "-q", "chunk") + self.commit("Do some work") + self.assertEqual(self.run_tool("needs-scoring-run").stdout, "No scoring run due.\n") + self.assertEqual(self.run_tool("scoring-run-owed").stdout, "No scoring run owed.\n") def release(self, tag, date, files=None): """Cut tag on the default branch at a commit dated date.""" @@ -559,6 +605,26 @@ class LarvReviewTool(unittest.TestCase): self.release("v0.0.3", "2026-10-21T12:00:00Z", {"docs/comprehension-history.md": "# Comprehension history\n\n" + SCORING.replace("2026-10-08T12", "2026-10-20T18")}) self.assertEqual(self.run_tool("needs-scoring-run", "2").stdout, "No scoring run due.\n") + def test_a_run_ends_an_unmeasured_release_only_when_it_is_a_scoring_run_newer_than_the_tag_with_a_time_that_reads(self): + self.release("v0.0.1", "2026-10-09T12:00:00Z") + history = "# Comprehension history\n\n" + due = "Scoring run due: the chunk follows v0.0.2, cut with no scoring run since v0.0.1.\n" + self.release("v0.0.2", "2026-10-20T12:00:00Z", {"docs/comprehension-history.md": history + paired("2026-10-21T12:00:00Z", "better") + "\n" + SCORING.replace("2026-10-08T12:00:00Z", "2026-10-09T12:00:00Z")}) + self.assertEqual(self.run_tool("needs-scoring-run", "2").stdout, due, "a ruling, and a run at the earlier tag's own second, end nothing") + self.release("v0.0.3", "2026-10-21T12:00:00Z", {"docs/comprehension-history.md": history + SCORING.replace("2026-10-08T12:00:00Z", "2026-10-30")}) + self.assertEqual(self.run_tool("needs-scoring-run", "2").stdout, due.replace("v0.0.2", "v0.0.3").replace("v0.0.1", "v0.0.2"), "a run whose time doesn't parse ends nothing") + + def test_an_unmeasured_release_is_judged_by_the_default_branch_alone_and_names_a_release_over_its_candidate(self): + self.release("v0.0.1", "2026-10-09T12:00:00Z") + self.release("v0.0.2-rc.1", "2026-10-10T12:00:00Z") + self.release("v0.0.2", "2026-10-20T12:00:00Z") + self.git("switch", "-q", "-c", "side") + self.commit("Tag a side branch") + self.git("tag", "v0.9.0") + self.git("switch", "-q", "chunk") + self.commit("Record a run on the branch", {"docs/comprehension-history.md": "# Comprehension history\n\n" + SCORING.replace("2026-10-08T12", "2026-10-25T12")}) + self.assertEqual(self.run_tool("needs-scoring-run", "2").stdout, "Scoring run due: the chunk follows v0.0.2, cut with no scoring run since v0.0.2-rc.1.\n") + def test_one_release_alone_calls_no_scoring_run_for_lacking_one(self): self.release("v0.0.1", "2026-10-09T12:00:00Z") self.assertEqual(self.run_tool("needs-scoring-run", "2").stdout, "No scoring run due.\n") diff --git a/bin/larv_review/unmeasured.py b/bin/larv_review/unmeasured.py index a55833b9..97890639 100644 --- a/bin/larv_review/unmeasured.py +++ b/bin/larv_review/unmeasured.py @@ -6,7 +6,9 @@ from git_cli.git_repo import file_at, git def unmeasured_cut(default: str, checkout: str) -> str | None | Failure: - """The default branch's newest release, named with the one before it, where no scoring run in the default branch's history is newer than that earlier release's tag: `v0.7.0, cut with no scoring run since v0.6.0`. None where it holds fewer than two release tags, or a run since the earlier one. + """Whether the default branch's newest release was cut unmeasured, as `v0.7.0, cut with no scoring run since v0.6.0`. It was where no scoring run in the default branch's history is newer than the second-newest v* tag. None where the branch holds fewer than two such tags, or a run since the earlier one. + + The reason ends once a run follows the earlier tag, so it asks only after a release was cut with none; it lets the chunk that finds the gap record the run (item 296 filed the gap after v0.5.0 to v0.7.0). A scoring run counts by the time its history heading records, against the tag's commit time; a heading whose time doesn't parse counts for nothing, so the run is asked for again. """ diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md index a2a92483..6e797e3a 100644 --- a/skills/larv-review/SKILL.md +++ b/skills/larv-review/SKILL.md @@ -136,7 +136,7 @@ Launch one principles-auditor on the trigger in §3, so the project is read once ### Comprehension check -The comprehension check records how hard the project is for its contributor to read (`~/.claude/rules/goals-and-audience.md`), and blocks no merge. Simulated readers, the seats, launched per `~/.claude/skills/comprehension-panel/SKILL.md`, each read the whole project, not the diff. It reports no findings and is no pass: it runs once, in §5, after every pass is done, the auto-reviewer included, so it reads the branch as review left it. It runs a paired ruling in the release review, even where an opt-out skips its architect, and a scoring run where one is due. It skips only as "Opt-out" or "Suspended" below says. +The comprehension check records how hard the project is for its contributor to read (`~/.claude/rules/goals-and-audience.md`), and no score blocks a merge; only a run the plan calls and the branch lacks does, per "Scoring run". Simulated readers, the seats, launched per `~/.claude/skills/comprehension-panel/SKILL.md`, each read the whole project, not the diff. It reports no findings and is no pass: it runs once, in §5, after every pass is done, the auto-reviewer included, so it reads the branch as review left it. It runs a paired ruling in the release review, even where an opt-out skips its architect, and a scoring run where one is due. It skips only as "Opt-out" or "Suspended" below says. **Paired ruling.** Each seat votes whether the project reads better, the same or worse at this branch's head than at the base. @@ -144,11 +144,10 @@ The comprehension check records how hard the project is for its contributor to r - **Head.** The head holds `origin/`, merged in at §4 step 1, so it differs from the default branch only by this branch's change. - **Seats.** Mid A and the inherited architect. Write what they read and their replies into a votes file in the chunk's review folder, in the shape `~/.claude/bin/larv-review --help` shows, and run `~/.claude/bin/larv-review record-ruling `. On `Split:`, launch the maintainability senior and Junior A together, add their lines, and run it again. -**Scoring run**, when `~/.claude/bin/larv-review needs-scoring-run ` prints `Scoring run due:`. Run `needs-scoring-run` before removing the chunk's items from `todo.md`. +**Scoring run**, when `~/.claude/bin/larv-review needs-scoring-run ` prints `Scoring run due:`. Run `needs-scoring-run` before removing the chunk's items from `todo.md`. `chunk-pr merge` refuses until the branch's committed history records every run the plan calls, which `larv-review scoring-run-owed` counts at merge time from the merge base; an earlier due line is only a snapshot. - **Seats.** Junior A, Mid A, the maintainability senior and the inherited architect each score the project at the head from 1 to 10 overall and on four dimensions: Navigation, Locality, Shape and Self-sufficiency. Write their lines into a scores file and run `~/.claude/bin/larv-review record-scoring `, which appends the run to the history and prints the four seats' means. - **Floor item.** Where `record-scoring` prints `Floor:`, a `Next:` line follows: file one floor item, or refresh the open one. A floor item is a plan item meant to bring every mean to 7.0. File it as one ambitious refactor, not touch-ups. It restructures the area behind the places `larv-review places` prints for this run, chosen where they bear on the lowest dimension, sized to bring every mean to 7.0, and quotes those places. Its tagline holds the words `comprehension floor`, so its own chunk runs a scoring run; while a mean stays under 7.0, that run's `Next:` line asks for the next floor item. Mark it `owner`, since the human asked that such a project always hold one, so no score deletes it. Put it in the earliest release the plan names after the one the chunk ships into, or else in the next version after that one that `~/.claude/rules/todo-items.md` allows, so the floor doesn't hold up any release. While one is open, refresh its places and aim from the newest run instead of filing another; the item the chunk ships doesn't count as open. Commit it with the run, as "Record" says. -- **Owed.** `chunk-pr merge` runs `~/.claude/bin/larv-review scoring-run-owed` against the plan as it stands at merge time and refuses while the run the plan calls is unrecorded on the branch. A due line from earlier in the chunk, such as `chunk-preflight`'s, is a snapshot: the merge gate decides. - **Second run.** Where `needs-scoring-run` printed that the chunk `leaves release … with no plan item`, launch the same four seats afresh on the same head. Their scores file's first line is ` rerun at `. Record it with the same `record-scoring` command. - **Agreement.** After the second run, run `~/.claude/bin/larv-review agreement` and put its counts in the summary. On `Assumption fails:`, ask the user whether to keep the paired ruling or change the decision `review: the comprehension check records …`. Record the answer as a decision in the repo whose history was counted, with the counts that led to the ask. A later run asks again only when the rulings' rate falls, or the runs' rate rises, against the recorded counts. @@ -195,7 +194,7 @@ Launch prose-reviewer with what the diff touched and every section this review c 1. Read the finished PR against the README goals and code health, unless the README voids it: does anything in it work against one? It breaks a maintain goal → do not merge; redesign the change or drop its item. It works against an achieve goal → do not merge; ask the human, stating the conflict. 2. Run the comprehension check (§3) where it runs; it runs once. When `origin/` moves after that, return to §4, and keep the ruling and scoring run already recorded. 3. Remove the chunk's items from `todo.md` per `~/.claude/CLAUDE.md` → "Working loop" in the branch, commit and push that, and wait for the forge's checks (§4 step 4); the commit re-enters no pass. -4. Aligned, every pass done and everything green → **merge** with `~/.claude/bin/chunk-pr merge --gate-passed`, which takes the first merge method the repository allows on its forge. A repo whose `AGENTS.md` names another method merges that way with the forge's CLI instead. A repo withholds this in its `AGENTS.md` → leave the PR ready and unmerged, and say which line withheld it. +4. Aligned, every pass done and everything green → **merge** with `~/.claude/bin/chunk-pr merge --gate-passed`, which takes the first merge method the repository allows on its forge. A repo whose `AGENTS.md` names another method merges that way with the forge's CLI instead, after `~/.claude/bin/larv-review scoring-run-owed` exits 0. A repo withholds this in its `AGENTS.md` → leave the PR ready and unmerged, and say which line withheld it. 5. Merged → run `~/.claude/bin/chunk-pr clean` in the chunk's worktree, and put a failure it prints in the summary. 6. Stop. The next chunk gets a fresh session.