Test 1 — LLM Advisory Fallback

{
    "status": "debug_mode_active",
    "endpoint": "fitment_check.php",
    "raw_input": "{\"product_id\":8339516915955,\"vehicle\":{\"year\":2012,\"make\":\"Ford\",\"model\":\"Mustang\"}}",
    "execution_time_ms": 526.05,
    "memory_usage": 472320,
    "peak_memory_usage": 559280,
    "debug_log": [],
    "normal_response_preview": {
        "status": "unknown",
        "matched_rows": 0,
        "confidence": 0.3,
        "confidence_band": "advisory",
        "deterministic_confidence": 0,
        "llm_used": true,
        "llm": {
            "used": true,
            "model": "openai\/gpt-4o-mini",
            "provider": "openrouter",
            "temperature": 0.2,
            "usage": {
                "tokens_prompt": 0,
                "tokens_completion": 0,
                "tokens_total": 0,
                "cost_usd": 0
            },
            "raw_text": "",
            "parsed": null,
            "llm_health": {
                "status": "degraded_transport",
                "http_code": 401,
                "transport_error": false,
                "tokens_total": 0
            },
            "transport_debug": {
                "http_code": 401,
                "curl_error": null,
                "raw_http_response": "{\"error\":{\"message\":\"Missing Authentication header\",\"code\":401}}",
                "transport_error": null,
                "transport_status": null,
                "transport_message": null
            },
            "llm_provider": "openrouter",
            "provider_resolved_from": "db"
        },
        "llm_confidence": 0.4,
        "explanation": {
            "summary": null,
            "compatibility_factors": [],
            "mechanical_differences": [],
            "raw_text": ""
        },
        "llm_provider": "openrouter",
        "provider_resolved_from": "db",
        "trace": {
            "trace_version": "2.0",
            "decision_id": "28e3adbb927340a3",
            "timestamp_utc": "2026-07-27T23:06:57+00:00",
            "stages": {
                "deterministic_checked": true,
                "deterministic_match": false,
                "vin_path": false,
                "llm_fallback": true
            },
            "authority": {
                "source": "llm_advisory",
                "confidence": 0.3,
                "confidence_band": "advisory"
            },
            "risk_flags": [],
            "token_usage": {
                "prompt": 0,
                "completion": 0,
                "total": 0
            }
        },
        "debug_product_lookup": {
            "product_found": true,
            "product_title": "Airaid 450-636 AIR Throttle Body Spacer"
        },
        "llm_model": "openai\/gpt-4o-mini",
        "llm_temperature": 0.2,
        "llm_tokens_prompt": 0,
        "llm_tokens_completion": 0,
        "llm_tokens_total": 0,
        "llm_cost_usd": 0,
        "llm_health": {
            "status": "degraded_transport",
            "http_code": 401,
            "transport_error": false,
            "tokens_total": 0
        },
        "debug_deterministic": {
            "exact_year_match": null,
            "exact_make_match": null,
            "exact_model_match": null,
            "engine_required": null,
            "vehicle_engine_provided": null,
            "engine_match": null
        },
        "final_confidence": 0.3,
        "display_confidence_label": "Low",
        "review_recommended": true,
        "request_mode": "ymm",
        "reasoning_trace_json": {
            "trace_version": "2.0",
            "decision_id": "28e3adbb927340a3",
            "timestamp_utc": "2026-07-27T23:06:57+00:00",
            "stages": {
                "deterministic_checked": true,
                "deterministic_match": false,
                "vin_path": false,
                "llm_fallback": true
            },
            "authority": {
                "source": "llm_advisory",
                "confidence": 0.3,
                "confidence_band": "advisory"
            },
            "risk_flags": [],
            "token_usage": {
                "prompt": 0,
                "completion": 0,
                "total": 0
            }
        }
    }
}
FAIL

Test 2 — Deterministic Year Contradiction

