#!/usr/bin/env bash # scripts/hooks/pre-commit — the commit gate (TOOL-14, The Staff), plus five # guards (see below). # # Runs `make gate-commit` (fmt --check + clippy + type-audit + type-audit-report, # plus the sub-floor nextest tier) before every commit that could change its # outcome. The lints are the cheapest checks and the most common review # finding per CLAUDE.md; the sub-floor tier adds a seconds-scale slice of the # workspace test suite (`docs/timings/subfloor-roster.tsv`) so a local commit # also gets test coverage without paying for the full `--workspace` run, # which stays reserved for the stage gate (`make gate-stage`). # # Opt-in: enable with `make install-hooks` (sets core.hooksPath). Bypass a # single commit with `git commit --no-verify` only when you have a reason — # never to skip the fmt gate (CLAUDE.md forbids --no-verify for that). # # ORDER MATTERS: the guards below run BEFORE `make gate-commit` — a commit that # a guard will refuse should not first pay a build. The pure-git/pure-text ones # (worktree branch, .superpowers scratch, conflict markers) come first and are # effectively free; the two that shell out to a build (the golden-pins # tripwire, the stream-manifest tripwire) fire only on the rare commit that # stages their trigger files. `make gate-commit` is last because it is the # only step that costs anything in the common case. # # NOTE — THE MERGE-COMMIT GAP IS REAL BUT IT IS THE OPPOSITE SHAPE FROM WHAT # THIS NOTE USED TO CLAIM. It said flatly "NONE OF THIS RUNS ON A MERGE # COMMIT"; The Escapement measured otherwise and the matrix is (git 2.50.1, # a scratch repo with both hooks installed under core.hooksPath): # # automatic (non-conflicted) true merge commit -> `pre-merge-commit` ONLY # fast-forward merge -> NEITHER (no commit exists) # CONFLICTED merge, resolved by hand, concluded # with an explicit `git commit` -> `pre-commit` — THIS FILE # # The third row is an ordinary commit invocation as far as git is concerned, # and it is not hypothetical: a conflicted 47-commit absorption ran the full # gate through this hook (fmt, clippy, type-audit, 3 subfloor chunks, 3302 # tests, rc=0, 50.1 s). `scripts/hooks/` holds no `pre-merge-commit`, so row # one is the ungated case and row three is gated. # # THAT INVERTS THE STATED RISK. The absorption most likely to mis-resolve a # generated artifact is the one where a human is hand-editing files — the # conflicted one — and that is exactly the one this hook DOES see. The blind # spot is the clean auto-merge, where nobody touched anything by hand. It is # still a blind spot (it happened, 3 for 3, on a count table), which is why # `post-merge` exists beside this file — advisory, because a merge commit # already exists by the time that hook can see it. # # This file absorbed the two features of a second, orphaned hook that used to # sit at the repo root (`hooks/pre-commit`, deleted 2026-07-31): the # linked-worktree/main branch guard, and the skip-the-build-on-docs-only fast # path. Only one hook can be active — core.hooksPath names a single directory — # and the root one had drifted to a weaker check set while still advertising # `git config core.hooksPath hooks` in its own header, so following that comment # silently disabled the two incident-derived guards below. set -euo pipefail repo_root="$(git rev-parse --show-toplevel)" cd "$repo_root" # The linked-worktree branch guard. Campaigns run in worktrees under # `.claude/worktrees/`, and a linked worktree sitting on `main` is essentially # always a wrong-branch mistake — a campaign subagent committed to main that way # once. The PRIMARY checkout on `main` is legitimate (merges, infra, docs), so # the guard keys on linked-vs-primary (git-dir != git-common-dir), not on the # branch name alone. git_dir="$(cd "$(git rev-parse --git-dir)" && pwd -P)" git_common="$(cd "$(git rev-parse --git-common-dir)" && pwd -P)" branch="$(git symbolic-ref --short -q HEAD || echo DETACHED)" if [[ "$git_dir" != "$git_common" && "$branch" == "main" ]]; then echo "pre-commit: refusing to commit to 'main' from a linked worktree —" >&2 echo " you are almost certainly on the wrong branch." >&2 echo " (The primary checkout may commit to main; a worktree may not.)" >&2 exit 1 fi # The bash-3.2 guard (Task 0, The Forebay). Every bash-shebanged file under # scripts/ must parse under macOS's /bin/bash 3.2 and avoid bash-4-only # constructs (mapfile/readarray, declare -A, ${var,,}/${var^^} case # expansion) -- shellcheck alone misses both classes (it reported a file # /bin/bash could not even parse as completely clean). Cheap and pure-text, # so it runs unconditionally on any commit that stages a scripts/ path, # rather than only on a rare trigger file the way the golden-pins and # stream-manifest tripwires below do. if git diff --cached --name-only --diff-filter=ACMR | grep -qE '^scripts/'; then if ! bash scripts/check-bash32.sh; then echo "pre-commit: 'scripts/check-bash32.sh' failed -- a staged scripts/ file" >&2 echo "either does not parse under /bin/bash (bash 3.2, what macOS ships) or" >&2 echo "uses a bash-4-only construct. See its output above for the file and line." >&2 exit 1 fi fi # The golden-pins.sql tripwire guard. `tools/census/queries/calibrate/ # golden-pins.sql` deliberately duplicates every pinned calibration constant # in the three calibration test files, checked against the committed census # fixture as an independent second path (its own header explains why). That # duplication has gone stale THREE times (2026-07-13, 2026-07-20, 2026-08-25) # because `make census-check` is not part of `make gate` and nobody remembered # to run it by hand at re-pin time. # # THE THIRD TIME IS WHY THE CENSUS ROWS ARE IN THIS LIST NOW, and it happened # because this guard watched the wrong half. A pin compares a value COMPUTED # FROM THE CENSUS against a hardcoded literal. The four Rust/SQL files below # hold the LITERAL; `book/src/laboratory/generated/*/rows.csv` is what # `computed` is read from. A census refresh therefore moves one side of every # pin while staging NONE of the four — which is exactly what `c54fb62c9` # (a Granary-era refresh) did, drifting 28 pins onto main with this hook # installed, firing on nothing, and the comment above still claiming the gap # was closed by construction. # # Guarding both sides is the whole fix: a pin can be falsified by an edit to # either operand, so the trigger has to name both operands. census_guard_files='windows/lab/tests/suite/calibration\.rs|windows/lab/tests/suite/branches_family_calibration\.rs|windows/lab/tests/suite/gathering_calibration\.rs|tools/census/queries/calibrate/golden-pins\.sql|book/src/laboratory/generated/[^/]+/rows\.csv' if [ -n "${HV_CENSUS_DELIVERY:-}" ]; then # A census delivery commit (scripts/sluice-census.sh) moves the fixture # wholesale and CANNOT carry matching pins: re-pinning is the owning # campaign's judgment call, made after the run, and the delivery branch is # gated as an ordinary merge before it can reach main. This is a scoped, # named opt-out of ONE check, set by one script for one commit — the rest # of this hook still runs. echo "pre-commit: HV_CENSUS_DELIVERY=1 — skipping the golden-pins guard for this census delivery." >&2 echo "pre-commit: the pins are EXPECTED to disagree until the owning campaign re-pins them." >&2 elif git diff --cached --name-only | grep -qE "^(${census_guard_files})$"; then echo "pre-commit: a calibration-pin file is staged — running 'make census-check' (~2.5 min; this is the golden-pins.sql tripwire guard)..." >&2 if ! make census-check; then echo "pre-commit: 'make census-check' failed — a calibration test file and" >&2 echo "tools/census/queries/calibrate/golden-pins.sql have drifted apart." >&2 echo "Re-sync golden-pins.sql's literals to match the Rust pins exactly" >&2 echo "(the Rust file is primary; never edit it to match the SQL) and" >&2 echo "re-run 'make census-check' before committing." >&2 echo "If duckdb/python3 aren't installed: brew install duckdb; then retry." >&2 exit 1 fi fi # The scratch-in-worktree guard. `.superpowers/` is campaign scratch — # reports, review packages, task state — and is already in `.gitignore`. But # `git add -f` deliberately overrides `.gitignore`, and once a path is # tracked the ignore stops applying at all, so a single forced add silently # makes the file permanent. That has happened at least twice (a `chore: # untrack .superpowers/ scratch that slipped past its own gitignore` commit # exists, and The Action Clock repeated it while freezing a baseline). # # THIS COMMENT USED TO END: "The ledger is explicitly NOT the durable # record — material entries are promoted into the spec at close — so # committing it is always a mistake, never a judgment call." That was a # judgment stated as a settled fact, and The Cartulary (2026-08-30) measured # it false: promotion-at-close has failed FIVE recorded times # (`docs/superpowers/specs/2026-08-30-the-cartulary-design.md` §1 — # `docs/retrospectives/{the-ell,the-quoin,the-lodestar,the-overture,the-attestation}.md`), # the last two of them *after* campaigns had added verification specifically # to catch this. Verification cannot save it: a check that reads the ledger to # confirm promotion cannot detect the ledger having been recycled out of # existence first, which is what happened both times. # # THE GUARD DOES NOT LOOSEN FOR THAT CORRECTION. What still lives under # `.superpowers/` is regenerable (a review package is `git diff` output) or # derivative (a report is evidence for a ruling recorded elsewhere) — a # campaign's decision ledger no longer needs to live here to survive: it is # instead a committed, per-campaign document at # `docs/superpowers/ledgers/YYYY-MM-DD-.md` (this campaign's own is # already there), written directly as rulings occur rather than promoted # from scratch at close. So every reason this guard refuses a # `.superpowers/` path still holds; only the rationale above it does not. # # Closing it by construction: no commit may ADD or MODIFY anything under # `.superpowers/`. `--diff-filter=d` excludes deletions deliberately — # `git rm --cached` is the remediation this hook recommends, and refusing that # would leave an already-tracked file impossible to untrack without # `--no-verify`. (Found immediately, by this guard refusing its own commit.) if git diff --cached --name-only --diff-filter=d | grep -qE '(^|/)\.superpowers/'; then echo "pre-commit: a .superpowers/ path is staged." >&2 echo "That directory is campaign SCRATCH and is gitignored; it was almost" >&2 echo "certainly added with 'git add -f'. Reports and review packages are" >&2 echo "regenerable and don't belong in git; a campaign's decision ledger" >&2 echo "belongs at docs/superpowers/ledgers/, not here." >&2 echo "" >&2 git diff --cached --name-only --diff-filter=d | grep -E '(^|/)\.superpowers/' | sed 's/^/ /' >&2 echo "" >&2 echo "Unstage with: git rm --cached (the file stays on disk)" >&2 exit 1 fi # The conflict-marker guard. Cheap, universal, and pure-text: a staged hunk # carrying `<<<<<<<` / `>>>>>>>` is an unresolved merge that compiles only by # accident (in markdown it does not even fail loudly — it just publishes). # Checked against the STAGED DIFF, not the working tree, so an unstaged # half-resolved file never blocks an unrelated commit. The `^+` anchor means # only lines this commit ADDS can trip it: a marker already committed # somewhere is someone else's problem, not this commit's. if git diff --cached -U0 | grep -qE '^\+(<{7}|>{7})( |$)'; then echo "pre-commit: staged changes add merge-conflict markers." >&2 git diff --cached --name-only --diff-filter=d | while read -r f; do if git diff --cached -U0 -- "$f" | grep -qE '^\+(<{7}|>{7})( |$)'; then echo " $f" >&2 fi done echo "Resolve the conflict before committing." >&2 exit 1 fi # The stream-manifest tripwire. `stream_labels()` publishes each crate's seed # derivation labels into `book/src/reference/stream-manifest-generated.md`, a # drift-checked artifact. Adding a label is a SAVE-FORMAT change (kernel # CLAUDE.md: every `pub const` in a `streams` module is a permanent contract), # and the manifest is the only place the full set is visible for review — but # nothing forces the regen into the same commit, so the artifact lags the # code and the drift check goes red later, on someone else's commit. # # Same shape as the golden-pins tripwire above: run the REAL check, not a # proxy, and only on the rare commit that touches a `streams.rs`. A proxy # ("is the manifest also staged?") would false-positive on a comment-only # edit and train you to bypass it; regenerating and diffing cannot. if git diff --cached --name-only --diff-filter=ACMR | grep -qE '(^|/)src/streams\.rs$'; then echo "pre-commit: a src/streams.rs is staged — checking the stream manifest is current..." >&2 manifest='book/src/reference/stream-manifest-generated.md' fresh="$(mktemp)" trap 'rm -f "$fresh"' EXIT if ! cargo run --quiet -p hornvale -- streams > "$fresh"; then echo "pre-commit: could not run 'cargo run -p hornvale -- streams' to check the manifest." >&2 exit 1 fi if ! diff -q "$manifest" "$fresh" >/dev/null 2>&1; then echo "pre-commit: $manifest is STALE against the staged streams.rs." >&2 echo "" >&2 diff -u "$manifest" "$fresh" | head -20 >&2 echo "" >&2 echo "A stream label is a permanent save-format contract (kernel/CLAUDE.md)." >&2 echo "Regenerate and stage it in THIS commit:" >&2 echo " make rebaseline && git add $manifest" >&2 exit 1 fi fi # The board lane rule (B13, decision 0129). `tools/board` is deliberately NOT # a workspace member (`members = ["kernel", "domains/*", "windows/*", "cli"]` # in the root `Cargo.toml`) — so `cargo clippy --workspace` and `make quick` # never examine it — but the `.rs` filter below runs `make quick` anyway on # any board change, since a board source file still matches `\.rs$`. Measured # (The Beacon): the suite that actually tests the board # (`cargo test --manifest-path tools/board/Cargo.toml`) takes 24.4s and runs # in no gate at all, so a board-only commit today pays for a gate that cannot # see it and skips the one that can. # # The fix is narrow on purpose: only when EVERY staged path is under # `tools/board/` does this replace `make quick` outright. Any other staged # path — including a MIXED commit that touches `tools/board/` alongside # workspace code — falls through to the ordinary filter below unchanged, so # a predicate this narrow only ever adds coverage. # # THE PREDICATE MUST SEE EVERY STAGED PATH, WHICH TAKES TWO FLAGS. Both were # missing when B13 landed, and each one on its own let a commit remove # workspace code while claiming the staged set was "entirely under # tools/board/" — the exact failure this comment used to say was impossible. # Measured (The Beacon Task 11b review): # # 1. `--diff-filter=ACMR` HIDES DELETIONS. Staging `M tools/board/…` # together with `D windows/lab/src/lib.rs` listed only the board path, # took this lane, skipped `make quick`, and landed a commit deleting a # workspace crate's `lib.rs`. Dropping the filter fixes it: a `D` entry # is a staged path like any other, and the point here is "is anything # outside tools/board/ involved", not "how did it change". # # 2. RENAME DETECTION HIDES THE SOURCE PATH, and dropping the filter does # NOT fix this one. `git mv windows/lab/src/lib.rs tools/board/moved.rs` # lists only `tools/board/moved.rs`, because `--name-only` reports a # rename as its destination. So a single `git mv` could still carry a # workspace file out of the workspace on this lane. `--no-renames` # decomposes it into the `D` and the `A`, exposing both paths. # # The `rust_relevant` filter below shares blind spot 1 and is deliberately # LEFT ALONE: it predates this work, so changing it is a separate decision. # # THE BELT, added by The Beacon Task 11b after this very lane corrupted a # developer's checkout. Git exports GIT_DIR and GIT_INDEX_FILE to a hook, and # from a LINKED WORKTREE they are absolute paths into the real repository: # # GIT_DIR=/…/hornvale/.git/worktrees/the-beacon # # GIT_DIR outranks `git -C `, so every `git -C ` the board's # tests make inherited it and operated on the real repo instead: `git init` # re-initialised it and guessed bare (core.bare=true), `git config` rewrote # user.name to `board test`, the merge helper landed root/work/merge commits on # main, and update-ref left a dangling ref that broke `git fetch` repo-wide. # # The real fix is in `tools/board/src/git.rs` (`Repo::command` scrubs the # environment) and is guarded by `tools/board/tests/hermeticity*.rs`. This is # the belt: `env -u` here protects any path that bypasses that constructor — # a shelled-out command, a new dependency, a helper script — for free. # # It must wrap ONLY the cargo invocation. The hook's own `git diff --cached` # calls above and below NEED the inherited GIT_INDEX_FILE to see the right # index, so unsetting these globally would silently change what this hook # checks. board_staged="$(git diff --cached --name-only --no-renames)" if [[ -n "$board_staged" ]] && ! grep -qvE '^tools/board/' <<<"$board_staged"; then echo "pre-commit: staged set is entirely under tools/board/ -- running its own suite instead of 'make quick' (B13)..." >&2 if ! env -u GIT_DIR -u GIT_WORK_TREE -u GIT_COMMON_DIR -u GIT_INDEX_FILE \ -u GIT_OBJECT_DIRECTORY -u GIT_ALTERNATE_OBJECT_DIRECTORIES \ -u GIT_NAMESPACE -u GIT_PREFIX \ cargo test --manifest-path tools/board/Cargo.toml; then echo "pre-commit: 'cargo test --manifest-path tools/board/Cargo.toml' failed." >&2 exit 1 fi exit 0 fi # `make gate-commit`, and the docs-only fast path. # # The repo commits a great many docs-only changes — chronicles, retrospectives, # specs, decision records, the book — and none of them can change what # fmt-check, clippy, the type audit, or the sub-floor test tier say. Paying a # workspace `cargo clippy` (and a nextest run) on a chronicle edit is pure # latency (~16 s warm on this box, minutes cold), so skip it when nothing # staged can affect the verdict. # # The predicate is deliberately WIDER than the `*.rs` test the orphaned root # hook used: fmt is configured by nothing here (no rustfmt.toml), but clippy # reads `clippy.toml` (it holds the disallowed-types bans — no HashMap, no # wall-clock), the build reads `Cargo.toml` / `Cargo.lock` / # `.cargo/config.toml` / `rust-toolchain.toml`, and the type audit is its own # crate under `tools/type-audit/` whose behaviour changes when IT changes. # Missing any of those would let a real regression through on a commit that # staged no `.rs` file at all. # # `docs/audits/type-audit-report.md` is in the list for the same reason: it # is the ONE non-`.rs` file `make gate-commit` itself directly verifies (the # `type-audit-report` target, added in The Mire task 1b, diffs a fresh # regen against this committed copy). A commit staging only a hand-edit or a # bad merge resolution of that file — no `.rs`, no `Cargo.*` — used to match # none of the alternatives above and skip `make quick` (this hook's check at # the time) entirely, so the very check that exists to catch a stale report # never ran on the commit most likely to make it stale. Verified empirically # before this fix: staging only a dirtied copy of the file made this # predicate fall through and the check never ran, even though # `make type-audit-report` alone failed on the same tree. # # NOTE — this fast path gates ONLY `make gate-commit`. The three guards above # run unconditionally, and that is load-bearing: `.superpowers/` scratch is # markdown and `golden-pins.sql` is SQL, so hanging the whole hook on "is Rust # staged" (as the root hook's early `exit 0` did) would have disabled both # guards on precisely the commits that trip them. rust_relevant='\.rs$|(^|/)Cargo\.(toml|lock)$|(^|/)clippy\.toml$|(^|/)rustfmt\.toml$|(^|/)rust-toolchain\.toml$|(^|/)\.cargo/|(^|/)tools/type-audit/|(^|/)tools/placement-audit/|(^|/)docs/audits/type-audit-report\.md$|(^|/)docs/audits/placement-audit-roster\.md$' # THE FAST PATH IS NOW AN INVERSION, NOT A SKIP (The Nettle). # # The old premise was "Rust paths staged -> Rust checks matter". The # counterexample is a Rust test whose SUBJECT IS PROSE: # `docs_consistency` scans `book/src` and `docs/`, is in the sub-floor # roster, and so runs in `gate-commit` — and a docs-only commit is exactly # what it exists to check and exactly what this predicate decided needed no # checking. One campaign made ~12 docs-only commits through the hole, each # printing a skip message that reads as an optimisation, and a one-sentence # prose defect went to the merge queue to be found on the canonical box # after it had taken the shared serial claim. # # So a docs-only commit now runs the PROSE-SUBJECT tests instead of nothing. # It does NOT run `make gate-commit`: fmt, clippy and the type audit cannot # be moved by a markdown edit, and that half of the old reasoning was right. # # COST, measured 2026-09-02 (The Nettle, spec §4), CORRECTED 2026-09-03 (fix # wave): the ~2.4 s warm figure first recorded here was measured on the # narrower 28-test `test(docs_consistency)` filter, not the shipped # eight-predicate, 60/62-test `docs-tests` filter. Warm re-measurements of # the shipped filter: 5.664 s, 10.249 s, 16.0 s, 17.2 s and 20.2 s — a # 5.7-24.0 s range, the pole being `repose_byte_identity`'s three worldgen # byte-identity probes (seconds-scale on their own), not primarily box # contention. Cold is still ~234.6 s, because the wall there is the BUILD of # the `suite` binary, which nextest compiles in full regardless of which # predicate selects tests from it — build cost does not vary with the # filter. The cold case is not rare — a chronicle or retrospective commit # right after absorbing main is exactly when the tree is cold. It is paid # deliberately: a campaign's docs commits cluster after one absorption, so # the cost is the cold build once plus ~5.7-24.0 s each thereafter, against # a merge phase reddening at ~1129-1595 s on the box everything else is # queued behind. if ! git diff --cached --name-only --diff-filter=ACMR | grep -qE "$rust_relevant"; then echo "pre-commit: no Rust-relevant paths staged — running the prose-subject tests instead of 'make gate-commit'." >&2 # No `env -u GIT_DIR -u GIT_INDEX_FILE ...` scrub here, unlike the board # invocation above — deliberately, not an oversight. `docs-tests` runs # `generated_paths` (four `git ls-files` calls), which must see what is # actually STAGED for this commit; scrubbing GIT_INDEX_FILE would make it # read the worktree index instead, which is wrong for a pre-commit hook # whose subject is the staged tree. # THE YELLOW-CENSUS ALARM CANNOT BE SATISFIED BY A DELIVERY COMMIT, so it is # stood down for that one commit — the same scoped opt-out, set by the same # script, as the golden-pins guard above. # # `a_census_over_the_alarm_threshold_owes_a_profiling_followup` demands a row # in docs/timings/census-yellow-log.tsv keyed to THE RUN'S OWN TIMESTAMP. # That timestamp does not exist until the run finishes, and the delivery # commit is how the run's row reaches the ledger — so the acknowledgement can # never be present in the tree the delivery commit is checked against. Not # awkward: UNSATISFIABLE. Any census over CENSUS_ALARM_SECS could never # deliver at all. # # This went unnoticed until 2026-09-04 because a docs-only commit did not run # the prose-subject tests before The Nettle inverted that fast path. The # inversion is right and caught a real defect the same day; this interaction # is its one casualty. Two censuses blocked in fourteen hours # (campaign/the-plat 1019.1 s, campaign/the-weft 1188.9 s with 70 goldens # stranded) before it was diagnosed. # # THE OBLIGATION IS DEFERRED, NOT DISCHARGED, and that is what keeps this # from degrading the ratchet into a formality — the failure its own header # warns about. The row lands, and the very next ordinary commit runs the # alarm against it and refuses until a human records the finding. The look is # still forced; it simply happens when it is possible to record. # BOTH DURATION CHECKS STAND DOWN, NOT ONE, AND THE SECOND ONE COST A RUN. # # The block above describes this hazard exactly and fixed it for the ALARM: # a delivery commit cannot satisfy a check keyed to a row it is in the act # of committing. `the_latest_census_is_under_the_refusal_ceiling` was added # later (The Sluice), reads the same latest row of the same working-tree # docs/timings.md, and was never added here — so it reintroduced the # identical defect one severity up. # # WHAT THAT COSTS IS NOT A FAILED COMMIT, IT IS A DEADLOCK. A census over # the ceiling writes its own row, is refused, and leaves its goldens staged # in the SHARED census worktree; the next attempt re-measures (still slow), # `reset --hard`s that worktree — destroying the previous attempt's output — # and is refused again. Measured on 2026-09-13: campaign/the-tidemark's # 1898.859 s run was refused and its 109 moved goldens were destroyed by the # following run, at ~30 minutes of canonical-box time per attempt. # # AND THE ONLY ESCAPE WAS TO MOVE THE GUARD. That campaign re-derived the # duration pair honestly — from the established five-run series, explicitly # NOT from the red reading, with the derivation committed — which is the # sanctioned path and was well done. But "the campaign that needs the # threshold raised is the campaign that raises it" is the shape decision # 0016 exists to keep out of measurement, and a deadlock whose only exit is # a guard change manufactures that shape on demand. Removing the deadlock # removes the pressure; it does not lower the bar. # # DEFERRED, NOT DISCHARGED, on exactly the terms the alarm already has: the # merge of the delivery branch runs the full suite and demands the # re-statement from the campaign that submits it. docs_tests_exclude="" if [ -n "${HV_CENSUS_DELIVERY:-}" ]; then docs_tests_exclude="test(a_census_over_the_alarm_threshold_owes_a_profiling_followup) or test(the_latest_census_is_under_the_refusal_ceiling)" echo "pre-commit: HV_CENSUS_DELIVERY=1 — standing down BOTH census duration checks for this delivery." >&2 echo "pre-commit: both are keyed to this run's own row and cannot be satisfied before it exists." >&2 echo "pre-commit: the obligation is DEFERRED, not discharged — the merge of this delivery branch demands it." >&2 fi if ! HV_DOCS_TESTS_EXCLUDE="$docs_tests_exclude" make docs-tests; then echo "pre-commit: 'make docs-tests' failed — a staged docs change breaks a test whose subject is prose." >&2 echo "pre-commit: this is the check the merge queue would otherwise find on the canonical box." >&2 exit 1 fi exit 0 fi # THE COLUMN-COUNT WITNESS CANNOT BE SATISFIED BY A DELIVERY COMMIT either, so # it is stood down for that one commit — the third scoped opt-out under the # same variable, set by the same script (The Spillway, decision 0836). # # `domesday::anomaly::tests::evaluable_columns_measured_surface_on_the__column_census` # carries the census's metric-column count in its NAME and in two assertions, # and its doc-comment is a per-epoch narrative ("re-measure and update this"). # It is in the sub-floor roster by exact name, and it is what refused The # Warp's census delivery FIRST. No machine may re-pin it: that is the rule # separating this from the injection arms, which the delivery regenerates # itself — satisfy what a regeneration remedies, defer what needs a human. # DEFERRED, not discharged: the merge of the delivery branch runs the full # suite and demands the re-pin of the campaign that submits it, exactly as it # demands the calibration pins. scripts/test-census-guard.sh reads this # pattern out of the hook and asserts it omits exactly one roster term. subfloor_exclude="" if [ -n "${HV_CENSUS_DELIVERY:-}" ]; then subfloor_exclude='evaluable_columns_measured_surface_on_the_[0-9]+_column_census' echo "pre-commit: HV_CENSUS_DELIVERY=1 — standing down the census column-count witness for this delivery." >&2 echo "pre-commit: its name carries a count that does not exist until the census does; only a human re-states it." >&2 echo "pre-commit: the obligation is DEFERRED, not discharged — the merge of the delivery branch will demand the re-pin." >&2 fi if ! HV_SUBFLOOR_EXCLUDE="$subfloor_exclude" make gate-commit; then echo "pre-commit: 'make gate-commit' failed — fix fmt/clippy/type-audit/tests before committing." >&2 exit 1 fi