Skip to content

Executable Specs & Diffs

Tests hidden in distant folders drift from implementation. Mo co-locates executable contracts directly inside functions, actors, and services:

  • examples verify concrete input/output cases right next to the signature.
  • promise blocks state universal invariants (implies) over inputs and result (or before/after state and now on actors/services). mo test generates typed inputs, shrinks failing counterexamples, and rejects vacuous promises whose antecedent is never true.
  • test blocks run end-to-end workflows, HTTP routes (ApiTest.send), and capability fakes with zero sockets.
  • Automatic crash-recovery sequences run automatically on every actor and service, simulating crashes and restarts to verify persisted state recovers identically.

Audit test coverage thoroughness by mutating comparisons, booleans, arithmetic, and constants (E1439 reveals surviving branches).

Compare candidate code against Git HEAD (or an older revision) across four dimensions:

  1. Capability authority expansions or narrowings
  2. Exposed and wire API deltas
  3. Persistent saved-state schema changes
  4. Behavioral contract checks running the old program’s compiled promises and examples directly against the new implementation