diff --git a/CHANGELOG.md b/CHANGELOG.md
index c078e56e..0340441b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+## Unreleased
+
+- `chunk-pr merge` now refuses while a scoring run the plan calls is unrecorded on the branch, and `larv-review needs-scoring-run` calls one after a release is cut with none.
+
## 0.7.0
- README's test, CI and mutation-test commands now have their own section, README → Test.
diff --git a/bin/chunk_pr/main.py b/bin/chunk_pr/main.py
index c2fed835..f39efc9c 100644
--- a/bin/chunk_pr/main.py
+++ b/bin/chunk_pr/main.py
@@ -18,7 +18,9 @@ merge merges the pull request, and only while its head is still the commit ch
push after the gate is never merged. It takes the first method the repository allows of:
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.
+ merge gate passed on that commit; without it, chunk-pr refuses. It also refuses where
+ `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
@@ -32,6 +34,7 @@ It prints what it did, exit 0, or why it failed, exit 1.
import dataclasses
import json
import os
+import pathlib
import sys
import typing
@@ -40,6 +43,7 @@ from chunk_preflight.gathered import Forge
from chunk_preflight.choices import forge_of
from deploy_release.forge import gitea, merged_pull, open_pull, Run, runner
+BIN = pathlib.Path(__file__).resolve().parents[1]
USAGE = "usage: chunk-pr open
[] | chunk-pr ready | chunk-pr merge --gate-passed | chunk-pr clean"
# Each forge's merge methods in the order merge prefers them, as the repository setting that allows the method and the method's name in the forge's merge call. A merge commit and a fast-forward keep the branch's commits as they are; a rebase or a squash rewrites them.
@@ -157,6 +161,9 @@ def merged(run: Run) -> str | Failure:
if isinstance(found, Failure):
return found
forge, number, head = found
+ owed = run([str(BIN / "larv-review"), "scoring-run-owed"])
+ if isinstance(owed, Failure):
+ return owed
method = merge_method(forge, run)
if isinstance(method, Failure):
return method
diff --git a/bin/chunk_pr/test_chunk_pr.py b/bin/chunk_pr/test_chunk_pr.py
index 6efed6e0..1dcc022c 100644
--- a/bin/chunk_pr/test_chunk_pr.py
+++ b/bin/chunk_pr/test_chunk_pr.py
@@ -21,6 +21,7 @@ GH_LIST = ["gh", "pr", "list", "--head", "item-7", "--json", "number,headRefOid,
TEA_LIST = ["tea", "api", "repos/{owner}/{repo}/pulls?state=open&limit=50"]
GH_SETTINGS = ["gh", "repo", "view", "--json", "mergeCommitAllowed,rebaseMergeAllowed,squashMergeAllowed"]
TEA_SETTINGS = ["tea", "api", "repos/{owner}/{repo}"]
+OWED = [str(pathlib.Path(__file__).resolve().parents[1] / "larv-review"), "scoring-run-owed"]
class Checkout:
@@ -58,7 +59,7 @@ class Checkout:
def acted(self) -> list[list[str]]:
"""What it ran beyond reading the checkout, the pull requests and the repository's settings."""
- reads = [GH_LIST, TEA_LIST, GH_SETTINGS, TEA_SETTINGS]
+ reads = [GH_LIST, TEA_LIST, GH_SETTINGS, TEA_SETTINGS, OWED]
return [command for command in self.ran if tuple(command) not in self.answers and command not in reads]
@@ -137,6 +138,14 @@ class Merge(unittest.TestCase):
self.assertIsInstance(step(["merge"], checkout), Failure)
self.assertEqual(checkout.ran, [])
+ def test_a_scoring_run_the_chunk_owes_and_has_not_recorded_refuses_the_merge(self):
+ for origin in (GITHUB, GITEA):
+ with self.subTest(origin=origin):
+ checkout = Checkout(origin, open=True)
+ checkout.answers[tuple(OWED)] = Failure("larv-review scoring-run-owed: the chunk owes 2 scoring runs")
+ self.assertEqual(step(["merge", "--gate-passed"], checkout), Failure("larv-review scoring-run-owed: the chunk owes 2 scoring runs"))
+ self.assertEqual(checkout.acted(), [])
+
def test_github_merges_with_a_merge_commit_pinned_to_the_head(self):
checkout = Checkout(GITHUB, open=True, allowed=("squashMergeAllowed", "mergeCommitAllowed"))
self.assertEqual(step(["merge", "--gate-passed"], checkout), "Merged pull request #12 (merge).")
diff --git a/bin/larv_review/main.py b/bin/larv_review/main.py
index b2412130..bd41c576 100644
--- a/bin/larv_review/main.py
+++ b/bin/larv_review/main.py
@@ -1,8 +1,8 @@
"""Hold larv-review's mechanical rules: the chunk's review folder, the paired ruling's base and vote count, each pass's rounds, the scoring run's trigger; the comprehension history's format, its latest places and its count of how often seats agree; and the header of each reviewer's prompt.
-usage: larv-review review-folder | ruling-base | round-count | needs-scoring-run [- ...] | record-ruling | record-scoring [
- ...] | places | agreement | reviewer-header [--rerun]
+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,6 +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.
+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 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 checkout's todo.md and the committed history, 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.
@@ -110,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
@@ -126,12 +138,13 @@ from larv_review.history_changes import history_changes
from review_rules.review_folder import made_review_folder
from larv_review.ruling_base import measured_commit
from larv_review.agreement import MIN_PAIRS
+from larv_review.owed import owed_scoring_run
from review_rules.review_passes import PASSES, REVIEWERS
from larv_review.plan import plan_reasons
from larv_review.history_commands import record_ruling, record_scoring, show_agreement, show_places
from larv_review.reviewer_header import reviewer_header
-USAGE = "usage: larv-review review-folder | ruling-base | round-count | needs-scoring-run [
- ...] | record-ruling | record-scoring [
- ...] | places | agreement | reviewer-header [--rerun]"
+USAGE = "usage: larv-review review-folder | ruling-base | round-count | needs-scoring-run [
- ...] | scoring-run-owed | record-ruling | record-scoring [
- ...] | places | agreement | reviewer-header [--rerun]"
def main(argv: list[str]) -> int:
@@ -147,6 +160,8 @@ def main(argv: list[str]) -> int:
done = with_default_branch(round_count, stale_ok=True)
elif command == "needs-scoring-run" and all(re.fullmatch(r"[0-9]+", id_) for id_ in given):
done = with_default_branch(lambda default: needs_scoring_run(default, [int(id_) for id_ in given]), stale_ok=False)
+ elif command == "scoring-run-owed" and not given:
+ done = with_default_branch(owed, stale_ok=False)
elif command == "record-ruling" and len(given) == 1:
done = record_ruling(pathlib.Path(given[0]))
elif command == "record-scoring" and given and all(re.fullmatch(r"[0-9]+", id_) for id_ in given[1:]):
@@ -223,6 +238,13 @@ def cap_note(count: int, most: int) -> str:
return f", {'at' if count == most else 'past'} the cap: no more rounds"
+def owed(default: str) -> Failure | None:
+ unrecorded = owed_scoring_run(default)
+ if unrecorded is None:
+ print("No scoring run owed.")
+ return unrecorded
+
+
def needs_scoring_run(default: str, ids: list[int]) -> Failure | None:
reasons = plan_reasons(default, ids)
if isinstance(reasons, Failure):
diff --git a/bin/larv_review/owed.py b/bin/larv_review/owed.py
new file mode 100644
index 00000000..85d562f6
--- /dev/null
+++ b/bin/larv_review/owed.py
@@ -0,0 +1,56 @@
+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, 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 `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 has_plan(checkout):
+ return 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
+ 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 ''} 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" if needed > 1 else ""}")
+
+
+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]:
+ return [entry.heading for entry in entries(history) if not entry.paired]
diff --git a/bin/larv_review/plan.py b/bin/larv_review/plan.py
index facd184a..7a0a3607 100644
--- a/bin/larv_review/plan.py
+++ b/bin/larv_review/plan.py
@@ -2,28 +2,36 @@ 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
-def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], landed_release: Release | None, renamed: set[Release]) -> list[str] | Failure:
+# 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"
+
+
+def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], landed_release: Release | None, renamed: set[Release], unmeasured: str | None = None) -> list[str] | Failure:
"""Why the plan calls a scoring run, empty when it does not.
- A chunk that ships an item naming the floor is due one, so it can prove the floor met. So is a chunk that empties a release after work has landed towards it, so no release ends unmeasured. A release the chunk's plan marks renamed is due none.
+ A chunk that ships an item naming the floor is due one, so it can prove the floor met. So is a chunk that empties a release after work has landed towards it, so no release ends unmeasured. A release the chunk's plan marks renamed is due none. A chunk after a release `unmeasured_cut` names is due one too, so a release cut with no scoring run is caught up.
- before is the default branch's plan and after the chunk's. ships holds the IDs of the items the chunk ships. landed_release is the next release where work has landed towards it, else None (`landed_towards`). renamed holds the releases the chunk's plan marks renamed.
+ before is the default branch's plan and after the chunk's. ships holds the IDs of the items the chunk ships. landed_release is the next release where work has landed towards it, else None (`landed_towards`). renamed holds the releases the chunk's plan marks renamed. unmeasured is `unmeasured_cut`'s answer.
"""
plan = {item.id: item for item in before + after}
if unknown := sorted(set(ships) - set(plan)):
return Failure(f"neither plan holds item {', '.join(map(str, unknown))}")
shipped = [plan[id_] for id_ in ships]
reasons = [f"ships item {item.id}, which names the comprehension floor" for item in shipped if FLOOR_ITEM in item.tagline.lower()]
+ if unmeasured:
+ reasons.append(f"follows {unmeasured}")
for release in emptied(before, after, shipped, renamed):
if work_landed(release, shipped, landed_release):
# SKILL.md → "Second run" keys on this wording.
- reasons.append(f"leaves release {version(release)} with no plan item")
+ reasons.append(f"leaves release {version(release)} {EMPTIED_WORDS}")
return reasons
@@ -55,12 +63,17 @@ def emptied(before: list[Item], after: list[Item], shipped: list[Item], renamed:
return sorted(named - {item.release for item in kept} - renamed)
-def plan_reasons(default: str, ids: list[int]) -> list[str] | Failure:
- """Why the plan calls a scoring run, from the default branch's todo.md and the checkout's."""
+def plan_reasons(ref: str, ids: list[int] | None) -> list[str] | Failure:
+ """Why the plan calls a scoring run, from todo.md at ref and the checkout's; empty where the project opts out of the comprehension check. ref is the default branch, or the commit where the chunk began. Where ids is None, the chunk ships each item the plan at ref holds and the checkout's does not."""
checkout = top()
if isinstance(checkout, Failure):
return checkout
- held = default_plan(checkout, default)
+ decisions = file_at(ref, "docs/decisions.md", checkout)
+ if isinstance(decisions, Failure):
+ return decisions
+ if OPTED_OUT.search(decisions):
+ return []
+ held = default_plan(checkout, ref)
before = held.todo
if isinstance(before, Failure):
return before
@@ -73,14 +86,19 @@ def plan_reasons(default: str, ids: list[int]) -> list[str] | Failure:
if isinstance(planned, NoItemsTable):
planned = []
if isinstance(planned, Failure):
- return Failure(f"{default}'s todo.md: {planned.reason}")
+ return Failure(f"{ref}'s todo.md: {planned.reason}")
renamed = renames(after)
if isinstance(renamed, Failure):
return Failure(f"the checkout's todo.md: {renamed.reason}")
landed_release = landed_towards(planned, held.cut)
if isinstance(landed_release, Failure):
return landed_release
- return scoring_run_due(planned, chunk, ids, landed_release, renamed)
+ unmeasured = unmeasured_cut(ref, checkout)
+ if isinstance(unmeasured, Failure):
+ return unmeasured
+ if ids is None:
+ ids = sorted({item.id for item in planned} - {item.id for item in chunk})
+ return scoring_run_due(planned, chunk, ids, landed_release, renamed, unmeasured)
def checkout_plan(checkout: str) -> tuple[str, list[Item]] | Failure:
diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py
index f7a8a488..194284de 100644
--- a/bin/larv_review/test_larv_review.py
+++ b/bin/larv_review/test_larv_review.py
@@ -12,7 +12,7 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from larv_review.agreement import agreement_report, ruling_agreement, run_agreement
from review_rules.comprehension_history import appended, entries, HistoryChange, latest_places, Place, recorded, ruling_entry, scoring_entry, ScoringRun, Seat
-from larv_review.plan import checkout_plan, landed_towards, plan_reasons, scoring_run_due
+from larv_review.plan import checkout_plan, EMPTIED_WORDS, landed_towards, plan_reasons, scoring_run_due
from review_rules import comprehension_history
from larv_review.ruling import counted, ruling, split, surplus, votes
from larv_review.history_commands import decided
@@ -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,20 @@ 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_skill_md_names_the_words_that_end_the_reason_a_release_empties(self):
+ self.assertIn(EMPTIED_WORDS, (pathlib.Path(__file__).resolve().parents[2] / "skills" / "larv-review" / "SKILL.md").read_text(encoding="utf-8"))
+
+ 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()
@@ -502,6 +517,128 @@ class LarvReviewTool(unittest.TestCase):
self.assertEqual(self.run_tool("needs-scoring-run").stdout, "No scoring run due.\n")
self.assertIn("todo.md's ID column", self.run_tool("needs-scoring-run", "item-85").stderr)
+ def test_a_scoring_run_that_a_release_ending_chunk_owes_is_refused_until_the_branch_records_two(self):
+ rest = ("| 2 | 0.2.0 | | **Then this.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |", "| 3 | 0.2.0 | | **And this.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |")
+ self.commit("Ship item 1", {"todo.md": todo(*rest)})
+ 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:", owed.stderr)
+ history = "# Comprehension history\n\n" + SCORING
+ self.commit("Record a run", {"docs/comprehension-history.md": history})
+ 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)
+
+ def test_a_scoring_run_the_floor_calls_is_owed_once(self):
+ row = "| 1 | 0.1.0 | | **Do it.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |"
+ other = "| 3 | 0.2.0 | | **And this.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |"
+ self.commit("Plan the floor item", {"todo.md": todo(row, "| 2 | 0.2.0 | | **Reach the comprehension floor.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |", other)})
+ self.git("push", "-q", "origin", "HEAD:main")
+ self.commit("Ship it", {"todo.md": todo(row, other)})
+ self.assertIn("names the comprehension floor", self.run_tool("scoring-run-owed").stderr)
+ self.commit("Record a run", {"docs/comprehension-history.md": "# Comprehension history\n\n" + SCORING})
+ self.assertEqual(self.run_tool("scoring-run-owed").returncode, 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.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"})
+ self.git("push", "-q", "origin", "HEAD:main")
+ 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").stdout, "No scoring run owed.\n")
+ (self.checkout / "todo.md").write_bytes(b"\xff\xfe")
+ self.git("add", "todo.md")
+ self.commit("Break the plan")
+ self.assertEqual(self.run_tool("scoring-run-owed").returncode, 1, "a plan that can't be read is no plan the gate may skip")
+
+ 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")
+ self.ship_item_1()
+ self.commit("Ship item 1 and record a run", {"docs/comprehension-history.md": "# Comprehension history\n\n" + SCORING.replace("PR #1", "PR #7")})
+ self.assertIn("owes 2 scoring runs and the branch's committed history records 1:", self.run_tool("scoring-run-owed").stderr, "main's own run is no credit to the branch")
+
+ def release(self, tag, date, files=None):
+ """Cut tag on the default branch at a commit dated date."""
+ self.env["GIT_COMMITTER_DATE"] = date
+ self.addCleanup(self.env.pop, "GIT_COMMITTER_DATE", None)
+ self.commit(f"Release {tag}", files)
+ self.git("tag", tag)
+ self.git("push", "-q", "origin", "HEAD:main")
+
+ def test_a_release_cut_with_no_scoring_run_since_the_one_before_it_calls_one_and_a_later_run_ends_that(self):
+ self.release("v0.0.1", "2026-10-09T12:00:00Z")
+ self.release("v0.0.2", "2026-10-20T12:00:00Z", {"docs/comprehension-history.md": "# Comprehension history\n\n" + SCORING})
+ 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.1.\n")
+ self.assertEqual(self.run_tool("scoring-run-owed").returncode, 1)
+ self.commit("Record a run", {"docs/comprehension-history.md": "# Comprehension history\n\n" + SCORING + "\n" + SCORING.replace("PR #1 at", "PR #2 at")})
+ self.assertEqual(self.run_tool("scoring-run-owed").returncode, 0)
+ 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")
+
def test_calls_a_scoring_run_for_a_deferred_release_and_none_for_one_the_checkouts_plan_marks_renamed(self):
rows = ("| 1 | 0.2.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 |", "| 3 | 0.2.0 | | **And this.** | 1 | 1 | 3 | 1 | 1 | 1 | 9.0 |")
self.commit("Move 0.1.0's item to 0.2.0", {"todo.md": todo(*rows)})
diff --git a/bin/larv_review/unmeasured.py b/bin/larv_review/unmeasured.py
new file mode 100644
index 00000000..f20d32c0
--- /dev/null
+++ b/bin/larv_review/unmeasured.py
@@ -0,0 +1,36 @@
+import datetime
+
+from review_rules.comprehension_history import entries, HISTORY
+from failure import Failure
+from git_cli.git_repo import file_at, git
+
+
+def unmeasured_cut(default: str, checkout: str) -> str | None | Failure:
+ """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.
+
+ 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.
+ """
+ # Sorts v1.0.0-rc.1 below v1.0.0, as release.newest_tag does.
+ tags = git("-c", "versionsort.suffix=-", "tag", "--list", "v*", "--merged", default, "--sort=-v:refname", cwd=checkout)
+ if isinstance(tags, Failure):
+ return tags
+ newest, earlier, *_ = [*tags.split(), None, None]
+ if earlier is None:
+ return None
+ since = git("log", "-1", "--format=%ct", earlier, cwd=checkout)
+ history = file_at(default, HISTORY, checkout)
+ if isinstance(since, Failure) or isinstance(history, Failure):
+ return since if isinstance(since, Failure) else history
+ if any(at > int(since) for at in (seconds(entry.time) for entry in entries(history) if not entry.paired)):
+ return None
+ return f"{newest}, cut with no scoring run since {earlier}"
+
+
+def seconds(heading_time: str) -> float:
+ """A history heading's UTC time as seconds since the epoch; 0 where it doesn't parse."""
+ try:
+ return datetime.datetime.strptime(heading_time, "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=datetime.timezone.utc).timestamp()
+ except ValueError:
+ return 0
diff --git a/docs/comprehension-history.md b/docs/comprehension-history.md
index af586aa0..cd31ccdc 100644
--- a/docs/comprehension-history.md
+++ b/docs/comprehension-history.md
@@ -3435,3 +3435,46 @@ Inherited architect, decided by:
- Locality, Shape: `bin/loop_claude/routing.py:84` `next_route`: each verdict kind has its own function, and `steps` and `below_cap` name the two conditions
- Locality: `bin/model_routing/route.py:88` `route_of`: the archive line and the reload hand-over decode a Route through one decoder
- Shape: `bin/loop_claude/loop/main.py:66` `next_cycle`: signatures of seven or eight positional parameters shrink to `(loop_run, loop)`
+
+## 2026-11-10T23:11:34Z, PR #473 at 13d1550
+
+| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall |
+|---|---|---|---|---|---|
+| Junior A | 7 | 5.5 | 6 | 6 | 6 |
+| Mid A | 7 | 5.5 | 6 | 6.5 | 6 |
+| Maintainability senior | 7 | 5.5 | 6 | 6 | 6 |
+| Inherited architect | 7 | 5.5 | 6 | 7 | 6 |
+| Mean | 7.00 | 5.50 | 6.00 | 6.38 | 6.00 |
+
+Junior A, hardest first:
+
+- Locality, Shape: `bin/loop_claude/routing.py:93` `unfinished_route`: the floor rung, the escalation mark, the unfinished count and the cap are held at once, with escalation_mark.py open beside it
+- Locality, Shape: `bin/larv_review/plan.py:66` `plan_reasons`: eight failure branches mix git reads, file reads and logic, and a parameter named `default` receives a merge-base commit
+- Locality: `bin/larv_review/owed.py:37` `shortfall`: whether one or two runs are owed hangs on the wording of an English sentence that SKILL.md also keys on
+- Shape: `bin/loop_claude/cycle/run.py:59` `run_cycle`: four near-identical archive helpers and a route replaced partway through the loop
+- Shape: `bin/release_plan/ranking.py:56` `rank`: nearly every function forks on the table's two shapes
+- Self-sufficiency: `skills/larv-review/SKILL.md:147` "Scoring run": dense rule prose with many cross-references, three sections to rebuild one rule
+
+Mid A, hardest first:
+
+- Locality, Shape: `bin/larv_review/plan.py:66` `plan_reasons`: `default` holds a merge-base commit on one call path and `after` means the checkout's text, then its items
+- Locality: `bin/loop_claude/routing.py:93` `unfinished_route`: six concepts meet in about twelve lines and need four modules open beside it
+- Locality: `bin/larv_review/owed.py:37` `shortfall`: a rule keyed on the text of a sentence that plan.py builds, and `scoring_runs` defines a scoring run differently from `Entry.scored`
+- Locality: `bin/loop_claude/cycle/judge.py:211` `quotes_checked`: a verdict is rewritten four times, half the behaviour in prompt prose and half in code
+- Shape: `bin/release_plan/ranking.py:304` `score`: every function branches on the old and the current table shape
+
+Maintainability senior, hardest first:
+
+- Locality, Shape: `bin/larv_review/plan.py:66` `plan_reasons`: a merge-base commit enters the parameter named for the default branch, and its error text would print the commit as a branch
+- Locality: `bin/larv_review/owed.py:37` `shortfall`: the one-run-or-two rule is spread over three files and a skill document
+- Locality, Shape: `bin/loop_claude/routing.py:93` `unfinished_route`: the six inputs interlock and a wrong answer runs the worker on the wrong rung without failing
+- Locality: `bin/model_routing/route.py:88` `route_of`: a route has two serializations, a flat archive line and a nested handover
+- Self-sufficiency: `bin/larv_review/plan.py:66` `plan_reasons`: its docstring doesn't say the first argument may be a commit
+
+Inherited architect, would restructure first:
+
+- Navigation, Shape: `bin/larv_review/owed.py:10` `owed_scoring_run`: the name gives the merge gate's question, not the module's subject, and the scoring-run logic sits in three files whose imports read as circular
+- Locality: `bin/larv_review/plan.py:14` `EMPTIED_WORDS`: prose and code share an exact string that SKILL.md keys on
+- Locality: `bin/loop_claude/routing.py:93` `unfinished_route`: routing logic spreads over about eight places, so a new trigger touches five files in three packages
+- Shape: `bin/rule_hook/rules.py:25` `RULES`: rules sit inline in one module while five others have a module each
+- Navigation: `bin/` README.md:116 "bin/": 56 entries in one flat list, the worst fan-out level
diff --git a/docs/reading-cost.md b/docs/reading-cost.md
index bdfa96a5..f94e43cc 100644
--- a/docs/reading-cost.md
+++ b/docs/reading-cost.md
@@ -1528,3 +1528,11 @@ Read most (opens and searches):
Read most (opens and searches):
- `todo.md` 5
+
+## Reading cost, chunk 31a25a029608, finished 2026-11-10T22:36:58Z
+
+40731 new input tokens before the first commit.
+
+Read most (opens and searches):
+
+- `todo.md` 1
diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md
index c18e27e4..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,7 +144,7 @@ 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.
@@ -194,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.
diff --git a/todo.md b/todo.md
index 4c162878..5dadb141 100644
--- a/todo.md
+++ b/todo.md
@@ -6,13 +6,12 @@
`Bar = 0.1`
-`Next ID = 300`
+`Next ID = 301`
## Items
| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |
|---|---|---|---|---|---|---|---|---|---|---|---|
-| 296 | 0.8.0 | | | **Run the scoring run that releases 0.5.0 to 0.7.0 skipped, and make a due scoring run fail a check the worker cannot dismiss.** | 2 | 2 | 3 | 5 | 3 | code health by 4 | 7.2 |
| 294 | 0.8.0 | | | **Check the files a commit stages against rule-hook's file rules, so a file a Bash command wrote is held to them as an Edit or Write is.** | 2 | 2 | 3 | 5 | 4 | 1.3 by 5 | 5.2 |
| 297 | 0.8.0 | | | **Have loop-claude compute the judge's taken-in items, release-ready and escalation fields from `chunk-preflight`, git and the worker's structured lines, and leave the judge only the verdict kind.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 2, code health by 2 | 3.7 |
| 293 | 0.8.0 | | | **Run mutation tests on a chunk's changed lines in the worker's pre-review gate, through one command that picks the tool by language, and hand stability-reviewer the surviving mutants.** | 3 | 2 | 3 | 6 | 5 | 1.1 by 5, 1.4 by 4, 1.5 by 2 | 2.8 |
@@ -28,6 +27,7 @@
| 273 | 0.9.0 | | decision | **Re-tune the E + I steps of `REVIEW_STEPS` for 6 to 8 once 10 finished chunks have scored an E + I of 6 or more, from how well E + I orders their review rounds and 🔴 findings.** | 1 | 2 | 2 | 3 | 2 | 1.1 by 2, 1.4 by 3 | 2.3 |
| 268 | 0.9.0 | | | **End a run whose release is ready to cut with a notice on loop-claude's terminal, in place of an interrupt that waits for an answer.** | 2 | 2 | 3 | 5 | 3 | 1 by 5 | 2.2 |
| 171 | 0.9.0 | | decision | **Group the routing figures' review rounds by the reviewers' rung as well as the worker's, so a call blames a rung only for rounds its own reviews raised.** | 3 | 2 | 2 | 5 | 4 | 1.2 by 3, 1.4 by 3 | 2.0 |
+| 300 | 0.9.0 | | owner | **Restructure the places the comprehension seats found hardest to follow, so the project reads at 7.0 or above on every dimension, Locality first: today the comprehension floor run at 13d1550 scored Locality 5.50, Shape 6.00, Self-sufficiency 6.38 and Overall 6.00.** | 4 | 2 | 3 | 7 | 8 | code health by 8 | 2.0 |
| 264 | 0.9.0 | | | **Report the comprehension seats and the escalated subagents as subagent types of their own in `routing-figures.md`, with their dollars.** | 2 | 2 | 1 | 3 | 3 | 1.4 by 5 | 2.0 |
| 149 | 0.9.0 | | decision | **Fill each release by priority up to a capacity it states, in place of the bar, and move what does not fit to a later release.** | 4 | 2 | 3 | 7 | 5 | 1.1 by 7 | 1.8 |
| 165 | 0.9.0 | | | **Make this repo's tests assert the facts a prompt or help text carries in place of its sentences, and drop the tests that scan source or assert a constant.** | 3 | 2 | 1 | 4 | 5 | 1.1 by 4, 1.4 by 3 | 1.8 |
@@ -59,10 +59,6 @@
## Details
-### 296. Run the scoring run that releases 0.5.0 to 0.7.0 skipped, and make a due scoring run fail a check the worker cannot dismiss.
-
-The last scoring run in `docs/comprehension-history.md` is from 2026-10-29: overall 6.00, Locality 5.63, under the 7.0 floor. v0.5.0, v0.6.0 and v0.7.0 were cut without one, and `larv-review places` still prints that run's places, 254 commits stale. Workers twice dismissed `needs-scoring-run`'s due line as preflight reading a stale branch's plan; find why before choosing the check. Without a run, the floor item the scoring run files under 7.0 never fires.
-
### 294. Check the files a commit stages against rule-hook's file rules, so a file a Bash command wrote is held to them as an Edit or Write is.
From 2026-11-08 to 2026-11-10, workers in other projects wrote 1,266 files through Bash (a python heredoc, `sed -i`, `cat >`) against 260 through Edit and Write, and `rule-hook --help` says it doesn't check a file a Bash command writes. So `action-pin`, `image-pin`, `ignorefile-sorted` and the attribution check miss most edits. rule-hook already checks at `git commit` for `todo-rank-check`, so checking staged files there follows a pattern the repo has. Ship item 192 in the same chunk: its unsorted `.gitignore` block is one symptom of this gap.
@@ -161,6 +157,27 @@ Releases are the human's, and `CLAUDE.md` → "Working loop" already ends the lo
Raised by the goals audit of PR #296. `bin/routing_figures/calls.py` groups a chunk's review rounds by the rung its worker started on, and calls for a routing change when a lower rung took more of them. Since PR #296 the reviewers may run above the worker's rung, on the one their item's E + I picks, and no figure groups rounds by it, though the archived worker line names the E + I it follows from. A cheap worker on an item of high E + I gets stronger reviewers, who may raise more rounds, and a call could then blame the worker's rung for them: an interrupt of lilleman that settles nothing (goal 1.2).
+### 300. Restructure the places the comprehension seats found hardest to follow, so the project reads at 7.0 or above on every dimension, Locality first: today the comprehension floor run at 13d1550 scored Locality 5.50, Shape 6.00, Self-sufficiency 6.38 and Overall 6.00.
+
+Filed by the comprehension check of PR #473 at 13d1550 (`larv-review record-scoring`), which printed `Floor:` and `Next:`. The lowest mean is Locality, 5.50. Refresh this item's places and aim from the newest run before the chunk starts; do not file a second floor item.
+
+Aim: one ambitious refactor of the areas below, sized so every mean reaches 7.0 on the chunk's own scoring run. Where a place is already easier to read when the chunk starts, drop it.
+
+Places the seats named, hardest first (`larv-review places`):
+
+- Locality, Shape: `bin/loop_claude/routing.py:93` `unfinished_route`: the floor rung, the escalation mark, the unfinished count and the cap are held at once, and the logic spreads over about eight places in three packages.
+- Locality, Shape: `bin/larv_review/plan.py:66` `plan_reasons`: a merge-base commit enters the parameter that item 296's chunk renamed `ref`, eight failure branches mix git reads, file reads and logic, and `after` means the checkout's text and then its items.
+- Locality: `bin/larv_review/owed.py:37` `shortfall`: the one-run-or-two rule is keyed on the wording `EMPTIED_WORDS` that plan.py builds and SKILL.md quotes; `scoring_runs` defines a scoring run differently from `Entry.scored`. Give the scoring-run logic one module, and have the number of runs owed come from a value, not from a sentence.
+- Locality: `bin/loop_claude/cycle/judge.py:211` `quotes_checked`: a verdict is rewritten four times, half the behaviour in prompt prose and half in code.
+- Locality: `bin/model_routing/route.py:88` `route_of`: a route has two serializations, a flat archive line and a nested handover.
+- Shape: `bin/release_plan/ranking.py:56` `rank` and `:304` `score`: nearly every function forks on the table's two shapes; item 156 removes the old one.
+- Shape: `bin/loop_claude/cycle/run.py:59` `run_cycle`: four near-identical archive helpers and a route replaced partway through the loop.
+- Shape: `bin/rule_hook/rules.py:25` `RULES`: rules sit inline in one module while five others have a module each.
+- Navigation: `README.md:116` `bin/`: 56 entries in one flat list, the worst fan-out level.
+- Self-sufficiency: `skills/larv-review/SKILL.md:147` "Scoring run": dense rule prose with many cross-references; three sections rebuild one rule.
+
+Scored L 4 because the refactor touches several components that hold known defects, E 2 because review and a manual check see a regression, I 3 because every session runs these tools. The chunk runs a scoring run, since its tagline names the comprehension floor.
+
### 264. Report the comprehension seats and the escalated subagents as subagent types of their own in `routing-figures.md`, with their dollars.
Seats launch as `general-purpose`, so they hide inside that type: $301.24 of the $962.17 the figures of 2026-11-04 count, from 221 subagents. By 2026-11-10 general-purpose was the second-largest spend, $585 of about $2,385, and by transcript size about two thirds of it were seats (291 launches), then 177 security passes. Escalations are counted by trigger only, never in dollars. `bin/routing_figures/chunk.py` groups subagents by their `subagent_type`; a seat is told apart by its prompt, and an escalated subagent by the escalation marker its prompt opens with.