-- Phase 4.5 — GPT Scout (non-authoritative side-channel)
CREATE TABLE fitment_gpt_scout (
  id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,

  internal_product_id BIGINT UNSIGNED NOT NULL,
  fitment_resolved_id BIGINT UNSIGNED NOT NULL,

  scout_flags JSON NOT NULL,
  confidence_delta DECIMAL(4,3) NOT NULL,
  reasoning TEXT NOT NULL,

  model_version VARCHAR(50) NOT NULL,
  prompt_hash CHAR(64) NOT NULL,

  created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,

  UNIQUE KEY uniq_scout_run (
    internal_product_id,
    fitment_resolved_id,
    prompt_hash
  )
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
