Spaces:
Sleeping
Sleeping
Commit History
-
fix: P0 provider mismatch and code quality audit fixes (#102)
Unverified signature* refactor: replace hacky try/except with proper pydantic validation PROBLEM: - CodeRabbit recommended try/except for ADVANCED_MAX_ROUNDS parsing - This is hacky defensive programming, not Clean Code - Silent fallbacks mask configuration errors SOLUTION (Uncle Bob approved): 1. Add advanced_max_rounds to Settings with pydantic Field validation: - ge=1, le=20 bounds checking - Fails fast at startup with clear error message 2. Add advanced_timeout to Settings (60-900 seconds) 3. Remove os.getenv + try/except hack from advanced.py - Now uses settings.advanced_max_rounds directly 4. Fix domain.py: invalid domain strings now raise ValueError - Shows valid options in error message - Previously silently fell back to default 5. Update tests: 18 tests verifying fail-fast behavior - TestSettingsValidation: type errors, bounds violations all raise - TestGetDomainConfig: invalid strings raise with helpful message PHILOSOPHY: "If someone configures your app wrong, tell t…599a754 -
ci: upgrade to ironclad CI/CD configuration
- Upgrade setup-uv@v4 → v7 with built-in caching (removes cache warning) - Pin uv version to 0.5.6 for reproducible builds - Add ruff format --check (enforces consistent formatting) - Add --locked to uv sync (ensures lockfile integrity) - Auto-format 4 files to pass new format checke70a3b7 -
feat: Wire LlamaIndex RAG into Simple Mode (Tiered Embedding) (#83)
Unverified signature* feat: wire LlamaIndex RAG service into embedding infrastructure This PR implements tiered embedding service selection per NEXT_TASK.md: ## Changes - Add EmbeddingServiceProtocol (embedding_protocol.py) for unified interface - Add async wrappers to LlamaIndexRAGService (add_evidence, search_similar, deduplicate) - Update service_loader.py with get_embedding_service() factory method - Update ResearchMemory to use service_loader instead of direct EmbeddingService - Update orchestrators to use EmbeddingServiceProtocol type hints ## Design Patterns Applied - Strategy Pattern: Tiered service selection (LlamaIndex or local) - Factory Method: get_embedding_service() creates appropriate service - Protocol Pattern: Structural typing for service interface - Dependency Injection: ResearchMemory accepts any protocol-compatible service ## Tiered Selection - Premium tier (OPENAI_API_KEY present): LlamaIndexRAGService with: - OpenAI embeddings (text-embedding-3-small) - Persistent ChromaDB s…7baf8ba
-
feat(SPEC-08): Integrate shared memory layer + CodeRabbit fixes (#74)
Unverified signature## Summary - SPEC-08: Shared memory layer integration - CodeRabbit critical fix: async add_evidence() with proper deduplication - Security: Fixed CVEs in langgraph-checkpoint and urllib3 - CI: Hardened to fail on security vulnerabilities - Docstrings: 80%+ coverage All 178 tests pass. No known vulnerabilities.e0c585c -
fix: resolve all P0 critical bugs blocking demo
Bug 1 - Free Tier Quota Loop (P0): - Detect 402/quota errors in HFInferenceJudgeHandler - Return `sufficient=True` to stop loop gracefully - Show clear "Free Tier Quota Exceeded" message to user Bug 3 - API Key Not Passed to Advanced Mode (P0): - Add `api_key` parameter to `create_orchestrator()` - Pass to `MagenticOrchestrator.__init__()` - Create `OpenAIChatClient` with user's BYOK key Bug 4 - Singleton EmbeddingService Cross-Session Pollution (P0): - Remove singleton pattern from `get_embedding_service()` - Create unique ChromaDB collection per request (uuid) - Keep `SentenceTransformer` model shared for performance Bug 2 was caused by Bug 4 (dedup on polluted collection). All 135 tests pass. Demo is now functional.d1f91a4 -
fix: address CodeRabbit review feedback
Fixes from CodeRabbit analysis: - docs/to_do/DEEP_RESEARCH_ROADMAP.md: Fix MagenticBuilder → MagenticOrchestrator - docs/to_do/DEEP_RESEARCH_ROADMAP.md: Add note clarifying RAGService vs EmbeddingService - src/services/llamaindex_rag.py: Add migration note for collection name change - tests/unit/utils/test_exceptions.py: Add pytestmark = pytest.mark.unit - docs/implementation/12_phase_mcp_server.md: Update all bioRxiv refs → Europe PMC All 127 tests pass, 0 warnings.7d28de6 -
fix: resolve all test warnings and complete DeepBoner rebrand
Code fixes: - Update OpenAIModel → OpenAIChatModel (pydantic-ai deprecation) - Add pytest.importorskip guards to 3 test files for optional deps Rebrand fixes (missed in initial rename): - src/services/llamaindex_rag.py: collection name - src/tools/clinicaltrials.py: User-Agent header - 7 doc files: package names, URLs, examples Config: - Add targeted pytest warning filters for Pydantic mock introspection (known upstream issue: pydantic/pydantic#9927) Result: 127 tests pass, 0 warnings (was 50 warnings)ff16d8e
-
rebrand: DeepCritical → DeepBoner (sexual health research agent)
🍆 AI-Native Sexual Health Research Agent - Package renamed: deepcritical → deepboner - New focus: sexual wellness, ED, hormone therapy, libido, reproductive health - Exception class: DeepCriticalError → DeepBonerError (with backwards compat) - UI examples updated for sexual health queries - Modal app renamed: deepboner-code-execution - Fixed pre-existing mypy issue (Modal API: uv_pip_install → pip_install) 46 files updated across: - Core: pyproject.toml, README.md, CLAUDE.md, AGENTS.md, GEMINI.md - Source: app.py, mcp_tools.py, exceptions.py, code_execution.py - Docs: ~25 markdown files - Examples: 8 demo scripts - Tests: exception tests updated All tests passing (102 passed, 6 skipped)5d12635
-
docs: sync AI agent context files and fix final nitpicks
- Update GEMINI.md, CLAUDE.md, AGENTS.md to Phase 13 status - Add HuggingFace Spaces collaboration guidelines - Remove redundant evidence[:10] slice (method handles internally) - Add CodeExecutionError handling to verify_sandbox.py demo8bac750 -
refactor: address CodeRabbit nitpick suggestions
- Use Literal type for verdict field (type safety) - Use lru_cache for thread-safe singleton pattern - Fix ellipsis only appended when content is truncated - Clarify docstrings for enable_modal_analysis vs modal_available - Surface execution failures in verify_sandbox.py demo - Gate StatisticalAnalyzer integration test on LLM keys901acc3 -
fix: address CodeRabbit review feedback for Phase 13
- Use .get() to prevent KeyError when execution dict lacks 'error' key - Use context manager for file read to prevent resource leak in testf32a2ca -
feat: implement phase 13 modal pipeline integration
7cc8b69 -
refactor: centralize embedding configuration in Settings
- Add openai_embedding_model and local_embedding_model to Settings - Update LlamaIndexRAGService to use settings.openai_embedding_model - Update EmbeddingService to use settings.local_embedding_model - Both services now read from centralized config instead of hardcoding - Constraint (OpenAI-only for cloud embeddings) is now explicit in config20c7bad -
refactor: address final CodeRabbit feedback
- Fix Windows path escaping in verify_sandbox.py using .as_posix() - Improve verdict detection with robust regex matching (avoid false positives) - Wire allow_network parameter to Modal sandbox block_network - Add finally block for sandbox resource cleanup - Use lru_cache for thread-safe singleton pattern - Add OpenAI-only note to LlamaIndexRAGService docstringb50fffd -
fix(rag): address remaining CodeRabbit feedback
- Validate OPENAI_API_KEY before creating LLM/embedding instances - Re-raise exceptions in retrieve() instead of returning empty list - Re-raise exceptions in query() instead of returning error string2f0030b -
fix(rag): use get_content() for BaseNode compatibility
3f90da8 -
fix(rag): apply lazy imports and use centralized config
- Remove unused TYPE_CHECKING block (imports are in __init__) - Use settings.openai_model instead of hard-coded "gpt-4o-mini" - Fix line length in clear_collection() method - Change Document type hint to Any for lazy import compatibility055a3a7 -
feat: Integrate Mario's Modal code execution + LlamaIndex RAG
Cherry-picked from mario-dev branch: - src/tools/code_execution.py: Modal sandbox for LLM-generated code - src/services/llamaindex_rag.py: LlamaIndex + ChromaDB RAG service - src/agents/analysis_agent.py: Statistical analysis agent - examples/modal_demo/: Demo scripts for code execution - docs/workflow-diagrams.md: Architecture documentation Dependencies added as optional [modal] group: - modal>=0.63.0, llama-index, chromadb Config additions: - MODAL_TOKEN_ID, MODAL_TOKEN_SECRET, CHROMA_DB_PATH Co-authored-by: Mario <mario@contributor>3aa91e9 -
feat: Complete Phase 9 Source Cleanup (Remove WebTool) (#14)
* feat: complete Phase 9 source cleanup - Removed WebTool (src/tools/websearch.py) and related tests - Updated SearchHandler and models to support only PubMed - Refactored all examples and tests to remove web search dependencies - Added verification tests to ensure no WebTool references remain - Fixed all unit tests to align with strict 'pubmed' source typing * fix: address CodeRabbit review feedback - Deduplicate tenacity dependency in pyproject.toml - Remove 'and web' from search agent description - Normalize Citation source to 'pubmed' in search agent - Update app.py markdown to remove web search references - Update embeddings demo with realistic PubMed URL/author - Enhance SearchHandler tests to verify multi-tool aggregation * refactor: replace mock data with real PubMed data in embeddings demo * fix: address CodeRabbit review feedback - Fix nested test_search_handler_pubmed_only (was inside another test, never ran) - Improve test_no_webtool_references to catch `from src.tool…cd004e1
-
fix: address CodeRabbit Phase 6 review feedback
- Dockerfile: Add curl for HEALTHCHECK, use specific extras (not --all-extras) - app.py: Tighten Magentic mode key detection to require OpenAI specifically - embeddings.py: Move structlog import to module level - test_embeddings.py: Remove redundant numpy import506a9c0 -
fix(phase6): critical fixes from senior audit
- Fix Dockerfile cache ownership (run model download as appuser) - Store full citation metadata in vector DB (title, date, authors) - Remove fragile locals() hack in search_agent.py - Add try/except in deduplicate loop for resilience - Document threshold semantics (cosine distance math) - Clean up redundant list() calls59afc84 -
feat(phase6): Embeddings & Semantic Search implementation
- Added EmbeddingService with ChromaDB and SentenceTransformers - Updated SearchAgent to support semantic deduplication and search - Updated MagenticOrchestrator to use embeddings if available - Added 100% async-safe implementation with run_in_executor - Added comprehensive unit tests3bacbf8