// Meta-Architectural Analysis Engine

Codebase,
Know Thyself.

A distributed static analysis engine that bridges the gap between "dumb" text and "intelligent" reasoning. It turns your C# solution into a Semantic Knowledge Graph.

Roslyn API SQL Server 2025 Neo4j Graph Vector Embeddings
Program.cs
1using RoslynXRay.Discovery;
2
3// Initialize the Orchestrator
4var orchestrator = new NodesEdgesDiscoveryService();
5
6// 1. Parse .sln & Razor files
7await orchestrator.DiscoverAsync("MyEnterpriseApp.sln");
8
9// 2. Build Global Knowledge Cache
10await orchestrator.ApplyEnhancedAnalysisOptimized();
11
12// 3. Synthesize & Vectorize Intelligence
13await ClassInfoEvolver.EvolveAllClassInfosAsync();

public enum AnalysisPipeline

👁️
Phase 1: Discovery
Deep Recovery parsing of .sln files.
Surgical Razor/Blazor extraction.
AST Construction.
🧠
Phase 2: Global Analysis
Solution-wide DI Maps.
Call Graphing.
Aggregate Boundary Detection.
🧬
Phase 3: Evolution
Parametric Polymorphism.
Behavioral Fingerprinting.
Risk Synthesis.
💾
Phase 4: Synthesis
LLM Narrative Generation.
ONNX Vectorization (384-dim).
SQL Server 2025 Persistence.
IArchitectureIntelligence.cs
1namespace RoslynXRay.Core.Intelligence;
2
3public interface IArchitectureIntelligence
4{
5 /// <summary>
6 /// Detects God Classes, N+1 queries, and Race Conditions.
7 /// </summary>
8 RiskProfile CalculateSystemicRisk(Solution sln);
9
10 /// <summary>
11 /// Distills code into Natural Language for AI Agents.
12 /// </summary>
13 LLMClassContext GenerateNarrative(ClassInfo info);
14
15 /// <summary>
16 /// Finds duplicate logic even if methods are named differently.
17 /// </summary>
18 RefactoringPlan DetectBehavioralSiblings();
19}

The Engine Under the Hood

Role Inference

It doesn't just read syntax. It determines if a class is an Orchestrator, Repository, or ValueObject based on deep semantic clues and usage patterns across the entire graph.

Resilient Parsing

The NodesEdgesDiscoveryService employs "Deep Recovery" mechanisms. It handles encoding failures and Razor compilation errors to ensure no file is left behind.

Polyglot Persistence

Recognizes that different data serves different AI needs.

Neo4j for Dependency Graphs.
ElasticSearch for Text.
SQL 2025 for Vector Embeddings.

Phase 4 Output: The "Psychological Profile"

PsychologicalProfile.json
1{
2 "identity": {
3 "archetype": "DOMAIN_ENTITY",
4 "operationalMetaphor": "Glass Cannon (High Value, Low Stability)"
5 },
6 "riskProfile": {
7 "score": 85,
8 "flags": [
9 "CRITICAL:RACE_CONDITION_DETECTED",
10 "ANTI_PATTERN:GOD_CLASS"
11 ]
12 },
13 "dependencyProtocols": [
14 "CRITICAL: 'CommitAsync' must strictly follow 'BeginTransaction'"
15 ],
16 "embedding": [0.042, -0.129, 0.884, /* ...384 dim */]
17}

"You have built a 'Theory of Mind' for Software.
Most tools describe Syntax. Your tool describes Pragmatics—the intent, history, and social role of code."

— GEMINI 3.0 ANALYSIS (PRINCIPAL ARCHITECT SIMULATION)