{
    "status": "debug_mode_active",
    "endpoint": "fitment_check.php",
    "raw_input": "{\"product_id\":8339516915955,\"vehicle\":{\"year\":2018,\"make\":\"Ford\",\"model\":\"Mustang\"}}",
    "execution_time_ms": 14.12,
    "memory_usage": 468688,
    "peak_memory_usage": 550952,
    "debug_log": [],
    "normal_response_preview": {
        "status": "does_not_fit",
        "confidence": 1,
        "deterministic_confidence": 100,
        "llm_used": false,
        "llm": {
            "used": false,
            "model": null,
            "provider": null,
            "temperature": null,
            "usage": null,
            "raw_text": null,
            "parsed": null,
            "llm_health": {
                "status": "not_used",
                "http_code": null,
                "transport_error": false,
                "tokens_total": 0
            }
        },
        "llm_confidence": null,
        "confidence_band": "verified",
        "review_recommended": false,
        "trace": {
            "trace_version": "2.0",
            "decision_id": "a8b91b34e0258a97",
            "timestamp_utc": "2026-07-27T23:06:57+00:00",
            "stages": {
                "deterministic_checked": true,
                "deterministic_match": false,
                "vin_path": false,
                "llm_fallback": false
            },
            "authority": {
                "source": "deterministic",
                "confidence": 1,
                "confidence_band": "high"
            },
            "risk_flags": [],
            "token_usage": []
        },
        "debug_product_lookup": {
            "product_found": true,
            "product_title": "Airaid 450-636 AIR Throttle Body Spacer"
        },
        "llm_model": null,
        "llm_provider": null,
        "llm_temperature": null,
        "llm_tokens_prompt": null,
        "llm_tokens_completion": null,
        "llm_tokens_total": null,
        "llm_cost_usd": null,
        "llm_health": {
            "status": "not_used",
            "http_code": null,
            "transport_error": false,
            "tokens_total": 0
        },
        "debug_deterministic": {
            "exact_year_match": null,
            "exact_make_match": null,
            "exact_model_match": null,
            "engine_required": null,
            "vehicle_engine_provided": null,
            "engine_match": null
        },
        "final_confidence": 100,
        "display_confidence_label": "High",
        "request_mode": "ymm",
        "reasoning_trace_json": {
            "trace_version": "2.0",
            "decision_id": "a8b91b34e0258a97",
            "timestamp_utc": "2026-07-27T23:06:57+00:00",
            "stages": {
                "deterministic_checked": true,
                "deterministic_match": false,
                "vin_path": false,
                "llm_fallback": false
            },
            "authority": {
                "source": "deterministic",
                "confidence": 1,
                "confidence_band": "high"
            },
            "risk_flags": [],
            "token_usage": []
        }
    }
}
FAIL

Test 3 — Missing Year Validation

{
    "status": "debug_mode_active",
    "endpoint": "fitment_check.php",
    "raw_input": "{\"product_id\":8339516915955,\"vehicle\":{\"make\":\"Ford\",\"model\":\"Mustang\"}}",
    "execution_time_ms": 1.75,
    "memory_usage": 458552,
    "peak_memory_usage": 458552,
    "debug_log": [],
    "normal_response_preview": {
        "status": "invalid_input",
        "request_mode": "ymm"
    }
}
FAIL

Test 4 — Engine Suppression

{
    "status": "debug_mode_active",
    "endpoint": "fitment_check.php",
    "raw_input": "{\"product_id\":8339516915955,\"vehicle\":{\"year\":2012,\"make\":\"Ford\",\"model\":\"Mustang\"}}",
    "execution_time_ms": 154.52,
    "memory_usage": 472312,
    "peak_memory_usage": 559272,
    "debug_log": [],
    "normal_response_preview": {
        "status": "unknown",
        "matched_rows": 0,
        "confidence": 0.3,
        "confidence_band": "advisory",
        "deterministic_confidence": 0,
        "llm_used": true,
        "llm": {
            "used": true,
            "model": "openai\/gpt-4o-mini",
            "provider": "openrouter",
            "temperature": 0.2,
            "usage": {
                "tokens_prompt": 0,
                "tokens_completion": 0,
                "tokens_total": 0,
                "cost_usd": 0
            },
            "raw_text": "",
            "parsed": null,
            "llm_health": {
                "status": "degraded_transport",
                "http_code": 401,
                "transport_error": false,
                "tokens_total": 0
            },
            "transport_debug": {
                "http_code": 401,
                "curl_error": null,
                "raw_http_response": "{\"error\":{\"message\":\"Missing Authentication header\",\"code\":401}}",
                "transport_error": null,
                "transport_status": null,
                "transport_message": null
            },
            "llm_provider": "openrouter",
            "provider_resolved_from": "db"
        },
        "llm_confidence": 0.4,
        "explanation": {
            "summary": null,
            "compatibility_factors": [],
            "mechanical_differences": [],
            "raw_text": ""
        },
        "llm_provider": "openrouter",
        "provider_resolved_from": "db",
        "trace": {
            "trace_version": "2.0",
            "decision_id": "663e7b7e2e3aa516",
            "timestamp_utc": "2026-07-27T23:06:57+00:00",
            "stages": {
                "deterministic_checked": true,
                "deterministic_match": false,
                "vin_path": false,
                "llm_fallback": true
            },
            "authority": {
                "source": "llm_advisory",
                "confidence": 0.3,
                "confidence_band": "advisory"
            },
            "risk_flags": [],
            "token_usage": {
                "prompt": 0,
                "completion": 0,
                "total": 0
            }
        },
        "debug_product_lookup": {
            "product_found": true,
            "product_title": "Airaid 450-636 AIR Throttle Body Spacer"
        },
        "llm_model": "openai\/gpt-4o-mini",
        "llm_temperature": 0.2,
        "llm_tokens_prompt": 0,
        "llm_tokens_completion": 0,
        "llm_tokens_total": 0,
        "llm_cost_usd": 0,
        "llm_health": {
            "status": "degraded_transport",
            "http_code": 401,
            "transport_error": false,
            "tokens_total": 0
        },
        "debug_deterministic": {
            "exact_year_match": null,
            "exact_make_match": null,
            "exact_model_match": null,
            "engine_required": null,
            "vehicle_engine_provided": null,
            "engine_match": null
        },
        "final_confidence": 0.3,
        "display_confidence_label": "Low",
        "review_recommended": true,
        "request_mode": "ymm",
        "reasoning_trace_json": {
            "trace_version": "2.0",
            "decision_id": "663e7b7e2e3aa516",
            "timestamp_utc": "2026-07-27T23:06:57+00:00",
            "stages": {
                "deterministic_checked": true,
                "deterministic_match": false,
                "vin_path": false,
                "llm_fallback": true
            },
            "authority": {
                "source": "llm_advisory",
                "confidence": 0.3,
                "confidence_band": "advisory"
            },
            "risk_flags": [],
            "token_usage": {
                "prompt": 0,
                "completion": 0,
                "total": 0
            }
        }
    }
}
FAIL

