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 -
feat(clinicaltrials): SPEC_14 Outcome Measures (#100)
Unverified signature* feat: add outcome measures to ClinicalTrials.gov tool - Add OutcomesModule and HasResults to FIELDS constant - Extract primary outcomes with measure and timeFrame - Show results availability status with posted date - Boost relevance for trials with results (0.90 vs 0.85) - Add 4 unit tests per SPEC_14 Closes #95 * fix: address CodeRabbit review feedback for SPEC_14 - Fix unconditional ellipsis: Only add "..." when summary > 400 chars - Refine primary outcome truncation: Build full string before truncating - Extract _extract_primary_outcome() helper to reduce statement count - Add identificationModule to test mock for completeness Addresses review comments on PR #100. * test: add pytest.skip for API flakiness resilience Add defensive skip if ClinicalTrials.gov API returns no results, making the integration test more resilient to external API changes. Addresses CodeRabbit review feedback on PR #100.de1af88 -
feat(search): SPEC_13 Evidence Deduplication (#98)
Unverified signature* feat(search): implement evidence deduplication (SPEC_13) - Add PMID extraction to OpenAlex tool (from ids.pmid) - Implement deduplicate_evidence and extract_paper_id in SearchHandler - Support deduplication across PubMed, Europe PMC (MED, PMC, PPR, PAT), OpenAlex, and ClinicalTrials - Add comprehensive unit tests for deduplication logic * test: complete SPEC_13 test coverage (senior review findings) Missing tests added per spec: - test_extracts_europepmc_pat_id_eu_format (EP patent format) - test_preserves_openalex_without_pmid (critical edge case) - test_keeps_unidentifiable_evidence (conservative behavior) - test_clinicaltrials_unique_per_nct (NCT uniqueness) - test_preprints_preserved_separately (PPR vs PMID) - test_extracts_pmid_from_ids_object (OpenAlex PMID extraction) - test_pmid_is_none_when_not_present (null case) Code improvements: - Move `import re` to module level in openalex.py (efficiency) - Add SAMPLE_OPENALEX_WITH_PMID fixture for cross-dedup testing All 35 tests…2c5db87 -
feat(SPEC_11): finalize transition to Sexual Health Research Specialist
This commit completes the transition of DeepBoner to a dedicated Sexual Health Research Agent by removing all references to "general" and "drug repurposing" domains. Key changes include: - Updated domain defaults to exclusively use "sexual_health". - Replaced all example queries and documentation to reflect a focus on sexual health topics. - Removed any lingering references to non-sexual health concepts in code and tests. - Ensured all tests are aligned with the new domain focus, passing successfully. This change reinforces the project's identity and simplifies the codebase, enhancing clarity and usability for users focused on sexual health research. Closes #89.fa696e8
-
feat(tools): add OpenAlex integration with citation-based ranking
- Implemented OpenAlexTool in src/tools/openalex.py - Added comprehensive unit and integration tests in tests/unit/tools/test_openalex.py - Updated src/tools/__init__.py to export the new tool - Updated SPEC_03 with final implementation details and test patterns - Features: Citation count sorting, abstract reconstruction, concept tagging, OA links - Verified with 100% test pass rate and clean lint/type checksfd28242 -
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
-
feat: add hierarchical orchestration with web search (integrates PR #44) (#46)
Unverified signature* feat: add hierarchical orchestration with web search (from PR #44) Based on contribution by @EmployeeNo427 with fixes: New features: - WebSearchTool using DuckDuckGo for web searches - SubIterationMiddleware for research loop pattern - HierarchicalOrchestrator with judge-based refinement - RetrievalAgent for web-based evidence gathering - CodeExecutorAgent for Modal sandbox execution - LLMSubIterationJudge for LLM-based assessment - src/state/ package for state management Fixes applied: - Added chroma_db/ to .gitignore (was committed as binaries) - Added structlog logging per coding guidelines - Added pytest markers to new tests - Fixed silent exception swallowing in orchestrator - Preserved dual-mode architecture from PR #45 - Added "web" to SourceName type - Fixed mypy type errors Co-authored-by: EmployeeNo427 <45109567+EmployeeNo427@users.noreply.github.com> * fix: resolve mypy type errors in middleware and agents * fix: remove type argument from SubIterationTeam --------- …20f762e -
feat: implement async-safe rate limiting (Phase 17) (#40)
Unverified signature- Add 'limits' library dependency - Implement async RateLimiter with finer-grained polling (0.01s) - Refactor PubMedTool to use shared singleton limiter - Add comprehensive unit tests and demo script316dc7d -
feat: add roadmap summary and detailed improvement plans for data sources
- Introduced new documentation files outlining the current state and future improvements for DeepCritical's data sources: PubMed, ClinicalTrials.gov, Europe PMC, and OpenAlex. - Each document includes sections on current implementation, strengths, limitations, recommended improvements, and integration opportunities. - Added a comprehensive roadmap summary to guide future maintainers and enhance project maintainability.9286db5 -
feat(search): implement ClinicalTrials.gov filtering (Phase 03)
Added filters for Interventional studies and Active/Completed status to ClinicalTrials tool. This removes noise from observational or terminated studies.d55440b -
feat(search): implement PubMed query preprocessing (Phase 02)
Added query preprocessing to strip question words and expand medical synonyms (e.g., 'Long COVID' -> 'PASC'). This fixes poor search results for natural language queries.e502f0d -
refactor(tools): replace BioRxiv with Europe PMC (Phase 01)
Replaced broken BioRxivTool with EuropePMCTool which supports keyword search. Updated all agents, MCP tools, and examples to use the new tool. Deleted legacy BioRxiv implementation.2f8ae1f
-
fix: wire EmbeddingService to simple orchestrator + improve search quality
Major fixes: - Wire EmbeddingService to simple orchestrator for semantic deduplication (was built but not connected - see docs/bugs/005) - Expand BioRxiv stop words (~100) and require minimum 2 term matches to filter out irrelevant papers - Fix MockJudgeHandler to return honest message instead of garbage drug candidates extracted via broken heuristics The simple orchestrator now uses local sentence-transformers for semantic deduplication without requiring any API keys. Bug documentation added in docs/bugs/005_services_not_integrated.md2e4a760 -
feat: Phase 11 bioRxiv Preprint Integration (#19)
Unverified signature* feat: Implement Phase 11 (bioRxiv Preprint Integration) * chore: add .mypy_cache to .gitignore * fix: address CodeRabbit review feedback for bioRxiv tool - Catch httpx.RequestError for network failures (major issue) - Use SourceName type alias in Citation model (DRY) - Only add '...' suffix when abstract is truncated - Add test for network error handlinge67c99f -
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 -
refactor: address CodeRabbit review feedback for Mario integration
CRITICAL fix: - Centralize sandbox library versions (SANDBOX_LIBRARIES constant) - Use shared config for both Modal image and LLM prompts - Prevent version mismatch between generated code and execution MAJOR fixes: - Use run_in_executor() for blocking Modal calls in async context - Lazy initialize code executor to avoid failing on import - Remove redundant hypothesis check (unreachable code) - Simplify semantic search placeholder (dead code paths) Minor fixes: - Update docs: Docker → Modal Sandbox terminology - Fix docstring claiming ConfigurationError (only warns)cbd94a4 -
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 -
refactor: address CodeRabbit nitpicks for Phase 10
- Centralize SourceName type alias in models.py - Update search_handler.py to use SourceName (reduces cast brittleness) - Update app.py intro text to mention ClinicalTrials.gov - Update run_search.py docstring for multi-source search - DRY test setup with mock_requests_get fixture - Speed up error test by patching tenacity retry stop condition1bc9785 -
feat: Implement Phase 10 (ClinicalTrials.gov) with requests
4e2ccbf -
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 5 review feedback
Critical fixes: - Fix invalid model names (gpt-5.1 → gpt-4o, claude-sonnet-4-5 → claude-sonnet-4-20250514) - Add OpenAI key validation in MagenticOrchestrator with clear error message - Document Magentic mode's OpenAI-only requirement Nitpicks: - Add streaming icon to AgentEvent.to_markdown() - Use exact equality for PubMed placeholder detection - Update app.py info text for API key requirements - Add language identifiers to markdown code blocks in docsd247864 -
fix: pydantic-ai v1 compatibility and Anthropic model update
- Use result.output instead of deprecated result.data (pydantic-ai v1) - Update Anthropic model to claude-sonnet-4-5 - Remove redundant cast in judges.py - Add orchestrator_demo example for end-to-end testing - Fix NCBI_API_KEY placeholder handling in pubmed.py - Update tests to use .output instead of .data4732667 -
fix(phase2): address CodeRabbit review feedback + add examples
CodeRabbit fixes: - Fix deprecated asyncio.get_event_loop() → get_running_loop() - Remove dead flatten() function from search_handler.py - Remove redundant getattr() in pubmed.py - Add truncation rationale comments New: - Add examples/search_demo/ with run_search.py demo script - Add examples/README.md32e3b61 -
fix: resolve mypy divergence between make check and pre-commit
- Add tenacity>=8.2 to pre-commit mypy additional_dependencies - Remove now-unnecessary type: ignore comment from pubmed.py Root cause: pre-commit mypy was missing tenacity, so it couldn't resolve the @retry decorator's type signature.cace02f -
feat(phase2): implement search slice (PubMed, Web, Orchestrator) (#4)
Implemented search tools with strict TDD and scatter-gather pattern. 100% test coverage.499170b -
feat(phase1): Foundation & Tooling complete
* feat: initialize deepcritical project structure with core configuration and main functionality - Added initial project files including `.python-version`, `pyproject.toml`, and main application logic in `main.py`. - Implemented application configuration using Pydantic in `src/utils/config.py` with environment variable support. - Created directory structure for source code and tests, including placeholders for agents, prompts, tools, and utilities. - Added unit tests for configuration loading and validation in `tests/unit/utils/test_config.py`. Review Score: 100/100 (Ironclad Gucci Banger Edition) * feat(phase1): complete foundation with Python 3.11, tests, and tooling - Fix Python version to 3.11 for HuggingFace Spaces compatibility - Add config.py with pydantic-settings for typed configuration - Add exceptions.py with custom exception hierarchy - Add conftest.py with test fixtures (sample_evidence deferred to Phase 2) - Add .env.example and .pre-commit-config.yaml - Remove refere…069f0a0
-
adds scaffolding
Joseph Pollack6fbbcda