{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.wtf-p.dev/project/validation/v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "id",
    "project_id",
    "subject_uri",
    "validator_role",
    "action_id",
    "status",
    "checks",
    "issues",
    "next_actions",
    "effects_applied",
    "executed_at"
  ],
  "properties": {
    "schema": { "const": "wtfp.project.validation/v1" },
    "id": { "$ref": "https://schemas.wtf-p.dev/project/common/v1#/$defs/identifier" },
    "project_id": { "$ref": "https://schemas.wtf-p.dev/project/common/v1#/$defs/identifier" },
    "subject_uri": { "$ref": "https://schemas.wtf-p.dev/project/common/v1#/$defs/logicalUri" },
    "validator_role": { "$ref": "https://schemas.wtf-p.dev/project/common/v1#/$defs/identifier" },
    "action_id": { "$ref": "https://schemas.wtf-p.dev/project/common/v1#/$defs/identifier" },
    "status": { "enum": ["passed", "issues-found", "needs-input", "failed"] },
    "checks": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "status", "summary", "evidence"],
        "properties": {
          "id": { "$ref": "https://schemas.wtf-p.dev/project/common/v1#/$defs/identifier" },
          "status": { "enum": ["passed", "warning", "failed", "not-applicable"] },
          "summary": { "$ref": "https://schemas.wtf-p.dev/project/common/v1#/$defs/nonEmptyString" },
          "evidence": {
            "type": "array",
            "items": { "$ref": "https://schemas.wtf-p.dev/project/common/v1#/$defs/nonEmptyString" }
          }
        }
      }
    },
    "issues": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["severity", "summary"],
        "properties": {
          "severity": { "enum": ["info", "warning", "error", "blocker"] },
          "summary": { "$ref": "https://schemas.wtf-p.dev/project/common/v1#/$defs/nonEmptyString" },
          "evidence": { "type": "string" }
        }
      }
    },
    "next_actions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["action", "reason"],
        "properties": {
          "action": { "$ref": "https://schemas.wtf-p.dev/project/common/v1#/$defs/identifier" },
          "reason": { "$ref": "https://schemas.wtf-p.dev/project/common/v1#/$defs/nonEmptyString" }
        }
      }
    },
    "effects_applied": { "const": [] },
    "executed_at": { "$ref": "https://schemas.wtf-p.dev/project/common/v1#/$defs/timestamp" }
  }
}
