export interface GraphNode { id: string; type: 'pr' | 'file' | 'author'; attributes: Record; } export interface GraphEdge { source: string; target: string; relation: 'touches' | 'authored' | 'duplicate_of' | 'related_to' | 'reviewed' | 'commented'; weight?: number; timestamp?: number; } export declare class KnowledgeGraph { private nodes; private edges; /** Fast O(1) edge dedup index: "source|target|relation" → index in edges array */ private edgeIndex; private edgeKey; /** * Clear the graph */ clear(): void; /** * Add a node to the graph */ addNode(node: GraphNode): void; /** * Retrieve a node */ getNode(id: string): GraphNode | undefined; /** * Add an edge between two nodes */ addEdge(edge: GraphEdge): void; /** * High-level method to ingest a PR into the graph */ addPR(prId: string | number, title: string, author: string, files: string[], originalPrId?: string | number): void; /** * Add an explicit expertise link (e.g. from parsing review comments) */ addReviewer(prId: string | number, reviewerId: string, isApproval?: boolean): void; /** * Export the entire graph topology for visualization (Dashboard Phase 7) */ export(): { nodes: GraphNode[]; edges: GraphEdge[]; }; /** * Calculate Bus Factor for a specific file or directory * Returns the number of distinct developers who have meaningfully contributed * to this file within the last year. */ calculateBusFactor(path: string): number; /** * Find True Expertise for a file. * Weighs Authorship (10pts) vs Approvals (5pts) vs Comments (2pts). * Time decay: Older interactions are worth less. */ getTrueExpertise(path: string): Array<{ author: string; score: number; }>; /** * General query method to find adjacent nodes of a specific type or relation */ query(startId: string, targetType?: 'pr' | 'file' | 'author', relationFilter?: GraphEdge['relation']): GraphNode[]; /** * Shortcut: Get all PRs that touched this file */ getFileHistory(filepath: string): GraphNode[]; /** * Shortcut: Get all files/PRs authored by this user */ getAuthorHistory(username: string): GraphNode[]; exportJSON(): string; importJSON(jsonString: string): void; } //# sourceMappingURL=knowledgeGraph.d.ts.map