{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/SetupAgentsWorkflowPhasePlanResult",
  "definitions": {
    "SetupAgentsWorkflowPhasePlanResult": {
      "type": "object",
      "properties": {
        "plan": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PhasePlanEntry"
          }
        },
        "skipped": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "phase": {
                "$ref": "#/definitions/WorkflowPhase"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": ["phase", "reason"],
            "additionalProperties": false
          }
        },
        "gates": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "cwd": {
          "type": "string"
        }
      },
      "required": ["plan", "skipped", "gates", "cwd"],
      "additionalProperties": false
    },
    "PhasePlanEntry": {
      "type": "object",
      "properties": {
        "phase": {
          "$ref": "#/definitions/WorkflowPhase"
        },
        "profile": {
          "type": "string"
        },
        "source": {
          "type": "string",
          "enum": ["always", "role-required", "role-optional", "profile-trigger", "override-add", "declared"]
        },
        "gateAfter": {
          "type": "boolean"
        },
        "overrideApplied": {
          "$ref": "#/definitions/PhaseOverrideAction"
        }
      },
      "required": ["phase", "profile", "source", "gateAfter"],
      "additionalProperties": false
    },
    "WorkflowPhase": {
      "type": "string",
      "enum": ["pm", "ba", "architect", "ux", "developer", "security-review", "qa", "document-review", "release"]
    },
    "PhaseOverrideAction": {
      "type": "string",
      "enum": ["skip", "add", "require-gate", "remove-gate"]
    }
  }
}
