From 9de87e04cf55acd769fa42c05e210b5a585105db Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 9 Oct 2026 11:04:01 +0200 Subject: [PATCH] Answer architecture round 2: fail a place naming no dimension, keep a ratchet until a ruling follows, leave the base on a fall-called run, let record-scoring say whether the floor blocks, and name the missing dimension in a discounted vote --- CHANGELOG.md | 2 +- bin/larv_review/history.py | 12 ++-- bin/larv_review/main.py | 73 +++++++++++++--------- bin/larv_review/rules.py | 29 +++++++-- bin/test_larv_review.py | 27 +++++--- docs/decisions.md | 2 +- skills/comprehension-panel/seat-prompts.md | 2 +- skills/larv-review/SKILL.md | 4 +- 8 files changed, 95 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39b0d0c4..ce21dcc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- larv-review's paired ruling takes each seat's vote on each dimension too: `Navigation same, Locality worse, Shape same, Self-sufficiency same, Overall better`. A better or same ruling in which a dimension fell calls a scoring run, and counts as worse, blocking the merge, when that dimension's mean is under the floor. A dimension's vote counts only where the seat names a place under that dimension. +- larv-review's paired ruling takes each seat's vote on each dimension too: `Navigation same, Locality worse, Shape same, Self-sufficiency same, Overall better`. A better or same ruling in which a dimension fell calls a scoring run, and counts as worse, blocking the merge, when that dimension's mean is under the floor. Such a run blocks on the fallen dimensions alone and leaves the ratchet's base in place unless the ruling is better. Each place a seat names must name the dimensions it moves, spelled as in the seat's line, or the run fails; a dimension's vote counts only where one of the seat's places names it. `record-scoring` takes the shipped item IDs too and prints `Floor:` when the means under the floor block the merge. - larv-review's mechanical rules run in the new, tested `bin/larv-review`: the paired ruling's base (`ruling-base`), each pass's round count (`round-count`), the scoring run's trigger (`needs-scoring-run ...`), and the vote count, means and history format (`record-ruling` and `record-scoring`, which read a seats file and append to `docs/comprehension-history.md`). The skill says when to run each and what its answer means. A seats file line the tool cannot read fails the run, so a mistyped vote never counts as same. The base search compares the history before and after each merged change, so it no longer depends on how a line is worded, and orders a change's rulings by their headings' times. A release whose last plan item moves to another release is due a scoring run too, once work has landed towards it. A seats file must name commits the checkout holds. Scores a `comprehension floor:` decision entry still holds move into the history through `record-scoring`, as a `Mean:` line. When origin cannot be fetched, the tool reads it as last fetched and says so. - The new `bin/metric-bench` benches cheap static metrics of a project's Python against the places its comprehension history names as hardest: cognitive complexity, length, shared state and change spread, each scored by how well it ranks the named functions above the rest. No metric enters review yet. - larv-review blocks a merge when simulated readers rule that the PR makes the project read worse than the last measured commit: the default branch's newest merged change that added a scoring run to `docs/comprehension-history.md`, or whose last ruling there is better. A ruling of same leaves that commit in place, so a worse ruling may name places earlier chunks wrote. In each architecture pass Mid A and the inherited architect vote better, same or worse; when they disagree, the maintainability senior and Junior A vote too. A ruling needs a lead of two or more votes, else it is same, and a vote that names no place counts as same. A worse ruling never ships: after three rounds larv-review asks you for another round, a no leaves the PR unmerged, and so does an unattended run. The four-seat scoring run checks the comprehension floor only when a chunk ships or removes a release's last plan item, or ships an item naming the floor; between those runs the floor blocks only a dimension a paired ruling finds fallen. A score under the floor blocks the merge until fixed or until you decide to ship; a decision in `docs/decisions.md` that lets every chunk ship under the floor counts as yours. diff --git a/bin/larv_review/history.py b/bin/larv_review/history.py index b3ac3c47..bfb2530d 100644 --- a/bin/larv_review/history.py +++ b/bin/larv_review/history.py @@ -115,14 +115,16 @@ def appended(history: str, entry: str) -> str: def ruling_entry(title: str, seats: list[Seat], said: dict[str, list[str]], counted: dict[str, list[str]], ruled: str, fell: list[str]) -> str: - """A paired ruling's entry, with a `Fell:` line when it is better or same and fell names dimensions; a seat's vote that counted as same for naming no place says so.""" - votes = [[seat.name, *map(vote_text, said[seat.name], counted[seat.name])] for seat in seats] - lines = [f"Ruling: {ruled}"] + ([f"Fell: {', '.join(fell)}"] if ruled != "worse" and fell else []) + """A paired ruling's entry, with a `Fell:` line when fell names dimensions; a seat's vote that counted as same for want of a place says so.""" + votes = [[seat.name, *map(vote_text, DIMENSIONS, said[seat.name], counted[seat.name])] for seat in seats] + lines = [f"Ruling: {ruled}"] + ([f"Fell: {', '.join(fell)}"] if fell else []) return entry_text(title, lines, [["Seat", *DIMENSIONS], *votes], [(f"{seat.name}, {DECIDED_BY}:", seat.places) for seat in seats]) -def vote_text(said: str, counted: str) -> str: - return counted if counted == said else f"same (voted {said}, naming no place)" +def vote_text(dimension: str, said: str, counted: str) -> str: + if counted == said: + return counted + return f"same (voted {said}, naming no place)" if dimension == DIMENSIONS[-1] else f"same (voted {said}, no place naming {dimension})" def scoring_entry(title: str, seats: list[Seat], scores: dict[str, list[str]], means: list[str], lines: list[str]) -> str: diff --git a/bin/larv_review/main.py b/bin/larv_review/main.py index f6822e06..8600bf44 100644 --- a/bin/larv_review/main.py +++ b/bin/larv_review/main.py @@ -9,8 +9,8 @@ read origin as last fetched and say so on stderr; the other two exit 1. The hist docs/comprehension-history.md in the checkout. ruling-base prints the commit a paired ruling reads against, then which of these found it. The last -measured commit is the default branch's newest merged change that adds a scoring run to the -history, or whose last added paired ruling, by heading time, is better; a merge commit counts as +measured commit is the default branch's newest merged change whose last added paired ruling, by +heading time, is better, or that adds a scoring run to the history while that ruling names no fall; a merge commit counts as one change against its first parent. With none, the base is the one the history's first paired ruling names; with no ruling either, it is the merge base of HEAD and the default branch. @@ -37,30 +37,34 @@ opens with its label, written exactly: `Junior A:`, `Mid A:`, `Maintainability s Mid A: Navigation same, Locality worse, Shape same, Self-sufficiency same, Overall worse - - `bin/x.py:12` `run`: three branches to hold at once + - `bin/x.py:12` `run`: Locality: three branches to hold at once Inherited architect: Navigation same, Locality worse, Shape same, Self-sufficiency same, Overall worse - - `bin/x.py:12` `run`: ... + - `bin/x.py:12` `run`: Locality: ... record-ruling takes Mid A's and the inherited architect's votes on each dimension and overall, -each better, same or worse. A dimension's vote counts as same unless one of the seat's places in +each better, same or worse. Each place names the dimensions it moves, or Overall, spelled as the +seat's line spells them. A dimension's vote counts as same unless one of the seat's places in backticks, `path:line`, names that dimension; the overall vote counts as same unless the seat names -any place. The printed votes say so. When the two counted overall votes differ, it appends +any such place. The printed votes say so. When the two counted overall votes differ, it appends nothing and prints `Split:`, saying to add the maintainability senior's and Junior A's lines. Otherwise the ruling is the overall vote that leads each other vote by two or more, else same; it prints `Ruling:` and appends the ruling. A dimension falls when its worse votes lead each other vote by two or more. Unless the ruling is worse, it prints and records a `Fell:` line naming each. -record-scoring takes Junior A's, Mid A's, the maintainability senior's and the inherited +record-scoring takes a seats file and the IDs of the items the chunk ships, as needs-scoring-run +does. The file holds Junior A's, Mid A's, the maintainability senior's and the inherited architect's lines in that order, or a `Mean:` line alone for a run moved from a decision entry. Each line is `Navigation , Locality , Shape , Self-sufficiency , Overall `, each score from 1 to 10 and the overall at most 1 above the line's lowest dimension. Its first line names no `, against`. It appends the seats' scores and their means, rounded half up to two -decimals, and prints the means and each one under the floor of {floor}. When the history ends on a +decimals, and prints the means and each one under the floor of {floor}. A `Floor:` line says the +means under the floor block the merge, as they do when needs-scoring-run would give a reason +besides a fall. When the history ends on a paired ruling with a `Fell:` line, it says whether the ruling stands; when a dimension that fell is under the floor, the ruling counts as worse, and it prints and records a `Ratchet:` line, which -needs-scoring-run repeats until a paired ruling follows it. Both read only the entries the default +needs-scoring-run repeats as `Still standing:` until a paired ruling follows it. Both read only the entries the default branch's history lacks. Each record is appended to the history, created when missing, under a heading of the current UTC @@ -79,14 +83,14 @@ import time import typing from larv_review.history import appended, Entry, heading, ruling_entry, scoring_entry, vote_text -from larv_review.rules import base, CAP, chunk_entries, counted, fall_outcome, fallen, FLOOR, means, PASSES, pending_fall, plan_items, round_counts, ruling, scoring_run_due, standing_ratchet, under_floor, votes +from larv_review.rules import base, CAP, chunk_entries, counted, fall_outcome, fallen, FLOOR, floor_verdict, means, PASSES, pending_fall, plan_items, round_counts, ruling, scoring_run_due, standing_ratchet, under_floor, votes from larv_review.git import commit_exists, default_branch, file_at, git, HISTORY, history_changes, landed_since_release, top from larv_review.seats import DIMENSIONS, MEAN, Report, report, score_line, scores from failure import Failure from rank_todo import ITEMS_HEADER from file_writes import replace_file -USAGE = "usage: larv-review ruling-base | round-count | needs-scoring-run [...] | record-ruling | record-scoring " +USAGE = "usage: larv-review ruling-base | round-count | needs-scoring-run [...] | record-ruling | record-scoring [...]" def main(argv: list[str]) -> int: @@ -102,10 +106,10 @@ def main(argv: list[str]) -> int: done = with_default_branch(lambda default: needs_scoring_run(default, [int(id_) for id_ in given]), stale_ok=False) elif command == "record-ruling" and len(given) == 1: done = record_ruling(pathlib.Path(given[0])) - elif command == "record-scoring" and len(given) == 1: - done = with_default_branch(lambda default: record_scoring(default, pathlib.Path(given[0])), stale_ok=True) - elif command == "needs-scoring-run": - print(f"needs-scoring-run takes item IDs, the numbers in todo.md's ID column: {' '.join(given)}", file=sys.stderr) + elif command == "record-scoring" and given and all(re.fullmatch(r"[0-9]+", id_) for id_ in given[1:]): + done = with_default_branch(lambda default: record_scoring(default, pathlib.Path(given[0]), [int(id_) for id_ in given[1:]]), stale_ok=True) + elif command in ("needs-scoring-run", "record-scoring") and given: + print(f"{command} takes item IDs, the numbers in todo.md's ID column: {' '.join(given)}", file=sys.stderr) return 1 elif not argv: print(USAGE, file=sys.stderr) @@ -156,6 +160,20 @@ def round_count(default: str) -> Failure | None: def needs_scoring_run(default: str, ids: list[int]) -> Failure | None: + recorded = chunk_history(default) + if isinstance(recorded, Failure): + return recorded + reasons = due_reasons(default, ids, pending_fall(recorded)) + if isinstance(reasons, Failure): + return reasons + print(f"Scoring run due: the chunk {' and '.join(reasons)}." if reasons else "No scoring run due.") + if ratchet := standing_ratchet(recorded): + print(f"Still standing: {ratchet} Fix it and rule again.") + return None + + +def due_reasons(default: str, ids: list[int], fell: list[str]) -> list[str] | Failure: + """Why the chunk is due a scoring run, from the default branch's plan and the checkout's.""" checkout = top() if isinstance(checkout, Failure): return checkout @@ -176,16 +194,7 @@ def needs_scoring_run(default: str, ids: list[int]) -> Failure | None: landed = landed_since_release(default) if isinstance(landed, Failure): return landed - recorded = chunk_history(default) - if isinstance(recorded, Failure): - return recorded - reasons = scoring_run_due(planned, chunk, ids, landed, pending_fall(recorded)) - if isinstance(reasons, Failure): - return reasons - print(f"Scoring run due: the chunk {' and '.join(reasons)}." if reasons else "No scoring run due.") - if ratchet := standing_ratchet(recorded): - print(f"Still standing: {ratchet} Fix it and rule again.") - return None + return scoring_run_due(planned, chunk, ids, landed, fell) def chunk_history(default: str) -> list[Entry] | Failure: @@ -208,19 +217,19 @@ def record_ruling(seats_file: pathlib.Path) -> Failure | None: if isinstance(said, Failure): return said count = counted(given.seats, said) - tally = ", ".join(f"{seat.name} {vote_text(said[seat.name][-1], count[seat.name][-1])}" for seat in given.seats) + tally = ", ".join(f"{seat.name} {vote_text(DIMENSIONS[-1], said[seat.name][-1], count[seat.name][-1])}" for seat in given.seats) ruled = ruling([each[-1] for each in count.values()]) if ruled is None: print(f"Split: {tally}. Launch the maintainability senior and Junior A together, add their lines to the seats file, and run this again.") return None - fell = fallen(count) + fell = fallen(count) if ruled != "worse" else [] print(f"Ruling: {ruled}. Overall votes as counted: {tally}.") - if ruled != "worse" and fell: + if fell: print(f"Fell: {', '.join(fell)}. A scoring run is due; the ruling counts as worse if it puts {' or '.join(fell)} under the floor of {FLOOR}.") return append(ruling_entry(title, given.seats, said, count, ruled, fell)) -def record_scoring(default: str, seats_file: pathlib.Path) -> Failure | None: +def record_scoring(default: str, seats_file: pathlib.Path, ids: list[int]) -> Failure | None: read = read_seats(seats_file, paired=False) if isinstance(read, Failure): return read @@ -232,11 +241,13 @@ def record_scoring(default: str, seats_file: pathlib.Path) -> Failure | None: if isinstance(moved, Failure): return moved mean = means(list(found.values()) or [moved]) - under = under_floor(mean) - print(f"Means: {', '.join(f'{name} {value}' for name, value in zip(DIMENSIONS, mean))}. {f'Under the floor of {FLOOR}: ' + ', '.join(under) if under else f'None under the floor of {FLOOR}'}.") recorded = chunk_history(default) if isinstance(recorded, Failure): return recorded + blocking = due_reasons(default, ids, []) + if isinstance(blocking, Failure): + return blocking + print(f"Means: {', '.join(f'{name} {value}' for name, value in zip(DIMENSIONS, mean))}. {floor_verdict(under_floor(mean), blocking)}") outcome = fall_outcome([] if given.moved_mean else pending_fall(recorded), mean) if outcome: print(outcome[0]) diff --git a/bin/larv_review/rules.py b/bin/larv_review/rules.py index cefcb28a..413d464c 100644 --- a/bin/larv_review/rules.py +++ b/bin/larv_review/rules.py @@ -23,6 +23,8 @@ def votes(seats: list[Seat]) -> dict[str, list[str]] | Failure: line = vote_line(seat.name, seat.said) if isinstance(line, Failure): return line + if unnamed := [place for place in seat.places if not any(re.search(rf"\b{name}\b", place) for name in DIMENSIONS)]: + return Failure(f"{seat.name}'s place names none of {', '.join(DIMENSIONS)}, spelled so: {unnamed[0]}") said[seat.name] = line first, second, *more = (each[-1] for each in counted(seats, said).values()) if more and first == second: @@ -31,12 +33,12 @@ def votes(seats: list[Seat]) -> dict[str, list[str]] | Failure: def counted(seats: list[Seat], said: dict[str, list[str]]) -> dict[str, list[str]]: - """Each seat's votes as they count: a dimension's vote counts as same unless one of the seat's `path:line` places names that dimension, and the overall vote unless the seat names any place.""" + """Each seat's votes as they count: a dimension's vote counts as same unless one of the seat's `path:line` places names that dimension, and the overall vote unless the seat names any such place.""" return {seat.name: [vote if names_a_place(seat, name) else "same" for name, vote in zip(DIMENSIONS, said[seat.name])] for seat in seats} def names_a_place(seat: Seat, dimension: str) -> bool: - return any(PLACE.search(place) and (dimension == DIMENSIONS[-1] or dimension.lower() in place.lower()) for place in seat.places) + return any(PLACE.search(place) and (dimension == DIMENSIONS[-1] or re.search(rf"\b{dimension}\b", place)) for place in seat.places) def ruling(counted: list[str]) -> str | None: @@ -66,8 +68,22 @@ def pending_fall(chunk: list[Entry]) -> list[str]: def standing_ratchet(chunk: list[Entry]) -> str | None: - """The `Ratchet:` line of the chunk's newest entry, which no paired ruling has followed yet.""" - return chunk[-1].ratchet if chunk else None + """The chunk's newest `Ratchet:` line, unless a paired ruling has followed it.""" + for entry in reversed(chunk): + if entry.paired: + return None + if entry.ratchet: + return entry.ratchet + return None + + +def floor_verdict(under: list[str], reasons: list[str]) -> str: + """Whether the means under the floor block the merge: they do on a run due for a reason besides a fall.""" + if not under: + return f"None under the floor of {FLOOR}." + if reasons: + return f"Floor: {', '.join(under)} under the floor of {FLOOR} block the merge, as the chunk {' and '.join(reasons)}." + return f"Under the floor of {FLOOR}, blocking nothing on a run due for no reason besides a fall: {', '.join(under)}." def fall_outcome(fell: list[str], found: list[decimal.Decimal]) -> tuple[str, list[str]] | None: @@ -103,12 +119,13 @@ def round_counts(titles: list[str]) -> dict[str, int]: def measured_commit(changes: list[HistoryChange]) -> str | None: - """The newest change, of changes given newest first, that adds a scoring run to the history, or whose last added paired ruling is better.""" + """The newest change, of changes given newest first, whose last added paired ruling is better, or that adds a scoring run and whose last added paired ruling names no fall.""" for change in changes: held = {entry.heading for entry in entries(change.before)} added = [entry for entry in entries(change.after) if entry.heading not in held] rulings = sorted((entry for entry in added if entry.paired), key=lambda entry: entry.time) - if any(not entry.paired for entry in added) or rulings and rulings[-1].ruling == "better": + last = rulings[-1] if rulings else None + if last and last.ruling == "better" or any(not entry.paired for entry in added) and not (last and last.fell): return change.commit return None diff --git a/bin/test_larv_review.py b/bin/test_larv_review.py index b62e64b6..d7626615 100644 --- a/bin/test_larv_review.py +++ b/bin/test_larv_review.py @@ -48,14 +48,16 @@ class Seats(unittest.TestCase): self.assertIsInstance(report(""), Failure) def test_counts_each_vote_of_a_seat_naming_no_place_as_same(self): - seats = [Seat("Mid A", said("worse", "worse"), ["the whole skill"]), Seat("Inherited architect", said("better"), ["`a.py:3` `f`: shorter"])] + seats = [Seat("Mid A", said("worse", "worse"), ["Locality: the whole skill"]), Seat("Inherited architect", said("better"), ["`a.py:3` `f`: Overall: shorter"])] written = votes(seats) self.assertEqual(written, {"Mid A": ["same", "worse", "same", "same", "worse"], "Inherited architect": ["same", "same", "same", "same", "better"]}) self.assertEqual(counted(seats, written)["Mid A"], ["same"] * 5) def test_counts_a_dimensions_vote_only_where_a_place_names_that_dimension(self): - seats = [Seat("Mid A", said("better", "worse"), ["`a.py:3` `f`: shorter"]), Seat("Inherited architect", said("better", "worse"), ["`a.py:3` `f`: locality, held at once"])] - self.assertEqual([votes[1:] for votes in counted(seats, {seat.name: [*said("better", "worse").replace(",", "").split()[1::2]] for seat in seats}).values()], [["same", "same", "same", "better"], ["worse", "same", "same", "better"]]) + seats = [Seat("Mid A", said("better", "worse"), ["`a.py:3` `f`: Shape, reshaped"]), Seat("Inherited architect", said("better", "worse"), ["`a.py:3` `f`: Locality, held at once"])] + written = {seat.name: ["same", "worse", "same", "same", "better"] for seat in seats} + self.assertEqual(counted(seats, written), {"Mid A": ["same", "same", "same", "same", "better"], "Inherited architect": written["Inherited architect"]}) + self.assertIsInstance(votes([Seat("Mid A", said("better"), ["`a.py:3` `f`: self sufficiency"]), seats[1]]), Failure) def test_refuses_two_more_seats_once_the_first_two_agree_overall(self): seats = [Seat(name, said(vote), ["`f.py:1` `f`: x"]) for name, vote in (("Mid A", "worse"), ("Inherited architect", "worse"), ("Maintainability senior", "better"), ("Junior A", "better"))] @@ -117,12 +119,11 @@ class History(unittest.TestCase): history = appended(appended("", SCORING), ruled) self.assertTrue(history.startswith("# Comprehension history\n\n## 2026-10-08T12:00:00Z")) self.assertNotIn("Inherited architect, decided by:", history) - self.assertIn("| Inherited architect | same | same (voted worse, naming no place) | same | same | same (voted worse, naming no place) |", history) + self.assertIn("| Inherited architect | same | same (voted worse, no place naming Locality) | same | same | same (voted worse, naming no place) |", history) found = entries(history) self.assertEqual([(entry.commit, entry.against, entry.ruling, entry.fell) for entry in found], [("aaaaaaa", None, None, []), ("bbbbbbb", "aaaaaaa", "better", ["Locality"])]) self.assertEqual(found[1].places, [Place("bin/a.py", "f"), Place("bin/a.py", "g")]) self.assertEqual([entry.paired for entry in found], [False, True]) - self.assertNotIn("Fell:", ruling_entry("2026-10-08T18:37:21Z, PR #2 at bbbbbbb, against aaaaaaa", seats, written, written, "worse", ["Locality"])) class PendingFall(unittest.TestCase): @@ -276,7 +277,7 @@ class LarvReviewTool(unittest.TestCase): Mid A: {worse} - - `bin/a.py:3` `f`: three branches + - `bin/a.py:3` `f`: Overall: three branches Inherited architect: {same} """ @@ -286,7 +287,7 @@ class LarvReviewTool(unittest.TestCase): self.assertTrue(split.stdout.startswith("Split: Mid A worse, Inherited architect same.")) history = self.checkout / "docs" / "comprehension-history.md" self.assertFalse(history.exists()) - lines += f"\n\t\t\tMaintainability senior: {said('worse')}\n\n\t\t\t- `bin/a.py:3` `f`: hard\n\n\t\t\tJunior A: {said('worse')}\n" + lines += f"\n\t\t\tMaintainability senior: {said('worse')}\n\n\t\t\t- `bin/a.py:3` `f`: Overall: hard\n\n\t\t\tJunior A: {said('worse')}\n" ran = self.run_tool("record-ruling", self.seats_file(lines)) self.assertEqual(ran.stdout.splitlines()[0], "Ruling: same. Overall votes as counted: Mid A worse, Inherited architect same, Maintainability senior worse, Junior A same (voted worse, naming no place).") recorded = entries(history.read_text()) @@ -312,16 +313,24 @@ class LarvReviewTool(unittest.TestCase): stands = self.run_tool("record-scoring", self.seats_file(f"PR #2 at {self.start}\n" + seats.replace("Locality 6.5", "Locality 7"))) self.assertIn("The paired ruling stands: Locality fell and stays at or above the floor of 7.0.", stands.stdout) + def test_names_no_fall_on_a_worse_ruling(self): + place = "\n\n- `bin/a.py:3` `f`: Locality, longer\n\n" + ran = self.run_tool("record-ruling", self.seats_file(f"PR #2 at {self.start}, against {self.start}\n\nMid A: {said('worse', 'worse')}{place}Inherited architect: {said('worse', 'worse')}{place}")) + self.assertEqual(ran.returncode, 0, ran.stderr) + self.assertNotIn("Fell:", ran.stdout + (self.checkout / "docs" / "comprehension-history.md").read_text()) + def test_records_a_scoring_run_with_its_means(self): line = "Navigation 7, Locality 6.5, Shape 7, Self-sufficiency 6.5, Overall 7" seats = "".join(f"\n{seat}: {line}\n\n- `bin/a.py:3` `f`: long\n" for seat in ("Junior A", "Mid A", "Maintainability senior", "Inherited architect")) ran = self.run_tool("record-scoring", self.seats_file(f"PR #2 at {self.start}\n" + seats)) self.assertEqual(ran.returncode, 0, ran.stderr) - self.assertIn("Under the floor of 7.0: Locality 6.50, Self-sufficiency 6.50.", ran.stdout) + self.assertIn("Under the floor of 7.0, blocking nothing on a run due for no reason besides a fall: Locality 6.50, Self-sufficiency 6.50.", ran.stdout) + due = self.run_tool("record-scoring", self.seats_file(f"PR #3 at {self.start}\n" + seats), "1") + self.assertIn("Floor: Locality 6.50, Self-sufficiency 6.50 under the floor of 7.0 block the merge, as the chunk leaves release 0.1.0 with no plan item.", due.stdout) text = (self.checkout / "docs" / "comprehension-history.md").read_text() self.assertIn("| Mean | 7.00 | 6.50 | 7.00 | 6.50 | 7.00 |", text) self.assertIn("Inherited architect, would restructure first:", text) - self.assertEqual([entry.places for entry in entries(text)], [[Place("bin/a.py", "f")] * 4]) + self.assertEqual(entries(text)[0].places, [Place("bin/a.py", "f")] * 4) def test_refuses_a_ruling_file_that_names_no_base_or_a_commit_the_checkout_lacks(self): ran = self.run_tool("record-ruling", self.seats_file(f"PR #2 at {self.start}\n\nMid A: {said('same')}\n\nInherited architect: {said('same')}\n")) diff --git a/docs/decisions.md b/docs/decisions.md index 70a6ae1b..097b9a5c 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -67,7 +67,7 @@ lilleman decided to ship each of these under the floor on the day listed. Each l ## review: a paired ruling against the last measured commit decides the ratchet, and counts as worse when a dimension it rules fallen is under the floor; the four-seat scoring run checks the floor when a release's items run out, an item names the floor or a ruling names a fallen dimension -2026-10-08, lilleman. Serves goals 1.1 and 1.4. Two independent four-seat runs moved up to 0.4 on near-identical code, so a fall within that noise forced rounds that changed nothing (PR #224). A seat reading both versions judges the difference on the same material, so the noise the versions share cancels. No conventional significance level lets a sign test settle with four votes, so the human chose a lead of two votes over every other ruling, same included. Two seats that agree settle it, so a PR that leaves the reading as it was costs two seats. A third seat alone can never settle it, so the third and fourth launch together. The base is the default branch's newest merged change that adds a scoring run to the history, or whose last added paired ruling is better. The human chose the last measured commit on the architect's finding that with a merge base as the base, chunks without an architecture pass, and a suspended restructure's steps, could each lower comprehension unseen. A ruling of same leaves the base where it was, or a run of small falls each ruled same would add up unseen. A scoring run moves it too: otherwise a project never ruled better would compare against its first ruling forever, and a release's floor check is where the human sees the absolute level. Reading the default branch one merged change at a time keeps the rule working for merge commits and squash merges alike: a branch's own early ruling of better never counts, only the merged change's last ruling. The scoring run also runs on a chunk shipping an item that names the floor, so the chunk that lifts a project to the floor can prove it. A chunk that removes a release's last item without shipping it runs it too, so no release ends unmeasured. 2026-10-09, lilleman: each seat also rules each dimension, and a dimension falls by the same lead of two. A better or same ruling naming a fallen dimension calls the scoring run, and counts as worse when that dimension's mean is under the floor, so between releases a project cannot trade one dimension below the floor for gains in the other three. Such a run blocks on the fallen dimensions alone: the floor's own block stays with a release's end and an item naming the floor. A dimension's vote counts only where one of the seat's places names that dimension. Valid while seats reading both versions agree more often than two absolute runs do. +2026-10-08, lilleman. Serves goals 1.1 and 1.4. Two independent four-seat runs moved up to 0.4 on near-identical code, so a fall within that noise forced rounds that changed nothing (PR #224). A seat reading both versions judges the difference on the same material, so the noise the versions share cancels. No conventional significance level lets a sign test settle with four votes, so the human chose a lead of two votes over every other ruling, same included. Two seats that agree settle it, so a PR that leaves the reading as it was costs two seats. A third seat alone can never settle it, so the third and fourth launch together. The base is the default branch's newest merged change that adds a scoring run to the history, or whose last added paired ruling is better. The human chose the last measured commit on the architect's finding that with a merge base as the base, chunks without an architecture pass, and a suspended restructure's steps, could each lower comprehension unseen. A ruling of same leaves the base where it was, or a run of small falls each ruled same would add up unseen. A scoring run moves it too: otherwise a project never ruled better would compare against its first ruling forever, and a release's floor check is where the human sees the absolute level. Reading the default branch one merged change at a time keeps the rule working for merge commits and squash merges alike: a branch's own early ruling of better never counts, only the merged change's last ruling. The scoring run also runs on a chunk shipping an item that names the floor, so the chunk that lifts a project to the floor can prove it. A chunk that removes a release's last item without shipping it runs it too, so no release ends unmeasured. 2026-10-09, lilleman: each seat also rules each dimension, and a dimension falls by the same lead of two. A better or same ruling naming a fallen dimension calls the scoring run, and counts as worse when that dimension's mean is under the floor, so between releases a project cannot trade one dimension below the floor for gains in the other three. Such a run blocks on the fallen dimensions alone: the floor's own block stays with a release's end and an item naming the floor. Nor does it move the base, unless the ruling is better: a run of falls each ruled same must not add up unseen. A dimension's vote counts only where one of the seat's places names that dimension. Valid while seats reading both versions agree more often than two absolute runs do. ## review: a project decision may suspend the comprehension check for the plan items it names diff --git a/skills/comprehension-panel/seat-prompts.md b/skills/comprehension-panel/seat-prompts.md index 5e0cb2cc..254fe5cf 100644 --- a/skills/comprehension-panel/seat-prompts.md +++ b/skills/comprehension-panel/seat-prompts.md @@ -90,5 +90,5 @@ Same means a reader of either version would find it as easy to understand and ch Report, in this shape: 1. Your rulings, each better, same or worse, in this shape: Navigation , Locality , Shape , Self-sufficiency , Overall -2. The places that decided them, most decisive first. Each: path:line and the unit's name, in the version the place is in, the dimension it moves, and one or two sentences on what reads easier or harder there than in the other version. Rulings with no named place are discarded. +2. The places that decided them, most decisive first. Each: path:line and the unit's name, in the version the place is in, the dimensions it moves, each spelled as in your rulings line, or Overall, and one or two sentences on what reads easier or harder there than in the other version. Rulings with no named place are discarded. ``` diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md index 52e9d721..5ce944b3 100644 --- a/skills/larv-review/SKILL.md +++ b/skills/larv-review/SKILL.md @@ -97,12 +97,12 @@ Then the comprehension check: simulated readers, launched per `~/.claude/skills/ - **Seats.** Mid A and the inherited architect. Write what they read and their replies into a seats file in your scratchpad, 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. - **Ruling.** The `Ruling:` line `record-ruling` prints and appends to the history. A better or same ruling may carry a `Fell:` line naming dimensions the seats ruled worse; a scoring run then decides whether it stands. -**Scoring run**, when `~/.claude/bin/larv-review needs-scoring-run ` prints `Scoring run due:`. Run `needs-scoring-run` after the paired ruling and before removing the chunk's items from `todo.md`. 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 seats file and run `~/.claude/bin/larv-review record-scoring `, which appends the run to the history and prints the four seats' means. +**Scoring run**, when `~/.claude/bin/larv-review needs-scoring-run ` prints `Scoring run due:`. Run `needs-scoring-run` after the paired ruling and before removing the chunk's items from `todo.md`. 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 seats file and run `~/.claude/bin/larv-review record-scoring `, which appends the run to the history and prints the four seats' means. The chunk does not merge while either holds: - **Ratchet.** The paired ruling is worse, or `record-scoring` prints `Ratchet:` because a dimension that fell is under the floor, which `needs-scoring-run` repeats as `Still standing:` until a paired ruling follows it. -- **Floor.** `record-scoring` names a mean under the floor of 7.0, on a run `needs-scoring-run` called for a reason besides a fall. +- **Floor.** `record-scoring` prints `Floor:`, naming means under the floor of 7.0 on a run due for a reason besides a fall. Each is a 🔴 of the comprehension check. It is never filed, and stands until a later run clears it or, for the floor, a decision to ship answers it.