diff --git a/AGENTS.md b/AGENTS.md index 06b1c8ca..ee700c08 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,3 +11,4 @@ Decisions live in `docs/decisions.md`: - comprehension floor: the 2026-09-25 four-seat score is the ratchet, and 0.1.0 waits on what caps it - larv-review: a re-entered loop takes a fresh round cap - vocabulary: the concept words are defined under `CLAUDE.md` → "Vocabulary" and cited by a bare link +- loop-claude: a CR-only README.md is reported at line 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 79fde370..21782057 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,4 +13,4 @@ - `loop-claude --help` names the Claude Code version its transcript, session and trust handling were observed on; check it first when an upgrade breaks a cycle. - `loop-claude` runs the model each project's settings pick; `LOOP_CLAUDE_WORKER_MODEL` and `LOOP_CLAUDE_JUDGE_MODEL` override it. - `settings.json`, the agents and the status line run on any machine unedited; the status line shows reset times in the machine's own time zone. -- `loop-claude`'s no-premises exit names what is wrong: `README.md` the OS cannot open, a `## Goals` or `## Audience` heading missing or repeated, or nothing under one. +- `loop-claude`'s no-premises exit names what is wrong: `README.md` unopenable or not UTF-8, a `## Goals` or `## Audience` heading missing or repeated, or nothing under one. diff --git a/bin/loop-claude b/bin/loop-claude index 4afdffda..56d2a54f 100755 --- a/bin/loop-claude +++ b/bin/loop-claude @@ -165,6 +165,9 @@ def read_premises(root): found = sections(open(os.path.join(root, "README.md"), encoding="utf-8").read()) except OSError as failure: sys.exit(f"README.md in {root}: {failure.strerror} - no premises.") + except UnicodeDecodeError as failure: + line = failure.object.count(b"\n", 0, failure.start) + 1 + sys.exit(f"README.md is not UTF-8 on line {line} - no premises.") for name in ("Goals", "Audience"): bodies = found.get(name, []) if not bodies: diff --git a/bin/test_loop_claude.py b/bin/test_loop_claude.py index ffe8742f..ac03aafc 100644 --- a/bin/test_loop_claude.py +++ b/bin/test_loop_claude.py @@ -57,6 +57,8 @@ class ReadPremises(unittest.TestCase): os.mkdir(readme) self.assertIn("Is a directory", self.exit_message(root)) os.rmdir(readme) + open(readme, "wb").write(b"# T\n## Goals\n1. g\xff\n## Audience\nme\n") + self.assertIn("README.md is not UTF-8 on line 3", self.exit_message(root)) for text, missing in texts.items(): with self.subTest(missing=missing): open(readme, "w").write(text) diff --git a/docs/decisions.md b/docs/decisions.md index 3fe13416..9764e8a5 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -35,3 +35,7 @@ ## loop-claude: a reload into an older file is unsupported 2026-09-26, lilleman. Serves goal 4. A running loop whose `bin/loop-claude` on disk is rolled back to a version with an older handover dies with a traceback in that older file, which this version cannot change; the human who rolled it back reruns `loop-claude `. Valid while nobody but the developer runs it: other team members running it while it is still developed reopens this. + +## loop-claude: a CR-only README.md is reported at line 1 + +2026-09-26, larv-review. Serves goal 4. The line of a non-UTF-8 byte counts `\n`, so a file with classic-Mac `\r` endings reports line 1 whatever line an editor shows; no machine the audience runs writes such a file. Valid while the audience is the author's own machines. diff --git a/todo.md b/todo.md index ee8aea46..9cc11111 100644 --- a/todo.md +++ b/todo.md @@ -4,6 +4,6 @@ Ordered by how many seats of the 2026-09-25 scoring panel (`docs/decisions.md`) named the place; each is one chunk. -- Exit `loop-claude` with a message, today a traceback, when `README.md` is not UTF-8. - Say under `CLAUDE.md` → "One spelling per goal" that one spelling in two places is the same case, and what its rejection names. - Say `could not read` when `~/.claude.json` parses to anything but an object whose `projects` maps paths to objects, today a traceback before the interrupt. +- State in `docs/decisions.md` the oldest Python `bin/` must parse on, today unstated and 3.11 by the last review.