The Clojure of the kotoba stack — a Lisp/EDN subset that compiles to WebAssembly, with a Datomic-style datom data model and CACAO-native authorization.
kotoba is a capability-safe language and content-addressed distributed Datalog database. It defines a source profile (`.kotoba` canonical, portable `.cljc`) that compiles directly to WebAssembly, plus its in-memory datom data model (`kotoba.kgraph`, an EAVT `[e a v]` store).
safe Kotoba adds a capability-confined profile for running untrusted or AI-generated agents. What a module can touch is whatever it was explicitly handed, and nothing else.
The public compiler surface is kotoba wasm. It exposes build, safe-build, and selfhost inspection
over the same compiler APIs, compiling Kotoba/EDN subset directly to real WebAssembly.
Datomic-style 5-tuple (E,A,V,T,Added) with 5-index arrangement (EAVT/AEVT/AVET/VAET/TEA) for
O(1)–O(log n) access, content-addressed over IPFS-compatible CIDv1 blocks.
The language itself is not defined in this repository. kotoba-lang/kotoba-lang is the semantic authority — the language/CLI semantic contract, conformance fixtures, and package/lock contract.
Canonical source extension: .kotoba. Compatibility extensions: .clj, .cljc.
.cljs is retired as a dedicated source extension. Reader-target resolution: :kotoba → :clj → :default.
The CLI/command contract is EDN, not code. lang/cli.edn defines the command surface (M0–M3).
Commands: kotoba check, kotoba run, kotoba wasm emit, kotoba wasm run.
WIT world: kotoba:kais@0.1.0. Host interfaces: kqe (Quad read/write),
kse (Journal), auth (CACAO), llm (CALL_FOREIGN), chain (SourceChain).
Install the kotoba launcher via Homebrew, npm, or from source.
Design decisions live in the parent monorepo ADRs. The cross-cutting design SSoT remains the parent-monorepo ADR
(see 90-docs/adr/2605240001-kotoba-cleanroom-architecture.md).
ADR-kotoba-wasm.md — Clojure/EDN-subset → WebAssembly compiler.
ADR-safe-capability-language.md — safe-clj capability-confined language design.
ADR-clojure-wasm.md — Compiler architecture.
SECURITY-ARCHITECTURE.md — X-Road-style accountability, R0–R3 custody, threat model.
ADR-sealed-cold-tier.md — Encrypted cold tier + t-of-N custody.
ADR-repository-boundaries.md — Split policy for language vs database vs domain actors.
kotoba : kotobase = Clojure : Datomic.