CHEESE APISelections

Validation and estimation

Normalize intent, resolve releases, inspect execution fidelity, and choose sync or durable work.

Suggest an edit

Call POST /api/v2/selections:validate before expensive work. It returns the deterministic normalized document and hash, expanded presets, resolved aliases, contradictions, unsupported conditions, warnings, and per-constraint execution status.

Then call POST /api/v2/selections:estimate. It adds coverage, work/result budgets, viable execution information, and execution_tier.

validation = dmc.selections.validate(selection)
estimate = dmc.selections.estimate(validation.normalized_selection)
if estimate.execution_tier == "synchronous":
    result = dmc.selections.create(estimate.normalized_selection)
else:
    run = dmc.runs.create(
        Run.selection(estimate.normalized_selection),
        idempotency_key="campaign-selection-v1",
    )

execution_tier="durable" is a successful estimate and contains a directly reusable run/1 request. Sending that document to synchronous /selections returns 413 durable_required with the same normalized intent; it does not start a hidden run or silently relax a condition.