Resolve every cited CLAUDE.md heading in a test
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@
|
||||
- `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. This repo runs on Fable 5.1.
|
||||
- Reviewers share one protocol for verdicts, severities, rounds and declines: `agents/review-protocol.md`.
|
||||
- Skills and agents cite `CLAUDE.md` by heading; the comment and documentation bar lives there alone.
|
||||
- Skills and agents cite `CLAUDE.md` by heading, and a test resolves each citation; the comment and documentation bar lives there alone.
|
||||
- Update a main checkout with `git pull --ff-only`, never `--autostash`.
|
||||
- One word per concept across `CLAUDE.md`, the agents, the skills and `loop-claude`, each defined once under `CLAUDE.md` → "Vocabulary" and cited from where it is used.
|
||||
- `settings.json`, the agents and the status line name no machine-specific path; the status line shows reset times in the host's time zone.
|
||||
|
||||
@@ -25,7 +25,7 @@ Rename `## Unreleased` in `CHANGELOG.md` to the version, commit, and tag that co
|
||||
|
||||
- `loop-claude <task>` runs a project's next chunk cycle after cycle; `loop-claude --help` states its contract.
|
||||
|
||||
Test: `python3 -m unittest bin/test_loop_claude.py`
|
||||
Test: `python3 -m unittest discover -s bin -p 'test_*.py'`
|
||||
|
||||
## Tracking a new file
|
||||
|
||||
|
||||
@@ -34,6 +34,6 @@ A reviewer honours an accepted risk in `docs/decisions.md` and a finding decline
|
||||
|
||||
## Documenting decisions
|
||||
|
||||
Knowledge that outlives one review goes in the repo, never in a memory file: `docs/decisions.md` for every standing decision — accepted risks, declined findings, deliberate deviations, rejected alternatives — and otherwise where `~/.claude/CLAUDE.md` → "Ask, don't guess" and "Comments and documentation" put its kind.
|
||||
Knowledge that outlives one review goes in the repo, never in a memory file: `docs/decisions.md` for every standing decision — accepted risks, declined findings, deliberate deviations, rejected alternatives — and otherwise where `~/.claude/CLAUDE.md` → "Working loop", "Ask, don't guess", and "Comments and documentation" put its kind.
|
||||
|
||||
Create the file if it is missing; fix it if it is wrong. Record only decisions the human made and declines made under Declining, plus answers the human gives to ❓ — an unrecorded answer gets asked again next review. Default to recording nothing: never what a change did, never a narration of one symbol, file or test.
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import pathlib
|
||||
import re
|
||||
import subprocess
|
||||
import unittest
|
||||
|
||||
ROOT = pathlib.Path(__file__).resolve().parents[1]
|
||||
CITATION = re.compile(r'CLAUDE\.md`?[ ,→]+"([^"]+)"')
|
||||
HEADING = re.compile(r"^#+ (.+?)(?: \(.*\))?$", re.MULTILINE)
|
||||
|
||||
|
||||
class Citations(unittest.TestCase):
|
||||
def test_every_cited_heading_is_in_claude_md(self):
|
||||
headings = set(HEADING.findall((ROOT / "CLAUDE.md").read_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())]
|
||||
self.assertTrue(cited)
|
||||
self.assertEqual([f"{path}: {heading}" for path, heading in cited if heading not in headings], [])
|
||||
@@ -4,11 +4,10 @@
|
||||
|
||||
Ordered by how many seats of the 2026-09-24 scoring panel (`docs/decisions.md`) named the place; each is one chunk.
|
||||
|
||||
- Pin every `CLAUDE.md` heading the agents and skills cite with a test that resolves each citation.
|
||||
- Define chunk, plan and release inside `JUDGE_RULES`; the judge reads nothing else.
|
||||
- Name the `set -u` empty-array idiom and the `@sh` eval in `statusline.sh`, one line each.
|
||||
- Make `CLAUDE.md`'s comment rules say an invariant earns a line only where the code cannot show it, state the one-line rule once, and scope the docstring exemption to what a tool consumes; today a reviewer finds two sentences saying keep and one saying delete.
|
||||
- Open `CLAUDE.md` → "Negation and history" with its scope, comments and docs beside code, and cut its two restatements of the section bar; today a reviewer cites it against a `CHANGELOG.md` line, which the next paragraph governs.
|
||||
- Open `CLAUDE.md` → "Comments and documentation", "Negation and history", with its scope, comments and docs beside code, and cut its two restatements of the section bar; today a reviewer cites it against a `CHANGELOG.md` line, which the next paragraph governs.
|
||||
- Give the comprehension floor in `larv-review` its own heading and move its six-project calibration sentence to `docs/decisions.md`; today it sits under §2 "Trigger".
|
||||
- Cut what `review-protocol.md` → "Documenting decisions" restates from `CLAUDE.md`: the decision kinds, the create-or-fix line and the record-nothing default.
|
||||
- Make the missing-premises exit name what is missing: `README.md` itself, a `## Goals` or `## Audience` heading, or a body under one; today all three print the same line.
|
||||
|
||||
Reference in New Issue
Block a user