Package entry points
Simulator.define binds run and openLedger to one versioned definition
and its complete event catalog.
Make a TypeScript entrypoint
A normal module is an executable experiment:simulatorLayer once at the application boundary and provide
it around the complete run or suite. Runtime constructors remain values in
the roster; they own runtime-specific installation and readiness settings.
Express completion policy in the program
The customer Effect returns, fails, or is interrupted according to its own logic:Clock, Schedule, race, timeout, Deferred, Stream, and
Scope primitives for deadlines, quiescence, supervised work, or explicit
stop conditions.
A runtime exit after readiness is committed as typed ledger evidence. It does
not implicitly end the customer Effect. This lets one policy fail fast on an
agent exit while another continues to observe the remaining society.
Interpret both Effect layers
There are two distinct results:- The outer
Society.runEffect can fail while acquiring the router or roster, or while writing and completing the ledger. - A successful outer Effect returns
SimulatorRunResult, whoseexitis the customer program’sExit,ledgeris the completed ledger reference, andcompletioncarries the record count and artifact digests.
Build a narrow customer language when useful
Products can accept declarative input by placing that grammar next to the customer concepts it represents. For example, a customer might decode a schema with only a model id, topology preset, and prompt family, then compile each case into:- customer event classes and an
EventCatalog; - one versioned
Simulator.definevalue; - a keyed mixed-runtime roster;
- an Effect program using
roster.Agents,Network,Society.Events, andSociety.Ledger; - code graders composed over
Society.openLedger.
Sweeps are orchestration
Use Effect and the surrounding job system for matrices and concurrency:Inspect ledgers in code
Use the same definition and storage Layer that produced the run:readLedgerManifest supports indexing without reading event evidence.
Society.openLedger returns reusable exact-class streams after the definition,
catalog, artifact digests, identities, count, sequence, and event schemas
validate.