diff --git a/bin/comprehension_history.py b/bin/comprehension_history.py index a299957c..122f1186 100644 --- a/bin/comprehension_history.py +++ b/bin/comprehension_history.py @@ -21,8 +21,8 @@ MID = "Mid A" PLACE = re.compile(r"`([^`\s]*):\d+`(?: `(\w+)`)?") RESTRUCTURE_FIRST = "would restructure first" RULING = re.compile(r"^Ruling: (better|same|worse)$", re.M) -RULED_PLACES = re.compile(rf"^.+, {DECIDED_BY}:$") -SCORED_PLACES = re.compile(rf"^.+, ({HARDEST_FIRST}|{RESTRUCTURE_FIRST}):$") +# A seat's label over its bullets: its name, then the listing's kind. +LABEL = re.compile(rf"^(.+), ({DECIDED_BY}|{HARDEST_FIRST}|{RESTRUCTURE_FIRST}):$") SENIOR = "Maintainability senior" TITLE = "# Comprehension history\n" @@ -40,22 +40,52 @@ class Place: name: str | None +@dataclasses.dataclass(frozen=True) +class Listing: + """The bullets a seat lists under one label of an entry, each with its indented continuation lines. `kind` is what the label ends in: DECIDED_BY, HARDEST_FIRST or RESTRUCTURE_FIRST.""" + label: str + seat: str + kind: str + bullets: list[str] + + @property + def places(self) -> list[Place]: + """The places on the first line of each bullet.""" + return [place for bullet in self.bullets for place in bullet_places(bullet.splitlines()[0])] + + @dataclasses.dataclass(frozen=True) 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.""" + """One paired ruling, which names the commit it was against and its ruling, or one scoring run, which names neither. + + `score_rows` holds the rows of the table with a Mean row, and `vote_rows` those of any other table: each row's cells after the first, keyed by the first, without the header. `ruled_listings` holds the decided-by listings, and `scored_listings` the hardest-first and would-restructure-first ones.""" heading: str time: str commit: str against: str | None ruling: str | None - ruled_places: list[Place] - scored_places: list[Place] - body: str + vote_rows: dict[str, list[str]] + score_rows: dict[str, list[str]] + ruled_listings: list[Listing] + scored_listings: list[Listing] @property def paired(self) -> bool: return self.against is not None + @property + def scored(self) -> bool: + """Whether the entry scores the project: a scoring run, or a ruling that lists scoring seats' places, as a ruling from before PR #255 may, beside their table.""" + return not self.paired or bool(self.scored_places) + + @property + def ruled_places(self) -> list[Place]: + return [place for listing in self.ruled_listings for place in listing.places] + + @property + def scored_places(self) -> list[Place]: + return [place for listing in self.scored_listings for place in listing.places] + @dataclasses.dataclass(frozen=True) class HistoryChange: @@ -101,25 +131,33 @@ 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)) + tables = table_rows(body) + listed = listings(body) + found.append(Entry( + heading, named.group(1), named.group(3), named.group(4), ruling.group(1) if ruling else None, + vote_rows={name: cells for table in tables if MEAN not in table for name, cells in table.items()}, + score_rows={name: cells for table in tables if MEAN in table for name, cells in table.items()}, + ruled_listings=[listing for listing in listed if listing.kind == DECIDED_BY], + scored_listings=[listing for listing in listed if listing.kind != DECIDED_BY], + )) return found def latest_places(history: str) -> str | None: """The places seats found hard since the newest scored commit, under each entry's heading, oldest first; None when no place counts. - They start at the first of newest_scored's entries, so a rerun of one head adds to the run before it. Where no entry counts as scoring the project, they start at the oldest entry. From there, each entry gives every scoring seat's place, and each ruled place opening with a dimension its seat voted worse.""" + They start at the first entry that scores that commit, so a rerun of one head adds to the run before it. Where no entry scores the project, they start at the oldest entry. From there, each entry gives every scoring seat's place, and each ruled place opening with a dimension its seat voted worse.""" found = by_time(entries(history)) - newest = newest_scored(found) + newest = newest_commit_runs(found) start = found.index(newest[0]) if newest else 0 - parts = [placed(entry, worse_places(entry) + labelled_bullets(entry.body, SCORED_PLACES)) for entry in found[start:]] + parts = [placed(entry, worse_places(entry) + entry.scored_listings) for entry in found[start:]] return "\n".join(part for part in parts if part) or None def latest_overall(history: str) -> decimal.Decimal | Failure | None: - """The mean of the overall means of newest_scored's entries, since a rerun of one head measures it again; None where no entry counts as scoring the project.""" + """The mean of the overall means of the entries that score the newest scored commit, since a rerun of one head measures it again; None where no entry scores the project.""" overalls = [] - for entry in newest_scored(by_time(entries(history))): + for entry in newest_commit_runs(by_time(entries(history))): overall = run_overall(entry) if isinstance(overall, Failure): return overall @@ -127,65 +165,65 @@ def latest_overall(history: str) -> decimal.Decimal | Failure | None: return sum(overalls, decimal.Decimal(0)) / len(overalls) if overalls else None -def newest_scored(found: list[Entry]) -> list[Entry]: - """In found's order, the entries that count as scoring the project on the newest scored commit, the commit of the last such entry; empty where none counts. A commit matches by prefix, since a heading may write it at any length from 7 characters.""" - scoring = [entry for entry in found if scored(entry)] - return [entry for entry in scoring if entry.commit.startswith(scoring[-1].commit) or scoring[-1].commit.startswith(entry.commit)] if scoring else [] +def newest_commit_runs(found: list[Entry]) -> list[Entry]: + """The entries that score the commit of the last entry that scores the project, in found's order; empty where none does. Commits match by prefix, since a heading may write one at any length from 7 characters.""" + scored = [entry for entry in found if entry.scored] + if not scored: + return [] + newest = scored[-1].commit + return [entry for entry in scored if entry.commit.startswith(newest) or newest.startswith(entry.commit)] def run_overall(run: Entry) -> decimal.Decimal | Failure: - """The overall cell of the Mean row of an entry that counts as scoring the project.""" + """The overall cell of the Mean row of an entry that scores the project.""" try: - overall = decimal.Decimal(overall_cells(run).get(MEAN, "")) + overall = decimal.Decimal(last_cells(run.score_rows).get(MEAN, "")) except decimal.InvalidOperation: overall = None return overall if overall is not None and overall.is_finite() else Failure(f"{HISTORY}'s scoring run {run.heading} has no Mean row ending in its overall, which sets code health's weight") -def overall_cells(entry: Entry) -> dict[str, str]: - """Each table row's last non-empty cell, by its first cell: a seat's overall vote in a ruling table, whether it has five votes or the older single `Vote`, or its overall score, or the Mean row's, in a scoring table.""" - return {name: cells[-1] for name, cells in table_rows(entry.body).items() if cells and cells[-1]} - - -def scoring_runs(found: list[Entry]) -> list[Entry]: - """The scoring runs among the entries, oldest first. Unlike scored, it leaves out a ruling from before PR #255 that holds scoring seats' places: there overall_cells reads each voting seat's vote, not its score.""" - return [entry for entry in by_time(found) if not entry.paired] +def last_cells(rows: dict[str, list[str]]) -> dict[str, str]: + """Each row's last cell, by its first cell, leaving out a row whose last cell is empty: a seat's overall vote in an entry's `vote_rows`, or its overall score, or the Mean row's, in its `score_rows`.""" + return {name: cells[-1] for name, cells in rows.items() if cells and cells[-1]} def by_time(found: list[Entry]) -> list[Entry]: return sorted(found, key=lambda entry: entry.time) -def scored(entry: Entry) -> bool: - """Whether the entry counts as scoring the project: a scoring run, or a ruling from before PR #255 that holds scoring seats' places.""" - return not entry.paired or bool(entry.scored_places) +def worse_places(entry: Entry) -> list[Listing]: + """Each of a ruling's decided-by listings, cut to the bullets that open with a dimension its seat's vote counted as worse.""" + cut = [] + for listing in entry.ruled_listings: + worse = worse_dimensions(entry.vote_rows.get(listing.seat, [])) + kept = [bullet for bullet in listing.bullets if worse.intersection(place_dimensions(bullet.removeprefix("- ")))] + cut.append(dataclasses.replace(listing, bullets=kept)) + return cut -def worse_places(entry: Entry) -> list[tuple[str, list[str]]]: - """Under each of a ruling's seat labels, the bullets that open with a dimension that seat's vote counted as worse; Overall counts as one.""" - worse = worse_votes(entry.body) - return [(label, [bullet for bullet in bullets if worse.get(label.split(",")[0], set()) & set(place_dimensions(bullet.removeprefix("- ")))]) for label, bullets in labelled_bullets(entry.body, RULED_PLACES)] - - -def placed(entry: Entry, labelled: list[tuple[str, list[str]]]) -> str: - """The entry's heading, then each label with bullets and its bullets; empty when no label has any.""" - text = "".join(f"\n{label}\n\n" + "".join(f"{bullet}\n" for bullet in bullets) for label, bullets in labelled if bullets) +def placed(entry: Entry, listed: list[Listing]) -> str: + """The entry's heading, then the label and bullets of each listing that has bullets; empty when none has.""" + text = "".join(f"\n{listing.label}\n\n" + "".join(f"{bullet}\n" for bullet in listing.bullets) for listing in listed if listing.bullets) return f"## {entry.heading}\n{text}" if text else "" -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.""" - 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 worse_dimensions(votes: list[str]) -> set[str]: + """The dimensions, Overall included, that a seat's row of votes counted as worse; `same (voted worse, …)` counts as same. A row without one vote per dimension, such as the older single `Vote` table's, gives an empty set.""" + return {dimension for dimension, vote in zip(DIMENSIONS, votes) if vote == "worse"} if len(votes) == len(DIMENSIONS) else set() -def table_rows(body: str) -> dict[str, list[str]]: - """Each table row's cells after its first, keyed by that first cell; where rows share a first cell, the first row wins. Header and Mean rows are included.""" - found: dict[str, list[str]] = {} - for line in body.splitlines(): - if line.startswith("| "): - name, *cells = [cell.strip() for cell in line.strip("|").split("|")] - found.setdefault(name, cells) - return found +def table_rows(body: str) -> list[dict[str, list[str]]]: + """Each table's rows after its header and separator, the cells after the first keyed by the first cell. Tables may touch, so a table starts at the row above a separator.""" + lines = [line for line in body.splitlines() if line.startswith("|")] + separators = [index for index, line in enumerate(lines) if line.startswith("|-")] + ends = [*(index - 1 for index in separators[1:]), len(lines)] + return [dict(row_cells(line) for line in lines[separator + 1:end]) for separator, end in zip(separators, ends)] + + +def row_cells(line: str) -> tuple[str, list[str]]: + name, *cells = [cell.strip() for cell in line.strip("|").split("|")] + return name, cells def place_dimensions(place: str) -> list[str]: @@ -199,25 +237,20 @@ def recorded(history: str, read: str) -> bool: return any(entry.heading.partition(", ")[2] == read for entry in entries(history)) -def seat_places(body: str, labels: re.Pattern[str]) -> list[Place]: - """The places on the first line of each bullet under a seat label the pattern `labels` matches.""" - return [place for _, bullets in labelled_bullets(body, labels) for bullet in bullets for place in bullet_places(bullet.splitlines()[0])] - - -def labelled_bullets(body: str, labels: re.Pattern[str]) -> list[tuple[str, list[str]]]: - """Each seat label the pattern `labels` matches, with its bullets, each with its indented continuation lines.""" - found: list[tuple[str, list[str]]] = [] - listing = False +def listings(body: str) -> list[Listing]: + """Each seat label in the body, with its bullets, each with its indented continuation lines.""" + found: list[Listing] = [] + under_label = False for line in body.splitlines(): - if labels.match(line): - found.append((line, [])) - listing = True - elif listing and line.startswith("- "): - found[-1][1].append(line) - elif listing and line.startswith(" ") and found[-1][1]: - found[-1][1][-1] += f"\n{line}" + if label := LABEL.match(line): + found.append(Listing(line, label.group(1), label.group(2), [])) + under_label = True + elif under_label and line.startswith("- "): + found[-1].bullets.append(line) + elif under_label and line.startswith(" ") and found[-1].bullets: + found[-1].bullets[-1] += f"\n{line}" elif not line.startswith(" "): - listing = False + under_label = False return found diff --git a/bin/larv_review/agreement.py b/bin/larv_review/agreement.py index 68234086..1e3755be 100644 --- a/bin/larv_review/agreement.py +++ b/bin/larv_review/agreement.py @@ -1,6 +1,6 @@ import decimal -from comprehension_history import counted_vote, entries, Entry, overall_cells, scoring_runs +from comprehension_history import by_time, counted_vote, entries, Entry, last_cells from larv_review.seats import FIRST_SEATS # Matches score-outcomes, which waits for 10 finished chunks before it shows a median. @@ -10,7 +10,7 @@ MIN_PAIRS = 10 def ruling_agreement(found: list[Entry]) -> list[bool]: """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] + cells = [last_cells(entry.vote_rows) for entry in found if entry.paired] return [counted_vote(each[first]) == counted_vote(each[second]) for each in cells if first in each and second in each] @@ -18,9 +18,9 @@ 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 scoring_runs(found): - cells = overall_cells(entry) - if first in cells and second in cells: + for entry in by_time(found): + cells = last_cells(entry.score_rows) + if entry.scored and 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] diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index 9e7bc0f0..c4e93907 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -162,6 +162,30 @@ class History(unittest.TestCase): fell = ruled.replace("2026-10-10T12:00:00Z", "2026-10-09T12:00:00Z") + "\n| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall |\n|---|---|---|---|---|---|\n| Mid A | 7 | 6 | 7 | 7 | 7 |\n| Mean | 7 | 6 | 7 | 7 | 7 |\n\nJunior A, hardest first:\n\n- `bin/j.py:5` `s`: wide\n" 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 test_takes_a_seats_vote_from_the_votes_table_when_it_comes_first(self): + self.assert_votes_table_read(lambda votes, scores: votes + scores) + + def test_takes_a_seats_vote_from_the_votes_table_when_it_comes_second(self): + self.assert_votes_table_read(lambda votes, scores: scores + votes) + + def assert_votes_table_read(self, tables): + votes = "| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall |\n|---|---|---|---|---|---|\n| Mid A | same | worse | same | same | same |\n" + scores = "| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall |\n|---|---|---|---|---|---|\n| Mid A | 7 | 7 | 7 | 7 | 7 |\n| Mean | 7 | 7 | 7 | 7 | 7 |\n" + places = "Mid A, decided by:\n\n- Locality: `bin/e.py:1` `n`: kept\n- Shape: `bin/f.py:2` `o`: dropped\n" + kept = "## 2026-10-07T12:00:00Z, PR #2 at bbbbbbb, against aaaaaaa\n\nMid A, decided by:\n\n- Locality: `bin/e.py:1` `n`: kept\n" + self.assertEqual(latest_places(appended("", paired("2026-10-07T12:00:00Z", "worse") + tables(votes, scores) + places)), kept) + + def test_keeps_every_bullet_of_a_listing_that_opens_with_a_dimension_voted_worse(self): + votes = "\n| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall |\n|---|---|---|---|---|---|\n| Mid A | same | worse | worse | same | same |\n" + places = "\nMid A, decided by:\n\n- Locality: `bin/e.py:1` `n`: deep\n- Shape: `bin/f.py:2` `o`: wide\n" + expected = "## 2026-10-07T12:00:00Z, PR #2 at bbbbbbb, against aaaaaaa\n\nMid A, decided by:\n\n- Locality: `bin/e.py:1` `n`: deep\n- Shape: `bin/f.py:2` `o`: wide\n" + self.assertEqual(latest_places(appended("", paired("2026-10-07T12:00:00Z", "worse") + votes + places)), expected) + + def test_drops_the_bullets_of_a_seat_with_no_row_in_the_votes_table(self): + votes = "\n| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall |\n|---|---|---|---|---|---|\n| Mid A | same | worse | same | same | same |\n" + places = "\nJunior A, decided by:\n\n- Locality: `bin/e.py:1` `n`: deep\n" + self.assertIsNone(latest_places(appended("", paired("2026-10-07T12:00:00Z", "worse") + votes + places))) + def test_names_the_places_of_every_run_on_the_newest_scored_commit(self): run = "## {time}, {pr} at {commit}\n\nJunior A, hardest first:\n\n- `bin/b.py:{line}` `h`: long\n" first, rerun, other = (run.format(time=time, pr=pr, commit=commit, line=line) for time, pr, commit, line in (("2026-10-08T12:00:00Z", "PR #1", "aaaaaaa", 1), ("2026-10-08T13:00:00Z", "PR #1 rerun", "aaaaaaa", 2), ("2026-10-09T12:00:00Z", "PR #2", "bbbbbbb", 3))) diff --git a/docs/comprehension-history.md b/docs/comprehension-history.md index 2b87f3ad..10ac460b 100644 --- a/docs/comprehension-history.md +++ b/docs/comprehension-history.md @@ -3360,3 +3360,27 @@ Inherited architect, decided by: - Locality: `bin/rule_hook/main.py:75` `breaches_of`: the repeat-read helpers moved beside their rule in `repeat_read.py`, so `main.py` only dispatches - Locality: `bin/release_standing.py:177` `dated_cut`: whether a CHANGELOG heading counts as the cut is recomputed at four call sites and not kept in `LastCut`; worse here, outweighed by the places above, and where it rots first - Shape: `bin/loop_claude/routing.py:84` `next_route`: fewer names to learn, a denser body to trace by hand; on balance the same + +## 2026-11-08T18:43:52Z, PR #428 at 4ab3648, against 6e0ef22 + +Ruling: better + +| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall | +|---|---|---|---|---|---| +| Mid A | same | better | better | same | better | +| Inherited architect | same | better | better | same | better | + +Mid A, decided by: + +- Locality, Shape: `bin/comprehension_history.py:127` `entries`: parses each entry once into vote_rows, score_rows, ruled_listings and scored_listings, where the older Entry kept a raw body that every consumer re-parsed under order rules ("the votes table comes first", "the first row wins") +- Shape: `bin/comprehension_history.py:168` `newest_commit_runs`: says what it returns, where the older `newest_scored` packed the same logic into one conditional comprehension, and `scoring_runs` with its caveat is gone +- Locality: `bin/rule_hook/rules.py:161` `unlimited_container`: asks `finds_this_docker` of the module beside run-heavy's docker, where the older version did index arithmetic on the words before docker and kept its own `resets_path` +- Shape: `bin/model_routing/route.py:81` `route_from`: reads one format, where the older version also kept a legacy regex and `legacy_fields` +- Shape: `bin/deploy_release/main.py:44` `main`: a thin dispatcher over `deploy.py`, `cut.py` and `forge.py`, each cohesive + +Inherited architect, decided by: + +- Locality, Shape: `bin/rule_hook/rules.py:166` `unlimited_container`: the PATH reasoning now sits in `finds_this_docker` and `resets_path` in `bin/run_heavy/capped_docker.py:39` next to the docker it describes, and `Launch` carries `word` and `before` +- Locality, Shape: `bin/comprehension_history.py:127` `entries`: parses each entry once; worse_places reads `listing.seat` instead of splitting a label, and the tables stay separate so no ordering trap remains +- Shape: `bin/model_routing/route.py:81` `route_from`: the legacy worker-line format is gone, so one format is left to read and keep in sync +- Shape: `bin/review_replay/main.py:100` `main`: the old `anchor` variable is renamed `project`, matching the project's-rung vocabulary diff --git a/docs/decisions.md b/docs/decisions.md index 8fad991c..b8a89f63 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -468,7 +468,7 @@ Valid while the worker writes the tests that larv-review's reviewers hold to the 2026-10-16, lilleman, answering the review of PR #283. An item that restores a maintain goal the project breaks today is a defect: exempt as `defect`. Its Moves name that maintain goal and how much of it is broken, and the goal weighs as the heaviest achieve goal, since a broken maintain goal outranks any achieve goal. Every defect ranks by its score, so a trivial one waits behind valuable work. Only questions and then security findings rank first in their release: a question's answer may change other items, and a question waits for the human anyway, so ranking it first delays no chunk. An item names the most specific goal it moves, and a parent only for a move none of its sub-goals covers, so a sub-goal's move does not count twice; `rank_todo.py` refuses a goal named beside its own sub-goal. Each project reshapes its own `todo.md`; `CLAUDE.md` → "Working loop" makes the reshape the only work until done, as it makes writing missing premises. An item that makes this project easier to read moves code health, as the paragraph below says, and goal 1.4, since reading cost is measured in tokens per chunk. -2026-10-18, lilleman. Serves goal 1.1: every project shares one achieve goal, code health, which `CLAUDE.md` → "Shared goal" states once and which replaces each project's own readability goal. It ranks first among a project's achieve goals, since lilleman rates it very important while the comprehension panel's overall is under 7.0. While that overall is under 7.0, or no scoring run has measured the project, it weighs four times its weight at 7.0 or above, as `UNDER_FLOOR` sets. The overall is the mean of the overall means of every scoring run on the newest scored commit in `docs/comprehension-history.md`, as `newest_scored` finds them. Two runs of one head measure it twice, and the newest alone would let their noise flip the weight: 7.13 and 6.88 on one head of another project would have. The review of PR #324 raised this choice. Weighing code health four times as much leaves the other achieve goals' weights as they are. So crossing 7.0 changes only the scores of the items that move code health, and of the defects, since a broken maintain goal weighs as the heaviest achieve goal. `larv-review record-scoring` re-ranks `todo.md` after it appends a run. A project that opts out of the comprehension check voids the goal, as `review: a project decision may opt every chunk out …` records. A README voids the goal with `**Void:** code health, since .` under `## Goals`, and an item's Moves cell names it as in `code health by 6`. A panel of three readers seated as lilleman picked both 3-0: `code health` over `code`, `health`, `C` and `0`, and the bold `Void:` line over a sentence under `## Goals` or a line under `## Audience`. `score-outcomes` counts the counter-signal's misread findings per chunk, as `review: a reviewer under …` records. Valid while the comprehension panel's overall is how a project measures how hard it is to read. +2026-10-18, lilleman. Serves goal 1.1: every project shares one achieve goal, code health, which `CLAUDE.md` → "Shared goal" states once and which replaces each project's own readability goal. It ranks first among a project's achieve goals, since lilleman rates it very important while the comprehension panel's overall is under 7.0. While that overall is under 7.0, or no scoring run has measured the project, it weighs four times its weight at 7.0 or above, as `UNDER_FLOOR` sets. The overall is the mean of the overall means of every scoring run on the newest scored commit in `docs/comprehension-history.md`, as `newest_commit_runs` finds them. Two runs of one head measure it twice, and the newest alone would let their noise flip the weight: 7.13 and 6.88 on one head of another project would have. The review of PR #324 raised this choice. Weighing code health four times as much leaves the other achieve goals' weights as they are. So crossing 7.0 changes only the scores of the items that move code health, and of the defects, since a broken maintain goal weighs as the heaviest achieve goal. `larv-review record-scoring` re-ranks `todo.md` after it appends a run. A project that opts out of the comprehension check voids the goal, as `review: a project decision may opt every chunk out …` records. A README voids the goal with `**Void:** code health, since .` under `## Goals`, and an item's Moves cell names it as in `code health by 6`. A panel of three readers seated as lilleman picked both 3-0: `code health` over `code`, `health`, `C` and `0`, and the bold `Void:` line over a sentence under `## Goals` or a line under `## Audience`. `score-outcomes` counts the counter-signal's misread findings per chunk, as `review: a reviewer under …` records. Valid while the comprehension panel's overall is how a project measures how hard it is to read. 2026-10-15, lilleman. Serves goal 1.4: loop-claude routes a chunk's first cycle on the item the chunk takes (`routing: a chunk's worker runs on the rung its item's L picks`). An item lists the items that must be done before it starts in a Blocked by column, and `rank_todo.py` ranks each blocker above every item it blocks. The table's order is `todo.md`'s only order: `rank_todo.py` fails on text beside the table under `## Items`, since a prose order there, "Release 0.3.0 takes items 125, 114 and 124 first", contradicted the table and loop-claude could not read it. A decision that wants an order sets the scores instead. An item waits while it is marked `question` or a blocker of it is still in the table, whatever the rows' order, so a release's first row that does not wait is the item a chunk takes. A blocker the table no longer holds was finished or deleted, and is dropped, so the cell shows what still blocks. A panel of three readers seated as lilleman picked the spelling: two ranked "Blocked by" first, as the cell lists only what still blocks, and all three chose bare IDs such as `12, 14` in a column right after Release, read before the tagline and kept apart from the scores. `rank_todo.py` adds the column to a table without it. The tools read cells by column name, so a later column leaves a reader on an older release working; `rank_todo.py`, which writes every column, fails on one it does not know rather than drop it. diff --git a/docs/reading-cost.md b/docs/reading-cost.md index 4e485d53..28df02c4 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -1056,3 +1056,15 @@ Read most (opens and searches): - `bin/subagent_rung/main.py` 2 - `CHANGELOG.md` 1 - `docs/decisions.md` 1 + +## Reading cost, chunk 9fd7519bd086, finished 2026-11-08T18:24:16Z + +56261 new input tokens before the first commit. + +Read most (opens and searches): + +- `docs/decisions.md` 7 +- `todo.md` 5 +- `AGENTS.md` 2 +- `CHANGELOG.md` 1 +- `README.md` 1 diff --git a/todo.md b/todo.md index a6acb341..5d873110 100644 --- a/todo.md +++ b/todo.md @@ -13,7 +13,6 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| | 1 | 0.7.0 | | question | **Say in README → Install how the transcript archive is backed up, once bender-infra backs up ai-sandbox's data volume.** | 1 | 2 | 1 | 2 | 1 | | 0.0 | -| 123 | 0.7.0 | | | **Have `bin/comprehension_history.py` parse each history entry once into seats, votes and places, so `latest_places`, `worse_places` and `worse_votes` neither depend on table order nor split a label to find a seat.** | 2 | 1 | 2 | 3 | 5 | code health by 5, 1.4 by 5 | 11.0 | | 139 | 0.7.0 | | | **Split `bin/routing_figures/measure.py` by concern, and keep the figures' measured cycle and each raised call as fields loop-claude reads back, not as the prose it renders.** | 3 | 1 | 2 | 4 | 5 | code health by 5, 1.4 by 5 | 11.0 | | 158 | 0.7.0 | | decision | **Measure the fixed cost of a chunk from loop-claude's archive, in tokens and hours against its items' S, and set F in `Score = 100 * V / (2**S + F)` to it.** | 2 | 2 | 1 | 3 | 3 | 1.1 by 5, 1.4 by 5 | 10.3 | | 155 | 0.7.0 | | | **Lower the reading cost of the files a chunk reads most before its first commit.** | 3 | 2 | 2 | 5 | 5 | code health by 4, 1.4 by 6 | 9.6 | @@ -85,10 +84,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). -### 123. Have `bin/comprehension_history.py` parse each history entry once into seats, votes and places, so `latest_places`, `worse_places` and `worse_votes` neither depend on table order nor split a label to find a seat. - -Three seats of PR #257's scoring run named `bin/comprehension_history.py:106` `latest_places`; the logic it rests on is `:114` `worse_places` and `:126` `worse_votes`. They regex the markdown the module writes. `worse_votes` keeps a seat's first row through `setdefault`, because the votes table comes first. `worse_places` recovers the seat with `label.split(",")[0]`. `Entry` still holds scoring seats' places for rulings recorded before PR #255. Release 0.3.0's seats named near-synonyms left from before PR #255: `:150` `scoring_runs`, "near-synonyms scored and scoring_runs differ only on a ruling from before PR #255" (Maintainability senior), `:130` `newest_scored`, "four near-identical names over two concepts", and `:159` `scored`. Make these functions easier to read. - ### 139. Split `bin/routing_figures/measure.py` by concern, and keep the figures' measured cycle and each raised call as fields loop-claude reads back, not as the prose it renders. The paired ruling on PR #265 ruled worse. Make these places easier to read: `measure.py` `measured` and `render` (token attribution, subagent rungs, round counting, calls and rendering in one module; `measured`, `Measured` and `measure_archive` side by side); `calls` with `archive.py` `raised` and `last_measured`, where a call's identity is its sentence and the measured cycle is read back from rendered markdown; and `Reports.searches`, which holds characters, not searches.