From 6091ae0dfcbd786449090fcdf21045ee9f980978 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 8 Nov 2026 22:28:00 +0100 Subject: [PATCH 1/6] Append the reading-cost figures --- docs/reading-cost.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/reading-cost.md b/docs/reading-cost.md index d70766b8..5959cb2a 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -1153,3 +1153,20 @@ Read most (opens and searches): - `bin/loop_claude/cycle/run.py` 1 - `bin/loop_claude/escalation_mark.py` 1 - `bin/review_replay/main.py` 1 + +## Reading cost, chunk 0a182fd1dbbd, finished 2026-11-08T21:19:12Z + +64512 new input tokens before the first commit. + +Read most (opens and searches): + +- `todo.md` 5 +- `docs/decisions.md` 4 +- `bin/loop_claude/cycle/judge.py` 3 +- `bin/repo_checks/test_citations.py` 3 +- `skills/larv-review/SKILL.md` 3 +- `CLAUDE.md` 2 +- `README.md` 2 +- `bin/loop_claude/cycle/prompts.py` 2 +- `AGENTS.md` 1 +- `CHANGELOG.md` 1 -- 2.52.0 From bcbd9f455f0ee5bdafd2676804d0987b81b4ba32 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 8 Nov 2026 22:28:00 +0100 Subject: [PATCH 2/6] File or refresh one comprehension-floor item whenever a scoring run is under 7.0 --- CHANGELOG.md | 1 + bin/larv_review/history_commands.py | 12 ++++++++++-- bin/larv_review/main.py | 8 +++++--- bin/larv_review/plan.py | 30 +++++++++++++++++++---------- bin/larv_review/scoring.py | 18 +++++++++++++++++ bin/larv_review/test_larv_review.py | 21 ++++++++++++++++++-- docs/decisions.md | 2 ++ skills/larv-review/SKILL.md | 3 ++- todo.md | 15 --------------- 9 files changed, 77 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d0d2a82..f3dd4454 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- A scoring run under the comprehension floor of 7.0 now leaves a plan item meant to reach it. `larv-review record-scoring` follows its `Floor:` line with a `Next:` line, which says to file one ambitious refactor aimed at the lowest dimension, or to refresh the one `todo.md` already holds. The item names the comprehension floor, so its own chunk runs a scoring run, and goes into the release after the chunk's, so the floor holds up no release (larv-review §3 → "Floor item"). - `loop-claude` now interrupts you less. A worker takes its own recommendation on a choice no rule reserves for you, and records it, and the judge answers an ask that carries a recommendation by quoting the rule that says so. You are still asked about a goal, a release's planned items and its cut, a change to the routing ladder, and whatever another rule asks your approval for; `CLAUDE.md` → "Working loop", "Ask, don't guess" lists them. - This setup's own plan now ranks items by `Score = 100 * V / (2**S + 32)`, up from 8: F, a chunk's fixed cost, is 32, about one size-5 change, fitted to ten finished chunks' tokens, so small items rank lower against large ones. `docs/decisions.md` holds the fit. - `loop-claude` now keeps the cycle it last measured the routing figures at, and each routing call it raised, in `routing-state.json` at the archive's root, and reads them back from there in place of `routing-figures.md` and `routing-calls-raised.md`. The two markdown files hold what they held before. From them, loop-claude now reads only a `Reset` line in `routing-calls-raised.md`, which still resets the figures. The first loop to close a cycle after the upgrade measures the figures at once. If the figures still make a call raised since the latest reset, it puts that call to you once more. diff --git a/bin/larv_review/history_commands.py b/bin/larv_review/history_commands.py index b7aaa7da..ef6919f0 100644 --- a/bin/larv_review/history_commands.py +++ b/bin/larv_review/history_commands.py @@ -3,12 +3,12 @@ import time from larv_review.agreement import agreement_report from review_rules.comprehension_history import appended, DIMENSIONS, FLOOR, heading, Heading, HISTORY, latest_places, recorded, ruling_entry, scoring_entry, ScoringRun, vote_text +from larv_review.plan import checkout_plan, plan_reasons from git_cli.git_repo import commit_exists, top from larv_review.ruling import counted, overall, ruling, split, surplus, votes from failure import Failure from larv_review.seats import FIRST_SEATS, scores, seats_file, SeatsFile -from larv_review.scoring import means, under_floor -from larv_review.plan import plan_reasons +from larv_review.scoring import floor_step, means, under_floor from release_plan import ranking from records.file_writes import replace_file @@ -47,9 +47,17 @@ def record_scoring(default: str, scores_file: pathlib.Path, ids: list[int]) -> F 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") + checkout = top() + if isinstance(checkout, Failure): + return checkout + todo = checkout_plan(checkout) + if isinstance(todo, Failure): + return todo + _, plan = todo 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}.") + print(floor_step(scoring.means, plan, ids)) if unrecorded := append(given.read, scoring_entry(named.title, scoring)): return unrecorded return rerank() diff --git a/bin/larv_review/main.py b/bin/larv_review/main.py index 5b7b8bb5..a2f7cab6 100644 --- a/bin/larv_review/main.py +++ b/bin/larv_review/main.py @@ -72,9 +72,11 @@ 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. 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. Then it ranks the checkout's todo.md as -rank_todo.py does, since the overall sets the weight of code health, the goal every project shares, -and exits 1 where rank_todo.py would, with the run recorded. +floor of {floor}, a line opening `Floor:` naming each one. A line opening `Next:` follows it: file +an item naming the comprehension floor, aimed at the lowest of the four dimensions, or refresh the +one the checkout's todo.md holds open, which is any such item but those given. Then it ranks the +checkout's todo.md as rank_todo.py does, since the overall sets the weight of code health, the goal +every project shares, and exits 1 where rank_todo.py would, with the run recorded. places prints the places seats found hard since the newest scored commit: the places of each scoring run on it, and, diff --git a/bin/larv_review/plan.py b/bin/larv_review/plan.py index 0e1ab26f..facd184a 100644 --- a/bin/larv_review/plan.py +++ b/bin/larv_review/plan.py @@ -2,6 +2,7 @@ import pathlib from release_plan.release_standing import Cut, default_plan, LastCut, next_release, Unknown from failure import Failure +from larv_review.scoring import FLOOR_ITEM from release_plan.todo_table import Item, items, NoItemsTable, renames from release_plan.release import Release, version from git_cli.git_repo import top @@ -18,7 +19,7 @@ def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], lan if unknown := sorted(set(ships) - set(plan)): return Failure(f"neither plan holds item {', '.join(map(str, unknown))}") shipped = [plan[id_] for id_ in ships] - reasons = [f"ships item {item.id}, which names the comprehension floor" for item in shipped if "comprehension floor" in item.tagline.lower()] + reasons = [f"ships item {item.id}, which names the comprehension floor" for item in shipped if FLOOR_ITEM in item.tagline.lower()] for release in emptied(before, after, shipped, renamed): if work_landed(release, shipped, landed_release): # SKILL.md → "Second run" keys on this wording. @@ -63,21 +64,16 @@ def plan_reasons(default: str, ids: list[int]) -> list[str] | Failure: before = held.todo if isinstance(before, Failure): return before - try: - after = pathlib.Path(checkout, "todo.md").read_text(encoding="utf-8") - except (OSError, UnicodeDecodeError) as failure: - return Failure(f"could not read todo.md: {failure}") + read = checkout_plan(checkout) + if isinstance(read, Failure): + return read + after, chunk = read # While a chunk reshapes todo.md into one table, the default branch's todo.md has no items table. planned = items(before) if isinstance(planned, NoItemsTable): planned = [] if isinstance(planned, Failure): return Failure(f"{default}'s todo.md: {planned.reason}") - chunk = items(after) - if isinstance(chunk, NoItemsTable): - return Failure("the checkout's todo.md has no items table; rank_todo.py --help shows one") - if isinstance(chunk, Failure): - return Failure(f"the checkout's todo.md: {chunk.reason}") renamed = renames(after) if isinstance(renamed, Failure): return Failure(f"the checkout's todo.md: {renamed.reason}") @@ -85,3 +81,17 @@ def plan_reasons(default: str, ids: list[int]) -> list[str] | Failure: if isinstance(landed_release, Failure): return landed_release return scoring_run_due(planned, chunk, ids, landed_release, renamed) + + +def checkout_plan(checkout: str) -> tuple[str, list[Item]] | Failure: + """The checkout's todo.md, as its text and its items.""" + try: + text = pathlib.Path(checkout, "todo.md").read_text(encoding="utf-8") + except (OSError, UnicodeDecodeError) as failure: + return Failure(f"could not read todo.md: {failure}") + found = items(text) + if isinstance(found, NoItemsTable): + return Failure("the checkout's todo.md has no items table; rank_todo.py --help shows one") + if isinstance(found, Failure): + return Failure(f"the checkout's todo.md: {found.reason}") + return text, found diff --git a/bin/larv_review/scoring.py b/bin/larv_review/scoring.py index f7453134..a555c20f 100644 --- a/bin/larv_review/scoring.py +++ b/bin/larv_review/scoring.py @@ -1,6 +1,10 @@ import decimal from review_rules.comprehension_history import DIMENSIONS, FLOOR +from release_plan.todo_table import Item + +# plan.scoring_run_due keys on these words too, so the floor item filed calls its own scoring run. +FLOOR_ITEM = "comprehension floor" def means(lines: list[list[str]]) -> list[decimal.Decimal]: @@ -14,3 +18,17 @@ def mean(values: list[decimal.Decimal]) -> decimal.Decimal: def under_floor(found: list[decimal.Decimal]) -> list[str]: return [f"{name} {value}" for name, value in zip(DIMENSIONS, found) if value < FLOOR] + + +def floor_step(found: list[decimal.Decimal], plan: list[Item], ships: list[int]) -> str | None: + """What a scoring run under the floor asks next, None when no mean is under it. It aims at the lowest of the four dimensions, each of them where they tie, since the lowest caps the overall. An item in plan naming the comprehension floor is open unless ships holds its ID: the chunk shipping it still asks for the next one.""" + if not under_floor(found): + return None + dimensions = dict(zip(DIMENSIONS[:-1], found)) + lowest = [name for name, value in dimensions.items() if value == min(dimensions.values())] + names = " and ".join(filter(None, [", ".join(lowest[:-1]), lowest[-1]])) + aim = f"{names}, the lowest dimension{'s' if len(lowest) > 1 else ''}" + rule = 'as larv-review §3 → "Floor item" says.' + if open_items := [item for item in plan if FLOOR_ITEM in item.tagline.lower() and item.id not in ships]: + return f"Next: refresh item {open_items[0].id}, which names the comprehension floor, to lift {aim}, with this run's places, and file no other, {rule}" + return f"Next: file one item naming the comprehension floor, a refactor lifting {aim}, to {FLOOR}, {rule}" diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index 39bd629f..7c7fcbe5 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -15,11 +15,11 @@ from review_rules.comprehension_history import appended, entries, HistoryChange, from review_rules import comprehension_history from larv_review.ruling import counted, ruling, split, surplus, votes from failure import Failure +from larv_review.scoring import floor_step, means, under_floor from test_env import isolated_env from release_plan.todo_table import Item, items, NoItemsTable from larv_review.plan import landed_towards, plan_reasons, scoring_run_due from release_plan.release_standing import LastCut -from larv_review.scoring import means, under_floor from larv_review.ruling_base import measured_commit from larv_review.seats import score_line, scores, seats_file @@ -113,6 +113,23 @@ class Seats(unittest.TestCase): self.assertEqual(under_floor(found), ["Locality 6.63", "Self-sufficiency 6.63", "Overall 6.88"]) self.assertEqual(under_floor([decimal.Decimal("7.00")] * 5), []) + def test_floor_step_files_one_item_at_the_lowest_dimension_unless_one_is_open(self): + found = [decimal.Decimal(mean) for mean in ("7.38", "6.63", "7.00", "6.50", "6.88")] + floor_item = item(5, (0, 2, 0), "**Restructure the reload, lifting Locality to the comprehension floor.**") + with self.subTest("none open"): + self.assertEqual(floor_step(found, [item(1, (0, 1, 0))], []), 'Next: file one item naming the comprehension floor, a refactor lifting Self-sufficiency, the lowest dimension, to 7.0, as larv-review §3 → "Floor item" says.') + with self.subTest("one open"): + self.assertEqual(floor_step(found, [item(1, (0, 1, 0)), floor_item], []), 'Next: refresh item 5, which names the comprehension floor, to lift Self-sufficiency, the lowest dimension, with this run\'s places, and file no other, as larv-review §3 → "Floor item" says.') + with self.subTest("the shipped one is not open"): + self.assertTrue(floor_step(found, [floor_item], [5]).startswith("Next: file one item")) + with self.subTest("a tie names both"): + tied = [decimal.Decimal(mean) for mean in ("7.38", "6.50", "7.00", "6.50", "6.88")] + self.assertIn("lifting Locality and Self-sufficiency, the lowest dimensions, to 7.0", floor_step(tied, [], [])) + with self.subTest("none under the floor"): + self.assertIsNone(floor_step([decimal.Decimal("7.00")] * 5, [floor_item], [])) + with self.subTest("only the overall under the floor"): + self.assertIn("lifting Navigation, Locality, Shape and Self-sufficiency, the lowest dimensions", floor_step([decimal.Decimal("7.00")] * 4 + [decimal.Decimal("6.75")], [], [])) + class History(unittest.TestCase): def test_writes_the_sample_entry_its_parser_shows(self): @@ -537,7 +554,7 @@ class LarvReviewTool(unittest.TestCase): self.plan() 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.\n", ran.stdout) + self.assertIn("\nFloor: Locality 6.50, Self-sufficiency 6.50 under the floor of 7.0.\nNext: file one item naming the comprehension floor, a refactor lifting Locality and Self-sufficiency, the lowest dimensions, to 7.0, as larv-review §3 → \"Floor item\" says.\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) diff --git a/docs/decisions.md b/docs/decisions.md index bfbaf32c..c9302282 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -42,6 +42,8 @@ The cap is 5, `bin/release_plan/todo_table.py`'s `BUNDLE_MAX_R`, from the same c 2026-10-15, lilleman, set by PR #283 on 2026-10-16: an item that lifts the lowest dimension moves each goal it cites by 9, since the lowest dimension caps the overall and lifting it is worth the most to the floor. Within a chunk its work comes first; in the plan, lilleman answering that PR's review, such items compete with the others like any item and don't rank first. PR #257's scoring run found Shape lowest, at 6.25, and two items were to lift it: one, shipped by PR #367, gave "record", "outcome" and "place" one meaning each in `bin/`; the other, shipped by PR #432, grouped `bin/`'s root modules into packages named by purpose. Release 0.3.0's scoring runs found Locality lowest, at 5.75 and 5.88, so the 9 moved from those items to the ones lifting Locality. +2026-11-08, claude, item 230: the floor item that larv-review files (`skills/larv-review/SKILL.md` → "Floor item") keeps the move by 9 and competes like any item. Its R, likely above 5, makes it ship alone, which decides only what joins its chunk, not its rank. + ## loop-claude: a `claude` that cannot start is a failed worker run, retried 2026-09-28, larv-review, declining a product-owner nit to exit at once when `claude` is missing. Serves goal 1. Claude Code's updater repoints `~/.local/bin/claude` at each new version under running loops, and a start that meets it mid-update fails with the same error as a broken install; the retry costs two minutes on the second and saves an unattended loop on the first. Valid while Claude Code updates by repointing its link. diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md index 89824ca6..d485caad 100644 --- a/skills/larv-review/SKILL.md +++ b/skills/larv-review/SKILL.md @@ -148,9 +148,10 @@ The comprehension check records how hard the project is for its contributor to r - **Seats.** 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. - **Second run.** Where `needs-scoring-run` printed that the chunk `leaves release … with no plan item`, launch the same four seats afresh on the same head. Their scores file's first line is ` rerun at `. Record it with the same `record-scoring` command. +- **Floor item.** Where `record-scoring` prints `Floor:`, the project holds one plan item meant to lift it to the floor, and the `Next:` line after `Floor:` says whether to file it or refresh it. File it as one ambitious refactor, not touch-ups: it restructures the area behind the places that `larv-review places` prints for the lowest dimension, sized to lift that dimension to 7.0, and quotes those places. Its tagline names the comprehension floor, so its own chunk runs a scoring run, and that run files the next one while any score stays under 7.0. Put it in the earliest release after the one the chunk ships into, so the floor holds up no release. While one such item is open, refresh its places and aim from the newest run instead of filing another; the item the chunk ships doesn't count as open. Commit it with the run, as "Record" says. - **Agreement.** After the second run, run `~/.claude/bin/larv-review agreement` and put its counts in the summary. On `Assumption fails:`, ask the user whether to keep the paired ruling or change the decision `review: the comprehension check records …`. Record the answer as a decision in the repo whose history was counted, with the counts that led to the ask. A later run asks again only when the rulings' rate falls, or the runs' rate rises, against the recorded counts. -**Record.** `docs/comprehension-history.md` keeps every paired ruling and scoring run, which `larv-review` appends; never edit one. Commit what it appends, with the `todo.md` that `record-scoring` re-ranks, in one commit titled `Record the comprehension check: …`, push it, and wait for the forge's checks (§4 step 4), not for an auto-review; it re-enters no pass. Resolve a merge conflict in the file by putting the default branch's entries first. Put each ruling with its base and votes, and each run's five scores, in the summary. +**Record.** `docs/comprehension-history.md` keeps every paired ruling and scoring run, which `larv-review` appends; never edit one. Commit what it appends, with the `todo.md` that `record-scoring` re-ranks and any floor item filed or refreshed, in one commit titled `Record the comprehension check: …`, push it, and wait for the forge's checks (§4 step 4), not for an auto-review; it re-enters no pass. Resolve a merge conflict in the file by putting the default branch's entries first. Put each ruling with its base and votes, and each run's five scores, in the summary. **Places.** Give systems-architect and stability-reviewer what `~/.claude/bin/larv-review places` prints: the places seats found hard since the newest scored commit. Ask each to report, as a 🟡, each of those places the change touches without making it easier to read, matching a place by its path and the function or section it names, since its line may have moved. Fix such a 🟡, or say in the PR summary why not; that reason settles it in place of a decline's record. diff --git a/todo.md b/todo.md index 153bd34e..5b4abbee 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 | -| 230 | 0.7.0 | | | **Have larv-review file one ambitious refactor item, aimed at the lowest-scoring dimension, whenever a scoring run leaves any score under 7.0, so such a project always holds a plan item meant to reach 7.0.** | 3 | 2 | 3 | 6 | 4 | 1.1 by 7, 1.2 by 4 | 3.8 | | 215 | 0.7.0 | | | **Decode a reload's handed JSON with a decoder for `LoopRun` and its `Route`, in place of `decoded_as`'s generic one with its two sentinels and `Route.fits` hook.** | 2 | 1 | 3 | 4 | 3 | code health by 2 | 3.6 | | 237 | 0.7.0 | | principle | **Give `judge` and `judge_once` in `bin/loop_claude/cycle/judge.py` a record of the inputs they share, in place of nine and eight parameters, or record why they stay.** | 2 | 1 | 2 | 3 | 3 | code health by 2 | 3.6 | | 242 | 0.7.0 | | principle | **Run each case of a table-driven test in its own `subTest`, and split each test that checks several behaviours, so one failure does not hide the others and names its case.** | 2 | 1 | 1 | 2 | 3 | code health by 2 | 3.6 | @@ -77,20 +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). -### 230. Have larv-review file one ambitious refactor item, aimed at the lowest-scoring dimension, whenever a scoring run leaves any score under 7.0, so such a project always holds a plan item meant to reach 7.0. - -Today `larv-review record-scoring` prints a `Floor:` line naming each mean under 7.0 (`bin/larv_review/history_commands.py:52`), and larv-review §3 → "Record" only commits the run and lists its scores. No rule turns that line into plan items. The places seats name reach the plan only when another item happens to touch one, so a project under 7.0 can stay there with no item aimed at it. - -The human set the shape on 2026-10-26: the item filed is one ambitious refactor, not touch-ups. It restructures the area behind the lowest dimension's places, sized to lift that dimension to 7.0, and quotes the places it answers. Its tagline names the comprehension floor, so its chunk runs a scoring run, and a run still under 7.0 files the next one. The chain stops when every score reaches 7.0. - -Settle in the change: - -- Where the rule lives: larv-review §3 → "Record", and whether `record-scoring` prints the step beside `Floor:` so no worker misses it. Seats already found `Floor:` unclear: `docs/comprehension-history.md:1536` says decision titles disagree on whether the floor blocks. -- Duplicates: a release ends with two scoring runs, and an earlier run's item may still be open. While one such item is open, a later run refreshes its places instead of filing another. The item a chunk ships doesn't count as open, so its own scoring run files the next one. -- Ranking: `docs/decisions.md` → `larv-review: within a chunk lifting a project towards the comprehension floor, …` moves such an item's goals by 9 and lets it compete like any other item. Say whether an ambitious refactor, likely above R 5 and so shipping alone, keeps both the move by 9 and that ranking. - -Once it ships, `~/code/log` drops its item 98, which does the same by hand, and revises the decisions that cite it. - ### 215. Decode a reload's handed JSON with a decoder for `LoopRun` and its `Route`, in place of `decoded_as`'s generic one with its two sentinels and `Route.fits` hook. Release 0.3.0's Mid A (PR #324 at c713910) named `bin/loop_claude/loop/reload.py:43` `decoded_as`: "a generic decoder with two sentinels and a duck-typed fits hook defined on Route". This lowers Shape: `decoded_as` is generic over any type, yet `decode_handed` calls it with one dataclass, `LoopRun`. Keep what it does today: a field added since the running script started may be missing, and a handed dataclass holding a field its `RETIRED` names decodes as None where its type allows None, and is rejected otherwise. `LoopRun.items_taken_in`, a tuple of item IDs, decodes only from a JSON array of integers. Make `decoded_as` easier to read. -- 2.52.0 From b37d03056c3277cd4a460c91cbbbaa025e7fd672 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 8 Nov 2026 22:28:37 +0100 Subject: [PATCH 3/6] =?UTF-8?q?Answer=20security=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From 6a1d5c81c3caf31b1cc435170a3b27d9c0fa6f9f Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 8 Nov 2026 22:37:12 +0100 Subject: [PATCH 4/6] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=205=20=F0=9F=9F=A1=20(0=20misread);=20test=20the?= =?UTF-8?q?=20open=20floor=20item=20end=20to=20end=20and=20checkout=5Fplan?= =?UTF-8?q?'s=20guards,=20check=20the=20Next:=20line's=20facts,=20word=20t?= =?UTF-8?q?he=20rule's=20places=20by=20this=20run's;=20log's=20item=2098?= =?UTF-8?q?=20is=20dropped=20once=20this=20merges?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- bin/larv_review/main.py | 11 ++++--- bin/larv_review/scoring.py | 11 ++++--- bin/larv_review/test_larv_review.py | 48 +++++++++++++++++++++++------ docs/decisions.md | 2 +- skills/larv-review/SKILL.md | 4 +-- 6 files changed, 56 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3dd4454..b3773409 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- A scoring run under the comprehension floor of 7.0 now leaves a plan item meant to reach it. `larv-review record-scoring` follows its `Floor:` line with a `Next:` line, which says to file one ambitious refactor aimed at the lowest dimension, or to refresh the one `todo.md` already holds. The item names the comprehension floor, so its own chunk runs a scoring run, and goes into the release after the chunk's, so the floor holds up no release (larv-review §3 → "Floor item"). +- A scoring run under the comprehension floor of 7.0 now leaves a plan item meant to reach it. `larv-review record-scoring` follows its `Floor:` line with a `Next:` line. It says to file one ambitious refactor aimed at the lowest dimension, or to refresh the one `todo.md` already holds. The item's tagline holds `comprehension floor`, so its own chunk runs a scoring run. It goes into the release after the chunk's, so the floor doesn't hold up any release (larv-review §3 → "Floor item"). An item already in `todo.md` whose tagline holds those words counts as the open one: drop or reword it if it isn't such a refactor. - `loop-claude` now interrupts you less. A worker takes its own recommendation on a choice no rule reserves for you, and records it, and the judge answers an ask that carries a recommendation by quoting the rule that says so. You are still asked about a goal, a release's planned items and its cut, a change to the routing ladder, and whatever another rule asks your approval for; `CLAUDE.md` → "Working loop", "Ask, don't guess" lists them. - This setup's own plan now ranks items by `Score = 100 * V / (2**S + 32)`, up from 8: F, a chunk's fixed cost, is 32, about one size-5 change, fitted to ten finished chunks' tokens, so small items rank lower against large ones. `docs/decisions.md` holds the fit. - `loop-claude` now keeps the cycle it last measured the routing figures at, and each routing call it raised, in `routing-state.json` at the archive's root, and reads them back from there in place of `routing-figures.md` and `routing-calls-raised.md`. The two markdown files hold what they held before. From them, loop-claude now reads only a `Reset` line in `routing-calls-raised.md`, which still resets the figures. The first loop to close a cycle after the upgrade measures the figures at once. If the figures still make a call raised since the latest reset, it puts that call to you once more. diff --git a/bin/larv_review/main.py b/bin/larv_review/main.py index a2f7cab6..4f85990f 100644 --- a/bin/larv_review/main.py +++ b/bin/larv_review/main.py @@ -72,11 +72,12 @@ 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. 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. A line opening `Next:` follows it: file -an item naming the comprehension floor, aimed at the lowest of the four dimensions, or refresh the -one the checkout's todo.md holds open, which is any such item but those given. Then it ranks the -checkout's todo.md as rank_todo.py does, since the overall sets the weight of code health, the goal -every project shares, and exits 1 where rank_todo.py would, with the run recorded. +floor of {floor}, a line opening `Floor:` naming each one. A line opening `Next:` follows it. It +says to file a floor item, one whose tagline holds `comprehension floor`, aimed at the lowest of the +four dimensions. Where the checkout's todo.md holds such an item other than those given, it says to +refresh that item instead. Then it ranks the checkout's todo.md as rank_todo.py does, since the +overall sets the weight of code health, the goal every project shares, and exits 1 where +rank_todo.py would, with the run recorded. places prints the places seats found hard since the newest scored commit: the places of each scoring run on it, and, diff --git a/bin/larv_review/scoring.py b/bin/larv_review/scoring.py index a555c20f..82f05a50 100644 --- a/bin/larv_review/scoring.py +++ b/bin/larv_review/scoring.py @@ -3,7 +3,7 @@ import decimal from review_rules.comprehension_history import DIMENSIONS, FLOOR from release_plan.todo_table import Item -# plan.scoring_run_due keys on these words too, so the floor item filed calls its own scoring run. +# A floor item's tagline holds these words, and plan.scoring_run_due keys on them too, so each floor item's chunk runs a scoring run. FLOOR_ITEM = "comprehension floor" @@ -21,7 +21,10 @@ def under_floor(found: list[decimal.Decimal]) -> list[str]: def floor_step(found: list[decimal.Decimal], plan: list[Item], ships: list[int]) -> str | None: - """What a scoring run under the floor asks next, None when no mean is under it. It aims at the lowest of the four dimensions, each of them where they tie, since the lowest caps the overall. An item in plan naming the comprehension floor is open unless ships holds its ID: the chunk shipping it still asks for the next one.""" + """The `Next:` line of a scoring run with a mean under the floor, None when no mean is under it (SKILL.md → "Floor item"). + + The line aims at the lowest of the four dimensions, or at each where they tie, since the lowest caps the overall. A floor item in plan is open unless ships holds its ID, so a chunk that ships one still files the next. + """ if not under_floor(found): return None dimensions = dict(zip(DIMENSIONS[:-1], found)) @@ -30,5 +33,5 @@ def floor_step(found: list[decimal.Decimal], plan: list[Item], ships: list[int]) aim = f"{names}, the lowest dimension{'s' if len(lowest) > 1 else ''}" rule = 'as larv-review §3 → "Floor item" says.' if open_items := [item for item in plan if FLOOR_ITEM in item.tagline.lower() and item.id not in ships]: - return f"Next: refresh item {open_items[0].id}, which names the comprehension floor, to lift {aim}, with this run's places, and file no other, {rule}" - return f"Next: file one item naming the comprehension floor, a refactor lifting {aim}, to {FLOOR}, {rule}" + return f"Next: refresh floor item {open_items[0].id} to lift {aim}, with this run's places, and file no other, {rule}" + return f"Next: file one floor item, a refactor lifting {aim}, until every mean reaches {FLOOR}, {rule}" diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index 7c7fcbe5..9d28cab2 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -12,13 +12,13 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from larv_review.agreement import agreement_report, ruling_agreement, run_agreement from review_rules.comprehension_history import appended, entries, HistoryChange, latest_places, Place, recorded, ruling_entry, scoring_entry, ScoringRun, Seat +from larv_review.plan import checkout_plan, landed_towards, plan_reasons, scoring_run_due from review_rules import comprehension_history from larv_review.ruling import counted, ruling, split, surplus, votes from failure import Failure from larv_review.scoring import floor_step, means, under_floor from test_env import isolated_env from release_plan.todo_table import Item, items, NoItemsTable -from larv_review.plan import landed_towards, plan_reasons, scoring_run_due from release_plan.release_standing import LastCut from larv_review.ruling_base import measured_commit from larv_review.seats import score_line, scores, seats_file @@ -117,18 +117,37 @@ class Seats(unittest.TestCase): found = [decimal.Decimal(mean) for mean in ("7.38", "6.63", "7.00", "6.50", "6.88")] floor_item = item(5, (0, 2, 0), "**Restructure the reload, lifting Locality to the comprehension floor.**") with self.subTest("none open"): - self.assertEqual(floor_step(found, [item(1, (0, 1, 0))], []), 'Next: file one item naming the comprehension floor, a refactor lifting Self-sufficiency, the lowest dimension, to 7.0, as larv-review §3 → "Floor item" says.') + step = floor_step(found, [item(1, (0, 1, 0))], []) + self.assertTrue(step.startswith("Next: file one floor item"), step) + self.assertIn(" Self-sufficiency, the lowest dimension,", step) + self.assertIn('"Floor item"', step) with self.subTest("one open"): - self.assertEqual(floor_step(found, [item(1, (0, 1, 0)), floor_item], []), 'Next: refresh item 5, which names the comprehension floor, to lift Self-sufficiency, the lowest dimension, with this run\'s places, and file no other, as larv-review §3 → "Floor item" says.') + step = floor_step(found, [item(1, (0, 1, 0)), floor_item], []) + self.assertTrue(step.startswith("Next: refresh floor item 5 "), step) + self.assertIn(" Self-sufficiency, the lowest dimension,", step) + self.assertIn("file no other", step) with self.subTest("the shipped one is not open"): - self.assertTrue(floor_step(found, [floor_item], [5]).startswith("Next: file one item")) + self.assertTrue(floor_step(found, [floor_item], [5]).startswith("Next: file one floor item")) with self.subTest("a tie names both"): tied = [decimal.Decimal(mean) for mean in ("7.38", "6.50", "7.00", "6.50", "6.88")] - self.assertIn("lifting Locality and Self-sufficiency, the lowest dimensions, to 7.0", floor_step(tied, [], [])) + self.assertIn(" Locality and Self-sufficiency, the lowest dimensions,", floor_step(tied, [], [])) with self.subTest("none under the floor"): self.assertIsNone(floor_step([decimal.Decimal("7.00")] * 5, [floor_item], [])) with self.subTest("only the overall under the floor"): - self.assertIn("lifting Navigation, Locality, Shape and Self-sufficiency, the lowest dimensions", floor_step([decimal.Decimal("7.00")] * 4 + [decimal.Decimal("6.75")], [], [])) + step = floor_step([decimal.Decimal("7.00")] * 4 + [decimal.Decimal("6.75")], [], []) + self.assertIn(" Navigation, Locality, Shape and Self-sufficiency, the lowest dimensions,", step) + self.assertIn("until every mean reaches 7.0", step) + + def test_checkout_plan_fails_on_a_missing_or_tableless_todo(self): + with tempfile.TemporaryDirectory() as checkout: + with self.subTest("missing"): + self.assertIsInstance(checkout_plan(checkout), Failure) + with self.subTest("no items table"): + pathlib.Path(checkout, "todo.md").write_text("# todo\n", encoding="utf-8") + self.assertIn("no items table", checkout_plan(checkout).reason) + with self.subTest("a malformed row"): + pathlib.Path(checkout, "todo.md").write_text(todo("| x | 0.1.0 |"), encoding="utf-8") + self.assertIn("the checkout's todo.md:", checkout_plan(checkout).reason) class History(unittest.TestCase): @@ -554,18 +573,29 @@ class LarvReviewTool(unittest.TestCase): self.plan() 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.\nNext: file one item naming the comprehension floor, a refactor lifting Locality and Self-sufficiency, the lowest dimensions, to 7.0, as larv-review §3 → \"Floor item\" says.\n", ran.stdout) + self.assertIn("\nFloor: Locality 6.50, Self-sufficiency 6.50 under the floor of 7.0.\nNext: file one floor item, a refactor lifting Locality and Self-sufficiency, the lowest dimensions,", 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 plan(self, readme="# P\n\n## Goals\n\n1. **Achieve:** A.\n", bar="0.1"): + def test_record_scoring_refreshes_the_open_floor_item_unless_the_chunk_ships_it(self): + line = "Navigation 7, Locality 6.5, Shape 7, Self-sufficiency 7, Overall 7" + seats = "".join(f"\n{seat}: {line}\n" for seat in ("Junior A", "Mid A", "Maintainability senior", "Inherited architect")) + self.plan(second="**Lift Locality to the comprehension floor.**") + 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("\nNext: refresh floor item 2 to lift Locality, the lowest dimension,", ran.stdout) + shipped = self.run_tool("record-scoring", self.seats_file(f"PR #2 rerun at {self.start}\n" + seats), "1", "2") + self.assertEqual(shipped.returncode, 0, shipped.stderr) + self.assertIn("\nNext: file one floor item,", shipped.stdout) + + def plan(self, readme="# P\n\n## Goals\n\n1. **Achieve:** A.\n", bar="0.1", second="**Do A.**"): """Commit and push the README.md and a todo.md whose item 1, alone in release 0.1.0, moves code health, each item scored as before any scoring run.""" header = "| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |\n|---|---|---|---|---|---|---|---|---|---|---|---|\n" # Before any scoring run code health weighs four times its weight at an overall of 7.0: 4 / 1.97 against goal 1's 0.97 / 1.97. - rows = "| 1 | 0.1.0 | | | **Read easier.** | 1 | 1 | 1 | 1 | 1 | code health by 1 | 101.5 |\n| 2 | 0.2.0 | | | **Do A.** | 1 | 1 | 1 | 1 | 1 | 1 by 3 | 73.9 |\n" + rows = f"| 1 | 0.1.0 | | | **Read easier.** | 1 | 1 | 1 | 1 | 1 | code health by 1 | 101.5 |\n| 2 | 0.2.0 | | | {second} | 1 | 1 | 1 | 1 | 1 | 1 by 3 | 73.9 |\n" self.commit("Plan", {"README.md": readme, "todo.md": f"# todo\n\n## Scoring\n\n`Score = 100 * V / 2**S`\n\n`Bar = {bar}`\n\n`Next ID = 3`\n\n## Items\n\n" + header + rows}) self.git("push", "-q", "origin", "HEAD:main") diff --git a/docs/decisions.md b/docs/decisions.md index c9302282..d6f41ec4 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -42,7 +42,7 @@ The cap is 5, `bin/release_plan/todo_table.py`'s `BUNDLE_MAX_R`, from the same c 2026-10-15, lilleman, set by PR #283 on 2026-10-16: an item that lifts the lowest dimension moves each goal it cites by 9, since the lowest dimension caps the overall and lifting it is worth the most to the floor. Within a chunk its work comes first; in the plan, lilleman answering that PR's review, such items compete with the others like any item and don't rank first. PR #257's scoring run found Shape lowest, at 6.25, and two items were to lift it: one, shipped by PR #367, gave "record", "outcome" and "place" one meaning each in `bin/`; the other, shipped by PR #432, grouped `bin/`'s root modules into packages named by purpose. Release 0.3.0's scoring runs found Locality lowest, at 5.75 and 5.88, so the 9 moved from those items to the ones lifting Locality. -2026-11-08, claude, item 230: the floor item that larv-review files (`skills/larv-review/SKILL.md` → "Floor item") keeps the move by 9 and competes like any item. Its R, likely above 5, makes it ship alone, which decides only what joins its chunk, not its rank. +2026-11-08, claude, item 230: the floor item that larv-review files (`skills/larv-review/SKILL.md` → "Floor item") keeps the move by 9 and competes like any item, though its R, likely above 5, makes it ship alone. ## loop-claude: a `claude` that cannot start is a failed worker run, retried diff --git a/skills/larv-review/SKILL.md b/skills/larv-review/SKILL.md index d485caad..ab6718de 100644 --- a/skills/larv-review/SKILL.md +++ b/skills/larv-review/SKILL.md @@ -147,11 +147,11 @@ The comprehension check records how hard the project is for its contributor to r **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`. - **Seats.** 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. +- **Floor item.** Where `record-scoring` prints `Floor:`, a `Next:` line follows: file one floor item, or refresh the open one. A floor item is a plan item meant to bring every mean to 7.0. File it as one ambitious refactor, not touch-ups. It restructures the area behind the places `larv-review places` prints for this run, chosen where they bear on the lowest dimension, sized to bring every mean to 7.0, and quotes those places. Its tagline holds the words `comprehension floor`, so its own chunk runs a scoring run; while a mean stays under 7.0, that run's `Next:` line asks for the next floor item. Mark it `owner`, since the human asked that such a project always hold one, so no score deletes it. Put it in the earliest release the plan names after the one the chunk ships into, or else in the next version after that one that `~/.claude/rules/todo-items.md` allows, so the floor doesn't hold up any release. While one is open, refresh its places and aim from the newest run instead of filing another; the item the chunk ships doesn't count as open. Commit it with the run, as "Record" says. - **Second run.** Where `needs-scoring-run` printed that the chunk `leaves release … with no plan item`, launch the same four seats afresh on the same head. Their scores file's first line is ` rerun at `. Record it with the same `record-scoring` command. -- **Floor item.** Where `record-scoring` prints `Floor:`, the project holds one plan item meant to lift it to the floor, and the `Next:` line after `Floor:` says whether to file it or refresh it. File it as one ambitious refactor, not touch-ups: it restructures the area behind the places that `larv-review places` prints for the lowest dimension, sized to lift that dimension to 7.0, and quotes those places. Its tagline names the comprehension floor, so its own chunk runs a scoring run, and that run files the next one while any score stays under 7.0. Put it in the earliest release after the one the chunk ships into, so the floor holds up no release. While one such item is open, refresh its places and aim from the newest run instead of filing another; the item the chunk ships doesn't count as open. Commit it with the run, as "Record" says. - **Agreement.** After the second run, run `~/.claude/bin/larv-review agreement` and put its counts in the summary. On `Assumption fails:`, ask the user whether to keep the paired ruling or change the decision `review: the comprehension check records …`. Record the answer as a decision in the repo whose history was counted, with the counts that led to the ask. A later run asks again only when the rulings' rate falls, or the runs' rate rises, against the recorded counts. -**Record.** `docs/comprehension-history.md` keeps every paired ruling and scoring run, which `larv-review` appends; never edit one. Commit what it appends, with the `todo.md` that `record-scoring` re-ranks and any floor item filed or refreshed, in one commit titled `Record the comprehension check: …`, push it, and wait for the forge's checks (§4 step 4), not for an auto-review; it re-enters no pass. Resolve a merge conflict in the file by putting the default branch's entries first. Put each ruling with its base and votes, and each run's five scores, in the summary. +**Record.** `docs/comprehension-history.md` keeps every paired ruling and scoring run, which `larv-review` appends; never edit one. Commit what it appends, with the `todo.md` that `record-scoring` re-ranks in one commit titled `Record the comprehension check: …`, push it, and wait for the forge's checks (§4 step 4), not for an auto-review; it re-enters no pass. Resolve a merge conflict in the file by putting the default branch's entries first. Put each ruling with its base and votes, and each run's five scores, in the summary. **Places.** Give systems-architect and stability-reviewer what `~/.claude/bin/larv-review places` prints: the places seats found hard since the newest scored commit. Ask each to report, as a 🟡, each of those places the change touches without making it easier to read, matching a place by its path and the function or section it names, since its line may have moved. Fix such a 🟡, or say in the PR summary why not; that reason settles it in place of a decline's record. -- 2.52.0 From 801dcc8233364bf88aef6502858e9ea597e0b243 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 8 Nov 2026 22:37:12 +0100 Subject: [PATCH 5/6] =?UTF-8?q?Answer=20product-owner=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=204=20=F0=9F=9F=A1=20(0=20misread);=20fixed=20in?= =?UTF-8?q?=20the=20stability=20round's=20commit:=20mark=20the=20floor=20i?= =?UTF-8?q?tem=20owner,=20fall=20back=20to=20the=20next=20version=20the=20?= =?UTF-8?q?bump=20rule=20allows,=20aim=20until=20every=20mean=20reaches=20?= =?UTF-8?q?7.0,=20note=20in=20the=20changelog=20that=20a=20tagline=20holdi?= =?UTF-8?q?ng=20the=20words=20counts=20as=20open?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0 From db019c626f731af0620799d27e3ee3c86a756ebd Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 8 Nov 2026 22:37:12 +0100 Subject: [PATCH 6/6] =?UTF-8?q?Answer=20prose=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=206=20=F0=9F=9F=A1=20(0=20misread);=20fixed=20in?= =?UTF-8?q?=20the=20stability=20round's=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- 2.52.0