From 537e0c7e1259b72e16a1d3f64feac348f76f9a0b Mon Sep 17 00:00:00 2001 From: momentum dev Date: Wed, 22 Jul 2026 20:31:33 -0500 Subject: [PATCH] =?UTF-8?q?docs:=20cutover=20config=20model=20=E2=80=94=20?= =?UTF-8?q?knobs=20in=20config=5Foverrides=20table,=20seed-from-env=20migr?= =?UTF-8?q?ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- docs/LIVE-CUTOVER.md | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/docs/LIVE-CUTOVER.md b/docs/LIVE-CUTOVER.md index da44125..3cd4d62 100644 --- a/docs/LIVE-CUTOVER.md +++ b/docs/LIVE-CUTOVER.md @@ -47,17 +47,26 @@ construction. The paper stack stays untouched as the research substrate ## Config model (added 2026-07-22) -Strategy knobs live in **`data/overrides.env`** on each stack's data volume — -NOT in the compose file. Every service loads it at boot (override beats -compose); the admin panel (paper :8767, live :8867) edits it via /api/config -with a whitelist (`TRADING_*`, `TRIGGER_*`, `WATCHER_*`, `NEWS_*`, `OLLAMA_*`, -`DISCOVER_*`; secrets refused) and can restart the loop to apply. Compose -retains only infra + secrets (keys, URLs, DB). The live stack's knob seed is -`deploy/docker/overrides.live.seed.env` — copy it to -`/mnt/Volume/Storage/Apps/momentum-live/data/overrides.env` during setup -(step 4 below). Flip-day knob changes (risk, regime gate, equity floor) happen -in the admin UI / overrides file; only keys + ALPACA_BASE_URL remain compose -edits (they're secret-marked, deliberately not UI-editable). +Strategy knobs live in the **`config_overrides` database table** (commit +495a3fa), edited via the admin panel (paper :8767, live :8867) with a +whitelist (`TRADING_*`, `TRIGGER_*`, `WATCHER_*`, `NEWS_*`, `OLLAMA_*`, +`DISCOVER_*`; secrets refused). Boot precedence: compose env < +`data/overrides.env` file < database — every service applies the table last; +DB down falls through silently so boot never blocks on config. Compose and +the overrides file retain only infra + secrets (keys, URLs, DB address — the +DB address cannot live inside the DB). One-shot migration inside any stack +container: + + python -m runtime.env_overrides seed-from-env + +copies that container's effective knobs into the table, after which the +compose knob lines are dead weight (strip at any redeploy). For the live +stack: run the seed after `bootstrap_live_db.sh` (the seeded table travels +with the DB restore otherwise — which is fine too, since the paper dump's +table carries the same knobs; just re-check flip-day values). Flip-day knob +changes (risk, regime gate, equity floor) happen in the admin UI; only keys + +ALPACA_BASE_URL remain compose edits (secret-marked, deliberately not +UI-editable). ## Cutover procedure (~15 min, paper stack keeps running throughout)