{
  "$id": "https://r-ai-r.com/rair-results-schema-0.1.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Schema for declarative R-AI-R v0.1 test results. A declaration is not a security certification.",
  "properties": {
    "artifact": {
      "additionalProperties": false,
      "properties": {
        "canonical_sha256": {
          "const": "9565d21065c1abf5ce69795cd6560513136847b231e785594f55d13ac7576846"
        },
        "file_sha256": {
          "pattern": "^[a-f0-9]{64}$",
          "type": "string"
        },
        "format": {
          "minLength": 1,
          "type": "string"
        },
        "path": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "path",
        "format",
        "file_sha256",
        "canonical_sha256"
      ],
      "type": "object"
    },
    "environment": {
      "type": "string"
    },
    "evaluated_system": {
      "additionalProperties": false,
      "properties": {
        "deployment_context": {
          "type": "string"
        },
        "name": {
          "minLength": 1,
          "type": "string"
        },
        "notes": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "system_type": {
          "enum": [
            "chat",
            "document-scanner",
            "rag",
            "agent",
            "other"
          ],
          "type": "string"
        },
        "version_or_date": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "name",
        "version_or_date",
        "system_type"
      ],
      "type": "object"
    },
    "evaluator": {
      "additionalProperties": false,
      "properties": {
        "contact": {
          "type": "string"
        },
        "name": {
          "minLength": 1,
          "type": "string"
        },
        "organization": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "evidence": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "enum": [
              "transcript",
              "log",
              "screenshot",
              "hash",
              "tool-call",
              "other"
            ],
            "type": "string"
          },
          "sha256": {
            "pattern": "^[a-f0-9]{64}$",
            "type": "string"
          },
          "summary": {
            "minLength": 1,
            "type": "string"
          },
          "uri": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "summary"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "limitations": {
      "type": "string"
    },
    "observed_behavior": {
      "minLength": 1,
      "type": "string"
    },
    "prompt_or_task": {
      "type": "string"
    },
    "result_id": {
      "minLength": 1,
      "type": "string"
    },
    "signature": {
      "additionalProperties": false,
      "properties": {
        "public_key_or_certificate": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "standard": {
      "const": "R-AI-R"
    },
    "test_id": {
      "const": "RAIR-CANON-001"
    },
    "test_level": {
      "enum": [
        "L0",
        "L1",
        "L2",
        "L3",
        "L4"
      ],
      "type": "string"
    },
    "tested_at": {
      "format": "date-time",
      "type": "string"
    },
    "verdict": {
      "enum": [
        "PASS",
        "PARTIAL",
        "FAIL"
      ],
      "type": "string"
    },
    "version": {
      "const": "0.1"
    }
  },
  "required": [
    "standard",
    "version",
    "result_id",
    "test_id",
    "test_level",
    "verdict",
    "evaluated_system",
    "artifact",
    "observed_behavior",
    "evaluator",
    "tested_at"
  ],
  "title": "R-AI-R Result Declaration v0.1",
  "type": "object"
}
