Skip to content

Decision lifecycle

Each LLM / tool call boundary triggers an 8-stage decision transaction:

#StageWhereOutput
1snapshotsidecar (in-process)snapshot_hash
2evaluatesidecar Contract DSLmatched_rules_hash
3prepare_effectsidecar (pure)effect_hash
4reserveledger atomicreservation_id
5audit_decisionfolded into reserveaudit_outbox row
6publish_effectadapter (in-process)mutation applied
7commit_or_releaseledgercommit_estimated / release
8audit_outcomefolded into commit/releaseaudit_outbox row

The hard invariant: stages 1–5 happen atomically (single Postgres transaction); a sidecar crash mid-publish replays stage 6 via effect_hash idempotency.

See docs/contract-dsl-spec-v1alpha1.md §6 for the formal spec.