Group loop_claude's modules into claude_code, claude_runs and project, and move the findings document beside larv-review

This commit is contained in:
2026-09-28 21:28:41 +02:00
parent 6a1a1d9027
commit 998cc3ac85
26 changed files with 39 additions and 35 deletions
@@ -5,8 +5,8 @@ import shutil
import sys
import uuid
from loop_claude.checkout import project_name
from loop_claude.claude_code import session_files, transcript_path
from loop_claude.project.checkout import project_name
from loop_claude.claude_code.formats import session_files, transcript_path
NAMESPACE = uuid.UUID("64fb586b-d926-4bb3-a44c-c903e86d3eec")
@@ -1,6 +1,6 @@
import json
from loop_claude.claude_code import assistant_parts, human_text, parse, part_text, tool_call
from loop_claude.claude_code.formats import assistant_parts, human_text, parse, part_text, tool_call
from loop_claude.outcome import Failure
@@ -1,7 +1,7 @@
import json
import sys
from loop_claude.claude_code import mark_trusted, trust_records
from loop_claude.claude_code.formats import mark_trusted, trust_records
from loop_claude.file_writes import replace_json
from loop_claude.outcome import Failure
@@ -2,10 +2,10 @@ import subprocess
import sys
from loop_claude import human
from loop_claude.checkout import checkouts
from loop_claude.project.checkout import checkouts
from loop_claude.outcome import Failure, Stop
from loop_claude.transcript import human_turns, read
from loop_claude.trust import trust
from loop_claude.claude_code.transcript import human_turns, read
from loop_claude.claude_code.trust import trust
TO = "answer the question above"
@@ -2,7 +2,7 @@ import itertools
import json
import subprocess
from loop_claude.claude_code import structured_output
from loop_claude.claude_code.formats import structured_output
from loop_claude.outcome import Failure
from loop_claude.retry import stop_or_sleep_a_minute
@@ -1,8 +1,8 @@
import subprocess
from loop_claude.claude_code import assistant_parts, ends_stream, parse
from loop_claude.claude_code.formats import assistant_parts, ends_stream, parse
from loop_claude.outcome import Failure
from loop_claude.transcript import part_line
from loop_claude.claude_code.transcript import part_line
def run_worker(root, args):
+6 -6
View File
@@ -1,14 +1,14 @@
import hashlib
import sys
from loop_claude.checkout import project_name
from loop_claude.project.checkout import project_name
from loop_claude.file_writes import make_private, replace_file
from loop_claude.interrupt import interrupt
from loop_claude.judge import judge
from loop_claude.claude_runs.interrupt import interrupt
from loop_claude.claude_runs.judge import judge
from loop_claude.outcome import Continue, Failure, Stop
from loop_claude.session import delete_session, session_for, transcript_file
from loop_claude.transcript import read, render
from loop_claude.worker import run_worker, worker_args
from loop_claude.claude_code.session import delete_session, session_for, transcript_file
from loop_claude.claude_code.transcript import read, render
from loop_claude.claude_runs.worker import run_worker, worker_args
def run_cycle(root, task, premises, models, paths):
+4 -4
View File
@@ -30,17 +30,17 @@ and read each cycle; a project without an entry, as on its first run, is asked f
LOOP_CLAUDE_JUDGE_MODEL overrides it for the judge, LOOP_CLAUDE_WORKER_MODEL for the worker and the
interrupt; with both set, nothing is asked.
A change to bin/loop-claude or bin/loop_claude/*.py takes effect at the next cycle boundary, once
A change to bin/loop-claude or bin/loop_claude/**/*.py takes effect at the next cycle boundary, once
loop-claude --help succeeds.
"""
import dataclasses
import sys
from loop_claude.checkout import checkout_root
from loop_claude.project.checkout import checkout_root
from loop_claude.cycle import run_cycle
from loop_claude.models import project_models
from loop_claude.project.models import project_models
from loop_claude.outcome import Continue, Failure, Stop
from loop_claude.premises import read_premises
from loop_claude.project.premises import read_premises
from loop_claude.reload import RELOAD_FLAG, decode_state, exec_if_edited, fingerprint
from loop_claude.retry import stop_or_sleep_a_minute
+1 -1
View File
@@ -1,7 +1,7 @@
import dataclasses
import pathlib
from loop_claude.claude_code import locations
from loop_claude.claude_code.formats import locations
@dataclasses.dataclass(frozen=True)
View File
@@ -3,8 +3,8 @@ import json
import sys
from loop_claude import human
from loop_claude.checkout import project_name
from loop_claude.claude_code import catalog
from loop_claude.project.checkout import project_name
from loop_claude.claude_code.formats import catalog
from loop_claude.file_writes import replace_json
from loop_claude.outcome import Stop
+2 -2
View File
@@ -23,12 +23,12 @@ def decode_state(handed, kind):
def fingerprint(launcher):
digest = hashlib.sha256()
for path in [launcher, *sorted((launcher.parent / "loop_claude").glob("*.py"))]:
for path in [launcher, *sorted((launcher.parent / "loop_claude").rglob("*.py"))]:
try:
content = path.read_bytes()
except OSError as failure:
content = str(failure).encode()
digest.update(f"{path.name}\0{len(content)}\0".encode() + content)
digest.update(f"{path.relative_to(launcher.parent)}\0{len(content)}\0".encode() + content)
return digest.hexdigest()