---
title: Make league gates fail closed on tooling errors
type: task
status: planned
description: >-
  League db/gates checks conflate a tooling error with a finding or a pass; make exit 2 universal
  for tooling errors, fix the unresolvable --base ref that reads as GATE OK, and ratchet negative
  controls and coverage denominators gate by gate.
base_uri: user:task/league/make-league-gates-fail-closed-on-tooling-errors.md
created_at: '2026-09-30T05:55:22.261Z'
entity_id: a5292aae-af9f-4abd-ab65-0b6b727fc805
owner_identity_uri: █████████████████████████
priority: Medium
public_read: true
tags:
  - user:tag/league-xo-football.md
updated_at: '2026-09-30T05:55:22.261Z'
visibility_analyzed_at: '2026-11-05T23:49:40.725Z'
---

Gates in `repository/active/league/db/gates/` must never report a pass, or a finding, when the real cause is a tooling error. Origin is [[████████████████████████-██-████████████████████-██████-██████-███████-████████]]. Its consolidation half is dead: the player and fantasy-stat repoint gates were archived to `db/archive/`. The loose ends below are what survives.

## Plan

- [ ] `check-renamed-column-consumers.mjs`: when the `--base` ref cannot be read, gate 2 sets `skipped` and still exits 0 (`process.exitCode` near line 957 counts only findings and failed controls). Make an unreadable ref exit 2, and prove it red with a garbage ref. Origin: [[████████████████████████-██-████████████████████-██████-██████-███████-████████]].
- [ ] Make exit 2 the tooling-error code in every gate. On 2026-09-30, 20 of 33 `check-*.mjs` gates use exit 2. `check-conflated-player-rows.mjs` without a production tunnel is the known case where a crash exits 1 and looks like a finding.
- [ ] Negative-control ratchet: 22 of 33 gates reference `negative-control.mjs` today. Add controls gate by gate, then decide whether `scripts/check-cluster-gates.mjs` should enforce them.
- [ ] Coverage denominators: a gate that takes an input set should report how much of it was anchored, and fail when anchored is less than given. Start with `check-plays-column-repoint.mjs`.
- [ ] Reconcile how the conformance ratchet and the drift gate treat stale adjudications, in one direction.

## Constraints

- Run eslint and prettier on changed files before committing, and use explicit pathspecs. The checkout is shared.
- Never accept a green you have not shown can go red.
- No DDL and no deploy.
