/** * NEXUS symbol impact (blast radius) analysis. * * Performs a BFS upstream traversal from a named symbol to identify all * direct and transitive callers. Returns a risk classification and * per-depth node lists. Used by `cleo nexus impact`. * * @task T1473 */ import { type EngineResult } from '../engine-result.js'; /** Risk level classification for an impacted symbol. */ export type NexusRiskLevel = 'NONE' | 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL'; /** A single impacted node at a given BFS depth. */ export interface NexusImpactNode { /** Node ID. */ nodeId: string; /** Symbol name. */ name: string; /** Node kind. */ kind: string; /** Relative file path, or null. */ filePath: string | null; /** Reason strings (populated when opts.why is true). */ reasons: string[]; } /** One BFS depth layer. */ export interface NexusImpactLayer { /** BFS depth (1 = direct callers, 2 = indirect, 3 = transitive). */ depth: number; /** Human-readable depth label. */ label: string; /** Impacted nodes at this depth. */ nodes: NexusImpactNode[]; } /** Options for {@link getSymbolImpact}. */ export interface NexusImpactOptions { /** Maximum BFS traversal depth (default: 3, max: 5). */ maxDepth?: number; /** When true, populate `reasons` on each node. */ why?: boolean; } /** Result envelope for {@link getSymbolImpact}. */ export interface NexusImpactResult { /** Original symbol query. */ query: string; /** Project ID. */ projectId: string; /** ID of the target node analyzed. */ targetNodeId: string; /** Name of the target node. */ targetName: unknown; /** Kind of the target node. */ targetKind: unknown; /** File path of the target node. */ targetFilePath: unknown; /** Risk level classification. */ riskLevel: NexusRiskLevel; /** Total impacted nodes (all depths). */ totalImpactedNodes: number; /** Maximum depth used for the traversal. */ maxDepth: number; /** Whether why-reasons are populated. */ why: boolean; /** Per-depth layer results. */ impactByDepth: NexusImpactLayer[]; } /** * Analyse the blast radius for a named code symbol via BFS upstream traversal. * * Loads all nodes and relations from the nexus DB, builds a reverse adjacency * map (calls/imports/accesses edges pointing TO the target), and traverses * breadth-first up to `maxDepth` levels. Returns per-depth layers with risk * classification. * * Throws with code `E_NOT_FOUND` when no symbol matches the query. * * @param symbolName - Symbol name to analyse (partial match). * @param projectId - Nexus project ID. * @param _repoPath - Absolute repository root path (reserved for future use). * @param opts - Traversal options. * @returns Impact analysis result. * * @example * const impact = await getSymbolImpact('dispatchFromCli', projectId, repoPath); * console.log(impact.riskLevel, impact.totalImpactedNodes); */ export declare function getSymbolImpact(symbolName: string, projectId: string, _repoPath: string, opts?: NexusImpactOptions): Promise; /** * Analyze impact of changing a symbol (SQL BFS implementation). * * Runs BFS from the target symbol to find all symbols that would be affected * by changes to it, optionally with detailed reasons. * * @task T1569 */ export declare function nexusImpact(symbol: string, _projectId?: string, why?: boolean): Promise; riskLevel: string; }>>; //# sourceMappingURL=impact.d.ts.map