Run every claude the loop starts in a Claude home generated outside the clone
CI / tests (pull_request) Successful in 4m45s
CI / tests (pull_request) Successful in 4m45s
This commit is contained in:
@@ -24,6 +24,7 @@ from transcript_archive.read import latest_worker
|
||||
from chunk_driver.this_loop import Loop
|
||||
from transcript_archive.project_key import project_key
|
||||
from model_routing.ladder_file import project_ladder_file, read_ladder
|
||||
from loop_state.paths import RELEASE_ROOT
|
||||
from model_routing.route import Route, route_from
|
||||
from loop_effects.effects import say
|
||||
from agent_cycle.stop import Stop
|
||||
@@ -95,13 +96,13 @@ def archived_route(archive_folder: pathlib.Path, loop: Loop) -> Route | None:
|
||||
|
||||
def cycle_of(loop: Loop, routing: Routing, route: Route, archive_folder: pathlib.Path, *, task: str, facts: str, premises: str, records: str, unfinished_evidence: str, prompts: WorkerPrompts, taken_in: typing.Callable[[list[Entry]], TakenIn]) -> Cycle:
|
||||
"""The cycle that runs in the loop's window on route. The keyword arguments are what the entry point alone knows; Cycle says what each is."""
|
||||
return Cycle(config=setup_version(loop.paths.claude_dir, loop.effects.git), effects=loop.effects, facts=facts, judge=judge_rung(routing.ladder, routing.models.judge), premises=premises, project=routing.project, project_archive=archive_folder, records=records, root=loop.root, route=route, session=loop.session, task=task, prompts=prompts, taken_in=taken_in, unfinished_evidence=unfinished_evidence, window=loop.window)
|
||||
return Cycle(config=setup_version(RELEASE_ROOT, loop.effects.git), effects=loop.effects, facts=facts, judge=judge_rung(routing.ladder, routing.models.judge), premises=premises, project=routing.project, project_archive=archive_folder, records=records, root=loop.root, route=route, session=loop.session, task=task, prompts=prompts, taken_in=taken_in, unfinished_evidence=unfinished_evidence, window=loop.window)
|
||||
|
||||
|
||||
def setup_version(claude_dir: pathlib.Path, git: Git) -> str:
|
||||
"""The release and commit of this setup that the worker's claude reads, as `v0.8.0 (<sha>)`; a commit past the latest release reads as git describe gives it, such as `v0.8.0-3-g1a2b3c4 (<sha>)`. Where git can't tell, `unknown` and why."""
|
||||
described = git("describe", "--tags", "--match", "v*", "--always", cwd=str(claude_dir))
|
||||
commit = git("rev-parse", "HEAD", cwd=str(claude_dir))
|
||||
def setup_version(clone: pathlib.Path, git: Git) -> str:
|
||||
"""The release and commit of clone, the setup the worker's claude reads through its home's links, as `v0.8.0 (<sha>)`; a commit past the latest release reads as git describe gives it, such as `v0.8.0-3-g1a2b3c4 (<sha>)`. Where git can't tell, `unknown` and why."""
|
||||
described = git("describe", "--tags", "--match", "v*", "--always", cwd=str(clone))
|
||||
commit = git("rev-parse", "HEAD", cwd=str(clone))
|
||||
if isinstance(described, Failure):
|
||||
return unknown_version(described)
|
||||
if isinstance(commit, Failure):
|
||||
|
||||
@@ -21,7 +21,7 @@ from loop_effects.doubles import FakeEffects, NOW, STAMP
|
||||
from git_cli import git_repo
|
||||
from chunk_driver.project.model_choice import Models
|
||||
from transcript_archive import outcomes, write
|
||||
from loop_state.paths import paths_from
|
||||
from loop_state.paths import paths_from, RELEASE_ROOT
|
||||
from model_routing.ladder import ProjectRung, Rung
|
||||
from model_routing.ladder_file import read_ladder, SHIPPED
|
||||
from text_files.file_writes import replace_file
|
||||
@@ -148,7 +148,7 @@ class CycleStart(unittest.TestCase):
|
||||
cycle = cycle_start.cycle_of(loop, self.ROUTING, route, archive, task="the task", facts="the facts", premises="the premises", records="the records", unfinished_evidence="the evidence", prompts=prompts, taken_in=taken_in)
|
||||
self.assertEqual(cycle, Cycle(config="v0.1.0 (abc)", effects=effects, facts="the facts", judge=Rung("judge-model"), premises="the premises", project=OPUS_PROJECT, project_archive=archive, records="the records", root="/r",
|
||||
route=route, session=loop.session, task="the task", prompts=prompts, taken_in=taken_in, unfinished_evidence="the evidence", window=loop.window))
|
||||
self.assertEqual(asked, ["/h/.claude", "/h/.claude"])
|
||||
self.assertEqual(asked, [str(RELEASE_ROOT), str(RELEASE_ROOT)])
|
||||
|
||||
|
||||
class Routes(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user