Answer stability round 3: 0 🔴, 4 🟡; test todo.md at the cut, before it and on a merged side branch through real git, count only the default branch's own commits since the cut, test a cut release named at the tag, restore the UTF-8 and timeout tests of git, and drop the wall-clock asserts

This commit is contained in:
2026-10-17 02:50:29 +02:00
parent c89dd87a18
commit 46ccea1322
6 changed files with 68 additions and 16 deletions
+10 -6
View File
@@ -18,7 +18,8 @@ MOVES = "Moves"
# How the items table's header opens, which tells it from any other table in todo.md.
HEADER_START = "| ID | Release |"
# How the plan's earliest release stands to the version x.y.z the newest tag names, the last cut. "next": it is the earliest release after x.y.z that todo.md has named since the cut, or no tag names a version. "cut": it is x.y.z or earlier.
# Else the next release, the earliest named since the cut, holds no item: "finished" where work landed since the cut, "unplanned" where none did, and "unknown" where that cannot be read.
# Else the next release, the earliest named since the cut, holds no item: "finished" where work landed since the cut, and "unplanned" where none did. "unknown": what todo.md named, or the work landed, since the cut cannot be read.
# A release named since the cut stays the next until a tag cuts it, even once its items moved to a later release: larv_review/plan.py's emptied counts such a release emptied too, and `~/.claude/CLAUDE.md` → "Working loop" then stops for the human, or plans the release with their approval.
Standing = typing.Literal["next", "cut", "finished", "unplanned", "unknown"]
# todo.md's ## Details section, its body the first group.
DETAILS = re.compile(r"^## Details\n(.*?)(?=^## |\Z)", re.M | re.S)
@@ -201,13 +202,14 @@ def landed(cut: LastCut) -> int | Failure:
return cut.commits if entries is None else entries
def named_releases(todos: list[str] | Failure) -> set[tuple[int, int, int]]:
"""Each release the todo.md texts file items under. A text that does not parse names none, and so does a history that cannot be read, which leaves the plan's earliest release as the next."""
found = [items(todo) for todo in todos] if isinstance(todos, list) else []
return {item.release for parsed in found if isinstance(parsed, list) for item in parsed}
def named_releases(todos: list[str] | Failure) -> set[tuple[int, int, int]] | Failure:
"""Each release the todo.md texts file items under; a text that does not parse names none."""
if isinstance(todos, Failure):
return todos
return {item.release for parsed in map(items, todos) if isinstance(parsed, list) for item in parsed}
def standing(tag: str | None | Failure, landed: int | Failure, earliest: tuple[int, int, int] | None, named: set[tuple[int, int, int]]) -> Standing:
def standing(tag: str | None | Failure, landed: int | Failure, earliest: tuple[int, int, int] | None, named: set[tuple[int, int, int]] | Failure) -> Standing:
"""How the plan's earliest release, None where the plan holds no item, stands to the newest v* tag, as Standing says. named holds each release todo.md named since that tag, and landed the work landed since it."""
cut = re.fullmatch(r"v([0-9]+)\.([0-9]+)\.([0-9]+)", tag) if isinstance(tag, str) else None
if cut is None:
@@ -215,6 +217,8 @@ def standing(tag: str | None | Failure, landed: int | Failure, earliest: tuple[i
version = tuple(int(part) for part in cut.groups())
if earliest is not None and earliest <= version:
return "cut"
if isinstance(named, Failure):
return "unknown"
if earliest is not None and earliest == min(release for release in named | {earliest} if release > version):
return "next"
if isinstance(landed, Failure):