core/scripts/hooks/pre-push
Shay 4bf8f3be99 chore(ci): local pre-push gate (smoke + warmed_session pin) + T11 reset record
Weekly-audit 2026-07-22 closeout — T13 decision (3) CI gate + T11 execution.

- scripts/hooks/pre-push + install.sh: a core.hooksPath pre-push gate that runs
  the smoke suite PLUS the warmed_session consistency lane pin — the T13
  telemetry-consistency regression class that smoke does NOT cover. The full
  ~12k fast-lane stays async CI by design; the gate is deliberately targeted so
  it blocks the regression class without gridlocking pushes. Fail-closed on
  empty stdin; skips deletion-only pushes; emergency bypass git push --no-verify.

- scripts/ops/reset_candidate_corpus_t11_20260722.py: provenance record of the
  T11 live-store reset. The 465 discovery candidates predated the #100
  isolation fix and carried no per-record test/prod discriminator, so a surgical
  quarantine was impossible; ruling was to clear (not asterisk). Executed as an
  ADR-0219 atomic generation reset (empty candidate ledger, keep=1) — candidates
  465 -> 0, turn_count 14990 and identity lineage preserved, tainted generations
  GC'd. Data lives in gitignored engine_state/; this script is the audit trail.

- AGENTS.md: document the automated pre-push gate under the Local-First CI
  Validation Protocol.

- weekly-audit ledger: T10 merged (#100), T11 ruled+executed, T13 (2) hedge-arm
  ruling + (3) pre-push gate recorded.

[Verification]: smoke 180 passed (132.9s) + warmed_session lane 10 passed
(140.5s), exit 0 — worktree core-wt-infra @ base 9a428d84.
2026-07-22 22:28:55 -07:00

52 lines
2 KiB
Bash
Executable file

#!/bin/sh
# CORE local-first pre-push gate (weekly-audit T13, 2026-07-22).
#
# Automates the AGENTS.md §Local-First CI Validation Protocol "Pre-Push Gate":
# (1) the `smoke` suite — exact CI-gate parity, and
# (2) the warmed_session consistency lane pin — catches the T13
# telemetry-consistency regression class, which `smoke` does NOT cover
# (the #96 fail-closed resolve + #97 morph override escaped smoke and
# surfaced only in the warmed_session lane).
# The full ~12k fast-lane stays an ASYNC CI concern by design — this gate is
# deliberately targeted so it prevents the regression class without gridlocking
# the push cycle.
#
# Install (per clone): scripts/hooks/install.sh (sets core.hooksPath).
# Emergency bypass: git push --no-verify (defeats the gate — avoid).
set -u
z40="0000000000000000000000000000000000000000"
read_any=0
only_deletes=1
while read -r _local_ref local_sha _remote_ref _remote_sha; do
read_any=1
if [ "${local_sha}" != "${z40}" ] && [ -n "${local_sha}" ]; then
only_deletes=0
fi
done
# Fail-closed: run the gate unless we positively identified a deletion-only push.
if [ "${read_any}" -eq 1 ] && [ "${only_deletes}" -eq 1 ]; then
echo "[pre-push] deletion-only push — nothing to validate."
exit 0
fi
echo "[pre-push] CORE local-first gate: smoke suite + warmed_session lane pin"
echo "[pre-push] (1/2) smoke suite (core test --suite smoke) ..."
if ! uv run core test --suite smoke -q; then
echo "[pre-push] BLOCKED: smoke suite failed. Fix before pushing." >&2
echo "[pre-push] (emergency bypass, discouraged: git push --no-verify)" >&2
exit 1
fi
echo "[pre-push] (2/2) warmed_session consistency lane ..."
if ! uv run python -m pytest tests/test_warmed_session_lane.py -q; then
echo "[pre-push] BLOCKED: warmed_session lane failed (T13 regression class)." >&2
echo "[pre-push] (emergency bypass, discouraged: git push --no-verify)" >&2
exit 1
fi
echo "[pre-push] gate PASSED — push proceeding."
exit 0