{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/SetupAgentsWorkflowBenchmarkResult",
  "definitions": {
    "SetupAgentsWorkflowBenchmarkResult": {
      "type": "object",
      "properties": {
        "result": {
          "$ref": "#/definitions/WorkflowBenchmarkResult"
        },
        "summary": {
          "$ref": "#/definitions/WorkflowBenchmarkSummary"
        },
        "file": {
          "type": "string"
        },
        "cwd": {
          "type": "string"
        }
      },
      "required": ["file", "cwd"],
      "additionalProperties": false
    },
    "WorkflowBenchmarkResult": {
      "type": "object",
      "properties": {
        "storyId": {
          "type": "string"
        },
        "sizingLabel": {
          "$ref": "#/definitions/WorkflowSizingLabel"
        },
        "soloEstimateDays": {
          "type": "number"
        },
        "aiUnguidedEstimateDays": {
          "type": "number"
        },
        "aiGuidedDays": {
          "type": ["number", "null"]
        },
        "actualDays": {
          "type": ["number", "null"]
        },
        "actualSource": {
          "$ref": "#/definitions/WorkflowBenchmarkActualSource"
        },
        "vsSoloPct": {
          "type": ["number", "null"]
        },
        "vsAiUnguidedPct": {
          "type": ["number", "null"]
        },
        "vsAiGuidedPct": {
          "type": ["number", "null"]
        },
        "qaIterations": {
          "type": "number"
        },
        "evidenceCount": {
          "type": "number"
        },
        "status": {
          "type": "string",
          "enum": ["pending", "complete"]
        }
      },
      "required": [
        "storyId",
        "sizingLabel",
        "soloEstimateDays",
        "aiUnguidedEstimateDays",
        "aiGuidedDays",
        "actualDays",
        "actualSource",
        "vsSoloPct",
        "vsAiUnguidedPct",
        "vsAiGuidedPct",
        "qaIterations",
        "evidenceCount",
        "status"
      ],
      "additionalProperties": false
    },
    "WorkflowSizingLabel": {
      "type": "string",
      "enum": ["xxs", "xs", "s", "m", "l", "xl", "xxl"]
    },
    "WorkflowBenchmarkActualSource": {
      "type": ["string", "null"],
      "enum": ["phase-timeline", "task-lifecycle", null]
    },
    "WorkflowBenchmarkSummary": {
      "type": "object",
      "properties": {
        "stories": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/WorkflowBenchmarkResult"
          }
        },
        "totalWithActuals": {
          "type": "number"
        },
        "avgVsSoloPct": {
          "type": ["number", "null"]
        },
        "avgVsAiUnguidedPct": {
          "type": ["number", "null"]
        },
        "avgVsAiGuidedPct": {
          "type": ["number", "null"]
        }
      },
      "required": ["stories", "totalWithActuals", "avgVsSoloPct", "avgVsAiUnguidedPct", "avgVsAiGuidedPct"],
      "additionalProperties": false
    }
  }
}
