/** * Shared primitives for the radar/freshness subsystem (#1498). * * Write-side counterpart to the read-only corpus-views renderers. Ports the * common helpers from corpus/radar_init.py + radar_report.py: * - externalized cluster map (mechanism only — the literal REF-range table * from radar_init.guess_cluster is NOT ported; the corpus supplies its own * `documentation/radar/clusters.yaml`, per the #1498 "don't port the literal * ranges" requirement), * - GRADE extraction from the analysis doc (improved over the Python source: * also matches the `**Quality**: A-` form the canonical/expanded reference * templates use, and preserves the +/- sign the Python `([A-D])` dropped), * - citation-sidecar title/authors, * - the radar-sidecar loader. * * @source historical: corpus/radar_init.py, corpus/radar_report.py */ import { type RadarMeta } from '../corpus-views/ref-parser.js'; /** A loaded radar sidecar: parsed meta (via the shared parser) + raw body + title. */ export interface RadarDoc { refId: string; meta: RadarMeta; title: string | null; /** Path relative to the corpus root, for report display. */ relPath: string; text: string; } /** List REF ids that have a radar sidecar (`documentation/radar/REF-*-radar.md`). */ export declare function listRadarRefs(corpusRoot: string): string[]; /** List REF ids that have a citation sidecar (`documentation/citations/REF-*-citations.md`). */ export declare function listCitationRefs(corpusRoot: string): string[]; /** * Build a REF-id → cluster-tag resolver from `documentation/radar/clusters.yaml`. * * Format (corpus-supplied; absent file → resolver always returns ''): * cluster-tag: * - "599" # a single REF number * - "600-605" # an inclusive REF-number range * * Mirrors the *behavior* of radar_init.guess_cluster (number-range → tag) without * porting its hardcoded ranges. */ export declare function loadClusterMap(corpusRoot: string): (refId: string) => string; /** * Extract the GRADE letter (with sign, e.g. `A-`) from the REF analysis doc. * Scans `documentation/references/REF-XXX-*.md` (skipping templates). Returns * `?` when no GRADE is found. Improves on radar_init.read_analysis_grade by * matching the `**Quality**:` classification form and preserving the sign. */ export declare function readAnalysisGrade(corpusRoot: string, refId: string): string; /** Corpus-relative path of the first analysis doc for a REF, or null. */ export declare function analysisRelPath(corpusRoot: string, refId: string): string | null; /** Title + author display names parsed from the citation sidecar frontmatter. */ export declare function readCitationMeta(corpusRoot: string, refId: string): { title: string; authors: string[]; }; /** Load every radar sidecar in the corpus (parsed meta + title + raw body). */ export declare function loadRadars(corpusRoot: string): RadarDoc[]; //# sourceMappingURL=radar-shared.d.ts.map