Skip to main content
Juan Diego Ussa
Back to portfolio
Causal Systems · Neuro-Symbolic · MCPVerified on Python 3.12 / 3.14 · CI Green

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
Python 3.11+AST Symbolic CompilerFastMCP (stdio/SSE/HTTP)LP / MILP / NLP SolversSobol VerificationGitHub Actions CI

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:

  1. 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).
  2. cge_do: Pearl counterfactual interventions do(I) implemented via explicit graph surgery rather than ad-hoc prompting.
  3. 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), or REJECTED_CONSTRAINT_BYPASS when a query attempts to violate a hard invariant.
  4. 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, assert and raise ValueError guards) using L0/L1 symbolic compilation and step-budgeted L2 AST simulation with zero exec/eval. Under Epistemic Gate P5, any leaf variable without a contract defaults strictly to exogenous—refusing to optimize unowned levers (AMBIGUOUS_LEAF_ROLES_P5) rather than guessing.
  • Layer 2 — Declarative Contract (actordb.yaml): A minimal Git-versioned sidecar declaring controls, exogenous, bounds, and constraints, verified deterministically against the AST (CONTRACT_AST_MISMATCH if code and contract drift apart).

Causal Diff in CI/CD & Sealed Benchmarks

  • Zero-Mutation PR Gating (cge-diff): Compares --base-ref against --head-ref (or WORKTREE) 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-problem OR-Bench suite, and anchored by a frozen baseline_v0 manifest sealing 41 benchmark artifacts under SHA-256.