Skip to content

Commit c84d23b

Browse files
committed
Document environment configuration standards
1 parent 62ebb31 commit c84d23b

16 files changed

Lines changed: 770 additions & 636 deletions

.env.example

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
# Official environment model:
55
# Local (VS Code) -> DEV -> IST -> UAT -> PROD
66
#
7+
# Official copy-source file names:
8+
# - .env.local
9+
# - .env.dev
10+
# - .env.ist
11+
# - .env.uat
12+
# - .env.prod
13+
# Legacy technical debt only:
14+
# - .env.prd
15+
#
716
# Environment invariance:
817
# Use an identical deployable artifact in every environment.
918
# Only .env values and environment-managed secret values differ.
@@ -19,10 +28,21 @@
1928
# Configure runtime auth, database, and storage connections here.
2029
# Missing connection configuration reports diagnostics instead of falling back.
2130

22-
# Browser-safe public site configuration exposed through the server API.
31+
# Required environment identity.
32+
# Allowed values: local, dev, ist, uat, prod.
33+
GAMEFOUNDRY_ENVIRONMENT=local
34+
35+
# Browser-safe public site/API configuration exposed through the server API.
2336
# These values may be sent to browser pages. Do not place secrets here.
37+
# Local uses 127.0.0.1 hostnames.
38+
# DEV/IST/UAT/PROD use configured *.gamefoundrystudio.com hostnames.
39+
# One shared API/service contract is used everywhere; URLs may differ by .env only.
40+
# Do not split Local API and Public API contracts.
2441
GAMEFOUNDRY_SITE_URL=
2542
GAMEFOUNDRY_API_URL=
43+
44+
# Display-only environment label.
45+
# Do not use this value for runtime behavior, API/service selection, storage selection, or feature behavior.
2646
# Valid environment banner labels:
2747
# - Local Development Environment
2848
# - Development Environment

docs_build/dev/BUILD_PR.md

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
1-
# PR_26177_OWNER_050-environment-governance-model
1+
# PR_26177_OWNER_051-environment-configuration-standards
22

33
## Purpose
44

5-
Establish the official Game Foundry Studio environment governance model and align the active configuration example comments/placeholders with that model.
5+
Define the official Game Foundry Studio environment configuration standards that build on the OWNER_050 environment model.
66

77
## Source Of Truth
88

9-
This `BUILD_PR.md` and the user request are the source of truth for `PR_26177_OWNER_050-environment-governance-model`.
9+
This `BUILD_PR.md` and the user request are the source of truth for `PR_26177_OWNER_051-environment-configuration-standards`.
1010

1111
## Exact Scope
1212

13-
- Documentation/governance only unless `.env.example` comment or placeholder updates are required.
14-
- Establish `Local (VS Code) -> DEV -> IST -> UAT -> PROD` as the official environment model.
15-
- Define the environment invariance rule: the deployable artifact is identical across all environments; only `.env` values and environment-managed secret values differ.
16-
- Define one shared API/service contract across all environments.
17-
- Define Supabase Auth, Supabase Postgres, and Cloudflare R2 as required for every environment.
18-
- Define R2 top-level prefixes:
19-
- `/local/`
20-
- `/dev/`
21-
- `/ist/`
22-
- `/uat/`
23-
- `/prod/`
24-
- Define that all environments receive approved guest seed data for all tools.
25-
- State SQLite is deprecated/retired and is not an active runtime database.
26-
- Review `.env.example` and update comments/placeholders to match the official model.
13+
- Governance/documentation only.
14+
- Build on OWNER_050 environment model.
15+
- Standardize environment file names:
16+
- `.env.local`
17+
- `.env.dev`
18+
- `.env.ist`
19+
- `.env.uat`
20+
- `.env.prod`
21+
- Treat `.env.prd` as legacy technical debt only.
22+
- Add `GAMEFOUNDRY_ENVIRONMENT` allowed values:
23+
- `local`
24+
- `dev`
25+
- `ist`
26+
- `uat`
27+
- `prod`
28+
- Keep `GAMEFOUNDRY_ENVIRONMENT_LABEL` display-only.
29+
- Document that only `.env` values and environment-managed secrets differ.
30+
- Document that the deployable artifact must remain identical.
31+
- Document one shared API/service contract.
32+
- Document feature flags cannot create permanent environment-specific behavior.
33+
- Review `.env.example` comments/placeholders only.
34+
- Do not change runtime behavior.
2735
- Create required Codex reports under `docs_build/dev/reports/`.
2836
- Create repo-structured delta ZIP under `tmp/`.
2937

