File or refresh one comprehension-floor item whenever a scoring run is under 7.0
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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,
|
||||
|
||||
+20
-10
@@ -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
|
||||
|
||||
@@ -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}"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 <scores file> <the same item IDs>`, 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 `<PR or branch> rerun at <commit>`. 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.
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user