Answer architecture round 2: 0 🔴, 1 🟡 (0 misread); the answer destinations and the help say the plan, and the notice of releases a plan outside the checkout hides prints once per chunk
This commit is contained in:
@@ -57,8 +57,8 @@ def archived_route(archive_folder: pathlib.Path, loop: Loop) -> Route | None:
|
||||
|
||||
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, fetched_plan(loop)
|
||||
fresh = not session_open(loop.session)
|
||||
return chunk_facts(loop) if fresh else "", fetched_plan(loop, fresh)
|
||||
|
||||
|
||||
def chunk_facts(loop: Loop) -> str:
|
||||
@@ -70,12 +70,12 @@ def chunk_facts(loop: Loop) -> str:
|
||||
return facts + (prompts.held_by_others(held) if held else "")
|
||||
|
||||
|
||||
def fetched_plan(loop: Loop) -> DefaultPlan | Failure:
|
||||
"""What the default branch, as last fetched, holds for routing; the plan and the changelog as they stand where the project's config puts them outside the checkout. It says UNSEEN_RELEASES for such a plan."""
|
||||
def fetched_plan(loop: Loop, announce: bool = True) -> DefaultPlan | Failure:
|
||||
"""What the default branch, as last fetched, holds for routing; the plan and the changelog as they stand where the project's config puts them outside the checkout. Where announce is True, as when a chunk starts, it says UNSEEN_RELEASES for such a plan, so the human reads it once per chunk, not every cycle."""
|
||||
config = located(loop.root, loop.paths.home)
|
||||
if isinstance(config, Failure):
|
||||
return config
|
||||
if config.tracked("plan") is None:
|
||||
if announce and config.tracked("plan") is None:
|
||||
say(UNSEEN_RELEASES, loop.effects)
|
||||
ref = default_ref(loop.root, ORIGIN_TIMEOUT, run=loop.effects.git)
|
||||
return ref if isinstance(ref, Failure) else project_plan(config, ref, loop.root, loop.effects.git)
|
||||
|
||||
Reference in New Issue
Block a user