/** * v0.6 Template Detection — Phase 1 of the audit-as-template pipeline. * * Clusters discovered URLs by path template, filters to qualifying clusters * (ratio ≥ 1% AND count ≥ 5), and returns TemplateCandidate[] with each * cluster's signature, URL list, and coverage metadata. * * Activation gating: callers must check that ≥ 2 candidates survive before * switching from the legacy single-template path. * * See spec §6.1 and §15.3. */ /** Synthetic signature for the long-tail bucket. */ export declare const LONGTAIL_SIGNATURE = "_longtail"; /** A qualifying URL-template cluster. */ export interface TemplateCandidate { /** Normalized path pattern, e.g. "/listing/:slug" */ signature: string; /** All URLs in the discovered set belonging to this cluster. */ urls: string[]; /** Count of URLs in this cluster. */ count: number; /** Ratio of URLs in this cluster vs total discovered. */ ratio: number; } /** * Detect qualifying URL templates from a list of discovered URLs. * * Returns TemplateCandidate[] for clusters meeting the 1% ratio AND count-5 * thresholds. URLs not matching any qualifying cluster are grouped into a * synthetic "_longtail" candidate (when at least one URL falls through). * * A URL is attributed to the FIRST qualifying cluster whose signature matches * (clusters are sorted by descending count, so the most specific/largest * cluster wins in the case of ambiguity — though URL-to-template mapping is * injective: one URL → exactly one normalized template). */ export declare function detectTemplates(urls: string[]): TemplateCandidate[]; /** * Given a list of TemplateCandidate[] (as returned by detectTemplates), * build a lookup map from URL → template signature for fast per-finding tagging. * * Long-tail URLs map to LONGTAIL_SIGNATURE. */ export declare function buildUrlToTemplateMap(candidates: TemplateCandidate[]): Map; /** * Check whether the v0.6 template path should activate. * Requires ≥ 2 QUALIFYING (non-longtail) templates per §15.3. */ export declare function shouldActivateTemplateScoring(candidates: TemplateCandidate[]): boolean; export declare function normalizePathToTemplate(pathname: string): string; //# sourceMappingURL=template-detection.d.ts.map