{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.corva.ai/fe-ai-tools/registry/v1",
  "title": "Ask Corva app-tools fleet registry",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "repositories"],
  "properties": {
    "$schema": { "type": "string" },
    "schemaVersion": { "const": 1 },
    "paused": { "type": "boolean" },
    "pauseReason": { "type": "string", "pattern": ".*\\S.*" },
    "repositories": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["repository", "profile", "rolloutGroup"],
        "properties": {
          "repository": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$"
          },
          "profile": { "enum": ["dc-app", "platform-app"] },
          "rolloutGroup": { "enum": ["canary", "early", "standard", "blocked"] },
          "reason": { "type": "string", "pattern": ".*\\S.*" }
        },
        "allOf": [
          {
            "if": { "properties": { "rolloutGroup": { "const": "blocked" } }, "required": ["rolloutGroup"] },
            "then": { "required": ["reason"] }
          }
        ]
      }
    }
  },
  "allOf": [
    {
      "if": { "properties": { "paused": { "const": true } }, "required": ["paused"] },
      "then": { "required": ["pauseReason"] }
    }
  ]
}
