Section 4.1Source:
server/src/analytics/AnalysisEngine.tsAnalytics Engine Architecture
The single entry point orchestrating graph traversal, upstream impact analysis, downstream dependencies, cycles, topological ordering, and connectivity.
Source:
server/src/analytics/AnalysisEngine.tsAnalyzer Dependency Composition
AnalysisEngine is instantiated with an immutable Graph instance and wires specialized analyzer classes:
server/src/analytics/AnalysisEngine.ts
12345678910111213141516171819export class AnalysisEngine { private readonly impactAnalyzer: ImpactAnalyzer; private readonly dependencyAnalyzer: DependencyAnalyzer; private readonly cycleAnalyzer: CycleAnalyzer; private readonly dependencyOrderingAnalyzer: DependencyOrderingAnalyzer; private readonly fanInOutAnalyzer: FanInOutAnalyzer; private readonly callPathAnalyzer: CallPathAnalyzer; private readonly graphTraversal: GraphTraversal; constructor(private readonly graph: Graph) { this.graphTraversal = new GraphTraversal(graph); this.impactAnalyzer = new ImpactAnalyzer(this.graphTraversal); this.dependencyAnalyzer = new DependencyAnalyzer(this.graphTraversal); this.cycleAnalyzer = new CycleAnalyzer(graph); this.dependencyOrderingAnalyzer = new DependencyOrderingAnalyzer(graph); this.fanInOutAnalyzer = new FanInOutAnalyzer(graph); this.callPathAnalyzer = new CallPathAnalyzer(graph); } }
Architectural Contracts
| Contract | Guarantee | Rationale |
|---|---|---|
| Read-Only Execution | No analyzer ever mutates the Graph maps or node objects. | Guarantees thread-safe parallel analysis across multiple queries. |
| Stateless per Call | Visited sets, queues, and recursion stacks are local to method execution. | Zero state leakage between subsequent requests. |
| Pure Functional Math | All metrics compute deterministic outputs from static graph facts. | Complete repeatability across developer machines and CI/CD. |