Answer architecture round 3: 0 🔴, 1 🟡; pick the next chunk's item in one function, todo_table.chunk_item, which routing and the preflight both call, so routing names no item where the release after the last cut has none

This commit is contained in:
2026-10-17 02:19:11 +02:00
parent 45004e1b0b
commit 4cf3c2bd8c
9 changed files with 130 additions and 95 deletions
+6 -9
View File
@@ -44,7 +44,7 @@ import subprocess
import sys
import typing
from git_repo import commit_exists, commits_since, default_branch, default_branch_todo, file_at, git, newest_release_tag, top
from git_repo import commit_exists, default_branch, default_plan, file_at, git, top
from failure import Failure
from chunk_preflight.gathered import Forge, forge_of, Gathered, ItemFacts, named_paths, NamedPath, NoItem, Plan, planned, pulls_command, Ran, Release, Worktree, worktree_add, worktree_on
from chunk_preflight.facts import render
@@ -96,18 +96,15 @@ def preflight(root: pathlib.Path, timeout: float) -> list[str] | Failure:
if isinstance(default, Failure):
return default
ref, note = default
cut = release(ref, root)
plan = planned(default_branch_todo(str(root), timeout), cut, ref)
held = default_plan(str(root), timeout)
if isinstance(held, Failure):
return held
cut = Release(held.tag, file_at(ref, "CHANGELOG.md", str(root)), held.commits)
plan = planned(held.todo, cut, ref)
item = plan if isinstance(plan, NoItem) else item_facts(root, ref, plan, timeout)
return render(Gathered(ref, note, cut, item))
def release(default: str, root: pathlib.Path) -> Release:
tag = newest_release_tag(default)
commits = tag if isinstance(tag, Failure) else commits_since(tag, default)
return Release(tag, file_at(default, "CHANGELOG.md", str(root)), commits)
def item_facts(root: pathlib.Path, default: str, plan: Plan, timeout: float) -> ItemFacts:
worktree = item_worktree(root, plan.branch, default)
path = worktree.path if isinstance(worktree, Worktree) else None