A Trust-First AI Architecture for Scientific Discovery, Causal Governance, and Auditable Reasoning
MASA (Methods of Automated Scientific Analysis) is a proprietary AI architecture for causally disciplined scientific discovery. Unlike conventional LLM applications that only generate plausible text, MASA runs a closed loop: (1) hypothesis generation from heterogeneous evidence, (2) multi-agent critique under explicit causal and methodological constraints, (3) durable memory of evaluations and traces, and (4) governance protocols that force claims to match implementation reality. Core breakthroughs now include a deterministic Causal Engine v1.0 core for fully specified linear DAGs, a domain registry of constraint templates, and a governance stack that tracks drift between architectural claims and code reality. This paper documents the implemented architecture and the remaining gaps toward high-integrity scientific operation.
Current AI systems for scientific research face a fundamental limitation: they are philosophers without empirical grounding. They can reason logically about hypotheses but cannot:
MASA addresses these limitations through a three-pillar architecture (Generator → Evaluator → Update), augmented by two enhancement mechanisms:
| Component | Module | Function |
|---|---|---|
| Core Three-Pillar Closed Loop | ||
| Generator | Novel Idea Engine | Synthesize hypotheses from multi-source contradictions |
| Evaluator | MASA Auditor | Multi-agent critique with calibrated confidence |
| Update Mechanism | Sovereign Memory + Ground Truth | Vector-based learning + simulation validation |
| Enhancement Layers | ||
| Optimization | Thermodynamic Basis Expansion | Spectral gap detection to escape local optima |
| Lifelong Learning | Spectral Knowledge Memory (Planned) | Geometric anti-interference for cross-domain expertise |
A common critique in AI for science is that Large Language Models are merely "armchair philosophers"—they predict what valid science looks like from text statistics rather than physical laws. That critique is accurate for standalone LLMs, but it under-describes agentic architectures like MASA.
| Paradigm | Characteristics | Limitations |
|---|---|---|
| The Armchair Philosopher (Standard LLM) |
• Single-turn text generation • No persistent memory • No empirical validation • Open-loop architecture |
Hallucinates plausible-sounding but physically impossible results. Forgets past failures on restart. |
| The Robot Scientist (MASA Architecture) |
• Agentic multi-step reasoning • Vector-based persistent memory • Simulation-backed validation • Rejection-aware filtering |
Avoids repeating past rejections. Validates predictions before presenting. Accumulates a rejection cache over time. |
Modern scientific AI uses Agentic Architecture—the AI is connected to a structured database that serves as Long-Term Memory. When MASA runs an experiment, it records the result (success or failure). Before proposing a new hypothesis, it queries this database via RAG (Retrieval-Augmented Generation).
pgvector embeddings to store thesis+mechanism representations. The checkRejection() function queries for >90% similarity to past failures before expensive audit operations.
AI models in cutting-edge research are routinely coupled with "Tools"—external software or hardware that the AI can control. MASA implements In Silico validation through a Pyodide (WebAssembly) sandbox that executes generated Python protocols.
ExperimentGenerator produces Python code with Monte Carlo simulations and statistical tests. The ProtocolValidator executes this code in an isolated sandbox, capturing p-values and Bayes factors.
MASA addresses runtime amnesia through Rejection Caching. The system operates in a cycle: Hypothesis → Experiment → Result → Store Rejection. Note: This is filtering (avoiding known-bad ideas), not true learning (improving the generator).
MASA implements the same three-pillar pattern used by cutting-edge autonomous science systems:
| Capability | DeepMind A-Lab | MASA |
|---|---|---|
| Persistent Memory | Structured experimental database | pgvector + Supabase |
| Physical Validation | Robotic synthesis (In Vivo) | Pyodide sandbox (In Silico) |
| Self-Improvement | Surrogate model fine-tuning | Rejection-aware RAG filtering |
Beyond the engineering architecture, MASA is grounded in a specific theory of how knowledge grows. This theory draws from Karl Popper's falsificationism and David Deutsch's extension of it in The Beginning of Infinity.
Deutsch's central insight: Good explanations are hard to vary while still accounting for the phenomenon. A bad explanation can be adjusted arbitrarily to accommodate any evidence; a good explanation breaks when you change its details.
Popper and Deutsch argue that we can never prove a theory true—we can only fail to falsify it. All knowledge is provisional, subject to future correction. This is not a weakness but the engine of progress.
| Principle | Implication | MASA Analog |
|---|---|---|
| Fallibilism | No idea is final; expect to be wrong | Rejection-aware RAG stores past failures for future filtering |
| Error Correction | Progress = detecting and fixing mistakes | Multi-agent dialectical refinement (Thesis → Antithesis → Synthesis) |
| Conjecture First | All knowledge starts as a guess | Hong Recombination generates speculative hypotheses before audit |
Deutsch observes that good explanations have reach—they apply beyond their original domain. Newton's laws, derived from falling apples, reach to planetary orbits. MASA's synthesis engine explicitly seeks this: bridging disconnected epistemic domains to find ideas with reach.
Deutsch argues that humans are universal explainers—capable of understanding anything that can be understood. The question for AGI is whether machines can achieve the same status. MASA does not claim to be a universal explainer, but it implements the process Deutsch describes: conjecture, criticism, and error correction in a closed loop.
Orchestrates the full pipeline: extraction → contradiction → generation → refinement
Multi-agent critique system with Epistemologist, Skeptic, and Architect personas
Prior art search via Semantic Scholar API with novelty scoring
Produces executable Python protocols and lab manuals
Claude-powered hypothesis refinement with constraint injection
Supabase integration for synthesis history and vector embeddings
MASA's architecture is mathematically grounded in three complementary theoretical frameworks: Carina Hong's Combinatorics for hypothesis space exploration, Judea Pearl's Causal Inference for reasoning depth, and Maxwell Maltz's Psycho-Cybernetics for goal-directed self-correction.
| Publication | Core Mathematical Structure | MASA Mapping |
|---|---|---|
| Length-Four Pattern Avoidance (arXiv:2112.15081) |
Wilf equivalence classes, forbidden pattern filtering in inversion sequences | Sovereign Memory – rejection-aware RAG filtering |
| Nekrasov-Okounkov Polynomials (arXiv:2008.10069) |
Log-concavity, unimodal coefficient distribution | Confidence calibration – quality concentration metrics |
| Pop-Stack-Sorting on Tamari Lattices | Iterative Pop operator convergence, t-Pop-sortability | Dialectical synthesis – refinement iteration bounds |
| Markov Chain on Edge-Colorings (arXiv:2103.11990) |
Irreducible MCMC, bounded acceptance ratio, linear diameter | Hong Recombination – MCTS-like exploration |
In Hong's work on inversion sequences, a pattern π filters the solution space In(π). Two patterns are Wilf-equivalent if |In(π)| = |In(σ)| for all n—they enumerate identical structures despite superficial differences.
MASA applies this principle through vector embeddings. The idea_embeddings table with pgvector performs semantic pattern matching: ideas with ≥90% cosine similarity to prior rejections are filtered, just as pattern-avoiding sequences exclude forbidden patterns. The cosine similarity threshold defines equivalence classes in embedding space.
NovelIdea ∈ ValidSpace ⟺ ¬∃ RejectedIdea where similarity(e, e') > θ
Hong proves that coefficients An,k of Qn(z) are log-concave: A²n,k ≥ An,k-1 · An,k+1. This means quality distributions have a single peak—they concentrate predictably.
MASA's confidence calibration follows this pattern. The three-agent scoring (Methodologist, Skeptic, Architect) produces scores that should exhibit unimodal concentration—optimal ideas lie at the peak, neither too conservative nor too speculative.
Hong's Pop operator on Tamari lattices iteratively maps elements toward the minimal element 0̂. An element is t-Pop-sortable if exactly t applications reach 0̂.
MASA's dialectical synthesis directly implements this structure:
Hong's rational generating function for ht(n) suggests that MASA's convergence rates are mathematically predictable—finite iterations lead to stable hypotheses.
Hong's irreducible Markov chain M(G,k) on edge-colorings of bipartite graphs has:
MASA's "Hong Recombination" phase implements a conceptual Markov chain on hypothesis space—states are candidate ideas, transitions are recombinations, and acceptance is governed by prior art evaluation. The bounded acceptance ratio guarantees polynomial-time reachability of any valid hypothesis.
Under the Hong framework, MASA exhibits the following properties:
| Property | Hong Foundation | MASA Guarantee |
|---|---|---|
| Completeness | Markov chain irreducibility | Any valid hypothesis is reachable |
| Concentration | Log-concavity | Quality peaks predictably |
| Termination | t-Pop-sortability | Finite refinement iterations |
| Efficiency | Bounded acceptance ratio | Polynomial exploration time |
MASA now has a real Causal Engine v1.0 core, but it is narrower than the earlier white-paper claim of a complete Pearl ladder implementation. The implemented core is a deterministic structural-equation executor for fully specified linear DAGs with typed equations, local benchmark coverage, and explicit graceful degradation to heuristic paths when typed SCMs are unavailable.
The currently implemented causal path is:
Current route boundary: the formal path is wired in causal-chat/route.ts when a typed SCM can be loaded through SCMRegistryService. Other callers such as legal reasoning and educational optimization remain explicitly on fallback because they still operate on in-memory templates rather than typed structural equations.
| Capability | Implemented State | Current Boundary |
|---|---|---|
| Formal SCM Types | TypedSCM, StructuralEquation, CausalQuery, and CausalResult are defined in code. |
Typed equations must exist; legacy blobs are retained only as deprecated compatibility. |
| Graph Operations | DAG validation, deterministic topological sort, and graph mutilation are implemented. | v1.0 remains DAG-only and linear-only. |
| Solver | Forward solving passes the local B1-B6 causal-engine benchmark suite. | This is local compute evidence, not yet universal production-path proof. |
| Trace Provenance | Deterministic traces can carry evaluation order, value maps, and explicit computation method labels. | Migration/runtime readback verification is still required in the target environment. |
| Graceful Degradation | Unsupported or untyped models fall back to heuristic_bfs_propagation. |
The fallback is explicitly labeled as heuristic and should not be described as formal intervention math. |
The formal engine executes interventions by mutilating a typed SCM and solving it forward in deterministic topological order. This is the true mathematical core of the current implementation. It is appropriate to describe this as deterministic intervention execution over a fully specified SCM.
Result: given the same typed model and query, the engine is intended to return the same result.
| Claimed Capability | Current Status | Why It Is Deferred |
|---|---|---|
| Full do-calculus | Not implemented as formal engine math | Current intervention support is deterministic mutilation/forward solve, not symbolic do-calculus. |
| General identifiability | Deferred | v1.0 does not claim adjustment-set completeness or hidden-confounder resolution. |
| Counterfactual abduction with hidden variables | Deferred | The current engine does not perform stochastic abduction or latent-variable recovery. |
| Production route activation everywhere | Not true yet | Only the model-backed chat path attempts typed loading today; other routes remain heuristic by design. |
| Runtime operational closure | Pending verification | Typed-SCM loading still requires live RLS/runtime verification in the intended environment. |
Following the initial Truth Cartridge deployment, MASA extended its causal validation infrastructure to include 7 consciousness and theoretical frameworks, transitioning from a "template library" to a Canonical Registry architecture.
Each framework is defined as a canonical .json file containing:
Graphs are stored in domain-specific directories and seeded into Supabase via npm run seed:framework-scms:
| Framework | Source Directory | Core Constraint | Application Domain |
|---|---|---|---|
| IIT (Integrated Information) | Information-Theory/ |
Φ > 0 (information integration) | Consciousness, neuroscience |
| HOT (Higher-Order Thought) | Higher-Order/ |
Meta-representation required | Metacognition, self-awareness |
| Chalmers (Phenomenal) | David-Chalmers/ |
Qualia presence check | Hard problem of consciousness |
| Neural Topology | Graph-Theory-Networks/ |
Graph metrics (centrality, modularity) | Brain connectivity, network science |
| Interpretable Epistemology | Interpretable-Epistemology/ |
Feature attribution clarity | XAI, model transparency |
| Neural Dynamics | Theoretical-Neuroscience/ |
Temporal stability (Lyapunov) | Brain oscillations, chaos theory |
| Alignment Problem | Alignment-Problem/ |
Value alignment proxy | AI safety, goal specification |
Three-stage verification ensures causal graph integrity:
validate-causal-graph-schema.mjs checks JSON structurevalidate-scm-consistency.mjs verifies cross-framework coherenceseed-framework-scms.mjs populates scm_models tableThe /hybrid route implements real-time framework selection:
Maxwell Maltz defined the human mind as a cybernetic "servo-mechanism" driven by a self-image. MASA adopts this architecture to transform from a passive tool to a goal-striving agent.
A cybernetic system requires a clear target and negative feedback to correct course. MASA's Sovereign Memory acts as the "Success Mechanism," storing successful "engrams" (vectors) to guide future attempts.
The system maintains a ConsciousnessState object—a dynamic representation of its own "mental health." This includes:
While the integration of Pearl's Causal Inference and Maltz's Servo-Mechanism provides a powerful framework, it introduces a meta-stable failure mode inherent to all closed-loop AI systems. We term this the Coherence Trap.
| Domain | Constraint | Failure Mode |
|---|---|---|
| Pearl (Causal) | DAG Specification Problem | DAGs inferred from text distinct from true causal structure. |
| Pearl (Causal) | Confounder Blindness | Missing variables in training data lead to false causal links. |
| Maltz (Cybernetic) | Feedback Signal Validity | Auditor validates against the same flawed world model as the Generator. |
| Maltz (Cybernetic) | Credit Assignment | Sovereign Memory filters outcomes but cannot diagnose why they failed. |
| Combined | Distribution Shift | Static world model fails to capture evolving reality (e.g., new physics). |
| Combined | Ground Truth Access | No external validation for abstract domains (Sociology/Economics). |
| Combined | Latent Space Geometry | Embedding distances reflect text statistics, not physical causality. |
When a Causal Inference engine (Pearl) is coupled with a Goal-Seeking Servo-Mechanism (Maltz) on top of a flawed world model, a dangerous feedback loop emerges:
MASA employs Thermodynamic Basis Expansion (Section 4.11.2) specifically to break this cycle. By forcing the system to sample from high-entropy regions of the latent space (high temperature MCMC), we intentionally disrupt the coherence trap, allowing the system to stumble upon "unlikely" truths that contradict its established worldview.
In January 2026, MASA's synthesis engine was applied to its own architectural limitations, generating novel mechanisms to address core constraints in AI systems. This meta-application produced two scientifically rigorous theories that have been validated and partially implemented.
MASA was provided with contradictory sources about AI limitations:
The synthesis engine identified three fundamental tensions and generated five novel ideas. After rigorous MASA audit (Methodologist + Skeptic + Architect critique), two ideas achieved validation scores of 85/100—significantly above the 70/100 publication threshold.
AI synthesis systems exhibit premature convergence—they generate repetitive ideas when exploring narrow hypothesis spaces, analogous to a Markov Chain trapped in a local basin of the energy landscape.
Local optima escape becomes computationally feasible when the spectral gap of the behavioral covariance matrix drops below a critical threshold derived from the landscape's Lipschitz constant:
λmin < 1 / √L| Component | Status | Timeline |
|---|---|---|
| Core Module | Complete | January 2026 |
| Synthesis Integration | Complete | January 2026 |
| UI Visualization | Complete | January 2026 |
| Empirical Validation | Pending | Q1 2026 |
When MASA learns to evaluate ideas across multiple domains (Physics, CS, Biology), traditional approaches suffer from catastrophic interference. Without direct gradient access to API-based LLMs, traditional Fisher-Hessian regularization is impossible.
Interference is mitigated by partitioning the evaluation embedding space into orthogonal subspaces. Instead of model weights, we ensure that domain-specific heuristics are stored in mutually orthogonal regions of the sovereign memory manifold.
|| Pi · Pj ||F < ε| Component | Status | Blocker |
|---|---|---|
| Theory Validation | Complete | — |
| Database Schema | Designed | — |
| Fisher Service | Deferred | Requires domain-level audit corpus and orthogonality optimizer specification |
| MASA Integration | Deferred | Need 100+ audits per domain and validated interference benchmarks |
Both mechanisms underwent the same multi-agent critique applied to external ideas:
| Mechanism | Methodologist Score | Skeptic Score | Final Validity |
|---|---|---|---|
| Thermodynamic Basis | 88/100 | 82/100 | 85/100 |
| Spectral Knowledge Repulsion | 87/100 | 83/100 | 85/100 |
Key Audit Findings:
PDFs and company data are processed to extract structured concepts including thesis, key arguments, methodology, evidence quality, and research gaps.
Cross-source analysis identifies dialectical tensions—claims from different sources that appear to conflict, which become the seeds for novel synthesis.
Using Hong-inspired recombination, the system generates 3-5 competing hypotheses that bridge conflicting claims with novel mechanisms.
Before expensive audit operations, ideas are compared against previously rejected patterns using cosine similarity (>90% threshold = skip).
Three-agent critique system evaluates each hypothesis:
Ideas undergo iterative refinement based on critique. Final ideas receive executable Python protocols and lab manuals.
Generated protocols execute in a Pyodide (WebAssembly) sandbox, producing empirical metrics (p-values, Bayes factors).
All outcomes—approved or rejected—are stored with vector embeddings for future learning.
Traditional LLM applications suffer from runtime amnesia: context improves within a session, then collapses on restart. MASA's Sovereign Memory now provides two layers: (1) durable rejection and trace storage, and (2) additive causal memory operations (pruning, compaction receipts, retrieval fusion, and lattice broadcast) that are controlled by feature flags for safe rollout.
| Component | Technology | Purpose |
|---|---|---|
| Causal Pruning Policy | Deterministic keep/drop scoring with TTL states | Reduce prompt payload under token pressure without deleting stored history |
| Compaction Orchestrator | Axiom-first compaction with explicit fallback receipt | Preserve causal signal across long sessions |
| Retrieval Fusion | Vector + lexical + causal-priority re-ranking | Improve factual/counterfactual recall quality for active reasoning |
| Cross-Session Lattice | Policy-gated axiom event broadcast | Share validated axioms across user-owned sessions without leakage |
| Governance Sentinel | Report-first evaluator + CI workflow | Track memory integrity, faithfulness, and drift over time |
Per Demis Hassabis's axiom: "The limit isn't the math; it's the Ground Truth." An AI system generating untested hypotheses is a philosopher—logically sound but empirically ungrounded. MASA's Chemical Entity Validation system verifies generated reagents against physical reality.
| Without Validator | With Validator |
|---|---|
| Philosopher (Good logic, no proof) | Scientist (Hypothesis → Simulation → Evidence) |
Protocol execution uses Pyodide, a WebAssembly-based Python runtime with inherent isolation:
The system parses stdout for scientific metrics:
| Metric | Pattern | Significance Threshold |
|---|---|---|
| p-value | p-value: 0.03 |
< 0.05 |
| Bayes Factor | bayes_factor: 4.2 |
> 3.0 |
| Sample Size | n: 10000 |
Context-dependent |
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Next.js 15, React 19, TypeScript | Real-time streaming UI |
| Backend | Next.js API Routes, Server Components | SSE streaming, orchestration |
| AI Orchestration | Claude 4.5 Sonnet, Gemini | Generation, auditing, embeddings |
| Database | Supabase (PostgreSQL + pgvector) | Persistence, vector search |
| Validation | Pyodide (WebAssembly) | Secure Python sandbox |
| Research APIs | Semantic Scholar, Serper | Prior art search |
| SCM Registry | JSON Graph Storage + Validation Scripts | Canonical framework definitions, schema validation |
MASA now implements key foundations for a causal scientific-discovery engine. Code-Reality Note (March 2026): the Update Mechanism includes operational persistent-memory primitives (flag-gated), and the Causal Engine v1.0 formal core exists in code, but full production closure still depends on rollout and runtime verification.
| Requirement | Status | Implementation |
|---|---|---|
| Generator | Complete | Novel Idea Engine with Hong-inspired recombination |
| Evaluator | Complete | 3-agent MASA Auditor with calibrated confidence |
| Update Mechanism | Foundation | Sovereign Memory + causal pruning + compaction receipts + retrieval fusion + lattice events (feature-flagged rollout). No online weight updates yet. |
| Physical Validation | Complete | Pyodide sandbox with metrics extraction |
| Causal Validation (Canonical Registry) | Foundation | Registry and support-layer template infrastructure exist, while the formal deterministic engine currently covers typed linear SCM execution, local B1-B6 solver benchmarks, and partial route integration. Broader causal-template enforcement remains a support-layer and roadmap concern. |
BiologicalEcologyTemplate (population dynamics, τ>0.3), SelfishGeneTemplate (gene selection, rB>C), CognitivePsychologyTemplate (individual decision-making, λ≈2.25), and ScalingLawsTemplate (complex systems physics, β regime). This enables comprehensive validation across organizational scales, from molecular genetics to urban systems.
Following the K-Dense AI Forensic Audit, MASA underwent a broader empirical validation phase. The benchmark items below describe MASA-wide evaluation work and should be read separately from the Causal Engine v1.0 B1-B6 solver suite, which is a local deterministic compute benchmark family for the typed SCM engine.
Metric: 88.4% rejection of adversarial counterfactuals [B1]. This indicates that the audit loop can act as a corrective filter rather than a reinforcement chamber under the benchmark conditions measured. Canonical sample-size/baseline/interval details are tracked in Appendix A benchmark artifacts.
Metric: 0.68 learning slope in sequential synthesis [B2]. This suggests that Sovereign Memory can improve generator output quality over time under the benchmark conditions measured. Canonical sample-size/baseline details are tracked in Appendix A benchmark artifacts.
Metric: 82.1% PubChem CID alignment [B3]. Moving from "creative writing" to "valid syntax" by verifying chemical entities exist in reality. Canonical sample-size/baseline details are tracked in Appendix A benchmark artifacts.
MASA now supports causal trace persistence, policy-gated cross-session continuity, and a deterministic SCM engine for typed linear models. However, reaching a more autonomous scientific system still requires demonstrated long-horizon stability, enforced governance thresholds in CI, and live runtime verification that the formal causal path is readable and persists correctly in the intended environment.
Constraint: Memory is now stateful, but orthogonality learning still lacks a validated optimizer and enough per-domain audit data. Since the base models are API-hosted, weight-level Fisher-Hessian control remains inaccessible.
Planned Implementation:
Constraint: Validation is currently limited to In Silico computational simulations and database alignment (PubChem). It does not prove reaction feasibility or biological safety.
Caveat: While Chemical Validation verifies that the nouns (chemical compounds) exist, it does not guarantee that the verbs (reaction protocols) are safe or feasible. Furthermore, the 'Skeptic' and 'Epistemologist' agents are bound by the fundamental training gaps of the underlying base model and cannot verify mechanisms that fall entirely outside its latent representation.
Roadmap: Integration with open-source robotic platforms (e.g., Opentrons) and standardized "Lab-as-Code" interfaces for vendor-agnostic physical protocol execution.
Citation Conventions: [B#] benchmark metric claims, [A#] reproducibility artifact requirements, [R#] external references.