Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .claude/agents/coherence-auditor.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,18 @@ Read first: `CLAUDE.md`, `docs/design.md`, `docs/roadmap.md`, the latest report
- every commit after 79025cd (audit 0010) follows an APPROVED verdict that a comment ties to
it. Earlier commits predate the rule. The one exception is an audit report: a commit that
adds only one file under `docs/audits/` (check with `git show --stat`);
- every finding of the previous audit and of the reviews is closed in one of three ways:
- for every such commit from 2852907 on, the tree in its last APPROVED verdict comment
equals `git rev-parse <commit>^{tree}`. The comment that names the commit quotes the same
tree. From 39635f6 on, the verdict comment also quotes the subject line. It equals
`git log -1 --format=%s <commit>`;
- every finding of the previous audit and of the reviews is closed in one of these ways:
- fixed and reviewed;
- written into the roadmap step that will fix it;
- declared wrong by the owner, with the reason in a PR comment;
- every minor point a verdict comment lists as moved to the next PR is fixed, or written into
a roadmap step, by the first commit of that PR.
- for a point on the message of a pushed commit, a note in the message of a later commit;
- every minor point a verdict comment lists as moved is closed, in one of the ways above, by
the commit it moved to. That is the next commit of the same PR, or the first commit of the
next PR.
7. Health. Run `cargo fmt --check`, `cargo clippy --all-targets -- -D warnings`,
`cargo nextest run`, `cargo test --doc` and `cargo deny check`. Report the actual results.

Expand Down
32 changes: 21 additions & 11 deletions .claude/agents/fable-reviewer.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: fable-reviewer
description: Independent reviewer on a different model (Fable), of equal or higher capability than the author's. Use after each TDD cycle (red -> green -> refactor), on the uncommitted changes before every commit (the audit report is the one exception), and again after every fix, to certify that the tests express the requirements in docs/design.md and that the code is correct. Read-only: it reports, it never edits.
description: Independent reviewer on a different model (Fable), of equal or higher capability than the author's. Use it on the uncommitted changes before every commit; the audit report is the one exception. Use it after each TDD cycle (red -> green -> refactor) and again after every fix. It certifies that the tests express the requirements in docs/design.md and that the code is correct. Read-only: it reports, it never edits.
model: fable
tools: Read, Grep, Glob, Bash
---
Expand Down Expand Up @@ -77,9 +77,11 @@ The brief holds:
- can write a document outside the selected folder;
- lets `--plan` write or download anything;
- treats a non-terminal input as a yes;
- confirms anything from a script (only `check` in an ordinary run, `check --plan`,
`extract --plan` in an ordinary run, and the `--plan` lists of `undo`, the menus and
`uninstall` run there);
- confirms anything from a script. Only these run from a script:
- `check` in an ordinary run;
- `check --plan`;
- `extract --plan` in an ordinary run;
- the `--plan` lists of `undo`, the menus and `uninstall`;
- judges time from the signer's claimed signing time;
- skips the native dialog of a context-menu run;
- counts several selected folders wrongly (a row each, the total typed, overlaps counted
Expand All @@ -101,9 +103,12 @@ The brief holds:
6. Nothing reaches the public repository that could carry personal or sensitive data (see the
section "What may never reach the public repository?" of `CLAUDE.md`). No mode of the public
check reads the working tree: `--staged` reads the index, and you must not touch the
repository's index. Copy the repository to the scratchpad (without `target/`, `tests/corpus/`
and `tests/out/`), run `git add -A` in the copy, then `sh scripts/check-public.sh --staged`
there. Check the planned commit message with `sh scripts/check-public.sh --message <file>`.
repository's index. Copy the repository to the scratchpad (without `target/`, `tests/corpus/`,
`tests/out/` and `.claude/worktrees/`), run `git add -A` in the copy, then
`sh scripts/check-public.sh --staged` there. Check the planned commit message with
`sh scripts/check-public.sh --message <file>`.
In the same copy, run `git write-tree` and report the tree: it ties your verdict to the
commit (`CLAUDE.md`, step 5).

