TradingAgents/tests/unit
ahmet guzererler 4c14080d73
feat(scanner): Finviz smart money scanner + Golden Overlap strategy
## Summary
- Adds `smart_money_scanner` as a new Phase 1b node that runs sequentially after `sector_scanner`, surfacing institutional footprints via Finviz screeners
- Introduces the **Golden Overlap** strategy in `macro_synthesis`: stocks confirmed by both top-down macro themes and bottom-up Finviz signals are labelled high-conviction
- Fixes model-name badge overflow in AgentGraph (long model IDs like OpenRouter paths were visually spilling into adjacent nodes)
- Completes all documentation: ADR-014, dataflow, architecture, components, glossary, current-state

## Key Decisions (see ADR-014)
- 3 zero-parameter tools (`get_insider_buying_stocks`, `get_unusual_volume_stocks`, `get_breakout_accumulation_stocks`) instead of 1 parameterised tool — prevents LLM hallucinations on string args
- Sequential after `sector_scanner` (not parallel fan-out) — gives access to `sector_performance_report` context and avoids `MAX_TOOL_ROUNDS=5` truncation in market_movers_scanner
- Graceful fallback: `_run_finviz_screen()` catches all exceptions and returns an error string — pipeline never hard-fails on web-scraper failure
- `breakout_accumulation` (52-wk high + 2x vol = O'Neil CAN SLIM institutional signal) replaces `oversold_bounces` (RSI<30 = retail contrarian, not smart money)

## Test Plan
- [x] 6 new mocked tests in `tests/unit/test_scanner_mocked.py` (happy path, empty DF, exception, sort order)
- [x] Fixed `tests/unit/test_scanner_graph.py` — added `smart_money_scanner` mock to compilation test
- [x] 2 pre-existing test failures excluded (verified baseline before changes)
- [x] AgentGraph badge: visually verified truncation with long OpenRouter model identifiers

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-03-24 16:03:17 +01:00
..
agents Parallel pre-fetch for analyst agents to reduce LLM round-trips 2026-03-23 21:08:15 +00:00
__init__.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
conftest.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_alpha_vantage_exceptions.py fix(tests): complete PR #26 — enforce socket isolation in unit tier and add test suite reference doc (#30) 2026-03-19 17:41:25 +01:00
test_alpha_vantage_integration.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_alpha_vantage_scanner.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_api_usage.py Add API consumption estimation module and CLI command 2026-03-21 17:25:26 +00:00
test_cli_main_tools.py 🧪 Implement robust tool call parsing and unit tests 2026-03-21 14:56:12 +00:00
test_config_wiring.py merge: sync with upstream TauricResearch/TradingAgents v0.2.2 2026-03-23 12:17:25 +00:00
test_debate_rounds.py merge: sync with upstream TauricResearch/TradingAgents v0.2.2 2026-03-23 12:17:25 +00:00
test_e2e_api_integration.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_env_override.py fix(tests): complete PR #26 — enforce socket isolation in unit tier and add test suite reference doc (#30) 2026-03-19 17:41:25 +01:00
test_finnhub_integration.py Fix Finnhub API error handling and add coverage 2026-03-21 14:51:29 +00:00
test_finnhub_scanner_utils.py 🧪 Add unit tests for _safe_fmt in finnhub_scanner 2026-03-21 22:20:19 +00:00
test_incident_fixes.py fix: harden dataflows layer against silent failures and data corruption 2026-03-22 07:23:14 +01:00
test_industry_deep_dive.py test: add tests and parsing logic for text formats in _extract_top_sectors 2026-03-21 08:28:35 +00:00
test_json_utils.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_langgraph_engine_extraction.py Fix report saving, event storing, auto tickers, portfolio report loading, and state propagation 2026-03-23 18:33:11 +00:00
test_langgraph_engine_run_modes.py Add tests for LangGraphEngine run modes (run_scan, run_pipeline, run_portfolio, run_auto) 2026-03-23 20:06:27 +00:00
test_macro_bridge.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_macro_regime.py Merge pull request #54 from aguzererler/test-macro-regime-fmt-pct-18208719821293052000 2026-03-21 17:36:20 +01:00
test_notebook_sync.py Fix security vulnerability in NotebookLM sync subprocess calls 2026-03-21 22:17:55 +00:00
test_peer_comparison.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_portfolio_tools.py feat: add portfolio risk metrics module and LangChain agent tools 2026-03-20 14:42:43 +00:00
test_scanner_fallback.py refactor(tests): consolidate live-API tests into integration/, move mocked tests to unit/ 2026-03-19 14:24:52 +01:00
test_scanner_graph.py feat(scanner): Finviz smart money scanner + Golden Overlap strategy 2026-03-24 16:03:17 +01:00
test_scanner_mocked.py feat(scanner): Finviz smart money scanner + Golden Overlap strategy 2026-03-24 16:03:17 +01:00
test_security_notebook_sync.py Fix security vulnerability in NotebookLM sync subprocess calls 2026-03-21 22:17:55 +00:00
test_stockstats_utils.py 🧪 Resolve PRs #56, #58, and #60 2026-03-21 16:51:49 +00:00
test_ttm_analysis.py Merge pull request #69 from aguzererler/copilot/review-financial-tools-implementation 2026-03-21 22:41:55 +01:00
test_vendor_failfast.py Add integration and unit tests for scanner routing, TTM analysis, vendor fail-fast, and yfinance data layer 2026-03-19 13:51:57 +01:00
test_yfinance_integration.py 🧪 Add tests for _extract_article_data in yfinance_news.py 2026-03-21 08:23:12 +00:00