diff --git a/docs/internal_dependency_pin_policy.md b/docs/internal_dependency_pin_policy.md index 8176ee7..d7324c9 100644 --- a/docs/internal_dependency_pin_policy.md +++ b/docs/internal_dependency_pin_policy.md @@ -1,5 +1,7 @@ # Internal dependency pin policy +[简体中文](internal_dependency_pin_policy.zh-CN.md) + QuantStrategyLab shares Python packages across platforms, strategies, and pipelines via git URL pins. This document explains how pins are tracked, when to use tags versus full commit SHAs, and how to bump dependencies safely. ## Source of truth diff --git a/docs/internal_dependency_pin_policy.zh-CN.md b/docs/internal_dependency_pin_policy.zh-CN.md index 4e685fd..b1b12f3 100644 --- a/docs/internal_dependency_pin_policy.zh-CN.md +++ b/docs/internal_dependency_pin_policy.zh-CN.md @@ -1,5 +1,7 @@ # 内部依赖 pin 政策 +[English](internal_dependency_pin_policy.md) + QuantStrategyLab 通过 git URL pin 在平台、策略与 pipeline 之间共享 Python 包。本文说明 pin 如何被追踪、何时使用 tag 与完整 commit SHA,以及如何安全升级依赖。 ## 权威来源 diff --git a/docs/manual_strategy_switch_permission_control.md b/docs/manual_strategy_switch_permission_control.md new file mode 100644 index 0000000..45ebd70 --- /dev/null +++ b/docs/manual_strategy_switch_permission_control.md @@ -0,0 +1,16 @@ +# Manual strategy switch permission control + +[简体中文](manual_strategy_switch_permission_control.zh-CN.md) + +Simplified permission model for a personal quant stack: you can switch strategies +like Codex would, while keeping basic guardrails against mis-clicks and secret +leakage. + +## Default: single-operator mode + +1. Only your GitHub account has write/admin on the runtime settings repository. +2. Configure `RUNTIME_SETTINGS_GH_TOKEN` as a GitHub secret. +3. Scope the token to the minimum variables/workflow permissions for target platform repos; do not grant `contents: write`. +4. Run the workflow once with `apply=false` to review the preview before applying. + +See the Chinese note for the full checklist, fork guidance, and threat-model notes. diff --git a/docs/manual_strategy_switch_permission_control.zh-CN.md b/docs/manual_strategy_switch_permission_control.zh-CN.md index 2d3edcb..98b3a6d 100644 --- a/docs/manual_strategy_switch_permission_control.zh-CN.md +++ b/docs/manual_strategy_switch_permission_control.zh-CN.md @@ -1,5 +1,7 @@ # 手动策略切换权限控制方案 +[English](manual_strategy_switch_permission_control.md) + 这是个人量化系统的简化权限方案。默认目标不是做团队审批,而是让你自己能像让 Codex 切换一样直接操作,同时保留必要的防误触和防泄密边界。 ## 默认方案:个人单人模式 diff --git a/docs/strategy_switch_admin_backend.md b/docs/strategy_switch_admin_backend.md index 2a53151..b68a656 100644 --- a/docs/strategy_switch_admin_backend.md +++ b/docs/strategy_switch_admin_backend.md @@ -1,5 +1,7 @@ # Strategy Switch Admin Backend +[简体中文](strategy_switch_admin_backend.zh-CN.md) + Goal: keep the open-source switch page public and read-only by default, while allowing an authenticated admin to manage who can switch strategies and which account routes appear in the dropdown. ## Current Implementation diff --git a/docs/strategy_switch_admin_backend.zh-CN.md b/docs/strategy_switch_admin_backend.zh-CN.md index 3ae185d..6822794 100644 --- a/docs/strategy_switch_admin_backend.zh-CN.md +++ b/docs/strategy_switch_admin_backend.zh-CN.md @@ -1,5 +1,7 @@ # 策略切换登录权限后台 +[English](strategy_switch_admin_backend.md) + 目标:开源页面可以公开查看,但只有登录并通过权限校验的 GitHub 账号能一键切换策略;管理员可以自己维护登录名单和账号下拉,不需要每次改代码。 ## 当前实现 diff --git a/docs/strategy_switch_architecture_security_review.md b/docs/strategy_switch_architecture_security_review.md new file mode 100644 index 0000000..fba8cd4 --- /dev/null +++ b/docs/strategy_switch_architecture_security_review.md @@ -0,0 +1,18 @@ +# Strategy switch console architecture and security review + +[简体中文](strategy_switch_architecture_security_review.zh-CN.md) + +Date: 2026-06-09 + +## Summary + +The current design fits a personal quant system: the public page stays read-only; +GitHub OAuth gates the Worker trigger; the `Manual Strategy Switch` workflow still +performs the actual GitHub Variables write. This boundary is safer than a browser +password plus front-end token, and simpler than a full approval backend. + +No Critical/High issues blocked release. Basic security response headers, same-origin +`Origin` checks for state-changing requests, and DOM API rendering for the main +switch page were added. + +See the Chinese review for architecture diagrams, threat notes, and follow-up items. diff --git a/docs/strategy_switch_architecture_security_review.zh-CN.md b/docs/strategy_switch_architecture_security_review.zh-CN.md index 7ac8c4f..2326ad0 100644 --- a/docs/strategy_switch_architecture_security_review.zh-CN.md +++ b/docs/strategy_switch_architecture_security_review.zh-CN.md @@ -1,5 +1,7 @@ # 策略切换控制台架构与安全 Review +[English](strategy_switch_architecture_security_review.md) + 日期:2026-06-09 ## 摘要 diff --git a/docs/strategy_switch_fork_guide.md b/docs/strategy_switch_fork_guide.md index 2a57c49..2dfce16 100644 --- a/docs/strategy_switch_fork_guide.md +++ b/docs/strategy_switch_fork_guide.md @@ -1,5 +1,7 @@ # Fork Guide: Strategy Switch Console +[简体中文](strategy_switch_fork_guide.zh-CN.md) + This guide explains how to fork this repository and deploy the same public-readonly, login-to-switch console for your own platform repositories. ## What You Need diff --git a/docs/strategy_switch_fork_guide.zh-CN.md b/docs/strategy_switch_fork_guide.zh-CN.md index 38f4862..addbcfd 100644 --- a/docs/strategy_switch_fork_guide.zh-CN.md +++ b/docs/strategy_switch_fork_guide.zh-CN.md @@ -1,5 +1,7 @@ # Fork 指南:策略切换控制台 +[English](strategy_switch_fork_guide.md) + 这份文档说明别人 fork 本仓库后,如何部署同样的“公开只读、登录后一键切换”策略控制台。 ## 你需要准备什么 diff --git a/examples/targets/qmt/README.md b/examples/targets/qmt/README.md new file mode 100644 index 0000000..e4ce8e5 --- /dev/null +++ b/examples/targets/qmt/README.md @@ -0,0 +1,19 @@ +# QMT (A-share) runtime target architecture + +[简体中文](README.zh-CN.md) + +Current phase: **dry-run only, no live broker account**. Broker differences (CITIC, +Guojin, etc.) are not modeled at the `platform_id` layer; when live trading is +enabled, add target entries in `account-options` and distinguish miniQMT +deployments on the broker side. + +## Layers + +| Layer | Repo / ID | Notes | +| --- | --- | --- | +| Strategy | `CnEquityStrategies` / `cn_*` profile | `cn_equity` domain only | +| Platform | `QmtPlatform` / `platform_id=qmt` | Unified miniQMT execution layer | +| Runtime settings | `QuantRuntimeSettings` | Target examples, switch console, `manual-strategy-switch` | +| Variable scope | `variable_scope=repository` | QMT uses repository-level GitHub Variables | + +See the Chinese README for workflow wiring, variable names, and operator steps. diff --git a/examples/targets/qmt/README.zh-CN.md b/examples/targets/qmt/README.zh-CN.md index 51b8905..a75be68 100644 --- a/examples/targets/qmt/README.zh-CN.md +++ b/examples/targets/qmt/README.zh-CN.md @@ -1,5 +1,7 @@ # QMT(A 股)Runtime Target 架构 +[English](README.md) + 当前阶段:**仅 dry-run,无 live 券商账号**。中信 / 国金等券商差异不在 `platform_id` 层建模,将来 live 时在 `account-options` 增加 target 项并在对应 miniQMT 部署侧区分即可。 ## 分层 diff --git a/web/strategy-switch-console/README.md b/web/strategy-switch-console/README.md index 7a74ec3..b37991f 100644 --- a/web/strategy-switch-console/README.md +++ b/web/strategy-switch-console/README.md @@ -1,5 +1,7 @@ # Strategy Switch Console Worker +[简体中文](README.zh-CN.md) + This is the authenticated backend for the personal strategy switch console. It is intentionally thin: - Visitors who are not signed in, or are not in the allowlist, can only view the public page. diff --git a/web/strategy-switch-console/README.zh-CN.md b/web/strategy-switch-console/README.zh-CN.md index 6194e71..1429514 100644 --- a/web/strategy-switch-console/README.zh-CN.md +++ b/web/strategy-switch-console/README.zh-CN.md @@ -1,5 +1,7 @@ # 策略切换控制台 +[English](README.md) + 这是个人量化系统的登录版网页控制台示例。它用 Cloudflare Worker 提供一个很薄的后端: - 未登录或不在 allowlist:只能查看公开页面,不能触发切换。