The KWAM Language · kwam.dev/v0.2

A declarative language whose SLA is checked, not promised

One auditable file co-specifies discovery, fault-domain replication, an SLA guard, authorized deploy, RBAC, and metrics. The compiler checks the durability nines against the replication and failure math, and rejects a guard that claims more than the math backs.

What it is

Config, not a general-purpose language

KWAM is declarative on purpose, so every program is total, auditable, and safe to lower.

A KWAM program describes what resilience you want, the fault domains to spread across, the durability to hold, who may deploy, what to watch, and the runtime makes it so. There are no loops, no user-defined functions, and no imperative verbs. That restraint is the point: it keeps the interpreter total and every program reviewable line by line.

Co-specifies the whole control plane

Discovery, replication, the SLA guard, authorized deploy, RBAC/capabilities, and metrics live in one file — not scattered across YAML, scripts, and dashboards.

Honest by construction

The strongest claim the compiler will let you assert is N-nines durability + zero silently-corrupted bits (SHA-256 detection) + a bounded per-bit restore MTTR — never "zero loss."

Closed schemas, fail-closed

Every block schema is closed; an unknown key is a parse error, not a silent drop. All validation errors are fatal and fail closed.

apiVersion Every program begins with apiVersion "kwam.dev/v0.2". v0.1 programs (no header) still parse under a compatibility shim; blocks are forward-additive, and an unknown top-level block under a newer apiVersion is a hard error, never skipped.
A taste

Six lines that mean something

A guard states the SLA; the compiler checks it against the replicate math.

apiVersion "kwam.dev/v0.2"

replicate code_and_data {
  factor        3
  anti_affinity [rack, pdu, spine, az]     # fault-domain independence
}

guard sla {
  durability    6nines      # checked vs the replicate/MTTR/MTBF math — 11nines would be REJECTED
  mttr_restore  90s         # per-bit, INDEPENDENT single-node loss
  integrity     sha256       # zero silently-corrupted bits
}
Why this matters The guard is the honest core. The interpreter computes achievable durability from the replication factor, fault-domain independence, and audited MTBF inputs, and rejects a guard that asserts more nines than the closed-form supports, demonstrated on a rejected 11nines counter-example. The headline KWAM signs is six nines (99.9999%), a design target.
The blocks

Nine blocks, plus the small glue

Each block lowers to one typed policy object. Full reference →

server

Bootstraps the governed control plane: identity, transport, ports, seeds, the trust anchor, and the kill-switch endpoints.

client

The in-memory per-node micro-service image: a content-addressed image cid, sandbox tier, health signals, hot-swap safepoint.

discovery

SWIM-style gossip membership + nearest-neighbor mesh, with an optional narrow tiny-LLM negotiator that only re-ranks candidates.

replicate

Replica factor + anti_affinity over fault domains; the placer keeps replicas in distinct domains.

guard

The SLA: durability in nines, the per-bit mttr_restore, mandatory integrity sha256, and audited MTBF inputs.

policy

RBAC: principals, capabilities, the trust anchor, the sandbox floor, and scoped, non-default discovery.

deploy

An authorized rollout, gated on an externally-minted, signed consent reference: waves, bake, rollback.

metric

Binds an observable (durability, restore p99, silent-corruption count) to a target + window; feeds the guard's error budget.

profile

Selects the hardware/interconnect model (h100, tpu, trainium) and its latency + health hooks.

The small glue: import / use bring in signed, content-addressed modules; let binds reusable values; expressions are literals, references, lists/maps, interpolation ${expr}, and a guarded ternary. Nothing more.

Status

Built vs designed, stated plainly

KWAM applies the same discipline to its own claims that it applies to durability.

Honest status The v0.1 mini-language (lexer → parser → AST → interpreter), the content-defined chunker, and the fan-out math are Built. The v0.2 blocks, the digest-pinned module system, and the durability validator are Built as well: every v0.2 block lowers and runs, and the validator is demonstrated in the conformance suite rejecting an unbacked guard. Claiming 11 nines at replication factor 3 is refused with a reproducible verdict. The capability is still described as "compiler-checked against a stated model," never a "compiler-verified guarantee," because the check is only as strong as the declared failure-model inputs.
Legal

Ownership & governing law

KWAM is our intellectual property, grounded in Swiss law.

Intellectual property & governing law

KWAM is the sole and exclusive property of the owners of KWAM.CH

KWAM — its source code, the KWAM language, the JHMM reconstruction orchestrator, the deterministic codec runtime, and all associated AI components — is a proprietary computer program and the sole and exclusive intellectual property of KWAM.CH. As a computer program it is a protected work under the Swiss Federal Act on Copyright and Related Rights (Copyright Act, CopA), and the exclusive rights of use vest in KWAM as employer; it is further protected as a trade secret under the Swiss Federal Act Against Unfair Competition (UCA). KWAM is offered by private licence only. All rights reserved.

CopA (SR 231.1) Art. 2 para. 3 & Art. 17 · UCA (SR 241) Art. 6 · Governed by the laws of Switzerland · Place of jurisdiction: Zürich