{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/finchnode-com/json-schema/finchnode-com-conformance-run-schema.json",
  "title": "ConformanceRun",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/finchnode-com-api-openapi.yml#/components/schemas/ConformanceRun",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "object",
    "status",
    "phase",
    "scenario",
    "sync_mode",
    "instructions",
    "checks",
    "expires_at",
    "started_at",
    "completed_at",
    "verdict",
    "cancel_reason",
    "links"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^crun_[A-Za-z0-9_-]{16}$"
    },
    "object": {
      "type": "string",
      "const": "conformance_run"
    },
    "status": {
      "type": "string",
      "enum": [
        "awaiting_session",
        "running",
        "completed",
        "expired",
        "cancelled"
      ]
    },
    "phase": {
      "type": "string",
      "enum": [
        "session",
        "read",
        "pagination",
        "rate_limit",
        "update",
        "revoke",
        "probes",
        "complete"
      ]
    },
    "scenario": {
      "type": "string"
    },
    "sync_mode": {
      "type": "string",
      "enum": [
        "one-time",
        "continuous"
      ]
    },
    "run_key": {
      "type": "string",
      "pattern": "^ck_test_[A-Za-z0-9_-]+$",
      "description": "Only in the create response. A sandbox key whose requests are attributed to the run; revoked when the run ends."
    },
    "instructions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "step",
          "text"
        ],
        "properties": {
          "step": {
            "type": "integer",
            "minimum": 1
          },
          "text": {
            "type": "string"
          }
        }
      }
    },
    "checks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ConformanceCheck"
      }
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "started_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "verdict": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "pass",
        "fail",
        "incomplete",
        null
      ]
    },
    "cancel_reason": {
      "type": [
        "string",
        "null"
      ],
      "description": "Why a cancelled run ended: developer, app_not_sandbox, run_key_error, sandbox_limit_reached, sandbox_unavailable, or subject_error."
    },
    "links": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "self",
        "report"
      ],
      "properties": {
        "self": {
          "type": "string",
          "format": "uri"
        },
        "report": {
          "type": "string",
          "format": "uri",
          "description": "The public report; works without a key."
        }
      }
    }
  },
  "$defs": {
    "ConformanceCheck": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "title",
        "level",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "enum": [
            "session.created",
            "records.read",
            "records.pagination",
            "ratelimit.retry_after",
            "changes.incremental",
            "consent.fail_closed",
            "webhook.ack.valid",
            "webhook.ack.probe_control",
            "webhook.reject.invalid_signature",
            "webhook.reject.stale_timestamp",
            "webhook.replay.tolerated"
          ]
        },
        "title": {
          "type": "string"
        },
        "level": {
          "type": "string",
          "enum": [
            "MUST",
            "SHOULD"
          ],
          "description": "MUST checks decide the verdict; SHOULD checks are reported and never fail a run."
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "pass",
            "fail",
            "skipped",
            "inconclusive"
          ]
        },
        "evidence": {
          "type": "object",
          "description": "Counts, timings, status codes, and fixed codes; never a record.",
          "additionalProperties": {
            "type": [
              "number",
              "string",
              "boolean",
              "null"
            ]
          }
        },
        "reason": {
          "type": "string",
          "description": "Why a check failed, was skipped, or was inconclusive, as a fixed code."
        }
      }
    }
  }
}