Skip to content

Commit 64d8920

Browse files
Pigbibicodex
andcommitted
feat: add read-only M0 research ledger
Co-Authored-By: Codex <noreply@openai.com>
1 parent 9a00e16 commit 64d8920

5 files changed

Lines changed: 939 additions & 0 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# M0 研究台账 v1
2+
3+
`qsl_m0_research_source_snapshot.v1``qsl_m0_research_ledger.v1`
4+
`QuantAdvisorResearch` 与运行时设置之间的只读边界。
5+
6+
它们只接收已由顾投系统产生且已闭合校验的
7+
`qsl.m0_research_hypothesis.v1`。这不是策略选择、仓位分配、运行时目标、
8+
平台路由或订单合约;实现不依赖 QPK selector,也不调用调度、券商或
9+
执行组件。
10+
11+
## 输入快照
12+
13+
一个 source snapshot 对应一个来源报告摘要:
14+
15+
```text
16+
schema_version: qsl_m0_research_source_snapshot.v1
17+
source_id: 稳定的传输来源标识
18+
source_report_digest: 顾投报告 SHA-256
19+
generated_at / computed_at / data_status
20+
hypotheses: [qsl.m0_research_hypothesis.v1, ...]
21+
errors: [安全错误码, ...]
22+
```
23+
24+
快照中的每条 hypothesis 必须:
25+
26+
- 精确匹配 M0 的字段闭包,并具有 `authority=research_only`
27+
`no_order=true``permitted_next_step=research_validation_only`
28+
- 具有有效的 7 天有效期、`as_of` 与生成时间关系,以及来源报告/来源条目
29+
SHA-256;
30+
- 与快照的 `source_report_digest` 完全一致;
31+
- 不含账户、仓位、权重、订单、路由、平台、运行时、密钥或执行语义。
32+
33+
快照不得把失效研究线索重新标为新信号。`ready` 来源必须提供时间与来源
34+
digest;`unavailable` 来源不得携带 hypothesis。
35+
36+
## 聚合行为
37+
38+
`aggregate_m0_research_sources(snapshots, now=...)` 是确定性的纯函数:
39+
40+
1. 校验每个来源;无效来源只产生安全错误码,不能污染有效台账。
41+
2.`(subject.kind, subject.identifier, source_report_digest)` 合并完全相同
42+
的观测,并保留所有 `source_ids`
43+
3. 同一 subject + source digest 出现不同内容时,作为
44+
`m0_source_subject_collision` 故障闭合剔除。
45+
4. 同一 subject 的不同报告保留为独立观测;若 `primary_horizon` 不同,
46+
标记 `horizon_conflict.status=conflict`。这是研究队列的人工/后续验证信号,
47+
不是交易信号。
48+
5. 依据 `now``expires_at` 产生 `fresh``stale``unknown`;来源自身
49+
`stale` 时不会被提升为 fresh。
50+
51+
输出台账始终固定:
52+
53+
```text
54+
authority: research_only
55+
no_order: true
56+
permitted_next_step: research_validation_only
57+
```
58+
59+
因此控制台可安全显示 subject、来源证据、有效期和短/中/长期冲突,而不能从
60+
该对象获得任何策略切换、平台控制或执行动作。未来若要把其中一条线索转成
61+
研究任务,必须由独立的 P1--P3 入场流程重新绑定数据、回测与审计证据。

0 commit comments

Comments
 (0)