Answer architecture round 1: 0 🔴, 4 🟡 (0 misread); chunks_to_start and the epic's folder take the resolved paths; branch_summaries and reviewer_breaches wait for item 300
CI / tests (pull_request) Successful in 5m19s

This commit is contained in:
2026-12-03 19:45:15 +01:00
parent 55f87fb34e
commit a014e75101
15 changed files with 72 additions and 67 deletions
+9 -9
View File
@@ -15,18 +15,18 @@ from text_files.markdown_text import listed
from project_config.settings import PARALLEL_CHUNKS
from do_epic.parked import parked_chunks
from chunk_pr.approval import PARKS
from loop_state.paths import state_folder
from loop_state.paths import Paths
from agent_cycle import tmux
# The folder in the state folder where a folder per epic key holds the epic's lock file, which `claims.LOCK` names. A chunk without a repo works there.
STATE = "do-epic"
# Why a human's task with a live window waits, as the epic's status says.
HUMAN_WAIT = "it is a human's task; do-epic polls Jira until you close it"
def epic_folder(state: pathlib.Path, key: str) -> pathlib.Path:
"""The folder of the epic called key, in the state folder state."""
return state / STATE / key
# Why a human's task with a live window waits, as the epic's status says.
HUMAN_WAIT = "it is a human's task; do-epic polls Jira until you close it"
@dataclasses.dataclass(frozen=True)
@@ -74,7 +74,7 @@ class Epic:
cap: int
# The checkout of the repo with this name and its `parallel-chunks`, or why the repo cannot be used.
locate: typing.Callable[[str], tuple[pathlib.Path, int] | Failure]
home: pathlib.Path
paths: Paths
# The do-epic script each window runs.
launcher: pathlib.Path
env: typing.Mapping[str, str]
@@ -87,7 +87,7 @@ class Epic:
@property
def folder(self) -> pathlib.Path:
return epic_folder(state_folder(self.env, self.home), self.key)
return epic_folder(self.paths.state_folder, self.key)
def unblocks(status: str, unblocking: tuple[str, ...]) -> bool:
@@ -233,10 +233,10 @@ def start_chunk(epic: Epic, chunk: Chunk, own: str | None, windows: list[tmux.Li
if isinstance(located, Failure):
return Waits(chunk.issue, located.reason)
checkout, limit = located
with starting(project_lock(str(checkout), epic.home, epic.env)) as unlocked:
with starting(project_lock(str(checkout), epic.paths)) as unlocked:
if unlocked:
return unlocked
if reason := refusal(chunk.repo, room_in(str(checkout), limit, (session, own), epic.home, run)):
if reason := refusal(chunk.repo, room_in(str(checkout), limit, (session, own), epic.paths.home, run)):
return Waits(chunk.issue, reason)
return tmux.start_chunk(tmux.Window(session, chunk.issue, ""), str(checkout), handed, command, windows, False, run)
@@ -259,10 +259,10 @@ def resume(epic: Epic, repo: str, window: tmux.Window, run: tmux.Tmux) -> str |
if isinstance(located, Failure):
return located.reason
checkout, limit = located
with starting(project_lock(str(checkout), epic.home, epic.env)) as unlocked:
with starting(project_lock(str(checkout), epic.paths)) as unlocked:
if unlocked:
return unlocked.reason
if reason := refusal(repo, room_in(str(checkout), limit, (window.session, window.name), epic.home, run)):
if reason := refusal(repo, room_in(str(checkout), limit, (window.session, window.name), epic.paths.home, run)):
return reason
tmux.unpark(window, str(checkout), run)
return None