{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mcpcensus-com/json-schema/mcpcensus-com-evaluation-detail-response-schema.json",
  "title": "EvaluationDetailResponse",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mcpcensus-com-openapi.json#/components/schemas/EvaluationDetailResponse",
  "type": "object",
  "required": [
    "ok",
    "evaluation"
  ],
  "properties": {
    "ok": {
      "const": true
    },
    "evaluation": {
      "allOf": [
        {
          "$ref": "#/$defs/EvaluationSummary"
        },
        {
          "type": "object",
          "required": [
            "ruleset_id",
            "ruleset_revision",
            "facts",
            "reasons"
          ],
          "properties": {
            "ruleset_id": {
              "const": "preflight-ruleset"
            },
            "ruleset_revision": {
              "const": 1
            },
            "facts": {
              "type": "object"
            },
            "reasons": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/PreflightReason"
              }
            }
          }
        }
      ]
    }
  },
  "$defs": {
    "EvaluationSummary": {
      "type": "object",
      "required": [
        "audit_id",
        "server_name",
        "policy_id",
        "policy_revision",
        "decision",
        "decision_scope",
        "facts_digest",
        "policy_digest",
        "decision_input_digest",
        "engine_version",
        "evaluated_at",
        "valid_until",
        "audit_signed"
      ],
      "properties": {
        "audit_id": {
          "type": "string",
          "format": "uuid"
        },
        "server_name": {
          "type": "string"
        },
        "policy_id": {
          "type": "string"
        },
        "policy_revision": {
          "type": "integer"
        },
        "decision": {
          "type": "string",
          "enum": [
            "PASS",
            "REVIEW",
            "BLOCK"
          ]
        },
        "decision_scope": {
          "const": "public_evidence_policy"
        },
        "facts_digest": {
          "type": "string"
        },
        "policy_digest": {
          "type": "string"
        },
        "decision_input_digest": {
          "type": "string"
        },
        "engine_version": {
          "type": "string"
        },
        "evaluated_at": {
          "type": "string",
          "format": "date-time"
        },
        "valid_until": {
          "type": "string",
          "format": "date-time"
        },
        "audit_signed": {
          "const": false
        }
      }
    },
    "PreflightEvidence": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "value": {},
        "observed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "attempted_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "freshness_enforced": {
          "type": "boolean"
        },
        "canonical_evidence_id": {
          "type": "string"
        }
      }
    },
    "PreflightReason": {
      "type": "object",
      "required": [
        "code",
        "result",
        "summary",
        "evidence"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "result": {
          "type": "string",
          "enum": [
            "pass",
            "review",
            "block",
            "context",
            "not_applicable",
            "unknown"
          ]
        },
        "summary": {
          "type": "string"
        },
        "ecosystem": {
          "type": "string"
        },
        "artifact_id": {
          "type": "string"
        },
        "evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PreflightEvidence"
          }
        }
      }
    }
  }
}