Moves JSON parsing inside try/except block to handle API
maintenance pages gracefully. Adds JSONDecodeError handling.
- Add `import json` at top of file
- Move `search_resp.json()` inside try block (line 84)
- Add `except json.JSONDecodeError` handler with warning log
- Return empty list on invalid JSON (graceful degradation)
- Add unit test for maintenance page scenario
Fixes: production crash on PubMed maintenance pages
* 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.
* fix(SPEC_11): address CodeRabbit review feedback
- Update run_full.py docstring to reference sexual health pipeline (not drug repurposing)
- Update run_full.py help text to use sexual health query example
- Fix app.py domain display to show "Sexual Health" (not "Sexual_Health")
- Update test_nodes.py mock data to use sexual health terms (Testosterone, Androgen Receptor)
- Add @pytest.mark.unit markers to test_judges.py test classes
- Add specific assertion for next_search_queries in test_judges.py
- Add missing @pytest.mark.asyncio marker to test_mcp_tools.py
- Update test_mcp_tools.py and test_clinicaltrials.py to use sexual health queries
- Fix SPEC_12 markdown bare code fence (MD040)
* fix(SPEC_11): comprehensive domain alignment audit
Second pass of CodeRabbit review fixes - found additional domain mismatches:
- examples/search_demo/run_search.py: Update docstring from "drug repurposing" to "sexual health"
- examples/orchestrator_demo/run_agent.py: Update help text from "metf…
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.
feat: Wire LlamaIndex RAG into Simple Mode (Tiered Embedding) (#83)
- 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 checks
Enhanced test files by adding type annotations to test functions and fixtures for better clarity and type checking. Cleaned up import statements and ensured consistent formatting across test cases.
Added filters for Interventional studies and Active/Completed status to ClinicalTrials tool. This removes noise from observational or terminated studies.
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.
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.
- Move network reachability check to runtime in test_clinicaltrials.py
(avoids 5s delay at test collection time)
- Add explicit api_provider validation in app.py
(raises ValueError for unsupported providers instead of silent fallback)
feat: add demo mode warnings and BYOK (Bring Your Own Key) support
Claude
Unverified signature
4d87419
Changes:
- Add clear "Demo Mode" warning when no API keys are configured
- Add BYOK feature allowing users to input their own API key in Gradio UI
- Improve MockJudgeHandler to extract meaningful info from real search results
instead of hardcoded "Drug A", "Drug B" placeholders
- Add API provider selection (OpenAI/Anthropic) for user-provided keys
- Skip integration tests when external APIs are unreachable (SSL/network issues)
This fixes the issue where users saw mock data ("Drug A", "Drug B", "Finding 1")
without any indication they were in demo mode. Now:
1. Users are clearly informed when running in demo mode
2. Users can enter their own API key for full AI-powered analysis
3. Demo mode shows real search results with extracted findings
* 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 handling
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 condition
feat: Implement Phase 10 (ClinicalTrials.gov) with requests
* 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…
* 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…