{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/3.1.0-beta.2/property/property-feature-definition.json",
  "title": "Property Feature Definition",
  "description": "Defines a feature that a governance agent can evaluate for properties. Used in get_adcp_capabilities to advertise agent capabilities.",
  "type": "object",
  "properties": {
    "feature_id": {
      "type": "string",
      "description": "Unique identifier for this feature (e.g., 'consent_quality', 'carbon_score'). Features prefixed with 'registry:' reference standardized policies from the shared policy registry (e.g., 'registry:us_coppa', 'registry:uk_hfss'). Unprefixed feature IDs are agent-defined."
    },
    "name": {
      "type": "string",
      "description": "Human-readable name for the feature"
    },
    "description": {
      "type": "string",
      "description": "Description of what this feature measures or represents"
    },
    "type": {
      "type": "string",
      "enum": ["binary", "quantitative", "categorical"],
      "description": "The type of values this feature produces: binary (true/false), quantitative (numeric range), categorical (enumerated values)"
    },
    "range": {
      "type": "object",
      "description": "For quantitative features, the valid range of values",
      "properties": {
        "min": {
          "type": "number",
          "description": "Minimum value"
        },
        "max": {
          "type": "number",
          "description": "Maximum value"
        }
      },
      "required": ["min", "max"],
      "additionalProperties": false
    },
    "allowed_values": {
      "type": "array",
      "description": "For categorical features, the set of valid values",
      "items": {
        "type": "string"
      }
    },
    "coverage": {
      "type": "object",
      "description": "What this feature covers (empty arrays = all)",
      "properties": {
        "property_types": {
          "type": "array",
          "description": "Property types this feature applies to",
          "items": {
            "type": "string"
          }
        },
        "countries": {
          "type": "array",
          "description": "Countries where this feature is available",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "methodology_url": {
      "type": "string",
      "format": "uri",
      "description": "URL to documentation explaining how this feature is calculated/measured"
    },
    "methodology_version": {
      "type": "string",
      "description": "Version identifier for the methodology (for audit trails)"
    },
    "ext": {
      "$ref": "/schemas/3.1.0-beta.2/core/ext.json"
    }
  },
  "required": ["feature_id", "name", "type", "methodology_url"],
  "additionalProperties": false
}
