Instance knows its environment
A running instance cannot today determine whether it is development, staging, or production — nothing inside the process carries it; the port it binds and the domain HAProxy routes to it are external facts (model-name names the app, not the environment; dev and staging Model Bank are both modelbank). Surfaced by the generate-button prompt-log design (2026-09-27): the log origin/filename can name the app but not the environment, so dev and staging generations are indistinguishable in the log.
Environment vocabulary of record: docs/deployment.md → "Environments" (the :domain-stg item, DONE 2026-09-13). This item gives the instance that vocabulary at runtime:
- Source of truth is ops metadata, not introspection: an env var (e.g.
DATA_UI_ENV=dev|stg|prod) set byprofile-run.sh(host profiles →dev) and by the deploy script (stg/prod), read once at startup into a dynamic variable, defaulting todevwhen unset (bare REPL image keeps working). - Surface it:
/api/infopayload,pl:log context, and available to hook code (prompt-log origin field first consumer). - Decide whether an unset variable is an error in production deploys (fail loud) vs defaulting quietly.
Small item; do it with or just before the generate-button prompt logging.
- Slot
- 9800
- Status
- 10 Open
- Tags
- backend, scripts
- Contributors
- Donnie