Release archive
3.2.38

PROD-AI-REPORT-08 (LLM Receives Empty Data) & PROD-AI-REPORT-09 (Analysis Bypasses Quality Gate)

Release v3.2.38 focuses on PROD-AI-REPORT-08 (LLM Receives Empty Data), PROD-AI-REPORT-09 (Analysis Bypasses Quality Gate), and PROD-AI-REPORT-10 (No Force-Regenerate).

FixedInternal
PROD-AI-REPORT-08 (LLM Receives Empty Data) & PROD-AI-REPORT-09 (Analysis Bypasses Quality Gate)

Release digest

Fixed

  • PROD-AI-REPORT-08 (LLM Receives Empty Data) — Root cause: ai_report_generator.py created a plain psycopg2 cursor (tuples) but accessed rows as dicts, silently falling into except with empty stats/reviews. Three related bugs fixed:
    • Added cursor_factory=psycopg2.extras.RealDictCursor for dict-based row access (backend/ai_report_generator.py).
    • Removed broken dict(zip(columns, stats_row)) conversion that produced {"col_name": "col_name"} once cursor returned dicts.
    • Added NULL/NaN-safe str(x or "").strip() for review text fields that previously crashed on None.strip().
  • PROD-AI-REPORT-09 (Analysis Bypasses Quality Gate)POST /api/analyze now routes through ReportOrchestrationService.resolve_sections() with force_regenerate=True instead of saving raw LLM output directly to DB (backend/routers/analytics.py).
  • PROD-AI-REPORT-10 (No Force-Regenerate) — Added force_regenerate parameter to resolve_sections() so "Run AI Analysis" always generates fresh content, skipping cached hallucinations (backend/services/report_orchestration_service.py).

Internal

  • Added tests/test_ai_report_data_integrity.py (9 tests):
    • Stats serialization correctness (numeric values, not column names)
    • NULL/NaN-safe review text assembly (None, NaN, all-NULL)
    • Quality gate hallucination blocking (Trust Score N/A, no employee reviews)
    • Orchestration force-regenerate contract
  • Full targeted regression: 9 passed.
  • Added docs/reports/2026-03-07_PROD_REPAIR_SEARCH_SENTIMENT_AI_REPORT.md (updated with PROD-AI-REPORT-08/09/10 closure).

Technical notes