16d-review-binding: gate the three rules that failed under attention - #9
Merged
Conversation
Three rules this session produced had no gate behind them, and each had already
failed once while enforced by attention alone. This commit makes them mechanical.
1. .githooks/pre-commit refuses a commit on `main`. Positive match on the full
ref, so a tag named `main` cannot defeat it; detached HEAD is deliberately
exempt, because rebase, bisect and the reviewer's index checkout all run
detached. A slip-guard, not an authorization control.
2. .githooks/pre-commit greps tracked .md for every path the staged diff deletes
or renames, failing on a hit not marked `<!-- historical-path -->` on the hit
line or the one immediately above. NUL-delimited throughout, and both
enumerations check git's exit status: earlier drafts failed OPEN on C-quoted
paths, on blobs GNU grep calls binary, and when the enumeration exited 128 --
printing an affirmative verdict over an input never searched.
3. tools/signoff.sh binds the signoff to the tree the reviewers actually read:
exactly two reviewer tree files per round, both equal to `git write-tree`, and
.githooks/pre-commit re-checks that at commit time.
Also: one definition of the reviewable-diff recipe in tools/gate.sh (copies 3 -> 2),
with an equality test holding .githooks/commit-msg's remaining copy to it until
slice 17 removes it; the two tools/gate.sh comment corrections carried from 16b;
and BACKLOG.md section 11 recording the advisory-print `is_uint` duplicate.
Four review rounds, two independent reviewers each on index checkouts, plus one
owner-bounded record-lane read. Seven blocking findings, seven universal
quantifiers, zero mechanism defects after round 1 -- every blocking finding was a
claim in a tracked file, not a defect in the code it described. Evidence, probe
results and dispositions in internal/slices/16d-review-binding/FINDINGS.md.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VNdY6wVS773UJgrHUeBN3Y
Reviewed-diff: sha256:e72d17e808d5f3aac533e64fc0137b4cec601b78c2a5ab2fcf5e1c66950996e2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #8, which was closed to clear a blocked rollup. The commit is unchanged —
27de8a1, tree3797e134, trailerReviewed-diff: e72d17e8…, signoff written bytools/signoff.shover the tree both round-5 reviewers read.What lands
Three rules produced during slice 16, each of which had already failed once while enforced by attention alone, become mechanical.
.githooks/pre-commitrefuses a commit onmain. Positive match on the full ref, so a tag namedmaincannot defeat it (--shortreturnsheads/mainin that case). Detached HEAD is deliberately exempt — rebase, bisect and the reviewer's index checkout all run detached. A slip-guard, not an authorization control..githooks/pre-commitgreps tracked.mdfor every path the staged diff deletes or renames, failing on a hit not marked<!-- historical-path -->on the hit line or the one immediately above. Two lines above does not count.Earlier drafts failed open three separate ways, each caught by review and each fixed with a working negative control: C-quoted paths (non-ASCII, tab, quote, newline) that
git grep -Fcould not match; blobs GNU grep calls binary, where it exits 0 and emits nothing on stdout; and an enumeration exiting 128, where the affirmative printed over an input never searched. Now NUL-delimited throughout, with both enumerations checking git's exit status.Scope, stated exactly: a tracked path, deleted or renamed by this commit, cited by exact string in a tracked
.md. The three defects that motivated the rule are not in that domain —internal/has never been tracked, one instance is a JSON key and one a stale line number — and the hook says so.tools/signoff.shbinds the signoff to the tree the reviewers read. Exactly two reviewer tree files per round, distinct reviewer numbers, both equal togit write-tree;.githooks/pre-commitre-checks at commit time. This exists because in slice 16c three of six staged files changed on disk mid-review: the attestation covers index bytes while the drift test hashes worktree bytes.Also: one definition of the reviewable-diff recipe in
tools/gate.sh(copies 3 → 2), with a test holding.githooks/commit-msg's remaining copy token-identical until slice 17 removes it; the twotools/gate.shcomment corrections carried from 16b; andBACKLOG.md§11 recording the advisory-printis_uintduplicate.Review
Four rounds plus a fifth of scope "delta", two independent reviewers each, read-only on checkouts of the index.
ebf90b6511d2c441a3b8b2cef159ea533797e134Seven blocking findings. Seven universal quantifiers. Zero mechanism defects after round 1. Every blocking finding was a claim in a tracked file — every, cannot, all three, would have — and not one was a defect in the code those words described. The slice closed by stripping the last such claim rather than qualifying it.
Why #8 was closed rather than merged
Its rollup carried two check-runs per context — a passing pull_request run and a failing force-push run — so two required contexts each showed a failure.
Cause, proved across three runs on this branch:
befored025d3527de8a1d025d350…(orphaned by force-push)27de8a1Same job, same code, same head SHA between the last two — only
beforediffers.tools/gate.sh:173-176guards the all-zeros sentinel but not a well-formed SHA that is unreachable;:178then fails closed, correctly. The CI blind spot is filed against slice 18 with this derivation.🤖 Generated with Claude Code
https://claude.ai/code/session_01VNdY6wVS773UJgrHUeBN3Y