{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://compatair.fr/schemas/ucp-compatibility-2026-07-15.json",
  "title": "CompatAir UCP read-only air compatibility capability",
  "$defs": {
    "CompressorReference": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9-]{1,160}$"
        },
        "compatair_id": {
          "type": "string",
          "pattern": "^ca:compressor:[a-z0-9-]{1,160}$"
        },
        "ean": {
          "type": "string",
          "pattern": "^\\d{8,14}$"
        },
        "mpn": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "reference": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://",
          "maxLength": 4096
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      },
      "oneOf": [
        {
          "required": [
            "id"
          ]
        },
        {
          "required": [
            "compatair_id"
          ]
        },
        {
          "required": [
            "ean"
          ]
        },
        {
          "required": [
            "mpn"
          ]
        },
        {
          "required": [
            "reference"
          ]
        },
        {
          "required": [
            "url"
          ]
        },
        {
          "required": [
            "name"
          ]
        }
      ],
      "additionalProperties": false
    },
    "ToolReference": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9-]{1,160}$"
        },
        "compatair_id": {
          "type": "string",
          "pattern": "^ca:tool:[a-z0-9-]{1,160}$"
        },
        "ean": {
          "type": "string",
          "pattern": "^\\d{8,14}$"
        },
        "mpn": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "reference": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://",
          "maxLength": 4096
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "quantity": {
          "type": "integer",
          "minimum": 1,
          "maximum": 20
        }
      },
      "oneOf": [
        {
          "required": [
            "id"
          ]
        },
        {
          "required": [
            "compatair_id"
          ]
        },
        {
          "required": [
            "ean"
          ]
        },
        {
          "required": [
            "mpn"
          ]
        },
        {
          "required": [
            "reference"
          ]
        },
        {
          "required": [
            "url"
          ]
        },
        {
          "required": [
            "name"
          ]
        }
      ],
      "additionalProperties": false
    },
    "EvaluationRequest": {
      "type": "object",
      "required": [
        "ucp",
        "configuration"
      ],
      "properties": {
        "ucp": {
          "type": "object",
          "required": [
            "version"
          ],
          "properties": {
            "version": {
              "const": "2026-04-08"
            }
          },
          "additionalProperties": false
        },
        "intent": {
          "enum": [
            "will_it_work",
            "explain_limits",
            "find_minimal_change",
            "build_complete_system"
          ]
        },
        "configuration": {
          "type": "object",
          "required": [
            "tools"
          ],
          "properties": {
            "compressor": {
              "$ref": "#/$defs/CompressorReference"
            },
            "tools": {
              "type": "array",
              "minItems": 1,
              "maxItems": 20,
              "items": {
                "$ref": "#/$defs/ToolReference"
              }
            },
            "mode": {
              "enum": [
                "successive",
                "simultaneous"
              ]
            }
          },
          "additionalProperties": false
        },
        "constraints": {
          "type": "object",
          "properties": {
            "max_total_minor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000000
            },
            "currency": {
              "const": "EUR"
            },
            "minimum_merchants": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10
            },
            "country": {
              "const": "FR"
            }
          },
          "additionalProperties": false
        },
        "requested_outputs": {
          "type": "array",
          "uniqueItems": true,
          "maxItems": 7,
          "items": {
            "enum": [
              "compatibility",
              "mandatory_accessories",
              "limits",
              "alternatives",
              "complete_configuration",
              "attribution",
              "evidence"
            ]
          }
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "intent": {
                "not": {
                  "const": "build_complete_system"
                }
              }
            }
          },
          "then": {
            "properties": {
              "configuration": {
                "required": [
                  "compressor"
                ]
              }
            }
          }
        }
      ],
      "additionalProperties": false
    },
    "McpArguments": {
      "type": "object",
      "required": [
        "meta",
        "ucp",
        "configuration"
      ],
      "properties": {
        "meta": {
          "type": "object",
          "required": [
            "ucp-agent"
          ],
          "properties": {
            "ucp-agent": {
              "type": "object",
              "required": [
                "profile"
              ],
              "properties": {
                "profile": {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^https://"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "ucp": {
          "$ref": "#/$defs/EvaluationRequest/properties/ucp"
        },
        "intent": {
          "$ref": "#/$defs/EvaluationRequest/properties/intent"
        },
        "configuration": {
          "type": "object",
          "required": [
            "tools"
          ],
          "properties": {
            "compressor": {
              "type": "object",
              "required": [
                "id"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z0-9-]{1,160}$"
                }
              },
              "additionalProperties": false
            },
            "tools": {
              "type": "array",
              "minItems": 1,
              "maxItems": 20,
              "items": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9-]{1,160}$"
                  }
                },
                "additionalProperties": false
              }
            },
            "mode": {
              "enum": [
                "successive",
                "simultaneous"
              ]
            }
          },
          "additionalProperties": false
        },
        "constraints": {
          "$ref": "#/$defs/EvaluationRequest/properties/constraints"
        },
        "requested_outputs": {
          "$ref": "#/$defs/EvaluationRequest/properties/requested_outputs"
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "intent": {
                "not": {
                  "const": "build_complete_system"
                }
              }
            }
          },
          "then": {
            "properties": {
              "configuration": {
                "required": [
                  "compressor"
                ]
              }
            }
          }
        }
      ],
      "additionalProperties": false
    },
    "ScopedVerdict": {
      "type": "object",
      "required": [
        "schema_version",
        "scope",
        "verdict",
        "limitations"
      ],
      "properties": {
        "schema_version": {
          "const": "2.0.0"
        },
        "scope": {
          "enum": [
            "air_supply",
            "complete_air_system",
            "commercial_constraints"
          ]
        },
        "verdict": {
          "enum": [
            "information",
            "compatible",
            "compatible_with_limits",
            "incompatible",
            "insufficient_data"
          ]
        },
        "engine_verdict": {
          "enum": [
            "continuous",
            "intermittent",
            "incompatible",
            "insufficient_data"
          ]
        },
        "limiting_factor": {
          "type": [
            "string",
            "null"
          ]
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "metrics": {
          "type": "object",
          "properties": {
            "required_fad_lpm": {
              "type": [
                "number",
                "null"
              ]
            },
            "available_fad_lpm": {
              "type": [
                "number",
                "null"
              ]
            },
            "effective_average_capacity_lpm": {
              "type": [
                "number",
                "null"
              ]
            },
            "required_pressure_bar": {
              "type": [
                "number",
                "null"
              ]
            },
            "available_pressure_bar": {
              "type": [
                "number",
                "null"
              ]
            },
            "demand_flow_lpm": {
              "type": [
                "number",
                "null"
              ]
            },
            "recommended_fad_lpm": {
              "type": [
                "number",
                "null"
              ]
            },
            "margin_percent": {
              "type": [
                "number",
                "null"
              ]
            },
            "mode": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ProductSummary": {
      "type": "object",
      "required": [
        "compat_air_id",
        "type",
        "id",
        "slug",
        "brand",
        "model",
        "canonical_url"
      ],
      "properties": {
        "compat_air_id": {
          "type": "string"
        },
        "type": {
          "enum": [
            "compressor",
            "tool"
          ]
        },
        "id": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "brand": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "mpn": {
          "type": "string"
        },
        "ean": {
          "type": "string"
        },
        "canonical_url": {
          "type": "string",
          "format": "uri"
        }
      },
      "additionalProperties": false
    },
    "Requirement": {
      "type": "object",
      "required": [
        "tool_id",
        "requirement"
      ],
      "properties": {
        "tool_id": {
          "type": "string"
        },
        "requirement": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "innerDiameterMm": {
                  "type": "number"
                },
                "maximumLengthMeters": {
                  "type": "number"
                }
              },
              "additionalProperties": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "Components": {
      "type": "object",
      "required": [
        "compressor",
        "tools",
        "hoses",
        "connectors",
        "filtration",
        "lubrication"
      ],
      "properties": {
        "compressor": {
          "oneOf": [
            {
              "$ref": "#/$defs/ProductSummary"
            },
            {
              "type": "null"
            }
          ]
        },
        "tools": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProductSummary"
          }
        },
        "hoses": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Requirement"
          }
        },
        "connectors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Requirement"
          }
        },
        "filtration": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Requirement"
          }
        },
        "lubrication": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Requirement"
          }
        }
      },
      "additionalProperties": false
    },
    "AirGraph": {
      "type": "object",
      "required": [
        "schema_version",
        "configuration_id",
        "nodes",
        "edges"
      ],
      "properties": {
        "schema_version": {
          "type": "string"
        },
        "configuration_id": {
          "type": "string"
        },
        "nodes": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "type"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "canonical_url": {
                "type": "string",
                "format": "uri"
              },
              "value": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "innerDiameterMm": {
                        "type": "number"
                      },
                      "maximumLengthMeters": {
                        "type": "number"
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              },
              "unit": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "edges": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "from",
              "to",
              "relation"
            ],
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              },
              "relation": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "Alternative": {
      "type": "object",
      "required": [
        "change",
        "compressor",
        "evaluation"
      ],
      "properties": {
        "change": {
          "type": "object",
          "required": [
            "field",
            "from",
            "to"
          ],
          "properties": {
            "field": {
              "const": "compressorId"
            },
            "from": {
              "type": "string"
            },
            "to": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "compressor": {
          "$ref": "#/$defs/ProductSummary"
        },
        "evaluation": {
          "type": "object",
          "required": [
            "verdict"
          ],
          "properties": {
            "verdict": {
              "enum": [
                "continuous",
                "intermittent",
                "incompatible",
                "insufficient_data"
              ]
            },
            "limitingFactor": {
              "type": "string"
            },
            "requiredPressureBar": {
              "type": "number"
            },
            "demandFlowLpm": {
              "type": "number"
            },
            "recommendedFadLpm": {
              "type": "number"
            },
            "availableFadLpm": {
              "type": "number"
            },
            "availableFadBasis": {
              "enum": [
                "exact",
                "interpolated",
                "higher-pressure-bound"
              ]
            },
            "availableFadReferencePressureBar": {
              "type": "number"
            },
            "effectiveAverageCapacityLpm": {
              "type": "number"
            },
            "limitations": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "mode": {
              "enum": [
                "successive",
                "simultaneous"
              ]
            }
          },
          "additionalProperties": false
        },
        "air_supply_verdict": {
          "$ref": "#/$defs/ScopedVerdict"
        }
      },
      "additionalProperties": false
    },
    "CompatibilityReceipt": {
      "type": "object",
      "required": [
        "schema_version",
        "receipt_id",
        "configuration_id",
        "overall_system_verdict",
        "air_supply_verdict",
        "method_version",
        "catalog_version",
        "observed_at",
        "canonical_url",
        "source_urls",
        "integrity",
        "verification_url"
      ],
      "properties": {
        "schema_version": {
          "const": "1.0.0"
        },
        "receipt_id": {
          "type": "string",
          "pattern": "^ca:receipt:[a-f0-9]{64}$"
        },
        "configuration_id": {
          "type": "string"
        },
        "overall_system_verdict": {
          "$ref": "#/$defs/ScopedVerdict"
        },
        "air_supply_verdict": {
          "$ref": "#/$defs/ScopedVerdict"
        },
        "method_version": {
          "const": "2026.07"
        },
        "catalog_version": {
          "type": "string"
        },
        "observed_at": {
          "type": "string",
          "format": "date"
        },
        "canonical_url": {
          "type": "string",
          "format": "uri"
        },
        "source_urls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "uniqueItems": true
        },
        "integrity": {
          "type": "object",
          "required": [
            "algorithm",
            "digest",
            "canonicalization"
          ],
          "properties": {
            "algorithm": {
              "const": "sha-256"
            },
            "digest": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            "canonicalization": {
              "const": "json-sort-keys-v1"
            }
          },
          "additionalProperties": false
        },
        "verification_url": {
          "type": "string",
          "format": "uri"
        }
      },
      "additionalProperties": false
    },
    "EvaluationResponse": {
      "type": "object",
      "required": [
        "ucp",
        "capability",
        "capability_version",
        "intent",
        "verdict",
        "verdict_scope",
        "verdict_schema_version",
        "overall_system_verdict",
        "air_supply_verdict",
        "canonical_url",
        "product_urls",
        "source_urls",
        "method_version",
        "catalog_version",
        "observed_at",
        "limitations",
        "next_actions",
        "security"
      ],
      "properties": {
        "ucp": {
          "type": "object",
          "required": [
            "version",
            "capabilities"
          ],
          "properties": {
            "version": {
              "const": "2026-04-08"
            },
            "capabilities": {
              "type": "object",
              "required": [
                "fr.compatair.air.compatibility"
              ],
              "properties": {
                "fr.compatair.air.compatibility": {
                  "type": "array",
                  "minItems": 1,
                  "maxItems": 1,
                  "items": {
                    "type": "object",
                    "required": [
                      "version"
                    ],
                    "properties": {
                      "version": {
                        "const": "2026-07-15"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "capability": {
          "const": "fr.compatair.air.compatibility"
        },
        "capability_version": {
          "const": "2026-07-15"
        },
        "intent": {
          "enum": [
            "will_it_work",
            "explain_limits",
            "find_minimal_change",
            "build_complete_system"
          ]
        },
        "verdict": {
          "enum": [
            "information",
            "compatible",
            "compatible_with_limits",
            "incompatible",
            "insufficient_data"
          ]
        },
        "verdict_scope": {
          "const": "complete_air_system"
        },
        "verdict_schema_version": {
          "const": "2.0.0"
        },
        "overall_system_verdict": {
          "$ref": "#/$defs/ScopedVerdict"
        },
        "air_supply_verdict": {
          "$ref": "#/$defs/ScopedVerdict"
        },
        "compatibility_receipt": {
          "$ref": "#/$defs/CompatibilityReceipt"
        },
        "canonical_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://compatair\\.fr/"
        },
        "product_urls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://compatair\\.fr/"
          },
          "uniqueItems": true
        },
        "source_urls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://"
          },
          "uniqueItems": true
        },
        "method_version": {
          "const": "2026.07"
        },
        "catalog_version": {
          "type": "string",
          "minLength": 1
        },
        "observed_at": {
          "type": "string",
          "format": "date"
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "next_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "catalogVersion": {
          "type": "string"
        },
        "engineVersion": {
          "type": "string"
        },
        "security": {
          "type": "object",
          "required": [
            "access",
            "accepts_pii",
            "accepts_payment",
            "mutates_commerce_state"
          ],
          "properties": {
            "access": {
              "const": "anonymous_read_only"
            },
            "accepts_pii": {
              "const": false
            },
            "accepts_payment": {
              "const": false
            },
            "mutates_commerce_state": {
              "const": false
            }
          },
          "additionalProperties": false
        },
        "compatibility": {
          "$ref": "#/$defs/ScopedVerdict"
        },
        "mandatory_accessories": {
          "type": "object",
          "required": [
            "hoses",
            "connectors",
            "filtration",
            "lubrication"
          ],
          "properties": {
            "hoses": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Requirement"
              }
            },
            "connectors": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Requirement"
              }
            },
            "filtration": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Requirement"
              }
            },
            "lubrication": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Requirement"
              }
            }
          },
          "additionalProperties": false
        },
        "limits": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "alternatives": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Alternative"
          }
        },
        "complete_configuration": {
          "$ref": "#/$defs/Components"
        },
        "configuration_id": {
          "type": "string",
          "pattern": "^ca:configuration:[a-f0-9]{24}$"
        },
        "airgraph": {
          "$ref": "#/$defs/AirGraph"
        },
        "attribution": {
          "type": "object",
          "required": [
            "provider",
            "canonical_url",
            "method_version"
          ],
          "properties": {
            "provider": {
              "const": "CompatAir"
            },
            "canonical_url": {
              "type": "string",
              "format": "uri",
              "pattern": "^https://compatair\\.fr/"
            },
            "method_version": {
              "const": "2026.07"
            }
          },
          "additionalProperties": false
        },
        "evidence_urls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "proof_urls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://compatair\\.fr/"
          },
          "uniqueItems": true
        },
        "commercial_constraints": {
          "type": "object",
          "required": [
            "requested",
            "verified",
            "verdict",
            "offer_snapshot_version",
            "covered_products",
            "merchant_count",
            "minimum_total_minor",
            "currency"
          ],
          "properties": {
            "requested": {
              "type": "object",
              "properties": {
                "max_total_minor": {
                  "type": "integer"
                },
                "currency": {
                  "const": "EUR"
                },
                "minimum_merchants": {
                  "type": "integer"
                },
                "country": {
                  "const": "FR"
                }
              },
              "additionalProperties": false
            },
            "verified": {
              "type": "boolean"
            },
            "verdict": {
              "$ref": "#/$defs/ScopedVerdict"
            },
            "offer_snapshot_version": {
              "type": [
                "string",
                "null"
              ]
            },
            "covered_products": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "merchant_count": {
              "type": "integer"
            },
            "minimum_total_minor": {
              "type": [
                "integer",
                "null"
              ]
            },
            "currency": {
              "const": "EUR"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ErrorResponse": {
      "type": "object",
      "required": [
        "ucp",
        "messages",
        "continue_url"
      ],
      "properties": {
        "ucp": {
          "type": "object",
          "required": [
            "version",
            "status",
            "capabilities"
          ],
          "properties": {
            "version": {
              "const": "2026-04-08"
            },
            "status": {
              "const": "error"
            },
            "capabilities": {
              "type": "object",
              "maxProperties": 0
            }
          },
          "additionalProperties": false
        },
        "messages": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": [
              "type",
              "code",
              "content",
              "severity"
            ],
            "properties": {
              "type": {
                "const": "error"
              },
              "code": {
                "type": "string"
              },
              "content": {
                "type": "string"
              },
              "severity": {
                "const": "unrecoverable"
              }
            },
            "additionalProperties": false
          }
        },
        "continue_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://compatair\\.fr/"
        }
      },
      "additionalProperties": false
    }
  }
}
