From 703a58279a69145da700264fd89eff203cdb8b98 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 22 Oct 2026 00:46:54 +0200 Subject: [PATCH] =?UTF-8?q?Answer=20principles=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=202=20=F0=9F=9F=A1;=20rename=20landed=20to=20comm?= =?UTF-8?q?itted,=20drop=20the=20back-pointer,=20hold=20the=20whole=20cond?= =?UTF-8?q?ition=20in=20work=5Flanded?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/larv_review/plan.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/larv_review/plan.py b/bin/larv_review/plan.py index 60eefb14..7ab0c9c0 100644 --- a/bin/larv_review/plan.py +++ b/bin/larv_review/plan.py @@ -6,8 +6,8 @@ from git_repo import file_at, top from todo_table import Item, items, NoItemsTable, renames, version -def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], landed: bool, 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 it ships, landed whether the default branch holds a commit after its newest release tag, and renamed the releases the chunk's plan marks renamed. +def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], committed: bool, 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 it ships, committed whether `committed_since_release` holds for the default branch, 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, short of one renamed as below. A release the chunk's plan marks renamed is due none. """ @@ -18,15 +18,15 @@ def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], lan reasons = [f"ships item {item.id}, which names the comprehension floor" for item in shipped if "comprehension floor" in item.tagline.lower()] next_release = min((item.release for item in before), default=None) for release in emptied(before, after, shipped, renamed): - if work_landed(release, shipped, next_release, landed): + if work_landed(release, shipped, next_release, committed): # SKILL.md → "Second run" keys on this wording. reasons.append(f"leaves release {version(release)} with no plan item") return reasons -def work_landed(release: tuple[int, int, int], shipped: list[Item], next_release: tuple[int, int, int] | None, landed: bool) -> bool: - """Whether work has landed towards release. It has when the chunk ships one of the release's items, or when the release is next_release, the earliest the default branch's plan names, and landed holds. larv-review's help points here.""" - return any(item.release == release for item in shipped) or (release == next_release and landed) +def work_landed(release: tuple[int, int, int], shipped: list[Item], next_release: tuple[int, int, int] | None, committed: bool) -> bool: + """Whether work has landed towards release, for the scoring-run trigger. It has when the chunk ships one of the release's items, or when the release is next_release, the earliest the default branch's plan names, and committed holds: the default branch has a commit after its newest v* tag, or any commit when it has no v* tag.""" + return any(item.release == release for item in shipped) or (release == next_release and committed) def emptied(before: list[Item], after: list[Item], shipped: list[Item], renamed: set[tuple[int, int, int]]) -> list[tuple[int, int, int]]: @@ -62,7 +62,7 @@ def plan_reasons(default: str, ids: list[int]) -> list[str] | Failure: renamed = renames(after) if isinstance(renamed, Failure): return Failure(f"the checkout's todo.md: {renamed.reason}") - landed = committed_since_release(default) - if isinstance(landed, Failure): - return landed - return scoring_run_due(planned, chunk, ids, landed, renamed) + committed = committed_since_release(default) + if isinstance(committed, Failure): + return committed + return scoring_run_due(planned, chunk, ids, committed, renamed)