Merge remote-tracking branch 'origin/main' into item-415
CI / tests (pull_request) Successful in 4m54s

# Conflicts:
#	README.md
#	bin/do_epic/chunk_prompt.py
#	bin/do_epic/main.py
#	bin/do_epic/scheduler.py
This commit is contained in:
2026-11-19 00:45:45 +01:00
21 changed files with 1098 additions and 110 deletions
+13 -3
View File
@@ -1,4 +1,4 @@
"""What a do-epic cycle's worker is told: its task, from the issue, and its first prompt. The resumed prompt and the rung sentences are the ones loop-claude's cycles use, naming do-epic."""
"""What a do-epic cycle's worker is told: its task, from the issue, and its first prompt. The resumed prompt and the rung sentences are the ones loop-claude's cycles use, naming do-epic; a chunk that was parked is first told why it resumes, and one whose task follows the epic's state is told that task as it resumes."""
import dataclasses
from do_epic.backend.protocol import EpicIssue
@@ -9,6 +9,7 @@ import pathlib
from model_routing.ladder import ProjectRung
from loop_claude.cycle import prompts
from model_routing.route import Route
from agent_cycle.worker_prompts import WorkerPrompts
# The entry point's name as the worker, the judge and the human read it.
DRIVER = "do-epic"
@@ -39,7 +40,16 @@ NAMES = prompts.RecordNames(
)
WORKER = prompts.worker_prompts(DRIVER, fresh, "", NAMES)
# What a worker does with a reviewer's feedback, as the decision asks (docs/decisions.md → `do-epic: drives one Jira epic …`, "Long gates").
FEEDBACK = 'Where a reviewer left feedback, fix what is reasonable and push the fix, answer each other comment in its thread, and change the setup so our review would have caught the finding (~/.claude/CLAUDE.md → "Working loop", "Change the setup for each finding an outside reviewer raises on a PR, deterministic tools first"). Then merge the pull request as before.'
def restating(task: str) -> prompts.WorkerPrompts:
def unparked(news: str) -> WorkerPrompts:
"""The prompts of the first cycle after a parked chunk resumes: WORKER's, with each prompt that starts a worker opening with news, which says what the chunk waited on and what changed. The fresh prompt opens with it too, since a chunk the judge ruled finished before it parked has no session left to resume."""
opening = f"{news} {FEEDBACK}\n\n"
return dataclasses.replace(WORKER, fresh=lambda *task: opening + WORKER.fresh(*task), resumed=lambda *evidence: opening + WORKER.resumed(*evidence))
def restating(task: str) -> WorkerPrompts:
"""WORKER for a chunk whose task follows the epic's state, as its finishing's does: the prompt that resumes its worker states task, which may not be the one its session began with."""
return dataclasses.replace(WORKER, resumed=lambda evidence, route, project: f"{WORKER.resumed(evidence, route, project)}\n\nThe task follows the epic's state, so it may have changed since you began. It is now:\n\n{task}")
return dataclasses.replace(WORKER, resumed=lambda *evidence: f"{WORKER.resumed(*evidence)}\n\nThe task follows the epic's state, so it may have changed since you began. It is now:\n\n{task}")