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:
@@ -5,7 +5,7 @@ import re
|
||||
import typing
|
||||
|
||||
from touch_predictions.beside import Beside, chunks_beside
|
||||
from chunk_driver.claims import CHUNK_FLAG, epic_chunks, HANDED, LOCK, loop_session, project_lock, starting
|
||||
from chunk_driver.claims import CHUNK_FLAG, epic_chunks, HANDED, loop_session, project_lock, starting
|
||||
from loop_claude.chunk import chunk_items
|
||||
from git_cli.git_repo import default_ref
|
||||
from loop_effects.effects import Effects, say
|
||||
@@ -161,6 +161,6 @@ def held_beside(chunk: str, root: str, paths: Paths, effects: Effects) -> list[i
|
||||
|
||||
|
||||
def wait_for_starts(root: str, home: pathlib.Path) -> None:
|
||||
"""Returns once no loop of the project is starting windows: start_chunks holds LOCK while it starts them. Where the lock cannot be taken, it returns at once."""
|
||||
"""Returns once no loop of the project is starting windows: start_chunks holds the lock file `claims.LOCK` names while it starts them. Where the lock cannot be taken, it returns at once."""
|
||||
with starting(project_lock(root, home)):
|
||||
pass
|
||||
|
||||
@@ -41,7 +41,7 @@ class Steps:
|
||||
exec_if_edited: typing.Callable[[Loop, str, LoopRun], Stop | None]
|
||||
next_cycle: typing.Callable[[LoopRun, Loop], Cycle | Stop]
|
||||
run_cycle: typing.Callable[[Cycle], Stop | Concluded]
|
||||
closed_cycle: typing.Callable[[LoopRun, ProjectRung | None, Concluded, pathlib.Path, str, Loop], LoopRun | Stop]
|
||||
closed_cycle: typing.Callable[[LoopRun, str, ProjectRung | None, Concluded, pathlib.Path, str, Loop], LoopRun | Stop]
|
||||
check_routing: typing.Callable[[pathlib.Path, Rung, Loop], Stop | None]
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ def run_loop(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launc
|
||||
concluded = steps.run_cycle(cycle)
|
||||
if isinstance(concluded, Stop):
|
||||
return concluded
|
||||
closed = steps.closed_cycle(loop_run, cycle.project, concluded, cycle.project_archive, fresh_prompt.DRIVER, loop)
|
||||
closed = steps.closed_cycle(loop_run, cycle.task, cycle.project, concluded, cycle.project_archive, fresh_prompt.DRIVER, loop)
|
||||
if isinstance(closed, Stop):
|
||||
return closed
|
||||
loop_run = closed
|
||||
|
||||
@@ -194,8 +194,8 @@ class WindowStarts(unittest.TestCase):
|
||||
|
||||
def test_a_window_loop_hands_each_step_of_a_cycle_what_the_steps_before_it_made(self):
|
||||
env = {"TMUX_PANE": "%4", "LOOP_CLAUDE_TRANSCRIPTS": "/t"}
|
||||
on_ladder = unittest.mock.Mock(project=OPUS_PROJECT, project_archive=pathlib.Path("/t/r"))
|
||||
off_ladder = unittest.mock.Mock(project=None, project_archive=pathlib.Path("/t/r"), route=unittest.mock.Mock(rung=Rung("my-model")))
|
||||
on_ladder = unittest.mock.Mock(task="the cycle's task", project=OPUS_PROJECT, project_archive=pathlib.Path("/t/r"))
|
||||
off_ladder = unittest.mock.Mock(task="the cycle's task", project=None, project_archive=pathlib.Path("/t/r"), route=unittest.mock.Mock(rung=Rung("my-model")))
|
||||
stop, calls = self.window_loop([on_ladder, off_ladder, Stop(2, "the human is needed")], env)
|
||||
self.assertEqual(stop, Stop(2, "the human is needed"))
|
||||
before, first, second, third = (main.LoopRun(number, "/r", "do it", "", unfinished_run=max(number - 1, 0), chunk="item-3") for number in range(4))
|
||||
@@ -204,12 +204,12 @@ class WindowStarts(unittest.TestCase):
|
||||
("exec_if_edited", self.loop, "print-1", before),
|
||||
("next_cycle", first, self.loop),
|
||||
("run_cycle", on_ladder),
|
||||
("closed_cycle", first, OPUS_PROJECT, self.unfinished, pathlib.Path("/t/r"), "loop-claude", self.loop),
|
||||
("closed_cycle", first, "the cycle's task", OPUS_PROJECT, self.unfinished, pathlib.Path("/t/r"), "loop-claude", self.loop),
|
||||
("check_routing", pathlib.Path("/t"), Rung("claude-opus-5-5", "medium"), self.loop),
|
||||
("exec_if_edited", self.loop, "print-1", dataclasses.replace(first, unfinished_run=1)),
|
||||
("next_cycle", second, self.loop),
|
||||
("run_cycle", off_ladder),
|
||||
("closed_cycle", second, None, self.unfinished, pathlib.Path("/t/r"), "loop-claude", self.loop),
|
||||
("closed_cycle", second, "the cycle's task", None, self.unfinished, pathlib.Path("/t/r"), "loop-claude", self.loop),
|
||||
("check_routing", pathlib.Path("/t"), Rung("my-model"), self.loop),
|
||||
("exec_if_edited", self.loop, "print-1", dataclasses.replace(second, unfinished_run=2)),
|
||||
("next_cycle", third, self.loop),
|
||||
|
||||
Reference in New Issue
Block a user