{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/turbometrics-io/json-schema/turbometrics-io-attribution-schema.json",
  "title": "Attribution",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/turbometrics-io-openapi.json#/components/schemas/Attribution",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "started_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "confidence": {
      "type": "string",
      "enum": [
        "high",
        "medium",
        "low"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "recovered"
      ]
    },
    "sentence": {
      "type": "string"
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "metric": {
            "type": "string",
            "enum": [
              "lcp",
              "fcp",
              "ttfb",
              "tbt",
              "cls",
              "inp",
              "score",
              "js_errors"
            ]
          },
          "device": {
            "type": "string",
            "enum": [
              "mobile",
              "desktop",
              "all"
            ]
          },
          "before": {
            "type": [
              "number",
              "null"
            ]
          },
          "after": {
            "type": [
              "number",
              "null"
            ]
          },
          "change_pct": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      }
    },
    "suspects": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "change_id": {
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "component": {
            "type": [
              "string",
              "null"
            ]
          },
          "from": {
            "type": [
              "string",
              "null"
            ]
          },
          "to": {
            "type": [
              "string",
              "null"
            ]
          },
          "occurred_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      }
    },
    "compare": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "before_scan_id": {
          "type": "string"
        },
        "after_scan_id": {
          "type": "string"
        }
      }
    }
  }
}