16d-review-binding: gate the three rules that failed under attention - #8
16d-review-binding: gate the three rules that failed under attention#8HackTuah wants to merge 1 commit into
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
d025d35 to
27de8a1
Compare
|
Closing to clear a blocked rollup, not because the work changed. The rollup carried two check-runs per context — the pull_request run (SUCCESS) and the force-push run (FAILURE) — so Cause, proved: the force-push orphaned The commit is unchanged: The CI blind spot is filed separately against slice 18. |
Three rules produced during slice 16 had no gate behind them, and each had already failed once while enforced by attention alone. This makes them mechanical.
What lands
.githooks/pre-commitrefuses a commit onmain. Positive match on the full ref, so a tag namedmaincannot defeat it. A detached HEAD is deliberately exempt — rebase, bisect and the reviewer's index checkout all run detached. A slip-guard, not an authorization control:--no-verifybypasses it and a clone that never ranmix setuphas no hook at all. The ruleset is what prevents a push..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 of this gate 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 classifies as binary, where it exits 0 and emits nothing on stdout; and an enumeration exiting 128, where the affirmative printed over an input that was never searched. It is now NUL-delimited throughout and both enumerations check 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, 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, so a signoff written after such a drift attests a diff that no longer exists.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 byte-identical to it until slice 17 removes it; the twotools/gate.shcomment corrections carried from 16b; andBACKLOG.md§11 recording the advisory-printis_uintduplicate.Review
Four rounds, two independent reviewers each, read-only on checkouts of the index, plus one owner-bounded record-lane read to close.
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 implementation was correct at the end of round 1 and did not regress under four rounds of adversarial probing.
The slice closed by stripping the last such claim rather than qualifying it: the coverage test is renamed to what it checks, its nine controls kept as regression locks, with no completeness assertion.
Gates
All nine green: compile, format, secret-scan, test (0 failures), credo held at 76, dialyzer held at 43, baseline unchanged, mutation 14 killed / 0 survivors, attestation — and the commit attests to its own diff.
derive_diff_hashandattestationverified byte-identical tomain's implementation across seven and five ranges, with non-vacuity asserted.Residuals
Recorded, not fixed: the gate matches an exact path string, so a parent-directory citation is missed and a longer path sharing the prefix is a false positive (fails closed); the detached-HEAD exemption is a two-command route onto
mainby design;.githooks/commit-msgkeeps its recipe copy until 17, bound by the equality test;is_uintstays duplicated (advisory print only,BACKLOG.md§11); one universal quantifier survives atdiff_recipe_test.exs:139, out of the closing scope and assigned to 17; and the new example test enumerates via the index but reads via the worktree — the same class this slice closes, bounded by the index-isolation gate, also for 17.Full evidence, probe results, negative controls and per-round dispositions in
internal/slices/16d-review-binding/FINDINGS.md(gitignored, local).🤖 Generated with Claude Code
https://claude.ai/code/session_01VNdY6wVS773UJgrHUeBN3Y