Answer architecture round 1: 0 🔴, 2 🟡; name the next release's test, state both cases of the plan reader, keep one release formatter

This commit is contained in:
2026-10-18 10:37:48 +02:00
parent 83701e20aa
commit ab081dd33f
6 changed files with 15 additions and 14 deletions
+4 -4
View File
@@ -84,7 +84,7 @@ def chunk_item(found: list[Item], cut: LastCut) -> Pick:
def standing(tag: str | None | Failure, changes: int | Failure, earliest: tuple[int, int, int] | None, named: set[tuple[int, int, int]] | Failure) -> tuple[Standing, tuple[int, int, int] | None]:
"""How earliest, the plan's earliest release, None where the plan holds no item, stands to tag, the newest v* tag; and the next release, as Pick.release says. changes counts the changes since the tag, and named holds each release todo.md named since it."""
"""How earliest, the plan's earliest release, None where the plan holds no item, stands to tag, the newest v* tag; and the next release: earliest where it is next, else the earliest release todo.md named since the cut, None for cut and unknown. changes counts the changes since the tag, and named holds each release todo.md named since it."""
cut = re.fullmatch(r"v([0-9]+)\.([0-9]+)\.([0-9]+)", tag) if isinstance(tag, str) else None
if cut is None:
return "next", earliest
@@ -93,12 +93,12 @@ def standing(tag: str | None | Failure, changes: int | Failure, earliest: tuple[
return "cut", None
if isinstance(named, Failure):
return "unknown", None
upcoming = min({release for release in named if release > version} | ({earliest} if earliest is not None else set()), default=None)
if earliest is not None and earliest == upcoming:
first_named = min((release for release in named if release > version), default=None)
if earliest is not None and (first_named is None or earliest <= first_named):
return "next", earliest
if isinstance(changes, Failure):
return "unknown", None
return ("finished" if changes else "unplanned"), upcoming
return ("finished" if changes else "unplanned"), first_named
def unreleased_changes(cut: LastCut) -> int | Failure: