Skip to content

Commit e8525af

Browse files
authored
docs: split bilingual open-source readmes
Split README.md and README.zh-CN.md into separate English and Chinese open-source project entry points.
1 parent eb235fd commit e8525af

2 files changed

Lines changed: 94 additions & 134 deletions

File tree

README.md

Lines changed: 32 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,164 +1,62 @@
11
# QuantRuntimeSettings
22

3-
<!-- qsl-doc-overview:start -->
3+
[Chinese README](README.zh-CN.md)
44

5-
> ⚠️ 投资有风险,不构成投资建议,仅供学习交流用途。
65
> ⚠️ Investing involves risk. This project does not provide investment advice and is for educational and research purposes only.
76
8-
## Open-source overview / 开源项目入口
7+
## What this project does
98

10-
| Item | Description |
11-
| --- | --- |
12-
| Project type | runtime settings |
13-
| What it does | Runtime settings schema and tooling for QuantStrategyLab deployments. |
14-
| 中文说明 | 运行时配置 schema 与工具,帮助各部署统一账户、profile、dry-run/live 参数。 |
15-
| Current status | Configuration tooling. It should not contain secrets or live account identifiers. |
9+
QuantRuntimeSettings is a **Runtime configuration package** in the QuantStrategyLab ecosystem. It defines schemas and tooling for shared QuantStrategyLab runtime settings.
1610

17-
### Quick start
11+
## Who this is for
1812

19-
- `python -m pip install -e '.[test]'`
20-
- `python -m pytest -q`
13+
- Engineers and researchers who want to inspect, reproduce, or extend this part of the QuantStrategyLab stack.
14+
- Operators who need a clear entry point before reading the deeper runbooks or workflow files.
15+
- Reviewers who need to understand the repository purpose, safety boundary, and evidence requirements before enabling automation.
2116

22-
### Deploy / operate safely
17+
## Current status
2318

24-
Consume generated settings from platform repositories; validate redaction and environment-specific overrides before use.
19+
Shared configuration contract; changes can affect multiple platforms.
2520

26-
### Strategy performance / evidence boundary
21+
## Repository layout
2722

28-
Not a strategy repository; correctness is schema/test coverage and safe downstream consumption.
23+
- `tests/`: unit and contract tests.
24+
- `.github/workflows/`: CI, scheduled jobs, and deployment workflows.
25+
- `scripts/`: operator scripts and local helpers.
2926

30-
> Detailed runbooks, migration notes, workflow internals, and historical decisions are kept below. Start with this overview before using the lower-level operational sections.
27+
## Quick start
3128

