/** * Playbook search — symptom-to-playbook matching (Sprint 25). * * Loads playbooks from .bober/playbooks/*.md (skipping README.md). * Each playbook frontmatter (name, classification, applicableSymptoms, * prerequisites) is parsed via a minimal YAML block parser — no external dep. * * searchPlaybooks(symptom) tokenises the symptom string, scores each * playbook's applicableSymptoms by token overlap, and returns matches * sorted by confidence descending. * * Confidence thresholds (exported constants): * HIGH_CONFIDENCE_THRESHOLD = 0.6 → diagnoser auto-follows playbook * LOW_CONFIDENCE_THRESHOLD = 0.3 → diagnoser surfaces as suggestion * * Sprint 25 — src/incident/playbook-search.ts */ /** A match at or above this threshold triggers automatic playbook execution. */ export declare const HIGH_CONFIDENCE_THRESHOLD = 0.6; /** A match at or above this (and below HIGH) surfaces as a suggestion. */ export declare const LOW_CONFIDENCE_THRESHOLD = 0.3; export interface Playbook { name: string; classification: "standard" | "emergency"; applicableSymptoms: string[]; prerequisites: string[]; filePath: string; /** Raw step sections (## Step N: ...) extracted from the markdown body */ stepSections: string[]; } export interface PlaybookMatch { playbook: Playbook; /** Confidence in [0, 1]. Clamped to the range. */ confidence: number; /** The tokens from the query that overlapped with a matched symptom phrase */ matchedTokens: string[]; } /** * Tokenise a string into lowercase, non-empty, non-stopword tokens. * Splits on whitespace and common punctuation. */ export declare function tokenize(text: string): string[]; /** * Load all playbooks from .bober/playbooks/*.md in the given projectRoot. * - Skips README.md * - Skips files with missing or malformed frontmatter (logs a warning) * - Returns [] gracefully when the directory does not exist */ export declare function loadPlaybooks(projectRoot: string): Promise; /** * Search the playbook library for playbooks matching the given symptom string. * * Algorithm: * 1. Tokenise the symptom string. * 2. For each playbook, score each of its applicableSymptoms phrases. * 3. Take the maximum score across phrases as the playbook's confidence. * 4. Return all playbooks with confidence > 0, sorted descending by confidence. * * @param symptom The free-text symptom string from the incident. * @param projectRoot Absolute path to the project root. Defaults to process.cwd(). */ export declare function searchPlaybooks(symptom: string, projectRoot?: string): Promise; /** * Search a pre-loaded list of playbooks. Useful for testing without touching disk. */ export declare function searchPlaybooksList(symptom: string, playbooks: Playbook[]): PlaybookMatch[]; //# sourceMappingURL=playbook-search.d.ts.map