{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudworldmodel-ai/json-schema/cloudworldmodel-ai-provider-api-scheduler-result-schema.json",
  "title": "ProviderApiSchedulerResult",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudworldmodel-ai-agent-x402-openapi.yml#/components/schemas/ProviderApiSchedulerResult",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schedulerVersion",
    "contractVersion",
    "status",
    "seed",
    "concurrency",
    "policyResolutions",
    "unsupportedGroups",
    "accounting",
    "byCategory",
    "operations",
    "queue",
    "timing",
    "retryBehavior",
    "optimization"
  ],
  "properties": {
    "schedulerVersion": {
      "type": "integer",
      "enum": [
        1
      ]
    },
    "contractVersion": {
      "type": "integer",
      "minimum": 1
    },
    "status": {
      "type": "string",
      "enum": [
        "supported",
        "unsupported_policy",
        "rejected"
      ]
    },
    "seed": {
      "type": "integer",
      "minimum": 0,
      "maximum": 4294967295
    },
    "concurrency": {
      "type": "integer",
      "minimum": 1
    },
    "policyResolutions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ProviderApiLimitResolution"
      }
    },
    "unsupportedGroups": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "operationCategory",
          "operation",
          "reason"
        ],
        "properties": {
          "operationCategory": {
            "type": "string"
          },
          "operation": {
            "type": "string"
          },
          "resource": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      }
    },
    "accounting": {
      "$ref": "#/$defs/ProviderApiSchedulerAccounting"
    },
    "byCategory": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "#/$defs/ProviderApiSchedulerAccounting"
          },
          {
            "type": "object",
            "required": [
              "category"
            ],
            "properties": {
              "category": {
                "type": "string"
              }
            }
          }
        ]
      }
    },
    "operations": {
      "type": "array",
      "maxItems": 100000,
      "description": "Per-unit outcomes. Empty when the workload has more than 1,000\nplanned operations; use the accounting and timing summaries in\nthat case.\n",
      "items": {
        "$ref": "#/$defs/ProviderApiUnitOutcome"
      }
    },
    "outputDetail": {
      "type": "string",
      "enum": [
        "full",
        "summary_only"
      ],
      "description": "Optional detail marker. `summary_only` is returned when more than\n1,000 planned operations cause `operations` to be empty. `full`\ndenotes itemized operation output when explicitly present;\nomission also means full itemized output.\n"
    },
    "queue": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "currentDepth",
        "peakDepth",
        "backpressureEvents"
      ],
      "properties": {
        "currentDepth": {
          "type": "integer",
          "minimum": 0
        },
        "peakDepth": {
          "type": "integer",
          "minimum": 0
        },
        "backpressureEvents": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "timing": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "completionTimeMs",
        "terminalCompletionTimeMs",
        "successfulCompletionTimeMs",
        "completionRatio",
        "effectiveThroughputPerSecond",
        "totalQueueWaitMs",
        "totalServiceTimeMs"
      ],
      "properties": {
        "completionTimeMs": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "terminalCompletionTimeMs": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "successfulCompletionTimeMs": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "completionRatio": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "effectiveThroughputPerSecond": {
          "type": "number",
          "minimum": 0
        },
        "totalQueueWaitMs": {
          "type": "number",
          "minimum": 0
        },
        "totalServiceTimeMs": {
          "type": "number",
          "minimum": 0
        }
      }
    },
    "retryBehavior": {
      "$ref": "#/$defs/ProviderApiRetryBehavior"
    },
    "optimization": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "objective",
        "maxThrottleRate",
        "acceptableConcurrency",
        "recommendedConcurrency",
        "optimalConcurrencyRange",
        "comparisons"
      ],
      "properties": {
        "objective": {
          "type": "string"
        },
        "maxThrottleRate": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "acceptableConcurrency": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 1
          }
        },
        "recommendedConcurrency": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1,
          "description": "Deterministic recommended candidate. Null when no candidate is\nsupported, fully completes, and stays within maxThrottleRate.\n"
        },
        "optimalConcurrencyRange": {
          "type": [
            "object",
            "null"
          ],
          "required": [
            "min",
            "max"
          ],
          "properties": {
            "min": {
              "type": "integer",
              "minimum": 1
            },
            "max": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "comparisons": {
          "type": "array",
          "maxItems": 16,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "concurrency",
              "status",
              "plannedOperations",
              "attemptedOperations",
              "completedOperations",
              "completionTimeMs",
              "terminalCompletionTimeMs",
              "successfulCompletionTimeMs",
              "completionRatio",
              "effectiveThroughputPerSecond",
              "throttledOperations",
              "retryOperations",
              "failedOperations",
              "timedOutOperations",
              "dependencyBlockedOperations",
              "unsupportedOperations",
              "pendingOperations",
              "terminalOperations",
              "queuePeak",
              "objectiveValue"
            ],
            "properties": {
              "concurrency": {
                "type": "integer",
                "minimum": 1
              },
              "status": {
                "type": "string",
                "enum": [
                  "supported",
                  "unsupported_policy",
                  "rejected"
                ]
              },
              "plannedOperations": {
                "type": "integer",
                "minimum": 0
              },
              "attemptedOperations": {
                "type": "integer",
                "minimum": 0
              },
              "completedOperations": {
                "type": "integer",
                "minimum": 0
              },
              "completionTimeMs": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              },
              "terminalCompletionTimeMs": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              },
              "successfulCompletionTimeMs": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              },
              "completionRatio": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "effectiveThroughputPerSecond": {
                "type": "number",
                "minimum": 0
              },
              "throttledOperations": {
                "type": "integer",
                "minimum": 0
              },
              "retryOperations": {
                "type": "integer",
                "minimum": 0
              },
              "failedOperations": {
                "type": "integer",
                "minimum": 0
              },
              "timedOutOperations": {
                "type": "integer",
                "minimum": 0
              },
              "dependencyBlockedOperations": {
                "type": "integer",
                "minimum": 0
              },
              "unsupportedOperations": {
                "type": "integer",
                "minimum": 0
              },
              "pendingOperations": {
                "type": "integer",
                "minimum": 0
              },
              "terminalOperations": {
                "type": "integer",
                "minimum": 0
              },
              "queuePeak": {
                "type": "integer",
                "minimum": 0
              },
              "objectiveValue": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              }
            }
          }
        }
      }
    },
    "reason": {
      "type": "string",
      "minLength": 1
    }
  },
  "$defs": {
    "ProviderApiBurstCapacity": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "capacity",
        "unit",
        "windowSeconds",
        "refill"
      ],
      "properties": {
        "capacity": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1000000000
        },
        "unit": {
          "type": "string",
          "enum": [
            "requests_per_second",
            "requests_per_minute",
            "requests_per_hour",
            "requests_per_window",
            "operations_per_second",
            "operations_per_minute",
            "operations_per_window",
            "concurrent_requests"
          ]
        },
        "windowSeconds": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 86400
        },
        "refill": {
          "type": "string",
          "enum": [
            "none",
            "fixed_window",
            "token_bucket"
          ]
        },
        "refillRate": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1000000000
        }
      }
    },
    "ProviderApiLimitResolution": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "contractVersion",
        "status",
        "accounting"
      ],
      "properties": {
        "contractVersion": {
          "type": "integer",
          "enum": [
            1
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "supported",
            "unsupported"
          ]
        },
        "operationCategory": {
          "type": "string",
          "enum": [
            "compute",
            "database",
            "storage",
            "network",
            "kubernetes",
            "identity",
            "monitoring",
            "quota",
            "other"
          ]
        },
        "operation": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "resource": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "policySource": {
          "type": "string",
          "enum": [
            "catalog_default",
            "caller_override"
          ]
        },
        "policy": {
          "$ref": "#/$defs/ProviderApiQuotaPolicy"
        },
        "reason": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "accounting": {
          "$ref": "#/$defs/ProviderApiOperationAccounting"
        }
      }
    },
    "ProviderApiOperationAccounting": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "plannedOperations",
        "attemptedOperations",
        "retryOperations",
        "throttledOperations",
        "completedOperations",
        "denominator"
      ],
      "properties": {
        "plannedOperations": {
          "type": "integer",
          "minimum": 0
        },
        "attemptedOperations": {
          "type": "integer",
          "minimum": 0
        },
        "retryOperations": {
          "type": "integer",
          "minimum": 0
        },
        "throttledOperations": {
          "type": "integer",
          "minimum": 0
        },
        "completedOperations": {
          "type": "integer",
          "minimum": 0
        },
        "denominator": {
          "type": "string",
          "enum": [
            "planned_operations"
          ]
        }
      }
    },
    "ProviderApiQuotaPolicy": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "policyId",
        "provider",
        "service",
        "operationCategory",
        "operation",
        "scope",
        "classification",
        "provenance",
        "enforcement",
        "notes"
      ],
      "properties": {
        "policyId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "provider": {
          "type": "string",
          "enum": [
            "aws",
            "gcp",
            "azure",
            "oci",
            "digitalocean"
          ]
        },
        "service": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "operationCategory": {
          "type": "string",
          "enum": [
            "compute",
            "database",
            "storage",
            "network",
            "kubernetes",
            "identity",
            "monitoring",
            "quota",
            "other"
          ]
        },
        "operation": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "scope": {
          "$ref": "#/$defs/ProviderApiQuotaScope"
        },
        "classification": {
          "type": "string",
          "enum": [
            "documented_public_default",
            "configurable_account_quota",
            "observed_behavior"
          ]
        },
        "provenance": {
          "$ref": "#/$defs/ProviderApiQuotaProvenance"
        },
        "sustainedRate": {
          "$ref": "#/$defs/ProviderApiRateQuantity"
        },
        "burstCapacity": {
          "$ref": "#/$defs/ProviderApiBurstCapacity"
        },
        "concurrencyCeiling": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000
        },
        "concurrencyOverflow": {
          "type": "string",
          "enum": [
            "queue",
            "reject"
          ],
          "description": "Optional concurrency-ceiling overflow behavior. Absent retains the existing reject behavior; queue waits for an in-process request to finish."
        },
        "enforcement": {
          "type": "string",
          "enum": [
            "token_bucket",
            "fixed_window",
            "sliding_window",
            "concurrency_ceiling",
            "provider_defined"
          ]
        },
        "notes": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        }
      }
    },
    "ProviderApiQuotaProvenance": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "sourceKind",
        "sourceReference",
        "asOfDate",
        "customerSpecific",
        "observed",
        "confidence"
      ],
      "properties": {
        "sourceKind": {
          "type": "string",
          "enum": [
            "provider_documentation",
            "provider_quota_documentation",
            "provider_observation",
            "caller_supplied"
          ]
        },
        "sourceReference": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "asOfDate": {
          "type": "string",
          "format": "date"
        },
        "customerSpecific": {
          "type": "boolean"
        },
        "observed": {
          "type": "boolean"
        },
        "confidence": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high"
          ]
        }
      }
    },
    "ProviderApiQuotaScope": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "account": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "subscription": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "project": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "servicePrincipal": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "region": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "zone": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "resource": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "service": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "operation": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      }
    },
    "ProviderApiRateQuantity": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "limit",
        "unit",
        "windowSeconds"
      ],
      "properties": {
        "limit": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1000000000
        },
        "unit": {
          "type": "string",
          "enum": [
            "requests_per_second",
            "requests_per_minute",
            "requests_per_hour",
            "requests_per_window",
            "operations_per_second",
            "operations_per_minute",
            "operations_per_window",
            "concurrent_requests"
          ]
        },
        "windowSeconds": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 86400
        }
      }
    },
    "ProviderApiRetryBehavior": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "source",
        "selectedProfile",
        "mode",
        "serviceDefault",
        "mechanics",
        "adaptiveRateLimiterModeled",
        "historicalRunsRewritten",
        "maxAttempts",
        "retryable",
        "generic",
        "transientBaseDelayMs",
        "throttlingBaseDelayMs",
        "retryTokenCapacity",
        "transientRetryTokenCost",
        "throttlingRetryTokenCost",
        "maxBackoffCapMs",
        "retryAfterMaxExtraMs",
        "rolloutNote",
        "clientBudgets"
      ],
      "description": "Resolved retry contract. It is distinct from provider quota-policy resolution.",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "aws_sdk_profile",
            "caller_override",
            "caller_generic",
            "legacy_generic"
          ]
        },
        "selectedProfile": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "aws-js-v3-standard-pre-2026",
            "aws-js-v3-standard-2026"
          ]
        },
        "mode": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "standard",
            "adaptive"
          ]
        },
        "serviceDefault": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "dynamodb"
          ]
        },
        "mechanics": {
          "type": "string",
          "enum": [
            "aws_shared_retry_layer",
            "caller_generic"
          ]
        },
        "adaptiveRateLimiterModeled": {
          "type": "boolean",
          "enum": [
            false
          ]
        },
        "historicalRunsRewritten": {
          "type": "boolean",
          "enum": [
            false
          ]
        },
        "maxAttempts": {
          "type": "integer",
          "minimum": 1
        },
        "retryable": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "throttled",
              "timeout",
              "server_error"
            ]
          }
        },
        "generic": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "required": [
            "baseBackoffMs",
            "maxBackoffMs",
            "backoffMultiplier",
            "jitterRatio"
          ],
          "properties": {
            "baseBackoffMs": {
              "type": "number",
              "minimum": 0
            },
            "maxBackoffMs": {
              "type": "number",
              "minimum": 0
            },
            "backoffMultiplier": {
              "type": "number",
              "minimum": 1
            },
            "jitterRatio": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          }
        },
        "transientBaseDelayMs": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "throttlingBaseDelayMs": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "retryTokenCapacity": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1
        },
        "transientRetryTokenCost": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1
        },
        "throttlingRetryTokenCost": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1
        },
        "maxBackoffCapMs": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "retryAfterMaxExtraMs": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "rolloutNote": {
          "type": [
            "string",
            "null"
          ]
        },
        "clientBudgets": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "clientId",
              "capacity",
              "remaining",
              "retriesDenied",
              "tokensConsumed",
              "tokensRestored",
              "tokensSpent"
            ],
            "properties": {
              "clientId": {
                "type": "string"
              },
              "capacity": {
                "type": "integer",
                "minimum": 1
              },
              "remaining": {
                "type": "integer",
                "minimum": 0
              },
              "retriesDenied": {
                "type": "integer",
                "minimum": 0
              },
              "tokensConsumed": {
                "type": "integer",
                "minimum": 0
              },
              "tokensRestored": {
                "type": "integer",
                "minimum": 0
              },
              "tokensSpent": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        }
      }
    },
    "ProviderApiSchedulerAccounting": {
      "allOf": [
        {
          "$ref": "#/$defs/ProviderApiOperationAccounting"
        },
        {
          "type": "object",
          "required": [
            "failedOperations",
            "timedOutOperations",
            "dependencyBlockedOperations",
            "unsupportedOperations",
            "pendingOperations",
            "terminalOperations"
          ],
          "properties": {
            "failedOperations": {
              "type": "integer",
              "minimum": 0
            },
            "timedOutOperations": {
              "type": "integer",
              "minimum": 0
            },
            "dependencyBlockedOperations": {
              "type": "integer",
              "minimum": 0
            },
            "unsupportedOperations": {
              "type": "integer",
              "minimum": 0
            },
            "pendingOperations": {
              "type": "integer",
              "minimum": 0
            },
            "terminalOperations": {
              "type": "integer",
              "minimum": 0
            }
          }
        }
      ]
    },
    "ProviderApiUnitOutcome": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "operationId",
        "operation",
        "category",
        "unitIndex",
        "outcome",
        "attempts",
        "retryOperations",
        "throttledAttempts",
        "timedOutAttempts",
        "readyAtMs",
        "terminalAtMs",
        "queueWaitMs",
        "throttleWaitMs",
        "retryBackoffMs",
        "serviceTimeMs"
      ],
      "properties": {
        "operationId": {
          "type": "string"
        },
        "operation": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "resource": {
          "type": "string"
        },
        "unitIndex": {
          "type": "integer",
          "minimum": 0
        },
        "outcome": {
          "type": "string",
          "enum": [
            "completed",
            "failed",
            "timed_out",
            "dependency_blocked",
            "unsupported_policy"
          ]
        },
        "attempts": {
          "type": "integer",
          "minimum": 0
        },
        "retryOperations": {
          "type": "integer",
          "minimum": 0
        },
        "throttledAttempts": {
          "type": "integer",
          "minimum": 0
        },
        "timedOutAttempts": {
          "type": "integer",
          "minimum": 0
        },
        "readyAtMs": {
          "type": "number",
          "minimum": 0
        },
        "firstAttemptAtMs": {
          "type": "number",
          "minimum": 0
        },
        "terminalAtMs": {
          "type": "number",
          "minimum": 0
        },
        "queueWaitMs": {
          "type": "number",
          "minimum": 0
        },
        "throttleWaitMs": {
          "type": "number",
          "minimum": 0
        },
        "retryBackoffMs": {
          "type": "number",
          "minimum": 0
        },
        "serviceTimeMs": {
          "type": "number",
          "minimum": 0
        }
      }
    }
  }
}