#!/bin/bash # local-gate.sh - Run every quality check that works on a dev machine and # print a PASS/FAIL table. # # Why: CI runs ZERO tests and ZERO lint (the only PR gate is that images # build and staging boots healthy). This script IS the pre-push gate. # # Scope (deliberate): # - backend lint, type-check, UNIT tests only (--forceExit; open pg/redis # handles otherwise hang jest). Integration tests are EXCLUDED: they # need a live database and some DROP TABLE CASCADE (owner non-negotiable: # never without a fresh backup). audit-log __tests__ also need a DB and # are excluded via path pattern. # - frontend lint, type-check. Frontend jest is broken outside the # container (2026-07-07), so no frontend tests here. # # Usage: ./local-gate.sh (needs node_modules in backend/ and frontend/: # run "npm install" in each first) # Exit: 0 = all pass, 1 = at least one failure set -u ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" [ -z "$ROOT" ] && { echo "ERROR: not inside a git repo" >&2; exit 2; } LOGDIR="${TMPDIR:-/tmp}/mvp-local-gate.$$" mkdir -p "$LOGDIR" RESULTS="" OVERALL=0 run_step() { # run_step