Print each chunk that asks a question and since when each parked chunk awaits its gate in do-epic --status
CI / tests (pull_request) Failing after 3m23s

This commit is contained in:
2026-11-19 00:40:16 +01:00
parent a49479948a
commit 8e210eaa09
8 changed files with 104 additions and 31 deletions
+6 -6
View File
@@ -9,7 +9,7 @@ import sys
import typing
from loop_claude.loop.chunk_start import archived_route, routed
from do_epic import chunk_prompt, findings, gates, parked, scheduler
from do_epic import chunk_prompt, findings, gates, parked, scheduler, status
from do_epic.repo_pick import ClaudeWork, HumanTask, recorded, Repo
from loop_claude.loop.close import closed_cycle
from loop_claude.project.records import CONSEQUENCE, read_records
@@ -52,7 +52,7 @@ A chunk whose worker ends its run while its pull request waits on its checks, an
is parked: it frees its place for the next chunk, and its window's name says what it awaits. Its worker goes
on once the checks pass, the approval comes or a reviewer comments, and a place is free; until one is, the
name says `awaits a slot`. A parked chunk survives a reboot: run do-epic <EPIC-KEY> again to go on polling.
--status starts no chunk: it prints each open issue with whether its chunk runs, or why it waits.
--status starts no chunk: it prints each open issue with whether its chunk runs, asks you a question, or why it waits: a parked chunk's gate and since when, a stopped window, a blocker or a human's task.
{findings.HELP}
The Jira site and its credentials are set in ~/.claude-projects/do-epic/config.toml."""
# Under the home folder, where a chunk's cycles are archived, a folder per epic. It is not loop-claude's archive, since that archive's readers, such as judge-replay and the routing figures, read loop-claude's prompts.
@@ -108,8 +108,8 @@ def main(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher:
def run(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher: pathlib.Path, effects: Effects, backend: Backend, stdin: typing.TextIO, forge_at: typing.Callable[[str], Run]) -> Stop:
chunk, words = (argv[1], argv[2:]) if len(argv) >= 2 and argv[0] == scheduler.CHUNK_FLAG else (None, argv)
status = chunk is None and words[1:] == [STATUS_FLAG]
words = words[:1] if status else words
status_asked = chunk is None and words[1:] == [STATUS_FLAG]
words = words[:1] if status_asked else words
# What the words after the epic's key write into the epic, where they are a filing or a decision.
writes = findings.parsed(words[1:]) if chunk is None else None
if (len(words) != 1 and not writes) or not ISSUE_KEY.fullmatch(words[0]) or (chunk is not None and not ISSUE_KEY.fullmatch(chunk)):
@@ -124,7 +124,7 @@ def run(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher:
return Stop(1, config.reason)
store, record = backend(config, words[0])
epic = EpicRun(words[0], config, store, record, paths, env, launcher, effects, forge_at)
if status:
if status_asked:
return status_printed(epic)
return windows_opened(epic) if chunk is None else chunk_run(chunk, epic)
@@ -132,7 +132,7 @@ def run(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher:
def status_printed(epic: EpicRun) -> Stop:
"""What `do-epic <EPIC-KEY> --status` does: prints a line per open issue, and doesn't start anything."""
issues = epic.store.read()
lines = issues if isinstance(issues, Failure) else scheduler.status(epic.key, epic.paths.home, issues, epic.effects.tmux)
lines = issues if isinstance(issues, Failure) else status.lines(epic.key, epic.paths.home, issues, epic.effects.tmux)
return Stop(1, lines.reason) if isinstance(lines, Failure) else Stop(0, "\n".join(lines) or f"the epic {epic.key} has no open issue")