XAP — the experience layer

XAP is the experience layer at the top of the CX web stack. It composes the cx-stdlib primitives — bus, journal, authz, session, sched, over http — into one orchestrator, so you build a capability once and surface it through many clients (CLI, TUI, web, agent) without rewriting it.

The cascade

Every intent commits through one synchronous, server-authoritative, journal-folded path. The bus is the single enforcement point: it calls the policy decision once, appends to the hash-chained journal, and re-folds state. A rejected intent is a value on the failure channel — not a crash. Reads are a deterministic fold over the log, always live and present.

Agent-parity

Agents are first-class peers. They emit the same intents as humans and are gated by the same authz dial — a delegation you can attenuate, time-bound, or revoke. Surfaces are medium-agnostic, so the same capability renders for a terminal, a browser, or an agent.

Using it

[?lib 'cx-xap' :as xap] imports the runtime — it is bundled in the binary, no install. The four demos below are a ladder: one capability, surfaced through progressively more clients — each rung turns on exactly one more subsystem. Run each with the command on its page.

The demo ladder