{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/SetupAgentsWorkflowEstimateResult",
  "definitions": {
    "SetupAgentsWorkflowEstimateResult": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "historicalStats": {
          "$ref": "#/definitions/HistoricalEstimateStats"
        },
        "record": {
          "$ref": "#/definitions/WorkflowEstimateRecord"
        },
        "file": {
          "type": "string"
        },
        "cwd": {
          "type": "string"
        }
      },
      "required": ["cwd", "file", "record"]
    },
    "HistoricalEstimateStats": {
      "type": "object",
      "properties": {
        "count": {
          "type": "number"
        },
        "medianSoloDays": {
          "type": ["number", "null"]
        },
        "medianAiGuidedDays": {
          "type": ["number", "null"]
        },
        "calibrationNote": {
          "type": ["string", "null"]
        }
      },
      "required": ["count", "medianSoloDays", "medianAiGuidedDays", "calibrationNote"],
      "additionalProperties": false
    },
    "WorkflowEstimateRecord": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "storyId": {
          "type": "string"
        },
        "sizingLabel": {
          "$ref": "#/definitions/WorkflowSizingLabel"
        },
        "soloEstimateDays": {
          "type": "number"
        },
        "aiUnguidedEstimateDays": {
          "type": "number"
        },
        "aiGuidedDays": {
          "type": "number"
        },
        "confidence": {
          "$ref": "#/definitions/WorkflowEstimateConfidence"
        },
        "declaredBy": {
          "type": "string"
        },
        "declaredAt": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "storyId",
        "sizingLabel",
        "soloEstimateDays",
        "aiUnguidedEstimateDays",
        "confidence",
        "declaredBy",
        "declaredAt"
      ],
      "additionalProperties": false
    },
    "WorkflowSizingLabel": {
      "type": "string",
      "enum": ["xxs", "xs", "s", "m", "l", "xl", "xxl"]
    },
    "WorkflowEstimateConfidence": {
      "type": "string",
      "enum": ["low", "medium", "high"]
    }
  }
}
