/** * Pre-flight blast-radius guard (change: add-preflight-blast-radius-guard). * * "Before I commit this diff, what does it actually touch?" The expensive * mistakes — changing a hub 58 callers depend on, orphaning a decision anchored * to a symbol you deleted, making a spec stale — are all knowable *before* the * edit, deterministically, from analyses OpenLore already computes. They just * are not surfaced at the moment they would prevent the mistake. * * This handler is PURE ORCHESTRATION: it composes existing deterministic * analyses — `analyze_impact` (callers / layers / hubs), `select_tests` (the * tests to run), and `check_spec_drift` (which already folds in anchored-memory * and ADR drift) over the diff returned by `getChangedFiles`. It adds no new * structural computation and runs no LLM (north star `c6d1ad07`). The result is * a single conclusion-shaped briefing — counts and named risks — never a graph. * * It is advisory by definition: the briefing informs, the agent acts. The * non-blocking git hook and opt-in blocking live in `cli/commands/blast-radius.ts`. */ export interface BlastRadiusInput { directory: string; /** Git ref to diff the working tree against. Default `HEAD` (uncommitted changes). */ baseRef?: string; /** Impact-analysis traversal depth (forwarded to analyze_impact). Default 2. */ depth?: number; /** Cap on the number of changed symbols analyzed for impact. Default 12. */ maxSymbols?: number; } type RiskLevel = 'low' | 'medium' | 'high' | 'critical'; /** Per-symbol slice of the briefing (the riskiest changed symbols). */ interface SymbolRisk { symbol: string; file: string; riskLevel: RiskLevel; affectedCallers: number; fanIn: number; isHub: boolean; } export interface BlastRadiusBriefing { /** The base ref the caller requested (default `HEAD`). */ baseRef: string; /** The ref git actually diffed against. Differs from `baseRef` when the * requested ref did not resolve and resolveBaseRef fell back (main → master → * HEAD~1); a caveat is emitted when they differ. */ resolvedBaseRef: string; changed: { files: number; symbols: number; symbolNames: string[]; }; impact: { highestRiskLevel: RiskLevel | 'none'; maxAffectedCallers: number; hubsTouched: Array<{ symbol: string; fanIn: number; }>; layersCrossed: string[]; governingDecisions: string[]; topSymbols: SymbolRisk[]; analyzedSymbolCount: number; truncated?: { omitted: number; reason: string; }; }; tests: { count: number; toRun: Array<{ test: string; file: string; confidence: string; }>; soundness: unknown; }; memory: { drifted: number; orphaned: number; willDrift: Array<{ kind: string; message: string; filePath: string; }>; }; specs: { willGoStale: number; items: Array<{ kind: string; message: string; domain: string | null; specPath: string | null; }>; }; decisions: { affected: number; /** Uncapped count of `adr-orphaned` issues. The hook's block gate reads this, * never `items` — `items` is display-capped and could omit a triggering issue. */ orphaned: number; items: Array<{ kind: string; message: string; domain: string | null; }>; }; federation: { evaluated: false; note: string; }; headline: string; posture: 'advisory'; caveats: string[]; } /** * Compute the pre-flight blast-radius briefing for a diff. Read-only, * deterministic, offline. Exported for reuse by the CLI hook; the MCP dispatch * entry is {@link handleBlastRadius}. */ export declare function computeBlastRadius(input: BlastRadiusInput): Promise; /** MCP dispatch entry. Returns the briefing object directly (additive-by-cast). */ export declare function handleBlastRadius(input: BlastRadiusInput): Promise; export {}; //# sourceMappingURL=blast-radius.d.ts.map