behavior selects the public result;
effect attaches the state changes and follow-up work that become true when that result commits.
This separation keeps a provider definition reviewable and prevents background mechanics from
changing response selection by accident.
Declare backends
Backends describe the supporting systems the emulator provides:cache, db, event_bus, http, mail, object_store, queue, and scheduler.
Define reusable background work
Anasync block is a named unit whose actions must not contribute to immediate response latency:
Attach consequences to operations
- validates the request and commits one public outcome;
- renders synchronous action arguments from that committed request and response;
- applies the synchronous unit transactionally and checkpoints durable Stack state;
- publishes schema-checked webhook occurrences and named asynchronous units to the durable outbox; and
- allows HTTP response delivery to proceed while workers lease, retry, and acknowledge that work.
response.order.id is rendered only for outcomes that contain that value; a provider error or an
accepted-without-entity outcome therefore does not accidentally run the write or turn the public
outcome into an execution failure.
Use db.put when the projected value is the complete public document. Use db.merge when the
operation deliberately exposes a partial public snapshot and omitted fields must survive. Merge is
recursive for objects and replaces supplied arrays and scalars, so the behavior remains explicit
and portable rather than depending on a provider’s private patch implementation.
Convention inference
When a service declares exactly one database, aPOST, PUT, or PATCH operation has a stable
operationId, and one successful response contains exactly one identifiable entity, Simile can
infer the ordinary db.put action. The collection name comes from the semantic route segment and
the key comes from the response entity’s id.
Inference stops at ambiguity. Multiple databases, multiple candidate entities, missing IDs, or an
authored effect require the provider to say what happens. Run simile audit to
see which actions were authored, inferred, or missing.
Causality and inspection
Every Stack command records a payload-free journal entry with its operation, causal parent, correlation identifier, resource, action, time, and outcome. Stored values are never included in the default journal view. Operators must explicitly opt in withsimile state SERVICE --values.
See State inspection, Simile Stack, and the
HCL language specification for the complete forms. Read
Durable work for checkpoint, lease, retry, and restart semantics.