Report L by the share of chunks with a 🔴 in score-outcomes where most hold none

This commit is contained in:
2026-11-09 01:55:45 +01:00
parent e97d30f809
commit 517276ba4f
6 changed files with 54 additions and 10 deletions
+1
View File
@@ -2,6 +2,7 @@
## Unreleased
- `score-outcomes` reads L by the share of chunks with a 🔴 at each L, once most of the chunks it counts hold none, beside L's rank correlation by review rounds.
- `todo-item add` now files an item in `todo.md` with one command. It takes `Next ID` as the item's ID, raises `Next ID`, writes the row and the detail it reads from stdin, and ranks the file.
- `todo-item finish <ID>` now removes a finished item's row and detail from `todo.md`. With `--changelog <bullet>`, it also adds that bullet first under `CHANGELOG.md` → `## Unreleased`. Where a `CHANGELOG.md` exists, it refuses to run without `--changelog <bullet>` or `--no-changelog`, so no bullet is left out by mistake.
- A worker whose review rules its work below standard now fixes it on its own rung where the fix changes only prose, a comment or docstring included. It hands the fix to a higher rung only where code, config or tests change.
+3 -1
View File
@@ -66,7 +66,9 @@ each pass's first and by 🔴 findings: Spearman's rank correlation, from -1 to
them exactly; none where every chunk held the same level, or the same outcome. It counts only chunks
that shipped one item, since a chunk measures all its items at once. It leaves out the chunks never
replayed, which may hold only part of a pull request. It reports a score only once 10 of the chunks
it counts hold it and its outcomes.
it counts hold it and its outcomes. Where more than half of the chunks it counts for L hold no 🔴, it
gives L's rank correlation by review rounds alone, then the share of chunks with a 🔴 at each L, since
medians of 0 and a rank resting on the few chunks with a 🔴 tell a scorer little.
Then, newest first, each finished chunk's 🔴 and 🟡 findings with its misread findings, for every
chunk whose round titles count them: code health's counter-signal in
+12 -3
View File
@@ -104,9 +104,12 @@ def report(results: list[Result]) -> list[str]:
lines.append(opening + too_few(len(rows), name, "both outcomes"))
continue
guesses, rounds, red = ([row[column] for row in rows] for column in range(3))
found = [rank_correlation(guesses, rounds), rank_correlation(guesses, red)]
undefined = ", since every chunk held one value" if None in found else ""
lines.append(opening + f"rank correlation {listed(['none' if value is None else f'{value:+.2f}' for value in found], 'and')}{undefined} ({plural(len(rows), 'chunk')})")
if name == "L" and red.count(0) * 2 > len(red):
# Where most chunks hold no 🔴 every median reads 0 and the rank rests on the few that have one, so L is read by how often a chunk has one.
lines.append(f"- {name}, by review rounds past each pass's first: rank correlation {correlations([rank_correlation(guesses, rounds)])} ({plural(len(rows), 'chunk')})")
lines.append(f"- {name}, by the share of chunks with a 🔴, since most of the {len(rows)} chunks hold none: " + ", ".join(f"{guess} → {sum(1 for at, count in zip(guesses, red) if at == guess and count)} of {plural(guesses.count(guess), 'chunk')}" for guess in sorted(set(guesses))))
continue
lines.append(opening + f"rank correlation {correlations([rank_correlation(guesses, rounds), rank_correlation(guesses, red)])} ({plural(len(rows), 'chunk')})")
return lines
@@ -137,6 +140,12 @@ def too_few(held: int, name: str, what: str) -> str:
return f"{held} {chunks} {name} and {what}; the report needs {ENOUGH}."
def correlations(found: list[float | None]) -> str:
"""Each rank correlation signed to two places, `none` where it is undefined, with the reason once after them."""
undefined = ", since every chunk held one value" if None in found else ""
return listed(["none" if value is None else f"{value:+.2f}" for value in found], "and") + undefined
def rank_correlation(guesses: list[int], results: list[int]) -> float | None:
"""Spearman's rank correlation, tied values sharing their mean rank; None where either side holds one value, which no order can rank."""
if len(set(guesses)) < 2 or len(set(results)) < 2:
+20
View File
@@ -106,6 +106,26 @@ class Report(unittest.TestCase):
self.assertIn("- I, by review rounds past each pass's first and 🔴 findings: rank correlation +1.00 and -1.00 (10 chunks)", lines)
self.assertIn("- E, by review rounds past each pass's first and 🔴 findings: rank correlation none and none, since every chunk held one value (10 chunks)", lines)
def test_gives_l_by_the_share_of_chunks_with_a_red_finding_where_most_hold_none(self):
levels = [1, 1, 2, 2, 2, 3, 3, 3, 4, 4]
red = [0, 0, 0, 0, 0, 0, 0, 1, 2, 1]
found = [result(id_, 2, 2, None, rounds=level, findings=(count, 0), levels={"L": level, "E": 2, "I": level}) for id_, (level, count) in enumerate(zip(levels, red), 1)]
lines = report(found)
self.assertIn("- L, by review rounds past each pass's first: rank correlation +1.00 (10 chunks)", lines)
self.assertIn("- L, by the share of chunks with a 🔴, since most of the 10 chunks hold none: 1 → 0 of 2 chunks, 2 → 0 of 3 chunks, 3 → 1 of 3 chunks, 4 → 2 of 2 chunks", lines)
self.assertTrue(any(line.startswith("- I, by review rounds past each pass's first and 🔴 findings: rank correlation +1.00 and +") for line in lines))
def test_keeps_the_rank_correlation_by_red_findings_where_half_the_chunks_hold_none(self):
levels = [1, 1, 2, 2, 2, 3, 3, 3, 4, 4]
red = [0, 0, 0, 0, 0, 1, 1, 1, 2, 2]
found = [result(id_, 2, 2, None, rounds=level, findings=(count, 0), levels={"L": level, "E": 2, "I": level}) for id_, (level, count) in enumerate(zip(levels, red), 1)]
self.assertTrue(any(line.startswith("- L, by review rounds past each pass's first and 🔴 findings: rank correlation +1.00 and +") for line in report(found)))
def test_says_when_l_rounds_have_one_value_beside_the_share_of_chunks_with_a_red_finding(self):
levels = [1, 1, 2, 2, 2, 3, 3, 3, 4, 4]
found = [result(id_, 2, 2, None, rounds=1, findings=(int(id_ == 10), 0), levels={"L": level, "E": 2, "I": 2}) for id_, level in enumerate(levels, 1)]
self.assertIn("- L, by review rounds past each pass's first: rank correlation none, since every chunk held one value (10 chunks)", report(found))
class Render(unittest.TestCase):
def test_shows_an_items_l_e_and_i_before_its_r_and_s(self):
+17
View File
@@ -1361,3 +1361,20 @@ Read most (opens and searches):
- `CLAUDE.md` 2
- `docs/decisions.md` 2
- `README.md` 1
## Reading cost, chunk f41e952086c5, finished 2026-11-09T00:54:09Z
193190 new input tokens before the first commit.
Read most (opens and searches):
- `README.md` 8
- `bin/release_plan/ranking.py` 8
- `bin/rank_todo.py` 5
- `bin/release_plan/todo_table.py` 5
- `CHANGELOG.md` 4
- `todo.md` 4
- `AGENTS.md` 3
- `bin/release_plan/test_ranking.py` 3
- `CLAUDE.md` 2
- `rules/todo-items.md` 2
+1 -6
View File
@@ -14,7 +14,6 @@
|---|---|---|---|---|---|---|---|---|---|---|---|
| 277 | 0.7.0 | | question | **Map the size of the code an item names onto S, on a scale the human picks, and have `score-outcomes` print that S for the item being scored and for each finished item it lists.** | 3 | 2 | 2 | 5 | 4 | 1.1 by 4, 1.4 by 3 | 2.4 |
| 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 |
| 116 | 0.7.0 | | | **Report L by the share of chunks with a 🔴, once 10 chunks that each shipped one item record finding counts and most record no 🔴.** | 1 | 1 | 2 | 2 | 2 | 1.1 by 5 | 2.3 |
| 280 | 0.7.0 | | | **Open the chunk's pull request as a draft, mark it ready and merge it with one command per step that picks `tea` or `gh` from the remote, so no worker looks up `tea`'s or `gh`'s flags.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 4, 1.5 by 3 | 2.3 |
| 282 | 0.7.0 | | | **Write the branch diff and what `larv-review places` prints into the chunk's review folder, and print each reviewer's prompt header, with one `larv-review` command.** | 3 | 2 | 3 | 6 | 4 | 1.4 by 4, 1.5 by 3 | 2.3 |
| 12 | 0.7.0 | | | **Run the test suite in CI on every PR, or record in `docs/decisions.md` why the local run is enough.** | 3 | 2 | 1 | 4 | 4 | 1.1 by 6 | 2.1 |
@@ -77,10 +76,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).
### 116. Report L by the share of chunks with a 🔴, once 10 chunks that each shipped one item record finding counts and most record no 🔴.
`score-outcomes` reports the median 🔴 count at each guessed R, and how well L orders chunks by 🔴 findings; the part of R a 🔴 tests is L. Where most chunks have no 🔴, every median reads 0 and the rank correlation rests on the few that have one, which tells a scorer little. No round title held counts before PR #254, so how often a chunk has a 🔴 is not yet known.
### 280. Open the chunk's pull request as a draft, mark it ready and merge it with one command per step that picks `tea` or `gh` from the remote, so no worker looks up `tea`'s or `gh`'s flags.
Audit of release 0.2.0's chunks (item 162): 37 chunks ran `tea pr` or `gh pr` create, ready, edit or merge, 106 calls, about 12.6k command tokens and 13.9k result tokens. 20 chunks spent 49 calls on `--help` lookups of those flags. The title follows `CLAUDE.md` → "Git, commits, and PRs"; the merge runs only where the caller says the gate passed.
@@ -139,7 +134,7 @@ goal is still redesigned or dropped.
### 286. Lower the reading cost of the files a chunk reads most before its first commit.
`reading-cost` reports Rising: the last five chunks' median is 152,018 new input tokens before the first commit, against 84,028 for the five before them. Those five chunks opened or searched these files most: `todo.md` 48 times, `docs/decisions.md` 11, `README.md` 9, `bin/review_replay/test_review_replay.py` 9, `bin/routing_figures/test_routing_figures.py` 9, `docs/reading-cost.md` 8, `bin/rule_hook/repeat_read.py` 7, `AGENTS.md` 6, `bin/loop_claude/test_loop_claude.py` 6 and `bin/routing_figures/chunk.py` 6.
`reading-cost` reports Rising: the last five chunks' median is 151,930 new input tokens before the first commit, against 103,215 for the five before them. Those five chunks opened or searched these files most: `todo.md` 42 times, `README.md` 16, `docs/decisions.md` 12, `AGENTS.md` 10, `bin/rank_todo.py` 9, `bin/release_plan/ranking.py` 8, `docs/reading-cost.md` 8, `CHANGELOG.md` 7, `rules/todo-items.md` 7 and `bin/rule_hook/test_rule_hook.py` 6.
Item 285 takes the `todo.md` reads; this item takes the rest. Find why a worker opens each of them before its first commit, and cut that cause, such as a test file too large to read in parts.