Commit Graph

15 Commits

Author SHA1 Message Date
陈少杰 b6e57d01e3 Stabilize TradingAgents contracts so orchestration and dashboard can converge
This change set introduces a versioned result contract, shared config schema/loading, provider/data adapter seams, and a no-strategy application-service skeleton so the current research graph, orchestrator layer, and dashboard backend stop drifting further apart. It also keeps the earlier MiniMax compatibility and compact-prompt work aligned with the new contract shape and extends regression coverage so degradation, fallback, and service migration remain testable during the next phases.

Constraint: Must preserve existing FastAPI entrypoints and fallback behavior while introducing an application-service seam
Constraint: Must not turn application service into a new strategy or learning layer
Rejected: Full backend rewrite to service-only execution now | too risky before contract and fallback paths stabilize
Rejected: Leave provider/data/config logic distributed across scripts and endpoints | continues boundary drift and weakens verification
Confidence: high
Scope-risk: broad
Directive: Keep future application-service changes orchestration-only; move any scoring, signal fusion, or learning logic to orchestrator or tradingagents instead
Tested: python -m compileall orchestrator tradingagents web_dashboard/backend
Tested: python -m pytest orchestrator/tests/test_signals.py orchestrator/tests/test_llm_runner.py orchestrator/tests/test_quant_runner.py orchestrator/tests/test_contract_v1alpha1.py orchestrator/tests/test_application_service.py orchestrator/tests/test_provider_adapter.py web_dashboard/backend/tests/test_main_api.py web_dashboard/backend/tests/test_portfolio_api.py web_dashboard/backend/tests/test_api_smoke.py web_dashboard/backend/tests/test_services_migration.py -q
Not-tested: live MiniMax/provider execution against external services
Not-tested: full dashboard/manual websocket flow against a running frontend
Not-tested: omx team runtime end-to-end in the primary workspace
2026-04-13 17:25:07 +08:00
陈少杰 b50e5b4725 fix(review): hmac.compare_digest for API key, ws/orchestrator auth, SignalMerger per-signal cap logic 2026-04-09 23:00:20 +08:00
陈少杰 28a95f34a7 fix(review): api_key→anthropic_key bug, sync-in-async event loop block, orchestrator per-message re-init, dead code cleanup 2026-04-09 22:55:36 +08:00
陈少杰 ce2e6d32cc feat(orchestrator): example scripts for backtest and live mode 2026-04-09 22:12:02 +08:00
陈少杰 480f0299b0 feat(orchestrator): LiveMode + /ws/orchestrator WebSocket endpoint 2026-04-09 22:10:15 +08:00
陈少杰 724c447720 feat(orchestrator): BacktestMode for historical signal collection 2026-04-09 22:09:38 +08:00
陈少杰 928f069184 test(orchestrator): unit tests for SignalMerger, LLMRunner._map_rating, QuantRunner._calc_confidence 2026-04-09 22:07:21 +08:00
陈少杰 14191abc29 feat(orchestrator): TradingOrchestrator main class with get_combined_signal 2026-04-09 22:05:03 +08:00
陈少杰 ba3297a696 fix(llm_runner): use stored direction/confidence on cache hit, sanitize ticker path 2026-04-09 22:03:17 +08:00
陈少杰 852b6c98e3 feat(orchestrator): implement LLMRunner with lazy graph init and JSON cache 2026-04-09 21:58:38 +08:00
陈少杰 29aae4bb18 feat(orchestrator): implement LLMRunner with caching and rating mapping 2026-04-09 21:54:48 +08:00
陈少杰 30d8f90467 fix(quant_runner): fix 3 critical issues and 2 important improvements
- Critical 1: initialize orders=[] before loop to prevent NameError when df is empty
- Critical 2: replace bare sqlite3 conn with context manager (with statement) in get_signal
- Critical 3: remove ticker param from _load_best_params (table has no ticker col, params are global)
- Important: extract db_path as self._db_path attribute in __init__ (DRY)
- Important: add comment explaining lazy imports require sys.path set in __init__
2026-04-09 21:51:38 +08:00
陈少杰 7a03c29330 feat(orchestrator): implement QuantRunner with BollingerStrategy signal generation 2026-04-09 21:44:34 +08:00
陈少杰 dacb3316fa fix(orchestrator): code quality fixes in config and signals
- config: remove hardcoded absolute path for quant_backtest_path (now empty string)
- config: add llm_solo_penalty (0.7) and quant_solo_penalty (0.8) fields
- signals: SignalMerger now accepts OrchestratorConfig in __init__
- signals: use config.llm_solo_penalty / quant_solo_penalty instead of magic numbers
- signals: apply quant_weight_cap / llm_weight_cap as confidence upper bounds
- signals: both-None branch raises ValueError instead of returning ticker=""
- signals: replace assert with explicit ValueError for llm-None-when-quant-None
- signals: replace datetime.utcnow() with datetime.now(timezone.utc)
2026-04-09 21:39:23 +08:00
陈少杰 56dc76d44a feat(orchestrator): add signals.py and config.py
- Signal / FinalSignal dataclasses
- SignalMerger with weighted merge, single-track fallbacks, and cancel-out HOLD
- OrchestratorConfig with all required fields
2026-04-09 21:35:31 +08:00