/** * Badcase Extractor (FR-N02) * * Parses badcase files and uses LLM to extract structured intent knowledge. * Supports three badcase source types: * - user_correction: user explicitly corrected agent behavior * - audit_finding: audit discovered a deviation * - verification_failure: automated verification caught a failure * * AC coverage: * AC1: Three source types identified and tagged * AC2: LLM semantic extraction (scenario → trigger → expected → anti-pattern) * AC4: Auto-annotates source type and source date * AC7: All semantic understanding via LLM, zero regex/template */ export type BadcaseSourceType = 'user_correction' | 'audit_finding' | 'verification_failure'; export interface BadcaseEntry { /** Raw text content of the badcase */ text: string; /** Source type classification */ sourceType: BadcaseSourceType; /** Date the badcase was recorded */ sourceDate: string; /** Optional file path origin */ filePath?: string; } export interface ExtractedIntent { /** Short title */ title: string; /** Full intent description */ content: string; /** Scenario where this intent applies */ scenario: string; /** What triggers this intent */ triggerCondition: string; /** Expected behavior */ expectedBehavior: string; /** Anti-pattern to avoid */ antiPattern: string; /** Confidence score 0-1 */ confidence: number; /** Tags for categorization */ tags: string[]; /** Similar sentences for intent matching */ similarSentences: string[]; /** Source type from the badcase */ sourceType: BadcaseSourceType; /** Date from the badcase */ sourceDate: string; } /** * Parse a badcase file into structured entries. * Supports markdown files with sections separated by `---` or `## `. * Each section is treated as one badcase entry. */ export declare function parseBadcaseFile(filePath: string): Promise; /** * Parse raw badcase text into structured entries. * Uses LLM for semantic source type classification. */ export declare function parseBadcaseText(text: string, filePath?: string): Promise; /** * Extract structured intents from badcase entries using LLM. * AC2 + AC7: All semantic understanding via LLM. */ export declare function extractIntentsFromBadcases(entries: BadcaseEntry[]): Promise; //# sourceMappingURL=badcase-extractor.d.ts.map