## How is TDD proved?

Expand All @@ -123,7 +128,12 @@ fails. Report every rule whose breakage no test notices.

## What does the report look like?

Start with one line: `VERDICT: APPROVED` or `VERDICT: CHANGES NEEDED`. Then list the findings,
most severe first. Each has `file:line`, what is wrong, a concrete input or scenario that shows
it, and the suggested fix. Separate "bug" from "missing test" from "minor". No praise, no
summary of what the code does. Write the report in English.
Start with one line: `VERDICT: APPROVED` or `VERDICT: CHANGES NEEDED`. The next line gives the
tree of the reviewed copy: `TREE: <hash>`. Then list the findings, most severe first. Each has
`file:line`, what is wrong, a concrete input or scenario that shows it, and the suggested fix.
Separate "bug" from "missing test" from "minor". No praise, no summary of what the code does.
Write the report in English.

When every finding is minor, the verdict is `VERDICT: APPROVED`, with the minor points listed.
Mark each point on personal data, or on confirmation or writing files (R28–R34): such a point
never moves. It is fixed and reviewed before the commit (`CLAUDE.md`, step 5).
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@

.DS_Store

# Claude Code personal settings
# Claude Code personal settings, and worktrees of agents working in parallel
/.claude/settings.local.json
/.claude/worktrees/
65 changes: 45 additions & 20 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ the CI workflow. There is no exception for "infrastructure".
Rules that protect (scripts under `scripts/`, safety code) are also checked by breaking each
rule on a copy and seeing at least one test fail. A rule that no test notices gets a test.
One exception, decided by the owner: in the "Rust" section of `audit-status.sh`, a breakage
that shows no bug is listed, not tested (`docs/roadmap.md`, 0.5).
that shows no bug is listed, not tested. The other known limits of the rule scripts are
listed in `docs/roadmap.md`, 0.5; the owner marked that step done with them listed.
5. Independent review, by a newly started `fable-reviewer` agent for every review: a different
model, of equal or higher capability than the author's. Never resume the reviewer. The brief
holds only:
Expand All @@ -37,22 +38,35 @@ the CI workflow. There is no exception for "infrastructure".

