ActorDB — Causal Graph Engine (CGE)
Compiles Python Repositories into a Verifiable Structural Causal Model & MCP Oracle
Instead of indexing code as text chunks, ActorDB compiles a Python project's decision logic and invariants into a formal Structural Causal Model with an MCP oracle (trace, do, solve, prove), Sobol fidelity certification (≤ 10⁻⁶), and zero-mutation Git PR gating.
- MCP Primitives
- trace · do · solve · prove
- Fidelity Bound
- Sobol rel. error ≤ 10⁻⁶
- Benchmark Suite
- OR-Bench (20 problems)
- Baseline Seal
- 41 artifacts · SHA-256
Beyond Rows and Embeddings
Relational databases store historical rows. Vector databases retrieve semantically similar text chunks. Neither can answer the operational questions that actually break production systems: If I change this pricing constant, what is the exact total derivative on margin across four modules? Which decision lever is algebraically dead? Does this Pull Request silently relax a hard business invariant?
ActorDB & CGE takes a different approach: it compiles the decision rules and constraints of a Python repository into a formal Structural Causal Model:
M_ActorDB = <U, X, V_num, V_logic, F, C, G>
capturing exogenous inputs (U), modifiable control levers (X), numeric and logical states (V), mechanisms (F), hard invariants (C), and optimization goals (G).
Four Formal MCP Primitives (Zero Hallucination)
Exposed via Model Context Protocol (stdio, sse, and streamable-http) with an O(1) in-memory cache invalidated deterministically by the SHA-256 signature of the repository file tree:
cge_trace: Directed causal lineage, exact path-wise sensitivities / total derivatives, and dead-actor detection—catching both structurally disconnected variables (T1-A) and exact algebraic cancellations (T1-B).cge_do: Pearl counterfactual interventionsdo(I)implemented via explicit graph surgery rather than ad-hoc prompting.cge_solve: Certified mathematical optimization (LP,MILP,QP,NLP,MINLP) returning explicit formal statuses:CERTIFIED_OPTIMAL,INFEASIBLE_CERTIFIED(accompanied by a Minimal Irreducible Infeasible Subsystem,Minimal IIS), orREJECTED_CONSTRAINT_BYPASSwhen a query attempts to violate a hard invariant.cge_prove: Symbolic/interval proof (PROVEN), bounded empirical verification (SAMPLED_VERIFIED), or exact counterexample refutation (FALSIFIED).
Two-Layer Universal Ingestion & Epistemic Gate P5
Real codebases rarely come pre-annotated for formal verification. ActorDB resolves that tension in two disciplined layers:
- Layer 1 — Zero-Config (
GenericPackageAdapter): Extracts cross-module causal graphs directly from the Python AST (constants,@dataclass, helper functions,assertandraise ValueErrorguards) usingL0/L1symbolic compilation and step-budgetedL2AST simulation with zeroexec/eval. Under Epistemic Gate P5, any leaf variable without a contract defaults strictly toexogenous—refusing to optimize unowned levers (AMBIGUOUS_LEAF_ROLES_P5) rather than guessing. - Layer 2 — Declarative Contract (
actordb.yaml): A minimal Git-versioned sidecar declaringcontrols,exogenous,bounds, andconstraints, verified deterministically against the AST (CONTRACT_AST_MISMATCHif code and contract drift apart).
Causal Diff in CI/CD & Sealed Benchmarks
- Zero-Mutation PR Gating (
cge-diff): Compares--base-refagainst--head-ref(orWORKTREE) without mutating the working directory, blocking Pull Requests that weaken hard constraints, regress invariants, or introduce newly dead decision levers. - Empirical Fidelity Certification: Verified via Sobol quasi-Monte Carlo sampling (
relative error ≤ 10⁻⁶), tested across the 20-problemOR-Benchsuite, and anchored by a frozenbaseline_v0manifest sealing 41 benchmark artifacts under SHA-256.