{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://developer.reits.tech/schemas/runner-controller-dossier-store-dry-boot-response-receipt-validator-outcome-adjudication.v1.schema.json",
  "title": "D05 dry-boot response receipt validator and outcome adjudication",
  "type": "object",
  "required": ["schemaVersion", "status", "evaluatedAt", "mode", "program", "summary", "upstreamCallEnvelopeContract", "upstreamNoShellAdapterContract", "outcomeTransactionContract", "productionEvaluation", "responseValidator", "responseReceiptDescriptorMatrix", "outcomeClassMatrix", "commitGuardMatrix", "outcomeProtocolMatrix", "authorityMatrix", "outcomeGateMatrix", "receiptChainMatrix", "terminalReceiptFieldMatrix", "lifecycleMatrix", "fixtureResults", "decisionCodes", "invariants", "safetyTruth"],
  "properties": {
    "schemaVersion": { "const": "developer.reits.tech/runner-controller-dossier-store-dry-boot-response-receipt-validator-outcome-adjudication/v1" },
    "status": { "enum": ["RESPONSE_RECEIPT_VALIDATOR_OUTCOME_ADJUDICATION_BOUND_PRODUCTION_OUTCOME_ABSENT", "UPSTREAM_CALL_ENVELOPE_CONTRACT_UNAVAILABLE", "RAW_NO_SHELL_ADAPTER_CONTRACT_UNAVAILABLE"] },
    "evaluatedAt": { "type": "string", "format": "date-time" },
    "mode": { "const": "PURE_TEST_ONLY_RESPONSE_VALIDATION_QUARANTINE_ADJUDICATION_AND_TICKET_CONSUMPTION_NO_ADAPTER_INVOCATION_NO_HOST_NO_PORT" },
    "program": { "type": "object" },
    "summary": { "$ref": "#/$defs/summary" },
    "upstreamCallEnvelopeContract": { "type": ["object", "null"] },
    "upstreamNoShellAdapterContract": { "type": ["object", "null"] },
    "outcomeTransactionContract": { "type": ["object", "null"] },
    "productionEvaluation": { "$ref": "#/$defs/evaluation" },
    "responseValidator": { "type": "object" },
    "responseReceiptDescriptorMatrix": { "type": "array", "minItems": 8, "maxItems": 8, "items": { "type": "object" } },
    "outcomeClassMatrix": { "type": "array", "minItems": 4, "maxItems": 4, "items": { "type": "object" } },
    "commitGuardMatrix": { "type": "array", "minItems": 6, "maxItems": 6, "items": { "type": "object" } },
    "outcomeProtocolMatrix": { "type": "array", "minItems": 10, "maxItems": 10, "items": { "type": "object" } },
    "authorityMatrix": { "type": "array", "minItems": 5, "maxItems": 5, "items": { "type": "object" } },
    "outcomeGateMatrix": { "type": "array", "minItems": 22, "maxItems": 22, "items": { "type": "object" } },
    "receiptChainMatrix": { "type": "array", "minItems": 17, "maxItems": 17, "items": { "type": "object" } },
    "terminalReceiptFieldMatrix": { "type": "array", "minItems": 62, "maxItems": 62, "items": { "type": "object" } },
    "lifecycleMatrix": { "type": "array", "minItems": 17, "maxItems": 17, "items": { "type": "object" } },
    "fixtureResults": { "type": "array", "minItems": 118, "maxItems": 118, "items": { "$ref": "#/$defs/fixture" } },
    "decisionCodes": { "type": "array", "minItems": 118, "maxItems": 118, "uniqueItems": true, "items": { "type": "string" } },
    "invariants": { "type": "array", "minItems": 78, "maxItems": 78, "uniqueItems": true, "items": { "type": "string" } },
    "safetyTruth": { "$ref": "#/$defs/safetyTruth" },
    "discovery": { "type": "object" }
  },
  "$defs": {
    "summary": {
      "type": "object",
      "required": ["logicalOutcomesRequired", "responseReceiptsRequired", "outcomeClassesRequired", "commitGuardsRequired", "protocolStagesRequired", "authorityRolesRequired", "outcomeGates", "receiptChainEntries", "terminalReceiptFields", "fixtureCases", "fixtureAssertionsPassed", "fixtureCommitted", "fixturePartialQuarantined", "fixtureDenied", "productionAdapterOutcomes", "productionResponseReceipts", "productionResponseValidations", "productionPartialQuarantines", "productionOutcomeAdjudications", "productionConsumptionIntents", "productionTicketConsumptions", "productionAdapterInvocations", "productionHostsCreated", "productionHostContacts", "productionPort8110Calls", "executionPermitted"],
      "properties": {
        "logicalOutcomesRequired": { "const": 1 }, "responseReceiptsRequired": { "const": 8 }, "outcomeClassesRequired": { "const": 4 }, "commitGuardsRequired": { "const": 6 }, "protocolStagesRequired": { "const": 10 }, "authorityRolesRequired": { "const": 5 }, "outcomeGates": { "const": 22 }, "receiptChainEntries": { "const": 17 }, "terminalReceiptFields": { "const": 62 }, "fixtureCases": { "const": 118 }, "fixtureAssertionsPassed": { "const": 118 }, "fixtureCommitted": { "const": 1 }, "fixturePartialQuarantined": { "const": 1 }, "fixtureDenied": { "const": 116 }, "productionAdapterOutcomes": { "const": 0 }, "productionResponseReceipts": { "const": 0 }, "productionResponseValidations": { "const": 0 }, "productionPartialQuarantines": { "const": 0 }, "productionOutcomeAdjudications": { "const": 0 }, "productionConsumptionIntents": { "const": 0 }, "productionTicketConsumptions": { "const": 0 }, "productionAdapterInvocations": { "const": 0 }, "productionHostsCreated": { "const": 0 }, "productionHostContacts": { "const": 0 }, "productionPort8110Calls": { "const": 0 }, "executionPermitted": { "const": false }
      }
    },
    "evaluation": {
      "type": "object",
      "required": ["code", "terminal", "failedGate", "outcomesVerified", "responseReceiptsVerified", "classesVerified", "guardsVerified", "stagesVerified", "authoritiesVerified", "receiptsVerified", "quarantinesVerified", "consumptionsCommitted", "productionReady"],
      "properties": { "code": { "type": "string" }, "terminal": { "enum": ["OUTCOME_COMMITTED_FIXTURE", "PARTIAL_QUARANTINED_FIXTURE", "DENIED"] }, "failedGate": { "type": ["string", "null"] }, "outcomesVerified": { "type": "integer" }, "responseReceiptsVerified": { "type": "integer" }, "classesVerified": { "type": "integer" }, "guardsVerified": { "type": "integer" }, "stagesVerified": { "type": "integer" }, "authoritiesVerified": { "type": "integer" }, "receiptsVerified": { "type": "integer" }, "quarantinesVerified": { "type": "integer" }, "consumptionsCommitted": { "type": "integer" }, "productionReady": { "const": false } }
    },
    "fixture": {
      "type": "object",
      "required": ["ordinal", "id", "mutation", "expectedCode", "actualCode", "expectedTerminal", "terminal", "passed", "failedGate", "outcomesVerified", "responseReceiptsVerified", "classesVerified", "guardsVerified", "stagesVerified", "authoritiesVerified", "receiptsVerified", "quarantinesVerified", "consumptionsCommitted", "productionReady"],
      "properties": { "ordinal": { "type": "integer" }, "id": { "type": "string", "pattern": "^DBO-[0-9]{3}$" }, "mutation": { "type": "string" }, "expectedCode": { "type": "string" }, "actualCode": { "type": "string" }, "expectedTerminal": { "type": "string" }, "terminal": { "type": "string" }, "passed": { "const": true }, "failedGate": { "type": ["string", "null"] }, "outcomesVerified": { "type": "integer" }, "responseReceiptsVerified": { "type": "integer" }, "classesVerified": { "type": "integer" }, "guardsVerified": { "type": "integer" }, "stagesVerified": { "type": "integer" }, "authoritiesVerified": { "type": "integer" }, "receiptsVerified": { "type": "integer" }, "quarantinesVerified": { "type": "integer" }, "consumptionsCommitted": { "type": "integer" }, "productionReady": { "const": false } }
    },
    "safetyTruth": {
      "type": "object",
      "properties": { "productionAdapterOutcomes": { "const": 0 }, "productionResponseReceipts": { "const": 0 }, "productionResponseValidations": { "const": 0 }, "productionPartialQuarantines": { "const": 0 }, "productionOutcomeAdjudications": { "const": 0 }, "productionConsumptionIntents": { "const": 0 }, "productionTicketConsumptions": { "const": 0 }, "productionAdapterInvocations": { "const": 0 }, "productionProcessesSpawned": { "const": 0 }, "productionHostsCreated": { "const": 0 }, "productionHostContacts": { "const": 0 }, "productionPort8110Calls": { "const": 0 }, "durableReadsExecuted": { "const": 0 }, "durableWritesExecuted": { "const": 0 }, "externalReadsExecuted": { "const": 0 }, "externalWritesExecuted": { "const": 0 }, "resourcesCreated": { "const": 0 }, "d1Created": { "const": 0 }, "r2Created": { "const": 0 }, "productionResponseValidatorConfigured": { "const": false }, "productionQuarantineStoreConfigured": { "const": false }, "productionTicketConsumptionStoreConfigured": { "const": false }, "productionOutcomeDriverConfigured": { "const": false }, "controller8110Started": { "const": false }, "executionPermitted": { "const": false } }
    }
  }
}
