{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://developer.reits.tech/schemas/runner-controller-dossier-store-dry-boot-executor-adapter-preflight-transaction.v1.schema.json",
  "title": "D05 dry-boot executor adapter preflight transaction",
  "type": "object",
  "required": ["schemaVersion", "status", "evaluatedAt", "mode", "program", "summary", "upstreamExecutionSessionContract", "upstreamNoShellAdapterContract", "preflightTransactionContract", "productionEvaluation", "adapterCapabilityManifest", "adapterCheckMatrix", "compensationTriggerMatrix", "preflightProtocolMatrix", "authorityMatrix", "preflightGateMatrix", "receiptChainMatrix", "terminalReceiptFieldMatrix", "lifecycleMatrix", "fixtureResults", "decisionCodes", "invariants", "safetyTruth"],
  "properties": {
    "schemaVersion": { "const": "developer.reits.tech/runner-controller-dossier-store-dry-boot-executor-adapter-preflight-transaction/v1" },
    "status": { "enum": ["EXECUTOR_ADAPTER_PREFLIGHT_CONTRACT_BOUND_PRODUCTION_PREFLIGHT_ABSENT", "UPSTREAM_EXECUTION_SESSION_CONTRACT_UNAVAILABLE", "RAW_NO_SHELL_ADAPTER_CONTRACT_UNAVAILABLE"] },
    "evaluatedAt": { "type": "string", "format": "date-time" },
    "mode": { "const": "PURE_TEST_ONLY_ADAPTER_PREFLIGHT_TRANSACTION_NO_ADAPTER_INVOCATION_NO_HOST_NO_PORT" },
    "program": { "type": "object" },
    "summary": { "$ref": "#/$defs/summary" },
    "upstreamExecutionSessionContract": { "type": ["object", "null"] },
    "upstreamNoShellAdapterContract": { "type": ["object", "null"] },
    "preflightTransactionContract": { "type": ["object", "null"] },
    "productionEvaluation": { "$ref": "#/$defs/evaluation" },
    "adapterCapabilityManifest": { "type": "object" },
    "adapterCheckMatrix": { "type": "array", "minItems": 8, "maxItems": 8, "items": { "type": "object" } },
    "compensationTriggerMatrix": { "type": "array", "minItems": 4, "maxItems": 4, "items": { "type": "object" } },
    "preflightProtocolMatrix": { "type": "array", "minItems": 8, "maxItems": 8, "items": { "type": "object" } },
    "authorityMatrix": { "type": "array", "minItems": 5, "maxItems": 5, "items": { "type": "object" } },
    "preflightGateMatrix": { "type": "array", "minItems": 20, "maxItems": 20, "items": { "type": "object" } },
    "receiptChainMatrix": { "type": "array", "minItems": 15, "maxItems": 15, "items": { "type": "object" } },
    "terminalReceiptFieldMatrix": { "type": "array", "minItems": 54, "maxItems": 54, "items": { "type": "object" } },
    "lifecycleMatrix": { "type": "array", "minItems": 15, "maxItems": 15, "items": { "type": "object" } },
    "fixtureResults": { "type": "array", "minItems": 106, "maxItems": 106, "items": { "$ref": "#/$defs/fixture" } },
    "decisionCodes": { "type": "array", "minItems": 106, "maxItems": 106, "uniqueItems": true, "items": { "type": "string" } },
    "invariants": { "type": "array", "minItems": 70, "maxItems": 70, "uniqueItems": true, "items": { "type": "string" } },
    "safetyTruth": { "$ref": "#/$defs/safetyTruth" },
    "discovery": { "type": "object" }
  },
  "$defs": {
    "summary": {
      "type": "object",
      "required": ["logicalTransactionsRequired", "adapterChecksRequired", "compensationTriggersRequired", "protocolStagesRequired", "authorityRolesRequired", "preflightGates", "receiptChainEntries", "terminalReceiptFields", "fixtureCases", "fixtureAssertionsPassed", "fixtureReady", "fixtureCompensated", "fixtureDenied", "productionPreflightTransactionsObserved", "productionInvocationTickets", "productionTicketConsumptions", "productionAdapterInvocations", "productionHostsCreated", "productionHostContacts", "productionPort8110Calls", "executionPermitted"],
      "properties": {
        "logicalTransactionsRequired": { "const": 1 }, "adapterChecksRequired": { "const": 8 }, "compensationTriggersRequired": { "const": 4 }, "protocolStagesRequired": { "const": 8 }, "authorityRolesRequired": { "const": 5 }, "preflightGates": { "const": 20 }, "receiptChainEntries": { "const": 15 }, "terminalReceiptFields": { "const": 54 }, "fixtureCases": { "const": 106 }, "fixtureAssertionsPassed": { "const": 106 }, "fixtureReady": { "const": 1 }, "fixtureCompensated": { "const": 1 }, "fixtureDenied": { "const": 104 }, "productionPreflightTransactionsObserved": { "const": 0 }, "productionInvocationTickets": { "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", "transactionsVerified", "checksVerified", "triggersVerified", "stagesVerified", "authoritiesVerified", "receiptsVerified", "productionReady"],
      "properties": { "code": { "type": "string" }, "terminal": { "enum": ["PREFLIGHT_READY_FIXTURE", "COMPENSATED_FIXTURE", "DENIED"] }, "failedGate": { "type": ["string", "null"] }, "transactionsVerified": { "type": "integer" }, "checksVerified": { "type": "integer" }, "triggersVerified": { "type": "integer" }, "stagesVerified": { "type": "integer" }, "authoritiesVerified": { "type": "integer" }, "receiptsVerified": { "type": "integer" }, "productionReady": { "const": false } }
    },
    "fixture": {
      "type": "object",
      "required": ["ordinal", "id", "mutation", "expectedCode", "actualCode", "expectedTerminal", "terminal", "passed", "failedGate", "transactionsVerified", "checksVerified", "triggersVerified", "stagesVerified", "authoritiesVerified", "receiptsVerified", "productionReady"],
      "properties": { "ordinal": { "type": "integer" }, "id": { "type": "string", "pattern": "^DBP-[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"] }, "transactionsVerified": { "type": "integer" }, "checksVerified": { "type": "integer" }, "triggersVerified": { "type": "integer" }, "stagesVerified": { "type": "integer" }, "authoritiesVerified": { "type": "integer" }, "receiptsVerified": { "type": "integer" }, "productionReady": { "const": false } }
    },
    "safetyTruth": {
      "type": "object",
      "properties": { "productionPreflightTransactions": { "const": 0 }, "productionInvocationTickets": { "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 }, "productionAdapterDriverConfigured": { "const": false }, "controller8110Started": { "const": false }, "executionPermitted": { "const": false } }
    }
  }
}
