OATH

Language
Verified code. Immutable truth.

Every definition is a sealed promise.

Oath Language is an AI-native verified-codebase kernel. Definitions are content-addressed by the hash of their canonical form, carry machine-checked properties inside their identity, and live in an immutable object store. The syntax is disposable — the substrate is the product.

— every definition is a sealed promise —
56
definitions
207
properties
134
proven by Z3
37
fully proven
2
kernels agree

The substrate

A codebase that verifies itself before it trusts a name.

Code isn't files and folders — it's an immutable graph of content-addressed objects. Each definition arrives with its specification attached. The kernel typechecks it, runs every property, and only then lets a human-readable name point at it.

  • Identity is the hash. Rename every variable — the object is byte-identical. De Bruijn binders make code alpha-canonical by construction.
  • The gate is total. Ill-typed code is refused; every accepted definition has been checked, tested, and verdicted.
  • Verdicts compose. Totality, confinement, and proofs propagate bottom-up through the dependency graph.
examples/list.oathproven
(data List [a]
  (Nil)
  (Cons a (List a)))

(defn length [a] [(xs (List a))] Int
  (match xs
    ((Nil) 0)
    ((Cons h t) (+ 1 (length [a] t))))
  (prop non-negative [(xs (List Int))]
    (<= 0 (length [Int] xs)))
  (prop cons-adds-one [(x Int) (xs (List Int))]
    (== (length [Int] (Cons [Int] x xs))
        (+ 1 (length [Int] xs)))))

The s-expression syntax is an input format. It elaborates to the canonical AST and is thrown away; oath get projects a fresh one back for human auditors.

Six invariants

What every object carries.

Identity, properties, proofs, capabilities, dependencies, metadata — the six things that make a definition a promise rather than a suggestion.

Identity

content-addressed

A definition's name is the SHA-256 of its canonical AST. Rename every variable and the hash is unchanged — binders are de Bruijn indices, so formatting and naming diffs cannot exist.

Properties

machine-checkable

Every definition carries its specification as part of its signature. The kernel refuses ill-typed code at the gate and runs every property before a name is ever trusted.

Proofs

tested or proven

Properties climb an honest ladder: asserted → tested with deterministic cases → PROVEN for all inputs by Z3, including recursive functions by structural induction.

Capabilities

authority-bounded

Effects are capabilities passed as ordinary parameters — the signature is the authority audit. The kernel proves confinement: a capability that never escapes is verdicted so.

Dependencies

explicit graph

Definitions reference each other by hash, forming an acyclic graph. Verdicts — totality, confinement, proofs — compose bottom-up through it like a lemma library.

Metadata

names are metadata

Names, docs, and guarantees live beside the object, never inside its identity. The store is an immutable object database; names are a mutable index that points into it.

The guarantee ladder

Honest about how much it knows.

A property doesn't just pass or fail. It sits on a rung, and the rung is recorded in the definition's metadata. Nothing is dressed up as more certain than it is.

asserted

Stated, not yet checked

The claim exists in the signature.

tested

200 deterministic cases

Inputs seeded from the definition's own hash — reproducible.

proven

All inputs, via Z3

SMT-LIB translation, structural induction for recursion.

falsified

Refuted, with a counterexample

A wrong definition is a recorded fact, not a hidden bug.

The exhibits kept on purpose

examples/undertested.oath — abs-smalltested · refuted by Z3
(defn abs-small [] [(x Int)] Int
  (if (< x 0) (- 0 x) x)
  (prop bounded-wrongly [(x Int)]
    (< (abs-small x) 401)))

Passes all 200 test cases; Z3 refutes it at x = -401, an input the generator never draws. This is why the rungs differ.

examples/nontotal.oath — spinfalsified
(defn spin [] [(x Int)] Int
  (spin x)
  (prop claims-zero [(x Int)]
    (== (spin x) 0)))

Non-terminating. The type system accepts it; the termination checker won't bless it; the fuel bound turns the loop into an honest verdict instead of a hang.

examples/sort.oath — insertion sortproven · total
(defn sort [] [(xs (List Int))] (List Int)
  (match xs
    ((Nil) (Nil [Int]))
    ((Cons h t) (insert h (sort t))))
  (prop output-is-sorted [(xs (List Int))]
    (is-sorted (sort xs)))
  (prop preserves-length [(xs (List Int))]
    (== (length [Int] (sort xs)) (length [Int] xs)))
  (prop preserves-counts [(x Int) (xs (List Int))]
    (== (count x (sort xs)) (count x xs)))
  (prop idempotent [(xs (List Int))]
    (== (sort (sort xs)) (sort xs)))
  (prop sorted-is-fixpoint [(xs (List Int))]
    (if (is-sorted xs) (== (sort xs) xs) true)))

Proof, not vibes

Insertion sort, proven correct for every list.

Authored against the specs of List, length, and append — never their bodies. The permutation oath is the strong one: count x (sort xs) == count x xs. Sorted output plus same length can both hold for wrong code; sorted plus counts-preserved cannot.

  • Proven by structural induction, discharged to Z3 over unbounded integers.
  • idempotent and reverse-invariant go through a four-lemma plan: insert commutativity, the sorted-head no-op, snoc-is-insert, and the sorted-fixpoint theorem.
  • Proven properties become a lemma library, asserted as axioms in later proofs — composing bottom-up through the hash graph.

Effects as capabilities

The signature is the authority audit.

No effect system — a capability is just a record of functions passed as an ordinary parameter. Purity is visible as the absence of capability parameters. Properties quantify over generated simulated worlds, and the kernel proves confinement: a capability that is only exercised — never returned, stored, or captured — is verdicted confined.

  • Capability verdict: net: confined. Contrast examples/leaky.oath, where net: ESCAPES.
  • Function values are array-encoded for Z3, so higher-order properties quantify over all functions.
examples/service.oath — greetnet: confined
(defn greet [] [(net {fetch (-> Str Str)}) (id Str)] Str
  (++ "Hello, " (++ ((. net fetch) id) "!"))
  (prop same-world-same-answer [(net {fetch (-> Str Str)}) (id Str)]
    (== (greet net id) (greet net id)))
  (prop never-shorter-than-frame [(net {fetch (-> Str Str)}) (id Str)]
    (<= 8 (str-len (greet net id)))))

Trust by reproduction

Two kernels. Byte-identical hashes.

The Go reference kernel and an independent Rust kernel — the second built blind from the specification and fixtures alone, never the Go source. They agree on every hash, every verdict, and all six conformance checks. When identity is a hash, no server has to be trusted; a definition is verified by reproducing it.

oath

Go reference · zero deps

The normative kernel and CLI. Typechecker, evaluator, prover, mutation tester, content-addressed store, MCP server.

oathrs

Rust · built blind

An N-version implementation from SPEC.md + fixtures only. Every ambiguity it surfaced is a recorded spec finding.

conformance

six checks · CI-gated

Byte-identical hashes, verify transcripts, analyses, and every proof outcome must match across both kernels, on every change.

Read the promises for yourself.

The playground is the real verified corpus — 56 definitions with their actual content hashes and Z3 verdicts. Nothing mocked.