@@ -33,17 +41,16 @@ This `BUILD_PR.md` and the user request are the source of truth for `PR_26177_OW
3341
- `docs_build/dev/PROJECT_INSTRUCTIONS.md`
3442
- `docs_build/dev/ProjectInstructions/PROJECT_INSTRUCTIONS.md`
3543
- `docs_build/dev/ProjectInstructions/README.txt`
44+
- `docs_build/dev/ProjectInstructions/addendums/environment_configuration_standards.md`
3645
- `docs_build/dev/ProjectInstructions/addendums/environment_governance_model.md`
37-
- `docs_build/dev/ProjectInstructions/addendums/postgres_only.md`
3846
- `docs_build/dev/ProjectInstructions/addendums/release_gate.md`
39-
- `docs_build/dev/admin-notes/index.txt`
4047
- `.env.example`
41-
- `docs_build/dev/reports/PR_26177_OWNER_050-environment-governance-model.md`
42-
- `docs_build/dev/reports/PR_26177_OWNER_050-environment-governance-model_branch-validation.md`
43-
- `docs_build/dev/reports/PR_26177_OWNER_050-environment-governance-model_requirement-checklist.md`
44-
- `docs_build/dev/reports/PR_26177_OWNER_050-environment-governance-model_validation-lane.md`
45-
- `docs_build/dev/reports/PR_26177_OWNER_050-environment-governance-model_manual-validation-notes.md`
46-
- `docs_build/dev/reports/PR_26177_OWNER_050-environment-governance-model_instruction-compliance-checklist.md`
48+
- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards.md`
49+
- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_branch-validation.md`
50+
- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_requirement-checklist.md`
51+
- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_validation-lane.md`
52+
- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_manual-validation-notes.md`
53+
- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_instruction-compliance-checklist.md`
4754
- `docs_build/dev/reports/codex_review.diff`
4855
- `docs_build/dev/reports/codex_changed_files.txt`
4956

@@ -53,24 +60,26 @@ This `BUILD_PR.md` and the user request are the source of truth for `PR_26177_OW
5360
- No UI changes.
5461
- No engine core changes.
5562
- No `start_of_day` folder changes.
56-
- No `.env`, `.env.dev`, `.env.ist`, `.env.uat`, or `.env.prd` secret/value edits.
63+
- No actual `.env`, `.env.local`, `.env.dev`, `.env.ist`, `.env.uat`, `.env.prod`, or `.env.prd` secret/value file edits.
5764
- No API implementation changes.
5865
- No storage implementation changes.
5966
- No database migration or DDL changes.
67+
- No feature flag implementation changes.
6068

6169
## Validation
6270

6371
Run exactly:
6472

6573
```powershell
66-
git status
6774
git diff --check
6875
```
6976

77+
Playwright is not required unless runtime files change.
78+
7079
## Artifact
7180

7281
Create repo-structured delta ZIP:
7382

7483
```text
75-
tmp/PR_26177_OWNER_050-environment-governance-model_delta.zip
84+
tmp/PR_26177_OWNER_051-environment-configuration-standards_delta.zip
7685
```

docs_build/dev/PROJECT_INSTRUCTIONS.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,9 @@ Environment invariance rule:
497497
Shared API/service contract:
498498
- One shared API/service contract is required across Local (VS Code), DEV, IST, UAT, and PROD.
499499
- Browser/UI/runtime code must consume the same contract in every environment.
500-
- Environment-specific endpoints, keys, buckets, and prefixes are configuration values only.
500+
- Environment-specific URLs, endpoints, keys, buckets, and prefixes are `.env` or environment-managed secret/config values only.
501501
- Do not create environment-specific API/service contracts.
502+
- Do not split Local API and Public API contracts. Local and shared environments use the same API/service contract; URLs may differ by `.env` only.
502503

