Route every read and write of the plan through plan_store and todo-item, which gains list, edit and move
CI / tests (pull_request) Failing after 2m13s

This commit is contained in:
2026-11-14 15:15:25 +01:00
parent a87b6cff98
commit 0ac8cad97f
35 changed files with 1088 additions and 421 deletions
+8 -9
View File
@@ -3,11 +3,12 @@ import pathlib
import typing
from git_cli.git_repo import default_ref
from release_plan.release_standing import DefaultPlan, held_at, project_plan, UNSEEN_RELEASES
from release_plan.release_standing import DefaultPlan, project_plan, UNSEEN_RELEASES
from loop_effects.effects import Effects, say
from failure import Failure
from loop_claude.routing import first_route, kept, routed_item
from release_plan.todo_table import Item, items
from plan_store.stores import held_at, Plan, store as plan_store
from release_plan.todo_table import Item
from transcript_archive.read import latest_worker
from project_config.main import located
from loop_claude.loop.this_loop import Loop
@@ -20,16 +21,16 @@ from claude_code.session import session_open, transcript_file
ORIGIN_TIMEOUT = 60
def fetched_todo(loop: Loop) -> str | Failure:
def fetched_todo(loop: Loop) -> Plan | Failure:
"""The plan, which scores the items a chunk takes: on the default branch as last fetched, or as it stands where the project's config puts it outside the checkout. fetched_plan reads it too, but also the release tag, CHANGELOG.md and each todo.md since the tag, which scoring the items doesn't need. Where it can't be read or scored, it says why."""
ref = default_ref(loop.root, ORIGIN_TIMEOUT, run=loop.effects.git)
config = located(loop.root, loop.paths.home)
if isinstance(config, Failure):
todo: str | Failure = config
todo: Plan | Failure = config
else:
todo = ref if isinstance(ref, Failure) else held_at(ref, config.place("plan"), loop.root, loop.effects.git)
if isinstance(scored := items(todo) if isinstance(todo, str) else todo, Failure):
say(f"the items the worker names lift no rung: {scored.reason}", loop.effects)
todo = ref if isinstance(ref, Failure) else held_at(ref, plan_store(config), loop.root, loop.effects.git)
if isinstance(todo, Failure):
say(f"the items the worker names lift no rung: {todo.reason}", loop.effects)
return todo
@@ -87,8 +88,6 @@ def plan_item(plan: DefaultPlan | Failure, effects: Effects) -> Item | None:
# It prints the reason itself, through effects, like the other loop-claude functions that print. todo.md item 51 moves them all to one injected effect, so changing this one alone would be undone.
if isinstance(plan, Failure):
item: Item | Failure | None = plan
elif isinstance(plan.todo, Failure):
item = plan.todo
else:
item = routed_item(plan.todo, plan.cut)
if isinstance(item, Failure):