32-
<!-- qsl-doc-overview:end -->
33-
34-
> ⚠️ 投资有风险,不构成投资建议,仅供学习交流用途。
35-
36-
[English](#english) | [中文](#中文)
37-
38-
---
39-
40-
<a id="english"></a>
41-
## English
42-
43-
Declarative runtime settings tooling for QuantStrategyLab deployments.
44-
45-
This repository provides the schema and tooling for "which platform runs which strategy". It does not contain live runtime assignments, strategy logic, broker execution code, credentials, or secrets.
46-
47-
## Public Repository Policy
48-
49-
Live target files must not be committed to this public repository. Keep real deployment choices in GitHub Variables/Environments, GitHub Secrets, Secret Manager, or ignored local files under `local/`.
50-
51-
Use repository or environment variables for non-secret runtime choices such as `TARGET_SPEC_JSON`, `RUNTIME_TARGET_JSON`, and plugin mount declarations. Use secrets only for credentials, tokens, and private keys.
52-
53-
If a deployment needs private validation policy, keep it in ignored local files such as `local/policy.json`.
54-
55-
## Boundaries
56-
57-
- `UsEquityStrategies` owns allocation logic, strategy defaults, and risk rules.
58-
- Platform repositories own broker adapters, runtime input collection, notifications, and execution.
59-
- This repository owns runtime target schemas, examples, validation, and rendering tools.
60-
- Secret values are intentionally excluded. Use secret names or platform repository secrets when needed.
61-
62-
## Commands
63-
64-
Validate examples, or local targets when `local/targets/**/*.json` exists:
65-
66-
```bash
67-
python3 scripts/runtime_settings.py validate
68-
```
69-
70-
Render assignments for an example:
71-
72-
```bash
73-
python3 scripts/runtime_settings.py render examples/targets/schwab/live.example.json
74-
```
75-
76-
Preview GitHub variable updates for an ignored local target:
77-
78-
```bash
79-
python3 scripts/runtime_settings.py apply local/targets/longbridge/sg.json
80-
```
81-
82-
Apply GitHub variable updates:
29+
From a fresh clone:
8330

8431
```bash
85-
python3 scripts/runtime_settings.py apply --yes local/targets/longbridge/sg.json
32+
python -m pip install -e .
33+
python -m pytest -q
8634
```
8735

88-
`RUNTIME_TARGET_JSON` is canonical. Compatibility variables such as `STRATEGY_PROFILE` are generated from it so they cannot drift independently.
89-
90-
For daily strategies that want both a precheck pass and an execution pass, declare them in `runtime_target.execution_windows`. Keep the strategy logic unchanged; let the platform layer decide whether a window is `notify_only`, `dry_run`, `paper`, or `live`.
91-
92-
## Architecture
93-
94-
This repo acts as a small bridge between strategy selection and platform deployment without exposing live assignments:
95-
96-
- A target file declares the desired runtime target.
97-
- The validator checks that required runtime fields and plugin mounts are coherent.
98-
- Optional ignored local policy can add private strategy/plugin requirements.
99-
- The renderer converts the declaration into platform-specific GitHub variables.
100-
- Platform repositories keep their existing adapter code and consume the generated variables.
101-
102-
---
103-
104-
<a id="中文"></a>
105-
## 中文
36+
If a command requires credentials, run it only after reading the relevant workflow or runbook and configuring secrets outside Git.
10637

107-
QuantStrategyLab 部署运行设置的声明式 schema 和工具仓库。
38+
## Deployment and operation
10839

109-
这个仓库用于描述和校验“哪个平台运行哪个策略”的配置格式,但不保存真实线上运行分配、策略逻辑、券商执行代码、凭据或密钥。
40+
Use the schemas in platform repositories and CI validation. Roll out setting changes through review, dry-run validation, and controlled platform deployment.
11041

111-
## 公开仓库策略
42+
Prefer manual or dry-run execution first. Enable schedules or live execution only after logs, artifacts, permissions, and rollback steps are reviewed.
11243

113-
真实 target 文件不能提交到这个公开仓库。真实部署选择应保存在 GitHub Variables / Environments、GitHub Secrets、Secret Manager,或放在被忽略的 `local/` 目录下。
44+
## Strategy performance and evidence
11445

115-
非敏感运行选择,例如 `TARGET_SPEC_JSON``RUNTIME_TARGET_JSON` 和插件挂载声明,可以放在 repository 或 environment variables 中。凭据、token、private key 等必须使用 secrets。
46+
Not a strategy repository. Quality is measured by compatibility, validation coverage, and reducing configuration mistakes.
11647

117-
如果某个部署需要私有校验策略,请放在被忽略的本地文件里,例如 `local/policy.json`
48+
README files are intentionally not a source of dated performance promises. Re-run the relevant tests, backtests, or pipeline jobs before relying on any result.
11849

119-
## 边界
120-
121-
- `UsEquityStrategies` 负责分配逻辑、策略默认值和风险规则。
122-
- 平台仓库负责券商 adapter、运行时输入采集、通知和执行。
123-
- 本仓库负责运行 target 的 schema、示例、校验和渲染工具。
124-
- 本仓库不保存 secret value;需要时只引用 secret name 或平台仓库自身的 secret。
125-
126-
## 命令
127-
128-
校验示例;如果存在 `local/targets/**/*.json`,则优先校验本地 target:
129-
130-
```bash
131-
python3 scripts/runtime_settings.py validate
132-
```
133-
134-
渲染一个示例 target:
135-
136-
```bash
137-
python3 scripts/runtime_settings.py render examples/targets/schwab/live.example.json
138-
```
139-
140-
预览被忽略本地 target 对应的 GitHub variable 更新:
141-
142-
```bash
143-
python3 scripts/runtime_settings.py apply local/targets/longbridge/sg.json
144-
```
145-
146-
实际应用 GitHub variable 更新:
147-
148-
```bash
149-
python3 scripts/runtime_settings.py apply --yes local/targets/longbridge/sg.json
150-
```
50+
## Safety notes
15151

152-
`RUNTIME_TARGET_JSON` 是唯一 canonical source。兼容变量,例如 `STRATEGY_PROFILE`,由它生成,避免多个配置源互相漂移。
52+
- Never commit API keys, broker credentials, OAuth tokens, cookies, or account identifiers.
53+
- Run new strategies and platform changes in dry-run or paper mode before any live execution.
54+
- Review generated orders, artifacts, and logs manually before enabling schedules.
15355

154-
对于希望同时有预检和执行两次运行的日频策略,可以在 `runtime_target.execution_windows` 里显式声明两个窗口。策略逻辑保持不变,由平台层决定某个窗口是 `notify_only``dry_run``paper` 还是 `live`
56+
## Contributing
15557

156-
## 架构
58+
Keep changes small, reproducible, and covered by the narrowest useful tests. For strategy-facing changes, include the evidence artifact or command used to validate behavior.
15759

158-
这个仓库在策略选择和平台部署之间提供一个轻量 bridge,同时避免公开真实运行分配:
60+
## License
15961

160-
- target 文件声明期望的运行目标。
161-
- validator 检查必填运行字段和插件挂载是否一致。
162-
- 可选的 ignored local policy 可以添加私有策略/插件要求。
163-
- renderer 把声明转换成平台专属 GitHub variables。
164-
- 平台仓库保持现有 adapter 代码,并消费生成后的变量。
62+
See [LICENSE](LICENSE) if present in this repository.

README.zh-CN.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# QuantRuntimeSettings
2+
3+
[English README](README.md)
4+
5+
> ⚠️ 投资有风险,不构成投资建议,仅供学习交流用途。
6+
7+
## 这个项目做什么
8+
9+
QuantRuntimeSettings 是 QuantStrategyLab 体系中的**运行配置包**。定义 QuantStrategyLab 共享运行配置的 schema 和工具。
10+
11+
## 适合谁使用
12+
13+
- 希望阅读、复现或扩展 QuantStrategyLab 相关模块的工程师和研究人员。
14+
- 在阅读详细 runbook 或 workflow 前,需要先理解项目入口的运维人员。
15+
- 在启用自动化前,需要确认项目职责、安全边界和证据要求的 reviewer。
16+
17+
## 当前状态
18+
19+
共享配置契约;改动可能影响多个执行平台。
20+
21+
## 仓库结构
22+
23+
- `tests/`:单元测试和契约测试。
24+
- `.github/workflows/`:CI、定时任务和部署 workflow。
25+
- `scripts/`:运维脚本和本地辅助工具。
26+
27+
## 快速开始
28+
29+
从全新 clone 开始:
30+
31+
```bash
32+
python -m pip install -e .
33+
python -m pytest -q
34+
```
35+
36+
如果命令需要凭据,请先阅读相关 workflow 或 runbook,并把密钥配置在 Git 之外。
37+
38+
## 部署和运行
39+
40+
在平台仓库和 CI 校验中使用这些 schema。配置变更应经过 review、dry-run 验证和受控平台发布。
41+
42+
建议先手工运行或 dry-run。只有在日志、产物、权限和回滚步骤都检查过之后,才启用定时任务或 live 执行。
43+
44+
## 策略表现与证据边界
45+
46+
这不是策略仓库。质量标准是兼容性、校验覆盖和减少配置错误。
47+
48+
README 不应该承诺固定收益或过期指标。实际使用前,请重新运行对应测试、回测或流水线任务。
49+
50+
## 安全注意事项
51+
52+
- 不要把 API key、券商凭据、OAuth token、Cookie 或账户标识提交到 Git。
53+
- 新策略或平台变更在 live 前必须先跑 dry-run 或 paper 流程。
54+
- 启用定时任务前,需要人工检查生成的订单、产物和日志。
55+
56+
## 参与贡献
57+
58+
请保持改动小、可复现,并用最小必要测试覆盖。涉及策略的改动,需要附上验证行为的证据产物或命令。
59+
60+
## 许可证
61+
62+
如仓库包含 [LICENSE](LICENSE),请以该文件为准。

0 commit comments

Comments
 (0)