-- VIN path and fitment resolution audit (production lock instrumentation)
-- Table is also created on first use via fitment_audit_ensure_table() in fitment_check.php
CREATE TABLE IF NOT EXISTS fitment_audit_log (
    id BIGINT AUTO_INCREMENT PRIMARY KEY,
    product_id BIGINT NOT NULL,
    vin_present TINYINT(1) NOT NULL DEFAULT 0,
    vin_decoded TINYINT(1) NOT NULL DEFAULT 0,
    deterministic_status VARCHAR(50) NOT NULL,
    llm_used TINYINT(1) NOT NULL DEFAULT 0,
    confidence DECIMAL(3,2) NOT NULL,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
