{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentdeals-dev/json-schema/agentdeals-dev-deal-change-schema.json",
  "title": "DealChange",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentdeals-dev-openapi.json#/components/schemas/DealChange",
  "type": "object",
  "properties": {
    "vendor": {
      "type": "string"
    },
    "change_type": {
      "type": "string",
      "enum": [
        "free_tier_removed",
        "open_source_killed",
        "product_deprecated",
        "limits_reduced",
        "restriction",
        "pricing_restructured",
        "pricing_model_change",
        "limits_increased",
        "new_free_tier",
        "new_tier",
        "startup_program_expanded",
        "pricing_postponed",
        "rebranded",
        "record_corrected"
      ]
    },
    "reports": {
      "type": "string",
      "enum": [
        "vendor_offer",
        "our_index"
      ],
      "description": "What the record is about. 'vendor_offer' — the vendor changed its own offer, and a vendor page is where that can be read. 'our_index' — we changed what we list while the vendor's offer stood still, so no vendor page evidences it and the record carries no source_url. Absent means vendor_offer. Filter these out of any figure you present as vendor market activity."
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "summary": {
      "type": "string"
    },
    "previous_state": {
      "type": "string"
    },
    "current_state": {
      "type": "string"
    },
    "tier_direction": {
      "type": "string",
      "enum": [
        "narrowed",
        "unchanged",
        "widened"
      ],
      "description": "Whether the tier we list is worse, the same, or better under current_state than it was under previous_state, judged with both in hand rather than read off change_type. Where it says the tier did not get worse we publish the record and take no risk verdict from it. Absent means we have not judged this record."
    },
    "impact": {
      "type": "string",
      "enum": [
        "high",
        "medium",
        "low"
      ]
    },
    "source_url": {
      "type": "string",
      "format": "uri"
    },
    "category": {
      "type": "string"
    },
    "alternatives": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "resolution": {
      "$ref": "#/$defs/ChangeResolution"
    }
  },
  "required": [
    "vendor",
    "change_type",
    "date",
    "summary",
    "previous_state",
    "current_state",
    "impact",
    "source_url",
    "category",
    "alternatives"
  ],
  "$defs": {
    "ChangeResolution": {
      "type": [
        "object",
        "null"
      ],
      "description": "Present when the change this record describes is no longer in force. state is 'reversed' when the vendor ended it and 'retracted' when the record was our error. date is the day from which it stopped being in force, or the day we established that, whichever we can source. resolved_by names the change record that ended it, when one exists. A record carrying this field never rates the vendor.",
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "reversed",
            "retracted"
          ]
        },
        "date": {
          "type": "string",
          "format": "date"
        },
        "detail": {
          "type": "string"
        },
        "source_url": {
          "type": "string",
          "format": "uri"
        },
        "resolved_by": {
          "type": "object",
          "properties": {
            "vendor": {
              "type": "string"
            },
            "date": {
              "type": "string",
              "format": "date"
            },
            "change_type": {
              "type": "string"
            }
          }
        }
      },
      "required": [
        "state",
        "date"
      ]
    }
  }
}