Purpose of this page: describe the pure core — the state machines and ordering rules — and the guarantees the rest of the system leans on.
Layer 6

domain/ (pure)

Entities, state machines, and zod schemas. No file system, no network, no clock, no randomness. The only runtime dependency is zod.

Components

Entities · state machines · transitions

The legal moves of every resource. A lease hierarchy with attempt accounting.

Plan format + canonical serialization

A plan document round-trips byte-identically. Serialization is canonical per the plan-format proposal.

Bytewise ordering

Document sets sort by canonical path, compared bytewise through Buffer.compare.

ULID tie-break

A topological walk breaks a tie by ULID, so task order is reproducible.

Inbound edges

FromMeaning
commands/validate input and state transitions against the domain
queries/shape reads with domain schemas

Rules

  1. Purity is enforced: no file system, no network, no clock, no randomness.
  2. A ULID is minted by a service and passed in. The domain never generates one.
  3. Determinism is a product guarantee: same input, same output, same order, same bytes.
  4. This layer imports only itself. Its only permitted runtime dependency is zod.