ContractRefine — Contract Taxonomy¶
This page catalogs the Phase 1 set of contracts the ContractRefine verifier evaluates at pre-execution time. The catalog is deliberately small and finite — see the parent Architecture for the design discipline (“Not a generic policy DSL”, “Not Isaac-aware”) this restraint serves.
Reason layer¶
Every contract failure emits a reason that conforms to the existing
<layer>: <subreason> regex enforced by
runtime/reasons_shape_test.go. ContractRefine introduces one new
canonical layer:
contract:
Subreasons follow the existing convention: lowercase, underscores allowed after the first character. See the catalog below for the full list.
The Phase 1 catalog¶
Contract kind |
Checks |
Failure subreason |
|---|---|---|
|
Each |
|
|
Every param marked |
|
|
The requested |
|
|
|
|
|
Every WAL attribute key the caller pledges via |
|
|
When attestation is enabled, the snapshot age is within a policy-defined ceiling. |
|
|
The runtime configuration at preflight time can produce a complete decision chain for the requested capability. The Phase 1 chain is hardcoded in |
|
What the catalog is NOT¶
No domain-specific contracts. No MAVLink-specific obligations, no Isaac mission-gate semantics, no ROSOrin restricted-zone primitives. Those land in consumer epics (#849 Isaac, #793 ROSOrin) on top of the neutral primitives here.
No EntitlementResolver / ApprovalResolver contracts. Deferred for interface-quality reasons — there is no substrate in
adkto anchor the resolver interface against. A follow-up epic will land them once ROSOrin’s/v1/intentsubstrate is in place.No per-capability custom chains. Phase 1 ships exactly one hardcoded decision chain. Per-capability chain customization via the policy bundle is a documented v2 feature; introspection failure on a custom chain returns the advisory
chain_unverifiable_offline, never a fail-closed deny.
Repair-hint shape¶
A repair_required outcome carries one or more RepairHint entries:
{
"field": "plan[1].params.altitude_m",
"suggestion": "altitude_m exceeds zone ceiling; reduce to 30 or below.",
"suggested_value": 30,
"bounded": true
}
field— JSON pointer-style path to the offending param.suggestion— human-readable repair text. Audit-only; never parsed by the runtime.suggested_value— present iff a deterministic, bounded correction can be named.bounded—true⇒ the suggestion is a deterministic, contract- derived value the caller may apply mechanically.false⇒ informational only; no machine-applicable correction.
Refinement is bounded by INV-CR-6:
at most one repair attempt per session by default, configurable up to a
small constant ≤ 3. Beyond that, the verifier returns deny.
Policy integration¶
Two surfaces let policy bundles interact with ContractRefine:
manifest.requires_preflight: true— when set,/v1/toolcalls for capabilities owned by this bundle MUST present a fresh, matchingX-Autonomy-Preflight-Id. Absent header ⇒ policy denies withcontract: preflight_required. Default isfalse(preflight remains optional). Behavior is gated globally byruntime.contract_refine.mode.input.preflightin Rego — when a preflight has run, thePreflightDecisionis exposed verbatim to policy asinput.preflight. Rules MAY read it (e.g., to deny apassverdict whoseexpected_evidencedid not include a required attr). Rules MUST NOT use it to flip a contractdenyinto a policyallow— that violates INV-CR-9.
Adding to the catalog (v2 path)¶
New contract kinds land via the following discipline:
One contract kind per PR. The kind, its checks, its failure subreasons, and its repair-hint semantics are reviewed together.
Reason subreasons go into
runtime/reasons_shape_test.goalong with the contract.An INV-CR-N entry on Invariants iff the kind asserts a new safety or security property that operators rely on.
A taxonomy table row on this page.
Catalog growth is bounded by deliberate review pressure — operators ask “what new invariant does this contract assert?” before “is the code clean?”. A new kind that does not assert a new invariant is an implementation detail of an existing kind, not a new entry.