Spaces:
Sleeping
Sleeping
Commit History
-
fix: pre-release audit round 12 β 33 bugs fixed across all tiersβ
Tier 1 (ship-blockers): - README/verifier layer count corrected to 7-layer/10-point - SQL keyword regex now strips quoted strings before checking - validate_citations counts unique sources, extracts from body only - Provider-specific error messages for all 3 LLM backends - Missing config error handling in ingest.py entry point Tier 2 (quality): - SQL injection: alphanumeric validation on interpolated values - LIKE wildcard escaping with ESCAPE clause - Fallback builds fresh keyword query instead of re-running failed SQL - NaN/NaT/inf filtering across all tabular readers - Merged docx table cells deduplicated via element identity - .env double-escaping fix in setup wizard - Verification LLM exceptions skip correction instead of triggering it - References check handles SQL and web sources - Dead pre-loop validate_citations removed - KB meta extension detection uses Path.suffix - QU prompt omits SQL fields when no schema available - Redundant collection.count() eliminated - Row padding fβ¦fbd18c8
-
fix: curated model lists, reasoning model token scaling, skip temp filesβ
- Restrict each provider to 3 supported models instead of fetching all from API (OpenAI: gpt-4.1/4o/4o-mini, Anthropic: sonnet/opus/haiku, Gemini: 2.5-pro/2.5-flash/2.0-flash) - Scale up max_completion_tokens 4x for OpenAI reasoning models (o1/o3/o4) since reasoning tokens count against the budget - Skip ~$ temp Excel files during ingestion - Log LLM errors in codebook description generation for debugging Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>112b4f4 -
fix: Round 8 audit β 15 bugs fixed across 10 files (1 CRITICAL, 7 HIGH, 3 MEDIUM, 4 LOW)β
Security fixes: - CRITICAL: execute comment-stripped SQL query (not original) to prevent injection bypass - HIGH: iterative comment stripping to handle nested comment attacks - HIGH: expand dangerous SQL keyword blocklist from 11 to 23 entries - HIGH: data loss prevention β deferred clear only on first successful embed Robustness fixes: - HIGH: parse_verification_result(None) crash guard - HIGH: try/except on all verification loop generate() calls - HIGH: empty rows guard in Excel reader - MEDIUM: strict boolean normalization for verification pass/fail - MEDIUM: R-style "na" added to null string detection - MEDIUM: broad exception handling for Gemini API errors Minor fixes: - LOW: distinct error message for empty LLM response vs no sources - LOW: bounds check on setup wizard model selection - LOW: route/sql_query keys in CLI and web fallback dicts - LOW: SQL fallback extended to route="both" Cross-checked by 2 verification agents β all fixes confirmed correct. 165/165 tests passing,β¦9093d8f -
fix: 10 bugs (4 HIGH + 6 MEDIUM) from comprehensive codebase auditβ
HIGH fixes: - H1: Gemini blocked-response detection in verifier (safety filter short-circuit) - H2: Config load crash guard in app_web.py (st.stop instead of traceback) - H3: Brace-escape user text in kb_meta.py prompts (prevent KeyError) - H4: Web UI clarification state tracking (pending_clarification_question) MEDIUM fixes: - M1: Preserve leading zeros as TEXT in sql_ingest type inference - M2: Deferred clearing in ingest.py prevents data loss on total failure - M3: Strip markdown fences from LLM-generated SQL in sql_retriever - M4: max_iterations=0 guard in verifier (skip verification, do not refuse) - M5: Add clarification QA to conversation history for pronoun resolution - M6: Remove hardcoded knowledge_base/ prefix in retriever source paths Also adds CLAUDE.md, docs/plans/, full test suite (162 tests, 17 files), and updates WORKLOG.md with audit results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1330e5c -
fix: harden route parsing, column dedup, and column name accessβ
- Normalize QU route output (strip/lowercase) before validation - Fix column name deduplication to handle suffix collisions (e.g., 'Score_A', 'Score_A', 'Score_A_2' no longer produces duplicates) - Use defensive .get() for column name access in SQL result formatting Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>a8fd301 -
fix: 7 bugs from multi-agent debug review of SQL layerβ
- Column name deduplication after sanitization (Score-A/Score_A collision) - _safe_str() preserves None in Stata/SPSS/R data loaders - Reject inf/Infinity in column type inference - Guard against n=1 in _get_sample_values (ZeroDivisionError) - NULL values render as "N/A" in SQL context (not "None") - Defensive .get() in build_schema_summary for malformed schema - Backtick-quoted table names in _extract_table_from_query regex Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>d6a01c7 -
fix: 4 bugs found during comprehensive code reviewβ
- Sort sample values numerically when all values are numeric (was lexicographic) - Handle CSV BOM (utf-8-sig) so Excel-exported CSVs do not corrupt first header - Wrap file_path.relative_to() in try/except to prevent crash on edge-case paths - Fix schema summary colon placement (was appended after description instead of header) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>86e20a0 -
feat: add LLM-powered column descriptions with codebook detectionβ
During SQL ingestion, each table columns are now described by the LLM: 1. Search same directory for codebook/documentation files (PDF, DOCX, TXT, MD) 2. If codebook found, pass its text + column metadata to LLM for descriptions 3. If no codebook, LLM infers column meanings from names, types, samples 4. Descriptions stored in sql_schemas.json alongside existing column metadata Column descriptions are always visible to the chatbot: - build_schema_summary() includes descriptions in the QU prompt - format_sql_results_as_context() includes descriptions with SQL results - Graceful degradation: LLM failure is non-fatal Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>3d1d5b4 -
fix: harden SQL ingest connection handling and brace-escape all prompt parametersβ
- Extract _ingest_tables() helper in sql_ingest.py to ensure SQLite connection is always closed via try/finally - Apply _escape_braces() to bot_name and domain in build_prompt() and build_query_understanding_prompt() to prevent KeyError on user-supplied text containing curly braces Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>3a0fe98
-
feat: add SQL ingestion β load tabular files into SQLite with schema registryβ
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>863e8aa -
feat: add SQL ingestion helpers β table naming, type inference, samplesβ
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>9649eb0