◐ Shell
clean mode source ↗

Fix syntax error in .mention-bot by berkerpeksag · Pull Request #361 · python/cpython

SonicField added a commit to SonicField/cpython that referenced this pull request

@SonicField

…first

Implements queue item 9 per supervisor 18:04:09Z disposition of pythia python#361
substantive (3) — replaces description-only feedback_compile_before_commit
(D-1776482908, 2026-04-22) enforcement with actual git pre-commit hook that
BLOCKS commits on build failure.

Closes the 13-day enforcement gap that produced today's c4 three-amend
cycle (2026-05-12 14:14Z linker fail, 15:33Z compile fail, 15:53Z PASS).
Per pythia python#361 + supervisor 16:49:09Z: 'enforcement-gap-detection-as-yet
-another-rule' superseded by structural git hook that runs the build.

Behaviour:
- Runs scripts/build_phoenix.sh (incremental build, no --clean by default;
  catches the c4 failure class at ~1-2min budget vs 5-10min for clean)
- Exit 0 -> commit proceeds; non-0 -> commit BLOCKED with log path + last
  40 lines of build output + actionable hint
- Skip path-pattern: docs/*, *.md, docs/benchmarks/*, docs/gates/* — pure
  doc/data commits don't run the build
- Opt-out via PHOENIX_SKIP_BUILD_CHECK=1 (USE WITH CARE; trailer in commit
  msg per reviewer-audit pattern)
- Self-contained: if scripts/build_phoenix.sh isn't found, hook exits 0
  (do not block); if not in a git repo, hook exits 0 (do not block)

Install (one-time, per-clone):
  ln -s ../../scripts/pre-commit-build-check.sh .git/hooks/pre-commit

Why incremental, not --clean:
- Pre-commit budget ~1-2min (clean is 5-10min, would discourage hook use)
- Incremental catches the c4 class (linker undef-symbol, compile errors
  in .h inline definitions, missing decl visibility)
- --clean still recommended after JIT header layout changes per CLAUDE.md
  'JIT Header Change Protocol' — hook does NOT replace that protocol,
  only catches the more common 'I forgot to compile' class

Single doc/script commit (scripts/ class). Codification batch with
post-c7 docs per supervisor 17:19:32Z plan.