/** * RedFlagDetector — pure, synchronous, 0-LLM emergency detection (Phase 6, Sprint 3). * * ADR-2: Detection is deterministic and local. A conservative keyword/phrase match * favors escalation reliability over paraphrase coverage. Novel phrasing may return * 'none' and proceed to the normal (still-guardrailed) path — this is the accepted risk * documented in ADR-2. Pattern set is versioned for auditability. * * NO async. NO fs. NO network. NO LLM import. Identical input => identical output. */ /** Six mutually-exclusive categories; 'none' means no emergency pattern matched. */ export type RedFlagCategory = "cardiac" | "stroke" | "anaphylaxis" | "self-harm" | "overdose" | "none"; /** Result of a single RedFlagDetector.detect() call. */ export interface RedFlagMatch { category: RedFlagCategory; /** * Rule ID that fired (IDs only — never prompt text). * Undefined when category === 'none'. */ ruleId?: string; } /** Versioned pattern-set identifier recorded in the audit log (ADR-2). */ export declare const PATTERNSET_VERSION = "redflag-2026.06.16"; /** * Detects emergency red-flag phrases in a medical prompt. * * PURE + SYNCHRONOUS. No async, no fs, no network, no LLM import. * Identical input => identical RedFlagMatch (asserted by sc-3-5). * * bober: conservative phrase matching; novel or indirect phrasing may return * 'none' and fall through to normal SOP handling (ADR-2 accepted risk). */ export declare class RedFlagDetector { readonly patternsetVersion = "redflag-2026.06.16"; /** * Returns the first matching RedFlagMatch, or { category: 'none' } if no * rule fires. Evaluation order is self-harm → overdose → cardiac → stroke → * anaphylaxis so the correct emergency hotline (988 vs 911) is assigned. */ detect(prompt: string): RedFlagMatch; } //# sourceMappingURL=red-flag.d.ts.map