Application map / References / Push gate

The Push Gate (no-mistakes)

The operating model for the nine-step pre-share validation pipeline that gates every substantive push to the product monorepo.

Posture: prefer mature, proven mechanisms (GitHub branch protection, managed runners, launchd, upstream configuration) over custom glue. Optimize for correctness-gate value per wall-clock hour, not for making the pipeline merely feel fast.

Provenance note: the corpus doc this page replaces deferred its "present state" to a NoMistakesNow.md that never existed — that pointer dangled from the start. This page is the operating doc; run records live with the tool.

What it is

A locally-installed git-push gate: pushing a branch to it intercepts the push and runs a nine-step serial pipeline — intent → rebase → review → test → document → lint → push → PR → CI babysit — each step executed by a fresh AI agent, before the change reaches the shared remote as a PR. It is the sole correctness gate for the two-app monorepo and it catches real defects across parallel agent-driven branches.

Behavioral properties that shape everything else

The operating model

  1. CI executes exactly once. The mirrored second CI system's workflows are deleted; GitHub Actions is the single orchestrator. Managed runners participate as runners (a label swap that keeps check names), never as a second CI system.
  2. Cadence: one run per PR-ready branch push. Not per commit (runs cost tens of minutes and a re-push supersedes anyway) and not per merge (nothing new exists at merge time). "Every merge is validated" is enforced by branch protection on main — required checks, PRs required, no direct pushes — a mature GitHub feature, not glue. Both workflows drop their paths: filters on PR triggers so every required check reports on every PR (a required check that never reports blocks the merge forever).
  3. Monitoring is two layers. The driving protocol for the live session: start with a rich --intent; poll status non-blocking; on a parked gate, respond — fixing findings you can judge and escalating ask-user findings to a human (the permission layer blocks agents from self-answering them); treat outcome: checks-passed as done — report the PR link and hand the merge to the human, never wait for the merge. The structural backstop: a launchd babysitter, session-independent, that reaps hung CI-fix agents (safe — the kill burns one retry attempt) and surfaces parked runs and hung non-CI steps for a human/agent decision. This babysitter is deliberately the only custom glue in the design.
  4. Configuration: bounded idle CI timeout; review auto-fix disabled (findings are judgment calls); fully unattended --yes runs only on explicit per-conversation consent; concurrent runs on different branches allowed.
  5. Deliberately kept: local test/lint duplicating CI (catching before sharing is the point), the document step, and a redundant independent build signal as an honest cross-check.
  6. The test step is provisioned, not improvising: deterministic step commands from committed pipeline config, real credentials at runtime through the machine-authed secrets manager, the proven test framework as both test framework and browser tool, and standing guidance inlined verbatim into every pipeline agent (injection is the only reliable channel — "see the other file" pointers are weak links).

Stall taxonomy (how to read a "hung" run)

Looks likeActually isOwner
Running for hours, no progressA genuinely hung fix agent — no built-in watchdog will unwedge itBabysitter kills CI-fix agents; humans/agents abort-then-rerun other steps
Stuck at "awaiting response"A gate parked waiting for a respond nobody is givingWhoever picks it up drives it; babysitter surfaces it
A terminal that never returnsA blocking client process left behind by an ended session — the run itself kept workingKill the client; the daemon runs rounds in the background
"Running" long after greenThe post-checks-passed babysit window — cosmeticNobody; merge the PR and the monitor retires