Skip to content

Data model

Arun Soman edited this page Aug 31, 2026 · 1 revision

Core data model

Core data model — migrated from the README on 2026-08-31 and verified against the code at tag v0.1.4; if code and wiki ever disagree, the code wins and this page gets a PR.

Core data model (models.py, repository.py, neo4j_repository.py, in_memory_repository.py, embedded_repository.py)

  • NodeKind covers the structural kinds (FILE/CLASS/FUNC/METHOD/SYMBOL) and every analysis-result kind — CloneCluster, AntiPattern, DriftFinding, MetricSnapshot, CommunitySummary, Type, Package, Document, Contract, TestSkeleton, StateMachine, State, Transition, AgentVerdict, ConfidenceReport, JustificationTrace, InvariantViolation, SemanticDiffFinding, RuntimeErrorTrace, Page, ImpliedPage, InteractiveElement, DerivedTaskHint, TestExecution, MockEndpoint, MockCall, ContractViolation, ApmMetric, PerformanceBaseline, PerformanceRegression, CoverageGap. Analysis nodes are never produced by extract.py — only by on-demand passes, written via replace_analysis_nodes.
  • Edge confidence: EXTRACTED / INFERRED / AMBIGUOUS, stamped with IN-08 provenance (extracted_at, extractor_version, source_ref).
  • Three Repository backends behind one Protocol: Neo4jRepository (Cypher, per-project namespacing, vector index, query/write/schema timeouts), InMemoryRepository (the reference test double both backends are verified against), and EmbeddedRepository (SQLite, two tables, full graph re-persisted per call — simple, single-project, local-first).
  • QueryEngine (query.py): thin, backend-agnostic orchestration — search, traversal, neighbors, community, god nodes, stats, shortest path, signatures, methods-of-class, file listing, feature discovery, semantic search (requires embeddings written at load time).

Clone this wiki locally