From 2ba30e1b9eb51bab638eff5053c4da5a375560b8 Mon Sep 17 00:00:00 2001 From: Art Date: Thu, 21 May 2026 22:22:48 +0300 Subject: [PATCH 1/2] =?UTF-8?q?chore(pre-push):=20flip=20=C2=A71.7=20+=20p?= =?UTF-8?q?rior-art=20substance=20arms=20warn-only=20=E2=86=92=20blocking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flip 3 defaults true→false so pre-push hard-fails (exit 1) instead of warning on real commits: - PA_SUBSTANCE_WARN_ONLY (§7 prior-art escape-hatch substance) - S17_WARN_ONLY (§9 §1.7 trailer presence) - S17_SUBSTANCE_WARN_ONLY (§9 §1.7 file:line citation) Enforcing branches (else → exit 1) already existed; only the defaults were warn-only. Calibration window (TODO 2026-06-10) overridden early per maintainer directive — earliest-reachable-channel enforcement now active at pre-push. Also updated stale TODO comments + warn-branch messages that still claimed "warn-only through 2026-06-10", so the hook no longer contradicts its own runtime state (documents-lie self-application). Self-test: 16 pass / 0 fail (packages/core/audit-self/pre-push.test.sh). Cases 4/8 assert function rc, not router default — unaffected by flip. Prior-art: skipped — not a capability commit (existing-file enforcement-mode flip, no new dep / no new ≥50-80 LOC file) --- .husky/pre-push | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.husky/pre-push b/.husky/pre-push index 7622ada3b..ad7257821 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -112,7 +112,7 @@ fi # Substance arm (Wave 8.4): on capability commits, the `Prior-art: skipped — …` # escape-hatch is rejected (exit 2 from pa_check_trailer); must cite a real SSOT # entry (prior-art-evaluations.md#N). PA_SUBSTANCE_WARN_ONLY gates independently. -# TODO 2026-06-10: flip default to PA_SUBSTANCE_WARN_ONLY=false; promote enforcement. +# Enforcing by default since 2026-05-21 (flipped early per maintainer directive); set PA_SUBSTANCE_WARN_ONLY=true for local downgrade. UPSTREAM_REF="origin/main" if git rev-parse --verify "$UPSTREAM_REF" &>/dev/null; then COMMITS=$(git rev-list "${UPSTREAM_REF}..HEAD" 2>/dev/null || true) @@ -244,7 +244,7 @@ if git rev-parse --verify "$UPSTREAM_REF" &>/dev/null; then return 1 } - PA_SUBSTANCE_WARN_ONLY="${PA_SUBSTANCE_WARN_ONLY:-true}" + PA_SUBSTANCE_WARN_ONLY="${PA_SUBSTANCE_WARN_ONLY:-false}" PRIOR_ART_FAILURES="" PA_SUBSTANCE_FAILURES="" for sha in $COMMITS; do @@ -276,7 +276,7 @@ if git rev-parse --verify "$UPSTREAM_REF" &>/dev/null; then if [ "$PA_SUBSTANCE_WARN_ONLY" = "true" ]; then printf '\n⚠ Prior-art: escape-hatch on capability commit (substance arm, Wave 8.4):\n' printf '%b' "$PA_SUBSTANCE_FAILURES" - printf '\nCalibration window: warn-only through 2026-06-10.\n' + printf 'Local downgrade active (*_WARN_ONLY=true); default is enforcing.' printf 'Fix: replace `Prior-art: skipped — …` with `Prior-art: prior-art-evaluations.md#N (verdict X — rationale)`.\n\n' else printf '\n❌ Prior-art: escape-hatch on capability commit:\n' @@ -304,16 +304,17 @@ if git rev-parse --verify "$UPSTREAM_REF" &>/dev/null; then # distinguish substance failures from missing-trailer failures (exit 1). # S17_SUBSTANCE_WARN_ONLY matures independently from S17_WARN_ONLY so the # substance arm can be calibrated without flipping the presence gate. - # TODO 2026-06-10: flip default to S17_WARN_ONLY=false; promote enforcement. - # TODO 2026-06-10: flip default to S17_SUBSTANCE_WARN_ONLY=false; promote substance enforcement. + # Enforcing by default since 2026-05-21 (flipped early per maintainer directive); set + # S17_WARN_ONLY=true / S17_SUBSTANCE_WARN_ONLY=true for local downgrade. + # Wave 8.5 historical cutoff. Commits authored before this date predate # the substance arms; replayed (e.g. rebased) historical commits MUST NOT # be retroactively blocked by gates that didn't exist when they were authored. S17_HISTORICAL_CUTOFF="2026-05-12" PA_HISTORICAL_CUTOFF="2026-05-12" - S17_WARN_ONLY="${S17_WARN_ONLY:-true}" - S17_SUBSTANCE_WARN_ONLY="${S17_SUBSTANCE_WARN_ONLY:-true}" + S17_WARN_ONLY="${S17_WARN_ONLY:-false}" + S17_SUBSTANCE_WARN_ONLY="${S17_SUBSTANCE_WARN_ONLY:-false}" S17_ALLOWLIST_RE='^(docs\(research-patches\)|chore\(snapshot-regen\)|chore\(prior-art-update\)):' s17_is_discipline_introducing() { @@ -427,7 +428,7 @@ if git rev-parse --verify "$UPSTREAM_REF" &>/dev/null; then if [ "$S17_WARN_ONLY" = "true" ]; then printf '\n⚠ §1.7 trailer missing or invalid on rule-introducing commit(s):\n' printf '%b' "$S17_FAILURES" - printf '\nCalibration window: warn-only through 2026-06-10 (30 days from ship). Set S17_WARN_ONLY=false to enforce locally.\n' + printf 'Local downgrade active (*_WARN_ONLY=true); default is enforcing.' printf 'Fix: add `§1.7: forward-check applied — …; backward-check sweep — …` to commit body.\n\n' else printf '\n❌ §1.7 trailer missing or invalid on rule-introducing commit(s):\n' @@ -442,7 +443,7 @@ if git rev-parse --verify "$UPSTREAM_REF" &>/dev/null; then if [ "$S17_SUBSTANCE_WARN_ONLY" = "true" ]; then printf '\n⚠ §1.7 trailer lacks file:line citation on rule-introducing commit(s) (substance arm — Wave 8.3):\n' printf '%b' "$S17_SUBSTANCE_FAILURES" - printf '\nCalibration window: warn-only through 2026-06-10. Set S17_SUBSTANCE_WARN_ONLY=false to enforce locally.\n' + printf '\Local downgrade active (*_WARN_ONLY=true); default is enforcing.' printf 'Fix: include ≥1 file:line citation, e.g. `packages/core/principles/02.test.ts:82`.\n\n' else printf '\n❌ §1.7 trailer lacks file:line citation on rule-introducing commit(s) (substance arm — Wave 8.3):\n' From 454a4a323f031707324937235e616c52631f1fce Mon Sep 17 00:00:00 2001 From: Art Date: Thu, 21 May 2026 23:25:46 +0300 Subject: [PATCH 2/2] =?UTF-8?q?fix(pre-push):=20keep=20PA-substance=20warn?= =?UTF-8?q?-only=20(Option=20B)=20=E2=80=94=20conflicts=20with=20CLAUDE.md?= =?UTF-8?q?=20escape=20hatch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The prior commit's flip made PA_SUBSTANCE_WARN_ONLY enforce, which blocks `Prior-art: skipped — refactor only` on capability-detected commits — contradicting the documented escape hatch in CLAUDE.md and breaking prior-art-trailer-hook.test.sh Test 3 (capability + valid escape → expected exit 0, got 1). Revert PA_SUBSTANCE_WARN_ONLY to warn-only default. §1.7 arms (S17_WARN_ONLY + S17_SUBSTANCE_WARN_ONLY) stay enforcing — they have no escape-hatch conflict. PA-substance enforcement deferred to the CI backstop (no pre-push escape-hatch conflict there) or a separate maintainer-owned CLAUDE.md contract revision. Also fixed a \L→\n printf typo on the S17 substance warn branch. Tests: pre-push.test.sh 16/0; prior-art-trailer-hook.test.sh 8/0. Prior-art: skipped — not a capability commit (enforcement-mode revert in existing hook file, no new dep / no new ≥50-80 LOC file) --- .husky/pre-push | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.husky/pre-push b/.husky/pre-push index ad7257821..b457eb55a 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -112,7 +112,8 @@ fi # Substance arm (Wave 8.4): on capability commits, the `Prior-art: skipped — …` # escape-hatch is rejected (exit 2 from pa_check_trailer); must cite a real SSOT # entry (prior-art-evaluations.md#N). PA_SUBSTANCE_WARN_ONLY gates independently. -# Enforcing by default since 2026-05-21 (flipped early per maintainer directive); set PA_SUBSTANCE_WARN_ONLY=true for local downgrade. +# PA_SUBSTANCE_WARN_ONLY stays warn-only (default true): enforcing it conflicts with the documented `skipped — refactor only` escape hatch in CLAUDE.md (PR #115, Option B). §1.7 arms are enforcing as of 2026-05-21. + UPSTREAM_REF="origin/main" if git rev-parse --verify "$UPSTREAM_REF" &>/dev/null; then COMMITS=$(git rev-list "${UPSTREAM_REF}..HEAD" 2>/dev/null || true) @@ -244,7 +245,7 @@ if git rev-parse --verify "$UPSTREAM_REF" &>/dev/null; then return 1 } - PA_SUBSTANCE_WARN_ONLY="${PA_SUBSTANCE_WARN_ONLY:-false}" + PA_SUBSTANCE_WARN_ONLY="${PA_SUBSTANCE_WARN_ONLY:-true}" PRIOR_ART_FAILURES="" PA_SUBSTANCE_FAILURES="" for sha in $COMMITS; do @@ -276,7 +277,7 @@ if git rev-parse --verify "$UPSTREAM_REF" &>/dev/null; then if [ "$PA_SUBSTANCE_WARN_ONLY" = "true" ]; then printf '\n⚠ Prior-art: escape-hatch on capability commit (substance arm, Wave 8.4):\n' printf '%b' "$PA_SUBSTANCE_FAILURES" - printf 'Local downgrade active (*_WARN_ONLY=true); default is enforcing.' + printf '\nWarn-only (PA_SUBSTANCE_WARN_ONLY default true); set =false to enforce. Enforcing conflicts with CLAUDE.md escape hatch — see PR #115.\n' printf 'Fix: replace `Prior-art: skipped — …` with `Prior-art: prior-art-evaluations.md#N (verdict X — rationale)`.\n\n' else printf '\n❌ Prior-art: escape-hatch on capability commit:\n' @@ -443,7 +444,7 @@ if git rev-parse --verify "$UPSTREAM_REF" &>/dev/null; then if [ "$S17_SUBSTANCE_WARN_ONLY" = "true" ]; then printf '\n⚠ §1.7 trailer lacks file:line citation on rule-introducing commit(s) (substance arm — Wave 8.3):\n' printf '%b' "$S17_SUBSTANCE_FAILURES" - printf '\Local downgrade active (*_WARN_ONLY=true); default is enforcing.' + printf 'Local downgrade active (*_WARN_ONLY=true); default is enforcing.' printf 'Fix: include ≥1 file:line citation, e.g. `packages/core/principles/02.test.ts:82`.\n\n' else printf '\n❌ §1.7 trailer lacks file:line citation on rule-introducing commit(s) (substance arm — Wave 8.3):\n'