# JOAN — full reference for agents and model context > DRAFT for a future JOAN site (llms-full.txt). Not deployed. Every statement below is either a design doctrine of the house or a measured result with its battery named. JOAN is a public alpha under build-out toward 1.0. Measured results re-verified on 2026-11-22 against the live testnet system: joan-mcp 11/11, battery-joan 23/23, battery-joan-d04 13/13. ## 1. What JOAN is JOAN is a language and contract system for verifiable agreements between agents and humans, built for verifiable machine-to-machine agent actions. Two halves: 1. **The language.** Agents express intent and contracts in JOAN, in a form designed to be judged mechanically. The implementation is Rust, organized in 26 crates, among them: joan-ast, joan-abi, joan-canonical, joan-check, joan-bytecode, joan-compiler, joan-conformance, joan-identity, joan-patch, joan-package, joan-runtime, joan-guardian, joan-instruction, joan-lattice, joan-host, joan-native, joan-executor, joan-case, joan-evidence, joan-dispute, joan-mock-ledger, joan-sim, joan-node, joan-syntax, joan-trust, joan-tool-forge. 2. **The judge.** Doctrine D-19: **JOAN judges only.** JOAN does not mint, seal, pay or execute. It receives artifacts produced by other systems and returns verdicts that name exactly what was checked. Sealing a judged agreement as durable proof is the chain's job — OMTIVO, the enterprise proof platform on million-tower-1. ## 2. The verdict discipline - Verdicts are **VALID**, **INVALID**, or **NOT_VERIFIABLE**. There is no "probably fine". - An artifact whose format has no JOAN judge is **NOT_VERIFIABLE**, with the reason named. JOAN never accepts an artifact on trust, reputation, or a caller's say-so. - Judgments are **offline**: the judge needs the artifact (and, for attestation packages, the chain's published anchors) — no service session, no portal, no network trust. - For MT-ATTESTATION-PROOF-1 packages the verdict decomposes into predicates, each with a `proves_only` note stating exactly what that predicate does and does not prove: HASH_MATCH, FILE_SIZE, SCHEMA_VALID, TIME_BOUND, MULTI_SIG. Attribution is ANCHORED when the package ties to the published anchors (constitution fingerprint, genesis hash, H(M0)); otherwise UNANCHORED, and the caller decides what it requires. ## 3. Judged formats today | Format | What it is | Judge | |---|---|---| | MT-ATTESTATION-PROOF-1 | Enterprise attestation package exported by the D04/OMTIVO enterprise service: evidence manifest, signatures, certified checkpoint | Full judge: verdict + 28 components + 5 predicates + attribution | | MT-BRIDGE-PROOF-1 | Bridge proof package: lock proof and burn proof for a foreign-chain crossing | Full judge: verdict + 11 components | | MT-POLICY-PERMIT-1 | Policy permit binding one operation (recipient, provider, currency, exact amount, single use, expiry) signed by the enterprise service | Permit gate: closed schema, ALLOW, signature, window, exact binding — validated before execution, consumed once | | MT-WEBHOOK-DELIVERY-1 | Signed event delivery from the enterprise service | Inbox: signature over the exact body bytes judged first; event identity is (event_seq, event_hash); applied exactly once; replays are DUPLICATE | Any other format: NOT_VERIFIABLE. ## 4. Canonicalization — three different things, never conflated - **joan-canonical** (JOAN's own): strict canonical JSON values with domain-separated SHA-256 digests. This is how JOAN digests its own objects. - **RFC 8785 JCS** (the chain's canonical JSON): used for shared envelopes at the JOAN↔chain frontier, because a signature is only meaningful if both sides verify the same bytes. Parity at this frontier is proven with cross vectors before any signature is judged — one different byte is a different signature. - **MT-DUAL-1024**: the chain's dual-hash constitution fingerprint construction. It is not a canonicalization and not JOAN's. ## 5. The JOAN ↔ OMTIVO contract (spec mt.enterprise.v1) The flow an agent lives: 1. The agent forms an intent for a case (a payment-like operation with recipient, provider, currency, amount) and signs it with its own ML-DSA-87 key. 2. The enterprise service answers with an MT-POLICY-PERMIT-1 permit (or a denial). The JOAN-side permit gate validates the permit — closed schema, ALLOW, service signature, validity window, exact binding — and consumes it once, before anything is submitted. Consumption precedes execution; a later failure does not resurrect the permit. 3. The signed intent's canonical bytes become the public artifact of an evidence record. The tenant's owner and attester keys sign the manifest (MULTI_SIG); a certified checkpoint seals it; the service exports an MT-ATTESTATION-PROOF-1 package. 4. JOAN judges the exported package offline. Only a VALID judgment with the required attribution counts as final evidence. 5. Signed MT-WEBHOOK-DELIVERY-1 events stream the case's progress; the JOAN-side inbox applies each event exactly once. Idempotency is structural: one settlement key, one record; a resubmission is a declared duplicate, a different intent under the same key is MT_SETTLEMENT_CONFLICT, and an unknown outcome is reconciled by polling the same key — never by resubmitting. ## 6. Measured results (testnet, batteries named) - **battery-joan 23/23** — the JOAN-side adapter against the M5 contract double: real bridge receipt judged VALID; tampered package not VALID; out-of-schema field not VALID; double's own receipt format declared NOT_VERIFIABLE; permit consumed once, reuse denied, over-amount denied MT_BUDGET_EXCEEDED, wrong recipient / expired / extra field / false service signature denied; signed deliveries applied once, replays DUPLICATE, forged signature INVALID, persistence across restart; full case SETTLED_PAID with FINAL_VALID evidence; no permit ⇒ zero operations submitted. - **battery-joan-d04 13/13** — the same contract against the REAL D04 enterprise testnet backend (not a double): tenant and owner/attester keys registered with proof of possession; signed intent → SETTLED_PAID; exported package judged VALID offline in a clean process with ANCHORED attribution and 5/5 predicates PASS; exactly one record per case; attacker-signed intent → AGENT_SIGNATURE_INVALID and zero records; DENY permit → case dies at the gate, zero records. ## 7. Agent access — joan-mcp `joan-mcp` is a zero-dependency stdio MCP server (Node >= 18) wrapping the JOAN-side adapter: | Tool | Input | Output | |---|---|---| | `joan_judge` | evidence package (+ optional published anchors) | verdict, kind, components, predicates, attribution | | `joan_validate_permit` | MT-POLICY-PERMIT-1 permit + expected operation + service public key | valid true/false with the denial code; never consumes the permit | | `joan_receive_delivery` | raw delivery body + signature + webhook public key | APPLIED / DUPLICATE / INVALID | Verified 11/11 over a real MCP handshake against the tree's own fixtures (see the package's evidence transcript). Config: ```json { "mcpServers": { "joan": { "command": "node", "args": ["/path/to/joan-mcp.mjs"] } } } ``` ### Not exposed, deliberately - **JOAN language source parsing / checking / compilation** — Rust crates in the JOAN repository; not present on the MCP host. A tool that claims to parse JOAN source without running them would be a fake, so there is none. - **`joan-canonical` hash** — same reason: JOAN's own canonical hash is a Rust crate. The MCP server does not substitute the chain's JCS or MT-DUAL-1024 and call it JOAN's. - **Case execution** — submitting operations to the enterprise API is the caller's own authenticated act, not a judging act. JOAN's side of a case is the permit gate, the inbox and the judge. ## 8. The pair: agree in JOAN, prove in OMTIVO JOAN and OMTIVO are one stack with two tools: - **JOAN** is where agents agree: intent, contract, permit, verdict. - **OMTIVO** is where agreements become proof: evidence records sealed with MT-DUAL-1024 and ML-DSA-87 signatures, certified checkpoints, exportable packages, and per-property verification (its hosted verification is labelled "OMTIVO-hosted verification — not independent"; for a fully independent verdict, export the package and let JOAN judge it offline). An agent that runs both MCP servers can negotiate and bind an agreement in JOAN, have it sealed in OMTIVO, and later prove — to any third party, offline — exactly what was agreed and that the proof has not changed. ## 9. Status and limits (read before relying) - JOAN: public alpha, pre-1.0. Still to build: the J1 language phase (records and enums, arrays and strings, control flow, recursion, generics, ownership, typed errors, modules, numeric model, formal semantics) and the A16 gate (a second host plus three external agent trials). - The Rust-side JOAN judge (crate `joan-mt-verify`) exists as a prepared package with a zero-divergence parity battery specified against the adapter's judgments; its application in the JOAN repository is an owner-gated step. - Chain side: testnet (million-tower-testnet-1). No production network, no real money, nothing for sale. - Post-quantum note, stated precisely: signatures are ML-DSA-87. No claim of FIPS certification or of any specific bit-security level is made.