Test 5 — Token Budget

{
    "status": "debug_mode_active",
    "endpoint": "fitment_check.php",
    "raw_input": "{\"product_id\":8339516915955,\"vehicle\":{\"year\":2012,\"make\":\"Ford\",\"model\":\"Mustang\"}}",
    "execution_time_ms": 143.54,
    "memory_usage": 472312,
    "peak_memory_usage": 559272,
    "debug_log": [],
    "normal_response_preview": {
        "status": "unknown",
        "matched_rows": 0,
        "confidence": 0.3,
        "confidence_band": "advisory",
        "deterministic_confidence": 0,
        "llm_used": true,
        "llm": {
            "used": true,
            "model": "openai\/gpt-4o-mini",
            "provider": "openrouter",
            "temperature": 0.2,
            "usage": {
                "tokens_prompt": 0,
                "tokens_completion": 0,
                "tokens_total": 0,
                "cost_usd": 0
            },
            "raw_text": "",
            "parsed": null,
            "llm_health": {
                "status": "degraded_transport",
                "http_code": 401,
                "transport_error": false,
                "tokens_total": 0
            },
            "transport_debug": {
                "http_code": 401,
                "curl_error": null,
                "raw_http_response": "{\"error\":{\"message\":\"Missing Authentication header\",\"code\":401}}",
                "transport_error": null,
                "transport_status": null,
                "transport_message": null
            },
            "llm_provider": "openrouter",
            "provider_resolved_from": "db"
        },
        "llm_confidence": 0.4,
        "explanation": {
            "summary": null,
            "compatibility_factors": [],
            "mechanical_differences": [],
            "raw_text": ""
        },
        "llm_provider": "openrouter",
        "provider_resolved_from": "db",
        "trace": {
            "trace_version": "2.0",
            "decision_id": "0baec291f1647f04",
            "timestamp_utc": "2026-07-27T23:06:58+00:00",
            "stages": {
                "deterministic_checked": true,
                "deterministic_match": false,
                "vin_path": false,
                "llm_fallback": true
            },
            "authority": {
                "source": "llm_advisory",
                "confidence": 0.3,
                "confidence_band": "advisory"
            },
            "risk_flags": [],
            "token_usage": {
                "prompt": 0,
                "completion": 0,
                "total": 0
            }
        },
        "debug_product_lookup": {
            "product_found": true,
            "product_title": "Airaid 450-636 AIR Throttle Body Spacer"
        },
        "llm_model": "openai\/gpt-4o-mini",
        "llm_temperature": 0.2,
        "llm_tokens_prompt": 0,
        "llm_tokens_completion": 0,
        "llm_tokens_total": 0,
        "llm_cost_usd": 0,
        "llm_health": {
            "status": "degraded_transport",
            "http_code": 401,
            "transport_error": false,
            "tokens_total": 0
        },
        "debug_deterministic": {
            "exact_year_match": null,
            "exact_make_match": null,
            "exact_model_match": null,
            "engine_required": null,
            "vehicle_engine_provided": null,
            "engine_match": null
        },
        "final_confidence": 0.3,
        "display_confidence_label": "Low",
        "review_recommended": true,
        "request_mode": "ymm",
        "reasoning_trace_json": {
            "trace_version": "2.0",
            "decision_id": "0baec291f1647f04",
            "timestamp_utc": "2026-07-27T23:06:58+00:00",
            "stages": {
                "deterministic_checked": true,
                "deterministic_match": false,
                "vin_path": false,
                "llm_fallback": true
            },
            "authority": {
                "source": "llm_advisory",
                "confidence": 0.3,
                "confidence_band": "advisory"
            },
            "risk_flags": [],
            "token_usage": {
                "prompt": 0,
                "completion": 0,
                "total": 0
            }
        }
    }
}
FAIL

Otto Governance Test Suite Complete