/** * Dependency Graph for LeanSpec * * Builds an in-memory graph of all spec dependencies for efficient querying. * Handles two types of relationships: * - dependsOn: Upstream dependencies (current spec depends on these) * - requiredBy: Downstream dependents (these specs depend on current) */ import type { SpecInfo } from '../types/spec.js'; /** * Complete dependency information for a spec */ export interface CompleteDependencyGraph { current: SpecInfo; dependsOn: SpecInfo[]; requiredBy: SpecInfo[]; } /** * Impact radius showing all specs affected by changes */ export interface ImpactRadius { current: SpecInfo; upstream: SpecInfo[]; downstream: SpecInfo[]; } /** * Manages the dependency graph for all specs */ export declare class SpecDependencyGraph { private graph; private specs; constructor(allSpecs: SpecInfo[]); /** * Build the complete dependency graph from all specs */ private buildGraph; /** * Get complete dependency graph for a spec */ getCompleteGraph(specPath: string): CompleteDependencyGraph; /** * Get upstream dependencies (specs this one depends on) * Recursively traverses the dependsOn chain up to maxDepth */ getUpstream(specPath: string, maxDepth?: number): SpecInfo[]; /** * Get downstream dependents (specs that depend on this one) * Recursively traverses the requiredBy chain up to maxDepth */ getDownstream(specPath: string, maxDepth?: number): SpecInfo[]; /** * Get impact radius - all specs affected by changes to this spec * Includes upstream dependencies and downstream dependents */ getImpactRadius(specPath: string, maxDepth?: number): ImpactRadius; /** * Check if a circular dependency exists */ hasCircularDependency(specPath: string): boolean; /** * Get all specs in the graph */ getAllSpecs(): SpecInfo[]; /** * Get specs by their paths */ private getSpecsByPaths; } //# sourceMappingURL=dependency-graph.d.ts.map