Say a repeated heading appears more than once, a count the exit does not check

This commit is contained in:
2026-09-25 08:29:38 +02:00
parent 33621cc6ff
commit b52cecb895
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -20,4 +20,4 @@
- `CLAUDE.md`'s negation rule opens with its scope: prose describing the code as it stands.
- `larv-review`'s comprehension floor has its own heading under the architecture pass; why a project under it is fixed at the capping dimension is a decision in `docs/decisions.md`.
- `review-protocol.md` says only what a reviewer records; the decision log's home and shape stay under `CLAUDE.md`.
- `loop-claude`'s no-premises exit names what is wrong: `README.md` unreadable, a `## Goals` or `## Audience` heading missing or repeated, or nothing under one.
- `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.
+1 -1
View File
@@ -106,7 +106,7 @@ def read_premises():
if not bodies:
sys.exit(f"README.md has no ## {name} heading - no premises.")
if len(bodies) > 1:
sys.exit(f"README.md has ## {name} twice - no premises.")
sys.exit(f"README.md has ## {name} more than once - no premises.")
if not bodies[0]:
sys.exit(f"README.md has nothing under ## {name} - no premises.")
return f"## Goals\n{found['Goals'][0]}\n\n## Audience\n{found['Audience'][0]}"
+1 -1
View File
@@ -45,7 +45,7 @@ class ReadPremises(unittest.TestCase):
"# T\n## Goals\n\n## Audience\nme\n": "nothing under ## Goals",
"# T\n## Goals\n1. g\n": "no ## Audience heading",
"# T\n## Goals\n1. g\n## Audience\n": "nothing under ## Audience",
"# T\n## Goals\n1. g\n## Audience\nme\n## Goals\n": "## Goals twice",
"# T\n## Goals\n1. g\n## Audience\nme\n## Goals\n": "## Goals more than once",
}
with tempfile.TemporaryDirectory() as root, contextlib.chdir(root):
self.assertIn(f"README.md in {os.getcwd()}: No such file or directory", self.exit_message())