Answer prose round 1: 0 🔴, 3 🟡; one name for unreleased changes, a plainer standing docstring, a changelog entry true without a named release

This commit is contained in:
2026-10-18 11:04:52 +02:00
parent 5eafe960e1
commit 3eb3217a49
5 changed files with 17 additions and 13 deletions
+10 -7
View File
@@ -1,4 +1,4 @@
"""The next chunk's pick: the item it takes first, weighed against the last release cut, and what the default branch holds for it."""
"""The next chunk's pick: the item the chunk takes first, weighed against the last release cut, and what the default branch holds for the pick."""
import dataclasses
import re
@@ -22,7 +22,7 @@ class LastCut:
@dataclasses.dataclass(frozen=True)
class Next:
"""The plan's earliest release is the next release: the earliest after the last cut that todo.md has named since it, or there is no cut to weigh it against."""
"""The plan's earliest release is the next release: the earliest after the last cut that todo.md has named since that cut. Without a cut, the plan's earliest release is the next."""
# None where the plan holds no item.
release: tuple[int, int, int] | None
# The item the next chunk takes first, next_item's pick; None where every item waits or the plan holds none.
@@ -37,14 +37,14 @@ class Cut:
@dataclasses.dataclass(frozen=True)
class Finished:
"""The next release holds no item, and work has landed since the cut."""
"""The next release holds no item, and changes are unreleased."""
# The next release, None where todo.md has named none since the cut.
release: tuple[int, int, int] | None
@dataclasses.dataclass(frozen=True)
class Unplanned:
"""The next release holds no item, and no work has landed since the cut."""
"""The next release holds no item, and no change is unreleased."""
# The next release, None where todo.md has named none since the cut.
release: tuple[int, int, int] | None
@@ -95,7 +95,10 @@ def chunk_item(found: list[Item], cut: LastCut) -> Pick:
def standing(tag: str | None | Failure, changes: int | Failure, earliest: tuple[int, int, int] | None, first: Item | None, named: set[tuple[int, int, int]] | Failure) -> Pick:
"""How earliest, the plan's earliest release, None where the plan holds no item, stands to tag, the newest v* tag. first is the earliest release's first item that does not wait, changes counts the changes since the tag, and named holds each release todo.md named since it."""
"""How the plan stands to tag, the newest v* tag.
earliest is the plan's earliest release, None where the plan holds no item, and first is next_item's pick. changes counts the unreleased changes. named holds each release todo.md named since the tag.
"""
tagged = re.fullmatch(r"v([0-9]+)\.([0-9]+)\.([0-9]+)", tag) if isinstance(tag, str) else None
if tagged is None:
return Next(earliest, first)
@@ -113,7 +116,7 @@ def standing(tag: str | None | Failure, changes: int | Failure, earliest: tuple[
def unreleased_changes(cut: LastCut) -> int | Failure:
"""How many changes are unreleased, as `~/.claude/CLAUDE.md` → "Working loop" counts them: the entries under ## Unreleased, or the commits since the tag where CHANGELOG.md has no such section."""
"""How many changes are unreleased, as `~/.claude/CLAUDE.md` → "Working loop" counts them: the entries under ## Unreleased, or the commits since the tag where CHANGELOG.md has no such section or cannot be read."""
entries = unreleased_entries(cut.changelog) if isinstance(cut.changelog, str) else None
return cut.commits if entries is None else entries
@@ -125,7 +128,7 @@ def unreleased_entries(changelog: str) -> int | None:
def named_releases(todos: list[str] | Failure) -> set[tuple[int, int, int]] | Failure:
"""Each release the todo.md texts, oldest first, file items under. A release leaves the set when a text marks it renamed, and returns when a later text files items under it again. A text whose items or marks do not parse names none, except the newest: its marks failing to parse fails the whole, since the release they should have excluded would read as finished. larv_review/plan.py's `emptied` skips the releases marked renamed too."""
"""Each release the todo.md texts, oldest first, file items under. A release leaves the set when a text marks it renamed, and returns when a later text files items under it again. A text whose items or marks do not parse names none, except the newest: where its marks do not parse, it returns that Failure, since the release they should have excluded would read as finished."""
if isinstance(todos, Failure):
return todos
if todos and isinstance(newest := renames(todos[-1]), Failure):