Why Moment

Domain-driven design maps the domain in two dimensions. Systems run in three.

Contexts, aggregates, and events give you a static map. But behavior happens over time — events cross boundaries, sagas orchestrate, contracts are honored or broken. That third dimension has never been specified, simulated, or tested before implementation. Moment is the layer that closes it.

Every other discipline

Validates the design before building it. Circuits get simulated. Structures get stress-modeled. Schemas get migrations tested in staging.

There is a rehearsal step between intent and implementation.

Domain-driven design

Goes straight from the whiteboard to the code. The event flows between bounded contexts — where incidents are actually born — are written directly into production.

There is no rehearsal. Moment adds it.

The missing dimension

Moment adds time to a two-dimensional domain design.

2D — the static map (DDD today)
Ordering Fulfillment Order LineItem Shipment

You can see the pieces and where they live. You cannot see what happens when, in what order, or what data moves between them.

+ time — the flow (Moment)
t PlaceOrder OrderPlaced crosses-to · contract InitiateFulfillment

Now the sequence is explicit: which event triggers which, where it crosses a boundary, and the exact contract the crossing must carry.

The unit of value

A moment is a behavioral assertion.

It states when, where, and how an event participates in a cross-context flow — including the schema contract the crossing carries. Every crossing must declare its contract explicitly.

An implicit crossing is not a shortcut. It is a specification error, and Moment reports it as one.

moment "Submission"
ordering: OrderPlaced
crosses-to fulfillment
via CustomerSupplier
contract { orderId, items }
✓ contract asserted at the boundary
Convergence, not correctness

Gaps between spec and code are diagnosed by severity — and driven to zero.

Moment never claims your system is “correct.” It measures the distance between the design you agreed to and the code you shipped, and gives you a gate to close it.

ERROR
Blocks convergence

A crossing with no contract, an event no flow consumes, a saga with no terminal state. The gate stays shut.

WARNING
Advisory

Implementation added a field the spec doesn’t know about. Reconcile in either direction when you’re ready.

INFO
Fitness signal

Coverage, naming drift, unused contracts. Tracked over time so the model stays healthy, not just legal.

No lock-in by construction

The full pipeline runs with zero Complai dependency.

No @mmmnt package may take a runtime or build-time dependency on any Complai service. The open-source community uses the entire toolchain without ever knowing Complai exists. Everything commercial plugs in around Moment — never inside it.

Read the DSL → Get started