/** * Behavioral hotspots — the observe → memory feedback loop. * * Turns behavioral *observations* (epistemic-lease telemetry) into a durable, deterministic signal * about WHERE in the codebase agents destabilize. This is the north-star direction of the panic * work: not a momentary nudge after an agent is already lost, but a memory/orient signal that helps * the NEXT agent arrive better-oriented to the regions that reliably cause trouble. * * Deterministic and read-only. No LLM, no composite "score" tuning knob — each hotspot carries raw * counts and labeled signals (deep-stale / high-oscillation / cross-module-drift); ranking is by * episode count. The memory/orient layer decides what to do with it. */ /** An epistemic-lease.jsonl record (subset this analysis reads). */ export interface LeaseHotspotEvent { ts: string; event: string; module?: string | null; tool?: string; depth?: number; to_depth?: number; density?: number; oscillation?: number; } export type HotspotLabel = 'deep-stale' | 'high-oscillation' | 'cross-module-drift'; export interface BehavioralHotspot { module: string; /** destabilization events (degraded / stale / depth_escalate) attributed to this module. */ events: number; max_depth: number; avg_density: number; avg_oscillation: number; tools: string[]; /** labeled signals (not a blended score) — what kind of trouble this region produces. */ labels: HotspotLabel[]; } export interface BehavioralHotspotReport { generated_from_events: number; modules_observed: number; hotspots: BehavioralHotspot[]; } /** Filename of the persisted artifact, relative to the analysis dir. */ export declare const HOTSPOT_ARTIFACT_FILE = "behavioral-hotspots.json"; /** * Read the persisted hotspot artifact (written by `openlore panic-hotspots --write`) from an * analysis directory. Fail-open: returns null on any error (missing/corrupt/wrong-shape). */ export declare function readHotspotArtifact(analysisDir: string): BehavioralHotspotReport | null; /** Hotspots whose module is in `modules` (contextual filtering for orient). */ export declare function hotspotsForModules(report: BehavioralHotspotReport, modules: Set): BehavioralHotspot[]; /** Thresholds for the labeled signals — referenced by tests. */ export declare const HOTSPOT: { readonly DEEP_STALE_DEPTH: 3; readonly HIGH_OSCILLATION: 0.5; readonly CROSS_MODULE_DRIFT_DENSITY: 0.6; }; /** * Aggregate per-module destabilization from epistemic-lease telemetry. * @param topN cap the returned hotspots (0 = all). Ranked by event count, then max depth. */ export declare function computeBehavioralHotspots(events: LeaseHotspotEvent[], topN?: number): BehavioralHotspotReport; //# sourceMappingURL=behavioral-hotspots.d.ts.map