{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/3.1.0-beta.2/creative/creative-feature-result.json",
  "title": "Creative Feature Result",
  "description": "A single feature evaluation result for a creative. Uses the same value structure as property-feature-value (value, confidence, expires_at, etc.).",
  "type": "object",
  "properties": {
    "feature_id": {
      "type": "string",
      "description": "The feature that was evaluated (e.g., 'auto_redirect', 'brand_consistency'). Features prefixed with 'registry:' reference standardized policies from the shared policy registry (e.g., 'registry:eu_ai_act_article_50'). Unprefixed feature IDs are agent-defined."
    },
    "value": {
      "description": "The feature value. Type depends on feature definition: boolean for binary, number for quantitative, string for categorical.",
      "oneOf": [
        { "type": "boolean" },
        { "type": "number" },
        { "type": "string" }
      ]
    },
    "unit": {
      "type": "string",
      "description": "Unit of measurement for quantitative values (e.g., 'percentage', 'score')"
    },
    "confidence": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "description": "Confidence score for this value (0-1)"
    },
    "measured_at": {
      "type": "string",
      "format": "date-time",
      "description": "When this feature was evaluated"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "When this evaluation expires and should be refreshed"
    },
    "methodology_version": {
      "type": "string",
      "description": "Version of the methodology used to evaluate this feature"
    },
    "details": {
      "type": "object",
      "description": "Additional vendor-specific details about this evaluation",
      "additionalProperties": true
    },
    "policy_id": {
      "type": "string",
      "description": "Optional attribution — when this feature was evaluated for the purpose of a specific policy, policy_id references the authorizing PolicyEntry. Creative agents and sellers populate when the measurement was motivated by a specific policy; do NOT populate when the feature is a generic measurement (carbon score, brand consistency) unrelated to any policy. See /docs/governance/policy-attribution.",
      "$comment": "x-entity deliberately omitted — a PolicyEntry reference can resolve to either a governance_registry_policy or a governance_inline_policy depending on the authorizing entry's source. See issue #2685."
    },
    "ext": {
      "$ref": "/schemas/3.1.0-beta.2/core/ext.json"
    }
  },
  "required": ["feature_id", "value"],
  "additionalProperties": false
}
