Title each decision by what holds now, and make the small fixes filed against bin/, the README, .gitignore and stability-reviewer

This commit is contained in:
2026-10-01 22:32:44 +02:00
parent c260a24ff7
commit 471b86db5e
15 changed files with 73 additions and 46 deletions
+13 -7
View File
@@ -6,6 +6,8 @@ import subprocess
import sys
import typing
from loop_claude.outcome import Stop
RELOAD_FLAG = "--reloaded"
T = typing.TypeVar("T")
@@ -42,11 +44,15 @@ def fingerprint(launcher) -> str:
return digest.hexdigest()
def exec_if_edited(launcher, baseline, state) -> None:
def exec_if_edited(launcher, baseline, state) -> Stop | None:
if fingerprint(launcher) == baseline:
return
trial = subprocess.run([sys.executable, launcher, "--help"], capture_output=True, text=True)
if trial.returncode != 0:
print(f"keeping the running script: {trial.stderr.strip() or f'exit {trial.returncode}'}", file=sys.stderr)
return
os.execv(sys.executable, [sys.executable, str(launcher), RELOAD_FLAG, json.dumps(dataclasses.asdict(state))])
return None
try:
trial = subprocess.run([sys.executable, launcher, "--help"], capture_output=True, text=True)
if trial.returncode != 0:
print(f"keeping the running script: {trial.stderr.strip() or f'exit {trial.returncode}'}", file=sys.stderr)
return None
os.execv(sys.executable, [sys.executable, str(launcher), RELOAD_FLAG, json.dumps(dataclasses.asdict(state))])
except OSError as failure:
return Stop(1, f"could not reload loop-claude: {failure.strerror}; rerun loop-claude <task>")
return None