groups:
  - id: registry.feature_flag
    type: attribute_group
    stability: experimental
    display_name: Feature Flag Attributes
    brief: >
        This document defines attributes for Feature Flags.
    attributes:
      - id: feature_flag.key
        type: string
        stability: experimental
        brief: The lookup key of the feature flag.
        examples: ["logo-color"]
      - id: feature_flag.provider_name
        type: string
        stability: experimental
        brief: Identifies the feature flag provider.
        examples: ["Flag Manager"]
      - id: feature_flag.variant
        type: string
        stability: experimental
        examples: ["red", "true", "on"]
        brief: >
          A semantic identifier for an evaluated flag value.
        note: |-
          A semantic identifier, commonly referred to as a variant, provides a means
          for referring to a value without including the value itself. This can
          provide additional context for understanding the meaning behind a value.
          For example, the variant `red` maybe be used for the value `#c05543`.
      - id: feature_flag.context.id
        type: string
        stability: experimental
        examples: ["5157782b-2203-4c80-a857-dbbd5e7761db"]
        brief: >
          The unique identifier for the flag evaluation context. For example, the targeting key.
      - id: feature_flag.version
        type: string
        stability: experimental
        examples: ["1", "01ABCDEF"]
        brief: >
          The version of the ruleset used during the evaluation. This may be any stable value which uniquely identifies the ruleset.
      - id: feature_flag.set.id
        type: string
        stability: experimental
        examples: ["proj-1", "ab98sgs", "service1/dev"]
        brief: >
          The identifier of the [flag set](https://openfeature.dev/specification/glossary/#flag-set) to which the feature flag belongs.
      - id: feature_flag.evaluation.reason
        type:
          members:
            - id: static
              value: "static"
              brief: The resolved value is static (no dynamic evaluation).
              stability: experimental
            - id: default
              value: "default"
              brief: The resolved value fell back to a pre-configured value (no dynamic evaluation occurred or dynamic evaluation yielded no result).
              stability: experimental
            - id: targeting_match
              value: "targeting_match"
              brief: The resolved value was the result of a dynamic evaluation, such as a rule or specific user-targeting.
              stability: experimental
            - id: split
              value: "split"
              brief: The resolved value was the result of pseudorandom assignment.
              stability: experimental
            - id: cached
              value: "cached"
              brief: The resolved value was retrieved from cache.
              stability: experimental
            - id: disabled
              value: "disabled"
              brief: The resolved value was the result of the flag being disabled in the management system.
              stability: experimental
            - id: unknown
              value: "unknown"
              brief: The reason for the resolved value could not be determined.
              stability: experimental
            - id: stale
              value: "stale"
              brief: The resolved value is non-authoritative or possibly out of date
              stability: experimental
            - id: error
              value: "error"
              brief: The resolved value was the result of an error.
              stability: experimental
        stability: experimental
        examples: ["static", "targeting_match", "error", "default"]
        brief: >
          The reason code which shows how a feature flag value was determined.
      - id: feature_flag.evaluation.error.message
        type: string
        stability: experimental
        examples: ["Flag `header-color` expected type `string` but found type `number`"]
        brief: A message explaining the nature of an error occurring during flag evaluation.
