Skip to content

Commit b6f7fcd

Browse files
Pigbibicodex
andcommitted
Add phase-1 QSL manifest and compatibility tooling
Co-Authored-By: Codex <noreply@openai.com>
1 parent 5674ca9 commit b6f7fcd

7 files changed

Lines changed: 548 additions & 0 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,23 @@ It supports the system but does not decide which strategy should be live. Strate
2121

2222
- `python/`: Python tooling (scripts, tests, pyproject.toml) — validation, code generation, deployment scripts.
2323
- `web/`: JavaScript web app (Cloudflare Workers strategy switch console).
24+
- `compat/`: QSL compatibility manifests (bundle matrix and repo tier rules).
2425
- `schemas/`: JSON Schema files shared by both Python and JS.
2526
- `tests/`: JavaScript unit/integration tests.
2627
- `.github/workflows/`: CI, scheduled jobs, release, or deployment workflows.
2728
- `docs/ARCHITECTURE.md`: Detailed architecture documentation.
2829

30+
## QSL compatibility manifest (phase 1)
31+
32+
This repository is the central manifest source for QSL compatibility checks.
33+
34+
- `qsl.toml`: current repo QSL metadata (`tier`, `upgrade_ring`, `bundle`).
35+
- `scripts/check_qsl_compat.py`: validate a repo's QSL compliance in `pyproject.toml`/`uv.lock` against central bundle.
36+
- `scripts/render_qsl_dependency_graph.py`: render dependency graph for review.
37+
- `compat/bundles/2026.07.0.toml`: first compatibility bundle (CalVer).
38+
- `compat/repo-tiers.toml`: repo tier and upgrade ring policy notes.
39+
- [QSL compatibility docs](docs/qsl_compat_upgrade.md)
40+
2941
## Quick start
3042

3143
```bash

compat/bundles/2026.07.0.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name = "2026.07.0"
2+
description = "Phase-1 QSL compatibility bundle"
3+
created_at = "2026-07-03"
4+
5+
[repos]
6+
QuantPlatformKit = "0063af3b4a974650ea58a7d3f26dd1b94f65d3e8"
7+
UsEquityStrategies = "46887bc3f5454d5b59623b1f5efb7c65912c6b8b"
8+
HkEquityStrategies = "61993bf261aeccf64b5a75428b9405f4e1d1d682"
9+
CnEquityStrategies = "ffbdf7303179ba6e7f9d3e28c21202f77e04762c"
10+
CryptoStrategies = "8039ddddde7634ad3615496c9b79d2918996938c"
11+
QuantStrategyPlugins = "6c10aef8989f52d82571e676092b14d315401989"
12+
MarketSignalSources = "ea8771b6b65f356e7edc4a2b08cd621186726646"

compat/repo-tiers.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[tiers]
2+
core = { name = "core", description = "平台最小闭环、运行核心与共享基础设施" }
3+
strategy_lib = { name = "strategy-lib", description = "策略库、插件与市场信号源" }
4+
pipeline = { name = "pipeline", description = "策略研发与快照流水线" }
5+
runtime = { name = "runtime", description = "平台运行时与执行服务" }
6+
ops = { name = "ops/tooling", description = "运维/发布与中央配置仓库" }
7+
8+
[upgrade_rings]
9+
ring_a = "core"
10+
ring_b = "strategy-lib"
11+
ring_c = "pipeline"
12+
ring_d = "runtime"
13+
ring_e = "ops/tooling"
14+
15+
[upgrade_rules]
16+
# 允许上升方向:稳定性从低到高(ops/tooling -> runtime -> pipeline -> strategy-lib -> core)
17+
# 建议原则:较外层可回退引用内层,内层通常不直接引用同级以上的低稳定性 ring。
18+
allow_drift = [
19+
"ops/tooling:runtime",
20+
"ops/tooling:pipeline",
21+
"ops/tooling:strategy-lib",
22+
"ops/tooling:core",
23+
"runtime:pipeline",
24+
"runtime:strategy-lib",
25+
"runtime:core",
26+
"pipeline:strategy-lib",
27+
"pipeline:core",
28+
"strategy-lib:core",
29+
]

docs/qsl_compat_upgrade.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# QSL Compatibility & Upgrade Checklist (Central Manifest Phase-1)
2+
3+
This repository carries the first version of the QSL central compatibility manifest.
4+
5+
## 文件结构
6+
7+
- `compat/bundles/*.toml`
8+
- 每个 bundle 用 Calendar Version 命名(当前:`2026.07.0`)。
9+
- 记录 QSL 管控的固定内部仓库提交。
10+
- `compat/repo-tiers.toml`
11+
- 记录仓库层级(`core/strategy-lib/pipeline/runtime/ops`)与升级 ring 规则。
12+
- `qsl.toml`
13+
- 本仓库自身的 QSL 元信息:`tier``compat`/`bundle``upgrade_ring`
14+
- `scripts/check_qsl_compat.py`
15+
- 在任意仓库根目录运行,校验:
16+
- 禁止 `@main`
17+
- 禁止短 SHA
18+
- 禁止 `requirements.txt` / `constraints.txt`(未设置 `allow_legacy=true` 时)
19+
- 内部依赖 Ref 是否与 `compat/bundles/<bundle>.toml` 一致
20+
- `scripts/render_qsl_dependency_graph.py`
21+
- 输出当前仓库的 QSL 依赖图(Markdown / Text)。
22+
23+
## 如何接入一个新仓库
24+
25+
1. 在仓库根目录新建 `qsl.toml`
26+
27+
```toml
28+
[qsl]
29+
bundle = "2026.07.0" # 选择要对齐的 central bundle
30+
compat = "2026.07.0" # 兼容检查入口(与 bundle 相同)
31+
tier = "ops/tooling"
32+
upgrade_ring = "ring_e"
33+
allow_legacy = false # 需要临时兼容时可先放开
34+
```
35+
36+
2.`pyproject.toml`/`uv.lock` 中用完整 SHA 固定 QuantStrategyLab 的内部 git 依赖。
37+
38+
3. 运行自检:
39+
40+
```bash
41+
python scripts/check_qsl_compat.py --repo-root . --non-strict
42+
python scripts/render_qsl_dependency_graph.py --repo-root . --format md
43+
```
44+
45+
说明:默认脚本会输出错误并以非零退出码返回;`--non-strict` 仅用于本地快速预览。
46+
47+
## 当前中心兼容基线
48+
49+
- Bundle: `2026.07.0`
50+
- QPK: `0063af3b4a974650ea58a7d3f26dd1b94f65d3e8`
51+
- UsEquityStrategies: `46887bc3f5454d5b59623b1f5efb7c65912c6b8b`
52+
- HkEquityStrategies: `61993bf261aeccf64b5a75428b9405f4e1d1d682`
53+
- CnEquityStrategies: `ffbdf7303179ba6e7f9d3e28c21202f77e04762c`
54+
- CryptoStrategies: `8039ddddde7634ad3615496c9b79d2918996938c`
55+
- QuantStrategyPlugins: `6c10aef8989f52d82571e676092b14d315401989`
56+
- MarketSignalSources: `ea8771b6b65f356e7edc4a2b08cd621186726646`

qsl.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[qsl]
2+
# QuantRuntimeSettings 作为 QSL 中央仓库
3+
repo = "QuantRuntimeSettings"
4+
bundle = "2026.07.0"
5+
compat = "2026.07.0"
6+
tier = "ops/tooling"
7+
upgrade_ring = "ring_e"
8+
allow_legacy = false

0 commit comments

Comments
 (0)