Answer stability round 1: 0 🔴, 4 🟡 (0 misread); a cycle's close takes the task from the cycle, a resolved thread is skipped unread, and tests run git in their own environment
CI / tests (pull_request) Successful in 3m56s
CI / tests (pull_request) Successful in 3m56s
This commit is contained in:
+1
-1
@@ -271,7 +271,7 @@ def chunk_run(key: str, epic: EpicRun) -> Stop:
|
||||
concluded = run_cycle(cycle)
|
||||
if isinstance(concluded, Stop):
|
||||
return concluded
|
||||
closed = closed_cycle(run, cycle.project, concluded, cycle.project_archive, chunk_prompt.DRIVER, loop)
|
||||
closed = closed_cycle(run, cycle.task, cycle.project, concluded, cycle.project_archive, chunk_prompt.DRIVER, loop)
|
||||
if isinstance(closed, Stop):
|
||||
return closed
|
||||
run = closed
|
||||
|
||||
@@ -6,7 +6,7 @@ import pathlib
|
||||
import typing
|
||||
|
||||
from do_epic.epic_record import CAP
|
||||
from chunk_driver.claims import CHUNK_FLAG, epic_chunks, HANDED, LOCK, loop_chunks, project_lock, starting
|
||||
from chunk_driver.claims import CHUNK_FLAG, epic_chunks, HANDED, loop_chunks, project_lock, starting
|
||||
from do_epic.backend.protocol import EpicIssue
|
||||
from failure import Failure
|
||||
from do_epic.repo_pick import HumanTask, recorded, Repo
|
||||
@@ -16,7 +16,7 @@ from chunk_pr.approval import PARKS
|
||||
from do_epic.split import SPLIT_LABEL
|
||||
from agent_cycle import tmux
|
||||
|
||||
# Under the home folder, a folder per epic key holds the epic's LOCK. A chunk without a repo works there.
|
||||
# Under the home folder, a folder per epic key holds the epic's lock file, which `claims.LOCK` names. A chunk without a repo works there.
|
||||
STATE = ".local/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"
|
||||
|
||||
@@ -10,9 +10,10 @@ from do_epic.config import DoEpicConfig, load
|
||||
from do_epic.epic_record import EpicRecord
|
||||
from failure import Failure
|
||||
from loop_effects.doubles import FakeEffects, judged, Worker
|
||||
from do_epic import findings, finish, main, scheduler
|
||||
from do_epic import findings, finish, main
|
||||
from project_config.settings import Finish
|
||||
from do_epic.test_scheduler import issue
|
||||
from chunk_driver.claims import LOCK
|
||||
from do_epic.backend.fake import MemoryEpic
|
||||
from loop_state.paths import paths_from
|
||||
from claude_code.session import session_named
|
||||
@@ -215,7 +216,7 @@ class TheFinishingChunk(DoEpicTest):
|
||||
|
||||
def test_stops_where_the_epics_issues_cannot_be_read_or_its_lock_cannot_be_taken(self) -> None:
|
||||
self.issues = [issue("ABC-20", "do-epic-claude", done=True)]
|
||||
(self.home / ".local/state/do-epic/ABC-12" / scheduler.LOCK).mkdir(parents=True)
|
||||
(self.home / ".local/state/do-epic/ABC-12" / LOCK).mkdir(parents=True)
|
||||
code, _, err = self.run_main(["ABC-12"], FakeEffects(on_terminal=False))
|
||||
self.assertEqual(code, 1)
|
||||
self.assertIn("cannot lock ", err)
|
||||
|
||||
@@ -26,6 +26,7 @@ from chunk_driver.this_loop import Loop
|
||||
from do_epic.backend.fake import MemoryEpic
|
||||
from do_epic import parked
|
||||
from loop_state.paths import paths_from
|
||||
from text_files.file_writes import replace_file
|
||||
from model_routing.route import Route
|
||||
from model_routing.ladder import Rung
|
||||
from do_epic.test_do_epic import SETTINGS
|
||||
@@ -410,6 +411,25 @@ class AChunksRun(DoEpicTest):
|
||||
self.assertTrue(any("Z Stepped up\n" in text for text in outcomes) and any("Z Stopped: " in text for text in outcomes), outcomes)
|
||||
self.assertEqual([text for text in outcomes if not text.startswith("Task: Work the Jira issue ABC-21 of the epic ABC-12 as one chunk")], [])
|
||||
|
||||
def test_a_step_up_archived_beside_a_new_copy_of_the_transcript_opens_with_the_chunks_task(self) -> None:
|
||||
fake = FakeEffects(streams=[self.worker()] * 6, claude=[judged("unfinished", escalation="working")] + [judged("unfinished")] * 5, git=UNREAD)
|
||||
|
||||
def grown_after_each_copy(path: pathlib.Path, data: bytes) -> Failure | None:
|
||||
"""Writes the file, and adds a line to the worker's transcript after each copy of it, as a worker that still writes does."""
|
||||
unwritten = replace_file(path, data)
|
||||
if path.suffix == ".jsonl":
|
||||
for transcript in (paths_from(self.home).claude_code_transcripts.parent / "projects" / "-fake").glob("*.jsonl"):
|
||||
with open(transcript, "a", encoding="utf-8") as handle:
|
||||
handle.write(json.dumps({"type": "queue-operation", "timestamp": str(path)}) + "\n")
|
||||
return unwritten
|
||||
|
||||
fake.replace_file = grown_after_each_copy
|
||||
code, out, _ = self.run_main(["--chunk", "ABC-21", "ABC-12"], fake, MODELS)
|
||||
self.assertEqual(code, 2, out)
|
||||
outcomes = [path.read_text(encoding="utf-8") for path in (self.home / ".claude/do-epic-transcripts/ABC-12").glob("*/*.outcomes.md")]
|
||||
self.assertTrue(any("Z Stepped up\n" in text for text in outcomes) and any("Z Stopped: " in text for text in outcomes), outcomes)
|
||||
self.assertEqual([text for text in outcomes if not text.startswith("Task: Work the Jira issue ABC-21 of the epic ABC-12 as one chunk")], [])
|
||||
|
||||
def test_a_finished_chunk_moves_its_issue_to_done_before_the_chunk_it_blocks_starts(self) -> None:
|
||||
store = MemoryEpic("ABC-12", [self.issues[0], self.issues[1], issue("ABC-22", "do-epic-claude", blockers=("ABC-21",))])
|
||||
self.backend = lambda config, key: (store, EpicRecord(Description(self.description))) # type: ignore[method-assign,arg-type]
|
||||
|
||||
Reference in New Issue
Block a user