{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion", "recordType", "candidateId", "sourceCommit", "gitTree",
    "selectionCommit", "selectionTree",
    "scopeSha256", "chain", "testId", "protocolId",
    "executionPolicySha256", "executablePath", "executableSha256",
    "candidateImplementationPath", "candidateImplementationSha256",
    "candidateImplementationGitBlob", "candidateInterfaceId",
    "independentOracleId", "launcherArgv", "isolationArgv", "candidateArgv",
    "startedAtUtc", "endedAtUtc", "durationMonotonicNs", "exitCode",
    "stdoutBase64", "stdoutSha256", "stderrBase64", "stderrSha256",
    "requestSha256", "responseBase64", "responseSha256",
    "generationId", "generationPointerPath",
    "requestedRawEventsPath", "requestedExecutionRecordPath",
    "rawEventsPath", "rawEventsBase64",
    "rawEventsSha256", "eventCount", "nonceBase64", "launcherSignature"
  ],
  "properties": {
    "schemaVersion": {"const": "3.0.0"},
    "recordType": {"const": "privacy-unlinkability-execution-output"},
    "candidateId": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
    "sourceCommit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
    "gitTree": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
    "selectionCommit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
    "selectionTree": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
    "scopeSha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "chain": {"const": "base"},
    "testId": {
      "enum": [
        "privacy.commitment-reuse", "privacy.cross-partner-collusion",
        "privacy.metadata-timing-correlation", "privacy.combined"
      ]
    },
    "protocolId": {"const": "vaultfire-unlinkability-execution-v4"},
    "executionPolicySha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "executablePath": {
      "const": "pr10/partner-package/scripts/run_unlinkability_protocol.py"
    },
    "executableSha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "candidateImplementationPath": {
      "const": "v3-src/privacy-portability/canonical_api.py"
    },
    "candidateImplementationSha256": {
      "type": "string", "pattern": "^[0-9a-f]{64}$"
    },
    "candidateImplementationGitBlob": {
      "type": "string", "pattern": "^[0-9a-f]{40}$"
    },
    "candidateInterfaceId": {
      "const": "vaultfire.privacy-portability.cli-v1"
    },
    "independentOracleId": {
      "const": "vaultfire.privacy-portability.oracle-v1"
    },
    "launcherArgv": {
      "type": "array", "minItems": 17, "maxItems": 17,
      "items": {"type": "string", "minLength": 1}
    },
    "isolationArgv": {
      "type": "array", "minItems": 40,
      "items": {"type": "string", "minLength": 1}
    },
    "candidateArgv": {
      "const": [
        "/runtime/bin/python", "-I", "-B",
        "/candidate/implementation.py", "--request-jsonl",
        "/input/requests.jsonl", "--response-jsonl",
        "/output/responses.jsonl"
      ]
    },
    "startedAtUtc": {"type": "string", "format": "date-time"},
    "endedAtUtc": {"type": "string", "format": "date-time"},
    "durationMonotonicNs": {"type": "integer", "minimum": 1},
    "exitCode": {"const": 0},
    "stdoutBase64": {"const": ""},
    "stdoutSha256": {
      "const": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
    },
    "stderrBase64": {"const": ""},
    "stderrSha256": {
      "const": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
    },
    "requestSha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "responseBase64": {"type": "string", "minLength": 4, "maxLength": 10485760},
    "responseSha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "generationId": {
      "type": "string", "pattern": "^generation-[0-9a-f]{64}$"
    },
    "generationPointerPath": {
      "type": "string",
      "pattern": "^pr10/partner-package/evidence/organizational/privacy-outputs/[a-z0-9-]+/CURRENT\\.json$"
    },
    "requestedRawEventsPath": {
      "type": "string",
      "pattern": "^pr10/partner-package/evidence/organizational/privacy-outputs/[a-z0-9-]+/raw-events\\.jsonl$"
    },
    "requestedExecutionRecordPath": {
      "type": "string",
      "pattern": "^pr10/partner-package/evidence/organizational/privacy-outputs/[a-z0-9-]+/execution-record\\.json$"
    },
    "rawEventsPath": {
      "type": "string",
      "pattern": "^pr10/partner-package/evidence/organizational/privacy-outputs/[a-z0-9-]+/generations/generation-[0-9a-f]{64}/raw-events\\.jsonl$"
    },
    "rawEventsBase64": {"type": "string", "minLength": 4, "maxLength": 10485760},
    "rawEventsSha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "eventCount": {"type": "integer", "minimum": 400},
    "nonceBase64": {
      "type": "string", "pattern": "^[A-Za-z0-9+/]{43}=$"
    },
    "launcherSignature": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "keyType", "publicKeySha256", "signedPayloadSha256", "signatureBase64"
      ],
      "properties": {
        "keyType": {"const": "Ed25519"},
        "publicKeySha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
        "signedPayloadSha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
        "signatureBase64": {
          "type": "string", "pattern": "^[A-Za-z0-9+/]{86}==$"
        }
      }
    }
  }
}
