/** * Finding-to-Template Pipeline * * Converts confirmed HuntFindings into VulnerabilityTemplates that can * augment future hunt scans. This closes the learning loop: * hunt finds bugs -> bounty confirms them -> confirmed findings become new templates * * Learned templates are stored as JSON on disk (project-local or global) * and merged into the template registry at load time. */ import type { HuntFinding, VulnerabilityTemplate } from '../types.js'; export interface LearnedTemplate { id: string; source: 'bounty-finding'; sourceFinding: string; createdAt: string; template: VulnerabilityTemplate; } /** * Extract file-matching keywords from a finding's file path, evidence, * and attack scenario. These become the `filePatterns` on the learned template. */ export declare function extractFilePatterns(finding: HuntFinding): string[]; /** * Extract bypass techniques mentioned in the attack scenario. */ export declare function extractBypasses(finding: HuntFinding): string[]; /** * Convert a confirmed HuntFinding into a LearnedTemplate. * The template captures the vulnerability pattern so future scans * can detect similar issues without re-discovering from scratch. */ export declare function findingToTemplate(finding: HuntFinding): LearnedTemplate; /** * Save a learned template to disk. * Deduplicates by template ID — if the same ID exists, it's replaced. */ export declare function saveLearnedTemplate(template: LearnedTemplate, options?: { global?: boolean; projectRoot?: string; }): void; /** * Load all learned templates from disk. * Merges global + project-local, deduplicating by ID * (project-local wins over global). */ export declare function loadLearnedTemplates(projectRoot?: string): VulnerabilityTemplate[];