6.2 Typed, Durable, Inspectable Runtimes for Investigation
Editorial context, 2026-04-20: The questions, constraints, proposals, disagreements, and caveats below are reformulated from the saved research discussion. LLM recommendations remain attributed proposals, not decisions by the author or independently verified findings. Technical examples and quoted source passages retain their original wording.
Executive summary
The saved survey reports strong solutions for almost every individual layer of the proposed system, but did not identify a published system that combines the layers into one computation model with the proposed contract:
typed investigation program -> static epistemic checks -> logical plan -> contract-preserving optimisation -> physical plan -> durable execution -> inspectable evidence state -> finding or typed abstention
The closest work falls into five groups. PlanCompiler, λ_A, Lean4Agent and ZipperGen/Causal Past Logic provide the strongest precedents for typed or formally checked agent programs. PlanCompiler is especially direct evidence that moving agent-plan errors into a compiler can improve reliability: it validates typed plans before deterministic execution and succeeds on 278/300 structured workflow tasks versus 202/300 and 187/300 for its free-form baselines.
RUBICON and DSPy are the closest precedents for the database/compiler side. RUBICON treats heterogeneous AI/data operations as a query-processing problem with an algebra, wrappers, visible intermediate results and cost-based optimisation; DSPy treats LM systems as declarative programs that can be compiled/optimised against metrics. Neither gives Coverage, Authority, ConflictResolved or ProvenanceExact the semantics of types or effects that gate construction of a final answer.
Database provenance is substantially more mature than AI-agent provenance. Provenance semirings give compositional algebra for explaining how outputs depend on inputs; ProvSQL implements provenance-aware relational computation in PostgreSQL and now has a Lean formalisation of its algebraic core; W3C PROV supplies a standard vocabulary for entities, activities, agents, derivations, revisions and primary sources. These appear directly reusable for the proposed provenance layer.
Temporal, DBOS and LangGraph already solve much of the engineering problem of durable execution: persistent state, failure recovery, replay/checkpointing, human pauses and long-running workflows. HASH’s Petri-net work additionally shows that Petri nets are being explored as an explicit, inspectable control model for agent systems. Their missing layer is epistemic semantics: they durably execute computation, but they do not document a general mechanism by which an unresolved source conflict or incomplete corpus screening makes a FinalFinding unconstructable.
Finally, PaperQA2, OpenScholar, STORM/Co-STORM and Hebbia Matrix demonstrate that evidence-seeking workflows benefit from iterative retrieval, source-linked synthesis, contradiction detection, decomposition and inspectable intermediate state. More specialised work isolates individual epistemic dimensions: RA-RAG estimates source reliability, FaithfulRAG explicitly models fact-level conflicts, and TRAQ supplies an end-to-end statistical correctness guarantee for RAG through conformal prediction. None of these sources documents the complete five-contract model–coverage, provenance, authority, contradictions and abstention–as compositional program semantics.
That leaves a credible first-paper gap. The proposal is to formulate it more narrowly than “a new agent runtime”:
Can evidence requirements be represented as compositional program contracts such that a compiler and runtime prevent an LLM investigation from finalising unless the execution produces machine-checkable certificates for the required epistemic conditions?
That matches the distinction already emerging in the research notes: the compiler verifies properties of the investigation computation while probabilistic operators remain responsible for uncertain semantic judgements. The broader durable operating-environment idea can remain the architecture around this contribution. The bounded-corpus evaluation setup you sketched is particularly well aligned with making the claim testable.
A key caveat follows from the literature: The proposal is to not call coverage=complete a guarantee that all semantically relevant evidence was found. You can deterministically certify that every document in a frozen corpus snapshot was screened, that every required question facet received an execution path, or that every final claim has provenance. Semantic evidence recall remains dependent on probabilistic operators unless you place an explicit statistical or verified contract around those operators. TRAQ is useful precisely because it shows one way to put statistical coverage guarantees around otherwise uncertain RAG behaviour.
Research claim and taxonomy
A useful way to position the project is as the missing intersection of programming languages, database systems, durable workflows and evidence-oriented AI:
flowchart TB
TARGET["Typed investigation runtime<br/>with epistemic contracts"]
PL["Typed & formally verified<br/>agent programs"]
QP["Query languages,<br/>compilers & optimisers"]
PROV["Provenance algebra<br/>& standards"]
DUR["Durable workflow<br/>runtimes"]
INV["Evidence-seeking<br/>AI systems"]
PL --> TARGET
QP --> TARGET
PROV --> TARGET
DUR --> TARGET
INV --> TARGET
PL1["λ_A · Lean4Agent<br/>PlanCompiler · ZipperGen"] --> PL
QP1["RUBICON · DSPy"] --> QP
PROV1["Semirings · ProvSQL<br/>W3C PROV"] --> PROV
DUR1["DBOS · Temporal<br/>LangGraph · Petri nets"] --> DUR
INV1["PaperQA2 · OpenScholar<br/>STORM · Hebbia<br/>RA-RAG · FaithfulRAG · TRAQ"] --> INV
This taxonomy is important because a superficial related-work comparison makes the idea look less distinct than it is. “Typed agent plans” already exist. “Durable agents” already exist. “RAG with citations” already exists. “Formal verification of probabilistic programs” has decades of work behind it. The contribution becomes more specific when the five pieces are composed into one semantic boundary.
The proposal is to distinguish four meanings of coverage in the paper:
Existing RAG benchmarks and systems often measure answer breadth, retrieval recall or citation completeness, while TRAQ demonstrates that a different kind of statistical correctness guarantee is possible. Treating those notions as equivalent would overstate what a compiler can prove.
For the comparison below, E means the dimension is enforced by an explicit formal/runtime mechanism, F means it is addressed as a feature or measured behaviour but is not exposed as a compositional program contract, and Unspecified means the survey identified no explicit statement in the primary source. “Unspecified” should not be read as evidence that a private implementation lacks the capability.
Comparative landscape
The table shows an important asymmetry. Programming-languages work is strongest on structural correctness; database work is strongest on provenance and optimisation; workflow systems are strongest on durability; research/RAG systems are strongest on semantic evidence operations. The five-way epistemic contract is largely absent from the interfaces joining those layers. This is an inference from the primary sources above, not a claim that no unpublished or proprietary implementation has such machinery.
Annotated relationship to the proposed research
The annotations below continue in the linked notes with their original arguments retained and wording edited.
- Formal languages and verification
- Provenance, query processing and scientific workflows
- Durable and inspectable execution
- Investigation and evidence systems
- Benchmarks and datasets
Gaps and direction for a first paper
The main gap is not another typed orchestration language. λ_A, Lean4Agent and PlanCompiler make that claim difficult to defend. It is also not another durable workflow engine, because LangGraph, Temporal and DBOS already occupy that layer, nor merely provenance-preserving RAG, because database provenance and evidence-oriented systems already cover substantial parts of that problem.
The proposed gap to defend is:
A compositional contract system for evidence-seeking probabilistic programs, in which conclusion strength is determined by machine-checkable evidence state and unsatisfied obligations become explicit abstention rather than silently degraded answers.
The formal model, compiler example, and evaluation design continue in the linked notes.
What looks most novel
Across the primary sources reviewed, provenance by itself is mature, typed agent plans are becoming established, durable execution is established, contradiction handling exists, source reliability exists, and even statistically guaranteed RAG correctness exists.
The underexplored composition is:
declared epistemic requirements
↓
typed obligations
↓
compiler rejects structurally incapable plans
↓
optimizer chooses only contract-compatible implementations
↓
durable probabilistic execution
↓
runtime certificates + compositional provenance
↓
finding strength determined by certificates
↓
explicit abstention when obligations remain openWithin that composition, authority is the least developed dimension identified by the survey. RA-RAG learns source reliability, W3C PROV can record provenance/revision/primary-source relationships, and many systems let users restrict sources, but the survey identified no primary source here describing a general typed investigation policy such as:
authority {
statute > regulation > guidance
accepted > draft
current > superseded
primary > derivative
unresolved_conflict(
source >= authoritative
) prohibits DefensibleFinding
}RA-RAG’s reliability estimation and W3C PROV’s source metadata are useful ingredients, but neither supplies that policy semantics.
Abstention as a type-level outcome also looks promising. RGB tests negative rejection, and TRAQ gives a statistical treatment of uncertainty, but the architectural idea that failure to discharge a declared evidence obligation automatically changes the set of constructible output types is different from prompting a model to say “I don’t know”.
My strongest recommendation is therefore to make the first paper about epistemic contracts and certificate-carrying investigation, with durability, provenance and logical/physical planning implemented just deeply enough to make that semantics real. Petri nets, visual programming, multi-agent collaboration and a learned cost optimiser can remain part of the broader research programme. That gives the first paper a narrow falsifiable claim while preserving the larger architecture: a typed, durable, inspectable environment in which probabilistic agents operate inside symbolic constraints rather than being responsible for enforcing those constraints themselves.
References
- Qin Liu. λ_A: A Typed Lambda Calculus for LLM Agent Composition (2026). https://arxiv.org/abs/2604.11767
- Ruida Wang, Jerry Huang, Pengcheng Wang, Xuanqing Liu, Luyang Kong, Tong Zhang. Lean4Agent: Formal Modeling and Verification for Agent Workflow and Trajectory (2026). https://arxiv.org/abs/2606.06523
- Pranav Harikumar. PlanCompiler: A Deterministic Compilation Architecture for Structured Multi-Step LLM Pipelines (2026). https://arxiv.org/abs/2604.13092
- Benedikt Bollig. Causal Past Logic for Runtime Verification of Distributed LLM Agent Workflows (2026). https://arxiv.org/abs/2605.20923
- ZipperGen project. https://zippergen.io/
- Cheng Wen et al. Formally Specifying the Intended Behavior of the Program: LLM-Driven Neuro-Symbolic Program Specification Synthesis (AutoSpec+) (ACL 2026 Demo). https://aclanthology.org/2026.acl-demo.66/
- Philipp Schröer, Kevin Batz, Umut Yiğit Dural, Darion Haase, Benjamin Lucien Kaminski, Joost-Pieter Katoen, Christoph Matheja. Caesar: A Deductive Verifier for Probabilistic Programs (2026). https://arxiv.org/abs/2605.15827
- Gilles Barthe et al. An Assertion-Based Program Logic for Probabilistic Programs (Ellora) (2018). https://arxiv.org/abs/1803.05535
- Todd J. Green, Grigoris Karvounarakis, Val Tannen. Provenance Semirings (PODS 2007). https://www.cs.ucdavis.edu/~green/papers/pods07.pdf
- ProvSQL: Provenance and Probability for PostgreSQL. https://provsql.org/
- W3C Provenance Working Group. PROV-O: The PROV Ontology (2013). https://www.w3.org/TR/prov-o/
- Common Workflow Language (CWL). https://www.commonwl.org/
- Omar Khattab et al. DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines (2024). https://arxiv.org/abs/2310.03714
- DSPy Assertions: Computational Constraints for Self-Refining Language Model Pipelines. https://arxiv.org/abs/2312.13382
- Fabian Wenz, Felix Treutwein, Kai Arenja, Çağatay Demiralp, Michael Stonebraker. An Alternate Agentic AI Architecture (It’s About the Data) / RUBICON (2026). https://arxiv.org/abs/2604.21413
- LangGraph documentation. https://docs.langchain.com/oss/python/langgraph/overview
- Temporal durable execution platform. https://temporal.io/
- Michael Stonebraker et al. DBOS research project and runtime. https://dbos-project.github.io/ and https://docs.dbos.dev/
- HASH. Petri Net-Powered Agents (2026). https://hash.ai/blog/petri-nets-for-agentic-ai
- Michael D. Skarlinski et al. Language agents achieve superhuman synthesis of scientific knowledge / PaperQA2 (2024). https://arxiv.org/abs/2409.13740
- PaperQA repository. https://github.com/Future-House/paper-qa
- OpenScholar: Synthesizing scientific literature with retrieval-augmented language models. Nature (2026). https://www.nature.com/articles/s41586-025-10072-4
- Yijia Shao et al. Assisting in Writing Wikipedia-like Articles From Scratch with Large Language Models (STORM) (2024). https://arxiv.org/abs/2402.14207
- STORM / Co-STORM repository. https://github.com/stanford-oval/storm
- Hebbia Matrix product. https://www.hebbia.com/product
- Jeongyeon Hwang et al. Retrieval-Augmented Generation with Estimation of Source Reliability (RA-RAG) (EMNLP 2025). https://aclanthology.org/2025.emnlp-main.1738/
- Qinggang Zhang et al. FaithfulRAG: Fact-Level Conflict Modeling for Context-Faithful Retrieval-Augmented Generation (ACL 2025). https://aclanthology.org/2025.acl-long.1062/
- Shuo Li, Sangdon Park, Insup Lee, Osbert Bastani. TRAQ: Trustworthy Retrieval Augmented Question Answering via Conformal Prediction (NAACL 2024). https://aclanthology.org/2024.naacl-long.210/
- Tianyu Gao et al. Enabling Large Language Models to Generate Text with Citations (ALCE) (EMNLP 2023). https://aclanthology.org/2023.emnlp-main.398/
- ALCE repository. https://github.com/princeton-nlp/ALCE
- Benchmarking Large Language Models in Retrieval-Augmented Generation (RGB). https://arxiv.org/abs/2309.01431
- RGB repository. https://github.com/chen700564/RGB
- RAGTruth dataset. https://github.com/ParticleMedia/RAGTruth
- MAGIC: A Multi-Hop and Graph-Based Benchmark for Inter-Context Conflicts in Retrieval-Augmented Generation (Findings of EMNLP 2025). https://aclanthology.org/2025.findings-emnlp.466/
- RARE: Retrieval-Aware Robustness Evaluation for Retrieval-Augmented Generation Systems (2025). https://arxiv.org/abs/2506.00789
- DeepResearch Bench: A Comprehensive Benchmark for Deep Research Agents (2025). https://arxiv.org/abs/2506.11763
- DeepResearch Bench II: Diagnosing Deep Research Agents via Rubrics from Expert Report (2026). https://arxiv.org/abs/2601.08536
- DeepScholar-Bench: A Live Benchmark and Automated Evaluation for Generative Research Synthesis (2025). https://arxiv.org/abs/2508.20033
- PaSa: An LLM Agent for Comprehensive Academic Paper Search (2025). https://arxiv.org/abs/2501.10120
- User-provided note: compiler-approach.md.
- User-provided note: startup-operating-environment.md.
- User-provided note: startup.md.
Index
Sections
- Executive summary
- Research claim and taxonomy
- Comparative landscape
- Annotated relationship to the proposed research
- Benchmarks and datasets
- Gaps and direction for a first paper
- References
Works and systems
- ALCE
- AutoSpec+
- Caesar / HeyVL
- Common Workflow Language
- DBOS
- DSPy / DSPy Assertions
- Ellora
- FaithfulRAG
- HASH Petri Net-Powered Agents
- Hebbia Matrix
- LangGraph
- Lean4Agent
- OpenScholar
- PaperQA2
- PlanCompiler
- Provenance Semirings
- ProvSQL
- RA-RAG
- RUBICON
- STORM / Co-STORM
- Temporal
- TRAQ
- W3C PROV / PROV-O
- ZipperGen / Causal Past Logic
- λ_A
Benchmarks
- ALCE
- DeepResearch Bench
- DeepResearch Bench II
- DeepScholar-Bench
- LitQA2
- MAGIC
- PaSa / RealScholarQuery
- RAGTruth
- RARE / RARE-Set
- RGB
- ScholarQABench
Library sources
- Wei et al. 2025, Multi-Objective Agentic Rewrites for Unstructured Data Processing (arXiv:2512.02289)