docs: cutover config model — knobs in config_overrides table, seed-from-env migration

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
momentum devandClaude Fable 5 committed 2026-07-22 20:31:33 -05:00
1 parent 495a3fa5d6
commit 537e0c7e12
1 file changed
+20 -11
+20 -11
View File
@@ -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)