{
 "$defs": {
  "ApplicabilityStatus": {
   "enum": [
    "APPLICABLE",
    "NOT_APPLICABLE",
    "UNDETERMINED",
    "CONFLICTED"
   ]
  },
  "ConflictReport": {
   "additionalProperties": false,
   "properties": {
    "defeatedCandidates": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array"
    },
    "id": {
     "$ref": "#/$defs/StableId"
    },
    "interpretations": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array"
    },
    "negative": {
     "$ref": "#/$defs/JsonValue"
    },
    "negativeCandidates": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array"
    },
    "positive": {
     "$ref": "#/$defs/JsonValue"
    },
    "positiveCandidates": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array"
    },
    "priorityEdges": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array"
    },
    "sourceAnchors": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array"
    },
    "unresolvedReason": {
     "enum": [
      "INCOMPARABLE",
      "EQUAL_PRIORITY",
      "STRICT_CONFLICT",
      "PRIORITY_CYCLE",
      "MISSING_PRIORITY_FACT",
      "INTERPRETATION_DIVERGENCE"
     ]
    }
   },
   "required": [
    "id",
    "positive",
    "negative",
    "positiveCandidates",
    "negativeCandidates",
    "unresolvedReason"
   ],
   "type": "object"
  },
  "Date": {
   "format": "date",
   "type": "string",
   "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
  },
  "Digest": {
   "pattern": "^[A-Za-z0-9_-]+:[A-Fa-f0-9]+$",
   "type": "string"
  },
  "EvaluationManifest": {
   "additionalProperties": false,
   "properties": {
    "calendarSnapshot": {
     "type": "string"
    },
    "caseHash": {
     "$ref": "#/$defs/Digest"
    },
    "decisionTime": {
     "anyOf": [{"$ref": "#/$defs/Instant"}, {"type": "null"}]
    },
    "evidenceSnapshotHash": {
     "$ref": "#/$defs/Digest"
    },
    "externalSnapshots": {
     "additionalProperties": {
      "type": "string"
     },
     "type": "object"
    },
    "id": {
     "$ref": "#/$defs/StableId"
    },
    "interpretations": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array"
    },
    "jurisdictionProfile": {
     "type": "string",
     "description": "Canon profile in the unified grammar `<id>/<version>#sha256:<64 hex>`. Present only for a computation over a package with a named profile. For documents of the 0.1 line (`semantics` = `law.core/0.1.0`, the vendored release), the field keeps its former free-form string.",
     "$comment": "SPEC §170.1; errata E-0161; DECISION-0170"
    },
    "knowledgeTime": {
     "anyOf": [{"$ref": "#/$defs/Instant"}, {"type": "null"}]
    },
    "editionsAsPresented": {
     "$ref": "#/$defs/LegalTime",
     "description": "The date as of which the set of editions was presented by the caller. Present only for a computation with this transport field in the request; without it the field is absent and the document is byte-identical to before.",
     "$comment": "SPEC §92, §168.3; errata E-0167"
    },
    "legalTime": {
     "description": "In 0.2 and later, null means a computation without a temporal slice; a consumer of the date requires an explicit legal time.",
     "$comment": "SPEC §89.3",
     "anyOf": [{"$ref": "#/$defs/LegalTime"}, {"type": "null"}]
    },
    "lockfileHash": {
     "$ref": "#/$defs/Digest"
    },
    "mode": {
     "enum": [
      "advisory",
      "compliance",
      "regulatory",
      "simulation",
      "audit"
     ]
    },
    "policies": {
     "additionalProperties": {
      "$ref": "#/$defs/StableId"
     },
     "type": "object"
    },
    "programHash": {
     "$ref": "#/$defs/Digest"
    },
    "theoryHash": {
     "$ref": "#/$defs/Digest"
    },
    "artifactHash": {
     "$ref": "#/$defs/Digest"
    },
    "resolvedEditions": {
     "additionalProperties": {
      "$ref": "#/$defs/StableId"
     },
     "type": "object"
    },
    "semantics": {
     "type": "string"
    },
    "timezone": {
     "type": ["string", "null"]
    },
    "timezoneDbSnapshot": {
     "type": "string"
    },
    "temporalResolutionPolicy": {
     "$ref": "#/$defs/StableId"
    },
    "solverProfile": {
     "type": "string"
    },
    "evidencePolicy": {
     "$ref": "#/$defs/StableId"
    },
    "evidencePolicyProfile": {
     "type": "string"
    },
    "evidencePolicyHash": {
     "$ref": "#/$defs/Digest"
    },
    "semanticHash": {
     "$ref": "#/$defs/Digest"
    }
   },
   "required": [
    "id",
    "semantics",
    "programHash",
    "lockfileHash",
    "caseHash",
    "legalTime",
    "decisionTime",
    "knowledgeTime",
    "resolvedEditions",
    "externalSnapshots",
    "semanticHash"
   ],
   "type": "object",
   "allOf": [
    {
     "if": {
      "properties": {
       "semantics": {
        "const": "law.core/0.1.0"
       }
      },
      "required": [
       "semantics"
      ]
     },
     "then": {
      "properties": {
       "legalTime": {"$ref": "#/$defs/LegalTime"},
       "decisionTime": {"$ref": "#/$defs/Instant"},
       "knowledgeTime": {"$ref": "#/$defs/Instant"},
       "timezone": {"type": "string"}
      }
     },
     "else": {
      "properties": {
       "jurisdictionProfile": {
        "pattern": "^[a-z][a-z0-9_]*(?:\\.[a-z][a-z0-9_]*)*/[0-9]+\\.[0-9]+\\.[0-9]+(?:-[0-9A-Za-z.-]+)?#sha256:[0-9a-f]{64}$"
       }
      }
     }
    }
   ]
  },
  "EvaluationResult": {
   "additionalProperties": false,
   "properties": {
    "applicabilityStatus": {
     "$ref": "#/$defs/ApplicabilityStatus"
    },
    "conflicts": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array"
    },
    "evaluationStatus": {
     "$ref": "#/$defs/EvaluationStatus"
    },
    "evidence": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array"
    },
    "id": {
     "$ref": "#/$defs/StableId"
    },
    "judgmentRequests": {
     "items": {
      "$ref": "#/$defs/JudgmentRequest"
     },
     "type": "array"
    },
    "manifest": {
     "$ref": "#/$defs/StableId"
    },
    "missingInputs": {
     "items": {
      "$ref": "#/$defs/InputRequirement"
     },
     "type": "array"
    },
    "normativeStatus": {
     "$ref": "#/$defs/NormativeStatus"
    },
    "proof": {
     "$ref": "#/$defs/StableId"
    },
    "query": {
     "$ref": "#/$defs/StableId"
    },
    "sourceAnchors": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array"
    },
    "target": {
     "$ref": "#/$defs/StableId"
    },
    "triggerStatus": {
     "$ref": "#/$defs/TriggerStatus"
    },
    "truthStatus": {
     "$ref": "#/$defs/TruthStatus"
    },
    "value": {
     "$ref": "#/$defs/JsonValue"
    },
    "normativeStatusSupports": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/NormativeStatusSupport"
     }
    },
    "resultKind": {
     "$ref": "#/$defs/ResultKind"
    }
   },
   "required": [
    "id",
    "query",
    "resultKind",
    "evaluationStatus",
    "proof",
    "normativeStatusSupports"
   ],
   "type": "object",
   "allOf": [
    {
     "if": {
      "properties": {
       "resultKind": {
        "const": "PROPOSITION"
       }
      }
     },
     "then": {
      "required": [
       "truthStatus"
      ]
     }
    },
    {
     "if": {
      "properties": {
       "resultKind": {
        "const": "RULE_APPLICATION"
       }
      }
     },
     "then": {
      "required": [
       "applicabilityStatus",
       "triggerStatus"
      ]
     }
    },
    {
     "if": {
      "properties": {
       "resultKind": {
        "const": "NORM_POSITION"
       }
      }
     },
     "then": {
      "required": [
       "applicabilityStatus",
       "normativeStatus",
       "normativeStatusSupports"
      ]
     }
    },
    {
     "if": {
      "properties": {
       "resultKind": {
        "const": "COMPLIANCE"
       }
      }
     },
     "then": {
      "required": [
       "applicabilityStatus"
      ]
     }
    },
    {
     "if": {
      "properties": {
       "resultKind": {
        "const": "CONSTRAINT"
       }
      }
     },
     "then": {
      "required": [
       "applicabilityStatus",
       "triggerStatus",
       "truthStatus",
       "normativeStatus",
       "target"
      ]
     }
    }
   ]
  },
  "EvaluationStatus": {
   "enum": [
    "COMPUTED",
    "MISSING_INPUT",
    "MISSING_POLICY",
    "REQUIRES_JUDGMENT",
    "NON_EXECUTABLE",
    "EXTERNAL_UNAVAILABLE",
    "INTERPRETATION_REQUIRED",
    "SOURCE_RESOLUTION_FAILED",
    "PRIORITY_CONFLICT",
    "UNRESOLVED_NORMATIVE_CONFLICT",
    "CONFLICTED_INPUTS",
    "TYPE_ERROR",
    "RUNTIME_ERROR",
    "RESOURCE_LIMIT"
   ]
  },
  "InputRequirement": {
   "additionalProperties": false,
   "properties": {
    "description": {
     "type": "string"
    },
    "expectedType": {
     "type": "string"
    },
    "id": {
     "$ref": "#/$defs/StableId"
    },
    "kind": {
     "type": "string"
    },
    "relatedNode": {
     "$ref": "#/$defs/StableId"
    }
   },
   "required": [
    "id",
    "kind",
    "description"
   ],
   "type": "object"
  },
  "Instant": {
   "format": "date-time",
   "type": "string",
   "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$"
  },
  "Issue": {
   "additionalProperties": false,
   "properties": {
    "code": {
     "type": "string"
    },
    "details": {
     "$ref": "#/$defs/JsonValue"
    },
    "message": {
     "type": "string"
    },
    "relatedNodes": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array"
    },
    "severity": {
     "enum": [
      "info",
      "warning",
      "error",
      "fatal"
     ]
    }
   },
   "required": [
    "code",
    "severity",
    "message"
   ],
   "type": "object"
  },
  "JsonObject": {
   "additionalProperties": {
    "$ref": "#/$defs/JsonValue"
   },
   "type": "object"
  },
  "JsonValue": {
   "oneOf": [
    {
     "type": [
      "string",
      "number",
      "integer",
      "boolean",
      "null"
     ]
    },
    {
     "items": {
      "$ref": "#/$defs/JsonValue"
     },
     "type": "array"
    },
    {
     "additionalProperties": {
      "$ref": "#/$defs/JsonValue"
     },
     "type": "object"
    }
   ]
  },
  "JudgmentRequest": {
   "additionalProperties": false,
   "properties": {
    "authority": {
     "$ref": "#/$defs/StableId"
    },
    "evidence": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array"
    },
    "id": {
     "$ref": "#/$defs/StableId"
    },
    "predicate": {
     "$ref": "#/$defs/StableId"
    },
    "proof": {
     "$ref": "#/$defs/StableId"
    },
    "request": {
     "$ref": "#/$defs/JsonValue"
    },
    "requestSchema": {
     "$ref": "#/$defs/JsonValue"
    }
   },
   "required": [
    "id",
    "predicate",
    "authority",
    "request"
   ],
   "type": "object"
  },
  "NormativeStatus": {
   "description": "Lifecycle states of a legal position. `AVAILABLE`, `EXERCISED`, `VALIDLY_EXERCISED` and `INVALIDLY_EXERCISED` are reserved and not produced in 0.2: the power, liberty and immunity lifecycle is created, active, suspended, terminated or expired only. Exercise validity is an event property, read via the POWER_INVALID_EXERCISE issue and the std literal invalidly_exercised(position), not via this enum.",
   "$comment": "SPEC §134, §127; errata E-0239",
   "enum": [
    "CREATED",
    "PENDING",
    "ACTIVE",
    "SATISFIED",
    "VIOLATED",
    "WAIVED",
    "SUSPENDED",
    "TERMINATED",
    "EXPIRED",
    "UNDETERMINED",
    "AVAILABLE",
    "EXERCISED",
    "VALIDLY_EXERCISED",
    "INVALIDLY_EXERCISED",
    "CONFLICTED",
    "DEFEATED"
   ]
  },
  "PositionInstance": {
   "additionalProperties": false,
   "properties": {
    "activationEvent": {
     "$ref": "#/$defs/StableId"
    },
    "beneficiary": {
     "$ref": "#/$defs/StableId"
    },
    "counterparty": {
     "$ref": "#/$defs/StableId"
    },
    "createdBy": {
     "$ref": "#/$defs/StableId"
    },
    "holder": {
     "$ref": "#/$defs/StableId"
    },
    "id": {
     "$ref": "#/$defs/StableId"
    },
    "manifest": {
     "$ref": "#/$defs/StableId"
    },
    "modality": {
     "enum": [
      "duty",
      "liberty",
      "power",
      "immunity"
     ]
    },
    "payload": {
     "$ref": "#/$defs/JsonValue"
    },
    "proof": {
     "$ref": "#/$defs/StableId"
    },
    "status": {
     "$ref": "#/$defs/NormativeStatus"
    },
    "statusHistory": {
     "items": {
      "$ref": "#/$defs/StatusTransition"
     },
     "type": "array"
    },
    "template": {
     "$ref": "#/$defs/StableId"
    }
   },
   "required": [
    "id",
    "template",
    "modality",
    "holder",
    "status",
    "createdBy",
    "manifest"
   ],
   "type": "object"
  },
  "ProofGraph": {
   "additionalProperties": false,
   "properties": {
    "nodes": {
     "items": {
      "$ref": "#/$defs/ProofNode"
     },
     "type": "array"
    },
    "proofHash": {
     "$ref": "#/$defs/Digest"
    },
    "roots": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array",
     "uniqueItems": true
    }
   },
   "required": [
    "nodes",
    "roots",
    "proofHash"
   ],
   "type": "object"
  },
  "PriorityPathStep": {
   "additionalProperties": false,
   "properties": {
    "priorityRule": {
     "$ref": "#/$defs/StableId"
    },
    "higher": {
     "$ref": "#/$defs/StableId"
    },
    "lower": {
     "$ref": "#/$defs/StableId"
    },
    "conditionWitnesses": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array",
     "uniqueItems": true
    }
   },
   "required": [
    "priorityRule",
    "higher",
    "lower",
    "conditionWitnesses"
   ],
   "type": "object"
  },
  "ProofNode": {
   "additionalProperties": false,
   "allOf": [
    {
     "if": {
      "properties": {
       "kind": {
        "const": "rule_application"
       }
      },
      "required": [
       "kind"
      ]
     },
     "then": {
      "required": [
       "rule",
       "substitution"
      ],
      "properties": {
       "id": {
        "pattern": "^urn:proof:apply:[^:]+:[0-9a-f]{64}$"
       }
      }
     }
    },
    {
     "if": {
      "properties": {
       "kind": {
        "enum": [
         "norm_creation",
         "norm_status_transition",
         "defeat",
         "source_resolution",
         "candidate_closure",
         "constraint_check",
         "judgment",
         "external_snapshot_read",
         "evidence_projection",
         "support_admission",
         "procedure_step",
         "procedure_history"
        ]
       }
      },
      "required": [
       "kind"
      ]
     },
     "then": {
      "properties": {
       "id": {
        "pattern": "^urn:proof:[a-z][a-z0-9-]*(?::[^:]+)*:[0-9a-f]{64}$"
       }
      }
     }
    }
   ],
   "properties": {
    "applicabilityStatus": {
     "$ref": "#/$defs/ApplicabilityStatus"
    },
    "attributes": {
     "additionalProperties": {
      "$ref": "#/$defs/JsonValue"
     },
     "type": "object"
    },
    "conclusion": {
     "$ref": "#/$defs/JsonValue"
    },
    "evidence": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array",
     "uniqueItems": true
    },
    "id": {
     "$ref": "#/$defs/StableId"
    },
    "interpretation": {
     "$ref": "#/$defs/StableId"
    },
    "kind": {
     "enum": [
      "assertion",
      "rule_application",
      "function_evaluation",
      "priority_decision",
      "defeat",
      "source_resolution",
      "interpretation_selection",
      "norm_creation",
      "norm_status_transition",
      "query_evaluation",
      "external_snapshot_read",
      "judgment",
      "candidate_closure",
      "constraint_check",
      "evidence_projection",
      "support_admission",
      "procedure_step",
      "procedure_history",
      "cone_completion"
     ]
    },
    "outcome": {
     "const": "DEFEATED"
    },
    "premises": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array",
     "uniqueItems": true
    },
    "priorityPath": {
     "items": {
      "$ref": "#/$defs/PriorityPathStep"
     },
     "type": "array"
    },
    "rule": {
     "$ref": "#/$defs/StableId"
    },
    "sourceAnchors": {
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "type": "array",
     "uniqueItems": true
    },
    "substitution": {
     "additionalProperties": {
      "$ref": "#/$defs/JsonValue"
     },
     "type": "object"
    },
    "triggerStatus": {
     "$ref": "#/$defs/TriggerStatus"
    }
   },
   "required": [
    "id",
    "kind",
    "conclusion",
    "premises"
   ],
   "type": "object"
  },
  "StableId": {
   "minLength": 1,
   "type": "string"
  },
  "StatusTransition": {
   "additionalProperties": false,
   "properties": {
    "at": {
     "$ref": "#/$defs/Instant"
    },
    "proof": {
     "$ref": "#/$defs/StableId"
    },
    "reason": {
     "type": "string"
    },
    "status": {
     "$ref": "#/$defs/NormativeStatus"
    }
   },
   "required": [
    "status",
    "at",
    "proof"
   ],
   "type": "object"
  },
  "TemporalInterval": {
   "additionalProperties": false,
   "properties": {
    "axis": {
     "type": "string"
    },
    "end": {
     "oneOf": [
      {
       "$ref": "#/$defs/Date"
      },
      {
       "$ref": "#/$defs/Instant"
      },
      {
       "const": "infinity"
      }
     ]
    },
    "endInclusive": {
     "type": "boolean"
    },
    "start": {
     "oneOf": [
      {
       "$ref": "#/$defs/Date"
      },
      {
       "$ref": "#/$defs/Instant"
      },
      {
       "const": "-infinity"
      }
     ]
    },
    "startInclusive": {
     "type": "boolean"
    }
   },
   "required": [
    "startInclusive",
    "endInclusive"
   ],
   "type": "object"
  },
  "TriggerStatus": {
   "enum": [
    "SATISFIED",
    "NOT_SATISFIED",
    "UNDETERMINED",
    "CONFLICTED"
   ]
  },
  "TruthStatus": {
   "enum": [
    "TRUE_ONLY",
    "FALSE_ONLY",
    "BOTH",
    "NEITHER"
   ]
  },
  "NormativeStatusSupport": {
   "type": "object",
   "additionalProperties": false,
   "required": [
    "status",
    "truthStatus",
    "proof"
   ],
   "properties": {
    "status": {
     "$ref": "#/$defs/NormativeStatus"
    },
    "truthStatus": {
     "$ref": "#/$defs/TruthStatus"
    },
    "valid": {
     "$ref": "#/$defs/TemporalInterval"
    },
    "proof": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/StableId"
     },
     "uniqueItems": true
    }
   }
  },
  "LegalTime": {
   "oneOf": [
    {
     "$ref": "#/$defs/Date"
    },
    {
     "$ref": "#/$defs/Instant"
    }
   ]
  },
  "ResultKind": {
   "enum": [
    "DATA",
    "COLLECTION",
    "PROPOSITION",
    "RULE_APPLICATION",
    "NORM_POSITION",
    "COMPLIANCE",
    "CONSTRAINT",
    "GRAPH"
   ]
  },
  "EvidenceAcceptanceReport": {
   "description": "Report of the acceptance phase. Present only when an evidence policy is selected; without a policy the document is byte-identical to before.",
   "$comment": "SPEC §78.2.7; DECISION-0126",
   "type": "object",
   "additionalProperties": false,
   "required": [
    "policy",
    "profile",
    "closureHash",
    "decisions",
    "documents",
    "blocked"
   ],
   "properties": {
    "policy": {
     "$ref": "#/$defs/StableId"
    },
    "profile": {
     "type": "string"
    },
    "closureHash": {
     "$ref": "#/$defs/Digest"
    },
    "decisions": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/EvidenceDecision"
     }
    },
    "documents": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/EvidenceDocumentReport"
     }
    },
    "blocked": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/EvidenceBlockedAssertion"
     }
    }
   }
  },
  "EvidenceDecisionReason": {
   "description": "Closed dictionary of acceptance reasons.",
   "$comment": "SPEC §78.2.2, §78.2.3",
   "enum": [
    "AUTHENTICATION_HASH_MISMATCH",
    "AUTHENTICATION_MISSING",
    "AUTHENTICATION_NOT_AVAILABLE",
    "AUTHENTICATION_UNBOUND",
    "EDGE_NOT_CURRENT",
    "EDGE_POLICY_MISMATCH",
    "EVIDENCE_NOT_AVAILABLE",
    "EVIDENCE_NOT_CURRENT",
    "EVIDENCE_NOT_DECLARED",
    "FIELD_NOT_BOUND",
    "FIELD_TYPE_MISMATCH",
    "NEGATED_PROPOSITION",
    "NO_ACCEPTANCE_RULE_APPLIED",
    "RELATION_NOT_EXECUTABLE"
   ]
  },
  "EvidenceDecision": {
   "type": "object",
   "additionalProperties": false,
   "required": [
    "edge",
    "evidence",
    "relation",
    "literal",
    "decision",
    "reasons"
   ],
   "properties": {
    "edge": {
     "$ref": "#/$defs/StableId"
    },
    "evidence": {
     "$ref": "#/$defs/StableId"
    },
    "relation": {
     "type": "string"
    },
    "literal": {
     "$ref": "#/$defs/JsonValue"
    },
    "polarity": {
     "enum": [
      "positive",
      "negative"
     ]
    },
    "decision": {
     "enum": [
      "accepted",
      "rejected"
     ]
    },
    "reasons": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/EvidenceDecisionReason"
     }
    },
    "proof": {
     "$ref": "#/$defs/StableId"
    },
    "blockers": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/EvidenceBlocker"
     },
     "description": "Present for support that reached the rules and was not accepted.",
     "$comment": "SPEC §78.2.7"
    },
    "provenance": {
     "$ref": "#/$defs/EvidenceFactProvenance"
    }
   }
  },
  "EvidenceFactProvenance": {
   "type": "object",
   "additionalProperties": false,
   "description": "Provenance of the case assertion whose literal equals the literal of the support (the smallest assertion id wins). Present only when that assertion was produced by an extractor (a was_generated_by provenance edge carrying an `extractor`) or carries a quote; earlier reports do not get the field.",
   "$comment": "DECISION-0360",
   "required": [
    "origin"
   ],
   "properties": {
    "origin": {
     "enum": [
      "case_input",
      "source_asserted",
      "external_snapshot",
      "derived",
      "adjudicated",
      "assumed_for_simulation"
     ],
     "description": "Origin of the assertion; extraction is not a new origin.",
     "$comment": "SPEC §73"
    },
    "evidence": {
     "$ref": "#/$defs/StableId",
     "description": "First id of the assertion's evidence[], otherwise the target of its was_derived_from edge."
    },
    "quote": {
     "$ref": "#/$defs/JsonValue",
     "description": "attributes.quote of the provenance edge, carried verbatim."
    },
    "confidence": {
     "$ref": "#/$defs/JsonValue",
     "description": "Confidence of the extractor edge, carried verbatim; the core does not read it (the package evidence policy does, via its confidence field).",
     "$comment": "SPEC §78.2.1"
    }
   }
  },
  "EvidenceDocumentReport": {
   "type": "object",
   "additionalProperties": false,
   "required": [
    "evidence",
    "available",
    "current",
    "notes"
   ],
   "properties": {
    "evidence": {
     "$ref": "#/$defs/StableId"
    },
    "available": {
     "type": "boolean"
    },
    "current": {
     "type": "boolean"
    },
    "notes": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/EvidenceDecisionReason"
     }
    },
    "authentications": {
     "type": "array",
     "items": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "id",
       "verifier",
       "outcome",
       "bound",
       "available"
      ],
      "properties": {
       "id": {
        "type": "string"
       },
       "verifier": {
        "type": "string"
       },
       "outcome": {
        "type": "string"
       },
       "bound": {
        "type": "boolean"
       },
       "available": {
        "type": "boolean",
        "description": "The record's recordedAt is at or before knowledgeTime.",
        "$comment": "SPEC §78.2.3"
       }
      }
     }
    }
   }
  },
  "EvidenceBlockedAssertion": {
   "description": "Assertion of a protected predicate that did not enter the support: the policy cannot be bypassed.",
   "$comment": "SPEC §78.2.4",
   "type": "object",
   "additionalProperties": false,
   "required": [
    "assertion",
    "predicate",
    "origin",
    "reason"
   ],
   "properties": {
    "assertion": {
     "$ref": "#/$defs/StableId"
    },
    "predicate": {
     "$ref": "#/$defs/StableId"
    },
    "origin": {
     "type": "string"
    },
    "reason": {
     "const": "PROTECTED_PREDICATE_REQUIRES_EVIDENCE"
    }
   }
  },
  "ExecutionReceipt": {
   "type": "object",
   "additionalProperties": false,
   "required": [
    "implementation",
    "implementationConformance",
    "receiptHash"
   ],
   "properties": {
    "implementation": {
     "type": "string"
    },
    "implementationConformance": {
     "type": "string"
    },
    "startedAt": {
     "$ref": "#/$defs/Instant"
    },
    "finishedAt": {
     "$ref": "#/$defs/Instant"
    },
    "resourceUsage": {
     "$ref": "#/$defs/JsonObject"
    },
    "signature": {
     "$ref": "#/$defs/JsonObject"
    },
    "receiptHash": {
     "$ref": "#/$defs/Digest"
    }
   }
  },
  "EvidenceBlockerConjunct": {
   "description": "One conjunct of a policy rule's body and its state: an evaluation over the phase store.",
   "$comment": "SPEC §185, §78.2.7",
   "type": "object",
   "additionalProperties": false,
   "required": [
    "kind",
    "literal",
    "trigger"
   ],
   "properties": {
    "literal": {
     "$ref": "#/$defs/JsonValue"
    },
    "trigger": {
     "enum": [
      "SATISFIED",
      "NOT_SATISFIED",
      "UNDETERMINED",
      "CONFLICTED"
     ]
    },
    "detail": {
     "type": "string"
    },
    "kind": {
     "type": "string",
     "description": "Kind of conjunct: established | not_known | supported | monotone | refuted | unknown | guard.",
     "$comment": "SPEC §66, §113, §65"
    },
    "stage": {
     "$ref": "#/$defs/WhyNotStage"
    }
   }
  },
  "BlockerHeadArgument": {
   "description": "Computed argument of a candidate rule's head (`call`, arithmetic, `let`). Equality with the goal argument is not checked: the value must not be treated as established in the explanation; `term` is the head term itself as in the CLIR.",
   "$comment": "SPEC §185, §86, §58; errata E-0164",
   "type": "object",
   "additionalProperties": false,
   "required": [
    "position",
    "term",
    "status"
   ],
   "properties": {
    "position": {
     "type": "integer",
     "minimum": 0
    },
    "term": {
     "$ref": "#/$defs/JsonValue"
    },
    "status": {
     "enum": [
      "UNEVALUATED"
     ]
    },
    "detail": {
     "type": "string"
    }
   }
  },
  "BlockerContinuation": {
   "description": "Continuation of the goal substitution by store witnesses in a `why_not` rule blocker: `bindings` are the variables bound by witnesses (not by the goal) with their values; `conjuncts` mark every body conjunct under the continuation; `trigger` and `detail` summarise this continuation only — there is no verdict over continuations.",
   "$comment": "SPEC §185; errata E-0254",
   "type": "object",
   "additionalProperties": false,
   "required": [
    "bindings",
    "trigger",
    "detail",
    "conjuncts"
   ],
   "properties": {
    "bindings": {
     "type": "object",
     "additionalProperties": {
      "$ref": "#/$defs/JsonValue"
     }
    },
    "trigger": {
     "enum": [
      "SATISFIED",
      "NOT_SATISFIED",
      "UNDETERMINED",
      "CONFLICTED"
     ]
    },
    "detail": {
     "type": "string"
    },
    "conjuncts": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/EvidenceBlockerConjunct"
     }
    }
   }
  },
  "BlockerDefeat": {
   "description": "Defeat of the blocker rule's application concluding the goal, read from the proof graph of the same document: `application` and `defeat` are proof node ids; `reason` is the defeat node's `attributes.reason`; `opponentRules` are the rules of opponent applications among the defeat node's premises (sorted, unique); `priorityRules` are the `priorityRule` of the defeat node's `priorityPath` steps in written order.",
   "$comment": "SPEC §185; errata E-0255",
   "type": "object",
   "additionalProperties": false,
   "required": [
    "application",
    "defeat",
    "reason",
    "opponentRules",
    "priorityRules"
   ],
   "properties": {
    "application": {
     "$ref": "#/$defs/StableId"
    },
    "defeat": {
     "$ref": "#/$defs/StableId"
    },
    "reason": {
     "enum": [
      "strict-opposition",
      "priority",
      "defeater"
     ]
    },
    "opponentRules": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/StableId"
     }
    },
    "priorityRules": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/StableId"
     }
    }
   }
  },
  "WhyNotStage": {
   "description": "Round of an executable `stage` named by a `why_not` report: same shape as `attributes.stage` of a `rule_application` node (the `index` is the index value — integer or ISO date — not a term) when the index lies in the domain, and `{name, index, outsideDomain: true}` outside it. On a rule blocker it names the round of the goal; on a conjunct, the round of the conjunct literal after substitution. Written by `why_not` only, and only in programs with an executable `stage`.",
   "$comment": "SPEC §185, §111.2; errata E-0271",
   "type": "object",
   "additionalProperties": false,
   "required": [
    "name",
    "index"
   ],
   "properties": {
    "name": {
     "type": "string"
    },
    "index": {
     "type": [
      "integer",
      "string"
     ]
    },
    "rank": {
     "type": "integer",
     "minimum": 0
    },
    "outsideDomain": {
     "const": true
    }
   },
   "oneOf": [
    {
     "required": [
      "rank"
     ]
    },
    {
     "required": [
      "outsideDomain"
     ]
    }
   ]
  },
  "EvidenceBlocker": {
   "description": "Breakdown of the NO_ACCEPTANCE_RULE_APPLIED reason for one policy rule. Same shape as `why_not` blockers; `headArguments` appears only for a rule with a computed head argument, and is written non-empty. `strength`, `continuations`, `truncated` and `defeats` belong to `why_not` rule blockers only: policy blockers and transition blockers never carry them; `continuations` and `defeats` are written non-empty, `truncated` only as `true`. `stage` is likewise `why_not`-only and appears only in programs with an executable `stage`.",
   "$comment": "SPEC §78.2.7, §185, §185.1; E-0164; errata E-0254, E-0255, E-0271",
   "type": "object",
   "additionalProperties": false,
   "required": [
    "rule",
    "applicability",
    "trigger",
    "conjuncts"
   ],
   "properties": {
    "rule": {
     "$ref": "#/$defs/StableId"
    },
    "headArguments": {
     "type": "array",
     "minItems": 1,
     "items": {
      "$ref": "#/$defs/BlockerHeadArgument"
     }
    },
    "stage": {
     "$ref": "#/$defs/WhyNotStage"
    },
    "applicability": {
     "enum": [
      "APPLICABLE",
      "NOT_APPLICABLE",
      "UNDETERMINED"
     ]
    },
    "trigger": {
     "enum": [
      "SATISFIED",
      "NOT_SATISFIED",
      "UNDETERMINED",
      "CONFLICTED"
     ]
    },
    "detail": {
     "type": "string"
    },
    "conjuncts": {
     "type": "array",
     "items": {
      "$ref": "#/$defs/EvidenceBlockerConjunct"
     }
    },
    "strength": {
     "enum": [
      "strict",
      "defeasible",
      "defeater"
     ]
    },
    "continuations": {
     "type": "array",
     "minItems": 1,
     "items": {
      "$ref": "#/$defs/BlockerContinuation"
     }
    },
    "truncated": {
     "const": true
    },
    "defeats": {
     "type": "array",
     "minItems": 1,
     "items": {
      "$ref": "#/$defs/BlockerDefeat"
     }
    }
   }
  }
 },
 "$id": "https://law.arxo.io/schema/evaluation.schema.json",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "additionalProperties": false,
 "properties": {
  "conflicts": {
   "default": [],
   "items": {
    "$ref": "#/$defs/ConflictReport"
   },
   "type": "array"
  },
  "issues": {
   "default": [],
   "items": {
    "$ref": "#/$defs/Issue"
   },
   "type": "array"
  },
  "manifest": {
   "$ref": "#/$defs/EvaluationManifest"
  },
  "positions": {
   "default": [],
   "items": {
    "$ref": "#/$defs/PositionInstance"
   },
   "type": "array"
  },
  "proofGraph": {
   "$ref": "#/$defs/ProofGraph"
  },
  "resultHash": {
   "$ref": "#/$defs/Digest"
  },
  "results": {
   "items": {
    "$ref": "#/$defs/EvaluationResult"
   },
   "type": "array"
  },
  "schemaVersion": {
   "enum": [
    "law.core.evaluation/0.1",
    "law.core.evaluation/0.2"
   ]
  },
  "executionReceipt": {
   "$ref": "#/$defs/ExecutionReceipt"
  },
  "evidenceAcceptance": {
   "$ref": "#/$defs/EvidenceAcceptanceReport"
  }
 },
 "required": [
  "schemaVersion",
  "manifest",
  "results",
  "proofGraph",
  "resultHash"
 ],
 "title": "Arxo Core Evaluation Result and Proof Graph",
 "type": "object",
 "allOf": [
  {
   "if": {
    "properties": {
     "schemaVersion": {
      "const": "law.core.evaluation/0.2"
     }
    },
    "required": [
     "schemaVersion"
    ]
   },
   "then": {
    "properties": {
     "manifest": {
      "required": [
       "theoryHash",
       "artifactHash"
      ]
     },
     "proofGraph": {
      "properties": {
       "nodes": {
        "items": {
         "if": {
          "properties": {
           "kind": {
            "const": "defeat"
           }
          },
          "required": [
           "kind"
          ]
         },
         "then": {
          "required": [
           "priorityPath",
           "outcome"
          ]
         }
        }
       }
      }
     }
    }
   }
  }
 ]
}
