Commit Graph

3 Commits

Author SHA1 Message Date
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
copilot-swe-agent[bot] e6b0f14087 docs: add data types, sizes, and context window budget to agent_dataflow.md
Add per-agent Prompt Size Budget tables (all 17 agents) with data type,
format, and token estimates. Add three new reference sections:
- Section 7: Tool Data Formats & Sizes (20 tools with format, size, limits)
- Section 8: Context Window Budget (model reference + per-agent risk table)
- Section 9: End-to-End Token Estimates (trading ~98K, scanner ~13K tokens)

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-19 20:42:35 +00:00
copilot-swe-agent[bot] 5e3a8e5ba0 docs: add comprehensive agent data flow documentation
Create docs/agent_dataflow.md covering all 17 agents with:
- Thinking modality overview (quick/mid/deep tier assignments)
- Trading pipeline flow diagram (analysts → debate → trader → risk)
- Scanner pipeline flow diagram (parallel scanners → deep dive → synthesis)
- Per-agent data flows with inputs, tools, data sources, LLM prompts, outputs
- Tool-to-data-source mapping table
- Memory system documentation

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-19 20:19:52 +00:00