Spaces:
Runtime error
Runtime error
Commit History
-
fix: Address code review security and quality issuesβ
Julien Simon +1: Claude Opus 4.5Security fixes: - Add path traversal protection via document filter allowlist - Add input length validation (MAX_QUERY_LENGTH=10000) - Add Gradio rate limiting (queue with max_size=20, concurrency=2) Code quality improvements: - Replace sys.exit() with FileNotFoundError in vectorstore.py - Fix lazy loading retry loop in qa_chain.py using sentinel pattern - Add error logging for silent failures in retrievers.py - Optimize O(n*m) to O(n) document matching in hybrid search - Make EMBEDDING_MODEL and RERANKER_MODEL configurable via env vars - Add proper exports to ui/__init__.py - Remove unused dependencies (streamlit, pandas, plotly) Test updates: - Update tests for new exception types and function signatures π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1521cd2
-
Add comprehensive test suite with 98.28% coverageβ
Julien Simon- Add 34 new high-priority tests covering critical workflows: * Multi-turn conversations with chat history (4 tests) * Mode switching between RAG and Vanilla LLM (4 tests) * Network and API failure scenarios (9 tests) * Empty vectorstore and initial state handling (8 tests) * Input validation and edge cases (8 tests) - Add test review document (TEST_REVIEW.md) with critical analysis - Add coverage configuration (.coveragerc) to exclude test files - Update pytest.ini with coverage configuration Test Results: - 153 tests passing (up from 119) - 98.28% code coverage (maintained) - All modules at 100% except qa_chain (98%) and retrievers (93%) Covers all critical user workflows and production edge cases.7ab7df1