Start with batch scoring for daily campaigns or retention queues. Use an API only when a decision needs current session or inventory context. Both paths need schema validation, authorisation, deterministic eligibility checks, freshness limits, deadlines and fallbacks.
The decision record should contain:
| Field group | Required contents |
|---|---|
| Identity | decision_id, pseudonymous entity key, as_of, experiment/assignment key |
| Inputs | Feature snapshot/query version, source freshness, relevant price/inventory/cost state |
| Candidates | Eligible action set, constraints and exclusion reasons |
| Decision | Selected action, default action, estimated value and uncertainty/support status |
| Versions | Model, calibration, policy and experiment configuration |
| Assignment | Assigned arm/action tuple, actual joint or stage-conditional propensities, coordinator version/history when relevant |
| Execution | Delivery status/time, idempotency key, override/fallback reason |
| Outcomes | Mature outcome reference, horizon, net cost/contribution and observation completeness |
Keep late outcomes in their own table, joined by stable keys. Store scores and reason codes needed for debugging, with restricted access and retention periods. Keep customer secrets out of general request logs. At execution, recheck inventory, contact fatigue and campaign and price validity. Reserve budget transactionally before delivery. Retries must never send duplicate incentives or apply a price change twice.
Release a reservation only after confirming the benefit was finally not delivered or issued. Reconcile uncertain timeouts so an issued benefit keeps its reservation. Log assignment, proposed action, executed action and override mechanism separately, marking unknown execution propensities.
When evidence is missing, return the currently allowed baseline with a reason. If even that baseline
is invalid, return review_required and execute nothing. A new action chosen by
extrapolation makes an unreliable fallback. Rehearse stale features, empty candidates, exhausted
budget, missing inventory, invalid input, timeout and duplicated delivery.