TradingAgents/tests
ahmet guzererler a90f14c086
feat: unified report paths, structured observability logging, and memory system update (#22)
* gitignore

* feat: unify report paths under reports/daily/{date}/ hierarchy

All generated artifacts now land under a single reports/ tree:
- reports/daily/{date}/market/ for scan results (was results/macro_scan/)
- reports/daily/{date}/{TICKER}/ for per-ticker analysis (was reports/{TICKER}_{timestamp}/)
- reports/daily/{date}/{TICKER}/eval/ for eval logs (was eval_results/{TICKER}/...)

Adds tradingagents/report_paths.py with centralized path helpers used by
CLI commands, trading graph, and pipeline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: structured observability logging for LLM, tool, and vendor calls

Add RunLogger (tradingagents/observability.py) that emits JSON-lines events
for every LLM call (model, agent, tokens in/out, latency), tool invocation
(tool name, args, success, latency), data vendor call (method, vendor,
success/failure, latency), and report save.

Integration points:
- route_to_vendor: log_vendor_call() on every try/catch
- run_tool_loop: log_tool_call() on every tool invoke
- ScannerGraph: new callbacks param, passes RunLogger.callback to all LLM tiers
- pipeline/macro_bridge: picks up RunLogger from thread-local, passes to TradingAgentsGraph
- cli/main.py: one RunLogger per command (analyze/scan/pipeline), write_log()
  at end, summary line printed to console

Log files co-located with reports:
  reports/daily/{date}/{TICKER}/run_log.jsonl   (analyze)
  reports/daily/{date}/market/run_log.jsonl     (scan)
  reports/daily/{date}/run_log.jsonl            (pipeline)

Also fix test_long_response_no_nudge: update "A"*600 → "A"*2100 to match
MIN_REPORT_LENGTH=2000 threshold set in an earlier commit.

Update memory system context files (ARCHITECTURE, COMPONENTS, CONVENTIONS,
GLOSSARY, CURRENT_STATE) to document observability and report path systems.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 09:06:40 +01:00
..
conftest.py feat: add scanner tests, global demo key in conftest, remove 48 inline key patches 2026-03-17 16:01:52 +00:00
test_alpha_vantage_exceptions.py feat: add scanner tests, global demo key in conftest, remove 48 inline key patches 2026-03-17 16:01:52 +00:00
test_alpha_vantage_integration.py feat: add scanner tests, global demo key in conftest, remove 48 inline key patches 2026-03-17 16:01:52 +00:00
test_alpha_vantage_scanner.py feat: Complete 3-phase LLM scanner pipeline with inline tool execution 2026-03-17 08:41:40 +01:00
test_config_wiring.py fix: resolve 12 pre-existing test failures across 5 test files 2026-03-18 11:11:00 +01:00
test_debate_rounds.py feat: medium-term positioning upgrade (debate rounds, TTM, peer comparison, macro regime) (#14) 2026-03-17 22:27:40 +01:00
test_e2e_api_integration.py feat: opt-in vendor fallback — fail-fast by default (#18) 2026-03-18 14:25:38 +01:00
test_env_override.py fix: resolve 12 pre-existing test failures across 5 test files 2026-03-18 11:11:00 +01:00
test_finnhub_integration.py Resolve merge conflicts after PR #16 merge into main (#17) 2026-03-18 11:38:44 +01:00
test_finnhub_live_integration.py feat: Finnhub integration layer, 141 tests, and vendor evaluation report (#16) 2026-03-18 11:28:43 +01:00
test_industry_deep_dive.py feat: unified report paths, structured observability logging, and memory system update (#22) 2026-03-19 09:06:40 +01:00
test_json_utils.py Resolve merge conflicts after PR #18 merge into main (#19) 2026-03-18 14:38:48 +01:00
test_macro_bridge.py feat: Complete 3-phase LLM scanner pipeline with inline tool execution 2026-03-17 08:41:40 +01:00
test_macro_regime.py feat: medium-term positioning upgrade (debate rounds, TTM, peer comparison, macro regime) (#14) 2026-03-17 22:27:40 +01:00
test_peer_comparison.py feat: medium-term positioning upgrade (debate rounds, TTM, peer comparison, macro regime) (#14) 2026-03-17 22:27:40 +01:00
test_scanner_complete_e2e.py feat: Complete 3-phase LLM scanner pipeline with inline tool execution 2026-03-17 08:41:40 +01:00
test_scanner_comprehensive.py feat: unified report paths, structured observability logging, and memory system update (#22) 2026-03-19 09:06:40 +01:00
test_scanner_end_to_end.py feat: Complete 3-phase LLM scanner pipeline with inline tool execution 2026-03-17 08:41:40 +01:00
test_scanner_fallback.py fix: resolve 12 pre-existing test failures across 5 test files 2026-03-18 11:11:00 +01:00
test_scanner_final.py feat: unified report paths, structured observability logging, and memory system update (#22) 2026-03-19 09:06:40 +01:00
test_scanner_graph.py fix: resolve 12 pre-existing test failures across 5 test files 2026-03-18 11:11:00 +01:00
test_scanner_mocked.py feat: add scanner tests, global demo key in conftest, remove 48 inline key patches 2026-03-17 16:01:52 +00:00
test_scanner_routing.py feat: medium-term positioning upgrade (debate rounds, TTM, peer comparison, macro regime) (#14) 2026-03-17 22:27:40 +01:00
test_scanner_tools.py feat: Complete 3-phase LLM scanner pipeline with inline tool execution 2026-03-17 08:41:40 +01:00
test_ttm_analysis.py feat: medium-term positioning upgrade (debate rounds, TTM, peer comparison, macro regime) (#14) 2026-03-17 22:27:40 +01:00
test_vendor_failfast.py feat: opt-in vendor fallback — fail-fast by default (#18) 2026-03-18 14:25:38 +01:00
test_yfinance_integration.py feat: add scanner tests, global demo key in conftest, remove 48 inline key patches 2026-03-17 16:01:52 +00:00