Code is an artifact of DNA, not the other way around.
This isn't an agent framework. It's the operating system for agent-human symbiosis. We believe the era of prompting is ending. When your software is written by autonomous agents operating under constraint regimes, the constraints you define ARE the product. Not the code. Not the prompts. Not the tests. The DNA contracts that declare what the system IS — before a single line of code ships. The best AI model in the world follows less than 30% of complex instructions perfectly. Leviathan achieves 96% compliance on the cheapest model. The difference isn't the model. It's the harness.
The entire system—every gate, every lifecycle rule, every governance decision—follows from two irreducible truths.
All resources are finite. Time, tokens, context, memory, compute, attention. Every design decision must respect scarcity. Token budgets are constraints, not suggestions. Context windows are walls, not guidelines.
This axiom forces honest engineering. No infinite retry loops. No unbounded context accumulation. No "just throw more compute at it." Every operation has a budget and a deadline.
Order matters. A then B is not B then A. History is irreversible. Every commit is an immutable receipt. Every state transition is append-only.
This axiom forces accountability. No rewriting history. No silent rollbacks. No pretending a failed experiment didn't happen. The system remembers everything, and the order in which it happened.
The reactive graph IS the AI. FlowMinds listen. Loops manifest. Evals validate.
Agents are dead. Sessions are dead. Swarms are meaningless. What matters is the reactive graph—a self-manifesting knowledge structure where you update a node, connected nodes trickle-update, loops manifest the change, and the whole system converges toward coherence.
The industry is obsessed with agents—how to coordinate them, how to give them memory, how to make them collaborate. This is the wrong abstraction.
Leviathan doesn't have agents. It has a graph that expresses itself through execution primitives. A "coding agent" is just a loop node with an eval gate and a git-commit effect. A "research agent" is a loop with a metric eval and an accumulation session. Strip away the anthropomorphic naming and you find seven primitives composing into arbitrary behaviors.
You don't spawn agents. You spawn workstreams. The graph does the rest.
graph TD G[Knowledge Graph] -->|trickle-update| N1[Node: Intent] G -->|trickle-update| N2[Node: Template] G -->|trickle-update| N3[Node: Gate] N1 -->|manifest| L[Loop] L -->|produce| A[Artifact] A -->|eval| E[Gate] E -->|pass| C[Commit to Graph] E -->|fail| L C -->|trickle-update| G
The reactive graph manifests itself through loops and gates
Three eras of AI-native development. Most teams are still in era one.
Craft the perfect prompt. Stuff the context window. Hope the model does the right thing. Prompt engineering is the BASIC of the AI era—necessary to learn, fatal to stay in.
Build eval loops. Add quality gates. Measure before shipping. The prompt is no longer the moat—the harness is. Control plane, runtime loop, gating strategy. Prompts converge. Harnesses differentiate.
Define what the system IS, not what it should do. DNA contracts compile into harnesses, which compile into runtime behavior. The constraints are the product. Code is the downstream artifact. You're not telling an agent what the system does. You're telling it what the system IS.
Extracted from production agent systems. Validated across 117+ development ticks.
Write DNA contracts and validation gates BEFORE implementation. The constraints declare what 'correct' means—not as vague requirements, but as executable contracts a machine can verify. YAML is DNA. These files define the organism.
The eval harness is itself constrained by its own DNA. Self-referential grounding. The system that verifies your code is verified by the same system. If the harness can be gamed, you have no system.
The harness IS the development loop. Not a test suite you run after. Every tick: produce an artifact, judge it, compare alternatives, keep or discard. The eval flow is the REPL.
Every exploit discovered becomes a new constraint. The verification surface grows monotonically. Gate quality > task quality. If the gates are right, the code follows mechanically.
DNA YAML steers agent behavior. Prose does not. Proof: 14/15 treatment vs 0/15 control.
You're not telling an agent what the system does. You're telling it what the system IS. The DNA is the irreducible representation. Specs explain it. Code implements it. Gates enforce it. But the DNA is the source of truth.
Human-readable purpose and rationale. Lossy but essential for onboarding and alignment. Specs, designs, manifesto. The WHY.
Machine-readable constraints and validation gates. The authoritative declaration of what the system IS. Compiles into runtime behavior. The WHAT.
Deterministic workflow graphs. YAML that compiles into agent orchestration. Nodes, edges, gates, effects. The HOW.
When a Go kernel and a Python script independently arrive at the same four-phase cycle—modify, measure, decide, accumulate—you are not looking at two inventions. You are looking at one primitive asserting itself across codebases.
DNA YAML isn't configuration. It's the genome of the system. It compiles to any framework format like LLVM targets multiple architectures. Today it compiles to FlowMind graphs and reactive hooks. Tomorrow it could compile to CrewAI, LangGraph, or anything else. The constraints are framework-agnostic. The runtime is a projection.
No single-sample decisions. Statistical significance required. Safety violations = automatic discard.
graph LR
P[Produce] --> J[Judge]
J --> C[Compare]
C --> K{Verdict}
K -->|Keep| Ship[Exit: Ship]
K -->|Discard| Bin[Exit: Reject]
K -->|HOLD| P
style Ship fill:#059669,color:#fff
style Bin fill:#dc2626,color:#fff
The eval flow — simple, universal, inescapable
Minimum sample size enforced BEFORE judging — no snap decisions on one example. Judge criteria defined BEFORE production — no post-hoc rationalization. Safety violations = automatic discard — regardless of other metrics. HOLD loops back for more samples — bounded by max_sample_budget.
The agent never marks its own homework. Judgment is externalized.
"One eval run showed improvement, ship it." Single-sample decisions are noise dressed up as signal. The eval flow forces statistical grounding. You collect enough samples before you judge, and you compare against a baseline. Anything else is coin-flipping with extra steps.
Whoever controls the gates controls what the graph learns.
Gates are the loss function. The architect's job is not to write code—it is to write gates. Code is a downstream consequence of well-defined constraints. Gate quality > task quality. Always.
In machine learning, the loss function determines what the model optimizes for. Get the loss function wrong and the model optimizes for the wrong thing—perfectly.
The same principle applies to agent systems. Gates are the loss function of your development process. They determine what gets shipped and what gets rejected. If your gates are weak, agents learn to satisfy weak criteria. If your gates are precise, agents produce precise output.
This realization changes who does what. The senior engineer's job isn't writing code. It's writing gates. The code is what the agent produces under those gates. The graph learns what the gates teach it.
C4: Gates never demote. Aspirational gates can become enforced. Enforced gates cannot become aspirational.
The gate exists as a goal. Violations logged, not blocked.
The gate is documented and measured. Teams track compliance.
The gate blocks. Violations prevent shipping. No exceptions.
The gate runs automatically in CI. No human in the loop. The system enforces itself.
Everything composes from seven execution primitives. "Autoresearch" is just Loop + Eval + Session + Effect.
A unit of computation. Takes input, produces output, has a gate. The atom of the system.
A connection between nodes. Carries data, has type constraints. The graph's wiring.
Repeated execution with a termination condition. Ralph loop, autoresearch loop, heartbeat loop. Three topologies.
Judgment. Gate-based, metric-based, LLM-as-judge, or adversarial. The loss function of the system.
Accumulated state across ticks. The working memory. Bounded by C1 Finitude.
An irreversible side effect. Git commit, API call, file write. Requires a receipt (C2 Non-Commutation).
A declaration of what should happen. Resolves through the graph to concrete execution. The user's will, formalized.
This four-layer pattern recurs everywhere. It is the substrate of the substrate.
Across every layer of Leviathan, the same meta-pattern repeats: declare what you want (YAML, markdown, config), compile it through a lowering step (validation, type-checking, resolution), produce a stable intermediate representation (FlowMind graph, reactive pipeline, config tree), and project it into runtime behavior (CLI, MCP, HTTP, agent execution).
This is not an accident. It is the architectural invariant. When you see a new subsystem that doesn't follow this pattern, that subsystem is either pre-mature or broken.
YAML declaration → flow compiler → execution graph → agent runtime
Handler contract → surface compiler → adapter IR → CLI / MCP / HTTP / SDK
Markdown prompt → usage feedback → FlowMind definition → deterministic pipeline
config.yaml → DNA validator → handler registry → runtime capabilities
Like Lean formal proofs for agent behavior. Impossible to cheat because the verification surface keeps growing.
Agent cheats? You find out? You make an adversarial flowmind. The constraint surface grows. The policy IS the environment. Modifying topology modifies decision-making. The system learns from its own failures.
The adversarial strategy answers one question: "did you game the system?" Per constraint, per invariant, potentially multiple checks per task. Both deterministic checks (did the output match the schema?) and subjective checks (does this feel gamed?).
When the system supports anonymous opt-in telemetry, discovered exploits become community-maintained constraints. Every user's pain becomes every other user's protection. Crowdsourced constraint engineering.
When constraints conflict, the system doesn't hallucinate a fix. It uses mathematical techniques (SAT solvers, Z3) to identify the minimal set of conflicting constraints—the unsatisfiable core—and emits a repair candidate that the agent operates inside.
This replaces "the model hallucinates a fix" with "the system emits a mathematically grounded repair envelope." The agent's creativity is bounded by proof, not hope.
Good patterns strengthen. Rejected approaches decay. Stale knowledge fades.
Successful approaches are reinforced. Validated gate configurations propagate. Skill definitions that produce consistent results get promoted from markdown to FlowMind. The system gets better with age because positive outcomes compound.
Failed experiments are remembered but demoted. Stale knowledge fades as newer evidence accumulates. The system doesn't just forget—it actively de-prioritizes approaches that reality has contradicted. Temporal decay is a feature, not a bug.
Everything expires. Trust is earned through demonstrated competence, not granted by configuration.
Traditional agent frameworks give agents permissions: "this agent can write files," "this agent can call APIs." Permissions are static. They don't account for the agent's track record, the sensitivity of the operation, or the current state of the system.
Leviathan uses leases. An agent earns the right to perform operations by demonstrating competence at lower-stakes tasks. Leases expire. They must be renewed through continued compliance. An agent that starts failing gate checks loses capabilities automatically.
This is how you build systems that fail closed, not fail open. Constraints that never bend.
A browser button, a voice command, a VR gesture, a Stream Deck key, a mobile notification.
Token-efficient TOON output. Content-first (no-args = live data). Self-documenting --help that IS the LLM guide. 40% fewer tokens than JSON.
Model Context Protocol for tool-use integration. Same handlers, different wire format. Schema overhead: 28.5% of input tokens.
REST and streaming for web integration. Same business logic, transport-adapted. Daemon owns all state.
Programmatic embedding. Import the handler, skip the wire format. Composable method routers with canHandle() + handle().
490 benchmark runs. Real data from real agent tasks.
| Approach | Success Rate | Cost/Task | Duration | Turns |
|---|---|---|---|---|
| AXI-Principled CLI | 100% | $0.074 | 21.5s | 4.5 |
| Standalone CLI | 99% | $0.078 | 28.6s | 4.9 |
| Rust CLI + Daemon | 99% | $0.088 | 24.6s | 4.8 |
| MCP Tool Schemas | 99% | $0.101 | 26.0s | 6.2 |
MCP tool schemas consume 28.5% of input tokens. AXI-principled CLIs average 79K tokens vs MCP's 185K. The debate between MCP and CLI is misframed. Principled design beats protocol choice. The cheapest approach is also the most reliable.
The cost of intelligence is dropping to zero. The winners built the best flywheel.
Kubernetes won by being the open standard, not by being the best at any single thing. Lev wins the same way. Open source IS the flywheel. The runtime is free. The constraint engineering platform—the governance, the audit trails, the enterprise gates—is where value accrues.
When intelligence costs zero, the competitive advantage isn't the intelligence—it's the governance. Who can audit what the agent did? Who can prove compliance? Who can demonstrate that the constraint surface is growing, not shrinking?
Leviathan is open source. The runtime, the DNA compiler, the eval harness, the FlowMind executor—all open. The enterprise layer—governance dashboards, audit trails, compliance gates, team coordination—is where the business model lives.
Local-first, federate-ready. Must work on a Raspberry Pi with no network. Must scale to a federated mesh.
Software development is just where we prove it first
Once you figure out the software development lifecycle for LLM interaction, it applies to anything. Content creation, research, design, operations, training—the same spine. Conversation gets you into alignment. The proposal is the current understanding, confirmed correct. The plan is a graph patch. Execution dispatches under constraint. Feedback asks "did it work?" Self-learning saves the experience for next time.
Get into alignment
Understanding confirmed
Graph patch declared
Dispatch under constraint
Did it work?
Save experience
This is not a 'nice to have after prototype.' This is the first requirement.
Which agent. Which step. Which workflow. Which constraint surface. Every message is a Tick: INGEST → OBSERVE → PROPOSE → GATE → APPLY → UPDATE → EMIT.
Input and output logged. Decisions captured. A commit is a tick—append-only, immutable receipt. A diff is a claim with evidence.
Settlement binds to verified receipt. When money or irreversible effects appear, proof is not optional. The audit trail IS the training data for world models.
A contract per workflow, enforced. DNA constraints validate structure. Gates validate behavior. Both run before any artifact ships.
This manifesto is canonical. The DNA is the irreducible representation. Specs explain it. Code implements it. Gates enforce it.
Constraint engineering isn't about restriction. It's about making the right thing easier than the wrong thing. Two axioms. A ratchet model. Validation gates at every boundary. That's how you go from agent chaos to engineering discipline—not by trusting agents more, but by making trust unnecessary.
Leviathan is open source. The DNA is the README.