feat(hooks): flip §1.7 (S17) arms to blocking by default (Wave 10.3 TS port) - #119
Merged
Conversation
…S port) s17Section() in pre-push.ts: default S17_WARN_ONLY and S17_SUBSTANCE_WARN_ONLY from 'true' (warn) to 'false' (blocking). The §1.7 discipline-trailer gate now hard-fails (exit 1) on rule-introducing commits lacking a valid §1.7 trailer / file:line citation, instead of only warning. Calibration window (2026-06-10) overridden early per maintainer directive. PA_SUBSTANCE_WARN_ONLY (pre-push.ts) stays warn-only — flipping it blocks the documented `Prior-art: skipped — refactor only` escape hatch (CLAUDE.md) and breaks prior-art-trailer-hook.test.sh; that contract change is deferred (Option B). Targets the Wave 10.3 TS port; the prior bash homes (.husky/pre-push, legacy-trailer-checks.sh) no longer exist on main. Updated the function doc comment, the call-site comment, and both warn-branch messages so the file states its runtime mode truthfully (no stale "warn-only through 2026-06-10"). Added regression guards (cold-review finding): s17-trailer-hook.test.sh tests 7 & 8 exercise the ENFORCING DEFAULT with env UNSET (prior tests only covered the explicit =false override) — a revert of the default to 'true' now fails CI. Verified: vitest hooks 128/128; s17-trailer-hook.test.sh 8/0; prior-art-trailer-hook.test.sh 8/0 (PA unaffected); tsc clean; default (env unset) blocks discipline commit w/o §1.7 (exit 1); load-bearing proof — forced warn-mode on the same scenario exits 0 (tests 7/8 discriminate). Prior-art: skipped — not a capability commit (config-default flip + test guard in existing TS hook, no new dep / no new ≥50-80 LOC file)
artyhoo
added a commit
that referenced
this pull request
May 21, 2026
…last-resort gate) (#121) Add `pr-commit-trailers` job to audit-self.yml: runs the pre-push §1.7 (s17) and §7 (prior-art) trailer checks over the real PR commit range (origin/main..HEAD) via the PREPUSH_ONLY seam in pre-push.ts. Reuses the exact TS check logic — no duplication (dual-implementation-discipline #two-prompts-drift). Closes the gap surfaced this session: those checks ran ONLY at pre-push (developer machine), so `--no-verify` bypassed them with no CI mirror and no log. Also the HARD prereq for the automerge→staging plan (green CI must actually gate trailer discipline before native auto-merge). §1.7 is HARD-ENFORCED in CI (S17_WARN_ONLY=false on the step), NOT mirrored: a cold-review caught that mirroring the pre-push warn-only default would leave the §1.7 step green-but-never-blocking until the pre-push flip (#119) lands — a named gate that never fires (false-negative theatre). The CI last-resort gate is strict regardless of the calibration default. §7 base (missing/invalid trailer) always blocks; §7 substance (`Prior-art: skipped` escape hatch) stays warn-only — Option B, the documented CLAUDE.md escape must not be hard-blocked. PR-only gate; checks out the PR head SHA (not the synthetic merge commit) so the range resolves to the authored PR commits. Validated: YAML parse OK; actionlint OK; zizmor clean; with the override a discipline commit lacking §1.7 exits 1, without it exits 0 (theatre case) — the override is load-bearing; §7 base blocks on a capability commit without trailer (s17/prior-art fixture suites). Prior-art: skipped — not a capability commit (CI workflow job addition, no new dep / no new ≥50-80 LOC file under packages)
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.
What
s17Section()inpackages/core/hooks/pre-push.ts: flip the default ofS17_WARN_ONLYandS17_SUBSTANCE_WARN_ONLYfrom'true'(warn-only) to'false'(blocking). The §1.7 discipline-trailer pre-push gate now hard-fails (exit 1) on rule-introducing commits lacking a valid§1.7:trailer / file:line citation, instead of only warning. Calibration2026-06-10overridden early per maintainer directive.Scope correction (parallel-session churn)
The original attempt (#115, closed) edited the legacy bash
.husky/pre-push, but Wave 10.1–10.3 (#107/#114/#116) migrated §1.7 to TS and deletedlegacy-trailer-checks.sh. This PR targets the current home:pre-push.ts(logic inchecks/s17.ts). Built in a worktree off freshorigin/main, rebased onto latest before push.Option B preserved
PA_SUBSTANCE_WARN_ONLYstays warn-only — flipping it blocks the documentedPrior-art: skipped — refactor onlyescape hatch (CLAUDE.md) and breaksprior-art-trailer-hook.test.sh. Deferred (prior decision).Honesty (documents-lie)
Updated the function doc comment, the call-site comment, and both warn-branch messages so the file no longer claims "warn-only through 2026-06-10".
Regression guard (cold-review finding)
Prior tests only covered the explicit
=falseoverride — a revert of the default to'true'would have passed CI silently. Addeds17-trailer-hook.test.shtests 7 & 8: discipline commit with env UNSET → must exit non-zero. Load-bearing proof: forcing warn-mode on the same scenario exits 0 (the new tests discriminate block vs warn).Verification
vitest packages/core/hooks→ 128/128s17-trailer-hook.test.sh→ 8/0prior-art-trailer-hook.test.sh→ 8/0 (PA unaffected)tsc --noEmitcleanexit 1;S17_WARN_ONLY=truedowngrades →exit 0Note for Wave 10.x
§1.7 now enforces by default in
pre-push.ts; carry the enforcing default forward in any further refactor.