{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://developer.reits.tech/schemas/auth-s08-r02-c02-receiver-intake-rehash.v1.schema.json",
  "title": "Auth S08 R02 C02 接收方到达登记与摘要重算准入台",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "subknifeId", "parentSubknife", "status", "progress", "boundary", "tool", "lanes", "stateMachine", "checkpoints", "rejectionCatalog", "scenarios", "outputs", "qaGates", "decision"],
  "properties": {
    "schemaVersion": { "const": "developer.reits.tech/auth-s08-r02-c02-receiver-intake-rehash/v1" },
    "subknifeId": { "const": "D05-A03-P03c-S08-R02-C02-H01-P05" },
    "parentSubknife": { "const": "D05-A03-P03c-S08-R02-C02-H01-P04" },
    "status": { "const": "RECEIVER_INTAKE_TOOL_READY_REAL_ARRIVAL_ABSENT" },
    "progress": {
      "type": "object",
      "required": ["formal", "auth", "s08", "r02Engineering", "engineeringTools", "externalContributions", "ownerBallots"],
      "properties": {
        "formal": {
          "type": "object",
          "properties": {
            "currentKnife": { "const": 5 },
            "acceptedKnives": { "const": 4 },
            "totalKnives": { "const": 36 },
            "remainingIncludingCurrent": { "const": 32 }
          },
          "required": ["currentKnife", "acceptedKnives", "totalKnives", "remainingIncludingCurrent"]
        },
        "auth": { "type": "object" },
        "s08": { "type": "object" },
        "r02Engineering": { "type": "object" },
        "engineeringTools": {
          "type": "object",
          "properties": {
            "completed": { "const": 4 },
            "total": { "const": 4 },
            "ownerPreflight": { "const": 1 },
            "quarantineAssembler": { "const": 1 },
            "custodyHandoff": { "const": 1 },
            "receiverIntake": { "const": 1 }
          },
          "required": ["completed", "total", "ownerPreflight", "quarantineAssembler", "custodyHandoff", "receiverIntake"]
        },
        "externalContributions": {
          "type": "object",
          "properties": {
            "required": { "const": 4 },
            "dispatched": { "const": 0 },
            "arrived": { "const": 0 },
            "rehashed": { "const": 0 },
            "digestMatched": { "const": 0 },
            "quarantined": { "const": 0 },
            "bound": { "const": 0 },
            "waiting": { "const": 4 }
          },
          "required": ["required", "dispatched", "arrived", "rehashed", "digestMatched", "quarantined", "bound", "waiting"]
        },
        "ownerBallots": { "type": "object" }
      }
    },
    "boundary": {
      "type": "object",
      "properties": {
        "networkRequestsAllowed": { "const": false },
        "onlineUploadAllowed": { "const": false },
        "browserPersistenceAllowed": { "const": false },
        "privateMaterialAllowed": { "const": false },
        "rawPublicKeyAllowedInEvidence": { "const": false },
        "toolOutputIsExternalReceipt": { "const": false },
        "toolOutputIsP03QuarantineReceipt": { "const": false },
        "authorityBindingEffect": { "const": false },
        "ballotEffect": { "const": false },
        "productionEffect": { "const": false },
        "formalAdvanceEffect": { "const": false }
      },
      "required": ["networkRequestsAllowed", "onlineUploadAllowed", "browserPersistenceAllowed", "privateMaterialAllowed", "rawPublicKeyAllowedInEvidence", "toolOutputIsExternalReceipt", "toolOutputIsP03QuarantineReceipt", "authorityBindingEffect", "ballotEffect", "productionEffect", "formalAdvanceEffect"]
    },
    "tool": { "type": "object" },
    "lanes": {
      "type": "array",
      "minItems": 4,
      "maxItems": 4,
      "items": {
        "type": "object",
        "properties": {
          "ownerId": { "enum": ["AUTH", "SECURITY", "SRE_DBA", "QA_WITNESS"] },
          "state": { "const": "NOT_ARRIVED" },
          "realCount": { "const": 0 }
        },
        "required": ["ownerId", "state", "realCount"]
      }
    },
    "stateMachine": { "type": "array", "minItems": 6, "maxItems": 6 },
    "checkpoints": {
      "type": "array",
      "minItems": 16,
      "maxItems": 16,
      "items": {
        "type": "object",
        "required": ["id", "name", "failureCode"],
        "properties": {
          "id": { "pattern": "^I(?:0[1-9]|1[0-6])$" },
          "name": { "type": "string", "minLength": 4 },
          "failureCode": { "pattern": "^E_[A-Z0-9_]+$" }
        }
      }
    },
    "rejectionCatalog": { "type": "array", "minItems": 16, "maxItems": 16 },
    "scenarios": { "type": "array", "minItems": 8, "maxItems": 8 },
    "outputs": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "items": {
        "type": "object",
        "properties": {
          "state": { "const": "HASH_MATCHED_AWAITING_P03_QUARANTINE" },
          "containsRawPublicKey": { "const": false },
          "containsSignature": { "const": false },
          "externalReceipt": { "const": false },
          "p03QuarantineReceipt": { "const": false },
          "authorityBindingEffect": { "const": false }
        },
        "required": ["state", "containsRawPublicKey", "containsSignature", "externalReceipt", "p03QuarantineReceipt", "authorityBindingEffect"]
      }
    },
    "qaGates": { "type": "array", "minItems": 16, "maxItems": 16 },
    "decision": {
      "type": "object",
      "properties": {
        "receiverIntakeToolReady": { "const": true },
        "realDispatches": { "const": 0 },
        "realArrivals": { "const": 0 },
        "realRehashes": { "const": 0 },
        "realDigestMatches": { "const": 0 },
        "realQuarantined": { "const": 0 },
        "externalReceiptAccepted": { "const": false },
        "authoritySetBound": { "const": false },
        "c02Complete": { "const": false },
        "c03Admitted": { "const": false },
        "productionHeld": { "const": true }
      },
      "required": ["receiverIntakeToolReady", "realDispatches", "realArrivals", "realRehashes", "realDigestMatches", "realQuarantined", "externalReceiptAccepted", "authoritySetBound", "c02Complete", "c03Admitted", "productionHeld", "nextRequiredEvent"]
    }
  }
}
