docs: 开启 ECR-004 威科夫硬化与 VP 减负(Draft)

跟进 ECR-003 Review Findings;待 Approve 后实现。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-06 18:35:25 +08:00
co-authored by Cursor
parent 081a57a90e
commit ac6be80278
11 changed files with 194 additions and 8 deletions
@@ -0,0 +1,45 @@
# ENGINEERING_SPEC — ECR-004
**Status:** Draft
**Date:** 2026-08-06
## Range scoring
替换「仅取最长合格窗口」:
1. 仍在 `lookback` + `tail_reserve` 框架内扫描候选段(步长可保留)。
2. 对每段计算分数,例如:
- `touch_score` = near_hi + near_lo(触边上沿/下沿次数)
- `width_penalty` = width / ATR(过宽扣分)
- `recency_bonus` = 段终点靠近 core 末
- 可选:段内 close 在 [low,high] 比例
3. 取分数最高且满足既有硬门槛(near_hi/lo≥2、inside≥0.75 等)的段。
4. 单测:`_box_df` 断言 `low∈[38,42]``high∈[58,62]`,且 `start` 不早于箱体起始(允许小容差)。
## Phases
- 为 A–E 设最小 bar 数(如 ≥3);不足则与相邻段合并或跳过空标签。
- 避免 D/E 完全同起止仍输出两条重复色带。
## API gate
```text
if include_wyckoff and not elements_only:
result["wyckoff"] = analyze_wyckoff(...)
```
## Frontend VP
任选其一(ENG 实现时定一种并写进 IMPL):
- **A**:只画 volume>0 的 bin,且最多 N 条(按 volume 取 Top-N),POC/VAH/VAL 仍全画
- **B**:用少量水平线 + 透明度映射,或单 series 多段(若 Lightweight 版本支持)
- **C**:服务端默认 `vp_bins` 上限降到 24,前端再 Top-N
区间填充线可从 6 降到 3。
## Tests
- 扩展 `tests/test_wyckoff.py`
- 契约:`elements_only=true&include_wyckoff=1``wyckoff`
- 不改 golden 缠论 JSON