Never give the reviewer other conclusions of the author or earlier findings. The owner
decided the brief and these rules on 2026-11-24:
- It reviews the uncommitted changes, before the commit. After CHANGES NEEDED, the fixed
changes get a new review.
- The reviewer reviews the uncommitted changes, before the commit. After CHANGES NEEDED, the
fixed changes get a new review.
- Commit and push only when the checks are complete. The review must be APPROVED. When a
coherence audit is due, it runs first, and each of its findings must be closed.
- A finding of a review or an audit is closed in one of three ways:
- A finding of a review or an audit is closed in one of these ways:
- fixed and reviewed;
- written into the roadmap step that will fix it;
- declared wrong by the owner, with the reason in a PR comment.
- declared wrong by the owner, with the reason in a PR comment;
- for a point on the message of a commit already pushed, a note in the message of a later
commit. History is not rewritten.
- The audit report is committed alone first, without a `fable-reviewer` review. It is pushed
with the commit that closes its findings, or alone when no commit is needed.
- Minor rounds have a limit. A round that is APPROVED with only minor points is a minor
round. After the third minor round on the same changes, the minor points left move to the
next PR, and no new round runs for them. Its verdict comment lists them as moved. The first
commit of the next PR fixes them or writes them into the roadmap step that will fix them.
- Some points never move: bugs, missing tests, and points on personal data, confirmation or
writing files (R28–R34). They are fixed and reviewed.
round. The count is of the minor rounds before one commit. A CHANGES NEEDED round in
between does not restart it; the next commit starts a new count. After the third minor
round, the minor points left move on. Those of the third round move too. No new round runs
for them. They move to the next commit of the same PR when the author plans more commits
in it (owner's decision, 2026-11-24). Otherwise they move to the first commit of the next
PR. The verdict comment of that round lists them as moved. The commit they move to fixes
them or writes them into the roadmap step that will fix them. For a point on the message
of a pushed commit, that commit carries the note.
- Some points never move: bugs, missing tests, and points on personal data, or on
confirmation or writing files (R28–R34). They are fixed and reviewed before the commit.
- The review leaves a trace of what it approved. The reviewer reports the tree of its
staged copy (`git write-tree`). The verdict comment quotes it, with the subject line of the
reviewed commit message. After the commit, `git rev-parse HEAD^{tree}` must give the same
tree. If it does not, nothing is pushed. Undo the commit with `git reset --soft HEAD~1`,
which keeps the changes, and send them to a new review. The comment that names the commit
quotes the tree too.

Post every verdict as a comment on the pull request, as soon as the PR exists: APPROVED or
CHANGES NEEDED, the findings in short, how each was closed. After the commit, a comment names
Expand Down Expand Up @@ -83,17 +97,18 @@ With the six rules below. Long work across sessions drifts: docs claim things th
do, references point to functions or options that never existed, work is left half-done.

- Session start: run `sh scripts/audit-status.sh` and tell the user what it shows. Unfinished
work comes first: uncommitted changes, stashes, unpushed commits, unmerged branches, open or
draft PRs, red CI. Finish it, or close it with a written reason, before starting anything new.
work comes first. Finish it, or close it with a written reason, before starting anything new.
Unfinished work is: uncommitted changes, stashes, unpushed commits, unmerged branches, open or
draft PRs, red CI.
- Branches and PRs (after the first push): one branch per roadmap step
(`step/1.1-portable-names`), pushed early as a draft PR. Mark it ready only when CI is green
on all four jobs (read in the job list, never assumed from a pending run) and `fable-reviewer`
approved, with its verdict posted on the PR. Merge it into `main` locally by fast-forward:
`git switch main && git merge --ff-only step/x && git push`. The merged commits are the same
ones CI checked, history stays linear and the pre-push hook runs. The GitHub merge button is
not used: it rewrites commits. One step is open at a time. A session never ends with a draft
PR without a comment saying its state and next step. Abandoned work is closed with the reason,
never left open.
(`step/1.1-portable-names`), pushed early as a draft PR. Mark it ready only when two things
hold. CI is green on all four jobs, read in the job list, never assumed from a pending run.
`fable-reviewer` approved, with its verdict posted on the PR. Merge it into `main` locally by
fast-forward: `git switch main && git merge --ff-only step/x && git push`. The merged commits
are the same ones CI checked, history stays linear and the pre-push hook runs. The GitHub merge
button is not used: it rewrites commits. One step is open at a time. A session never ends with
a draft PR without a comment saying its state and next step. Abandoned work is closed with the
reason, never left open.
- Every 5 commits, a coherence audit by the `coherence-auditor` agent (Fable, a different model
of equal or higher capability than the author's, fresh context, read-only). It checks
requirements, tests and code against each other, the existence of every concrete reference,
Expand All @@ -112,6 +127,16 @@ do, references point to functions or options that never existed, work is left ha
only lists them. The main session runs the removing form after an audit; agents (auditor,
reviewer) run only `sh scripts/cleanup.sh --plan`.
- Worktrees, backups (`*.bak`), editor files and other untracked files are only listed.
- Agents that work in parallel each get a git worktree under `.claude/worktrees/` (ignored by
git). They never commit there; the main session takes their changes as a patch. When the
changes are committed, the main session removes the worktree and its branch, locally.
First it compares the worktree with the patch it took, with these two commands:
- `git -C <worktree> diff HEAD`;
- `git -C <worktree> status --porcelain --untracked-files=all`.

A change made after the patch is taken again or reported, never lost. Then
`git worktree remove --force` and `git branch -D`. `--force` is needed because the worktree
still has uncommitted files.
- Ignored folders are never touched. `tests/corpus/`, `tests/out/` and `target/` are protected
even if `.gitignore` lacks them.
- Deletion happens only locally, from the development environment, never on GitHub. Merged
Expand Down
Loading
Loading