Answer architecture round 1: 1 🔴, 0 🟡; read the history's tables once and compare scoring runs on one commit
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- `larv-review agreement` checks the assumption behind the paired ruling: it counts how often Mid A and the inherited architect vote alike in a paired ruling and how often their overall scores move alike between two scoring runs of one PR, and says whether the first rate is higher. A scoring run runs it and asks the user when it says no.
|
||||
- Each release's scoring run is done twice on the same head, and `larv-review agreement` checks the assumption behind the paired ruling from the pairs: it counts how often Mid A and the inherited architect vote alike in a paired ruling and how often their overall scores move alike between two runs on one commit. It gives a verdict after 10 pairs, and a scoring run asks the user when it says the assumption fails.
|
||||
- `workflow-bench/bench.py` gives each run a fixed list of allowed tools. Before, it skipped every permission check. A run may launch agents, run `/security-review`, edit its clone (not the clone's `.git/` or `.claude/`) and its report, and read its clone and the copy of `~/.claude` it benches. For git it gets one command, `workflow-bench/review_git.py`, and no bare `git`. The wrapper runs `log`, `diff`, `show`, `status`, `ls-files`, `add` and `commit -m` on the run's clone, whatever the working directory. It allows only the options it lists for each, and refuses an argument that names a path outside the clone. git runs with no global or system config, hook, pager or editor. A run loads no settings or MCP servers from `~/.claude` or from the case's clone, so their hooks and extra directories do not apply to it. Every other call is denied. Expect a benched review that needs another git command, or to run a project's code or tests, to say in its report that it could not.
|
||||
- Every goal in `README.md` → Goals is marked `**Maintain:**`, a state to hold, or `**Achieve:**`, a direction to pursue. Each achieve goal has a signal, a counter-signal and a one-line reason under it. A change that breaks a maintain goal is redesigned or dropped, whatever it scores: `rules/todo-items.md` says so, and larv-review's goal alignment step no longer merges such a PR. `rules/goals-and-audience.md` states the form for every project's README. Expect larv-review to stop a PR on a maintain goal where it asked you before.
|
||||
- Reshape every project's `todo.md` to the new shape below: until it is reshaped, that is the project's only work, as it is while README.md lacks Goals and Audience, and `rank_todo.py` says so. First move every machine to this release: an older release rejects the new formula, so it fails on every reshaped `todo.md`. Then mark the README's goals `**Maintain:**` or `**Achieve:**`, score each item's L, E and I, and set a bar on the new scale below the score of every item to keep, since the old bar would drop most items. Until then, an old-shape `todo.md` still ranks by its own formula and weights.
|
||||
|
||||
@@ -43,6 +43,7 @@ class Entry:
|
||||
"""One paired ruling, which names the commit it was against and its ruling, or one scoring run, which names neither. The places under a scoring seat's label are scored_places; a ruling recorded before PR #255 may hold them too."""
|
||||
heading: str
|
||||
time: str
|
||||
label: str
|
||||
commit: str
|
||||
against: str | None
|
||||
ruling: str | None
|
||||
@@ -79,7 +80,7 @@ class ScoringRun:
|
||||
means: list[decimal.Decimal]
|
||||
|
||||
|
||||
# A paired ruling as entry_text writes it. A scoring run's heading has no `, against`; it has no Ruling line, ends its table with a Mean row, and labels each seat's places `<seat>, hardest first:` or, for the architect, `<seat>, would restructure first:`.
|
||||
# A paired ruling as entry_text writes it. A scoring run's heading has no `, against`; it has no Ruling line, ends its table with a Mean row, and labels each seat's places `<seat>, hardest first:` or, for the architect, `<seat>, would restructure first:`. A ruling recorded before PR #232 has a `| Seat | Vote |` table, whose one cell is the overall vote.
|
||||
#
|
||||
# ## 2026-10-09T09:47:25Z, PR #232 at 324d650, against 12d6d75
|
||||
#
|
||||
@@ -99,7 +100,7 @@ def entries(history: str) -> list[Entry]:
|
||||
if named := HEADING.match(heading):
|
||||
body = "\n".join(bodies)
|
||||
ruling = RULING.search(body)
|
||||
found.append(Entry(heading, named.group(1), named.group(3), named.group(4), ruling.group(1) if ruling else None, seat_places(body, RULED_PLACES), seat_places(body, SCORED_PLACES), body))
|
||||
found.append(Entry(heading, named.group(1), named.group(2), named.group(3), named.group(4), ruling.group(1) if ruling else None, seat_places(body, RULED_PLACES), seat_places(body, SCORED_PLACES), body))
|
||||
return found
|
||||
|
||||
|
||||
@@ -125,13 +126,16 @@ def placed(entry: Entry, labelled: list[tuple[str, list[str]]]) -> str:
|
||||
|
||||
def worse_votes(body: str) -> dict[str, set[str]]:
|
||||
"""Each seat's dimensions, Overall included, whose vote in the ruling's table counted as worse; `same (voted worse, …)` counted as same. The votes table comes first, so a seat's row in a later scores table is not its vote."""
|
||||
found: dict[str, set[str]] = {}
|
||||
return {name: {dimension for dimension, vote in zip(DIMENSIONS, cells) if vote == "worse"} for name, cells in table_rows(body).items() if len(cells) == len(DIMENSIONS)}
|
||||
|
||||
|
||||
def table_rows(body: str) -> dict[str, list[str]]:
|
||||
"""The cells after the first cell of each table row, by that cell, from the first row that has it; a table's header and its Mean row come with the seats'."""
|
||||
found: dict[str, list[str]] = {}
|
||||
for line in body.splitlines():
|
||||
if not line.startswith("| "):
|
||||
continue
|
||||
name, *votes = [cell.strip() for cell in line.strip("|").split("|")]
|
||||
if len(votes) == len(DIMENSIONS):
|
||||
found.setdefault(name, {dimension for dimension, vote in zip(DIMENSIONS, votes) if vote == "worse"})
|
||||
if line.startswith("| "):
|
||||
name, *cells = [cell.strip() for cell in line.strip("|").split("|")]
|
||||
found.setdefault(name, cells)
|
||||
return found
|
||||
|
||||
|
||||
@@ -205,6 +209,11 @@ def vote_text(dimension: str, said: str, counted: str) -> str:
|
||||
return f"same (voted {said}, naming no place)" if dimension == DIMENSIONS[-1] else f"same (voted {said}, no place naming {dimension})"
|
||||
|
||||
|
||||
def counted_vote(cell: str) -> str:
|
||||
"""The vote a ruling's table cell counted as, which is its first word, as vote_text writes it."""
|
||||
return cell.split()[0]
|
||||
|
||||
|
||||
def scoring_entry(title: str, scoring: ScoringRun) -> str:
|
||||
return entry_text(title, [], [scores_table(scoring)], scoring_labels(scoring.seats))
|
||||
|
||||
|
||||
@@ -1,44 +1,46 @@
|
||||
import decimal
|
||||
import itertools
|
||||
|
||||
from comprehension_history import Entry, entries, HEADING
|
||||
from comprehension_history import counted_vote, entries, Entry, table_rows
|
||||
from larv_review.seats import FIRST_SEATS
|
||||
|
||||
# As score-outcomes waits for 10 finished chunks before it shows a median.
|
||||
MIN_PAIRS = 10
|
||||
|
||||
|
||||
def overall_cells(entry: Entry) -> dict[str, str]:
|
||||
"""Each seat's last cell, the overall, from the first table that lists it; a vote reads as its first word, so `same (voted worse, naming no place)` is same."""
|
||||
found: dict[str, str] = {}
|
||||
for line in entry.body.splitlines():
|
||||
if line.startswith("| "):
|
||||
name, *cells = [cell.strip() for cell in line.strip("|").split("|")]
|
||||
found.setdefault(name, cells[-1].split()[0] if cells else "")
|
||||
return found
|
||||
"""Each seat's last cell: its overall vote in a ruling, its overall score in a scoring run."""
|
||||
return {name: cells[-1] for name, cells in table_rows(entry.body).items() if cells and cells[-1]}
|
||||
|
||||
|
||||
def ruling_agreement(found: list[Entry]) -> list[bool]:
|
||||
"""For each paired ruling that holds both of the first seats' overall votes, whether they agree."""
|
||||
"""For each paired ruling that holds both of the first seats' overall votes, whether they counted alike."""
|
||||
first, second = FIRST_SEATS
|
||||
cells = [overall_cells(entry) for entry in found if entry.paired]
|
||||
return [each[FIRST_SEATS[0]] == each[FIRST_SEATS[1]] for each in cells if all(seat in each for seat in FIRST_SEATS)]
|
||||
return [counted_vote(each[first]) == counted_vote(each[second]) for each in cells if first in each and second in each]
|
||||
|
||||
|
||||
def run_agreement(found: list[Entry], seats: tuple[str, str] = FIRST_SEATS) -> list[bool]:
|
||||
"""For each two successive scoring runs of one PR, whether two seats' overall scores moved the same way, up, down or not at all, between them. The two runs read near-identical code, so it is the ruling those seats would make from absolute scores."""
|
||||
def run_agreement(found: list[Entry]) -> list[bool]:
|
||||
"""For each commit scored at least twice, whether the first two seats' overall scores moved the same way, up, down or not at all, from its first run to its second. Both runs read one tree, so the pair is the ruling those seats would make from absolute scores on code that did not change."""
|
||||
first, second = FIRST_SEATS
|
||||
runs: dict[str, list[dict[str, decimal.Decimal]]] = {}
|
||||
for entry in sorted((each for each in found if not each.paired), key=lambda each: each.time):
|
||||
cells = overall_cells(entry)
|
||||
if all(seat in cells for seat in seats):
|
||||
label = HEADING.match(entry.heading)
|
||||
runs.setdefault(label.group(2) if label else entry.heading, []).append({seat: decimal.Decimal(cells[seat]) for seat in seats})
|
||||
moves = ([(after[seat] > before[seat]) - (after[seat] < before[seat]) for seat in seats] for each in runs.values() for before, after in itertools.pairwise(each))
|
||||
return [first == second for first, second in moves]
|
||||
if first in cells and second in cells:
|
||||
runs.setdefault(entry.commit, []).append({first: decimal.Decimal(cells[first]), second: decimal.Decimal(cells[second])})
|
||||
pairs = [(each[0], each[1]) for each in runs.values() if len(each) >= 2]
|
||||
return [direction(before[first], after[first]) == direction(before[second], after[second]) for before, after in pairs]
|
||||
|
||||
|
||||
def direction(before: decimal.Decimal, after: decimal.Decimal) -> int:
|
||||
return (after > before) - (after < before)
|
||||
|
||||
|
||||
def agreement_report(history: str) -> str:
|
||||
"""Whether the first two seats agree more often in a paired ruling than across two scoring runs of one PR, as the comprehension check's decision assumes; None of either leaves it unchecked."""
|
||||
"""Whether the first two seats agree more often in a paired ruling than across two scoring runs on one commit, as the comprehension check's decision assumes. It opens `Assumption holds:`, `Assumption fails:`, or `Unchecked:` until the history holds MIN_PAIRS pairs of runs and a ruling."""
|
||||
found = entries(history)
|
||||
ruled, scored = ruling_agreement(found), run_agreement(found)
|
||||
counts = f"{' and '.join(FIRST_SEATS)} voted alike overall in {sum(ruled)} of {len(ruled)} paired rulings, and their overall scores moved alike between two scoring runs of one PR in {sum(scored)} of {len(scored)} pairs of runs."
|
||||
if not ruled or not scored:
|
||||
return f"{counts} The assumption cannot be checked until the history holds both."
|
||||
counts = f"{' and '.join(FIRST_SEATS)} voted alike overall in {sum(ruled)} of {len(ruled)} paired rulings, and their overall scores moved alike between two scoring runs on one commit in {sum(scored)} of {len(scored)} pairs."
|
||||
if len(scored) < MIN_PAIRS or not ruled:
|
||||
return f"Unchecked: {counts} A verdict needs {MIN_PAIRS} pairs of scoring runs on one commit and one paired ruling."
|
||||
holds = sum(ruled) / len(ruled) > sum(scored) / len(scored)
|
||||
return f"{counts} The assumption {'holds' if holds else 'does not hold'}: seats {'agree more' if holds else 'do not agree more'} often in a paired ruling than across scoring runs."
|
||||
return f"Assumption {'holds' if holds else 'fails'}: {counts}"
|
||||
|
||||
@@ -72,9 +72,11 @@ A ruling recorded with scoring seats' places counts as a scoring run. Each entry
|
||||
under its heading, oldest first. With no scoring run, it reads every ruling.
|
||||
|
||||
agreement checks the assumption behind the paired ruling: that Mid A and the inherited architect
|
||||
vote alike overall in a paired ruling more often than they move alike between two scoring runs of
|
||||
one PR, which read near-identical code. A seat's move between two runs is up, down or none in its
|
||||
overall score. It prints both counts and whether the assumption holds, and exits 0 either way.
|
||||
vote alike overall in a paired ruling more often than they move alike between two scoring runs on
|
||||
one commit. A seat moves up, down or none from the first run to the second in its overall score. A
|
||||
release's scoring run is done twice on its head, the second recorded as `<PR> rerun at <commit>`.
|
||||
It prints both counts and opens `Unchecked:` until the history holds 10 such pairs of runs and one
|
||||
ruling, then `Assumption holds:` or `Assumption fails:`. It exits 0 for each.
|
||||
|
||||
Each record is appended to the history, created when missing, under a heading of the current UTC
|
||||
time and the seats file's first line. Each commit that line names must be in the checkout. It exits 1
|
||||
|
||||
@@ -157,34 +157,68 @@ class History(unittest.TestCase):
|
||||
self.assertEqual(latest_places(appended(appended("", scored), fell)), hard_since.replace("2026-10-10T12:00:00Z", "2026-10-09T12:00:00Z") + "\nJunior A, hardest first:\n\n- `bin/j.py:5` `s`: wide\n")
|
||||
|
||||
|
||||
def scored(time: str, pr: str, commit: str, junior: str, mid: str, architect: str = "7") -> str:
|
||||
return f"## {time}, {pr} at {commit}\n\n| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall |\n|---|---|---|---|---|---|\n| Junior A | 7 | 7 | 7 | 7 | {junior} |\n| Mid A | 7 | 7 | 7 | 7 | {mid} |\n| Inherited architect | 7 | 7 | 7 | 7 | {architect} |\n| Mean | 7.00 | 7.00 | 7.00 | 7.00 | 7.00 |\n"
|
||||
def scored(time: str, pr: str, commit: str, mid: str, architect: str) -> str:
|
||||
"""A scoring run's entry as the history writes it, with the two seats' overall scores."""
|
||||
run = ScoringRun([], {"Mid A": ["7", "7", "7", "7", mid], "Inherited architect": ["7", "7", "7", "7", architect]}, [decimal.Decimal("7.00")] * 5)
|
||||
return scoring_entry(f"{time}, {pr} at {commit}", run)
|
||||
|
||||
|
||||
def ruled(time: str, pr: str, mid: str, architect: str) -> str:
|
||||
return f"## {time}, {pr} at ccccccc, against aaaaaaa\n\nRuling: same\n\n| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall |\n|---|---|---|---|---|---|\n| Mid A | same | same | same | same | {mid} |\n| Inherited architect | same | same | same | same | {architect} |\n"
|
||||
def ruled(time: str, pr: str, mid: str, architect: str, voted: str | None = None) -> str:
|
||||
"""A paired ruling's entry as the history writes it; `voted` is what Mid A said overall when it counted as `mid`."""
|
||||
counts = {"Mid A": ["same"] * 4 + [mid], "Inherited architect": ["same"] * 4 + [architect]}
|
||||
said = {**counts, "Mid A": ["same"] * 4 + [voted or mid]}
|
||||
return ruling_entry(f"{time}, {pr} at ccccccc, against aaaaaaa", [Seat("Mid A", "", []), Seat("Inherited architect", "", [])], said, counts, "same")
|
||||
|
||||
|
||||
def pairs_of_runs(alike: int, apart: int) -> list[str]:
|
||||
"""Each pair is two runs on one commit: Mid A and the architect both up, or Mid A up and the architect not moving."""
|
||||
return [scored(f"2026-10-02T00:{index:02d}:{later}Z", "PR #1 rerun" if later else "PR #1", f"{index:07x}", "7.5" if later else "7", "7.5" if later and index < alike else "7") for index in range(alike + apart) for later in (0, 1)]
|
||||
|
||||
|
||||
class Agreement(unittest.TestCase):
|
||||
def test_counts_the_rulings_whose_two_seats_vote_alike_overall(self):
|
||||
history = "\n".join([ruled("2026-10-01T00:00:00Z", "PR #1", "same", "same"), ruled("2026-10-02T00:00:00Z", "PR #2", "same (voted worse, naming no place)", "same"), ruled("2026-10-03T00:00:00Z", "PR #3", "worse", "better")])
|
||||
self.assertEqual(ruling_agreement(entries(history)), [True, True, False])
|
||||
def test_counts_the_rulings_whose_two_seats_voted_alike_overall(self):
|
||||
old = "## 2026-10-08T18:37:21Z, PR #228 at 2682668, against 8c9bf09\n\nRuling: worse\n\n| Seat | Vote |\n|---|---|\n| Mid A | worse |\n| Inherited architect | worse |\n"
|
||||
history = "\n".join([ruled("2026-10-01T00:00:00Z", "PR #1", "same", "same"), ruled("2026-10-02T00:00:00Z", "PR #2", "same", "same", voted="worse"), ruled("2026-10-03T00:00:00Z", "PR #3", "worse", "better"), old])
|
||||
self.assertEqual(ruling_agreement(entries(history)), [True, True, False, True])
|
||||
|
||||
def test_counts_the_seat_pairs_whose_scores_move_the_same_way_between_runs_of_one_pr(self):
|
||||
seats = ("Junior A", "Mid A")
|
||||
# Junior A better and Mid A same, then Junior A worse and Mid A better: the seats differ twice. PR #2 has one run.
|
||||
differing = "\n".join([scored("2026-10-01T00:00:00Z", "PR #1", "aaaaaaa", "6.5", "7"), scored("2026-10-02T00:00:00Z", "PR #1", "bbbbbbb", "7", "7"), scored("2026-10-03T00:00:00Z", "PR #1", "ccccccc", "6.5", "7.5"), scored("2026-10-04T00:00:00Z", "PR #2", "ddddddd", "5", "5")])
|
||||
self.assertEqual(run_agreement(entries(differing), seats), [False, False])
|
||||
alike = "\n".join([scored("2026-10-01T00:00:00Z", "PR #1", "aaaaaaa", "6.5", "7"), scored("2026-10-02T00:00:00Z", "PR #1", "bbbbbbb", "7", "7.5")])
|
||||
self.assertEqual(run_agreement(entries(alike), seats), [True])
|
||||
def test_compares_the_two_seats_across_the_first_two_runs_on_one_commit(self):
|
||||
both_up = [scored("2026-10-01T00:00:00Z", "PR #1", "aaaaaaa", "7", "7"), scored("2026-10-02T00:00:00Z", "PR #1 rerun", "aaaaaaa", "7.5", "7.5")]
|
||||
one_up = [scored("2026-10-03T00:00:00Z", "PR #2", "bbbbbbb", "7", "7"), scored("2026-10-04T00:00:00Z", "PR #2 rerun", "bbbbbbb", "7.5", "7")]
|
||||
self.assertEqual(run_agreement(entries("\n".join([*both_up, *one_up]))), [True, False])
|
||||
|
||||
def test_says_whether_seats_agree_more_often_in_a_ruling_than_across_two_runs(self):
|
||||
runs = [scored("2026-10-01T00:00:00Z", "PR #1", "aaaaaaa", "7", "7", "7"), scored("2026-10-02T00:00:00Z", "PR #1", "bbbbbbb", "7", "7", "6.5")]
|
||||
agreeing = ruled("2026-10-03T00:00:00Z", "PR #2", "same", "same")
|
||||
disagreeing = ruled("2026-10-03T00:00:00Z", "PR #2", "worse", "same")
|
||||
self.assertIn("The assumption holds", agreement_report("\n".join([*runs, agreeing])))
|
||||
self.assertIn("does not hold", agreement_report("\n".join([*runs, disagreeing])))
|
||||
self.assertIn("cannot be checked", agreement_report("\n".join(runs)))
|
||||
def test_leaves_out_commits_scored_once_and_runs_of_one_pr_on_different_commits(self):
|
||||
history = "\n".join([scored("2026-10-01T00:00:00Z", "PR #1", "aaaaaaa", "7", "7"), scored("2026-10-02T00:00:00Z", "PR #1", "bbbbbbb", "7.5", "7.5")])
|
||||
self.assertEqual(run_agreement(entries(history)), [])
|
||||
|
||||
def test_takes_the_two_earliest_runs_of_a_commit_whatever_order_the_file_holds_them(self):
|
||||
history = "\n".join([scored("2026-10-03T00:00:00Z", "PR #1 again", "aaaaaaa", "6", "7"), scored("2026-10-01T00:00:00Z", "PR #1", "aaaaaaa", "7", "7"), scored("2026-10-02T00:00:00Z", "PR #1 rerun", "aaaaaaa", "7.5", "7.5")])
|
||||
self.assertEqual(run_agreement(entries(history)), [True])
|
||||
|
||||
def test_skips_a_run_whose_table_lists_neither_seat(self):
|
||||
mean_only = scoring_entry("2026-10-01T12:00:00Z, PR #1 at aaaaaaa", ScoringRun([], {}, [decimal.Decimal("7.00")] * 5))
|
||||
history = "\n".join([mean_only, scored("2026-10-01T00:00:00Z", "PR #1 rerun", "aaaaaaa", "7", "7"), scored("2026-10-02T00:00:00Z", "PR #1 again", "aaaaaaa", "7.5", "7.5")])
|
||||
self.assertEqual(run_agreement(entries(history)), [True])
|
||||
|
||||
def test_records_a_rerun_beside_the_run_it_repeats(self):
|
||||
history = appended("", scored("2026-10-01T00:00:00Z", "PR #1", "aaaaaaa", "7", "7"))
|
||||
self.assertTrue(recorded(history, "PR #1 at aaaaaaa"))
|
||||
self.assertFalse(recorded(history, "PR #1 rerun at aaaaaaa"))
|
||||
|
||||
def test_gives_no_verdict_before_ten_pairs_of_runs_and_a_ruling(self):
|
||||
ruling = ruled("2026-10-20T00:00:00Z", "PR #2", "same", "same")
|
||||
self.assertIn("Unchecked: ", agreement_report("\n".join([*pairs_of_runs(9, 0), ruling])))
|
||||
self.assertIn("Unchecked: ", agreement_report("\n".join(pairs_of_runs(10, 0))))
|
||||
|
||||
def test_holds_when_the_seats_agree_in_a_higher_share_of_rulings_than_of_pairs_of_runs(self):
|
||||
rulings = [ruled(f"2026-10-20T00:00:0{index}Z", f"PR #{index + 2}", "same", "same") for index in range(3)]
|
||||
report = agreement_report("\n".join([*pairs_of_runs(5, 5), *rulings]))
|
||||
self.assertEqual(report.split(":")[0], "Assumption holds")
|
||||
self.assertIn("3 of 3 paired rulings", report)
|
||||
self.assertIn("5 of 10 pairs", report)
|
||||
|
||||
def test_fails_when_the_seats_agree_in_a_lower_share_of_rulings_than_of_pairs_of_runs(self):
|
||||
rulings = [ruled("2026-10-20T00:00:00Z", "PR #2", "same", "same"), ruled("2026-10-20T00:00:01Z", "PR #3", "same", "same"), ruled("2026-10-20T00:00:02Z", "PR #4", "worse", "same")]
|
||||
self.assertEqual(agreement_report("\n".join([*pairs_of_runs(8, 2), *rulings])).split(":")[0], "Assumption fails")
|
||||
|
||||
|
||||
class Base(unittest.TestCase):
|
||||
@@ -368,11 +402,11 @@ class LarvReviewTool(unittest.TestCase):
|
||||
outside = subprocess.run([sys.executable, str(TOOL), "places"], capture_output=True, cwd=self.checkout.parent, env=self.env, text=True)
|
||||
self.assertEqual((outside.returncode, outside.stdout), (1, ""))
|
||||
|
||||
def test_prints_how_often_seats_agree_in_rulings_and_across_runs_of_one_pr(self):
|
||||
history = "\n".join([scored("2026-10-01T00:00:00Z", "PR #1", "aaaaaaa", "7", "7", "7"), scored("2026-10-02T00:00:00Z", "PR #1", "bbbbbbb", "7", "7", "6.5"), ruled("2026-10-03T00:00:00Z", "PR #2", "same", "same")])
|
||||
def test_prints_how_often_seats_agree_in_rulings_and_across_runs_on_one_commit(self):
|
||||
history = "\n".join([scored("2026-10-01T00:00:00Z", "PR #1", "aaaaaaa", "7", "7"), scored("2026-10-02T00:00:00Z", "PR #1 rerun", "aaaaaaa", "7.5", "7"), ruled("2026-10-03T00:00:00Z", "PR #2", "same", "same")])
|
||||
self.commit("Record the checks", {"docs/comprehension-history.md": appended("", history)})
|
||||
ran = self.run_tool("agreement")
|
||||
self.assertEqual((ran.returncode, ran.stdout), (0, "Mid A and Inherited architect voted alike overall in 1 of 1 paired rulings, and their overall scores moved alike between two scoring runs of one PR in 0 of 1 pairs of runs. The assumption holds: seats agree more often in a paired ruling than across scoring runs.\n"), ran.stderr)
|
||||
self.assertEqual((ran.returncode, ran.stdout), (0, "Unchecked: Mid A and Inherited architect voted alike overall in 1 of 1 paired rulings, and their overall scores moved alike between two scoring runs on one commit in 0 of 1 pairs. A verdict needs 10 pairs of scoring runs on one commit and one paired ruling.\n"), ran.stderr)
|
||||
self.assertIn("unknown arguments", self.run_tool("agreement", "x").stderr)
|
||||
|
||||
def test_refuses_a_ruling_file_that_names_no_base_or_a_commit_the_checkout_lacks(self):
|
||||
|
||||
@@ -112,7 +112,7 @@ The comprehension check records how hard the project is to read, and blocks no m
|
||||
- **Head.** The head holds `origin/<default branch>`, 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 your scratchpad, in the shape `~/.claude/bin/larv-review --help` shows, and run `~/.claude/bin/larv-review record-ruling <votes file>`. 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 <the IDs of the items the chunk ships, if any>` prints `Scoring run due:`. Run `needs-scoring-run` 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 scores file and run `~/.claude/bin/larv-review record-scoring <scores file> <the same item IDs>`, which appends the run to the history and prints the four seats' means. Then run `~/.claude/bin/larv-review agreement`. Where it says the assumption does not hold, the decision `review: the comprehension check records …` no longer holds: say so in the summary and ask the user.
|
||||
**Scoring run**, when `~/.claude/bin/larv-review needs-scoring-run <the IDs of the items the chunk ships, if any>` prints `Scoring run due:`. Run `needs-scoring-run` 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 scores file and run `~/.claude/bin/larv-review record-scoring <scores file> <the same item IDs>`, which appends the run to the history and prints the four seats' means. Then record the same head's second run, with the same four seats scoring it afresh and the first line of its scores file `<PR or branch> rerun at <commit>`, by the same `record-scoring` command. Then run `~/.claude/bin/larv-review agreement`. On `Assumption fails:`, ask the user whether to keep the paired ruling or change `~/.claude/docs/decisions.md` → `review: the comprehension check records …`, and record the answer there, with the counts it answered; a later run asks again only when the counts are worse than the recorded ones. Put its counts in the summary.
|
||||
|
||||
**Record.** `docs/comprehension-history.md` keeps every paired ruling and scoring run, which `larv-review` appends; never edit one. Commit what it appends in one commit titled `Record the comprehension check: …`, push it, and wait for the forge's checks (§4 step 4), not for an auto-review; it re-enters no pass. Resolve a merge conflict in the file by putting the default branch's entries first. Put each ruling with its base and votes, and each run's five scores, in the summary.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user