503504
Required services in every environment:
504505
- Supabase Auth
@@ -520,10 +521,22 @@ Required Cloudflare R2 top-level prefixes:
520521
Derived R2 paths for projects, backups, exports, or future storage lanes must stay under the matching top-level prefix for the active environment.
521522

522523
The following files are copy-source files only:
524+
- `.env.local`
523525
- `.env.dev`
524526
- `.env.ist`
525527
- `.env.uat`
526-
- `.env.prd` is the legacy copy-source filename for PROD values; new environment governance uses the `PROD` environment name.
528+
- `.env.prod`
529+
530+
`.env.prd` is legacy technical debt only. New environment governance uses `.env.prod` and the `PROD` environment name.
531+
532+
Allowed `GAMEFOUNDRY_ENVIRONMENT` values:
533+
- `local`
534+
- `dev`
535+
- `ist`
536+
- `uat`
537+
- `prod`
538+
539+
`GAMEFOUNDRY_ENVIRONMENT_LABEL` is display-only and must not drive runtime behavior, API/service selection, database selection, storage selection, or feature behavior.
527540

528541
Valid environment stages are:
529542
- `Local (VS Code)`
@@ -552,6 +565,16 @@ Do not introduce runtime parameters such as:
552565

553566
Application code, runtime code, API/service code, and DB runtime scripts must not branch behavior by deployment target name.
554567

568+
Host/domain configuration:
569+
- Local (VS Code) uses `127.0.0.1` hostnames.
570+
- DEV, IST, UAT, and PROD use configured `*.gamefoundrystudio.com` hostnames.
571+
- Host/domain differences are configuration values only and must not create separate deployable artifacts or environment-specific code.
572+
573+
Feature flag governance:
574+
- Feature flags must not create permanent environment-specific behavior.
575+
- Feature flags may be used only for staged rollout, testing, or emergency mitigation.
576+
- Feature flags must be removed, promoted to normal behavior, or documented as active temporary controls when the rollout, test, or mitigation ends.
577+
555578
## RUNTIME SCRIPT NAMING GOVERNANCE
556579

557580
Active runtime script names should describe capability rather than vendor/provider.

docs_build/dev/ProjectInstructions/PROJECT_INSTRUCTIONS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Existing Project Instructions remain preserved in their current locations. This
3939

4040
`docs_build/dev/ProjectInstructions/addendums/environment_governance_model.md` defines the official environment model, environment invariance rule, shared API/service contract rule, required Supabase/Postgres/R2 services, required R2 prefixes, and SQLite retired status.
4141

42+
`docs_build/dev/ProjectInstructions/addendums/environment_configuration_standards.md` defines official `.env` file names, environment variable values, host/domain configuration, API URL configuration, R2 prefix configuration, and feature flag governance.
43+
4244
## Merge Control
4345

4446
No PR in this operating system is merged without explicit owner approval.

