State when work has landed towards a release once, in work_landed

This commit is contained in:
2026-10-22 00:43:40 +02:00
parent 45b2444a70
commit d459c2315b
3 changed files with 14 additions and 7 deletions
+3 -5
View File
@@ -30,11 +30,9 @@ another round. It also lists each name in such a title that is not a pass.
needs-scoring-run takes the IDs of the todo.md items the chunk ships, none when it ships none, and
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, or when it leaves a release with no item in
the checkout's todo.md, less the shipped items, and work has landed towards that release. Work has
landed when the chunk ships one of the release's items, or when the release is the earliest the
default branch's todo.md names and the default branch has a commit after its newest v* tag, or has
no v* tag. 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.
the checkout's todo.md, less the shipped items, and work has landed towards that release;
bin/larv_review/plan.py's `work_landed` says 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 `<PR or branch> rerun at <commit>`, so record-scoring
does not refuse it as a repeat of the first.
+7 -2
View File
@@ -9,7 +9,7 @@ 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.
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. Work has landed when the chunk ships one of the release's items, or when the release is the earliest one `before` names and `landed` holds. A release the chunk's plan marks renamed is due none.
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.
"""
plan = {item.id: item for item in before + after}
if unknown := sorted(set(ships) - set(plan)):
@@ -18,12 +18,17 @@ 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 any(item.release == release for item in shipped) or (release == next_release and landed):
if work_landed(release, shipped, next_release, landed):
# 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 emptied(before: list[Item], after: list[Item], shipped: list[Item], renamed: set[tuple[int, int, int]]) -> list[tuple[int, int, int]]:
"""Each release the default branch's plan or a shipped item names that the chunk's plan, less the shipped items, names no longer, unless the chunk's plan marks it renamed."""
named = {item.release for item in before + shipped}
+4
View File
@@ -734,3 +734,7 @@ Read most (opens and searches):
- `bin/routing_figures/measure.py` 1
- `bin/score_outcomes/outcomes.py` 1
- `docs/decisions.md` 1
## Reading cost, chunk 4527b73a80f1, finished 2026-10-21T22:42:41Z
63554 new input tokens before the first commit.