From dbb228ad3b12cc693e53874d012830643d9ccc19 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 24 Sep 2026 23:16:35 +0200 Subject: [PATCH] Name the counters main reads back from a reload, and the baseline it compares against --- bin/loop-claude | 16 ++++++++-------- todo.md | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/bin/loop-claude b/bin/loop-claude index 1a3770a4..a414d5d2 100755 --- a/bin/loop-claude +++ b/bin/loop-claude @@ -42,10 +42,10 @@ import time import uuid ARCHIVE = os.path.expanduser(os.environ.get("AUTO_MODE_TRANSCRIPTS", "~/.claude/auto-mode-transcripts")) -FAILURES = "LOOP_CLAUDE_FAILURES" -CYCLE = "LOOP_CLAUDE_CYCLE" +RELOAD_BASELINE = open(__file__, encoding="utf-8").read() +RELOAD_CYCLE = "LOOP_CLAUDE_CYCLE" +RELOAD_FAILURES = "LOOP_CLAUDE_FAILURES" SESSION_NAMESPACE = uuid.UUID("64fb586b-d926-4bb3-a44c-c903e86d3eec") -SOURCE = open(__file__, encoding="utf-8").read() JUDGE_RULES = ( "Decide whether the human must now be interrupted. ask=true when any of these appear:\n" @@ -338,14 +338,14 @@ def reload_if_edited(cycle_number, failures): except OSError as failure: print(f"keeping the running script: {failure}", file=sys.stderr) return - if source == SOURCE: + if source == RELOAD_BASELINE: return trial = subprocess.run([sys.executable, __file__, "--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.environ[FAILURES] = str(failures) - os.environ[CYCLE] = str(cycle_number) + os.environ[RELOAD_CYCLE] = str(cycle_number) + os.environ[RELOAD_FAILURES] = str(failures) os.execv(sys.executable, [sys.executable, __file__, *sys.argv[1:]]) @@ -354,8 +354,8 @@ def main(): if task in ("", "-h", "--help"): print(__doc__.strip()) sys.exit(0 if task else 1) - failures = int(os.environ.pop(FAILURES, 0)) - cycle_number = int(os.environ.pop(CYCLE, 0)) + cycle_number = int(os.environ.pop(RELOAD_CYCLE, 0)) + failures = int(os.environ.pop(RELOAD_FAILURES, 0)) while True: reload_if_edited(cycle_number, failures) cycle_number += 1 diff --git a/todo.md b/todo.md index 23c87e10..2479bc2b 100644 --- a/todo.md +++ b/todo.md @@ -4,7 +4,6 @@ Ordered by how many seats of the 2026-09-24 scoring panel (`docs/decisions.md`) named the place; each is one chunk. -- Make the re-exec handoff visible in `main`: the counters `reload_if_edited` carries across `os.execv` are named where they are read, and `SOURCE` says it is the reload baseline. - State `larv-review`'s re-entry rules once, including whether ยง6's closing stability round counts against the stability cap. - Decide resume-or-fresh in `run_cycle` from state it owns, and give `interrupt`'s no-tty and nothing-typed outcomes two distinct results. - Give the concept words one definition a reader lands on, cited from where they are used; today three seats found them only in `CHANGELOG.md`'s one-word-per-concept entry.