Answer architecture round 1: 4 🔴, 5 🟡 (0 misread); one-way plan packages with a plan core and an Atlassian client, one parse and print of an item's cells, a pure chunk-start decision, a settings table, one plan read and one standing per pick, one config load in chunk-pr, notifier backends in notifier, and the bin regroup filed as item 392
This commit is contained in:
@@ -7,14 +7,14 @@ from release_plan.release_standing import DefaultPlan, project_plan, UNSEEN_RELE
|
||||
from loop_effects.effects import Effects, say
|
||||
from failure import Failure
|
||||
from loop_claude.routing import first_route, kept, routed_item
|
||||
from plan_store.stores import held_at, Plan, store as plan_store
|
||||
from loop_claude.loop.chunk_windows import held_beside, item_of
|
||||
from chunk_preflight.main import ITEM
|
||||
from release_plan.todo_table import Item
|
||||
from plan.todo_table import Item
|
||||
from model_routing.ladder import Ladder, Rung
|
||||
from transcript_archive.read import latest_worker
|
||||
from project_config.main import located
|
||||
from loop_claude.loop.this_loop import Loop
|
||||
from plan_store.plans import Plan
|
||||
from loop_claude.cycle import prompts
|
||||
from model_routing.route import Route, route_from
|
||||
from claude_code.session import session_open, transcript_file
|
||||
@@ -23,17 +23,12 @@ from claude_code.session import session_open, transcript_file
|
||||
ORIGIN_TIMEOUT = 60
|
||||
|
||||
|
||||
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: Plan | Failure = config
|
||||
else:
|
||||
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
|
||||
def scored_plan(default: DefaultPlan | Failure, effects: Effects) -> Plan | Failure:
|
||||
"""The plan, which scores the items a chunk takes, from what the default branch holds; where it can't be read or scored, it says why."""
|
||||
plan = default.plan if isinstance(default, DefaultPlan) else default
|
||||
if isinstance(plan, Failure):
|
||||
say(f"the items the worker names lift no rung: {plan.reason}", effects)
|
||||
return plan
|
||||
|
||||
|
||||
def routed(route: Route | None, ladder: Ladder, project: Rung | None, model: str, archived: typing.Callable[[], Route | None], item: typing.Callable[[], Item | None]) -> Route:
|
||||
@@ -60,10 +55,10 @@ def archived_route(archive_folder: pathlib.Path, loop: Loop) -> Route | None:
|
||||
return route
|
||||
|
||||
|
||||
def chunk_start(loop: Loop) -> tuple[str, typing.Callable[[], Item | None]]:
|
||||
"""The facts for a fresh worker's prompt, empty where the session is open, and the reader of the item that routes the chunk. The reader reads the default branch as last fetched: for a fresh chunk, by the preflight that runs first; for an open session, which runs none, by whatever fetched last."""
|
||||
def chunk_start(loop: Loop) -> tuple[str, DefaultPlan | Failure]:
|
||||
"""The facts for a fresh worker's prompt, empty where the session is open, and what the default branch holds, read once for the cycle: it routes the chunk, through plan_item, and scores the items the worker names, through scored_plan. It reads the default branch as last fetched: for a fresh chunk, by the preflight that runs first; for an open session, which runs none, by whatever fetched last."""
|
||||
facts = "" if session_open(loop.session) else chunk_facts(loop)
|
||||
return facts, lambda: plan_item(fetched_plan(loop), item_of(loop.window.name), loop.effects)
|
||||
return facts, fetched_plan(loop)
|
||||
|
||||
|
||||
def chunk_facts(loop: Loop) -> str:
|
||||
@@ -92,7 +87,7 @@ def plan_item(plan: DefaultPlan | Failure, window_item: int | None, effects: Eff
|
||||
if isinstance(plan, Failure):
|
||||
item: Item | Failure | None = plan
|
||||
else:
|
||||
item = routed_item(plan.todo, plan.cut, window_item)
|
||||
item = routed_item(plan.plan, plan.cut, window_item)
|
||||
if isinstance(item, Failure):
|
||||
say(f"routing on the project's rung: {item.reason}", effects)
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user