Spaces:
Sleeping
Sleeping
Commit History
-
feat: Implement Free Tier synthesis using HuggingFace Inference
- Added a new synthesis method in the JudgeHandler to utilize free HuggingFace Inference for narrative generation in Free Tier mode. - Updated the Orchestrator to check for the judge's synthesis method, ensuring consistent behavior across judging and synthesis. - Enhanced integration and unit tests to verify the correct usage of the new synthesis method and fallback mechanisms. - Documented the bug related to synthesis incorrectly using server-side API keys, outlining the root cause and potential fixes. This change addresses user confusion and improves the Free Tier experience by ensuring expected functionality without requiring an API key.e18ea9a -
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 -
fix(SPEC_11): address CodeRabbit review feedback (#92)
Unverified signature* 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…89f1173 -
feat: SPEC_10 - Domain-Agnostic Refactor + License Fix (#87)
Unverified signature* feat: implement SPEC_10 domain-agnostic refactor * fix: complete SPEC_10 audit - license + HierarchicalOrchestrator domain License Fixes: - LICENSE: Fix copyright "Antibody Training Pipeline ESM" → "DeepBoner Contributors" - pyproject.toml: Add missing license = "Apache-2.0" field - README.md: Fix frontmatter license: mit → apache-2.0 Domain Threading Fixes: - hierarchical.py: Add domain param to __init__ and pass to ResearchTeam - factory.py: Pass domain to HierarchicalOrchestrator All 237 tests pass. Domain now properly threaded through all orchestrators. * test: enhance domain handling in orchestrators and judges - Updated unit tests for `configure_orchestrator` to include mock mode and free tier scenarios, ensuring the domain is correctly passed to handlers. - Refactored tests for `JudgeHandler` to mock model retrieval, allowing for domain acceptance without API key requirements. - Improved `AdvancedOrchestrator` tests to mock API key validation and ensure domain handling i…fd1472e
-
fix(P0): Implement SPEC_06 - Simple Mode Synthesis Fix (#71)
Unverified signature* feat: implement SPEC_06 fixes for simple mode synthesis Implements research-backed architecture changes for Simple mode: - Diverse evidence selection with lost-in-the-middle mitigation - Debiased judge prompt (scoring only, no decision making) - Code-enforced termination criteria (prevents infinite loops) - Real partial synthesis with drug candidates when max iterations reached - Unit and integration tests for all new logic * fix: address CodeRabbit review feedback - Fix type annotation: recommendation str -> Literal["continue", "synthesize"] - Add @pytest.mark.unit markers to unit tests - Add @pytest.mark.integration markers to integration tests - Simplify early/late evidence assertions using set intersection - Replace next() with explicit filtering for clearer test diagnostics - Extract hardcoded thresholds (50, 30) to TERMINATION_CRITERIA - Fix e2e mock to accept iteration/max_iterations parameters All 177 tests pass, mypy clean, ruff clean. * docs: add P3 architectural gap r…5cac97d -
refactor: add session reset + document magic number (senior review feedback)
2588375 -
fix: P0 dedup bug + HF judge infinite loop prevention
Bug 1 - Semantic Dedup Removing All Evidence: - Was calling _deduplicate_and_rank(all_evidence) every iteration - Old items already in vector store found THEMSELVES as duplicates - Fix: Only dedup NEW evidence, not entire accumulated list Bug 2 - HF Judge Infinite Loop: - HF Inference failures returned "continue" with 0% confidence - Loop never terminated when API kept failing - Fix: Track consecutive failures, force "synthesize" after 3 failures Both bugs caused Simple mode (free tier) to loop forever with no output. Now: Evidence accumulates properly AND loop terminates gracefully.5e761eb -
style: integrate CodeRabbit review feedback
- Add @pytest.mark.unit to streaming fix tests - Simplify API key fallback: nested ternary → (x or y) or None - Clean up commented-out event handler code in app.py - Add language specifiers to markdown code blocks (text, bash) - Remove redundant fallback in judges.py _extract_key_findings All 138 tests passing.82503b1 -
refactor(judges): extract shared title-extraction helper
Address CodeRabbit nitpicks: - Add language tag to fenced code block in docs - Extract _extract_titles_from_evidence() to reduce duplication between HFInferenceJudgeHandler and MockJudgeHandler All 136 tests pass.b8dbd20 -
fix(judges): fallback to heuristic extraction when HF quota exhausted
11ad1dd -
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: 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
-
feat: implement dual-mode architecture (Simple + Advanced) (#45)
Unverified signature* docs: add dual-mode architecture specification Senior agent reviewed and approved. Key documents: - 00_SITUATION_AND_PLAN.md: Problem analysis, branch states, recommended path - 01_ARCHITECTURE_SPEC.md: Dual-mode architecture (Simple + Advanced) - 02_IMPLEMENTATION_PHASES.md: 6-phase implementation plan - 03_IMMEDIATE_ACTIONS.md: Quick reference checklist Architecture: pydantic-ai (structured outputs) + Microsoft Agent Framework (orchestration) are COMPLEMENTARY, not competing. Dual-mode allows graceful degradation to free tier when no API keys available. * docs: add follow-up review request for senior agent verification * feat: implement dual-mode architecture (Simple + Advanced) Phase 1 - Pydantic-AI Improvements (Simple Mode): - Add HuggingFace provider support in judges.py with get_model() - Add huggingface_model and hf_token config fields - Tests in test_judges_factory.py Phase 2 - Orchestrator Factory: - Implement create_orchestrator() with auto-detection logic - Simple m…b2929fc -
fix(magentic): defensive text extraction & cleanup biorxiv refs
Add _extract_text to fix ChatMessage object output bug. Update bioRxiv strings to Europe PMC. Add regression test.3bfd42c -
fix: address CodeRabbit feedback and P0 blockers
Code Fixes (HIGH priority): - Add API key/provider validation to prevent silent auth failures - Fix hardcoded manager model in orchestrator_magentic.py (now uses settings.openai_model) - Add bounds checking to JSON extraction in judges.py (prevents IndexError) - Fix fragile test assertion in test_judges_hf.py Code Quality (MEDIUM priority): - Add explicit type annotation for models_to_try: list[str] - Fix structured logging (f-string → structured params) - Align fallback query count (3 queries) between handlers Test Improvements: - Add @pytest.mark.unit decorator to TestHFInferenceJudgeHandler Documentation Sync: - Update Phase 3 docs to match actual implementation: - __init__ signature (simplified, no inline imports) - _extract_json (string split with bounds checking) - _call_with_retry (tenacity decorator, asyncio.get_running_loop()) - assess method (simplified model loop) - Update Phase 4 docs with ChatInterface additional_inputs for BYOK All 104 tests pass.f985224 -
feat: implement HFInferenceJudgeHandler for free-tier AI analysis
Replace MockJudgeHandler with real AI analysis using HuggingFace Inference API: - Add HFInferenceJudgeHandler with chat_completion API - Model fallback chain: Llama 3.1 → Mistral → Zephyr (ungated) - Robust JSON extraction (handles markdown blocks, nested braces) - Tenacity retry with exponential backoff for rate limits - Fix app.py to use HF Inference when no paid API keys present Priority: User API key → Env API key → HF Inference (free) Hackathon judges now get real AI analysis without needing API keys. Set HF_TOKEN as Space secret for best model (Llama 3.1).7fab6d4
-
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: add demo mode warnings and BYOK (Bring Your Own Key) support
ClaudeUnverified signatureChanges: - 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 findings4d87419
-
fix: pass API keys explicitly to pydantic-ai providers
- Use OpenAIProvider and AnthropicProvider with explicit api_key - Removes need for users to source .env or export vars manually - Update default OpenAI model to gpt-5.1 - Frictionless UX: just add keys to .env and run examples1f96735 -
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: add type ignore comment for Agent instantiation in JudgeHandler
Updated the Agent instantiation in JudgeHandler to include a type ignore comment, addressing type-checking issues while maintaining functionality.9760706 -
fix(tests): resolve mypy divergence and test failures
- Add pydantic-ai to pre-commit mypy dependencies to fix divergence between local mypy and CI (both now recognize Agent overloads) - Fix JudgeHandler tests to mock get_model() which instantiates OpenAIModel at import time (requires API key)95d2e29 -
feat(phase3): implement judge slice (LLM Judge, Prompts, Models)
Implemented LLM-based Judge Agent with PydanticAI for structured output. Includes 100% test coverage and fallback mechanisms.d7e5abb -
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