From 31fb1a0093dd1d2bc4265bfa7173767341f95646 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 22 Oct 2026 02:07:24 +0200 Subject: [PATCH] =?UTF-8?q?Answer=20prose=20round=201:=200=20=F0=9F=94=B4,?= =?UTF-8?q?=205=20=F0=9F=9F=A1;=20say=20what=20landed=5Ftowards=20returns?= =?UTF-8?q?=20and=20fails=20on,=20point=20--help=20at=20it,=20reword=20the?= =?UTF-8?q?=20changelog=20entry=20and=20two=20test=20names,=20and=20leave?= =?UTF-8?q?=20the=20README=20as=20it=20was?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- README.md | 2 +- bin/larv_review/main.py | 2 +- bin/larv_review/plan.py | 10 +++++----- bin/larv_review/test_larv_review.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7332dbcd..fb6bc587 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- `larv-review needs-scoring-run` now decides which release work has landed towards as `chunk-preflight` does: the next release it names, once `CHANGELOG.md` → `## Unreleased` holds an entry, or, where there is no such section, a commit follows the newest `v*` tag. Before, it took the plan's earliest release and counted commits alone, so a chunk that moved the next release's last items to a later release without shipping them called a scoring run where `chunk-preflight` called the release unplanned. +- `larv-review needs-scoring-run` now calls a scoring run for the release `chunk-preflight` names as next, not for the earliest release in the plan. It also counts a change as unreleased the way `chunk-preflight` does: an entry under `CHANGELOG.md` → `## Unreleased`, or, where there is no such section, a commit after the newest `v*` tag (any commit when there is none). Before, a chunk that moved the next release's last items to a later release without shipping them called a scoring run, while `chunk-preflight` called that release unplanned. - README → Install now says that every machine taking this checkout must be a sandbox with no direct access to a production environment, since `settings.json` runs Claude Code in auto mode with the dangerous-mode prompt skipped. Before, it asked for a sandbox only for `loop-claude`. ## 0.3.0 diff --git a/README.md b/README.md index 2c57e7a5..7ee48994 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ pytest_add_cli_args=-k Then, in the copy: `uvx --with pytest 'mutmut>=3,<4' run && uvx --with pytest 'mutmut>=3,<4' results`, and `uvx --with pytest 'mutmut>=3,<4' show ` to see a mutant's change. The config keys are mutmut 3's. -`bin/` is the import root: each launcher puts it on `sys.path`, so a module imports another by its path under `bin/`, such as `from claude_code.entries import parse_entry`. Each tool's package holds its tests; `rank_todo.py`, `settings_filter.py` and `statusline.py` are tools of one file each, tested beside them, `rule_hook` imports `rank_todo.py`'s check, `larv_review` imports `rank_todo.py`'s ranking and `chunk_pick`'s next release and count of unreleased changes, `score_outcomes` imports `reading_cost`'s record path, `judge_replay` imports `loop_claude`'s judge, and `loop_claude` runs `chunk-preflight` as a process of its own. `judge_replay` and `review_replay` share `rung_replay/`: the rung search, the argument reader, the candidate rungs and the exits. `rung_replay/` reads `loop_claude`'s retry count and models file. The other non-test modules at `bin/`'s root, `claude_code/` and `transcript_archive/` serve more than one tool; `model_routing/` holds the routing ladder, which loop-claude, `rule_hook`, both replay tools and `subagent-rung` read. `routing_figures/` measures loop-claude's archive for loop-claude's routing calls. `test_env.py` serves the tests, and `repo_checks/` tests the repo itself. +`bin/` is the import root: each launcher puts it on `sys.path`, so a module imports another by its path under `bin/`, such as `from claude_code.entries import parse_entry`. Each tool's package holds its tests; `rank_todo.py`, `settings_filter.py` and `statusline.py` are tools of one file each, tested beside them, `rule_hook` imports `rank_todo.py`'s check, `larv_review` imports `rank_todo.py`'s ranking, `score_outcomes` imports `reading_cost`'s record path, `judge_replay` imports `loop_claude`'s judge, and `loop_claude` runs `chunk-preflight` as a process of its own. `judge_replay` and `review_replay` share `rung_replay/`: the rung search, the argument reader, the candidate rungs and the exits. `rung_replay/` reads `loop_claude`'s retry count and models file. The other non-test modules at `bin/`'s root, `claude_code/` and `transcript_archive/` serve more than one tool; `model_routing/` holds the routing ladder, which loop-claude, `rule_hook`, both replay tools and `subagent-rung` read. `routing_figures/` measures loop-claude's archive for loop-claude's routing calls. `test_env.py` serves the tests, and `repo_checks/` tests the repo itself. ## Tracking a new file diff --git a/bin/larv_review/main.py b/bin/larv_review/main.py index f9758723..bb7c017e 100644 --- a/bin/larv_review/main.py +++ b/bin/larv_review/main.py @@ -31,7 +31,7 @@ needs-scoring-run takes the IDs of the todo.md items the chunk ships, none when prints why the chunk is due a scoring run, or `No scoring run due.` It is due when the chunk ships an item whose tagline names the comprehension floor. It is also due when the chunk leaves a release with no item in the checkout's todo.md, once the shipped items are set aside, and work has landed -towards that release; bin/larv_review/plan.py's `work_landed` says when. A release the checkout's +towards that release; bin/larv_review/plan.py's `work_landed` and `landed_towards` say when. A release the checkout's todo.md marks renamed in its ## Renamed section, as `- 0.2.1 renamed to 0.3.0`, is due none. A second scoring run of one head names itself ` rerun at `, so record-scoring diff --git a/bin/larv_review/plan.py b/bin/larv_review/plan.py index 261483cb..798bc8d4 100644 --- a/bin/larv_review/plan.py +++ b/bin/larv_review/plan.py @@ -7,7 +7,7 @@ from git_repo import top def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], landed: tuple[int, int, int] | None, renamed: set[tuple[int, int, int]]) -> list[str] | Failure: - """Why the plan calls a scoring run, empty when it does not. before is the default branch's plan, after the chunk's, ships the IDs of the items the chunk ships, landed the release unreleased changes have landed towards (`landed_towards`), and renamed the releases the chunk's plan marks renamed. + """Why the plan calls a scoring run, empty when it does not. before is the default branch's plan, after the chunk's, ships the IDs of the items the chunk ships, landed the release that unreleased changes landed towards (`landed_towards`), and renamed the releases the chunk's plan marks renamed. A chunk that ships an item naming the floor is due one, so it can prove the floor met. So is a chunk that empties a release after work has landed towards it, so no release ends unmeasured. A release the chunk's plan marks renamed is due none. """ @@ -25,16 +25,16 @@ def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], lan # larv-review --help points here rather than restating the rule, so the rule is written once. def work_landed(release: tuple[int, int, int], shipped: list[Item], landed: tuple[int, int, int] | None) -> bool: - """Whether work has landed towards release, for the scoring-run trigger. It has when the chunk ships one of the release's items. It has too when release is landed, the release that unreleased changes on the default branch landed towards.""" + """Whether work has landed towards release, for the scoring-run trigger. It has when the chunk ships one of the release's items. It has too when release is the one `landed_towards` names.""" return any(item.release == release for item in shipped) or release == landed def landed_towards(found: list[Item], cut: LastCut) -> tuple[int, int, int] | None | Failure: - """The release unreleased changes on the default branch have landed towards: the next release, as chunk-preflight names it (`chunk_pick.chunk_item`), where it holds items and `chunk_pick.unreleased_changes` counts one or more. None otherwise; a Failure where either cannot be read. found is the default branch's plan.""" + """The release that unreleased changes on the default branch have landed towards, None where there is none. It is the next release, as chunk-preflight names it (`chunk_pick.chunk_item`), once `chunk_pick.unreleased_changes` counts one or more changes. A Failure where chunk_item's pick is Unknown, or is Next and the count cannot be read. found is the default branch's plan.""" pick = chunk_item(found, cut) if isinstance(pick, Unknown): - return Failure("could not tell the next release from the default branch's tags and todo.md history") - # Only Next names a release a chunk can empty after work landed: Cut's is already cut, and Finished's and Unplanned's hold no item. + return Failure("could not tell the next release: the default branch's todo.md history or its unreleased changes cannot be read") + # Only Next names a release a chunk can empty after work landed: Cut's is the last cut's version or earlier, and Finished's and Unplanned's hold no item. if not isinstance(pick, Next): return None changes = unreleased_changes(cut) diff --git a/bin/larv_review/test_larv_review.py b/bin/larv_review/test_larv_review.py index 5517d1db..a9706d7e 100644 --- a/bin/larv_review/test_larv_review.py +++ b/bin/larv_review/test_larv_review.py @@ -318,7 +318,7 @@ class LandedTowards(unittest.TestCase): self.assertEqual(landed_towards(plan, LastCut("v0.1.0", "", 3, [])), (0, 2, 0)) self.assertEqual(landed_towards(plan, LastCut(None, "", 0, [])), None) - def test_names_no_release_where_chunk_preflight_names_none_a_chunk_can_empty(self): + def test_names_no_release_unless_chunk_preflight_names_a_next_release_with_items(self): changelog = "# Changelog\n\n## Unreleased\n\n- Did a thing.\n" self.assertIsNone(landed_towards([item(1, (0, 1, 0))], LastCut("v0.1.0", changelog, 0, []))) self.assertIsNone(landed_towards([], LastCut("v0.1.0", changelog, 0, [""]))) @@ -402,7 +402,7 @@ class LarvReviewTool(unittest.TestCase): self.commit("Mark 0.1.0 renamed", {"todo.md": todo(*rows) + "\n## Renamed\n\n- 0.1.0 renamed to 0.2.0\n"}) self.assertEqual(self.run_tool("needs-scoring-run").stdout, "No scoring run due.\n") - def test_counts_work_landed_towards_the_next_release_as_the_changelog_does_where_it_has_an_unreleased_section(self): + def test_counts_work_landed_from_the_changelogs_unreleased_entries_where_it_has_that_section(self): self.git("tag", "v0.0.1") self.commit("Commit after the tag", {"CHANGELOG.md": "# Changelog\n\n## Unreleased\n\n## 0.0.1\n"}) self.git("push", "-q", "origin", "HEAD:main")