A deterministic, distributed, capability-safe execution fabric for agent workflows.
CATHEDRAL.FABRIC is an agent operating substrate that provides:
- Deterministic workflow compiler - Compile high-level workflows into typed execution DAGs
- Distributed scheduler - Execute across single machines or clusters with guaranteed ordering
- Replicated event log - Hash-chained, append-only log that serves as single source of truth
- Replay engine - Reconstruct full cluster state from any point in history
- Policy system - Capability-based security with logged proof objects
- Tool sandbox - WASM isolation with fuel limits and mediated host functions
- Trace UI - Terminal interface for audit and debugging
- Formal verification - TLA+ specs for core protocols
This is larger than an agent framework. It is a substrate for building verifiable, auditable, reproducible agent systems.
CATHEDRAL guarantees:
- Canonical event encoding - Byte-stable across Linux, macOS, Windows
- Hash chained logs - Tamper-evident event history
- Deterministic replay - Reconstruct exact state from snapshots and logs
- Deterministic execution - Same inputs always produce same event sequence
- Capability enforcement - Every side effect requires explicit capability
- Policy proofs - All allow/deny decisions logged with justification
- Tool isolation - Deny-by-default sandboxing
- Stable diffs - Minimal divergence explanation between runs
- Portable bundles - Reproduce without network access
CATHEDRAL does NOT guarantee:
- Model truthfulness
- Tool output truthfulness
- Optimal plans
- Immunity to operator misconfiguration
- Perfect performance
┌─────────────────────────────────────────────────────────────────────┐
│ CLI / TUI / API │
├─────────────────────────────────────────────────────────────────────┤
│ PLAN │
│ (DSL parser → DAG compiler → resource/capability contracts) │
├─────────────────────────────────────────────────────────────────────┤
│ RUNTIME │
│ (scheduler → executor → backpressure → capability enforcement) │
├─────────────────────────────────────────────────────────────────────┤
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────────┐ │
│ │ LOG │ │ REPLAY │ │ STORAGE │ │ CLUSTER │ │
│ │ encoding │ │ diff │ │ snapshot │ │ replication consensus │ │
│ │ chain │ │ trace │ │ blob │ │ membership election │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────────────────┘ │
├─────────────────────────────────────────────────────────────────────┤
│ ┌──────────┐ ┌──────────┐ ┌──────────────────────────────────┐ │
│ │ POLICY │ │ TOOL │ │ WASM │ │
│ │ language │ │ sandbox │ │ fuel limits memory limits ABI │ │
│ │ proof │ │normalize │ │ isolation │ │
│ └──────────┘ └──────────┘ └──────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────────────┤
│ CORE │
│ (pure types: IDs, hashes, capabilities, time, errors) │
├─────────────────────────────────────────────────────────────────────┤
│ SIM │
│ (deterministic network/failure simulation with recorded seeds) │
└─────────────────────────────────────────────────────────────────────┘
cargo install cathedral-fabric --cli cathedral# Run a workflow
cathedral run -f workflow.cath
# Replay from logs
cathedral replay -b run-001.cath-bundle
# Diff two runs
cathedral diff --left run-001.cath-bundle --right run-002.cath-bundle
# View trace in TUI
cathedral-tui -i run-001.cath-bundleworkflow "example" {
resources cpu: "100m", memory: "64Mi"
step "fetch" using tool:read_url {
input: { url: "https://example.com/data" }
}
step "process" depends_on: ["fetch"] using tool:transform {
input: { data: fetch.output }
}
step "write" depends_on: ["process"] using tool:write_file {
input: { path: "output.txt", content: process.output }
capabilities: [FsWrite { prefix: "./output" }]
}
}
Replay reconstructs full execution state from snapshots and logs:
cathedral replay -b bundle.cath-bundle --from-snapshot snap-001Replay guarantees:
- Byte-identical workflow compilation output
- Identical scheduling decisions from log
- State reconstruction at each event
- Divergence detection with causal tracing
Compare two runs with minimal stable diff:
cathedral diff --left run-001.cath-bundle --right run-002.cath-bundleDiff output:
- First divergent event
- Causal ancestors of divergence
- Human-readable summary
- Machine-readable JSON
CATHEDRAL runs identically on single machines and clusters:
# Start coordinator
cathedral-server --role coordinator --bind 0.0.0.0:8080
# Start workers
cathedral-server --role worker --join coordinator:8080All scheduling decisions are events in the replicated log:
- Task assignment to workers
- Resource allocation
- Capability grants
- Timeouts and retries
Uses Raft for log replication:
- Leader election
- Log commitment
- Snapshot transfer
- Membership changes
Tools declare:
name: "web_fetch"
version: "1.0.0"
input_schema: {...}
output_schema: {...}
capabilities: [NetRead { allowlist: ["*.example.com"] }]
side_effects: []
determinism: "maybe"
timeout: "30s"
Tools run in WASM with:
- Fuel limits (instruction count)
- Memory limits
- Capability-mediated host calls
- No ambient authority
Tool output is normalized:
- Raw output stored
- Normalized output computed
- Hash of normalized output in log
- Never trust raw output
policy "default" {
allow tools: ["read_url", "write_file", "transform"]
deny capabilities: [NetWrite]
rule "data_access" {
match { tool: "read_url" }
require { capability: NetRead }
allow { domains: ["*.trusted.com"] }
}
rule "file_write" {
match { tool: "write_file" }
require { capability: FsWrite }
allow { prefix: "./outputs" }
redact { field: "api_key" }
}
}
Each policy decision produces a proof:
{
"decision_id": "...",
"allow": true,
"matched_rule": "data_access",
"reasoning": {...},
"timestamp": "..."
}cathedral certify -b run-001.cath-bundleCertification validates:
- Hash chain integrity
- Snapshot signatures
- Cross-platform reproducibility
- Event ordering correctness
Certification runs on:
- Linux (x86_64, ARM64)
- macOS (x86_64, ARM64)
- Windows (x86_64)
Bundles certified on one platform reproduce on all platforms.
Assumes:
- Tools may be malicious
- Models may hallucinate
- Operators may misconfigure
- Network may be partitioned
Defends against:
- Unauthorized capability use
- Log tampering (detects via hash chain)
- Snapshot injection
- Undocumented side effects
Capabilities are:
- Immutable per run
- Explicitly granted
- Logged on every check
- Non-transferable
Every action is logged:
- Capability checks
- Policy decisions
- Tool invocations
- I/O operations
- Scheduling decisions
- Network partition - Consensus pauses, resumes on reconnect
- Tool crash - Logged, retry policy applies
- Worker crash - State replayed on another worker
- Snapshot corruption - Detected, rejected
- Resource exhaustion - Backpressure, queue limits
- Malicious tool - Isolated, logged, can be analyzed
- Model deception - Cannot detect model lying
- Tool data lies - Treated as data, validated separately
- Operator error - Policy cannot prevent all misconfigurations
cathedral.fabric/
├── Cargo.toml # Workspace config
├── crates/
│ ├── cathedral_core/ # Pure types, no I/O
│ ├── cathedral_log/ # Event log, encoding, hash chain
│ ├── cathedral_replay/ # Replay engine, diff
│ ├── cathedral_plan/ # DSL parser, DAG compiler
│ ├── cathedral_runtime/ # Execution engine, scheduler
│ ├── cathedral_policy/ # Policy language, proofs
│ ├── cathedral_tool/ # Tool interface, sandbox
│ ├── cathedral_wasm/ # WASM runtime
│ ├── cathedral_storage/ # Content-addressed storage
│ ├── cathedral_cluster/ # Distributed execution
│ ├── cathedral_sim/ # Deterministic simulation
│ ├── cathedral_cli/ # Command-line interface
│ ├── cathedral_server/ # HTTP API
│ └── cathedral_tui/ # Terminal UI
├── docs/ # Documentation
├── rfcs/ # RFC process
├── examples/ # Example programs
├── fuzz/ # Fuzz targets
└── .github/workflows/ # CI/CD
- Rust 1.85+
- Nightly for fuzzing
cargo build --releasecargo test --workspacecargo install cargo-fuzz
cargo fuzz run cathedral_log_parsercargo test --package cathedral_sim sim_longcargo fmtcargo clippy --all-targets --all-featuresSee CHANGELOG.md for version history.
Release template:
- Stable features
- Experimental features
- Known limitations
- Security notes
- Determinism notes
- Upgrade notes
MIT OR Apache-2.0
See CONTRIBUTING.md for details.
We are committed to providing a welcoming and inclusive environment.
See SECURITY.md for reporting vulnerabilities.