Add ICT mainline development plan

This commit is contained in:
Codex
2026-05-21 10:38:09 +08:00
parent a8a05c1af4
commit db1edf5c66
4 changed files with 393 additions and 3 deletions
+2 -2
View File
@@ -142,7 +142,7 @@ Automation execution-layer PXX remains closed and its known scope stays frozen.
- latest_strategy_backtest_validation: node --check app/i18n, focused API/static tests, `npm run build`, `npm run lint` full unit discovery 791 tests, `git diff --check` with only LF/CRLF warnings, deploy smoke 11 endpoints, remote ops smoke, readonly live analysis smoke, remote `/trading/backtests` field smoke, and browser audit on `http://192.168.3.90:8000/#strategy-backtest` passed. Remote latest run `#489` is correctly blocked by quality gate (`sample_size_too_small`, executed sample, expectancy, profit factor, consecutive-loss reasons) and the Chinese UI renders those as trader-readable reasons.
- latest_trader_cockpit_recompression_slice: ict_six_point_readout_with_backtest_edge
- latest_trader_cockpit_recompression_status: implemented_deployed_remote_ops_passed_readonly_launch_blocked_by_external_proxy
- latest_trader_cockpit_recompression_closure: Trader Cockpit first screen now uses the ICT mainline six-point readout `Now / Reason / Wait / Risk / Historical Edge / Boundary`, fetches `/trading/backtests` for the active instrument, and summarizes the latest quality gate as historical edge evidence without promoting any setup into a buy/sell or order-submission instruction. Local build, full lint/unit, deploy smoke, remote ops smoke, remote `/trading/backtests` field smoke, and remote browser QA passed. `run_readonly_live_analysis_smoke.py` static/API checks passed but the final launch-readiness gate remains blocked by external market/news/broker freshness because the configured market proxy refuses OKX connections and direct OKX access times out.
- latest_trader_cockpit_recompression_closure: Trader Cockpit first screen now uses the ICT mainline six-point readout `Now / Reason / Wait / Risk / Historical Edge / Boundary`, fetches `/trading/backtests` for the active instrument, and summarizes the latest quality gate as historical edge evidence without promoting any setup into a buy/sell or order-submission instruction. Local build, full lint/unit, deploy smoke, remote ops smoke, remote `/trading/backtests` field smoke, and remote browser QA passed. After the proxy/network path recovered, `run_readonly_live_analysis_smoke.py` also passed with `ready_for_readonly_live_analysis=true`, `must_not_trade=true`, `trade_permission_required=false`, and `submit_cancel_or_live_execution_called=false`; remaining stream/news/account degradations are read-only warnings, not order-permission requirements.
- latest_decision_assistant_workflow_queue_slice: assistant_loop_queue
- latest_decision_assistant_workspace_loop_slice: workflow_section_navigation_loop_queue
- latest_decision_assistant_learning_focus_slice: learning_focus_queue
@@ -835,7 +835,7 @@ Automation execution-layer PXX remains closed and its known scope stays frozen.
## Exact Next Step
Next continue Step 5 of `docs/AI_ICT_主线纠偏与功能裁剪方案_2026-05-20_v1.md` only after Step 4 validation/deploy closes: perform a code-level deletion readiness audit for non-mainline trader-facing surfaces. Start with dependency scan, API usage scan, and test coverage confirmation; do not physically delete shared or diagnostic code until the scan proves it is unused or safely isolated under `System Ops`. Do not restart external-context/archive/digest long-tail work, do not create order-submission features, and do not fabricate R2 paper samples. Keep `execution_allowed`, `decision_support_ready`, `real_live_ready`, risk governor, trust bucket, and operator confirmation protocol unchanged.
Use `docs/AI_ICT_实盘辅助分析决策助手ICT主线开发方案_2026-05-21_v1.md` as the next active development anchor. Continue with S1 mainline deletion readiness audit: scan all non-mainline trader-facing routes, sidebar sections, API endpoints, frontend panels, and tests; classify each as `Mainline`, `System Ops`, `Research Only`, `Deprecated`, or `Delete Candidate`; do not physically delete shared or diagnostic code until dependency, API usage, test coverage, rollback, and remote smoke impact are clear. Every follow-up slice must map to `docs/ICT交易全书_出版终校版.md` and the mandatory chain `Range / Draw / Location -> Liquidity / Sweep / Inducement / Path -> Displacement / MSS / FVG / Retest / Session -> backtest evidence -> pre-market plan -> intraday unique focus or no-trade reason -> journal / study-notes feedback`. Do not restart external-context/archive/digest long-tail work, do not create order-submission features, and do not fabricate R2 paper samples. Keep `execution_allowed`, `decision_support_ready`, `real_live_ready`, risk governor, trust bucket, and operator confirmation protocol unchanged.
## Validation Commands Used Recently
+5 -1
View File
@@ -931,8 +931,12 @@
- [x] Existing UI i18n/R2 gate polish follow-up: existing Trader Mode/readiness/shadow-paper labels now translate runtime/gate jargon such as `Auto refresh`, `All Trust`, `Incident Journal`, `Live Readiness`, `paper_ticket_sample_gate`, and `operator_feedback_count`; R2 evidence window now follows canonical `failed_criteria`, remote browser audit has no repeated first-screen Chinese phrases and only 13 active-view English tokens left; deploy smoke, remote ops smoke, read-only live smoke, focused tests, static checks, and full unit (`790`) passed
- [x] Session Focus dynamic Chinese label follow-up: existing i18n now translates reported dynamic session-focus labels/values (`ASIA`, `NY_PM`, `status`, `window`, `candidates`, `executable`, `open executions`, `alerts`, `recommendation`, `action hint`, `incomplete`, `observe @ n/a`, `avoid_new_risk`, `review_alerts`); remote browser audit on `/trader-mode#session-focus` passed with no reported English leftovers and no console errors
- [x] Trader mainline Step 3 Strategy Backtest productization: added read-only `/trading/backtests`, Strategy Backtest workbench controls, latest-run summary, quality gate explanation, R metrics, equity curve, top sessions, failure reasons, recent run list, Chinese labels for backtest gate reasons, and resilient candle/backtest failure fallback; full unit (`791`), deploy smoke, remote ops smoke, readonly live smoke, remote backtest endpoint smoke, and browser audit passed
- [x] Trader mainline Step 4 cockpit recompression implemented/deployed: under the hard ICT book mainline gate, Trader Cockpit first screen now reduces to `Now / Reason / Wait / Risk / Historical Edge / Boundary` and uses latest Strategy Backtest evidence without changing any execution/readiness gate; deploy smoke, remote ops smoke, remote backtest field smoke, and browser QA passed, while readonly launch smoke remains blocked by external market/news/broker freshness through the currently unreachable OKX/proxy path
- [x] Trader mainline Step 4 cockpit recompression implemented/deployed: under the hard ICT book mainline gate, Trader Cockpit first screen now reduces to `Now / Reason / Wait / Risk / Historical Edge / Boundary` and uses latest Strategy Backtest evidence without changing any execution/readiness gate; deploy smoke, remote ops smoke, remote backtest field smoke, browser QA, and the recovered read-only launch smoke passed with `ready_for_readonly_live_analysis=true`, `must_not_trade=true`, `trade_permission_required=false`, and no submit/cancel/live execution calls
- [x] Created next-stage ICT mainline development anchor: `docs/AI_ICT_实盘辅助分析决策助手ICT主线开发方案_2026-05-21_v1.md`, binding all future work to `docs/ICT交易全书_出版终校版.md`, read-only assisted analysis, Strategy Backtest, Trading Plan, Trader Cockpit, Journal, and System Ops separation
- [ ] Trader mainline Step 5 deletion readiness audit: scan non-mainline trader-facing surfaces for dependency/API/test coverage before any code-level deletion; keep diagnostics under `System Ops` unless proven removable
- [ ] S1 mainline deletion readiness audit under the new plan: classify routes/sidebar/API/frontend panels/tests as `Mainline`, `System Ops`, `Research Only`, `Deprecated`, or `Delete Candidate`, then hide/migrate before considering physical deletion
- [ ] S2 ICT canonical taxonomy/rulebook registry: require every Trader Cockpit focus, Strategy Backtest result, Trading Plan item, and Journal note to map to the book chain
- [ ] S3/S4 follow-up: make Trading Plan a hard upstream gate for `Review Now`, then deepen Strategy Backtest so quality-gate failure blocks weak setups from live focus
- [ ] R2 paper-ticket sample gate is waiting on a real executable candidate; do not fabricate paper tickets from blocked candidates
- [ ] R2 operator feedback sample gate still needs 2 more real feedback samples (`operator_feedback_count=3/5`)
- [ ] R2 weekly review visible gate still needs a real execution-derived journal/weekly review entry (`weekly_review_entry_count=0`)
@@ -0,0 +1,385 @@
# AI_ICT 实盘辅助分析决策助手 ICT 主线开发方案 2026-05-21 v1
## 0. 最高约束
本方案是后续开发的执行锚点。所有新增、修改、裁剪、验证和部署,都必须同时满足两个目标:
1. 严格围绕 `docs/ICT交易全书_出版终校版.md` 的交易主线,绝对不能再偏离到泛化 AI 工作台、运营看板、archive 长尾或无关自动化。
2. 服务“实盘辅助分析决策”,只帮助交易员更快理解当前盘面、等待什么确认、为什么不交易、历史是否有优势、如何复盘;不下单、不交易、不输出可直接执行的买卖指令。
如果旧文档、旧 backlog、历史切片或临时需求与本方案冲突,以本方案和 `docs/AI_ICT_硬性主线约束_必须遵循ICT交易全书_2026-05-21_v1.md` 为准。
## 1. 当前事实状态
截至 2026-05-21,系统已经具备以下基础:
- Trader 主界面已裁剪为 `Trader Cockpit / Strategy Backtest / Trading Plan / Journal / System Ops` 五类入口。
- `/trader-mode` 已进入统一左侧菜单框架,不再是脱离主框架的独立页。
- 中文/英文切换已经覆盖主要交易员界面,默认中文。
- Trader Cockpit 首屏已压缩为六项速读:`Now / Reason / Wait / Risk / Historical Edge / Boundary`。
- Strategy Backtest 已有只读页面 `/trading/backtests`,能展示最新回测、质量门、样本、R 指标、权益曲线、失败原因和最近运行。
- 远端只读实盘分析链路在网络恢复后已重新通过 smoke:`ready_for_readonly_live_analysis=true`、`must_not_trade=true`、`trade_permission_required=false`、`submit_cancel_or_live_execution_called=false`。
- 当前 OKX/行情路径仍以只读分析为目标,允许 REST candles fallback;stream、news、readonly account context 的退化只能作为 warnings,不能被包装成交易信号。
- R2 证据仍未完整闭环:`paper_ticket_count=0`、`paper_execution_count=0`、`weekly_review_entry_count=0`,真实 operator feedback 仍需继续自然采集。
当前不能宣称:
- 不能宣称系统可以指导实盘下单。
- 不能宣称 `decision_support_ready=true`。
- 不能宣称 R2 连续 shadow/paper 证据窗口已经 completed。
- 不能启用 `execution_allowed`、`real_live_ready`、自动下单、半自动下单或 OKX trade permission 流程。
## 2. 唯一产品目标
系统的目标不是“功能多”,而是让交易员在实盘中用最少注意力回答 7 个问题:
1. 今天和此刻处于什么 ICT 叙事?
2. 当前 dealing range / daily range 在哪里?
3. Draw on Liquidity 指向哪里?
4. 价格现在处于 premium / discount / equilibrium 的什么位置?
5. 是否已经发生 liquidity sweep / inducement / displacement / MSS / FVG / retest 的完整确认链?
6. 该 setup 在历史回测中是否有足够优势?
7. 当前应该 `Review Now`、`Observe Only`,还是 `Do Not Use`,以及为什么?
如果一个功能不能帮助回答这些问题,就不应出现在交易员主界面。
## 3. 《ICT交易全书》强制主线
后续系统表达必须固定为以下顺序:
```text
Range / Draw / Location
-> Liquidity / Sweep / Inducement / Path
-> Displacement / MSS / FVG / Retest / Session
-> backtest evidence
-> pre-market plan
-> intraday unique focus or no-trade reason
-> journal / study-notes feedback
```
对应到书中主线:
- Daily Range Model:先定义日内 range、操纵、扩张,而不是先找局部信号。
- Current Dealing Range:先知道当前价格处于什么区间。
- Draw on Liquidity:目标必须从流动性吸引点推导,不从 UI 候选随机生成。
- Premium / Discount:位置决定风险,不允许脱离位置谈 FVG 或 MSS。
- IRL / ERL:目标与获利预期要来自内部/外部流动性。
- MSS / MSB:结构信号必须服务 Draw,不能把 MSS 当孤立入场按钮。
- FVG / Retest:只能作为完整链条里的确认,不是策略本身。
- Backtesting / Study Notes / Journal:回测、学习笔记、交易日志是同一闭环,不是三个装饰模块。
## 4. 系统分层
### 4.1 Trader Cockpit
定位:盘中唯一首屏。
只回答:
- 现在:`Review Now / Observe Only / Do Not Use`
- 原因:最多三条,必须使用交易员语言。
- 等待:下一步只等一个最关键确认。
- 风险:一个最重要失效条件。
- 历史优势:当前 setup/session/symbol 是否通过回测质量门。
- 边界:只读分析,不是买卖指令,不下单。
不显示:
- archive 长列表
- workflow bridge
- external context 长尾
- owner cadence / revisit queue
- digest history
- provider 细节
- 大量 runtime 内部字段
### 4.2 Strategy Backtest
定位:验证策略是否值得相信。
必须围绕 ICT 书本模型回测,不做泛化指标堆叠。
核心输出:
- setup 是否来自书本链路。
- 样本数是否足够。
- executed sample 是否足够。
- 总 R、平均 R、expectancy R。
- profit factor。
- max drawdown。
- consecutive losses。
- session edge。
- out-of-model rate。
- 失败原因是否与 book-rule violation 对齐。
- 哪些 setup/session/symbol 禁止进入 Trader Cockpit 的 `Review Now`。
### 4.3 Trading Plan
定位:盘前计划,不是盘中复杂面板。
必须按书本顺序填写:
```text
Narrative
-> Range
-> Draw
-> Bias
-> Location
-> Session
-> Confirmation
-> Invalidation
-> Target
-> No-trade conditions
```
没有合格 plan 时,Trader Cockpit 不得给出 `Review Now`。
### 4.4 Journal / Study Notes
定位:把真实使用反馈沉淀回模型。
只记录:
- 是否按模型等待。
- 是否提前行动。
- 是否在 premium/discount 位置误判。
- 是否误读 liquidity sweep。
- 是否把 MSS/FVG 脱离 Draw 使用。
- 是否缺少回测支持。
- 是否因为数据 stale 或 runtime warning 误用。
- 盘后复盘结论。
当前阶段没有真实交易,因此 Journal 不能伪造实盘执行结果;可以记录观察、No Trade、Agree、Disagree、Need More Evidence 和 study note。
### 4.5 System Ops
定位:运维、诊断、审计,不是交易员盘中主界面。
放入:
- runtime status
- remote ops smoke
- unattended harness
- proxy / market freshness
- readonly account context
- archive / workflow / digest 旧能力
- external context provider health
- migration / deploy / maintenance summary
System Ops 可以保留复杂度,但默认不能干扰交易员实盘速读。
## 5. 后续开发阶段
### S1 主线裁剪审计
目标:先判定哪些现有功能该保留、隐藏、迁移到 System Ops、归档或删除。
交付:
- 扫描所有 trader-facing routes、sidebar sections、API endpoints、frontend panels、tests。
- 每个项目打标签:
- `Mainline`
- `System Ops`
- `Research Only`
- `Deprecated`
- `Delete Candidate`
- 输出依赖关系:前端是否引用、API 是否被测试覆盖、远端 smoke 是否依赖。
- 对可隐藏项先从交易员主界面移出;物理删除必须等依赖扫描和回滚点明确。
验收:
- 不破坏 `/trader-mode`、`/trading/backtests`、Trading Plan、Journal、System Ops。
- 不新增交易功能。
- 文档列清楚“为什么保留/为什么隐藏/为什么删除候选”。
### S2 ICT 书本模型字典
目标:建立一份系统内部 canonical ICT taxonomy,所有策略、候选、回测、计划、日志必须引用它。
交付:
- 定义核心概念:`dealing_range`、`daily_range`、`draw_on_liquidity`、`premium_discount`、`liquidity_pool`、`sweep`、`inducement`、`displacement`、`mss`、`fvg`、`retest`、`session`、`irl`、`erl`、`invalidation`。
- 每个概念必须有:
- book anchor
- plain-language label
- required fields
- invalid examples
- UI display rule
- 增加测试:任何进入 Trader Cockpit 的 focus 必须能映射到书本模型字段。
验收:
- 不再出现“只有 internal reason bucket、没有书本链路”的候选解释。
- 所有 trader-facing 文案能追溯到 ICT 书本概念。
### S3 Trading Plan 重构
目标:让盘前计划成为 Trader Cockpit 的上游硬依赖。
交付:
- Trading Plan 页面改成书本顺序表单。
- 支持每日计划快照。
- 支持缺失项提示:没有 Draw、没有 invalidation、没有 no-trade condition 时,不允许 Cockpit 进入 `Review Now`。
- 支持从 Backtest 引用同类 setup 的历史质量门。
验收:
- 没有合格 plan 时,Cockpit 只能显示 `Observe Only` 或 `Do Not Use`。
- plan 输出不包含买卖指令,只包含观察条件、失效条件和复盘条件。
### S4 Strategy Backtest 深化
目标:从“能看回测结果”升级为“能判断策略是否值得在盘中关注”。
交付:
- 所有回测 run 必须包含 ICT setup mapping。
- 质量门原因改写为交易员可理解语言。
- 增加 book-rule violation 统计。
- 增加 session/symbol/setup 分层结果。
- 增加 no-lookahead 证据展示。
- 明确哪些结果只允许 study,不允许进入 Cockpit `Review Now`。
验收:
- 如果样本太小、expectancy 不足、profit factor 不足、回撤过大或连续亏损过高,Cockpit 必须显示历史优势不足。
- Strategy Backtest 页面能解释“为什么这个策略暂时不可信”。
### S5 Trader Cockpit 二次压缩
目标:把现有首屏进一步压成真正盘中可读。
交付:
- 所有 focus 解释必须按以下句式生成:
```text
当前处于 [Range/Location],主 Draw 是 [Draw];
已/未处理 [Liquidity event];
还需要等待 [Confirmation];
历史回测 [Pass/Fail/Insufficient];
因此现在 [Review/Observe/Do Not Use]。
```
- 无候选时必须告诉交易员:不是“没有数据”,而是“当前缺少哪一环”。
- stale 时冻结结论或降级为 `Do Not Use`。
- 只保留一个 focus,多品种队列只用于“哪个值得看”,不是买卖信号。
验收:
- 13/14 寸屏、窄屏、暗色环境浏览器验证通过。
- 中文首屏不能出现内部 snake_case 或难懂状态。
- 状态变化时提示必须说明变化原因。
### S6 Journal / Study Notes 闭环
目标:把使用反馈变成模型改进素材。
交付:
- Agree / Disagree / No Trade / Need More Evidence / Quick Note 都要映射到书本错误分类。
- 盘后自动生成 study note 草稿。
- weekly review 明确区分:
- observation review
- paper review
- execution-derived review
- 当前不做实盘交易,因此不能把 observation review 伪造成 execution evidence。
验收:
- R2 证据面板必须诚实显示哪些是真实样本,哪些只是观察样本。
- `paper_ticket_count` 和 `paper_execution_count` 只能来自真实 executable candidate 的纸面流程,不能从 blocked candidate 造样本。
### S7 只读实盘可靠性
目标:让系统每天能被交易员打开,并明确知道能不能用于“看盘分析”。
交付:
- 固化只读 launch smoke。
- System Ops 显示 proxy、market freshness、runtime、review packet、REST fallback、stream status、news/account warnings。
- Trader Cockpit 只显示交易员必须知道的健康结论,不暴露完整运维细节。
验收:
- `run_readonly_live_analysis_smoke.py` passed。
- `must_not_trade=true`。
- `trade_permission_required=false`。
- `submit_cancel_or_live_execution_called=false`。
- warnings 不被误解释成交易机会。
### S8 使用手册与训练流程
目标:把系统变成“交易员会用”的工具,而不是“开发者知道怎么点”的系统。
交付:
- 一页式盘中 SOP:
- 打开 Trader Cockpit。
- 看六项速读。
- 如果 `Observe Only`,记录为什么不交易。
- 如果 `Review Now`,检查书本链路和回测优势。
- 盘后写 Journal / Study Note。
- 回测 SOP:
- 如何选择 symbol/session/setup。
- 如何读质量门失败。
- 如何决定某 setup 暂停使用。
- 复盘 SOP:
- 如何把 No Trade / Disagree 变成学习条目。
验收:
- 新用户不用看复杂后台,也能理解当天为什么不交易、下一步看什么。
## 6. 不做清单
以下内容后续不得作为主线开发目标,除非用户明确改变项目阶段:
- 自动下单。
- 半自动下单。
- OKX live submit/cancel/fills。
- 为了跑 sandbox smoke 索取 trade permission key。
- 将 `Review Now` 包装成买入/卖出信号。
- 外部上下文长尾、archive 长尾、workflow 长尾继续扩张。
- 多 agent 研究委员会式复杂决策。
- 与《ICT交易全书》无关的指标堆叠、LLM 泛化分析、运营报表。
## 7. 质量门
每个切片必须通过以下检查:
- 是否能映射到《ICT交易全书》的主线链路。
- 是否减少或至少不增加交易员主界面复杂度。
- 是否保持只读辅助边界。
- 是否保持 `execution_allowed=false`、`real_live_ready=false`。
- 是否没有伪造 R2 样本。
- 是否有 focused tests。
- 涉及前端时必须做浏览器验证。
- 涉及远端可用性时必须跑 remote ops smoke 和 readonly live analysis smoke。
- 文档、代码、SESSION、TASKS 必须回写一致。
## 8. 推荐立即执行顺序
下一轮不要再加新功能,按以下顺序执行:
1. S1 主线裁剪审计:列出所有非主线 trader-facing surface,决定隐藏、迁移或删除候选。
2. S2 ICT 书本模型字典:建立统一概念层,让后续所有候选、回测、计划、日志都按书本字段表达。
3. S3 Trading Plan 重构:把盘前计划变成 Cockpit 的前置硬门。
4. S4 Strategy Backtest 深化:让回测真正回答“这个 ICT setup 有没有优势”。
5. S5 Trader Cockpit 二次压缩:把首屏语言改成书本链路和交易员语言。
6. S6 Journal / Study Notes 闭环:把真实观察和盘后复盘沉淀回模型。
7. S7 只读可靠性日常化:把每天能不能用于看盘分析变成固定 smoke 和 System Ops 状态。
8. S8 使用手册与训练流程:让交易员按固定 SOP 使用,而不是靠猜。
## 9. 完整闭环定义
本阶段只有在以下条件同时满足后,才能称为闭环:
- Trader 主界面只围绕 ICT 书本链路。
- Trading Plan、Strategy Backtest、Trader Cockpit、Journal 形成闭环。
- System Ops 承接复杂诊断,不再污染交易员首屏。
- 交易员可以一眼知道:现在为什么不交易、下一步等什么、唯一 focus 为什么值得看、历史是否支持、数据是否可用。
- 回测质量门能阻止不可信 setup 进入实盘关注。
- R2 样本继续真实采集,不伪造 paper/execution/weekly evidence。
- 系统仍然明确处于只读辅助分析,不下单,不交易,不给买卖指令。
@@ -19,6 +19,7 @@ NONEXISTENT_VISUAL_PLAN_NAME = "AI_ICT_" + "视觉盯盘与主动告警增强方
ACTIVE_TOP_LEVEL_DOCS = {
"AI_ICT_硬性主线约束_必须遵循ICT交易全书_2026-05-21_v1.md",
"AI_ICT_实盘辅助分析决策助手ICT主线开发方案_2026-05-21_v1.md",
"AI_ICT_主线纠偏与功能裁剪方案_2026-05-20_v1.md",
"AI_ICT_实盘辅助分析决策助手上线必做清单_2026-05-18_v1.md",
"AI_ICT_实盘辅助分析决策助手使用说明_2026-05-18_v1.md",