/** * Is this one ground, or two? The physical half of venue identity — capacity * and position — kept apart from the name half. * * Names cannot answer this question and never could. "Anfield" is a whole-word * subset of "Anfield Sports and Community Centre", "Şəhər stadionu" is what the * supplier calls both Tovuz's and Ganja's city stadiums, and two Buenos Aires * grounds are both "Estadio Islas Malvinas". In each case the names agree and * the grounds do not — a 61,276-seat stadium is not a 1,000-capacity artificial * pitch a kilometre away, whatever they are called. * * **A missing measurement is evidence of a different KIND of ground, not * licence to skip the test.** This is the inversion the module exists for. The * ven-8 venue tooling guarded capacity as * * if (ca && cb && Math.min(ca, cb) / Math.max(ca, cb) < CAPACITY_TOLERANCE) * * which protects only the pairs where BOTH numbers are known — the pairs least * likely to be wrong — while the side that lacks a capacity is systematically * the small ground. That is how Liverpool FC's Anfield came to hold supplier id * 12137, Anfield Sports Community Centre, and why Lower Breck's fixtures * rendered at a Premier League stadium. So `unknown` is its own verdict here * and callers must decide what to do with it; it is never silently `same`. * * Distance is the weaker half and is deliberately secondary: the community * centre is 1.13km from Anfield, so a 1km proximity rule barely separated them, * while the capacity ratio was 0.016. * * Two callers, one rule (the `deriveGlobalRanks` precedent): * `weekendgoals-scraper/src/venues/venue-claim-verification.ts` at fixture * time, where a claimed venue rarely states either measurement, and * `api-gateway/scripts/audit-absorbed-venue-ids.ts`, which asks the supplier * for both records precisely so it can. */ /** Two known capacities at least this close describe one ground. */ export declare const CAPACITY_SAME_GROUND_RATIO = 0.9; /** * Two known capacities further apart than this are not one ground under any * reading. Between this and `CAPACITY_SAME_GROUND_RATIO` is a renovation, and * the band is calibrated on the widest legitimate one measured: Vejlby * Stadion's 5,200 and Ceres Park Vejlby's 12,000 are the same stadium before * and after its 2024-25 rebuild — a ratio of **0.433** — and * `api-gateway/scripts/reviewed/vejlby-stadium-merge.csv` merged them on * evidence. So the floor sits clear below that rather than at a round 0.5, * which would have called that merge `different`. * * A ground whose capacity changed by more than this has not been renovated; it * has been replaced, and a replacement usually moves too. Every wrong absorb in * the 2026-08-27 audit that this catches is far below it — Anfield 0.016, Braga * 0.041, Gran Canaria 0.062, Ganja 0.260 — and the two that sit above (Szegedi * 0.363, Frosinone 0.620) are caught by distance instead, which is the point of * having both halves. */ export declare const CAPACITY_DIFFERENT_GROUND_RATIO = 0.3; /** Coordinates this close are the same place. */ export declare const SAME_SPOT_KM = 1; export interface VenuePhysical { capacity?: number | null; /** GeoJSON order: `[longitude, latitude]`. */ coordinates?: [number, number] | number[] | null; } export type VenueIdentityVerdict = "same" | "different" | "unknown"; export interface VenueIdentityAssessment { verdict: VenueIdentityVerdict; reason: string; /** `min/max` of the two capacities, when both are known. */ capacityRatio?: number; /** Great-circle kilometres, when both coordinates are known. */ distanceKm?: number; } /** Great-circle distance in km between two `[longitude, latitude]` points. */ export declare function haversineKm(a: [number, number] | number[], b: [number, number] | number[]): number; /** * Assess two grounds on their physical measurements alone, saying nothing about * their names. * * `different` is returned only on evidence: capacities more than * `CAPACITY_DIFFERENT_GROUND_RATIO` apart, or positions more than * `SAME_SPOT_KM` apart. Capacity is checked first because it is the stronger * signal — the Anfield pair was 0.016 on capacity and only 1.13km on distance. * * `unknown` means a measurement is missing on at least one side. A caller that * treats `unknown` as `same` has rebuilt the bug this module documents. */ export declare function assessVenueIdentity(a: VenuePhysical, b: VenuePhysical): VenueIdentityAssessment; //# sourceMappingURL=venue-identity.d.ts.map