Add live.py lifecycle and event candidates; assemble confirmed vs live in engine; Summary partition; execution_signal source=confirmed only. Keep strategies untouched; do not lower Confirmed thresholds for Live. Co-authored-by: Cursor <cursoragent@cursor.com>
2.0 KiB
2.0 KiB
Backend Design: ECR-007 Wyckoff Live Structure
| Field | Value |
|---|---|
| ID | BD-2026-007 |
| ECR | ECR-007 |
| Change Level | L2 |
| Status | Approved |
| Author | Architect (LOOP-RUN-005 Planner) |
| Date | 2026-08-07 |
| Risk | High (domain / execution boundary) |
Context
- 问题:Confirmed 引擎已存在;需要独立 Live 推演层供观察,且不得成为交易执行输入。
- 非目标:改 Confirmed 门槛;自动交易;策略。
- 依赖:ECR-003/004 威科夫;WYCKOFF-LIVE-STRUCTURE-001(FROZEN)。
Architecture Change / Change Boundary
OHLCV
→ detect_trading_ranges (Confirmed path)
→ detect_bias_and_events / build_phases ← Confirmed(阈值不降)
→ analyze_live_structure ← Live(只读 confirmed)
→ cycles[i] = { lifecycle, confirmed, live }
→ API analyze + Summary UI
→ execution_signal_from_wyckoff(confirmed only)
| Layer | May change | Must not |
|---|---|---|
| Confirmed | assemble into confirmed{} |
relax Spring/SOS rules |
| Live | live.py heuristics |
write into confirmed.events |
| Execution helper | source=confirmed gate | consume candidates |
| UI | Summary partition | treat Live as order |
Backend Change Boundary
Live outputs are observation. Execution boundary:
assert execution_signal.source == "confirmed"
# live-only payload → None
Data contract
See WYCKOFF-LIVE-STRUCTURE-001. Top-level phases/events mirror Confirmed only.
delivery_constraints
- BD Status Approved
- TEST_REPORT commands/result/date
- CODE_REVIEW handoff
- TRACEABILITY commit
- out_of_scope + execution_source_confirmed_only
Test Plan
- Live candidates not in confirmed.events
- CONFIRMED lifecycle when Spring+SOS confirmed
- execution_signal source=confirmed; live-only → None
- analyze contract keys include live/lifecycle
Rollback
Remove live assembly path; Summary falls back to confirmed-only.