/** * Ground-truth validation for the Impect documentation set. * * The Impect corpus is built from one source only: the public open-data * repository at https://github.com/ImpectAPI/open-data. Everything in * docs/impect/ must be traceable to it — enum members, KPI names and IDs, and * field names all appear in that repository, so anything else in the docs is an * invention and should fail the build. * * Two halves: * * 1. A generator (CLI) that reads a local clone of the open-data repository * and writes data/impect-open-data-truth.json. Maintainer-only; needs the * clone, so it is not run in CI. * * 2. validateImpectDocs(), a pure function run by the test suite against the * committed truth file. No clone required. * * Usage: * pnpm impect:truth # uses IMPECT_OPEN_DATA_DIR * pnpm impect:truth -- --dir /path/to/open-data */ export declare const OPEN_DATA_REPO = "https://github.com/ImpectAPI/open-data"; export interface ImpectTruth { source: { repo: string; commit: string; generated_at: string; matches: number; events: number; }; /** Enum members observed in the snapshot, by field name. */ enums: Record; /** KPI id (as string) -> machine name, from kpi_definitions.json. */ kpis: Record; /** ISO and FIFA country codes from countries.json. */ countryCodes: string[]; } /** * Guards against Impect's commercial API surface reappearing in the corpus. * Assembled patterns rather than literal strings: this file is the enforcement * mechanism, so it should not carry a copy of what it exists to keep out. */ export declare const FORBIDDEN_PATTERNS: Array<{ label: string; pattern: RegExp; }>; /** Build the truth file from a local clone of the open-data repository. */ export declare function generateTruth(openDataDir: string, commit: string, generatedAt: string): ImpectTruth; export interface DocFile { file: string; text: string; } /** Every SCREAMING_SNAKE_CASE token inside a backtick code span. */ export declare function extractUppercaseTokens(text: string): string[]; /** * Check the Impect docs against the open-data ground truth. * Returns a list of human-readable violations; empty means clean. */ export declare function validateImpectDocs(docs: DocFile[], truth: ImpectTruth): string[]; export declare function loadTruth(path?: string): ImpectTruth;