Home / Projects / Orchestrata Ultimate / Decisions / ADR index / ADR-0031

ADR-0031: Every gate decision carries its proof tree

field value
Status Accepted
Date 2026-07-24
Register factory (docs/adr, 4-digit ids)
Source docs/adr/0031-gate-decisions-carry-proof-trees.md — permalink at bdafa201a (unchanged on master since that commit)
Wiki register entry ADR-0031 (wiki status: Accepted)

← ADR-0030 · ADR-0032 →

The record

Context

Three requirements in this register independently ask for the same missing thing:

The codebase shows the cost concretely. AccessResult.reason is today the string "prolog_policy" or "prolog_denied" — near-zero information. plans/prolog-utilization-plan.md (item #3) records that the 2026-07-10 resource-access flake would have been self-diagnosing had the decision carried its derivation.

Prolog answers this natively and cheaply. A meta-interpreter — the classic vanilla-interpreter extension, ~40 lines — evaluates a goal while building the derivation as a term: which rule fired, which facts it consumed, in what order. The utilization plan already scopes it (prolog/explain.pl, janus marshals the nested-list tree to JSON, no change to the fast non-explaining path) and rates it high value / small-to-medium effort, sequenced in P1 precisely because every later item pays into it.

The "why not" direction matters as much as the "why": for a denial, enumerating the failing preconditions of each candidate rule tells the agent exactly which condition to satisfy — which is the actionable amendment direction ADR-0020 needs.

Decision

Every governance decision carries its proof tree, produced by a Prolog meta-interpreter, and the tree is a first-class artefact:

No gate may return a bare verdict where the decision blocks work, escalates a tier, or is offered to a human for adjudication.

Alternatives rejected

Consequences

Provenance

plans/prolog-utilization-plan.md item #3 (proof trees / explanations), reviewed 2026-07-24, which scoped the meta-interpreter and cited the 2026-07-10 resource-access flake as the motivating failure. Mapped onto SPEC-033 by the observation that ADR-0020, ADR-0024 and ADR-0030 each require it separately.

Rulings cited

None.

Specs cited