Skip to content

feat(hooks): flip §1.7 (S17) arms to blocking by default (Wave 10.3 TS port) - #119

Merged
artyhoo merged 1 commit into
mainfrom
chore/flip-s17-default-blocking
May 21, 2026
Merged

feat(hooks): flip §1.7 (S17) arms to blocking by default (Wave 10.3 TS port)#119
artyhoo merged 1 commit into
mainfrom
chore/flip-s17-default-blocking

Conversation

@artyhoo

@artyhoo artyhoo commented May 21, 2026

Copy link
Copy Markdown
Owner

What

s17Section() in packages/core/hooks/pre-push.ts: flip the default of S17_WARN_ONLY and S17_SUBSTANCE_WARN_ONLY from '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. Calibration 2026-06-10 overridden 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 deleted legacy-trailer-checks.sh. This PR targets the current home: pre-push.ts (logic in checks/s17.ts). Built in a worktree off fresh origin/main, rebased onto latest before push.

Option B preserved

PA_SUBSTANCE_WARN_ONLY 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. 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 =false override — a revert of the default to 'true' would have passed CI silently. Added s17-trailer-hook.test.sh tests 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/128
  • s17-trailer-hook.test.sh → 8/0
  • prior-art-trailer-hook.test.sh → 8/0 (PA unaffected)
  • tsc --noEmit clean
  • default (env unset) blocks discipline commit w/o §1.7 → exit 1; S17_WARN_ONLY=true downgrades → exit 0
  • adversarial cold-review (Opus) on the diff: SHIP-WITH-FIXES → both fixes applied

Note for Wave 10.x

§1.7 now enforces by default in pre-push.ts; carry the enforcing default forward in any further refactor.

…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
artyhoo merged commit 66df1d9 into main May 21, 2026
32 checks passed
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)
@artyhoo
artyhoo deleted the chore/flip-s17-default-blocking branch May 22, 2026 18:08
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