#!/bin/sh
# P0 fase B (audit 2026-08-26): the gate runs before anything leaves the
# machine. Fast static checks first, the vitest suite last; the
# browser-dependent validators (morfo:check, perm:check, smoke, layer:check)
# stay manual — they need a dev server.
#
# NOT ARMED until fase A is green: arm with
#   cp scripts/hooks/pre-push .git/hooks/pre-push
# `lint` is deliberately NOT in the gate yet: the tree carries ~2,300 files
# of pre-existing format debt (never formatted repo-wide; no CI ever ran it).
# The pending one-shot is: `npm run format` as its own commit on a quiet
# tree, then add `npm run lint &&` back to the `gate` script.
#
# Skipping this hook (--no-verify) is forbidden by CLAUDE.md except when the
# user explicitly asks.
echo "pre-push: running npm run gate (fast checks + tests)..."
npm run gate || {
	echo "pre-push: gate FAILED — push rejected."
	exit 1
}
