Spaces:
Sleeping
Sleeping
Commit History
-
fix: Concept-era mixing in SEC fundamentals β most-recent-across-concepts everywhereβ
Root cause of MA's net income showing $3.1B/9.5% margin: companies migrate XBRL tags over time, and get_latest_value returned the FIRST concept with any data - for MA the legacy NetIncomeLoss tag whose 10-K facts end at FY2013 - then paired it with FY2025 revenue. Revenue alone had been switched to get_most_recent_across_concepts (with a comment describing this exact bug); all 104 extraction sites now use it. Margins additionally require same-period components (skipped + logged otherwise, surfacing as a DATA NOT PROVIDED gap downstream). Verified against live MA companyfacts: net income $14.97B FY2025, net margin 45.65%, consistent with EPS 16.54.5115fb8 -
fix: Period-mixing in SEC fundamentals extractionβ
10-K companyfacts embed quarterly-duration frames (Q4 values) alongside annual figures with the same form and end date; end-date sorting could pair annual revenue with quarterly net income (observed on MA: net margin computed as 9.5% instead of ~40%). Duration-typed facts now must span >=300 days; instantaneous balance-sheet facts pass through. Ratios are only computed from same-period components.ba43455 -
fix: Silent empty-valuation bug β never return an empty successβ
Root cause of chronically missing valuation data: when Yahoo (.info is blocked from datacenter IPs) and Alpha Vantage both failed, get_all_sources_valuation returned {} with no error key, so the client marked the basket 'available' and shipped an empty payload downstream - the original incomplete-SWOT handoff failure, surfaced by the new data gate on its first live run. - Empty results now return an explicit error (with per-source causes) so the basket is properly retried and reported in sources_failed - Alpha Vantage is called only when Yahoo fails: the parallel every-run supplementary call was burning the 25-req/day quota that the fallback path depends on - Same empty-success guard added to volatility and macro all_sources61be869 -
docs: Add business README for the Researcher data layer
5275683 -
chore: Remove dead Tradier integrationβ
fetch_tradier_implied_volatility was never called and no Tradier key has ever been provisioned; volatility is served by Yahoo + FRED (+ Alpha Vantage when keyed). Removes the fetcher, config, and .env.example entry.052525e -
feat: TTL task eviction and pinned dependenciesβ
- Evict completed/failed/canceled tasks from the in-memory TASK_STORE after 1h so long-running instances cannot grow unbounded - requirements.in + uv-compiled fully pinned requirements.txt for reproducible Docker builds (resolution matches today's validated build)7531716
-
chore: Audit fixes β SEC contact, complete .env.example, MIT LICENSEβ
- Replace placeholder contact@example.com in SEC EDGAR User-Agent headers (SEC fair-access policy requires a real contact; placeholder risks blocking) - Document all env vars actually read by the MCP servers in .env.example (FRED_VIX, Alpha Vantage, Tradier, BLS, BEA, NYT, NewsAPI) - Add MIT LICENSE file to match the README license badge - Untrack .obsidian/ editor config and reports/ test artifactsafc827a
-
fix: Initialize info variable to prevent NameError on retry failureβ
The yfinance retry loop could cause NameError if all retries failed because 'info' was only defined inside the try block. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>a8d6631 -
feat: Add EPS extraction to fundamentals-basketβ
- Add EPS_CONCEPTS for XBRL extraction (EarningsPerShareBasic, EarningsPerShareDiluted) - Add eps field to ParsedFinancials schema - Extract EPS in parse_financials() using unit="USD/shares" - Include eps in to_dict() output Closes gap where analyzer expected eps but MCP didn't provide it. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>03f045c -
docs: Fix field names in mcp_data_structure.md to match implementationβ
- macro-basket: cpi_yoy β cpi_inflation, unemployment_rate β unemployment, fed_funds_rate β interest_rate - valuation-basket: price_to_book β pb_ratio, price_to_sales β ps_ratio - Added notes explaining field meanings and fallback behavior Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>4edd0ae
-
fix: Update _extract_and_emit_metrics for flattened data structureβ
- Remove "data" wrapper lookups (structure was flattened) - Fix source names: bea_bls β bea/bls/fred separate - Fix valuation metric extraction (unwrap {value, as_of} dicts) - Fix news/sentiment to use source-keyed arrays Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>287f0b8 -
fix: Improve Reddit and yfinance reliabilityβ
- Reddit: Use browser-like User-Agent to avoid 403 blocks - Reddit: Add proper HTTP status code logging - yfinance: Add retry logic with exponential backoff for rate limits Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>30dbe43 -
chore: Bump version to 1.1.2β
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>b9618e8 -
fix: Remove broken configs import from news-basket MCP serverβ
Company name is already cleaned in app.py before reaching MCP servers, so this import was redundant and causing ModuleNotFoundError. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>bd752bd -
chore: Bump version to 1.1.1β
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>698592a -
fix: Add configs/ directory to Dockerfileβ
Missing import for company_name_filters caused Internal Server Error Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>842d4d3 -
fix: Clean company name suffixes before MCP server queriesβ
- Add stock suffixes to filters: "- Common Stock", "- Class A/B/C", etc. - Apply clean_company_name() in parse_research_request() - Prevents polluted search queries like "Microsoft Corporation - Common Stock stock news" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>89f2b8e -
Refactor: Source-keyed output format across all MCP serversβ
- MCPs now emit {source: {data: ...}} format directly - Simplify mcp_client.py normalizers to pass-through - Update news-basket to source-keyed structure (tavily, nyt, newsapi) - Update data schema docs to reflect new output format - Streamline fundamentals orchestrator Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>50c0d03 -
Cleanup: Remove obsolete docs, add new schemas, deduplicate configsβ
- Remove 24 obsolete documentation files (old schemas, test reports) - Add CLAUDE.md project instructions - Add new docs: mcp_output_schemas.md, nvidia_mcp_output_sample.md, sec_edgar_data_schema.md - Deduplicate company_name_filters.py (use root /configs/ version) - Update news-basket to import from shared configs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>332e21c
-
Feat: Industry-specific metrics via SIC code detection + company addressβ
- Add SIC-to-sector mapping for 13 industries (config.py) - Add industry-specific XBRL concept mappings for: Insurance, Banks, REITs, Oil & Gas, Utilities, Technology, Healthcare, Retail, Financials, Industrials, Transportation, Materials, Mining - Add 60+ industry-specific fields to ParsedFinancials schema - Extract industry metrics based on detected sector (parser.py) - Add business_address extraction from SEC EDGAR submissions - Include company info (with address) in get_all_sources_fundamentals - Add Company Info section to E2E test report Tested with CVX (Oil & Gas), V (Financials), L (Insurance) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>ab2f4fb -
Fix: Include fiscal_year and form in fundamentals MCP outputβ
The orchestrator's to_metric_dict helper was only returning value, end_date, and data_type fields - missing fiscal_year and form which are needed by the frontend to properly identify SEC EDGAR data. Updated all three to_metric_dict helpers in orchestrator.py to include the full temporal metadata from TemporalMetric. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>5ba49c2 -
Fix end_date emission for valuation, volatility, and macro metricsβ
- Volatility: Use per-metric dates (VIX uses "date", beta/hist_vol use "as_of") - Macro: Use per-metric "date" field (actual data dates like "2025Q3", "2025-12-01") - Valuation: Use regular_market_time from yahoo_finance (last trading day) Results: - GDP_growth: 2025Q3 (not fetch date) - interest_rate: 2025-12-01 - VIX: 2026-01-08 (last observation) - beta/hist_vol: 2026-01-09 - P/E, P/B, P/S: 2026-01-09 (market time) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>8b9a7b7 -
Revert "Fix: Include fiscal_year and form in SEC EDGAR metric responses"β
This reverts commit 48fb7139e860a1c7506db8aa6a9d9b9696b4b762.b702fee -
Fix: Include fiscal_year and form in SEC EDGAR metric responsesβ
The to_metric_dict helper was only including value, end_date, and data_type but omitting fiscal_year and form fields from TemporalMetric objects. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>48fb713 -
Fix: Standardize MCP server timeouts to 90s and use subprocess+MCP in testsβ
- Remove server_legacy.py (unused direct import path) - Update test_mcp_e2e.py to use subprocess+MCP protocol (same as production) - Standardize TOOL_TIMEOUT to 90s across all MCP servers to match mcp_client - fundamentals: 60s -> 90s - valuation: 45s -> 90s - volatility: 45s -> 90s - macro: 45s -> 90s (was causing timeouts on HuggingFace) - news: 45s -> 90s - sentiment: 60s -> 90s Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>d377800
-
Add human-readable output format documentationβ
Added example output tables for quantitative and qualitative data using markdown format matching mcp_test_report format. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>f28dae4 -
Add output format documentation to metrics schemaβ
Documents the JSON output structure for: - Aggregated response from fetch_all_research_data - Individual MCP outputs (fundamentals, valuation, volatility, macro, news, sentiment) - Streamed partial_metrics format Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>7b2e271 -
Fix: Include partial_metrics in COMPLETED responsesβ
News and sentiment metrics were stored but never sent to client because partial_metrics was only included when status was WORKING. When the task completed (quickly after news/sentiment finish), the final poll got COMPLETED status without partial_metrics. Fix: Include partial_metrics for both WORKING and COMPLETED status so the client can receive all metrics on the final poll. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>fb7f46b -
Fix env loading in all MCP serversβ
All 6 MCP servers had a bug where they would `break` after loading the first .env file found (~/.env). This caused project-specific API keys in Researcher-Agent/.env to never be loaded. Fix: Load ALL .env files with override=True, so project-specific keys properly override base config. Order: ~/.env (base) -> project root (overrides) -> server dir (highest priority). Affected servers: - fundamentals-basket - valuation-basket - volatility-basket - macro-basket - news-basket - sentiment-basket Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>0b347d4 -
Add schema normalizers for MCP output consistencyβ
- Add _normalize_fundamentals(), _normalize_valuation(), _normalize_volatility(), _normalize_macro() - Flatten sources wrapper to top-level keys (sec_edgar, yahoo_finance, etc.) - Rename financials to fundamentals for consistency across codebase - Add docs: metrics_schema_emitted.md, schema_normalization.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>26c5c2f
-
Add NewsAPI as third news sourceβ
- Add newsapi_search function for NewsAPI.org - Update search_company_news to fetch from Tavily + NYT + NewsAPI in parallel - 150,000+ sources coverage (24hr delay on free tier) π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>210e257 -
Add NYT Article Search API as news sourceβ
- Add nyt_search function for NYT Article Search API - Update search_company_news to fetch from Tavily + NYT in parallel - Add nyt_search as standalone MCP tool - Rate limit: 5 req/min, 500 req/day π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1707aaf -
Fix news metric extraction - use 'results' fieldβ
π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>4de32a0
-
Fix mcp_client.py - restore nested financials/debt accessβ
The get_sec_fundamentals_basket returns nested structure: {"financials": {...}, "debt": {...}} Reverted incorrect change that tried to access result.get("revenue") directly. Correct access is result.get("financials").get("revenue"). π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>7de6ec4 -
Fix temporal data for calculated metrics (margins, debt_to_equity)β
financials-basket/server.py: - Add create_temporal_metric() helper to inherit temporal data from source metrics - Update margin calculations (gross, operating, net) to preserve fiscal period - Update debt_to_equity calculation to preserve fiscal period - Update SWOT analysis to handle both dict and plain number formats mcp_client.py: - Fix structure: result IS the financials data, not nested under "financials" key - Handle temporal data for net_margin_pct and debt_to_equity dicts - Add fallback for old format (plain numbers) π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>fbe5ac1 -
Refactor emit_metric to use structured payload dictβ
Pass a single dict payload instead of positional args to avoid arg-order bugs and ensure temporal fields (fiscal_year, end_date, form) are not dropped. Adds debug logging of the JSON payload. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>e7b767d -
Add comprehensive null checks in _extract_and_emit_metricsβ
Fix NoneType errors by using defensive patterns: - Use `or {}` instead of `.get(key, {})` to handle explicit None values - Add isinstance() checks before accessing dict methods - Extract values to variables before checking π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>2901968 -
Add status messages for empty news/sentiment dataβ
When news or sentiment MCPs return no usable data, emit a "status" metric explaining why (e.g., "No recent news found") instead of showing empty data in the UI. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>584203d -
Add temporal data streaming to A2A partial_metricsβ
- Add end_date, fiscal_year, form fields to MetricEntry - Update emit_metric() to accept temporal parameters - Extract temporal data from financials MCP response - Stream fiscal period info (FY 2023, Q3 2024) via A2A π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>f286eb6 -
Fix NoneType error for companies with incomplete SEC dataβ
Add defensive null checks to get_latest_value() and calculate_growth() to handle cases where SEC EDGAR returns incomplete data for smaller companies (e.g., VBNK). The us-gaap namespace may be missing or contain incomplete concept data. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>34989f6
-
Initial commit: Researcher Agentβ
A2A research service with TRUE MCP protocol: - FastAPI A2A server (JSON-RPC 2.0) - MCP client via subprocess + JSON-RPC handshake - 6 bundled MCP servers (financials, valuation, volatility, macro, news, sentiment) - Partial metrics streaming during research π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>d66c6c9