{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://scischema.org/schemas/psychology/stroop-task/1.0.0/master-schema.json",
  "version": "1.0.0",
  "title": "Stroop Task Process Schema",
  "description": "A JSON schema representing the Stroop task process, including experimental design, stimuli, settings, outputs, practice effects, neuroimaging, and neurocomputational modeling extensions.",
  "type": "object",
  "properties": {
    "metadata": {
      "type": "object",
      "description": "General metadata about the experiment.",
      "properties": {
        "experiment_id": {
          "type": "string",
          "description": "Unique identifier for the experiment."
        },
        "variant": {
          "type": "string",
          "description": "Type of Stroop variant used.",
          "enum": [
            "Standard",
            "Emotional",
            "Numerical",
            "Spatial",
            "Bilingual",
            "Clinical",
            "Emotional_Clinical"
          ]
        },
        "sample": {
          "type": "object",
          "description": "Characteristics of the participant sample.",
          "properties": {
            "age_range": {
              "type": "object",
              "description": "Age range of participants.",
              "properties": {
                "min": {
                  "type": "number",
                  "description": "Minimum age of participants (in years)."
                },
                "max": {
                  "type": "number",
                  "description": "Maximum age of participants (in years)."
                }
              },
              "required": [
                "min",
                "max"
              ]
            },
            "sample_size": {
              "type": "integer",
              "description": "Number of participants in the experiment.",
              "minimum": 20
            },
            "clinical_population": {
              "type": "boolean",
              "description": "Whether the sample includes a clinical population."
            },
            "practice": {
              "type": "object",
              "description": "Details of the practice session.",
              "properties": {
                "duration_days": {
                  "type": "integer",
                  "description": "Number of days of practice."
                },
                "monitored": {
                  "type": "boolean",
                  "description": "Whether practice sessions were monitored."
                }
              }
            }
          }
        }
      },
      "required": [
        "variant"
      ]
    },
    "stimuli": {
      "type": "object",
      "description": "Properties of the stimuli used in the experiment.",
      "properties": {
        "colors": {
          "type": "array",
          "description": "List of colors used in the experiment.",
          "items": {
            "type": "string",
            "enum": [
              "red",
              "blue",
              "green",
              "yellow",
              "black",
              "white"
            ]
          },
          "minItems": 3,
          "maxItems": 6
        },
        "conditions": {
          "type": "array",
          "description": "Types of stimuli used in the experiment.",
          "items": {
            "type": "string",
            "enum": [
              "congruent",
              "incongruent",
              "neutral",
              "emotional"
            ]
          }
        },
        "words": {
          "type": "object",
          "description": "List of words used in the experiment.",
          "properties": {
            "neutral": {
              "type": "array",
              "description": "List of non-color words or symbols used as neutral stimuli (e.g., 'XXXX' or geometric shapes). Used to control for general perceptual load.",
              "items": {
                "type": "string"
              }
            },
            "emotional": {
              "type": "array",
              "description": "List of emotional words used in emotional Stroop variants.",
              "items": {
                "type": "string"
              }
            }
          }
        }
      },
      "required": [
        "colors"
      ]
    },
    "task": {
      "type": "object",
      "description": "Task instructions and response mapping for participants.",
      "properties": {
        "response": {
          "type": "object",
          "description": "Task instructions and response mapping for participants.",
          "properties": {
            "modality": {
              "type": "string",
              "description": "Response modality used by participants.",
              "enum": [
                "verbal",
                "manual"
              ]
            },
            "mapping": {
              "type": "string",
              "description": "Response mapping instructions.",
              "enum": [
                "name_color",
                "read_word"
              ]
            },
            "keys": {
              "type": "object",
              "description": "Mapping of keys to colors for manual response modality.",
              "unevaluatedProperties": {
                "type": "string"
              }
            }
          },
          "required": [
            "modality",
            "mapping"
          ]
        }
      }
    },
    "timing": {
      "type": "object",
      "description": "Parameters related to trial timing.",
      "properties": {
        "stimulus": {
          "type": "object",
          "description": "Duration of stimulus presentation in milliseconds.",
          "properties": {
            "min": {
              "type": "integer",
              "description": "Minimum stimulus presentation duration.",
              "minimum": 500
            },
            "max": {
              "type": "integer",
              "description": "Maximum stimulus presentation duration.",
              "maximum": 2000
            }
          },
          "required": [
            "min",
            "max"
          ]
        },
        "iti": {
          "type": "object",
          "description": "Duration of the inter-trial interval in milliseconds.",
          "properties": {
            "min": {
              "type": "integer",
              "description": "Minimum inter-trial interval duration.",
              "minimum": 500
            },
            "max": {
              "type": "integer",
              "description": "Maximum inter-trial interval duration.",
              "maximum": 1500
            }
          },
          "required": [
            "min",
            "max"
          ]
        }
      },
      "required": [
        "stimulus",
        "iti"
      ]
    },
    "design": {
      "type": "object",
      "description": "Trial structure and randomization.",
      "properties": {
        "trials": {
          "type": "object",
          "description": "Number of trials per stimulus condition (congruent, incongruent, neutral). Typically 20–100+; higher counts improve statistical power.",
          "unevaluatedProperties": {
            "type": "integer",
            "minimum": 0
          }
        },
        "randomization": {
          "type": "string",
          "description": "Whether stimulus order is randomized or counterbalanced.",
          "enum": [
            "randomized",
            "counterbalanced"
          ]
        }
      }
    },
    "instruments": {
      "type": "object",
      "description": "Apparatus and instruments used in the experiment.",
      "properties": {
        "software": {
          "type": "string",
          "description": "Experimental software used.",
          "enum": [
            "PsychoPy",
            "E-Prime",
            "MATLAB_Psychtoolbox",
            "Other"
          ]
        },
        "device": {
          "type": "string",
          "description": "Device used for responses.",
          "enum": [
            "keyboard",
            "response_pad"
          ]
        },
        "voice": {
          "type": "boolean",
          "description": "Whether voice recording is used for verbal responses."
        },
        "rt_precision": {
          "type": "string",
          "description": "Precision of reaction time measurement.",
          "enum": [
            "millisecond"
          ]
        },
        "display_calibrated": {
          "type": "boolean",
          "description": "Whether display luminance and contrast are calibrated."
        }
      },
      "required": [
        "software",
        "device"
      ]
    },
    "behavior": {
      "type": "object",
      "description": "Primary behavioral outputs of the experiment.",
      "properties": {
        "reaction_times": {
          "type": "object",
          "description": "Reaction times per condition in milliseconds.",
          "unevaluatedProperties": {
            "type": "array",
            "items": {
              "type": "number",
              "minimum": 0
            }
          }
        },
        "error_rates": {
          "type": "object",
          "description": "Error rates per condition in percentage.",
          "unevaluatedProperties": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          }
        },
        "interference": {
          "type": "object",
          "description": "Interference scores calculated as RT(incongruent) - RT(congruent).",
          "properties": {
            "standard": {
              "type": "number",
              "description": "Difference between incongruent and congruent reaction times in standard Stroop (default: 0)."
            },
            "emotional": {
              "type": "number",
              "description": "Interference effect measured for emotional Stroop stimuli."
            }
          }
        }
      },
      "required": [
        "reaction_times",
        "error_rates"
      ]
    },
    "neuroimaging": {
      "type": "object",
      "description": "Neuroimaging data collection parameters.",
      "properties": {
        "modality": {
          "type": "string",
          "description": "Neuroimaging modality used.",
          "enum": [
            "EEG",
            "fMRI",
            "None"
          ]
        },
        "eeg": {
          "type": "object",
          "description": "EEG implementation parameters",
          "properties": {
            "channels": {
              "type": "integer",
              "description": "Number of EEG channels (e.g., 32–128).",
              "minimum": 32,
              "maximum": 128
            },
            "sampling_rate": {
              "type": "integer",
              "description": "EEG sampling rate in Hz (≥500 Hz).",
              "minimum": 500
            },
            "impedance": {
              "type": "object",
              "description": "Electrode impedance in ohms (Ω), typically <5–10 kΩ.",
              "properties": {
                "max": {
                  "type": "number",
                  "description": "Maximum allowed EEG electrode impedance.",
                  "minimum": 5,
                  "maximum": 10
                }
              },
              "required": [
                "max"
              ]
            },
            "reference": {
              "type": "string",
              "description": "EEG reference type (e.g., linked mastoids, average reference).",
              "enum": [
                "linked_mastoids",
                "average"
              ]
            },
            "events": {
              "type": "array",
              "description": "Event markers recorded (e.g., stimulus onset, response onset, accuracy).",
              "items": {
                "type": "string",
                "enum": [
                  "stimulus_onset",
                  "response_onset",
                  "accuracy"
                ]
              }
            }
          }
        },
        "fmri": {
          "type": "object",
          "description": "fMRI implementation parameters",
          "properties": {
            "scanner": {
              "type": "string",
              "description": "MRI scanner strength",
              "enum": [
                "3T"
              ]
            },
            "tr": {
              "type": "integer",
              "description": "Repetition time in milliseconds",
              "minimum": 2000,
              "maximum": 2500
            },
            "te": {
              "type": "integer",
              "description": "Echo time in milliseconds",
              "minimum": 20,
              "maximum": 50
            },
            "voxel": {
              "type": "object",
              "description": "Voxel resolution in mm",
              "properties": {
                "x": {
                  "type": "number",
                  "description": "Voxel size in millimeters (mm).",
                  "minimum": 2,
                  "maximum": 3
                },
                "y": {
                  "type": "number",
                  "description": "Voxel size in millimeters (mm).",
                  "minimum": 2,
                  "maximum": 3
                },
                "z": {
                  "type": "number",
                  "description": "Voxel size in millimeters (mm).",
                  "minimum": 2,
                  "maximum": 3
                }
              },
              "required": [
                "x",
                "y",
                "z"
              ]
            },
            "design": {
              "type": "string",
              "description": "Experimental design used in fMRI. Event-related preferred for conflict separation and reactive control.",
              "enum": [
                "event_related",
                "block"
              ]
            }
          }
        }
      },
      "required": [
        "modality"
      ]
    },
    "model": {
      "type": "object",
      "description": "Neurocomputational model parameters.",
      "properties": {
        "type": {
          "type": "string",
          "description": "Computational model used to simulate Stroop performance. The fronto-cerebellar loop model is now supported by fMRI evidence.",
          "enum": [
            "drift_diffusion",
            "conflict_monitoring",
            "None"
          ]
        },
        "parameters": {
          "type": "object",
          "description": "Core parameters in the model that influence response latency and accuracy. Cerebellar gain, coupling, sequence strategy, and mental imagery strength are now included.",
          "unevaluatedProperties": {
            "type": "number"
          }
        }
      }
    },
    "analysis": {
      "type": "object",
      "description": "Data analysis parameters and norms.",
      "properties": {
        "outliers": {
          "type": "object",
          "description": "Outlier removal criteria for reaction times.",
          "properties": {
            "sd": {
              "type": "number",
              "description": "Number of standard deviations from the mean to consider as an outlier (default: 2).",
              "minimum": 1
            },
            "min_rt": {
              "type": "integer",
              "description": "Minimum reaction time in ms.",
              "minimum": 200
            },
            "max_rt": {
              "type": "integer",
              "description": "Maximum reaction time in ms.",
              "minimum": 2000
            }
          }
        },
        "accuracy_adjusted": {
          "type": "boolean",
          "description": "Optional composite metric combining RT and accuracy (e.g., inverse accuracy RT). Used to reduce bias from speed-accuracy tradeoffs."
        },
        "method": {
          "type": "string",
          "description": "Primary statistical method used to analyze data. Mixed-effects models are preferred for hierarchical data.",
          "enum": [
            "within_subject_anova",
            "mixed_effects",
            "other"
          ]
        }
      },
      "required": [
        "outliers"
      ]
    },
    "clinical": {
      "type": "object",
      "description": "Clinical applications and considerations.",
      "properties": {
        "diagnosis": {
          "type": "array",
          "description": "Clinical diagnoses being studied.",
          "items": {
            "type": "string",
            "enum": [
              "ADHD",
              "depression",
              "schizophrenia",
              "frontal_lobe_dysfunction",
              "aging"
            ]
          }
        },
        "coupling": {
          "type": "array",
          "description": "Derived measures for behavioral-neural coupling.",
          "items": {
            "type": "string"
          }
        }
      }
    }
  },
  "required": [
    "metadata",
    "stimuli",
    "task",
    "timing",
    "instruments",
    "behavior"
  ],
  "unevaluatedProperties": false
}
