{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://haltseal.com/schemas/workflow-evaluation.v1.json",
  "title": "HALTSEAL Workflow Evaluation input",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "workflow_alias", "profile", "stable_reference", "paths", "owners", "excluded_paths", "current_controls"],
  "properties": {
    "schema": {"const": "haltseal.workflow-evaluation.input.v1"},
    "workflow_alias": {"type": "string", "minLength": 1, "maxLength": 80},
    "profile": {"const": "own-account-usd10-local"},
    "stable_reference": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"},
    "paths": {
      "type": "array", "minItems": 2, "maxItems": 2,
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["alias", "route", "entry_point"],
        "properties": {
          "alias": {"enum": ["original", "replacement"]},
          "route": {"enum": ["A", "B"]},
          "entry_point": {"type": "string", "minLength": 1, "maxLength": 200}
        }
      },
      "prefixItems": [
        {"properties": {"alias": {"const": "original"}, "route": {"const": "A"}}},
        {"properties": {"alias": {"const": "replacement"}, "route": {"const": "B"}}}
      ]
    },
    "owners": {
      "type": "object", "additionalProperties": false,
      "required": ["engineer", "operations", "budget"],
      "properties": {
        "engineer": {"type": "string", "minLength": 1, "maxLength": 120},
        "operations": {"type": "string", "minLength": 1, "maxLength": 120},
        "budget": {"type": "string", "minLength": 1, "maxLength": 120}
      }
    },
    "excluded_paths": {"type": "array", "minItems": 1, "maxItems": 20, "items": {"type": "string", "minLength": 1, "maxLength": 200}},
    "current_controls": {"type": "string", "minLength": 1, "maxLength": 1000}
  }
}
