Skip to content

Roadmap 0.5: remaining gaps in the rule-script tests - #4

Merged
bertalan merged 5 commits into
mainfrom
step/0.5-script-test-gaps
Nov 25, 2026
Merged

bertalan merged 5 commits into
mainfrom
step/0.5-script-test-gaps

Conversation

@bertalan

@bertalan bertalan commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Roadmap 0.5: remaining gaps in the rule-script tests

This PR closes the gaps that the reviews of PR #1, PR #2 and PR #3 found in the tests of the rule scripts (docs/roadmap.md, 0.5). It also closes the minor points that PR #3 moved here.

Planned in this step:

  • first commit: the twelve minor points moved from PR Roadmap 0.4: writing guide #3, and the owner's decisions of 2026-11-24 on how minor rounds are counted and how a point on a pushed commit message is closed;
  • scripts/audit-status.sh: everything that is not green counts as red (owner's decision, 2026-11-24), and the missing tests of the unfinished-work and GitHub sections;
  • scripts/cleanup.sh: tests for the "still merged" check before deletion, a branch created at main, a detached HEAD at an unmerged commit, and checked skip counts;
  • scripts/check-public.sh and the hooks: tests that a failing git command or a crashing check refuses, never passes;
  • the review trace becomes a rule (owner's decision, 2026-11-24): the reviewer reports the tree of the reviewed copy, and the commit must have the same tree.

Each script change is test first. The red and green runs of the script commit are below.

Red and green runs

TDD proof for the scripts commit of this PR (roadmap 0.5). Each script change was made test first; where a test fixes behaviour that was already correct, the red comes from breaking a copy of the script and seeing the test fail.

check-public.sh: nested annotated tags (bug fixed)

Red, before the fix:

FAIL: nested tags: inner message scanned (expected exit 1, got 0)
FAIL: nested tags: push with a leak in the inner tag refused (expected exit 1, got 0)
hooks tests: 39 passed, 2 failed

Green: hooks tests: 41 passed, 0 failed.

check-public.sh: a failing git command stops the check

The code already refused, except for git cat-file -t on a tag: there a failure skipped the tag scan and passed. With the HEAD script and the new tests, red:

FAIL: git cat-file fails on the type of a tag (exit 0, expected 2 ...)

For the other commands, red on broken copies, for example git show ... || cannot changed to || true:

FAIL: git show fails on a staged file (exit 0, expected 2 with "cannot check: cannot read :docs/b.md"; got: fatal: test failure)

Each of show, ls-tree (tip and merge), diff-tree and the new cat-file lines has a breakage that fails a test.

Hooks refuse when a check is missing or crashes

Red on a copy where pre-push blocks only on exit 1 and skips any other exit; all earlier tests stayed green:

FAIL: pre-push: check-public.sh missing refused
FAIL: pre-push: push without check-public.sh refused
FAIL: pre-push: nothing reached the remote without the check
FAIL: pre-push: check-public.sh that cannot run refused

cleanup.sh (tests only)

Red on broken copies:

== merge-base check removed before deletion
FAIL: race 1: listed as merged, then kept
cleanup tests: 79 passed, 6 failed, 0 skipped
== branches with only a creation reflog entry skipped
FAIL: branch created at main: listed for removal
cleanup tests: 81 passed, 9 failed, 0 skipped
== --no-merged through git branch instead of for-each-ref
FAIL: detached unmerged HEAD: only real branches listed
cleanup tests: 89 passed, 1 failed, 0 skipped
== wrong skip counts (3 instead of 4, 2 instead of 1)
FAIL: skip count: the block says 3 checks, it ran 4
cleanup tests: 90 passed, 2 failed, 0 skipped

audit-status.sh: what counts as red

Red, before the change (the old script did no selection):

FAIL: report: red checks selected (not green, not pending) (expected exit 0, got 1)

Red, only the latest attempt counts:

FAIL: report: only the latest attempt of each check counts (expected exit 0, got 1)
scripts tests: 198 passed, 1 failed

Red on copies for the empty-section rule, for example with the "Audit cadence" section made silent:

FAIL: report: 4 commits, no AUDIT DUE (section "Audit cadence" is empty or has "^AUDIT DUE$")

Fixes of the first review (CHANGES NEEDED)

  • A check is keyed on pull request, workflow and name. Red on a copy with the old key ($1 SUBSEP $4): FAIL: report: only the latest attempt of each check counts (198 passed, 1 failed).
  • Equal start times, the type guards and the anchors of the red patterns: each removal on a copy fails the same test (198 passed, 1 failed each).
  • The audit gate when audit-status.sh cannot run: on a copy where both hooks skip exit 2 of the gate, pre-push: audit-status.sh that cannot run refused and pre-commit: ... fail (41 passed, 2 failed).
  • "No warning with hooks" now also checks that the report printed: on a copy that exits before the first section, FAIL: report printed with hooks enabled.

Fixes of the second review (CHANGES NEEDED)

Red, tests only, before the script change (198 passed, 4 failed):

FAIL: report: red checks selected (not green, not pending)
FAIL: report: only the latest attempt of each check counts
FAIL: report: a red status is not hidden by a green check run of the same name
FAIL: report: a failing gh pr list is said

Breakages on copies: the key without the type fails "a red status is not hidden ..."; the old denylist for either type fails the red-selection and latest-attempt tests; the allowlist without its anchor fails the latest-attempt test; a changed "checks not read" line fails "a failing gh pr list is said".

Fixes of the third review (CHANGES NEEDED)

Red, a failing git rev-list --parents over a merge commit (206 passed, 1 failed):

FAIL: git rev-list --parents fails on a merge commit (exit 0, expected 2 with "cannot check: git rev-list failed on <sha>"; got: fatal: test failure ...)

Red, a row of an unknown type (207 passed, 1 failed):

FAIL: report: a row of an unknown type is red unless green or empty (expected exit 0, got 1)

Breakages on copies, one failing test each: the git log, both range git rev-list and the git diff --cached guards changed to || true; the empty-state rule of a status removed; the unknown-type rule disabled, or without its conclusion or its state.

Fixes of the fourth review (CHANGES NEEDED)

Red, tests first, before the script change (210 passed, 8 failed):

FAIL: no warning with the absolute path of .githooks
FAIL: report: only the latest attempt of each check counts
FAIL: report: a finished check with no time is older than one with a time
FAIL: report: red checks named with workflow, empty name said
FAIL: report: a failing gh pr list says open pull requests not read
FAIL: report: a failing gh pr list does not say no open pull requests
FAIL: report: a failing gh run list says CI runs not read
FAIL: report: a failing gh run list does not say no CI runs

Breakages on copies, each failing at least one test: a finished row with no time treated as latest; the anchors of the unknown-type allowlist removed; the not-started rule or its zero-time clause removed; each "not read" line turned back into "no ..."; the workflow prefix or "(no name)" removed; the absolute hooks path never accepted, accepted without the equality check, compared unresolved, or accepted when missing.

Fixes of the fifth review (CHANGES NEEDED)

Red on broken copies:

== tag loop stopped after the second tag
FAIL: three nested tags: innermost message scanned (expected exit 1, got 0)
FAIL: three nested tags: push with a leak in the innermost tag refused (expected exit 1, got 0)
hooks tests: 45 passed, 2 failed
== a finished status with no time treated as not started
FAIL: report: a finished status with no time is older than one with a time (expected exit 0, got 1)
== STALE added to the green values
FAIL: report: a row of an unknown type is red unless green or empty
== only paths starting with / count as absolute
FAIL: no warning with a drive-letter path of .githooks (expected exit 1, got 0)
FAIL: no warning with a drive-letter path, backslash (expected exit 1, got 0)

Fixes of the sixth review (CHANGES NEEDED)

Red on broken copies:

== a green value removed from the unknown-type rule (each of four)
FAIL: report: no red checks, no RED CHECKS line (section "GitHub" is empty or has "RED CHECKS")
== the CI run list or its heading removed
FAIL: report: last CI runs listed under the heading (expected exit 0, got 1)
== "no CI runs on main" removed
FAIL: report: no CI runs said (expected exit 0, got 1)
== "open pull requests:" removed
FAIL: report: open pull requests heading printed (expected exit 0, got 1)
== hooks path compared as a string, not by identity
FAIL: no warning with another spelling of the same folder (expected exit 1, got 0)
== the report exits before its first section
FAIL: report printed with the absolute path of .githooks (expected exit 0, got 1)

Fix of the seventh review (CHANGES NEEDED)

Red on copies where either green list is replaced by the union of both:

FAIL: report: each type has its own green list (expected exit 0, got 1)
scripts tests: 230 passed, 1 failed

Fix of the eighth review (APPROVED, minor points)

A failing gh api for the interaction limit printed "INTERACTION LIMIT NOT ACTIVE". Red, tests first (231 passed, 2 failed):

FAIL: limit: a failing gh api is said (expected exit 0, got 1)
FAIL: limit: a failing gh api is not a missing limit (section "GitHub" is empty or has "INTERACTION LIMIT NOT ACTIVE")

The same two tests fail on a copy where a failing gh api is not recorded.

Fix of the ninth review (APPROVED, minor points)

The test of the expiry warning now matches the whole line, date only. Red on a copy where the date is not cut from the time stamp (232 passed, 1 failed):

FAIL: limit expiring within 30 days (expected exit 0, got 1)

Green, all suites, on the merged changes

scripts tests: 233 passed, 0 failed
cleanup tests: 90 passed, 0 failed, 0 skipped
hooks tests: 47 passed, 0 failed

Red and green runs of the commit that closes audit 0011

TDD proof for the commit that closes audit 0011.

F1: the marker search skips tests/corpus/ and tests/out/

Red, tests first, before the fix (235 passed, 1 failed):

FAIL: markers: fixtures, corpus and output skipped (section "Markers in code" is empty or has "fixtures|corpus|tests/out|extracted")

Breakages on copies, each failing a test: the prune of tests/corpus/ removed; the prune of tests/out/ pointed at another folder; the prune of tests/fixtures/ removed (235 passed, 1 failed each).

Fix of the first review (CHANGES NEEDED): two missing tests

Tests for each marker word and for the file name with a single file to search. These rules were already in the script, so the red comes from breaking copies:

== XXX removed from the pattern
FAIL: markers: listed: src/words.rs:1:// XXX word (expected exit 0, got 1)
FAIL: markers: a single file is named (expected exit 0, got 1)
scripts tests: 239 passed, 2 failed
== #[ignore removed
FAIL: markers: listed: src/words.rs:4:#[ignore] (expected exit 0, got 1)
scripts tests: 240 passed, 1 failed
== todo!( and unimplemented!( removed
FAIL: markers: listed: src/words.rs:2:todo!(a) (expected exit 0, got 1)
FAIL: markers: listed: src/words.rs:3:unimplemented!(b) (expected exit 0, got 1)
scripts tests: 239 passed, 2 failed
== grep -nHE changed to grep -nE
FAIL: markers: a single file is named (expected exit 0, got 1)
scripts tests: 240 passed, 1 failed

Fix of the second review (CHANGES NEEDED): case and binary files

Red, tests first, before the fix (242 passed, 1 failed):

FAIL: markers: cased corpus and output skipped (section "Markers in code" is empty or has "Corpus|OUT|cased")

Red on a copy where the search reads the folders and hides their lines (grep -r ... | grep -Ev '^tests/(fixtures|corpus|out)/'), which prints the names of binary files (241 passed, 2 failed):

FAIL: markers: fixtures, corpus and output skipped (section "Markers in code" is empty or has "fixtures|corpus|tests/out|extracted")
FAIL: markers: cased corpus and output skipped (section "Markers in code" is empty or has "Corpus|OUT|cased")

Fix of the third review (CHANGES NEEDED): every letter in both cases

The cased test now uses tests/CORPUS and tests/OUT, every letter in capitals; the first test has them in lower case. Breakages on copies, each failing the cased test (242 passed, 1 failed each):

== [Cc][Oo][Rr][Pp][Uu][Ss] narrowed to [Cc]orpus
== [Cc][Oo][Rr][Pp][Uu][Ss] turned back into corpus
== [Oo][Uu][Tt] narrowed to [Oo]ut
FAIL: markers: cased corpus and output skipped (section "Markers in code" is empty or has "CORPUS|OUT|cased")
scripts tests: 242 passed, 1 failed

Fix of the fourth review (CHANGES NEEDED): symbolic links

The search did not follow links, so the red comes from breaking copies (244 passed, 1 failed each):

== -o -type f changed to -o -true
FAIL: markers: links into the corpus not followed (section "Markers in code" is empty or has "linked")
== find changed to find -L
FAIL: markers: links into the corpus not followed (section "Markers in code" is empty or has "linked")

Fix of the sixth review (CHANGES NEEDED): never opened, and "none"

A grep stand-in logs each recursive option and each file grep is given; a test checks that no grep is recursive and none is given a corpus or output file. A test checks the "none" line. Red on copies:

== the search reads the folders and hides their lines, unanchored and in any case (grep -rnE ... src tests | grep -viE 'tests/(fixtures|corpus|out)/')
FAIL: markers: grep stand-in was used
FAIL: markers: no recursive grep and no corpus or output file given to grep
== || echo "none" changed to || true
FAIL: markers: none said

Green, all suites

scripts tests: 248 passed, 0 failed
cleanup tests: 90 passed, 0 failed, 0 skipped
hooks tests: 47 passed, 0 failed

State

Draft. The current state and the next step are in the latest comment.

Generated with Claude Code

PR #3 moved twelve minor points to this PR, under the minor-round rule.
This commit closes them.

Review round 13:
- CLAUDE.md, step 5: "It reviews" becomes "The reviewer reviews".
- The reviewer prompt's description is split into short sentences.
- Roadmap 0.5 says that its last item, the review trace, is an open
  point for the owner to decide, not a missing test.
- The auditor prompt accepts a note in the first commit message as the
  way to close a moved point on a pushed commit message.
- The message of 5244cbe did not name the reworded sentence on
  brackets at the top of docs/design.md. Noted here.

Review round 14:
- The reviewer prompt knows the minor-round rule: findings that are
  all minor give APPROVED, and each point on personal data,
  confirmation or writing files is marked.
- CLAUDE.md says what the count covers: the minor rounds before one
  commit. A CHANGES NEEDED round in between does not restart it; the
  next commit starts a new count; the points of the third minor round
  move too. "Its verdict comment" becomes "The verdict comment of that
  round". A point on the message of a commit already pushed is closed
  by a note in the next commit message (owner's decisions,
  2026-11-24).
- CLAUDE.md, the points that never move: "confirmation or writing
  files" becomes "or on confirmation or writing files". They are fixed
  and reviewed before the commit; the reviewer prompt says so too.
- The message of 5244cbe lists "After each commit, a PR comment names
  the commit" under the owner's decisions; CLAUDE.md does not. Noted
  here.
- The reviewer prompt lists the commands that run from a script as a
  sub-list.

Review of the 0.4 mark:
- docs/design.md: the 25 requirement labels lose their bold (owner's
  decision, 2026-11-24).
- Roadmap intro: CI is green on all four jobs "on its last commit".
- The message of 6fe7029 says nine minor points move; twelve moved.
  Noted here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bertalan

bertalan commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner Author

Review rounds 1 to 3 of the first commit of this PR (5 files against 6fe7029), each by a newly started fable-reviewer, made before the PR existed. The commit closes the twelve minor points that PR #3 moved here.

Runs in each round: cargo fmt --check, clippy and cargo nextest run (5 passed) clean; sh scripts/check-public.sh --staged on a scratch copy and --message on the planned commit message exit 0. Red and green runs do not apply: no logic changed.

Round 1. VERDICT: APPROVED. Four minor points:

  1. The counting rule for minor rounds had no owner's decision behind it. The owner confirmed it ("I confirm, from the third"): the count is of the minor rounds before one commit, and the points of the third round move too.
  2. Three points are closed by a note in the commit message, a way the rule did not name. The owner decided it ("Yes, a note"): a point on the message of a pushed commit is closed by a note.
  3. The reviewer prompt's description had a 23-word sentence. Fixed.
  4. The commit message quoted "R28-R34" with a hyphen. Fixed.

Round 2. VERDICT: APPROVED. Five minor points, all fixed: the auditor prompt accepts the note; points that never move are fixed and reviewed before the commit (CLAUDE.md and the reviewer prompt); two long sentences split; a fragment in the commit message rewritten.

Round 3. VERDICT: APPROVED. Tree of the reviewed copy: 594ec9f6102a7618f53bc07d96be19ec1eb4d8e2. Two minor points. This was the third minor round, so they move; since this PR has more commits, the next commit of this PR closes them:

  1. CLAUDE.md says the note goes in "the next commit", the auditor prompt in "the first commit of the next PR". Align both; and the list "closed in one of three ways" should name the note.
  2. docs/roadmap.md, 0.5 lead-in: "except the last item" reads as the only exception, while the "Rust" section has items that are listed, not tested.

Edited on 2026-11-25: the owner's words are given in English, translated from Italian (audit 0011, F5). The meaning is unchanged.

@bertalan

bertalan commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner Author

Commit 2852907 holds the changes approved in round 3 of the first comment of this PR. Its tree, 594ec9f6102a7618f53bc07d96be19ec1eb4d8e2, is the tree of the reviewed copy.

Review rounds 1 to 3 of the second commit of this PR (5 files against 2852907), each by a newly started fable-reviewer. The commit makes the review trace a rule, says where moved points go, ignores .claude/worktrees/, and closes the two points that round 3 of the first commit moved here.

Runs in each round: cargo fmt --check, clippy and cargo nextest run (5 passed) clean; sh scripts/check-public.sh --staged on a scratch copy and --message on the planned commit message exit 0; from round 2, the script tests (178), cleanup tests (79) and hook tests (24) passed on the copy. Red and green runs do not apply: no logic changed.

Round 1. VERDICT: APPROVED. Five minor points, all fixed: ignore .claude/worktrees/, so a staged copy never picks up the agents' worktrees; say where moved points go when the PR has more commits; state that the tree does not cover the message; reflow a paragraph; a pronoun with no referent in the message.

Round 2. VERDICT: APPROVED. Six minor points, all fixed:

  1. Where moved points go had no owner's decision. The owner decided ("Same PR if there are commits"): to the next commit of the same PR when more commits are planned in it, otherwise to the first commit of the next PR.
  2. The auditor compares the tree of the last APPROVED verdict.
  3. The reviewer leaves .claude/worktrees/ out of its scratch copy.
  4. The verdict comment quotes the subject line of the reviewed message, and a mismatch undoes the commit locally for a new review.
  5. and 6. Long sentences in the prompts and the message split.

Round 3. VERDICT: APPROVED.
TREE: 3279a2100563d71e962c2ea49654b61e48c69c9c
Subject: "Tie each APPROVED verdict to the tree of its commit"

Four minor points. This was the third minor round, so they move to the next commit of this PR:

  1. The commit message says the reviewer leaving .claude/worktrees/ out of its copy keeps them out of the tree. The ignore rule does that; leaving them out only avoids copying other work. The next commit message carries the note.
  2. CLAUDE.md: "the commit is undone locally" names no command and is passive; name git reset --soft HEAD~1. Same pattern in "when more commits are planned in it".
  3. The auditor prompt does not check the comment that names the commit, and checks the subject line only when one is quoted. Make the subject mandatory after 2852907 and check that comment too. The commit message overstates the check for 2852907, which quoted no subject; the next commit message carries the note.
  4. CLAUDE.md does not say that parallel agents work in git worktrees under .claude/worktrees/, nor who removes them.

Edited on 2026-11-25: the owner's words are given in English, translated from Italian (audit 0011, F5). The meaning is unchanged.

Owner's decision of 2026-11-24 on the review trace: it becomes a rule.
The reviewer reports the tree of its staged copy (git write-tree), on
a TREE line after the verdict. The verdict comment quotes it, with the
subject line of the reviewed message. After the commit, git rev-parse
HEAD^{tree} must give the same tree. If it does not, nothing is
pushed: the commit is undone locally and reviewed again. The auditor
compares tree and subject for every commit from 2852907 on. The open
item in roadmap 0.5 is gone.

Where moved points go (owner's decision, 2026-11-24): to the next
commit of the same PR when more commits are planned in it, otherwise
to the first commit of the next PR.

.gitignore now ignores .claude/worktrees/, where agents working in
parallel keep their copies. The reviewer leaves that folder out of
its scratch copy, so the reported tree never picks them up.

This commit also closes the two minor points that round 3 of the
review of 2852907 moved on:
- CLAUDE.md and the auditor prompt now agree on the note for a point
  on a pushed commit message: a note in the message of a later commit,
  listed as one of the ways to close a finding.
- The lead-in of roadmap 0.5 says "except where an item says
  otherwise", since its "Rust" section lists items that are not
  tested by the owner's decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bertalan

Copy link
Copy Markdown
Owner Author

Commit 39635f6 holds the changes approved in round 3 of the review of the second commit of this PR. Its tree, 3279a2100563d71e962c2ea49654b61e48c69c9c, is the tree of the reviewed copy, and its subject is the reviewed one: "Tie each APPROVED verdict to the tree of its commit".

State: the third commit of this PR (the rule-script tests, roadmap 0.5 and 0.6) is in review. Rounds 1 to 3 were CHANGES NEEDED; each found real bugs in audit-status.sh and check-public.sh, fixed test first. Their verdicts will be posted with the commit.

@bertalan

Copy link
Copy Markdown
Owner Author

Review of the third commit of this PR, "Close the gaps in the rule-script tests" (roadmap 0.5, rule-script tests, roadmap 0.6). Ten rounds, each by a newly started fable-reviewer, on the uncommitted changes.

Round 10: APPROVED. Reviewed tree 33882b4bc25e19d4a169b78dd7bf2c7f153e26f5, subject "Close the gaps in the rule-script tests".

Rounds 1 to 7: CHANGES NEEDED. Each finding was fixed test first and reviewed again in the next round.

  • Round 1: the latest attempt of a check was keyed without the workflow, so a red check could hide behind a green one of the same name (bug). Three tests were missing.
  • Round 2: the key had no type either (bug). Red checks were selected by a denylist, so unknown values passed; it is now an allowlist.
  • Round 3: a failing git rev-list --parents let a merge commit through unscanned in check-public.sh (bug). Some git calls had no guard. Rows of an unknown type were not judged.
  • Round 4: a finished attempt with no start time was taken as the latest (bug). A failing gh call printed "no open pull requests" and "no CI runs" instead of "not read". Red checks had no workflow in their name. An absolute core.hooksPath was refused.
  • Round 5: tests for three nested tags and for a status with no time.
  • Round 6: unknown green values; tests for the CI list and its headings; the hooks path compared by identity (test -ef); a test that could remove a folder at the drive root on Windows now runs only where it creates that folder itself.
  • Round 7: each type needs its own green list. Fixed, with a test.

Rounds 8 to 10: APPROVED with minor points (minor rounds 1 to 3).

  • Round 8, six points, fixed and reviewed:
    • the message named only one of two silent passes. The second: a failing git cat-file -t on a tag skipped the tag scan;
    • "Windows-only blocks" corrected to "blocks skipped on Windows";
    • the red rule now keeps "not empty";
    • a failing gh api printed "INTERACTION LIMIT NOT ACTIVE". It now prints "interaction limit not read", test first;
    • the roadmap list of what the step closed was completed;
    • a long test comment was split.
  • Round 9, five points, fixed and reviewed:
    • the expiry warning test now matches the date (it was a missing test);
    • the worktree removal in the message now matches CLAUDE.md;
    • the model-by-risk details were checked against the full text of the option the owner chose;
    • a line of the message was re-wrapped;
    • the red and green runs were added to the PR description.
  • Round 10, two points. This is the third minor round, so they move to the next commit of this PR (CLAUDE.md, step 5):
    • docs/roadmap.md, 0.5: the lead-in says each known limit needs a test before its code changes, but the "Rust" item says its breakages are listed, not tested. The lead-in needs that exception back;
    • docs/roadmap.md, 0.6: "Sonnet writes routine code: scripts, their tests, docs" says more than the owner's decision ("Sonnet for routine code"). The rule scripts protect, so they may not be routine. Drop the examples or ask the owner.

Checks in the last round:

  • test-scripts: 233 passed;
  • test-cleanup: 90 passed;
  • test-hooks: 47 passed;
  • cargo fmt, clippy and nextest: clean;
  • check-public.sh on the staged files and on the message: exit 0;
  • 21 rules broken on copies, all noticed by a test.

The Windows branches of the drive-letter tests run only in CI.

Roadmap 0.5, test first; the step is marked done. Three agents
worked in parallel git worktrees; their changes are merged here, with
the fixes of the reviews of this commit.

check-public.sh and the hooks:
- A failing git command stops the check with exit 2, never a silent
  pass: show, ls-tree, diff-tree, cat-file, log, rev-list and diff
  (13 tests, plus 2 controls of the git wrapper).
- A failing git rev-list --parents let a merge commit through
  unscanned, since the exit status was that of wc (bug found in
  review, test first).
- A failing git cat-file -t on a tag skipped the tag scan and
  passed (bug, test first).
- Nested annotated tags are scanned to the innermost one. Before, only
  the outer message was scanned (bug, test first; 7 tests, up to three
  levels).
- Every hook refuses when its check finds a problem, is missing or
  cannot run, for check-public.sh and audit-status.sh alike (16
  tests).

cleanup.sh (tests only, no change to the script):
- the "still merged into main" check just before deletion, with a
  branch that moves while the script runs;
- a branch created at main is removed (audit 0003, F6);
- a detached HEAD at an unmerged commit;
- the skip counts of the blocks skipped on Windows are still written
  by hand. Off Windows they are now checked: a block that runs a
  different number of checks fails.

audit-status.sh:
- Everything that is not green counts as red (owner's decision,
  2026-11-24). The rule is an allowlist. A check run is red when its
  conclusion is not empty and not SUCCESS, NEUTRAL or SKIPPED. A status
  is red when its state is not empty and not SUCCESS, PENDING or
  EXPECTED. So STALE and any value GitHub adds later are red; a row of
  an unknown type is judged by the same lists. NEUTRAL and SKIPPED are
  green, as in GitHub's branch protection: the report flags what would
  block a merge.
- Only the latest attempt of each check counts (owner's decision,
  2026-11-25). An attempt not started yet, with empty values, is the
  latest, so a queued re-run is not red (owner's decision: a queued
  re-run is in progress). A finished attempt with no start time is
  older than any with a time. Each type has its own green list.
- A check is one pull request, one type, one workflow and one name.
  Without the workflow or the type, a red check could hide behind a
  green one of the same name (two bugs found in review, test first).
- When a gh call fails (network, API limit), the report says "not
  read" for open pull requests, their checks, the CI runs and the
  interaction limit, never "no open pull requests", "no CI runs" or
  "interaction limit not active".
- A red check is printed as "workflow / name", and "(no name)" when
  it has none.
- The hooks check accepts core.hooksPath set to ".githooks" or to the
  absolute path of this repository's .githooks, in POSIX or Windows
  drive-letter form. The two paths are compared as files (test -ef),
  not as strings.
- The CI runs on main and the open pull requests are tested under
  their headings.
- The gh stub returns raw data, so the tests check which checks are
  selected as red, including equal start times and the type guards.
- New tests for uncommitted changes, stashes and the unpushed and
  not-pulled counts. A test that checks a line is absent now fails
  when its section prints nothing, except in the "Rust" section. The
  "no warning with hooks" test checks that the report printed.

Roadmap 0.5 now lists what this step closed and the known limits that
remain. The owner marked the step done with them listed. Eight
limits are new:
- the jq projection in the gh call is not tested;
- gh gives no event, so a green manual run of a job hides a failed
  run of the same job;
- a check name with a backslash prints doubled;
- gh pr list reads at most 30 open pull requests;
- the exit status of the awk that selects red checks is not checked;
- start times are compared as strings;
- a commit held only by a detached HEAD is not reported;
- nothing checks that every off_windows block ends with
  end_off_windows.

Roadmap 0.6 is new: the four changes to the way of working that the
owner adopted on 2026-11-25 ("Done when" for every step, a
merge-ready script, the model chosen by risk with PRs of about 400
lines, and a lessons file with no CI watching by agents).

Minor points moved from round 3 of the review of 39635f6:
- CLAUDE.md names the command to undo a commit whose tree does not
  match (git reset --soft HEAD~1), and says "when the author plans
  more commits".
- The auditor prompt checks the tree in the comment that names the
  commit, and the subject line from 39635f6 on.
- CLAUDE.md points to the known limits of roadmap 0.5 as the other
  untested parts of the rule scripts.
- CLAUDE.md says where parallel agents work and who removes their
  worktrees: after comparing the worktree with the patch it took,
  git worktree remove --force and git branch -D.
- Note on the message of 39635f6: the ignore rule keeps
  .claude/worktrees/ out of the reported tree; the reviewer leaving
  that folder out of its copy only avoids copying other work. The
  message of 39635f6 also says the auditor compares tree and subject
  from 2852907 on; the subject is compared from 39635f6 on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bertalan

Copy link
Copy Markdown
Owner Author

Commit 74cb34c holds the changes approved in round 10 of the review of the third commit of this PR. Its tree, 33882b4bc25e19d4a169b78dd7bf2c7f153e26f5, is the tree of the reviewed copy, and its subject is the reviewed one: "Close the gaps in the rule-script tests".

State: this is the fifth commit since audit 0010, so coherence audit 0011 runs next. Its report is committed alone. The next commit closes its findings and the two minor points moved from round 10. Then CI green on all four jobs, the PR marked ready, and the merge into main with the owner's go-ahead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bertalan

Copy link
Copy Markdown
Owner Author

Review of the commit that closes audit 0011 (on top of 29643bd), round 1: CHANGES NEEDED. Reviewed tree 567a000f4ac8ab32c0092466cbf6a07dd0227ef2, subject "Close audit 0011 and the two points moved from round 10". A first reviewer of these changes stopped on an API timeout with no verdict; this round is by a newly started one.

The F1 fix holds: breaking each of its three prunes fails a test. Two missing tests block the commit; they are fixed test first and go to round 2:

  • Four of the six marker words (XXX, todo!(, unimplemented!(, #[ignore) have no test that they are listed. Removing any of them from the pattern leaves every test green.
  • The file name before each marker line (grep -H) has no test. When grep gets a single file, the line would print without it.

Three minor points, fixed for round 2:

  • the commit message says the roadmap 0.5 lead-in "again names" the "Rust" exception; the earlier text did not name the section;
  • the message does not say that the choices on F3 and F4 were made under the owner's delegation of 2026-11-25 ("choose the solution that serves the goal and is coherent with earlier choices");
  • a paragraph of roadmap 0.6 is not re-wrapped.

@bertalan

Copy link
Copy Markdown
Owner Author

Review of the commit that closes audit 0011, round 2: CHANGES NEEDED. Reviewed tree e21fca1ba48544fe3718e8841e8379592eda7203, subject "Close audit 0011 and the two points moved from round 10".

Two findings, both on personal data, so neither moves. Both are fixed test first and go to round 3:

  • Bug: the prune of tests/corpus and tests/out is case-sensitive. On macOS and Windows, a folder written tests/Corpus or tests/OUT is the same folder, and the marker search still opened it and printed its lines. cleanup.sh already protects these folders without regard to case.
  • Missing test: no test noticed a search that reads the folders and then hides their lines, in place of one that never opens them. That form prints "Binary file ... matches" with the file name for a binary document, and real signed documents are binary, often named after a person. A binary file with a marker word goes into the test folders.

One minor point, fixed for round 3: the commit message names only the first leak; it now also names the file names of binary documents.

@bertalan

Copy link
Copy Markdown
Owner Author

Review of the commit that closes audit 0011, round 3: CHANGES NEEDED. Reviewed tree 1b5fa4162b1288dc21e9a38129ccfe8332d53337, subject "Close audit 0011 and the two points moved from round 10".

One missing test on a personal-data rule, so it does not move. It is fixed test first and goes to round 4:

  • The cased-corpus test used tests/Corpus, which differs from tests/corpus in the first letter only. A pattern narrowed to [Cc]orpus passed every test, yet would read tests/CORPUS. The test folders are now tests/CORPUS and tests/OUT, in capitals, beside the lowercase ones of the first test.

Minor points, fixed for round 4:

  • roadmap 0.6 did not say which model writes the rule scripts and hooks; it now says this step decides it;
  • two sentences of the commit message are split or made exact (the fixtures are pruned as written, not in any case);
  • "R28–R34" is written with its usual dash.

To check before the PR is marked ready: find is new in the rule scripts. The Windows CI job must use the find of Git Bash; the marker tests fail otherwise.

@bertalan

Copy link
Copy Markdown
Owner Author

Review of the commit that closes audit 0011, round 4: CHANGES NEEDED. Reviewed tree d3e8f9ac0679fa0b1c071fb2d11b3d6e5c976f00, subject "Close audit 0011 and the two points moved from round 10".

One missing test on personal data, so it does not move. It is fixed test first and goes to round 5:

  • Symbolic links into tests/corpus/. The search does not follow them today, but no test noticed if it did: with -type f dropped, or with find -L, a link to a corpus file or folder printed its lines, and every test stayed green. A test with a file link and a folder link into the corpus now covers both.

Minor points, fixed for round 5:

  • roadmap 0.6, "so they may not be routine code", reads two ways. It now says the step decides whether they count as routine code;
  • the brief of this round gave the reviewer a proof file with the history of earlier rounds. CLAUDE.md, step 5, says the brief holds no earlier findings. The next brief gives only the red and green runs.

@bertalan

Copy link
Copy Markdown
Owner Author

Review of the commit that closes audit 0011, round 5: APPROVED with one minor point (minor round 1 of this commit). Reviewed tree 00083fdd0251c2c60a9211431814b516c4b32bff, subject "Close audit 0011 and the two points moved from round 10".

No bug and no missing test. The reviewer found no input that makes the marker search open tests/corpus/ or tests/out/, and each rule it broke on a copy failed a test.

Minor point, fixed for round 6: a sentence of the commit message ("New tests: ...") holds five ideas in about 50 words; it becomes a list.

Outside the changes: the marker search prints "none" when find or grep cannot run, as the old line did. It is added to the known limits of audit-status.sh in roadmap 0.5.

@bertalan

Copy link
Copy Markdown
Owner Author

Review of the commit that closes audit 0011, round 6: CHANGES NEEDED. Reviewed tree dcb6d1cbfb71900aabe8a2231e69b9fe2a003651, subject "Close audit 0011 and the two points moved from round 10".

Two missing tests. The first is on personal data, so it does not move. Both are fixed and go to round 7:

  • The rule "never opened, not only hidden" had no direct test. A search that reads every file of the two folders and hides all their lines, the "Binary file" line included, passed every marker test. A grep stand-in now logs each file and folder it is given, and the test checks that none is a folder and none lies in tests/corpus/ or tests/out/.
  • The "none" line of the marker section had no test. A repository with no marker now expects it.

Minor points, fixed for round 7:

  • audit F7 named the 33-word sentence on marking a PR ready (CLAUDE.md), not the session-start one; that sentence is now split, and the message says which sentences changed;
  • the known limit added to roadmap 0.5 after the owner marked the step done now says so;
  • one phrase of the commit message on the fixtures prune was unclear.

@bertalan

Copy link
Copy Markdown
Owner Author

Review of the commit that closes audit 0011, round 7: APPROVED with three minor points (minor round 2 of this commit). Reviewed tree 2e829f063b00b74358bb173672ae59cadaea0f66, subject "Close audit 0011 and the two points moved from round 10".

No bug and no missing test. Every rule the reviewer broke on a copy failed a test, except the one in the third point below, where no file is read.

Minor points, fixed for round 8:

  • the commit message said grep "is never given a folder"; the stand-in logs recursive options and files, so the message now says grep never searches recursively and is never given a file in the two folders;
  • the known limit added to roadmap 0.5 after the owner marked the step done is named to the owner here and in the conversation: the marker search prints "none" when find or grep cannot run. The old line behaved the same;
  • "never opened" in the script, the test and the message becomes "their files are never read". A search that walks the two folders without reading their files is not caught by a test, and reads nothing.

@bertalan

Copy link
Copy Markdown
Owner Author

Review of the commit that closes audit 0011, round 8: APPROVED with five minor points (minor round 3 of this commit). Reviewed tree 139e441c3403e74c7d34246e3d0a6409c3b637a1, subject "Close audit 0011 and the two points moved from round 10".

No bug and no missing test. The reviewer broke the marker search in fourteen ways on copies, among them reading then hiding, --exclude-dir, find -exec cat and tracked files only; each made a test fail.

This is the third minor round, so the five points move without a new round (CLAUDE.md, step 5). No more commits are planned in this PR, so they move to the first commit of the next PR (roadmap 0.6):

  • roadmap 0.5: the marker search prints "none" when find or grep cannot run. The owner has been told; step 0.6 either prints "markers not read" with a test, as the GitHub sections do, or the owner accepts the limit;
  • CLAUDE.md: the split "mark it ready" sentence reads as two facts; it becomes a two-item list of conditions;
  • roadmap 0.5: the new limit's second sentence is long and passive; it is rewritten;
  • two points on the message of this commit, closed by a note in a later commit message: two long sentences (F4 and F5, F7) that should be lists, and a "So" that follows the wrong sentence.

F1, bug, test first: the marker search of audit-status.sh read
tests/corpus/ and tests/out/, which hold real and extracted documents.
A marker word in a real document would be printed in the session
report. For a binary document, such as a signed file, grep printed its
file name. find now prunes both folders, in any case of their names.
It prunes tests/fixtures too, in that exact case. So the two folders
are never read, even when .gitignore lacks them. Before, the marker
section had no test. New tests:
- a tracked and an untracked marker are listed;
- fixtures, corpus and output are not listed, binary files and
  capital names (tests/CORPUS, tests/OUT) included;
- symbolic links into the corpus are not followed;
- each of the six marker words is listed;
- with a single file to search, its name is still printed;
- grep never searches recursively and is never given a file in the
  two folders (a grep stand-in logs its options and files);
- a repository with no marker says "none".

Roadmap 0.5 lists one more known limit, added after the owner marked
the step done: the marker search prints "none" when find or grep
cannot run.

F2, moved from round 10: the lead-in of roadmap 0.5 again carries
the exception, and now names the "Rust" section.

The audit leaves F3 and F4 to the owner. The owner delegated such
choices on 2026-11-25: choose the solution that serves the goal and
is coherent with earlier choices.

F3, moved from round 10: roadmap 0.6 no longer counts scripts as
routine code. The owner's decision says only "Sonnet for routine
code"; the rule scripts protect. Step 0.6 decides whether the rule
scripts and the hooks count as routine code.

F4 and F5 are written into roadmap 0.6 as the first lessons of
docs/lessons.md: post each verdict when its round ends; give the
owner's decisions in English on GitHub. At the owner's request, the
two PR #4 comments with Italian quotes now give them in English, with
a note that says so.

F6: the reviewer prompt says a point on personal data or R28–R34
"never moves", without naming a place.

F7: the three long sentences the audit names are split: in
CLAUDE.md, marking a PR ready and the worktree removal; in roadmap
1.5, sensitive folders and the risky run. The session-start sentence
of CLAUDE.md is split too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bertalan

Copy link
Copy Markdown
Owner Author

Commit 72b89f3 holds the changes approved in round 8 of the review of the commit that closes audit 0011. Its tree, 139e441c3403e74c7d34246e3d0a6409c3b637a1, is the tree of the reviewed copy, and its subject is the reviewed one: "Close audit 0011 and the two points moved from round 10". The audit report itself is in 29643bd ("audit: 0011"), pushed with it.

State: every finding of audit 0011 is closed. Next: CI green on all four jobs on this commit, read in the job list (the Windows job must show that the new marker tests use the find of Git Bash), then the PR marked ready and the merge into main with the owner's go-ahead. The five minor points of round 8 move to the first commit of roadmap 0.6.

@bertalan
bertalan marked this pull request as ready for review November 25, 2026 14:19
@bertalan
bertalan merged commit 72b89f3 into main Nov 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant