diff --git a/scripts/check-api-validation-contracts.ts b/scripts/check-api-validation-contracts.ts index 3f66bbc8a2f..bb66f38e3f8 100644 --- a/scripts/check-api-validation-contracts.ts +++ b/scripts/check-api-validation-contracts.ts @@ -8,6 +8,17 @@ const CONTRACTS_DIR = path.join(ROOT, 'apps/sim/lib/api/contracts') const QUERY_HOOKS_DIR = path.join(ROOT, 'apps/sim/hooks/queries') const SELECTOR_HOOKS_DIR = path.join(ROOT, 'apps/sim/hooks/selectors') +/** + * `totalRoutes` is reported, never gated. + * + * The invariant worth holding is that every route is contract-backed, and + * `nonZodRoutes` states exactly that: it is 0, and rises the moment a route ships + * without one. Failing on the total as well meant a fully compliant new route + * still turned CI red, fixable only by editing the number here. A ratchet + * survives on the habit of never bumping it casually, and a gate that must be + * bumped to add a compliant route teaches precisely the opposite habit — on a + * file whose other seven baselines depend on that habit holding. + */ const BASELINE = { totalRoutes: 1162, zodRoutes: 1162, @@ -1373,9 +1384,6 @@ async function main() { if (!checkOnly) return const failures: string[] = [] - if (totalRoutes > BASELINE.totalRoutes) { - failures.push(`route count increased from ${BASELINE.totalRoutes} to ${totalRoutes}`) - } if (nonZodRoutes > BASELINE.nonZodRoutes) { failures.push( `non-Zod routes increased from ${BASELINE.nonZodRoutes} to ${nonZodRoutes} (${zodRoutes} Zod-backed routes)`