How ai4se4ai-lab/sikg works
Project type and purpose
• This is a VS Code extension (open-source developer tool) named “SIKG” that builds a semantic knowledge graph of your code, analyzes changes, and prioritizes/runs tests accordingly.
File structure
• Top-level:
• package.json, tsconfig.json, README.md – extension manifest, build config, docs
• src/extension.ts – activation entry point
• src/services/ – integration services (GitService, TestRunnerService)
• src/sikg/ – core knowledge-graph logic (SIKGManager, CodeParser, ChangeAnalyzer, TestParser, TestPrioritizer, GraphTypes)
• src/ui/ – UI components (StatusBarManager, SIKGViewProvider for webview)
• src/utils/ – config and logging utilities
Extract architecture insights from README
• Components: graph builder, change analyzer, impact propagator, self-learning engine, UI visualizer
• External dependencies: Git for diffs, VS Code UI, test runners
Main components and their interactions
A. Extension Host & Activation
B. Services Layer
• GitService: fetches diffs/commits
• TestRunnerService: executes test suites and returns results
C. Core Graph Engine (sikg/)
1. CodeParser & TestParser – scan workspace to identify code entities & tests → produce initial graph nodes
2. SIKGManager – holds in-memory graph (GraphTypes) and weights
3. ChangeAnalyzer – consumes Git diff + parsed graph → marks changed nodes
4. TestPrioritizer – propagates impact through graph edges → scores tests
5. Self-learning loop – after TestRunnerService returns results, SIKGManager adjusts edge weights
D. UI Layer
• SIKGViewProvider – renders interactive impact graph in webview
• StatusBarManager – shows status/progress in VS Code status bar
E. Utilities
• ConfigManager – reads extension settings
• Logger – logs debug/info to output channel
Architectural patterns & design principles
• Modular layering: Services / Core / UI / Utils
• Event-driven command handlers (VS Code API)
• Knowledge-graph model (nodes & edges) for domain logic
• Feedback loop for self-learning (observer pattern)
Technologies & frameworks
• TypeScript, Node.js, VS Code Extension API
• Graph data structures in memory (no external DB)
• VS Code Webview API for visualization