Config Env Contract Check
Use this skill when a change touches environment variables, deployment paths, Docker, Compose, settings APIs, or docs that describe configuration.
Contract Surfaces
Check these files when present:
.env.exampledocker-compose.ymlDockerfilefrontend/Dockerfilebackend/app/config.pybackend/app/api/routes/settings.pyfrontend/src/lib/api.tsfrontend/src/lib/paths.tsfrontend/vite.config.tsfrontend/vite.paths.tsfrontend/src/stores/useSettingsStore.tsscripts/check_config_contract.py← CI contract enforcer; must be updated atomically with env var defaultsscripts/validate_vite_env.mjs← Build-time frontend env validator; must stay in sync with inline Dockerfile validationREADME.mdINSTALLATION.mddocs/admin-guide.md.github/workflows/ci.yml
Required Checks
- Defaults match between runtime config and deployment examples.
- Docker Compose defaults do not narrow application defaults unexpectedly.
- Frontend build-time env values and backend runtime env values are coordinated.
- Public path prefixes keep
APP_ROOT_PATH,VITE_APP_BASENAME, andVITE_API_URLaligned. - Security-sensitive placeholders are documented and rejected or validated by runtime config.
- Docs examples match the actual env names consumed by code.
- Tests cover parser edge cases for new config formats.
Atomicity rule for env var default changes
When changing a default value for any env var that appears across the deployment stack, all of the following surfaces MUST be updated in the same commit:
.env.example— example/documentation valuedocker-compose.yml— Compose defaultDockerfile(root) — build-stage defaultfrontend/Dockerfile— frontend build-stage defaultscripts/check_config_contract.py— CI contract assertion
Missing any one of these causes scripts/check_config_contract.py to fail in
CI with a mismatch error that is hard to diagnose without knowing all five
surfaces must agree. The script itself is part of the contract, not just an
observer of it.
Additionally: the inline validation in frontend/Dockerfile and the standalone
scripts/validate_vite_env.mjs must implement identical validation rules.
If you add or relax a check in one, update the other.
Automation
Run the repo contract check when relevant:
python scripts/check_config_contract.py
If the script fails, treat it as a config contract regression unless the script itself is stale and the intended contract has changed.
Output
Report findings as:
Contract:
Owner:
Consumers:
Status: CONFIRMED / DISPROVED / UNVERIFIED
Evidence:
Fix: