|
| 1 | +# QuantRuntimeSettings |
| 2 | + |
| 3 | +Declarative runtime settings tooling for QuantStrategyLab deployments. |
| 4 | + |
| 5 | +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. |
| 6 | + |
| 7 | +## Public Repository Policy |
| 8 | + |
| 9 | +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/`. |
| 10 | + |
| 11 | +Use repository or environment variables for non-secret runtime choices such as `RUNTIME_TARGET_JSON` and plugin mount declarations. Use secrets only for credentials, tokens, and private keys. |
| 12 | + |
| 13 | +If a deployment needs private validation policy, keep it in ignored local files such as `local/policy.json`. |
| 14 | + |
| 15 | +## Boundaries |
| 16 | + |
| 17 | +- `UsEquityStrategies` owns allocation logic, strategy defaults, and risk rules. |
| 18 | +- Platform repositories own broker adapters, runtime input collection, notifications, and execution. |
| 19 | +- This repository owns runtime target schemas, examples, validation, and rendering tools. |
| 20 | +- Secret values are intentionally excluded. Use secret names or platform repository secrets when needed. |
| 21 | + |
| 22 | +## Commands |
| 23 | + |
| 24 | +Validate examples, or local targets when `local/targets/**/*.json` exists: |
| 25 | + |
| 26 | +```bash |
| 27 | +python3 scripts/runtime_settings.py validate |
| 28 | +``` |
| 29 | + |
| 30 | +Render assignments for an example: |
| 31 | + |
| 32 | +```bash |
| 33 | +python3 scripts/runtime_settings.py render examples/targets/schwab/live.example.json |
| 34 | +``` |
| 35 | + |
| 36 | +Preview GitHub variable updates for an ignored local target: |
| 37 | + |
| 38 | +```bash |
| 39 | +python3 scripts/runtime_settings.py apply local/targets/longbridge/sg.json |
| 40 | +``` |
| 41 | + |
| 42 | +Apply GitHub variable updates: |
| 43 | + |
| 44 | +```bash |
| 45 | +python3 scripts/runtime_settings.py apply --yes local/targets/longbridge/sg.json |
| 46 | +``` |
| 47 | + |
| 48 | +`RUNTIME_TARGET_JSON` is canonical. Compatibility variables such as `STRATEGY_PROFILE` are generated from it so they cannot drift independently. |
| 49 | + |
| 50 | +## Architecture |
| 51 | + |
| 52 | +This repo acts as a small bridge between strategy selection and platform deployment without exposing live assignments: |
| 53 | + |
| 54 | +- A target file declares the desired runtime target. |
| 55 | +- The validator checks that required runtime fields and plugin mounts are coherent. |
| 56 | +- Optional ignored local policy can add private strategy/plugin requirements. |
| 57 | +- The renderer converts the declaration into platform-specific GitHub variables. |
| 58 | +- Platform repositories keep their existing adapter code and consume the generated variables. |
0 commit comments