1// Region-misconfig gate. Branch 2 (scanner-only) — per-region TTFB data gap.2//3// The intended Branch 1 (region-grouped TTFB metric) was preflight-tested but the4// CLI returned INTERNAL_ERROR for the `--group-by route --group-by function_region`5// combination, and SAML re-auth blocked single-dim verification (see Phase 0 in6// plans/wild-splashing-flamingo.md). Ship scanner-only with `evidence.dataGap` and7// add the query later when verifiable.8//9// Fires when a single-region pin is found AND the project has meaningful surface area10// (routes.length > 20). Skips multi-region configs (informational only).11export const metadata = {12 id: 'region_misconfig',
18 "A single function region is pinned in `vercel.json` or per-route `preferredRegion`. Without per-region TTFB data (data gap), the gate can't quantify the geographic latency cost — but a single-region pin on a project with 20+ routes is worth auditing against Speed Insights traffic geo.",
52 ? `all functions pinned to a single region (${regionList[0]}) on a project with ${routes.length} routes`
53 : `${regionList.length} different single-region pins across files`,
54 question: 'Are the pinned function regions aligned with the dominant user geography and the data source location? Speed Insights TTFB-by-country can ground the comparison.',