Something went wrong. Try again.
Something went wrong. Try again.
1.4 kB 33 lines
at public
12345678910111213141516171819202122232425262728293031323334#!/usr/bin/env bash# Pre-commit hook: FAST (~2s). High-signal, low-cost.## Runs ruff bug-classes on staged source + a curated fast-test gate that# rebuilds the kernel, guards against a stale binary, and proves the# load-bearing claims end-to-end (3 4 + . -> 7), the dragon trapnet, the# cave size budget, the print path, and branch logic.## The comprehensive gate (full suite) lives in pre-push — commit is for fast# feedback, push is for the full net. Phantom state thrives in hidden output;# each phase announces itself before it runs.set -euo pipefailcd "$(git rev-parse --show-toplevel)"
# Only relevant if Python/build config changed. A docs-only commit skips.if ! git diff --cached --name-only | grep -qE '\.(py|toml)$|Makefile|^hooks/'; then echo "── pre-commit: no .py/.toml/Makefile changes — skipping ──" exit 0fi
echo "── pre-commit: ruff bug-classes (src + test) ──"ruff check src/ test/ --select F821,F811,E722,W605
echo "── pre-commit: fast gate (build + staleness + integration + trapnet + size) ──"uv run python -m src.build_kernel >/dev/nulluv run pytest -q \ test/test_precompiled_kernel.py::TestStalenessGuard \ test/test_kernel_integration.py \ test/test_trapnet.py \ test/test_size_budget.py \ test/test_dot_hunt.py \ test/test_conditionals.pyecho "── pre-commit: done ──"