Skip to content

16d-review-binding: gate the three rules that failed under attention - #8

Closed
HackTuah wants to merge 1 commit into
mainfrom
slice/16d-review-binding
Closed

16d-review-binding: gate the three rules that failed under attention#8
HackTuah wants to merge 1 commit into
mainfrom
slice/16d-review-binding

Conversation

@HackTuah

@HackTuah HackTuah commented Sep 3, 2026

Copy link
Copy Markdown
Member

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

  1. .githooks/pre-commit refuses a commit on main. Positive match on the full ref, so a tag named main cannot 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-verify bypasses it and a clone that never ran mix setup has no hook at all. The ruleset is what prevents a push.

  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. 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 -F could 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.

  3. tools/signoff.sh binds the signoff to the tree the reviewers read. Exactly two reviewer tree files per round, both equal to git write-tree; .githooks/pre-commit re-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 two tools/gate.sh comment corrections carried from 16b; and BACKLOG.md §11 recording the advisory-print is_uint duplicate.

Review

Four rounds, two independent reviewers each, read-only on checkouts of the index, plus one owner-bounded record-lane read to close.

Round Tree Gate integrity Record / regression Blocking
1 ebf90b65 FAIL PASS-with-residuals 2
2 11d2c441 FAIL FAIL 4
3 a3b8b2ce FAIL PASS-with-residuals 2
4 f159ea53 FAIL PASS-with-residuals 1
read 3797e134 CONFIRMED 0

Seven 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_hash and attestation verified byte-identical to main'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 main by design; .githooks/commit-msg keeps its recipe copy until 17, bound by the equality test; is_uint stays duplicated (advisory print only, BACKLOG.md §11); one universal quantifier survives at diff_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

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
@HackTuah
HackTuah force-pushed the slice/16d-review-binding branch from d025d35 to 27de8a1 Compare September 3, 2026 02:55
@HackTuah

HackTuah commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

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 Gate - attestation and Gate - baseline may only decrease each showed a failure and the PR went BLOCKED.

Cause, proved: the force-push orphaned d025d35, and tools/gate.sh:173-176 guards the all-zeros sentinel (before on a new branch) but not a well-formed SHA that is unreachable. Line :178 then fails closed — correctly; a gate that cannot measure must not pass.

The commit is unchanged: 27de8a1, tree 3797e134, trailer e72d17e8, signoff written by tools/signoff.sh over the tree both round-5 reviewers read. Re-pushing as a new branch reproduces run 33700784040's conditions, where all nine gates were green.

The CI blind spot is filed separately against slice 18.

@HackTuah HackTuah closed this Sep 4, 2026
@HackTuah
HackTuah deleted the slice/16d-review-binding branch September 4, 2026 13:16
@HackTuah
HackTuah restored the slice/16d-review-binding branch September 4, 2026 13:17
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