docs_build/dev/ProjectInstructions/README.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ Addendum index:
5050
- Codex Project Instructions Startup: project-instructions/addendums/codex-project-instructions-startup.md
5151
- Project Reference Files Governance: docs_build/dev/ProjectInstructions/addendums/project_reference_files.md
5252
- Environment Governance Model: docs_build/dev/ProjectInstructions/addendums/environment_governance_model.md
53+
- Environment Configuration Standards: docs_build/dev/ProjectInstructions/addendums/environment_configuration_standards.md
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Environment Configuration Standards
2+
3+
Status: Approved
4+
Owner: OWNER
5+
6+
## Purpose
7+
8+
Define the official environment configuration standards that build on the OWNER_050 environment model.
9+
10+
This addendum is governance/documentation only. It does not change runtime behavior, API implementation, storage implementation, database DDL, or secret values.
11+
12+
## Source Model
13+
14+
This standard builds on:
15+
16+
```text
17+
Local (VS Code) -> DEV -> IST -> UAT -> PROD
18+
```
19+
20+
The deployable artifact must remain identical across all environments.
21+
22+
Only `.env` values and environment-managed secret values may differ by environment.
23+
24+
Deployable artifacts must not contain environment-specific application code, runtime code, API/service code, database code, storage code, or feature behavior.
25+
26+
## Official Environment Files
27+
28+
Official environment copy-source file names:
29+
30+
- `.env.local`
31+
- `.env.dev`
32+
- `.env.ist`
33+
- `.env.uat`
34+
- `.env.prod`
35+
36+
Runtime startup still loads `.env` only. The official flow is to copy the selected source file to `.env` before validation/startup.
37+
38+
`.env.prd` is legacy technical debt only. Do not introduce new references to `.env.prd` except when documenting migration or historical compatibility.
39+
40+
## Environment Identity
41+
42+
Allowed `GAMEFOUNDRY_ENVIRONMENT` values:
43+
44+
- `local`
45+
- `dev`
46+
- `ist`
47+
- `uat`
48+
- `prod`
49+
50+
`GAMEFOUNDRY_ENVIRONMENT` identifies the active configuration lane. It must not cause application, runtime, API/service, database, storage, or feature behavior forks.
51+
52+
`GAMEFOUNDRY_ENVIRONMENT_LABEL` is display-only. It may be used for visual labels and diagnostics, but must not drive runtime behavior, API/service selection, database selection, storage selection, or feature behavior.
53+
54+
## Host And Domain Configuration
55+
56+
Local (VS Code) uses `127.0.0.1` hostnames.
57+
58+
DEV, IST, UAT, and PROD use configured `*.gamefoundrystudio.com` hostnames.
59+
60+
Host/domain differences are configuration values only. They must not create separate deployable artifacts or environment-specific code.
61+
62+
## R2 Prefix Configuration
63+
64+
Required Cloudflare R2 top-level prefixes:
65+
66+
- Local (VS Code): `/local/`
67+
- DEV: `/dev/`
68+
- IST: `/ist/`
69+
- UAT: `/uat/`
70+
- PROD: `/prod/`
71+
72+
R2 project, backup, export, import, or future storage paths must stay under the matching environment prefix.
73+
74+
## API/Service Contract Configuration
75+
76+
One shared API/service contract is required across Local (VS Code), DEV, IST, UAT, and PROD.
77+
78+
Rules:
79+
80+
- API URLs may differ by `.env` only.
81+
- Do not split Local API and Public API contracts.
82+
- Do not create environment-specific API/service contracts.
83+
- Browser/UI/runtime code must use the same API/service contract shape in every environment.
84+
85+
## Feature Flag Governance
86+
87+
Feature flags must not create permanent environment-specific behavior.
88+
89+
Allowed feature flag uses:
90+
91+
- staged rollout
92+
- testing
93+
- emergency mitigation
94+
95+
Feature flags must be removed, promoted to normal behavior, or documented as active temporary controls when the rollout, test, or mitigation ends.
96+
97+
Feature flags must not become a substitute for the environment invariance rule.

docs_build/dev/ProjectInstructions/addendums/environment_governance_model.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,7 @@ Rules:
112112
## Scope Boundary
113113

114114
This governance addendum defines documentation and configuration contract rules only. It does not change runtime code, API implementation code, storage implementation code, database DDL, or secret values.
115+
116+
## Related Configuration Standard
117+
118+
`docs_build/dev/ProjectInstructions/addendums/environment_configuration_standards.md` defines the official `.env` file names, allowed `GAMEFOUNDRY_ENVIRONMENT` values, display-only environment label rule, host/domain configuration, API URL configuration, and feature flag governance.

docs_build/dev/ProjectInstructions/addendums/release_gate.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ The release gate should confirm these files when relevant to the PR:
3838
- `docs_build/dev/ProjectInstructions/addendums/pr_workflow.md`
3939
- `docs_build/dev/ProjectInstructions/addendums/project_reference_files.md`
4040
- `docs_build/dev/ProjectInstructions/addendums/environment_governance_model.md`
41+
- `docs_build/dev/ProjectInstructions/addendums/environment_configuration_standards.md`
4142
- `docs_build/dev/ProjectInstructions/team_assignments/team_ownership.md`
4243
- `docs_build/dev/admin-notes/Installs required.txt` when present
4344
- `docs_build/dev/admin-notes/Table layout.txt` when present

0 commit comments

Comments
 (0)