Sort the imports, type the check reads and cite the working rule by its whole lead

This commit is contained in:
2026-11-18 23:19:41 +01:00
parent 117c698f65
commit 2dcf93a55f
10 changed files with 18 additions and 15 deletions
+4 -2
View File
@@ -63,8 +63,10 @@ def approved(number: str, run: Run, sleep: typing.Callable[[float], None] = time
def unanswered(number: str, run: Run) -> Failure | None:
"""A Failure naming the files where a reviewer's comment waits for an answer on pull request number, as `waiting_threads` finds them, or saying why they cannot be read. None where no thread waits."""
waiting = waiting_threads(number, run)
if isinstance(waiting, Failure) or not waiting:
return waiting or None
if isinstance(waiting, Failure):
return waiting
if not waiting:
return None
return Failure(f"a reviewer's comment on pull request {number} waits for an answer, in {', '.join(waiting)}; answer it in its thread, push any fix, and run chunk-pr merge again")
+2 -2
View File
@@ -1,11 +1,11 @@
"""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."""
import dataclasses
from agent_cycle.worker_prompts import WorkerPrompts
from do_epic.backend.protocol import EpicIssue
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"
@@ -31,7 +31,7 @@ def fresh(task: str, premises: str, route: Route, project: ProjectRung | None, f
WORKER = prompts.worker_prompts(DRIVER, fresh, "")
# 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 it, answer the rest in its thread, and change the setup so review would have caught it (~/.claude/CLAUDE.md → "Working loop", "Change the setup for each finding an outside reviewer raises"). Then merge the pull request as before.'
FEEDBACK = 'Where a reviewer left feedback, fix what is reasonable and push it, answer the rest in its thread, and change the setup so review would have caught it (~/.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 unparked(news: str) -> WorkerPrompts:
+2 -2
View File
@@ -5,10 +5,10 @@ import dataclasses
import json
import typing
from chunk_pr.approval import waiting_threads
from forge.pulls import CheckFailed, checks_now, open_pull, Pending, required_checks
from failure import Failure
from forge.commands import forge_of, Run
from forge.pulls import CheckFailed, checks_now, open_pull, Pending, required_checks
from chunk_pr.approval import waiting_threads
# What a pull request waits on, as the words after "awaits".
CHECKS = "its checks"
+1 -1
View File
@@ -9,7 +9,6 @@ import typing
from loop_claude.loop.chunk_start import archived_route, routed
from do_epic import chunk_prompt, gates, parked, scheduler
from forge.commands import Run, runner
from do_epic.repo_pick import ClaudeWork, HumanTask, recorded, Repo
from loop_claude.loop.close import closed_cycle
from agent_cycle.run import Cycle, run_cycle
@@ -33,6 +32,7 @@ from transcript_archive.project_key import project_key
from model_routing.ladder_file import project_ladder_file, read_ladder, SHIPPED
from loop_claude.project.premises import read_premises
from loop_claude.project.records import read_records
from forge.commands import Run, runner
from claude_code.session import session_named
from loop_claude.loop.main import setup_version
from agent_cycle.stop import Stop
+2 -2
View File
@@ -5,14 +5,14 @@ import dataclasses
import pathlib
import typing
from chunk_pr.approval import PARKS
from do_epic.epic_record import CAP
from do_epic.parked import parked_chunks
from loop_claude.loop.chunk_windows import epic_chunks, HANDED, LOCK, project_lock, starting
from do_epic.backend.protocol import EpicIssue
from failure import Failure
from do_epic.repo_pick import HumanTask, recorded, Repo
from project_config.settings import PARALLEL_CHUNKS
from do_epic.parked import parked_chunks
from chunk_pr.approval import PARKS
from transcript_archive.project_key import project_key
from do_epic.split import SPLIT_LABEL
from agent_cycle import tmux
+2 -2
View File
@@ -18,12 +18,12 @@ from do_epic.epic_record import EpicRecord
from agent_cycle import escalation_mark, judge, tmux
from failure import Failure
from loop_claude.test_loop_claude import FakeEffects, judged, Worker
from do_epic.test_scheduler import issue
from do_epic.test_gates import Forge
from do_epic import parked
from do_epic.test_scheduler import issue
from loop_claude.loop.this_loop import Loop
from loop_claude.loop.reload import LoopRun
from do_epic.backend.fake import MemoryEpic
from do_epic import parked
from loop_state.paths import paths_from
from model_routing.route import Route
from model_routing.ladder import Rung
+1 -1
View File
@@ -5,8 +5,8 @@ import unittest
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from do_epic.parked import file_of, park, Parked, parked_chunks, unpark
from failure import Failure
from do_epic.parked import file_of, park, Parked, parked_chunks, unpark
CHUNK = Parked("ABC-21", "/code/billing-ABC-21", "7", "0c0f", "an approval")
+1 -1
View File
@@ -7,10 +7,10 @@ import unittest
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from do_epic.scheduler import Chunk, CHUNK_FLAG, chunks, Epic, refusal, RepoRoom, resume, start_chunks, Started, Waits
from do_epic.parked import file_of, park, Parked
from do_epic import chunk_prompt
from do_epic.backend.protocol import EpicIssue
from failure import Failure
from do_epic.parked import file_of, park, Parked
from do_epic.epic_record import parallel_chunks_in
from loop_claude.cycle import prompts
from model_routing.route import Route
+2 -1
View File
@@ -117,11 +117,12 @@ def checks_passed(forge: Forge, number: str, head: str, required: set[str], run:
sleep(POLL_SECONDS)
return None
polls = WAIT_SECONDS // POLL_SECONDS
now: Pending | Failure | None = None
for poll in range(polls + 1):
now = checks_now(forge, number, head, required, run, settled=poll * POLL_SECONDS >= settle)
if not isinstance(now, Pending):
return now
if poll < polls:
sleep(POLL_SECONDS)
waited_on = f"{', '.join(now.missing)}, which the protection requires, never passed" if now.missing else "a check is still pending"
waited_on = f"{', '.join(now.missing)}, which the protection requires, never passed" if isinstance(now, Pending) and now.missing else "a check is still pending"
return Failure(f"gave up on pull request {number} after {WAIT_SECONDS // 60} minutes: {waited_on}")
+1 -1
View File
@@ -7,8 +7,8 @@ import unittest
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from forge.pulls import CheckFailed, checks_now, checks_passed, open_pull, Pending, POLL_SECONDS, required_checks, WAIT_SECONDS
from forge.commands import forge_of, gitea, url_beside
from failure import Failure
from forge.commands import forge_of, gitea, url_beside
class ForgeOf(unittest.TestCase):