From 816bbfc3138a4573d5738023559d6f28930887b2 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 25 Sep 2026 00:27:48 +0200 Subject: [PATCH] Resolve every name in a citation and pin the arrow spelling --- bin/loop-claude | 2 +- bin/test_citations.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/loop-claude b/bin/loop-claude index 8f611926..6d469e78 100755 --- a/bin/loop-claude +++ b/bin/loop-claude @@ -7,7 +7,7 @@ Run it in a project checkout whose README.md has ## Goals and ## Audience, the p a worker runs the task; a judge then reads the transcript against them. A question only the human can answer, or a release ready to cut, is an interrupt: `claude --resume` on the terminal. An unfinished chunk resumes the same session next cycle; a finished one starts a fresh session. Cycles -continue until that interrupt or Ctrl-C. Words: ~/.claude/CLAUDE.md, "Vocabulary". +continue until that interrupt or Ctrl-C. Words: ~/.claude/CLAUDE.md → "Vocabulary". Exit 1: no task, no premises, claude leaves no transcript, or the worker or the judge fails three times running, a verdict missing a field or quoting nothing in the transcript being a judge failure. diff --git a/bin/test_citations.py b/bin/test_citations.py index fafb6d8b..a053230e 100644 --- a/bin/test_citations.py +++ b/bin/test_citations.py @@ -4,14 +4,18 @@ import subprocess import unittest ROOT = pathlib.Path(__file__).resolve().parents[1] -CITATION = re.compile(r'CLAUDE\.md`?[ ,→]+"([^"]+)"') +CITATION = re.compile(r'`?CLAUDE\.md`? → ("[^"]+"(?:,? (?:and )?"[^"]+")*)') HEADING = re.compile(r"^#+ (.+?)(?: \(.*\))?$", re.MULTILINE) +LEAD = re.compile(r"^(?:- )?\*\*(.+?)(?:\*\*|[:.]| —)", re.MULTILINE) +NAME = re.compile(r'"([^"]+)"') class Citations(unittest.TestCase): - def test_every_cited_heading_is_in_claude_md(self): - headings = set(HEADING.findall((ROOT / "CLAUDE.md").read_text())) + def test_every_citation_names_a_heading_then_headings_or_bold_leads_of_claude_md(self): + text = (ROOT / "CLAUDE.md").read_text() + headings = set(HEADING.findall(text)) + leads = headings | set(LEAD.findall(text)) tracked = subprocess.run(["git", "ls-files", "-z"], capture_output=True, check=True, cwd=ROOT, text=True).stdout.split("\0") - cited = [(path, heading) for path in filter(None, tracked) for heading in CITATION.findall((ROOT / path).read_text())] + cited = [(path, NAME.findall(run)) for path in filter(None, tracked) for run in CITATION.findall((ROOT / path).read_text())] self.assertTrue(cited) - self.assertEqual([f"{path}: {heading}" for path, heading in cited if heading not in headings], []) + self.assertEqual([f"{path}: {names}" for path, names in cited if names[0] not in headings or set(names[1:]) - leads], [])