{
  "schema_version": 1,
  "unity_config_version": 1,
  "concept_key": "clinic",
  "display_name_semantic_key": "clinic.label",
  "applicable_node_keys": [
    "answer_where",
    "tell_short_story",
    "generalise_across_contexts"
  ],
  "target_assets": {
    "teaching": [
      "clinic_isolated_01",
      "clinic_natural_context_01"
    ],
    "variation": [
      "clinic_variation_01",
      "clinic_viewpoint_01"
    ],
    "discrimination": [
      "clinic_context_complex_01"
    ],
    "unseen_probe": [
      "clinic_unfamiliar_01"
    ]
  },
  "distractors": {
    "clear_contrast_concept_keys": [
      "apple",
      "banana",
      "orange_fruit"
    ],
    "near_contrast_concept_keys": [
      "home",
      "school"
    ],
    "advanced_policy": "Use novel exemplars, richer contexts and balanced positions; remove colour, scale, actor, container and background shortcuts.",
    "prohibited_cues": [
      "target always in the same position",
      "target uniquely larger or brighter",
      "written label reveals answer",
      "only target has audio or animation",
      "distractor is unsafe, frightening or culturally demeaning"
    ],
    "asset_policy": "Use approved isolated or natural-context assets; match crop, background complexity, visual size and audio availability across choices."
  },
  "difficulty_progression": [
    {
      "level": 0,
      "name": "access_and_exposure",
      "field_size": 1,
      "targets": "teaching",
      "distractors": "none",
      "prompt_start": "full_model_or_visual",
      "exit": "access method and engagement confirmed"
    },
    {
      "level": 1,
      "name": "clear_choice",
      "field_size": 2,
      "targets": "teaching",
      "distractors": "clear_contrast",
      "prompt_start": "least_supportive_safe_prompt",
      "exit": "3 consecutive independent correct across 2 exemplars"
    },
    {
      "level": 2,
      "name": "near_discrimination",
      "field_size": 2,
      "targets": "teaching_and_variation",
      "distractors": "near_contrast",
      "prompt_start": "independent",
      "exit": "80 percent independent across 10 trials and 3 exemplars"
    },
    {
      "level": 3,
      "name": "mixed_context",
      "field_size": 3,
      "targets": "variation_and_discrimination",
      "distractors": "near_and_advanced",
      "prompt_start": "independent",
      "exit": "80 percent independent in 2 contexts"
    },
    {
      "level": 4,
      "name": "generalisation_probe",
      "field_size": 2,
      "targets": "unseen_probe",
      "distractors": "balanced_near",
      "prompt_start": "independent",
      "exit": "record only; do not auto-teach during scored probe"
    }
  ],
  "adaptation": {
    "increase_when": "3 consecutive independent correct responses across at least 2 target exemplars",
    "decrease_when": "2 consecutive incorrect or no-response trials, or clinician-observed distress/fatigue",
    "hold_when": "raw accuracy improves while prompt dependence increases",
    "decrease_action": "reduce field size first, then reduce distractor similarity; preserve target meaning",
    "clinician_override": true
  },
  "prompts": {
    "ready": "game.prompt.ready",
    "identify": "clinic.instruction.identify",
    "match": "game.instruction.match_same_meaning",
    "functional_use": "clinic.instruction.functional_use",
    "replay": "game.action.replay_prompt",
    "correct": "game.feedback.correct_neutral",
    "retry": "game.feedback.try_again_neutral",
    "pause": "game.action.pause",
    "stop": "game.action.stop",
    "no_response": "game.feedback.no_response_neutral"
  },
  "prompt_hierarchy": [
    "independent",
    "natural_cue",
    "visual_cue",
    "gesture",
    "verbal_cue",
    "partial_model",
    "full_model",
    "physical_assistance"
  ],
  "scoring": {
    "trial_outcomes": [
      "correct",
      "incorrect",
      "no_response",
      "aborted",
      "not_scorable"
    ],
    "store_separately": [
      "raw_correctness",
      "prompt_level",
      "independence",
      "attempt",
      "latency_ms",
      "response_mode",
      "clinician_override",
      "stop_reason"
    ],
    "independent_rule": "Correct on first scorable attempt with prompt_level independent or natural_cue.",
    "prompted_rule": "Correctness may be true but independence is false after visual cue or greater support.",
    "mastery_rule": "At least 80 percent independent across 10 scorable trials, 3 exemplars and 2 sessions; clinician may require broader evidence.",
    "generalisation_rule": "Independent success with unseen exemplar and at least 2 people or contexts as applicable.",
    "no_response_rule": "Never convert no_response to incorrect automatically.",
    "points_rewards": "No public points, penalties, streak pressure or leaderboards; reinforcement is optional and calm."
  },
  "runtime": {
    "randomization": "deterministic_session_seed",
    "max_same_position_run": 2,
    "default_timeout": null,
    "input_debounce_ms": 300,
    "selected_highlight_ms": 800,
    "stop_available_in_all_states": true
  },
  "accessibility": {
    "minimum_target_pixels": 96,
    "minimum_spacing_pixels": 24,
    "large_card_mode": true,
    "reduced_motion": true,
    "high_contrast": true,
    "audio_optional": true,
    "switch_scan_seconds_range": [
      1,
      10
    ],
    "drag_alternative_required": true
  },
  "trial_event_fields": [
    "schema_version",
    "session_id",
    "session_seed",
    "concept_key",
    "node_key",
    "game_key",
    "language",
    "stimulus_asset_key",
    "choice_asset_keys",
    "target_index",
    "response_mode",
    "raw_response",
    "correct",
    "independent",
    "prompt_level",
    "attempt",
    "latency_ms",
    "difficulty",
    "clinician_override",
    "stop_reason",
    "timestamp_utc"
  ],
  "test_cases": [
    {
      "test_key": "clinic_load_all_modes",
      "type": "edit_mode",
      "given": "valid config and six target assets",
      "when": "all five game keys load",
      "then": "no exception and every stable key resolves"
    },
    {
      "test_key": "clinic_one_target",
      "type": "property",
      "given": "100 seeded scored choice trials",
      "when": "choices are constructed",
      "then": "exactly one target is present in every trial"
    },
    {
      "test_key": "clinic_position_balance",
      "type": "property",
      "given": "1000 seeded trials at each field size",
      "when": "target positions are counted",
      "then": "position frequency differs by no more than 10 percent"
    },
    {
      "test_key": "clinic_run_limit",
      "type": "property",
      "given": "any deterministic seed",
      "when": "target positions are generated",
      "then": "the same target position never occurs more than twice consecutively"
    },
    {
      "test_key": "clinic_clear_before_near",
      "type": "play_mode",
      "given": "learner has not met level-1 advancement",
      "when": "a distractor set is requested",
      "then": "near distractors are excluded"
    },
    {
      "test_key": "clinic_near_unlock",
      "type": "play_mode",
      "given": "three independent correct trials across two exemplars",
      "when": "difficulty is updated",
      "then": "near distractor home may be introduced"
    },
    {
      "test_key": "clinic_prompted_not_mastery",
      "type": "unit",
      "given": "a correct response after a prompt",
      "when": "mastery evidence is calculated",
      "then": "correctness is true and independence is false"
    },
    {
      "test_key": "clinic_timeout_semantics",
      "type": "unit",
      "given": "optional clinician timeout enabled",
      "when": "no response occurs",
      "then": "outcome is no_response and not incorrect"
    },
    {
      "test_key": "clinic_deescalation",
      "type": "play_mode",
      "given": "two consecutive errors or no-responses",
      "when": "difficulty adapts",
      "then": "field size or distractor similarity decreases without negative feedback"
    },
    {
      "test_key": "clinic_probe_isolation",
      "type": "play_mode",
      "given": "novel probe mode",
      "when": "the first scored response is incorrect",
      "then": "no corrective teaching changes the probe score"
    },
    {
      "test_key": "clinic_access_paths",
      "type": "play_mode",
      "given": "touch keyboard switch-scan and clinician-observed profiles",
      "when": "the same trial is completed",
      "then": "all paths produce equivalent semantic event data"
    },
    {
      "test_key": "clinic_stop_every_state",
      "type": "play_mode",
      "given": "each runtime state",
      "when": "stop is activated",
      "then": "the game stops immediately and records stop_reason"
    },
    {
      "test_key": "clinic_missing_locale",
      "type": "edit_mode",
      "given": "required prompt key is missing",
      "when": "session validation runs",
      "then": "learner trial does not start and a non-identifying configuration error is returned"
    },
    {
      "test_key": "clinic_no_pii",
      "type": "schema",
      "given": "serialized trial event",
      "when": "fields are inspected",
      "then": "no name birth date recording free text or medical identifier exists"
    }
  ],
  "review_status": "implementation_and_clinical_review_required"
}
