{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/novence-ai/json-schema/novence-ai-deployment-schema.json",
  "title": "Deployment",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/novence-ai-openapi.yml#/components/schemas/Deployment",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "description": "queued (waiting for a check runner) | checking (runner started) |\npromoting | live | failed. Legacy rows may say pending (= queued).\n"
    },
    "phase": {
      "type": "string",
      "enum": [
        "queued",
        "checking",
        "promoting",
        "live",
        "failed"
      ]
    },
    "queuePosition": {
      "type": [
        "integer",
        "null"
      ],
      "description": "1-based place in the check queue while `status` is `queued`"
    },
    "recommendedPollSeconds": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Suggested delay before the next poll (15 while queued, 5 while checking/promoting); null when live or failed"
    },
    "checksResults": {
      "allOf": [
        {
          "$ref": "#/$defs/ChecksResults"
        }
      ],
      "nullable": true
    },
    "checksUrl": {
      "type": "string"
    },
    "errorMessage": {
      "type": [
        "string",
        "null"
      ]
    },
    "previewUrl": {
      "type": "string",
      "format": "uri",
      "description": "Per-deploy alias on Pro/Scale (`https://{suffix}--{ref}.novence.ai/`).\nOn Free this is the live host.\n"
    },
    "liveUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "source": {
      "allOf": [
        {
          "$ref": "#/$defs/DeploySource"
        }
      ],
      "nullable": true
    },
    "queuedRedeploy": {
      "type": "boolean",
      "description": "True while a newer deploy is waiting for this one to settle. A deployment\nwith a different id follows; keep polling `…/deployments/latest`.\n"
    }
  },
  "$defs": {
    "ChecksResults": {
      "type": "object",
      "description": "Quality-gate payload. When `skipped` is true (unverified accounts),\n`passed` is null — do not treat that as checks having passed.\n",
      "properties": {
        "passed": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "skipped": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        },
        "deploymentId": {
          "type": "string",
          "format": "uuid",
          "description": "The deployment these results were measured from."
        },
        "measurementError": {
          "type": "string",
          "description": "Why Lighthouse could not score the page. The deploy fails and `lighthouse` is null."
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Non-blocking findings, e.g. Lighthouse performance below threshold while `enforcePerformance` is false."
        },
        "lighthouse": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "performance": {
              "type": "number"
            },
            "accessibility": {
              "type": "number"
            },
            "bestPractices": {
              "type": "number"
            },
            "seo": {
              "type": "number"
            }
          }
        }
      }
    },
    "DeploySource": {
      "type": "object",
      "description": "Where a deployment came from",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "api",
            "cli",
            "mcp",
            "sdk",
            "github-actions"
          ]
        },
        "repository": {
          "type": "string"
        },
        "ref": {
          "type": "string"
        },
        "sha": {
          "type": "string"
        },
        "message": {
          "type": "string",
          "description": "First line of the commit message"
        },
        "actor": {
          "type": "string"
        },
        "runUrl": {
          "type": "string",
          "format": "uri"
        },
        "verified": {
          "type": "boolean",
          "description": "True when the git fields were read from a GitHub OIDC token"
        }
      }
    }
  }
}