version: "2.0"

demo:
  id: restaurant_discovery
  title: Restaurant Discovery
  purpose: >
    Demonstrate two SMA meaning-resolution modes over the same enriched
    Google Places venue data.

  deployment:
    interface: semantic_interface
    modes:
      - avatar
      - headless

data_source:
  provider: google_places
  location: Berkeley, California
  entity: venue
  raw_fields:
    - name
    - rating
    - user_ratings_total
    - price_level
    - formatted_address
    - types

semantic_enrichment:
  fields:
    wifi_quality:
      source: [reviews, venue_tags, photos]
      scale: "0 = absent or unreliable | 1 = strong, consistent, confirmed"
    outlet_access:
      source: [reviews, photos]
      scale: "0 = unavailable | 1 = abundant and accessible"
    noise_level:
      source: [reviews, time_of_day_mentions]
      scale: "0 = quiet | 1 = loud"
    parking_access:
      source: [reviews, venue_attributes]
      scale: "0 = difficult | 1 = easy"
    ambience:
      source: [reviews, photos, venue_tags]
      scale: "0 = minimal atmosphere | 1 = highly distinctive atmosphere"
    energy_level:
      source: [reviews, time_of_day_mentions]
      scale: "0 = subdued | 1 = highly energetic"
    lighting_warmth:
      source: [reviews, photos]
      scale: "0 = bright or cool | 1 = warm or intimate"

avatar_mode:
  description: >
    A known person remains persistent while a temporary contextual extension
    changes which signals matter in the current experience.

  experience_avatar:
    identity:
      id: alex
      name: Alex
      persistence: stable
      description: >
        The same person across every restaurant scenario. Context changes the
        meaning projection without replacing the underlying identity.

    environment:
      location: Berkeley, California
      source: declared_or_sensed

    state:
      source: declared_or_inferred
      active_context: remote_work

  contextual_extensions:
    none:
      label: No Active Context
      description: >
        No contextual projection is active. Results remain in the default
        Google Places order.
      behavior_mode: balanced
      scoring: null

    remote_work:
      label: Remote Work
      description: >
        Alex needs a venue that supports focused work. Reliable wifi, outlet
        access, and low noise become the dominant signals.
      behavior_mode: explore
      meaning: >
        Connectivity and sustained focus matter more than ambience or nightlife energy.
      semantic_weights:
        wifi_quality: {weight: 0.35, direction: higher_better}
        outlet_access: {weight: 0.25, direction: higher_better}
        noise_level: {weight: 0.15, direction: lower_better}
        parking_access: {weight: 0.10, direction: higher_better}
        ambience: {weight: 0.05, direction: higher_better}
        energy_level: {weight: 0.05, direction: lower_better}
        lighting_warmth: {weight: 0.05, direction: higher_better}
      interaction_constraints:
        - "High noise is a friction signal and should demote the venue."
        - "Wifi and outlet access remain visually elevated."
      action: rank_by_context_score

    date_night:
      label: Date Night
      description: >
        Alex is planning a date. Ambience, warm lighting, conversational comfort,
        and an appropriate level of energy become the dominant signals.
      behavior_mode: focus
      meaning: >
        Atmosphere and intimacy matter. Work-oriented signals such as wifi and
        outlets become irrelevant.
      semantic_weights:
        wifi_quality: {weight: 0.00, direction: neutral}
        outlet_access: {weight: 0.00, direction: neutral}
        noise_level: {weight: 0.20, direction: lower_better}
        parking_access: {weight: 0.10, direction: higher_better}
        ambience: {weight: 0.35, direction: higher_better}
        energy_level: {weight: 0.20, direction: higher_better}
        lighting_warmth: {weight: 0.15, direction: higher_better}
      interaction_constraints:
        - "Wifi and outlet access should be visually muted."
        - "Ambience is the primary elevated signal."
      action: rank_by_context_score

    family_dinner:
      label: Family Dinner
      description: >
        Alex is dining with family. Parking, a comfortable level of activity,
        flexibility, and tolerance for noise become positive experience signals.
      behavior_mode: balanced
      meaning: >
        A lively room can reduce social friction for a family group, while easy
        arrival and flexible seating support the overall experience.
      semantic_weights:
        wifi_quality: {weight: 0.15, direction: higher_better}
        outlet_access: {weight: 0.00, direction: neutral}
        noise_level: {weight: 0.25, direction: higher_better}
        parking_access: {weight: 0.25, direction: higher_better}
        ambience: {weight: 0.10, direction: higher_better}
        energy_level: {weight: 0.15, direction: higher_better}
        lighting_warmth: {weight: 0.10, direction: higher_better}
      interaction_constraints:
        - "Noise is interpreted as a comfort signal rather than a warning."
        - "Parking and family-friendly energy should remain visible."
      action: rank_by_context_score

headless_mode:
  description: >
    No identity is declared. Meaning is assembled from the user's active filter
    behavior over the same SMA-enriched venue fields.

  identity:
    required: false

  inputs:
    type: weighted_filters
    fields:
      - wifi_quality
      - outlet_access
      - quiet
      - parking_access
      - ambience
      - energy_level
      - lighting_warmth

  resolution:
    quiet:
      maps_to: noise_level
      transform: inverse
      note: "Higher quiet preference means lower noise is better."
    all_other_fields:
      transform: direct

  action: rank_by_weighted_filter_score

meaning_pipeline:
  avatar:
    - google_places_signal
    - semantic_enrichment
    - persistent_identity
    - active_contextual_extension
    - meaning_projection
    - interaction_constraints
    - ranked_output

  headless:
    - google_places_signal
    - semantic_enrichment
    - live_filter_behavior
    - assembled_meaning
    - interaction_constraints
    - ranked_output

governance:
  contextual_extensions:
    versioned: true
    review_required: true
    evidence_traceable: true

  principle: >
    The base person remains persistent. Context is temporary. Meaning is resolved
    before the interface ranks or renders the result.
