TOUR · CHAPTER 5

Compile and deploy

From contract to verifiable artifact. AIR, MEX, and the enforcement loop.

You’ve written a contract. You’ve composed a few spaces. Time to ship it.

What the compiler does

The Anglish compiler reads your declarations and produces three things:

  1. The Space–Path Graph (SPG). Every space becomes a graph node; every =path connects two of them; tasks and data resources hang off the nodes they belong to. The SPG is what gets validated against the contract.
  2. The Anglish Intermediate Representation (AIR). A typed, deterministic serialisation of the SPG plus the bound vibe blocks, ready for downstream agents and runtimes.
  3. Authorship metadata. Every output is tagged with which author (human, AI, or composite) produced which decision. This is what makes the diff legible at review time.

If your contract doesn’t validate — a :FUNC space tries to persist directly, a path references a space that doesn’t exist, a vibe block omits a required reference — the build fails. You see exactly where, with the offending line.

The MEX archive

The assembler takes the AIR and packages it into a Mixed Experience (MEX) archive: a signed, sealed .mex file with SBOM-linked provenance. Two properties matter here:

  • Reproducibility. Re-running the build from the same source produces a byte-identical archive. The contract is the source of truth, not the generated implementation.
  • Provenance. A cryptographic chain links the reviewed text to the deployed binary. There is no “what actually shipped?” gap.

The MEX archive is what the runtime loads. It’s the unit of deployment, the unit of audit, and the unit of distribution.

The enforcement loop

When a .mex runs on Samoza OS, the runtime validates each sub-problem’s outputs against the boundaries declared in the contract. A declarative boundary that said “produce a pathfinding algorithm with O(n log n)” is checked against actual runtime behaviour. An imperative boundary that said “use Dijkstra with a binary heap” is checked against the actual selection.

When something fails, the runtime emits an event — back into the enforcement loop, where it’s surfaced to the author or fed forward into a refinement step. This is the “enforcement loop” half of the two coupled loops the paper describes; the “refinement loop” half is the back-and-forth between you and the AI as you iterate the contract itself.

Where to go from here

You’ve now seen the whole shape:

  • Five meta-characters for structure: @ # $ % =.
  • Five space types for semantics: :UI :IO :DATA :FUNC :AGENTIC.
  • Vibe blocks that travel with the structure as one signed unit.
  • Composition via $use() or dotted names.
  • Compilation to AIR and MEX, with provenance to deploy.

That is Anglish. The rest is depth: each space type has its own conventions, each meta-character has full reference documentation, each authoring pattern (stub tasks, intent-only agents, mixed delegation) has best practices.

The reference is the next stop. The examples are the second one.

Read the reference →