Project the decision input contract for one stored policy version
The facts the exact stored rule set of this candidate consumes — canonical key, business definition where one is declared, usage per rule, and requiredness DERIVED from native rule semantics. This is policy-scoped: MeshQu has no object spanning the policies applying to one decision, so this never combines more than the one selected candidate’s rules, and the response is titled by policy and version rather than implying a broader scope.
Never “all consumed fields are mandatory”. requiredness.kind reflects exactly what the active rules imply for that key: required only when the owning rule applies, must be absent, conditional on a named gate, gate-only (the key decides only whether a rule applies, never itself required), or checked only when supplied (a forbidden-only list rule has nothing to test on an absent field).
Preflight, not runtime validation (contract §8). No new validator runs at POST /v1/decisions/record because of this route’s existence; this is a read-only projection over stored rule bytes and declared definitions, and changing what it shows changes no evaluation outcome, no hash, and no receipt.
Definition resolution is point-in-time (contract §3). Omit as_of and every key is resolved against the definition’s CURRENT revision. Supply as_of — an RFC 3339 date-time that MUST carry a zone designator (Z or ±hh:mm) — and every key is resolved as it stood at that instant instead, never a newer meaning shown as if it had applied then. A date alone, a year, a bare number or a zone-less date-time is refused 400 INVALID_AS_OF: it names no instant, or one that depends on the server’s timezone. So is a value whose calendar or clock components are out of range — 2026-02-30T00:00:00Z, 2026-01-01T24:00:00Z, a leap second, an offset beyond ±23:59 — which are never rolled forward into the following day or minute. A key whose tenant_fields row is DECLARED but had no revision yet at the requested instant reports definition: "not_defined_at_time", distinct from "unknown" (the catalogue has never seen the key at all) and from "observed_only" (the row exists but was never declared, so it has no meaning at any instant).
Refreshes on every draft edit. A draft’s draft_revision moves on every save; this route re-reads the stored rules on every call, so a client keying its cache on draft_revision (the examples panel’s binding rule) gets a projection that reflects the edit. A historical snapshot’s rules never change, so only its point-in-time definition lookup can move (a definition edited after the snapshot was taken).
Opaque dependencies are never silently omitted. A rule of type expression, or a when shape the read boundary refuses (CCR-504), contributes an entry to opaque[] naming the rule code, instead of disappearing from the projection.
Authorizations
MeshQu API key passed as a bearer token: Authorization: Bearer mqu_…. Mint one in the console (Settings → API keys).
Tenant UUID for multi-tenant isolation. Required on all authenticated routes — validated before authentication (middleware/tenant.ts), so a missing or non-UUID header returns 400 (MISSING_TENANT_ID / INVALID_TENANT_ID) before the API key is checked.
Path Parameters
Policy id.
Policy version number.
x >= 1Query Parameters
An RFC 3339 date-time that MUST carry a zone designator — Z or ±hh:mm — e.g. 2026-09-17T00:00:00Z or 2026-09-17T01:00:00+01:00. When supplied, every key's definition is resolved as it stood at that instant (contract §3: "the revision whose changed_at is the latest not after the snapshot's own timestamp"), never the current meaning. Omitted, the current revision is used — the "draft or current version" branch of §3. A date alone (2026-09-17), a year (2026), a bare number, a human date string or a date-time with no zone (2026-09-17T00:00:00) is refused 400 INVALID_AS_OF: it names no instant, or names one that depends on the server's timezone. So is a date-time whose components are out of range — 2026-02-30T00:00:00Z, 2026-01-01T24:00:00Z, a leap second, an offset beyond ±23:59 — which Date would otherwise roll silently into the next day or minute and answer for an instant nobody asked for (BC review round 2).
Response
Default Response
x >= 0draft - Option 1
- Option 2
One entry per canonical key the exact active rule set references, in the deterministic order projectDecisionInputs produces (required-first, then alphabetical). This projection is POLICY-SCOPED: MeshQu has no object spanning the policies applying to one decision, so this never combines more than the one selected candidate's rules.
A rule of type expression, or a When shape the walker refuses to read, contributes an entry here naming the rule code — never silently omitted (contract §6).