From 0ea21c7c8382865c695edc46d14d2cc33a2d1529 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 13 Oct 2026 12:17:31 +0200 Subject: [PATCH 01/13] Drop the comprehension panel as a merge gate, and feed the places its seats found hard to the architect, the stability reviewer and item filing --- AGENTS.md | 4 +- CHANGELOG.md | 12 ++-- README.md | 2 +- bin/comprehension_history.py | 19 +++++-- bin/larv_review/main.py | 46 ++++++++-------- bin/larv_review/record.py | 66 ++++++++-------------- bin/larv_review/ruling.py | 5 -- bin/larv_review/scoring.py | 7 --- bin/larv_review/test_larv_review.py | 85 +++++++++++------------------ docs/decisions.md | 29 ++-------- rules/todo-items.md | 1 + skills/larv-review/SKILL.md | 63 +++++++++------------ todo.md | 25 +++------ 13 files changed, 141 insertions(+), 223 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 64d60c79..6618142e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,11 +8,11 @@ Decisions live in `docs/decisions.md`: - loop-claude: before an interrupt, it marks the checkout and each of its worktrees trusted in `~/.claude.json` - bin/: the tests rerun themselves on a `uv`-fetched Python at README Install's floor - bin/: the tools and their tests run on the host's Python, with no container -- comprehension floor: every dimension and the overall at 7.0 or above, and 0.3.0 waits on it +- comprehension floor: every dimension and the overall at 7.0 or above is the target, and blocks no merge or release - loop-claude: each project's model lives in `~/.claude/loop-claude-models.json`, which only loop-claude writes - review: a pass gets at most three rounds per chunk; instead of a fourth, the run asks the human - review: a fix for a 🔴 or 🟡 reruns the pass that found it and each pass whose trigger names fixes like it; a fix for a 🟢, a ❓ or a prose finding reruns none -- 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 or an item names the floor, and also runs when a ruling names a fallen dimension +- review: the comprehension check records how hard a project is to read and blocks no merge: a paired ruling against the last measured commit where the architecture pass ran, and the four-seat scoring run when a release's items run out or an item names the floor - review: a project decision may suspend the comprehension check for the plan items it names - review: a project decision may opt every chunk out of the architect, the product-owner pass or the comprehension check - review: a pass skips only on a precedent: a decision, or a plan item crediting the pass, that the repo held before the chunk began diff --git a/CHANGELOG.md b/CHANGELOG.md index 19ac6e31..ce47abf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,19 +15,19 @@ - A README no longer holds cross-cutting decisions; `docs/decisions.md` does. - A technical principle, "Prefer deep modules": a module puts a small, intuitive interface in front of a lot of hidden work, and hides how it works but never what it depends on. It wins over "Explicit over implicit" unless hiding the work makes it harder for someone new to the project to tell what a call does. "Functional core, imperative shell" moves up to second place, a core rule beside "Compose, do not entangle" that no other principle overrides. The systems architect holds every module to it. - A hook blocks each Bash, Edit, MultiEdit and Write call that breaks a rule a program can check: a commit message that is not one line passed with `-m`, a Claude or Anthropic attribution, a container image short of a full patch version, an Action pinned to anything but a semver tag, an unsorted block in an ignore file, and a commit of a `todo.md` that `rank_todo.py --check` rejects. `CLAUDE.md` states those rules only where the hook cannot check them; `~/.claude/bin/rule-hook --help` states what it checks. A call overrides a rule with `# rule-override : `. larv-review's new overrides pass, run before stability, accepts or rejects each override the chunk logged, and the PR body lists each with its ruling; a rejected override means the chunk keeps the rule. An override that touches a credential, a security rule or a production system, or cannot be undone, is asked of you. -- A project may opt out of larv-review's architect, product-owner pass or comprehension check in every chunk, through a `docs/decisions.md` entry titled `review opt-out: …` that names the goal that skipping them serves. A project without such an entry is reviewed as before. Opting out of the comprehension check also skips the scoring run due at a release's end, so the floor blocks nothing; the opt-out ends with a chunk that ships a plan item naming the floor, which removes the comprehension check from the entry. The principles audit always runs. +- A project may opt out of larv-review's architect, product-owner pass or comprehension check in every chunk, through a `docs/decisions.md` entry titled `review opt-out: …` that names the goal that skipping them serves. A project without such an entry is reviewed as before. Opting out of the comprehension check also skips the scoring run due at a release's end. The principles audit always runs. - A README goal states the project's aim and intent, and no longer names a step of the work, such as "kill weak candidates early". Such steps go in a method section further down the README and name the goal they serve. - The stability reviewer keeps its scratch work in a directory it creates for the run, deletes that directory afterwards, and deletes nothing else. -- 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`, which ignores case in a round's commit title, counts a repeated round number as a round of its own, and says to ask you before another round once a pass is at or past the cap), the scoring run's trigger (`needs-scoring-run ...`), and the vote count, means and history format (`record-ruling []` and `record-scoring [...]`, which append to `docs/comprehension-history.md` and refuse a second entry on what a seats file's first line reads; `record-scoring` refuses a run the plan does not call, and prints `Floor:` naming each mean under the floor). 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. When origin cannot be fetched, the tool reads it as last fetched and says so. +- 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`, which ignores case in a round's commit title, counts a repeated round number as a round of its own, and says to ask you before another round once a pass is at or past the cap), the scoring run's trigger (`needs-scoring-run ...`), and the vote count, means and history format (`record-ruling ` and `record-scoring [...]`, which append to `docs/comprehension-history.md` and refuse a second entry on what a seats file's first line reads; `record-scoring` refuses a run the plan does not call, and prints `Floor:` naming each mean under the comprehension floor of 7.0), and the places the newest scoring seats found hard (`places`). 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. 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 on each dimension and overall: `Navigation same, Locality worse, Shape same, Self-sufficiency same, Overall better`. When their overall votes differ, the maintainability senior and Junior A vote too. A ruling needs a lead of two or more votes, else it is same. Each place a seat names opens with the dimensions it moves, such as `Locality, Shape: `, or the run fails, and a vote that no place opens with counts as same. A dimension falls when its worse votes lead by two. When a dimension falls in a better or same ruling, `record-ruling` asks for the four scoring seats and, given their scores file, counts the ruling as worse when that dimension's mean is under the floor. 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, a score under the floor blocks a merge only through a fallen dimension, and that block counts as a worse ruling. On those runs, 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. +- larv-review runs a comprehension check, which records how hard the project is to read and blocks no merge. It runs once per chunk, after every other pass, on the commit to merge. Where the architecture pass ran, Mid A and the inherited architect read that commit beside 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. They vote better, same or worse on each dimension and overall: `Navigation same, Locality worse, Shape same, Self-sufficiency same, Overall better`. When their overall votes differ, the maintainability senior and Junior A vote too. A ruling needs a lead of two or more votes, else it is same. Each place a seat names opens with the dimensions it moves, such as `Locality, Shape: `, or the run fails, and a vote that no place opens with counts as same. Four seats score the project from 1 to 10 when a chunk ships or removes a release's last plan item, or ships an item naming the comprehension floor of 7.0. - larv-review reruns fewer passes after a fix. A fix reruns the pass whose 🔴 or 🟡 it answers, plus stability when the fix changes behaviour, security when it opens an untrusted-input boundary or touches authn/authz, secrets or crypto, and architecture when it carries an architectural decision. A rerun reviews only what changed since that pass last reviewed. A fix for a 🟢, a ❓ or any prose finding reruns no pass, and prose takes one round. - larv-review runs one security pass on each change: the full scan alone when it runs, else `/security-review`. - larv-review runs the new `bin/reading-cost`, which measures each chunk `loop-claude` finished from its archive: the new input tokens the worker and its subagents took in before the worker's first commit, and the files git tracks that they read most. It appends each figure the project's `docs/reading-cost.md` lacks. Once 10 chunks are measured, and the last 5 chunks' median is above the 5 before them, larv-review files one plan item naming the files read most, or refreshes it. The chunk that ships it runs `reading-cost --reset`, so the trend counts only chunks that finished after it. -- larv-review appends every paired ruling and scoring run to the project's `docs/comprehension-history.md`: the commit the seats read, a ruling's base, each seat's vote or scores, and the places each seat named. The PR summary gives each ruling with its base and votes. The `comprehension floor:` entry in `docs/decisions.md` keeps only the decisions to ship under the floor; a project's next scoring run moves the last scores the entry still holds into the history. The seats do not read the history. +- larv-review appends every paired ruling and scoring run to the project's `docs/comprehension-history.md`: the commit the seats read, a ruling's base, each seat's vote or scores, and the places each seat named. The PR summary gives each ruling with its base and votes. The seats do not read the history. +- The architect and the stability reviewer get the places the newest scoring seats found hard, from the new `larv-review places`. Each reports, as a 🟡, a place the change touches without making it easier to read; the chunk fixes it or says in the PR summary why not. A session filing a `todo.md` item reads the places too, and an item touching one says to make it easier to read. - The README's goals put quality with the fewest interrupts first, as goal 1; sharing the setup, backups and leaking nothing follow as goals 2–4. -- larv-review reruns the comprehension check before merge when any commit since its last run changes more than `docs/decisions.md`, `docs/comprehension-history.md`, `docs/reading-cost.md`, `todo.md` or `CHANGELOG.md`, so the recorded result is the merged commit's. A result that blocks the merge is never filed in `todo.md`. A rerun counts toward the three-round cap only when it reports a block that no decision of yours covers. -- larv-review skips the comprehension check for a chunk whose plan items a project decision names. The decision also names the later item whose check ends the suspension. A skipped chunk cannot be blocked for reading worse or for the floor, and its summary cites the decision. A chunk that ships or removes a release's last plan item, or ships an item naming the floor, still gets the scoring run. +- larv-review skips the comprehension check for a chunk whose plan items a project decision names. The decision also names the later item whose check ends the suspension. The skipped chunk's summary cites the decision. A chunk that ships or removes a release's last plan item, or ships an item naming the floor, still gets the scoring run. - README → Install and Update give the commands that check the latest tag out into `~/.claude`: on a new machine, whether or not Claude Code has already created the directory, and on one already on an older tag. - A session commits changes Claude Code made to `settings.json` only once their diff holds no credential, and asks you to move any credential out of the file first. - A technical principle, "Sane defaults, where a default serves better than an explicit ask". A default suits a value most callers want, does no harm when wrong, and can be seen and changed. It lives at the program's edge, such as a CLI; a library still asks for data, the clock and randomness. diff --git a/README.md b/README.md index 934ccdf6..2dcf8ef2 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Rename `## Unreleased` in `CHANGELOG.md` to the version, commit, tag that commit Install puts only `loop-claude` on `PATH`; call the others by their path, such as `~/.claude/bin/metric-bench`, from the project's checkout. -- `larv-review ` holds larv-review's mechanical rules: the paired ruling's base and vote count, each pass's round count, the scoring run's trigger and the comprehension history's format; `larv-review --help` states them. +- `larv-review ` holds larv-review's mechanical rules: the paired ruling's base and vote count, each pass's round count, the scoring run's trigger, and the comprehension history's format and latest places; `larv-review --help` states them. - `loop-claude ` runs a project's next chunk cycle after cycle; `loop-claude --help` states its contract. - `metric-bench [history]` benches cheap static metrics of a project's Python against the places its comprehension history names as hardest; `metric-bench --help` states the metrics and the scores. - `rank_todo.py [--check] [todo.md]` scores and ranks a project's `todo.md`; `rank_todo.py --help` states the format. diff --git a/bin/comprehension_history.py b/bin/comprehension_history.py index b115fc5a..835c0b54 100644 --- a/bin/comprehension_history.py +++ b/bin/comprehension_history.py @@ -102,6 +102,17 @@ def entries(history: str) -> list[Entry]: return found +def latest_places(history: str) -> str | None: + """The heading and the seats' places of the newest entry, by its time, whose seats scored the project: a scoring run, or a ruling whose fall called the scoring seats. None when no entry did.""" + scored = [(named.group(1), heading, "\n".join(bodies)) for heading, bodies in sections(history).items() if (named := HEADING.match(heading)) and seat_places("\n".join(bodies), SCORED_PLACES)] + if not scored: + return None + _, heading, body = max(scored) + lines = body.splitlines() + start = next(index for index, line in enumerate(lines) if SCORED_PLACES.match(line)) + return f"## {heading}\n" + "".join(f"\n{line}\n\n" if SCORED_PLACES.match(line) else f"{line}\n" for line in lines[start:]) + + def recorded(history: str, read: str) -> bool: """Whether the history holds an entry on what a seats file's first line says the seats read.""" return any(entry.heading.partition(", ")[2] == read for entry in entries(history)) @@ -146,12 +157,10 @@ def appended(history: str, entry: str) -> str: return f"{text}\n{entry}" -def ruling_entry(title: str, seats: list[Seat], said: dict[str, list[str]], counted: dict[str, list[str]], ruled: str, notes: list[str], scoring: ScoringRun | None) -> str: - """A paired ruling's entry, with any notes, such as why a fall decided it, and the scores that decided a fall; a seat's vote that counted as same for want of a place says so.""" +def ruling_entry(title: str, seats: list[Seat], said: dict[str, list[str]], counted: dict[str, list[str]], ruled: str) -> str: + """A paired ruling's entry; 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] - tables = [[["Seat", *DIMENSIONS], *votes]] + ([scores_table(scoring)] if scoring else []) - labels = [(f"{seat.name}, {DECIDED_BY}:", seat.places) for seat in seats] + (scoring_labels(scoring.seats) if scoring else []) - return entry_text(title, [f"Ruling: {ruled}", *notes], tables, labels) + return entry_text(title, [f"Ruling: {ruled}"], [[["Seat", *DIMENSIONS], *votes]], [(f"{seat.name}, {DECIDED_BY}:", seat.places) for seat in seats]) def vote_text(dimension: str, said: str, counted: str) -> str: diff --git a/bin/larv_review/main.py b/bin/larv_review/main.py index c9b8218c..43dc3d42 100644 --- a/bin/larv_review/main.py +++ b/bin/larv_review/main.py @@ -1,14 +1,13 @@ -"""Hold larv-review's mechanical rules: the paired ruling's base and vote count, each pass's rounds, the scoring run's trigger, and the comprehension history's format. +"""Hold larv-review's mechanical rules: the paired ruling's base and vote count, each pass's rounds, the scoring run's trigger, and the comprehension history's format and latest places. -usage: larv-review ruling-base | round-count | needs-scoring-run [...] | record-ruling [] | record-scoring [...] +usage: larv-review ruling-base | round-count | needs-scoring-run [...] | record-ruling | record-scoring [...] | places -The comprehension check keeps a project from reading worse, two ways. 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; a -worse ruling blocks the merge, which is the ratchet. In a scoring run, four seats score the project -from 1 to 10; a mean under the floor of {floor} blocks the merge, unless you decide to ship. +The comprehension check records how hard a project is to read, two ways, and blocks no 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. -Run it inside a project checkout or one of its worktrees. Each command but record-ruling first +Run it inside a project checkout or one of its worktrees. Each command but record-ruling and places 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 reads origin as last fetched and says so on stderr; the other three exit 1. The history is @@ -60,26 +59,25 @@ better, same or worse. Each place opens with the names from the seat's line that with that dimension and holds a `path:line` in backticks; the overall vote counts as same unless any place holds one. 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. A -dimension falls when its worse votes lead each other vote by two or more. When a better or same -ruling has a fallen dimension, it appends nothing and prints `Fell:`, saying to run the four -scoring seats on the same commit and run it again with their scores file. With that file, the -ruling counts as worse when a fallen dimension's mean is under the floor of {floor}, and stands -otherwise. It prints `Ruling:` and appends the ruling, with the scores where a fall called them. +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. record-scoring takes the scores file of a run needs-scoring-run calls, whose first line names no `, against`, and the same item IDs, and exits 1 when they call no run: each scoring run moves the -ratchet's base. It appends the seats' scores and their means, rounded half up to two decimals, -prints the means and, when a mean is under the floor of {floor}, a line opening `Floor:` naming -each one, which blocks the merge. +paired ruling's base. It appends the seats' scores and their means, rounded half up to two +decimals, prints the means and, when a mean is under the floor of {floor}, a line opening `Floor:` +naming each one. + +places prints the places the seats named in the history's newest entry, by its time, that scored +the project: a scoring run, or a ruling recorded before this tool stopped calling the scoring seats +on a fallen dimension. 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 when the history already holds an entry on what that line reads. Exit 1, saying why, on unknown arguments, an unknown item ID, a seats file it cannot read or that -breaks the shape above, a scores file record-ruling did not call for or one naming another commit, -or when git cannot start, finds no checkout or no default branch, cannot +breaks the shape above, 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 or todo.md. """ import pathlib @@ -95,9 +93,9 @@ from larv_review.scoring import FLOOR from comprehension_history import HISTORY from larv_review.git import history_changes from larv_review.plan import plan_reasons -from larv_review.record import record_ruling, record_scoring +from larv_review.record import record_ruling, record_scoring, show_places -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 [...] | places" def main(argv: list[str]) -> int: @@ -111,10 +109,12 @@ 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 == "record-ruling" and len(given) in (1, 2): - done = record_ruling(*map(pathlib.Path, given)) + 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:]): done = with_default_branch(lambda default: record_scoring(default, pathlib.Path(given[0]), [int(id_) for id_ in given[1:]]), stale_ok=False) + elif command == "places" and not given: + done = show_places() elif command in ("needs-scoring-run", "record-scoring") and given: named = given[1:] if command == "record-scoring" else given print(f"{command} takes item IDs, the numbers in todo.md's ID column, not {' '.join(id_ for id_ in named if not re.fullmatch(r'[0-9]+', id_))}; {USAGE}", file=sys.stderr) diff --git a/bin/larv_review/record.py b/bin/larv_review/record.py index 031c7efe..ddb5066e 100644 --- a/bin/larv_review/record.py +++ b/bin/larv_review/record.py @@ -1,17 +1,17 @@ import pathlib import time -from comprehension_history import appended, DIMENSIONS, heading, Heading, HISTORY, recorded, ruling_entry, scoring_entry, ScoringRun, vote_text +from comprehension_history import appended, DIMENSIONS, heading, Heading, HISTORY, latest_places, recorded, ruling_entry, scoring_entry, ScoringRun, vote_text from git_repo import commit_exists, top -from larv_review.ruling import counted, fallen, overall, ruling, split, votes +from larv_review.ruling import counted, overall, ruling, split, votes from failure import Failure -from larv_review.scoring import fall_ruling, FLOOR, means, under_floor +from larv_review.scoring import FLOOR, means, under_floor from larv_review.plan import plan_reasons from file_writes import replace_file from larv_review.seats import scores, seats_file, SeatsFile -def record_ruling(votes_file: pathlib.Path, scores_file: pathlib.Path | None = None) -> Failure | None: +def record_ruling(votes_file: pathlib.Path) -> Failure | None: read = read_seats(votes_file, paired=True) if isinstance(read, Failure): return read @@ -26,24 +26,8 @@ def record_ruling(votes_file: pathlib.Path, scores_file: pathlib.Path | None = N print(f"Split: {tally}. Launch the maintainability senior and Junior A together, add their lines to the votes file, and run this again.") return None ruled = ruling(overall_votes) - fell = fallen(counts) if ruled != "worse" else [] - scoring = None - notes = [] - if not fell and scores_file: - why = "a worse ruling takes no scores file" if ruled == "worse" else f"no dimension fell in this {ruled} ruling, so it takes no scores file" - return Failure(f"{why}; run record-ruling again with the votes file alone") - if fell and not scores_file: - print(f"Fell: {', '.join(fell)}, in a {ruled} ruling. Launch the four scoring seats on {heading_read.label} at {heading_read.commit}, write their lines to a scores file, and run this again with both files.") - return None - if fell and scores_file: - scored = read_fall_scores(scores_file, heading_read) - if isinstance(scored, Failure): - return scored - scoring = scored - ruled, why = fall_ruling(ruled, fell, scoring.means) - notes = [why] - print(f"Ruling: {ruled}. {' '.join(notes + [f'Overall votes as counted: {tally}.'])}") - return append(seats_read.read, ruling_entry(heading_read.title, seats_read.seats, written, counts, ruled, notes, scoring)) + print(f"Ruling: {ruled}. Overall votes as counted: {tally}.") + return append(seats_read.read, ruling_entry(heading_read.title, seats_read.seats, written, counts, ruled)) def record_scoring(default: str, scores_file: pathlib.Path, ids: list[int]) -> Failure | None: @@ -58,24 +42,13 @@ def record_scoring(default: str, scores_file: pathlib.Path, ids: list[int]) -> F if isinstance(reasons, Failure): return reasons if not reasons: - return Failure("no plan item or release calls this scoring run; name the item IDs the chunk ships, as needs-scoring-run took them, or record a fall's scores with record-ruling") + return Failure("no plan item or release calls this scoring run; name the item IDs the chunk ships, as needs-scoring-run took them") print(f"Means: {', '.join(f'{name} {value}' for name, value in zip(DIMENSIONS, scoring.means))}.") if under := under_floor(scoring.means): - print(f"Floor: {', '.join(under)} under the floor of {FLOOR} block the merge, as the chunk {' and '.join(reasons)}.") + print(f"Floor: {', '.join(under)} under the floor of {FLOOR}.") return append(given.read, scoring_entry(named.title, scoring)) -def read_fall_scores(scores_file: pathlib.Path, votes: Heading) -> ScoringRun | Failure: - """The scores a fall called, once their file names what the votes file read.""" - read = read_seats(scores_file, paired=False, refuse_recorded=False) - if isinstance(read, Failure): - return read - named, given = read - if (named.label, named.commit) != (votes.label, votes.commit): - return Failure(f"the scores file's first line is not `{votes.label} at {votes.commit}`, as the votes file reads: {given.read}") - return scored_seats(given) - - def scored_seats(given: SeatsFile) -> ScoringRun | Failure: found = scores(given.seats) if isinstance(found, Failure): @@ -83,8 +56,8 @@ def scored_seats(given: SeatsFile) -> ScoringRun | Failure: return ScoringRun(given.seats, found, means(list(found.values()))) -def read_seats(path: pathlib.Path, paired: bool, refuse_recorded: bool = True) -> tuple[Heading, SeatsFile] | Failure: - """The seats file and the heading its record goes under. Fails when the file names a commit the checkout lacks, or, when refuse_recorded, when the history already holds an entry on what it reads; it runs before anything is printed.""" +def read_seats(path: pathlib.Path, paired: bool) -> tuple[Heading, SeatsFile] | Failure: + """The seats file and the heading its record goes under. Fails when the file names a commit the checkout lacks, or when the history already holds an entry on what it reads; it runs before anything is printed.""" try: given = seats_file(path.read_text(encoding="utf-8")) except (OSError, UnicodeDecodeError) as failure: @@ -96,15 +69,22 @@ def read_seats(path: pathlib.Path, paired: bool, refuse_recorded: bool = True) - return named if unknown := [commit for commit in (named.commit, named.against) if commit and not commit_exists(commit)]: return Failure(f"the seats file names {', '.join(unknown)}, which is no commit in this checkout") - if refuse_recorded: - history = history_file() - if isinstance(history, Failure): - return history - if recorded(history[1], given.read): - return Failure(f"{history[0]} already holds an entry on {given.read}; record each ruling or run once") + history = history_file() + if isinstance(history, Failure): + return history + if recorded(history[1], given.read): + return Failure(f"{history[0]} already holds an entry on {given.read}; record each ruling or run once") return named, given +def show_places() -> Failure | None: + history = history_file() + if isinstance(history, Failure): + return history + print((latest_places(history[1]) or "The comprehension history names no places a scoring run found hard.").rstrip("\n")) + return None + + def history_file() -> tuple[pathlib.Path, str] | Failure: """The checkout's history and its text, empty when the file is missing.""" checkout = top() diff --git a/bin/larv_review/ruling.py b/bin/larv_review/ruling.py index 5df6cdf6..c5f1ba05 100644 --- a/bin/larv_review/ruling.py +++ b/bin/larv_review/ruling.py @@ -53,11 +53,6 @@ def ruling(overall: list[str]) -> str: return lead(overall) or "same" -def fallen(counted: dict[str, list[str]]) -> list[str]: - """Each dimension, Overall aside, that the seats rule worse by a lead of two.""" - return [name for name, column in zip(DIMENSIONS[:-1], zip(*counted.values())) if lead(list(column)) == "worse"] - - def lead(votes: list[str]) -> str | None: """The vote that leads each other vote by two or more, if one does.""" return next((vote for vote in VOTES if all(votes.count(vote) >= votes.count(other) + 2 for other in VOTES if other != vote)), None) diff --git a/bin/larv_review/scoring.py b/bin/larv_review/scoring.py index 19b86fcd..7444cb93 100644 --- a/bin/larv_review/scoring.py +++ b/bin/larv_review/scoring.py @@ -5,13 +5,6 @@ from comprehension_history import DIMENSIONS FLOOR = decimal.Decimal("7.0") -def fall_ruling(ruled: str, fell: list[str], found: list[decimal.Decimal]) -> tuple[str, str]: - """The ruling once the scoring run has scored the dimensions that fell, and the line that says why: worse when one of their means is under the floor, so a chunk cannot trade one dimension below the floor for gains in the others.""" - if under := [f"{name} {value}" for name, value in zip(DIMENSIONS, found) if name in fell and value < FLOOR]: - return "worse", f"Fell: {', '.join(fell)}. Under the floor of {FLOOR}: {', '.join(under)}, so the {ruled} ruling counts as worse." - return ruled, f"Fell: {', '.join(fell)}, each at or above the floor of {FLOOR}, so the {ruled} ruling stands." - - def means(lines: list[list[str]]) -> list[decimal.Decimal]: """The mean of each score across the lines, in DIMENSIONS' order, rounded half up to two decimals.""" return [mean([decimal.Decimal(score) for score in column]) for column in zip(*lines)] diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index ec2a9378..650c00b0 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -10,14 +10,14 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) -from comprehension_history import appended, entries, HistoryChange, Place, recorded, ruling_entry, ScoringRun, Seat +from comprehension_history import appended, entries, HistoryChange, latest_places, Place, recorded, ruling_entry, scoring_entry, ScoringRun, Seat from larv_review.ruling_base import base, first_ruling, measured_commit import comprehension_history -from larv_review.ruling import counted, fallen, ruling, split, votes +from larv_review.ruling import counted, ruling, split, votes from failure import Failure -from larv_review.scoring import fall_ruling, means, under_floor from test_env import isolated_env from todo_table import Item, items +from larv_review.scoring import means, under_floor from larv_review.seats import score_line, scores, seats_file from larv_review.plan import scoring_run_due @@ -77,12 +77,6 @@ class Seats(unittest.TestCase): self.assertIsInstance(votes([first[0], Seat("Inherited architect", said("worst"), [])]), Failure) self.assertIsInstance(votes([first[0], Seat("Inherited architect", "same", [])]), Failure) - def test_finds_each_dimension_ruled_worse_by_a_lead_of_two(self): - self.assertEqual(fallen({"Mid A": ["same", "worse", "worse", "same", "better"], "Inherited architect": ["same", "worse", "same", "same", "better"]}), ["Locality"]) - four = {name: ["same", vote, "same", "same", "better"] for name, vote in (("Mid A", "worse"), ("Inherited architect", "same"), ("Maintainability senior", "worse"), ("Junior A", "worse"))} - self.assertEqual(fallen(four), ["Locality"]) - self.assertEqual(fallen({**four, "Junior A": ["same", "better", "same", "same", "better"]}), []) - def test_rules_by_a_lead_of_two_and_splits_two_seats_that_differ(self): cases = [ (["worse", "worse"], "worse"), @@ -120,31 +114,33 @@ class History(unittest.TestCase): sample = [line.removeprefix("#").removeprefix(" ") for line in itertools.takewhile(lambda line: line.startswith("#"), source[start:])] seat = Seat("Mid A", said("better", "worse"), ["Locality: `bin/x.py:12` `run`: three branches to hold at once"]) votes = {"Mid A": ["better", "worse", "same", "same", "better"]} - self.assertEqual(ruling_entry("2026-10-09T09:47:25Z, PR #232 at 324d650, against 12d6d75", [seat], votes, votes, "same", [], None), "\n".join(sample) + "\n") + self.assertEqual(ruling_entry("2026-10-09T09:47:25Z, PR #232 at 324d650, against 12d6d75", [seat], votes, votes, "same"), "\n".join(sample) + "\n") def test_reads_back_what_it_writes(self): seats = [Seat("Mid A", said("better", "worse"), ["`bin/a.py:3` `f`: hard, with `:9` `g`"]), Seat("Inherited architect", said("worse", "worse"), [])] written = {"Mid A": ["same", "worse", "same", "same", "better"], "Inherited architect": ["same", "worse", "same", "same", "worse"]} scoring = ScoringRun([Seat("Junior A", "", ["`bin/b.py:4` `h`: long"])], {"Junior A": ["7", "6.5", "7", "7", "7"]}, [decimal.Decimal(mean) for mean in ("7.00", "6.50", "7.00", "7.00", "7.00")]) - ruled = ruling_entry("2026-10-08T18:37:21Z, PR #2 at bbbbbbb, against aaaaaaa", seats, written, {**written, "Inherited architect": ["same"] * 5}, "worse", ["Fell: Locality, under the floor."], scoring) - history = appended(appended("", SCORING), ruled) + ruled = ruling_entry("2026-10-08T18:37:21Z, PR #2 at bbbbbbb, against aaaaaaa", seats, written, {**written, "Inherited architect": ["same"] * 5}, "worse") + history = appended(appended("", scoring_entry("2026-10-08T12:00:00Z, PR #1 at aaaaaaa", 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, no place naming Locality) | same | same | same (voted worse, naming no place) |", history) found = entries(history) self.assertEqual([(entry.commit, entry.against, entry.ruling) for entry in found], [("aaaaaaa", None, None), ("bbbbbbb", "aaaaaaa", "worse")]) - self.assertEqual((found[1].ruled_places, found[1].scored_places), ([Place("bin/a.py", "f"), Place("bin/a.py", "g")], [Place("bin/b.py", "h")])) + self.assertEqual((found[0].scored_places, found[1].ruled_places), ([Place("bin/b.py", "h")], [Place("bin/a.py", "f"), Place("bin/a.py", "g")])) self.assertTrue(recorded(history, "PR #2 at bbbbbbb, against aaaaaaa")) self.assertFalse(recorded(history, "PR #2 at bbbbbbb")) - self.assertIn("| Mean | 7.00 | 6.50 | 7.00 | 7.00 | 7.00 |\n\nMid A, decided by:", history) + self.assertIn("| Mean | 7.00 | 6.50 | 7.00 | 7.00 | 7.00 |\n\nJunior A, hardest first:", history) self.assertEqual([entry.paired for entry in found], [False, True]) - -class FallRuling(unittest.TestCase): - def test_counts_a_ruling_worse_when_a_fallen_dimensions_mean_is_under_the_floor(self): - found = [decimal.Decimal(score) for score in ("6", "6.5", "7", "6", "6")] - self.assertEqual(fall_ruling("better", ["Locality", "Shape"], found), ("worse", "Fell: Locality, Shape. Under the floor of 7.0: Locality 6.5, so the better ruling counts as worse.")) - self.assertEqual(fall_ruling("same", ["Shape"], found), ("same", "Fell: Shape, each at or above the floor of 7.0, so the same ruling stands.")) + def test_names_the_places_of_the_newest_entry_that_scored_the_project(self): + scored = "## 2026-10-08T12:00:00Z, PR #1 at aaaaaaa\n\n| Seat | Overall |\n|---|---|\n| Mean | 7.00 |\n\nJunior A, hardest first:\n\n- `bin/b.py:4` `h`: long\n and wrapped\n\nInherited architect, would restructure first:\n\n- `bin/c.py:1` `k`: tangled\n" + fell = "## 2026-10-09T12:00:00Z, PR #2 at bbbbbbb, against aaaaaaa\n\nRuling: same\n\nMid A, decided by:\n\n- Locality: `bin/a.py:3` `f`: hard\n\nMid A, hardest first:\n\n- `bin/d.py:2` `m`: deep\n" + ruled = paired("2026-10-10T12:00:00Z", "worse") + "\nMid A, decided by:\n\n- Locality: `bin/a.py:3` `f`: hard\n" + self.assertIsNone(latest_places("")) + self.assertIsNone(latest_places(appended("", ruled))) + self.assertEqual(latest_places(appended(appended("", scored), ruled)), "## 2026-10-08T12:00:00Z, PR #1 at aaaaaaa\n\nJunior A, hardest first:\n\n- `bin/b.py:4` `h`: long\n and wrapped\n\nInherited architect, would restructure first:\n\n- `bin/c.py:1` `k`: tangled\n") + self.assertEqual(latest_places(appended(appended(appended("", ruled), fell), scored)), "## 2026-10-09T12:00:00Z, PR #2 at bbbbbbb, against aaaaaaa\n\nMid A, hardest first:\n\n- `bin/d.py:2` `m`: deep\n") class Base(unittest.TestCase): @@ -305,42 +301,16 @@ class LarvReviewTool(unittest.TestCase): self.assertEqual(recorded[0].ruled_places, [Place("bin/a.py", "f")] * 2) self.assertIn("| Junior A | same | same | same | same | same (voted worse, naming no place) |", history.read_text()) - def test_asks_for_the_scoring_seats_when_a_dimension_falls_and_rules_with_their_scores(self): + def test_records_a_ruling_whose_dimension_fell_and_takes_no_scores_file(self): place = "\n\n- Locality, Overall: `bin/a.py:3` `f`: shorter\n\n" votes_file = self.seats_file(f"PR #2 at {self.start}, against {self.start}\n\nMid A: {said('better', 'worse')}{place}Inherited architect: {said('better', 'worse')}{place}", "votes.md") - asked = self.run_tool("record-ruling", votes_file) - self.assertEqual(asked.returncode, 0, asked.stderr) - self.assertTrue(asked.stdout.startswith(f"Fell: Locality, in a better ruling. Launch the four scoring seats on PR #2 at {self.start},")) - history = self.checkout / "docs" / "comprehension-history.md" - self.assertFalse(history.exists()) - line = "Navigation 7, Locality 6.5, Shape 7, Self-sufficiency 7, Overall 7" - scores_text = f"PR #2 at {self.start}\n" + "".join(f"\n{seat}: {line}\n\n- `bin/b.py:4` `h`: long\n" for seat in ("Junior A", "Mid A", "Maintainability senior", "Inherited architect")) - ruled = self.run_tool("record-ruling", votes_file, self.seats_file(scores_text, "scores.md")) - self.assertEqual(ruled.returncode, 0, ruled.stderr) - self.assertTrue(ruled.stdout.startswith("Ruling: worse. Fell: Locality. Under the floor of 7.0: Locality 6.50, so the better ruling counts as worse.")) - again = self.run_tool("record-ruling", votes_file, self.seats_file(scores_text, "scores.md")) - self.assertIn("already holds an entry on", again.stderr) - self.assertEqual(self.run_tool("record-ruling", votes_file).stdout, "") - recorded = entries(history.read_text()) - self.assertEqual([entry.ruling for entry in recorded], ["worse"]) - self.assertIn("| Mean | 7.00 | 6.50 | 7.00 | 7.00 | 7.00 |", history.read_text()) - votes_file = self.seats_file(pathlib.Path(votes_file).read_text().replace("PR #2", "PR #3"), "votes.md") - scores_text = scores_text.replace("PR #2", "PR #3") - stands = self.run_tool("record-ruling", votes_file, self.seats_file(scores_text.replace("Locality 6.5", "Locality 7"), "scores.md")) - self.assertTrue(stands.stdout.startswith("Ruling: better. Fell: Locality, each at or above the floor of 7.0, so the better ruling stands."), stands.stderr) - votes_file = self.seats_file(pathlib.Path(votes_file).read_text().replace("PR #3", "PR #4"), "votes.md") - other = self.run_tool("record-ruling", votes_file, self.seats_file(scores_text.replace("PR #3", "PR #5"), "scores.md")) - self.assertIn("the scores file's first line is not", other.stderr) - - def test_names_no_fall_on_a_worse_ruling_and_takes_no_scores_file_without_one(self): - place = "\n\n- Locality, Overall: `bin/a.py:3` `f`: 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}")) + extra = self.run_tool("record-ruling", votes_file, votes_file) + self.assertEqual(extra.returncode, 1) + self.assertIn("unknown arguments", extra.stderr) + ran = self.run_tool("record-ruling", votes_file) self.assertEqual(ran.returncode, 0, ran.stderr) - self.assertNotIn("Fell:", ran.stdout + (self.checkout / "docs" / "comprehension-history.md").read_text()) - extra = self.run_tool("record-ruling", self.seats_file(f"PR #3 at {self.start}, against {self.start}\n\nMid A: {said('worse')}{place}Inherited architect: {said('worse')}{place}"), self.seats_file("PR #2", "scores.md")) - self.assertIn("a worse ruling takes no scores file; run record-ruling again with the votes file alone", extra.stderr) - better = self.run_tool("record-ruling", self.seats_file(f"PR #5 at {self.start}, against {self.start}\n\nMid A: {said('better')}{place}Inherited architect: {said('better')}{place}"), self.seats_file("PR #5", "scores.md")) - self.assertIn("no dimension fell in this better ruling, so it takes no scores file", better.stderr) + self.assertTrue(ran.stdout.startswith("Ruling: better. Overall votes as counted:")) + self.assertEqual([entry.ruling for entry in entries((self.checkout / "docs" / "comprehension-history.md").read_text())], ["better"]) def test_records_a_scoring_run_with_its_means(self): line = "Navigation 7, Locality 6.5, Shape 7, Self-sufficiency 6.5, Overall 7" @@ -350,13 +320,20 @@ class LarvReviewTool(unittest.TestCase): self.assertIn("no plan item or release calls this scoring run", uncalled.stderr) ran = self.run_tool("record-scoring", self.seats_file(f"PR #2 at {self.start}\n" + seats), "1") self.assertEqual(ran.returncode, 0, ran.stderr) - self.assertIn("\nFloor: 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.\n", ran.stdout) + self.assertIn("\nFloor: Locality 6.50, Self-sufficiency 6.50 under the floor of 7.0.\n", ran.stdout) self.assertIn("not /", self.run_tool("record-scoring", "1", self.seats_file(f"PR #2 at {self.start}\n" + seats)).stderr) 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(entries(text)[0].scored_places, [Place("bin/a.py", "f")] * 4) + def test_prints_the_places_the_newest_scoring_seats_named(self): + self.assertEqual(self.run_tool("places").stdout, "The comprehension history names no places a scoring run found hard.\n") + self.commit("Record a scoring run", {"docs/comprehension-history.md": appended("", SCORING + "\nJunior A, hardest first:\n\n- `bin/b.py:4` `h`: long\n")}) + ran = self.run_tool("places") + self.assertEqual((ran.returncode, ran.stdout), (0, "## 2026-10-08T12:00:00Z, PR #1 at aaaaaaa\n\nJunior A, hardest first:\n\n- `bin/b.py:4` `h`: long\n"), ran.stderr) + self.assertIn("unknown arguments", self.run_tool("places", "x").stderr) + 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")) self.assertEqual(ran.returncode, 1) diff --git a/docs/decisions.md b/docs/decisions.md index a690922e..642be9c4 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -38,26 +38,9 @@ 2026-09-24, larv-review. Serves goals 1 and 2. The tools drive the host's claude CLI and read the host's session files, which a container cannot see; the tests run on the same host Python the tools meet. Valid while claude runs on the host. -## comprehension floor: every dimension and the overall at 7.0 or above, and 0.3.0 waits on it +## comprehension floor: every dimension and the overall at 7.0 or above is the target, and blocks no merge or release -2026-09-27, lilleman, restating the 2026-09-24 target and extending it to the overall. Serves goal 1. Valid while the scoring run keeps its four seats. The decisions to ship under the floor, listed below, stand until `todo.md` item 62 lifts the project to it. 2026-10-12, lilleman: 0.1.0 holds the CLAUDE.md, hook, reviewer and scoring rework, 0.2.0 the task routing, and item 62 moves to 0.3.0. The chunk that ends 0.1.0 merges under the floor only once lilleman ships it under the floor, listed below. - -lilleman decided to ship each of these under the floor on the day listed. Each line gives its last scores (Navigation, Locality, Shape, Self-sufficiency, overall): - -- 2026-10-01, `rebuild`, merged at 8585257: 7.38, 6.75, 7.25, 6.5, 6.88. -- 2026-10-01, PR #182: 7.5, 6.5, 6.88, 6.25, 6.38. -- 2026-10-02, PR #191: 7.63, 7.0, 7.25, 6.75, 7.25. -- 2026-10-02, PR #196: 7.5, 7.0, 7.0, 6.75, 7.0. -- 2026-10-02, PR #198: 7.63, 6.88, 7.38, 6.75, 7.13. -- 2026-10-03, PR #202: 7.5, 7.0, 7.0, 6.75, 7.0. -- 2026-10-03, PR #208: 7.5, 7.0, 7.13, 6.63, 6.88. -- 2026-10-04, PR #215: 7.38, 6.63, 7.0, 6.88, 6.88. -- 2026-10-08, PR #224: 7.00, 6.50, 7.00, 6.50, 6.75. lilleman shipped it below the ratchet as well: its 20 lines of skill prose left the code as it was, so the fall is the panel's noise between runs, which the paired ruling cancels. -- 2026-10-08, PR #225: 7.25, 6.75, 7.00, 6.88, 6.88. Above PR #224's run on every score but Shape, which held. -- 2026-10-08, PR #228: no scoring run; its last paired ruling, against 12d6d75, was worse, 2 votes to 0. lilleman shipped it below the ratchet: the seats blamed the new ratchet's own rules, since moved into the tested `bin/larv-review`. -- 2026-10-08, PR #229: no scoring run; its last paired ruling, against 12d6d75, was worse, 2 votes to 0. lilleman shipped it below the ratchet for PR #228's reason: the seats' decisive places were still PR #228's rules, since moved into `bin/larv-review`. -- 2026-10-09, PR #232: 7.13, 6.50, 6.63, 6.63, 6.88, at 324d650, whose ruling the fall made worse. Its last paired ruling, at 53014f8 against 12d6d75, split: Mid A better, the inherited architect worse, both with Locality worse. lilleman shipped it below the ratchet: after a restructure the seats still weigh PRs #229 to #231's code against the base, and their Locality places are filed under item 62; the `bin/` regrouping, item 83, shipped in PR #234. -- 2026-10-09, PR #234: 7.13, 6.63, 6.75, 6.50, 6.63, at 7e13778. Four architecture rounds and the rescore each ruled better, 2 votes to 0, while the means moved within the panel's noise between runs. lilleman shipped it below the floor: most of every seat's remaining places sit in larv-review's rules, which cannot be followed without `skills/larv-review/SKILL.md` §3 open beside the code. Fixing that is a chunk of its own, under item 62. +2026-09-27, lilleman, restating the 2026-09-24 target and extending it to the overall. Serves goal 1. 2026-10-13, lilleman: the floor blocks nothing, and `review: the comprehension check records …` says why. The decisions to ship under the floor, listed here until then, are in git history. `larv-review record-scoring` names each mean under the floor, and item 62 lifts this project to it. Valid while the scoring run keeps its four seats. ## loop-claude: each project's model lives in `~/.claude/loop-claude-models.json`, which only loop-claude writes @@ -71,19 +54,19 @@ lilleman decided to ship each of these under the floor on the day listed. Each l 2026-10-08, lilleman, replacing the 2026-09-30 rule that every fix, a nit's included, re-enters review. Serves goal 1.4. An audit of the four costliest archived chunks (2026-10-08) found nearly every finding that mattered in a pass's first round; later rounds mostly re-checked the last fix, reworded what an earlier round wrote, or contradicted another round on the same line. A round 2 caught real bugs only where a fix changed behaviour, so stability still reruns on every fix that does, and security on every fix that opens an untrusted-input boundary or touches authn/authz, secrets or crypto. Valid while round-2 reviews of nit and prose fixes keep changing nothing a user would notice. -## 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 or an item names the floor, and also runs when a ruling names a fallen dimension +## review: the comprehension check records how hard a project is to read and blocks no merge: a paired ruling against the last measured commit where the architecture pass ran, and the four-seat scoring run when a release's items run out or an item names the floor 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. Valid while seats reading both versions agree more often than two absolute runs do. -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. The four scoring seats' scores go into the ruling itself, which `record-ruling` decides in one call, so no command reads a fall another command recorded. Those scores block on the fallen dimensions alone, the floor's own block staying with a release's end and an item naming the floor, and they leave the base where the ruling leaves it: a run of falls each ruled same must not add up unseen. PR #232's own history holds one fall-called scoring run recorded on its own, before this rule; it moves the base like any scoring run, which is safe under it, since a later fall of a dimension under the floor is always caught. A dimension's vote counts only where one of the seat's places opens with that dimension, so a fall rests on places the seats name. +2026-10-13, lilleman. No published study validates simulated reader panels as a measure of how easy code is to understand, and item 84's test of whether the panel's signal beats its noise has not run. So no ruling, score or floor blocks a merge, and the ratchet is gone. The runs go on, so the history keeps the scores and the places the seats found hard, for later measurement. The architect, the stability reviewer and a session filing an item read the newest places, since those places are what a chunk can improve. With nothing to block, the check runs once per chunk, on the commit to merge, in place of a run in each architecture round and a rescore after later commits. A fallen dimension no longer calls the four scoring seats either: their scores only decided the block. This replaces the 2026-10-09 rule that made a fall under the floor count as worse. ## review: a project decision may suspend the comprehension check for the plan items it names -2026-10-04, lilleman. Serves goal 1.4. In a restructure, each step's scoring run measures code the next step deletes. It costs a run and, below the floor, blocks the step, yet says nothing about what the restructure buys. The scoring run after the last step measures that. 2026-10-08: the paired ruling replaced the scoring run in most chunks, and the suspension covers it too; the ruling after the last step compares with the commit measured before the first step. Valid while such a decision names its items and the plan item that ends it. +2026-10-04, lilleman. Serves goal 1.4. In a restructure, each step's scoring run measures code the next step deletes. It costs a run and, below the floor, blocks the step, yet says nothing about what the restructure buys. The scoring run after the last step measures that. 2026-10-08: the paired ruling replaced the scoring run in most chunks, and the suspension covers it too; the ruling after the last step compares with the commit measured before the first step. 2026-10-13, lilleman: the comprehension check blocks nothing now, so a suspension saves only the runs. Valid while such a decision names its items and the plan item that ends it. ## review: a project decision may opt every chunk out of the architect, the product-owner pass or the comprehension check -2026-10-11, lilleman. Serves goal 1.4. A research repo's PR, in a repo with no consumer for the product-owner pass and no product for the architect, spent rounds of both, and of the comprehension check, on a probe. The opt-out is the project's to make, and only an entry titled `review opt-out:` makes it, so a project without one is reviewed as before (goal 1.3). No opted-out reviewer works against a goal or a technical principle: the principles audit, which has no opt-out, still judges KISS and every other principle, so the entry names no plan item that ends it. An opt-out of the comprehension check ends with a chunk that ships an item naming the floor. That chunk runs a scoring run alone, so no ruling compares against a commit measured before the opt-out. Valid while the principles audit judges every chunk, and while the architect's and the product-owner's findings matter only to a product with consumers. +2026-10-11, lilleman. Serves goal 1.4. A research repo's PR, in a repo with no consumer for the product-owner pass and no product for the architect, spent rounds of both, and of the comprehension check, on a probe. The opt-out is the project's to make, and only an entry titled `review opt-out:` makes it, so a project without one is reviewed as before (goal 1.3). No opted-out reviewer works against a goal or a technical principle: the principles audit, which has no opt-out, still judges KISS and every other principle, so the entry names no plan item that ends it. 2026-10-13, lilleman: an opt-out of the comprehension check no longer ends with a chunk that ships an item naming the floor, since the floor blocks nothing. Valid while the principles audit judges every chunk, and while the architect's and the product-owner's findings matter only to a product with consumers. ## review: a pass skips only on a precedent: a decision, or a plan item crediting the pass, that the repo held before the chunk began diff --git a/rules/todo-items.md b/rules/todo-items.md index 7d890e4e..c9cfe3f3 100644 --- a/rules/todo-items.md +++ b/rules/todo-items.md @@ -14,6 +14,7 @@ paths: - **A** — its value to the audience in `README.md` → `## Audience`. - **G** — its value to the goals it cites in the Goals column; W is the weight of the heaviest of them. - **Check R, S and C against finished chunks.** Guess them, then run `~/.claude/bin/score-outcomes ` in the project. It lists the finished items guessed nearest, what their chunks measured, and the median outcome at each guessed value. Set each score to the value guessed for the finished items whose outcome matches what you expect of this one. Keep your guess when no listed item resembles the one you are scoring. +- **Read the places the comprehension seats found hard before filing an item.** `~/.claude/bin/larv-review places` prints them. Where the item's change touches one, its detail says to make that place easier to read. - **An item scoring under the bar is deleted, with every item that needs it, and a finding under the bar is not filed.** The chunk's summary names each, with its score. - **The Exempt cell keeps an item whatever its score:** `security` for a security finding, `defect` for a 🔴 finding, `question` for a question only the human can answer, `decision` for an item `docs/decisions.md` cites, and, where no other reason fits, `principle` for a 🟡 finding against a file under `~/.claude/principles/`, whose item's detail names that principle. Every item `docs/decisions.md` cites carries one of these reasons. - **Unless the project has a reason to differ, weigh goals by position, the first heaviest.** When the weights stop listing the README's goals, `rank_todo.py` fails and prints those weights. diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md index fbbc1e12..7f397a2f 100644 --- a/skills/larv-review/SKILL.md +++ b/skills/larv-review/SKILL.md @@ -32,7 +32,7 @@ A pass is one kind of review, a row of the table, named by its first column. Its | Pass | Reviewer | Trigger | |------|----------|----------------------------------------| -| Architecture | systems-architect, then principles-auditor and the comprehension check | is due a scoring run ("Architecture" → "Scoring run"); or carries an architectural decision: a new, restructured or moved component, module, service or boundary; a new dependency or first use of an infrastructure pattern (queue, cron, cache, websocket, …); a new or changed external contract (routes, request/response shapes, events, webhooks, published file formats, CLI flags and exit codes); a schema change beyond an additive column; a fix, only where it carries an architectural decision | +| Architecture | systems-architect, then principles-auditor | carries an architectural decision: a new, restructured or moved component, module, service or boundary; a new dependency or first use of an infrastructure pattern (queue, cron, cache, websocket, …); a new or changed external contract (routes, request/response shapes, events, webhooks, published file formats, CLI flags and exit codes); a schema change beyond an additive column; a fix, only where it carries an architectural decision | | Full scan | the `claude-security` plugin at high effort: `/claude-security scan this branch's changes at high` | touches authn/authz, secrets or crypto, opens an untrusted-input boundary, or adds an external surface | | Security | `/security-review` | changes code or config, unless the full scan runs on the same change; a fix, only where it opens an untrusted-input boundary or touches authn/authz, secrets or crypto, and the full scan does not rerun on it | | Overrides | override-reviewer | `~/.claude/bin/rule-hook overrides`, run in the chunk's worktree, prints a line no round of this pass has ruled on; a fix, only where the hook logged an override for it | @@ -44,30 +44,29 @@ A comment is prose, not code. Passes run in this order: line-level polish on cod Give a reviewer without Bash the branch diff and `git ls-files`'s output in its prompt: some harnesses grant it Read alone. -`~/.claude/bin/larv-review` holds this section's mechanical rules: the round count, the paired ruling's base and vote count, the scoring run's trigger and the history's format. Run it in the chunk's worktree; `~/.claude/bin/larv-review --help` states each rule. On exit 1, repair what its message names and run it again; when you cannot, ask the user. +`~/.claude/bin/larv-review` holds this section's mechanical rules: the round count, the paired ruling's base and vote count, the scoring run's trigger, and the history's format and latest places. Run it in the chunk's worktree; `~/.claude/bin/larv-review --help` states each rule. On exit 1, repair what its message names and run it again; when you cannot, ask the user. **Precedent, then ask** — for the architecture pass and the full scan: - **Skip.** A precedent is a `docs/decisions.md` entry, or a plan item crediting the pass, that the repo held before the chunk began. Where one holds the decision this change executes, skip the pass and cite that entry or item. - **Departure.** A change that departs from the precedent is unreviewed, however thorough the precedent is. - **Ask.** Fired and not skipped → ask the user whether to run it, with the evidence and your recommendation; no user reachable → run it. For the full scan, give the evidence and your recommendation, then launch it: the plugin asks the user to confirm its cost, and that prompt is the ask. -- **Audit.** A precedent or the user's no skips only the architect, never the principles audit: no precedent checked the code this chunk writes. The comprehension check skips only as "Opt-out" or "Architecture" → "Suspended" says. +- **Audit.** A precedent or the user's no skips only the architect, never the principles audit: no precedent checked the code this chunk writes. The comprehension check skips only as "Opt-out" or "Comprehension check" → "Suspended" says. **Opt-out** — for the architect, the product-owner pass and the comprehension check: - **Entry.** A project opts out only through a `docs/decisions.md` entry, held before the chunk began, whose title opens `review opt-out:` and names one or more of the three. The entry names the project goal that skipping them serves. - **Skip.** Every chunk skips each reviewer the entry names, even where its trigger, a 🔀 or a due scoring run calls for it, and the chunk's summary cites the entry. Unlike a suspension, an opt-out needs no plan item to end it. -- **Audit.** An architecture pass left without the architect and the comprehension check still runs the principles audit. +- **Audit.** An architecture pass left without the architect still runs the principles audit. - **Malformed.** A title naming another reviewer, or an entry naming no goal, is a finding of the pass the chunk runs, and the chunk runs every pass its trigger fires. -- **End.** An opt-out of the comprehension check ends with the chunk that ships a plan item naming the floor, and that chunk removes the comprehension check from the entry. It runs the comprehension check as a scoring run alone, with no paired ruling. That scoring run's floor blocks the merge as at a release's end, and the run becomes the base of the next paired ruling. **Round cap.** -- **Round.** A round is one launch of a pass's reviewer: the first, each re-entry, and the rerun after the architect returns Stage 0 questions ("Architecture" below). A rescore is a round only as "Architecture" → "Fresh" says. -- **Architecture round.** The architecture pass's first round is the architect (unless skipped), the principles audit and the comprehension check, which "Opt-out" or "Architecture" → "Suspended" may skip. A later round relaunches each reviewer whose 🔴 or 🟡 the previous round's fixes answer, the comprehension check only as "Architecture" → "Fresh" says. Where those fixes carry an architectural decision, the architect and the principles audit run again. +- **Round.** A round is one launch of a pass's reviewer: the first, each re-entry, and the rerun after the architect returns Stage 0 questions ("Architecture" below). +- **Architecture round.** The architecture pass's first round is the architect (unless skipped) and the principles audit. A later round relaunches each reviewer whose 🔴 or 🟡 the previous round's fixes answer. Where those fixes carry an architectural decision, the architect and the principles audit run again. - **Auto-reviewer.** The external auto-reviewer (§4) is a pass of its own, each review it posts a round. -- **Count.** Close each round with one commit that holds the round's fixes. Title it `Answer round : 🔴, 🟡; …`: `` is the pass's name in lower case, such as `full scan`, and `` and `` are the 🔴 and 🟡 findings all the round's reviewers reported. Example: `Answer stability round 1: 1 🔴, 2 🟡; flag a deleted test`. A round that changed nothing gets an empty commit (`git commit --allow-empty`). Push the commits when §4 runs next, where there is a remote. `~/.claude/bin/larv-review round-count` prints each pass's count and marks a pass at the cap. The auto-reviewer's count is the number of its reviews on the PR, less its reviews of a `Rescore:` commit. -- **Later rounds.** A rerun pass reviews only what changed since it last reviewed: `git diff HEAD`, since the fixes may be unpushed. The comprehension check's seats still read the whole project. From round 2, prompt an agent under `~/.claude/agents/` with its own last round's findings verbatim too. +- **Count.** Close each round with one commit that holds the round's fixes. Title it `Answer round : 🔴, 🟡; …`: `` is the pass's name in lower case, such as `full scan`, and `` and `` are the 🔴 and 🟡 findings all the round's reviewers reported. Example: `Answer stability round 1: 1 🔴, 2 🟡; flag a deleted test`. A round that changed nothing gets an empty commit (`git commit --allow-empty`). Push the commits when §4 runs next, where there is a remote. `~/.claude/bin/larv-review round-count` prints each pass's count and marks a pass at the cap. The auto-reviewer's count is the number of its reviews on the PR, less its reviews of a `Record the comprehension check:` commit. +- **Later rounds.** A rerun pass reviews only what changed since it last reviewed: `git diff HEAD`, since the fixes may be unpushed. From round 2, prompt an agent under `~/.claude/agents/` with its own last round's findings verbatim too. - **Done.** A pass is done when its latest round leaves no 🔴 or 🟡 standing: none was reported, or each was shown factually wrong, declined, filed, or named under the bar per "Findings", or, for the prose pass, fixed. Resolve that round's 🟢s and ❓s per "Findings" too. - **Cap.** A pass takes at most three rounds per chunk. Instead of a fourth, list what is open and ask the user. For the auto-reviewer, ask before the push that would summon its fourth, and hold the fixes unpushed until the answer. - **Answer.** A yes grants that pass one more round, after which the ask repeats; a no leaves the PR unmerged. @@ -76,7 +75,7 @@ Give a reviewer without Bash the branch diff and `git ls-files`'s output in its - **Fix.** A fix is a change no pass has seen. - **Rerun.** A round's fixes for 🔴 and 🟡 findings outside the prose pass re-enter together. Run, in table order, each pass whose 🔴 or 🟡 they answer, and each pass whose trigger has an "a fix, only where …" clause they meet, a done pass included. A pass at its cap gets "Round cap" → "Cap"'s ask instead. Then §4. -- **No rerun.** A fix for a 🟢, a ❓ or any prose finding reruns no pass. Its commit still calls for a rescore per "Architecture" → "Fresh". +- **No rerun.** A fix for a 🟢, a ❓ or any prose finding reruns no pass. **Findings.** A reviewer rates each finding 🔴 must fix, 🟡 should fix, 🟢 nit, ❓ question, or 🔀 escalation naming the reviewer whose concern it is. @@ -90,43 +89,30 @@ Give a reviewer without Bash the branch diff and `git ls-files`'s output in its ### Architecture -Launch systems-architect: review the system as a whole entered through this change; the decision log carries previously accepted decisions to honor, the README the goals and Stage 0 artifacts. +Launch systems-architect: review the system as a whole entered through this change; the decision log carries previously accepted decisions to honor, the README the goals and Stage 0 artifacts. Give it the places per "Comprehension check" → "Places". - **Stage 0 questions returned**: relay them to the user, record the answers in the README, re-run once. - **BLOCK** → confirm with the user first when the restructure materially reshapes their PR; until confirmed, no later pass runs. Then the principles audit: one principles-auditor for the README's goals, and one per file in `~/.claude/principles/` whose `Applies to` line the project meets, judged from the README, `git ls-files` and the branch diff. A file without the line applies to every project. Unsure → launch it. -Then the comprehension check: simulated readers, launched per `~/.claude/skills/comprehension-panel/SKILL.md`, each read the whole project, not the diff. It has two kinds of run. +### Comprehension check -**Paired ruling**, in every architecture pass. Each seat votes whether the project reads better, the same or worse at this branch's head than at the base. +The comprehension check records how hard the project is to read, 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 commit to merge. It runs a paired ruling where the architecture pass ran, and a scoring run where one is due. + +**Paired ruling.** Each seat votes whether the project reads better, the same or worse at this branch's head than at the base. - **Base.** The last measured commit, which `~/.claude/bin/larv-review ruling-base` prints. -- **Head.** Before each ruling, merge `origin/` into this branch unless the head already holds it, so the seats see only this branch's change on top of the base. -- **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 `. On `Split:`, launch the maintainability senior and Junior A together, add their lines, and run it again. On `Fell:`, launch the four scoring seats, below, on the same commit, write their lines into a scores file, and run `record-ruling `. -- **Ruling.** The `Ruling:` line `record-ruling` prints and appends to the history. +- **Head.** Before the ruling, merge `origin/` into this branch unless the head already holds it, so the seats see only this branch's change on top of the base. +- **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 `. 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`. 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. Where a fall's scores file already read the head, run `record-scoring` on that file. +**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`. 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. -The chunk does not merge while either holds: +**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 3), 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. -- **Ratchet.** The paired ruling is worse. -- **Floor.** `record-scoring` prints `Floor:`, naming means under the floor of 7.0. +**Places.** Give systems-architect and stability-reviewer what `~/.claude/bin/larv-review places` prints: the places the newest scoring seats found hard. Ask each to report, as a 🟡, each of those places the change touches without making it easier to read. Fix such a 🟡, or say in the PR summary why not; that reason settles it in place of a decline's record. -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. - -Fix a worse ruling at the places the seats voting worse name, or, where a fallen dimension made it worse, at the places that open with that dimension, and the floor at the places the seats name under the lowest dimension. When only the Floor bullet holds, the user may decide to ship instead. A decision that lets every chunk ship under the floor, held in the project's `docs/decisions.md` before the chunk began, counts as theirs while it stands. A decision to ship listed in the `comprehension floor:` entry covers only the chunk it names. No user reachable → fix. A worse ruling never ships: after three rounds, "Round cap" → "Cap" asks the user for another round. - -Two files of the project keep the records: - -- **History.** `docs/comprehension-history.md` keeps every paired ruling and scoring run, which `larv-review` appends; never edit one. Appending re-enters no pass. Resolve a merge conflict in the file by putting the default branch's entries first. -- **Entry.** `docs/decisions.md` keeps one entry whose title opens `comprehension floor:`. It holds each decision to ship under the floor, with its scores. - -Put each ruling with its base and votes, and each run's five scores, in the summary. List in the entry each decision to ship under the floor, and file its places in `todo.md` per `~/.claude/rules/todo-items.md`. A project without the entry gets it at its first scoring run, titled `comprehension floor: every dimension and the overall at 7.0 or above` and applying KISS (`~/.claude/principles/technical-principles.md`). - -**Fresh.** Where the chunk ran a comprehension check, the architecture pass is done only once its last paired ruling, and its last scoring run where one is due, read the commit to merge. They may predate commits that change only `docs/decisions.md`, `docs/comprehension-history.md`, `docs/reading-cost.md`, `todo.md` or `CHANGELOG.md`. Any other commit after them, a prose fix included, because the seats read the docs, calls for a rescore: the comprehension check again, once every other pass is done, the auto-reviewer included. A rescore reporting a 🔴 that no decision to ship answers is an architecture round. Any other rescore is not a round: append only its results to the history, in a commit titled `Rescore: …`. A `Rescore:` commit re-enters no pass: push it and wait for the forge's checks (§4 step 3), not for an auto-review. - -**Suspended.** A decision in the project's `docs/decisions.md`, held before the chunk began, may name plan items to ship without a comprehension check. A named item counts as `todo.md` worded it before the chunk began. The decision must name the later plan item whose chunk ends the suspension with a comprehension check. A chunk may ship named items only with each other. Such a chunk skips the comprehension check, so neither the ratchet nor the floor can block it, and its summary cites the decision. A chunk due a scoring run runs it, even when every item it ships is named. +**Suspended.** A decision in the project's `docs/decisions.md`, held before the chunk began, may name plan items to ship without a comprehension check. A named item counts as `todo.md` worded it before the chunk began. The decision must name the later plan item whose chunk ends the suspension with a comprehension check. A chunk may ship named items only with each other. Such a chunk skips the comprehension check, and its summary cites the decision. A chunk due a scoring run runs it, even when every item it ships is named. ### Security @@ -144,7 +130,7 @@ Launch override-reviewer with each line `rule-hook overrides` prints that no ear ### Stability and product-owner -Launch the reviewer with the change — product-owner-reviewer also with the external surface it touches. Fix along the reviewer's Fix guidance (delete > simplify > modify > add). Product-owner findings are about the consumer's experience — wording, discoverability, upgrade path, the edge case a persona hits — so the fix is as often a message or a doc as it is code. +Launch the reviewer with the change — stability-reviewer also with the places per "Comprehension check" → "Places", product-owner-reviewer with the external surface it touches. Fix along the reviewer's Fix guidance (delete > simplify > modify > add). Product-owner findings are about the consumer's experience — wording, discoverability, upgrade path, the edge case a persona hits — so the fix is as often a message or a doc as it is code. ### Prose @@ -162,9 +148,10 @@ Launch prose-reviewer with what the diff touched and every section this review c ## 5. Goal alignment, then merge 1. Read the finished PR against the README goals: does anything in it work against one? Misaligned → do not merge; ask the human, stating the conflict. -2. Aligned, every pass done and everything green → **merge**. Follow the repo's merge method (`AGENTS.md`; ff-only where that is the convention). A repo withholds this in its `AGENTS.md` → leave the PR ready and unmerged, and say which line withheld it. -3. Merged → remove the chunk's items from `todo.md` per `~/.claude/CLAUDE.md` → "Working loop". -4. Stop. The next chunk gets a fresh session. +2. Run the comprehension check (§3) where it runs. +3. Aligned, every pass done and everything green → **merge**. Follow the repo's merge method (`AGENTS.md`; ff-only where that is the convention). A repo withholds this in its `AGENTS.md` → leave the PR ready and unmerged, and say which line withheld it. +4. Merged → remove the chunk's items from `todo.md` per `~/.claude/CLAUDE.md` → "Working loop". +5. Stop. The next chunk gets a fresh session. ## 6. Wrap up diff --git a/todo.md b/todo.md index 466ab462..9e925cf1 100644 --- a/todo.md +++ b/todo.md @@ -24,7 +24,6 @@ | ID | Release | Exempt | Item | R | S | C | A | G | Goals | Score | |---|---|---|---|---|---|---|---|---|---|---| -| 99 | 0.1.0 | | **Drop the comprehension panel as a merge gate, and keep recording its scores and the places in the code its seats found hard, for later measurement and for other reviewers and agents to improve.** | 4 | 5 | 4 | 7 | 7 | 1.1, 1.4, 1.5 | 22.6 | | 97 | 0.1.0 | | **Narrow each review pass to the findings worth a fix, so a pass converges in its second round.** | 5 | 4 | 6 | 7 | 7 | 1.1, 1.4, 1.5 | 21.9 | | 109 | 0.1.0 | | **Lower the reading cost of the files a chunk reads most before its first commit.** | 2 | 4 | 4 | 5 | 6 | 1.4 | 18.5 | | 93 | 0.2.0 | | **Let a chunk's worker start below the project's model, once the archive shows chunks on a lower rung took no more review rounds than chunks on the project's model.** | 3 | 2 | 6 | 6 | 7 | 1.1, 1.4 | 22.4 | @@ -42,12 +41,12 @@ | 111 | 0.2.0 | | **Measure the chunks of a project that merges by squash or fast-forward, which `score-outcomes` skips today.** | 3 | 3 | 5 | 4 | 5 | 1.3 | 13.9 | | 113 | 0.2.0 | | **Compute an item's S from the code it names, where it names any, and show it beside the finished items `score-outcomes` lists.** | 3 | 4 | 6 | 4 | 5 | 1.1, 1.4 | 13.9 | | 1 | 0.3.0 | question | **Say in README → Install how the transcript archive is backed up, once bender-infra backs up ai-sandbox's data volume.** | 3 | 5 | 2 | 8 | 9 | 3, 4 | 27.0 | -| 62 | 0.3.0 | defect | **Lift Locality, Self-sufficiency and the overall to the comprehension floor, at the places the seats name.** | 4 | 6 | 6 | 6 | 8 | 1.1 | 22.3 | | 21 | 0.3.0 | | **Give `settings.json`'s model one writer, and sort its keys.** | 3 | 3 | 4 | 6 | 7 | 1.3 | 21.8 | | 49 | 0.3.0 | principle | **Check that `AGENTS.md` lists exactly the titles of `docs/decisions.md`.** | 1 | 2 | 2 | 5 | 6 | 1.3 | 20.1 | | 59 | 0.3.0 | | **Bound a run of unfinished verdicts on one chunk, so a worker and judge that disagree cannot cycle unattended without end.** | 3 | 3 | 5 | 6 | 6 | 1.4 | 19.8 | | 12 | 0.3.0 | | **Run the test suite in CI on every PR, or record in `docs/decisions.md` why the local run is enough.** | 2 | 4 | 3 | 4 | 6 | 1.1 | 16.9 | | 80 | 0.3.0 | | **State in README → Install that every machine taking this checkout must be a sandbox, as `settings.json`'s auto mode assumes.** | 1 | 1 | 1 | 5 | 5 | 4 | 16.8 | +| 62 | 0.3.0 | | **Lift Locality, Self-sufficiency and the overall to the comprehension floor, at the places the seats name.** | 4 | 6 | 6 | 5 | 6 | 1.1 | 16.4 | | 5 | 0.3.0 | decision | **Key a project on its checkout's full path, and refuse to start while another session uses that key.** | 5 | 5 | 7 | 5 | 6 | 1.1 | 15.6 | | 84 | 0.3.0 | | **Check, at each release's scoring run, that seats in a paired ruling agree more often than two scoring runs on near-identical code do, as the paired-ruling decision assumes.** | 2 | 2 | 5 | 4 | 5 | 1.4 | 15.1 | | 67 | 0.3.0 | principle | **Point stability-reviewer at the technical principles in place of its own restatement of them.** | 2 | 3 | 2 | 4 | 5 | 1.3 | 14.9 | @@ -72,12 +71,6 @@ ## Details -### 99. Drop the comprehension panel as a merge gate, and keep recording its scores and the places in the code its seats found hard, for later measurement and for other reviewers and agents to improve. - -No published study validates simulated reader panels as a measure of how easy code is to understand, and item 84's test of whether the panel's signal beats its noise has not run. Keep running the panel where it runs, and keep `docs/comprehension-history.md`: each run's scores, and each place a seat named with what it found hard there. No paired ruling, floor or ratchet blocks a merge. The architecture pass and the stability reviewer read the latest places named, and each chunk that touches one of them improves it or says in its PR summary why not. A worker filing items reads them too. - -This revises the `comprehension floor:` decision and the `review:` decisions on the paired ruling, the scoring run, suspending and opting out of the comprehension check, and it turns item 62 from a defect into an ordinary item scored by its value. A project's own gate rule, such as the one in fejkdata's `AGENTS.md`, is that project's to change. - ### 97. Narrow each review pass to the findings worth a fix, so a pass converges in its second round. Anthropic's best-practices page: "A reviewer prompted to find gaps will usually report some, even when the work is sound… Chasing every finding leads to over-engineering." 320 of this repo's 876 commits answer a review round. @@ -166,12 +159,6 @@ It lives under `~/.claude`, which `.gitignore` keeps from the remote, so a lost The README line covers the bench's transcripts in `workflow-bench/logs/` too (goal 3). -### 62. Lift Locality, Self-sufficiency and the overall to the comprehension floor, at the places the seats name. - -Raised by the principles audit of PR #215 against KISS, in `principles/technical-principles.md`, and goal 1.1. The `comprehension floor:` entry in `docs/decisions.md` lists each decision to ship under it. - -PR #234's last scoring run, at b2a277b, put Locality and Self-sufficiency at 6.50 and the overall at 6.75. Every seat named larv-review's rules, which cannot be followed without `skills/larv-review/SKILL.md` §3 open beside the code: "Round cap", "Re-entry", "Fresh" and "Suspended" point at each other; `bin/larv_review/record.py` `record_ruling` branches on split, worse, fell and a scores file, with its terms defined only in `larv-review --help` and the skill; the pass list lives in both `bin/round_titles.py` `PASSES` and the skill's table, which also counts the auto-reviewer; `bin/comprehension_history.py` is reader, writer and seat registry in one, and parses the history by regex for two tools. Also named: the judge's prompt assembled from `cycle/judge.py`, `cycle/prompts.py` and `project/records.py`; git run four ways, in `bin/larv_review/git.py`, `bin/metric_bench/main.py`, `bin/reading_cost/main.py` and `bin/loop_claude/effects.py`; `SeatsFile.read`, a field named like a method. - ### 21. Give `settings.json`'s model one writer, and sort its keys. Claude Code rewrites `"model"` in this tracked file whenever a model is picked, so one `/model` dirties the checkout and overrides the synced choice. @@ -196,6 +183,12 @@ When CI runs a rule check, such as one of `bin/rule-hook`'s, let `