import { type DisclosureRuleT, type FreshnessT, type LookupQueryT, type LookupResultT, type RuleSetT } from "./schema.js"; /** * Compute the `last_verified` freshness band for a rule, relative to * a reference date (defaults to "now"). Pure function: no I/O, * deterministic for a given (rule, now) pair. * * Bands: * - fresh < 90 days since `last_verified` * - stale 90 to 180 days * - critically_stale > 180 days * * Exported so consumers can compute the band without invoking a full * lookup, and so tests can pass a fixed `now` for deterministic * verification. */ export declare function lastVerifiedFreshness(rule: DisclosureRuleT, now?: Date): FreshnessT; export interface StalenessAuditEntry { rule_id: string; short_title: string; severity: DisclosureRuleT["severity"]; jurisdiction: string; last_verified: string; days_since_verified: number; status: FreshnessT["status"]; } export interface StalenessAuditReport { audited_at: string; total_rules: number; fresh_count: number; stale_count: number; critically_stale_count: number; /** Rules that need attention (stale or critically_stale), sorted oldest first. */ needs_attention: StalenessAuditEntry[]; /** All entries, including fresh, sorted oldest first. */ all_entries: StalenessAuditEntry[]; } /** * Run a staleness audit across a rule set. Returns the freshness * status for every rule and a sorted list of those that need * re-verification (stale or critically_stale). * * Pure function: deterministic for any (rules, now) pair. Use in * pre-deploy checks, watcher cron post-processing, or as a sanity * surface for operators. */ export declare function auditFreshness(rules: RuleSetT, now?: Date): StalenessAuditReport; /** * Returns the rules that apply to a given (jurisdiction × channel × use_case) * query, plus a generated disclosure-text result for each. * * Match semantics: * - jurisdiction: the rule's jurisdiction must equal the query jurisdiction, * or the rule's jurisdiction must be a less-specific prefix of the query * jurisdiction. Example: a query for "us-ca" matches rules with * jurisdiction "us-ca" (exact) and rules with jurisdiction "us" (parent). * - channel: the rule's channels list must include the query channel. * - use_case: the rule's use_cases list must include the query use_case * OR include the universal "general" use_case. * * Rules are returned in deterministic order: by severity (mandatory first), * then by id (alphabetical). */ export declare function lookup(rules: RuleSetT, query: LookupQueryT): LookupResultT[]; export declare function generateDisclosureText(rule: DisclosureRuleT): { plain: string; formal?: string | undefined; }; /** * Validates a candidate disclosure text against a rule's required elements. * * The check is heuristic. For each required element it derives a small set of * keyword signals (id tokens, significant words from the element description * and example) and checks whether any appear in the candidate (case-insensitive). * An element with no signals found is reported as missing. * * This is a sanity check, NOT a legal-sufficiency determination. False * negatives (rejecting compliant text) are possible and false positives * (accepting non-compliant text) are possible. For high-stakes disclosures, * verify against the cited regulator-published text and consult counsel. */ export interface ElementReport { element_id: string; found: boolean; /** Confidence band based on how many signals matched. */ confidence: "high" | "medium" | "missing"; /** Signals that matched the candidate (whole-word). */ matched_signals: string[]; } export declare function validateDisclosure(rule: DisclosureRuleT, candidate: string): { rule_id: string; passes: boolean; missing_elements: string[]; /** Per-element detail: which signals matched and confidence band. */ elements: ElementReport[]; warning: string; }; //# sourceMappingURL=lookup.d.ts.map