Skip to content

Commit 0e9aa23

Browse files
authored
Merge pull request #203 from ToolboxAid/PR_26177_OWNER_051-environment-configuration-standards
PR_26177_OWNER_051-environment-configuration-standards
2 parents 62ebb31 + 7f03c45 commit 0e9aa23

16 files changed

Lines changed: 894 additions & 620 deletions

.env.example

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,29 @@
44
# Official environment model:
55
# Local (VS Code) -> DEV -> IST -> UAT -> PROD
66
#
7+
# Only this .env.example file is committed to the repository.
8+
# Real .env files are user/environment-owned and must live outside
9+
# the repo clone or be injected by deployment.
10+
#
11+
# Official external copy-source names when a copy-source file is used:
12+
# - .env.local
13+
# - .env.dev
14+
# - .env.ist
15+
# - .env.uat
16+
# - .env.prod
17+
# Legacy technical debt only:
18+
# - .env.prd
19+
#
20+
# Example external layout:
21+
# - /env/local/.env
22+
# - /env/dev/.env
23+
# - /env/ist/.env
24+
# - /env/uat/.env
25+
# - /env/prod/.env
26+
# - /GFS/ repo clone
27+
#
28+
# The app/runtime reads .env values supplied by the target environment.
29+
#
730
# Environment invariance:
831
# Use an identical deployable artifact in every environment.
932
# Only .env values and environment-managed secret values differ.
@@ -19,10 +42,21 @@
1942
# Configure runtime auth, database, and storage connections here.
2043
# Missing connection configuration reports diagnostics instead of falling back.
2144

22-
# Browser-safe public site configuration exposed through the server API.
45+
# Required environment identity.
46+
# Allowed values: local, dev, ist, uat, prod.
47+
GAMEFOUNDRY_ENVIRONMENT=local
48+
49+
# Browser-safe public site/API configuration exposed through the server API.
2350
# These values may be sent to browser pages. Do not place secrets here.
51+
# Local uses 127.0.0.1 hostnames.
52+
# DEV/IST/UAT/PROD use configured *.gamefoundrystudio.com hostnames.
53+
# One shared API/service contract is used everywhere; URLs may differ by .env only.
54+
# Do not split Local API and Public API contracts.
2455
GAMEFOUNDRY_SITE_URL=
2556
GAMEFOUNDRY_API_URL=
57+
58+
# Display-only environment label.
59+
# Do not use this value for runtime behavior, API/service selection, storage selection, or feature behavior.
2660
# Valid environment banner labels:
2761
# - Local Development Environment
2862
# - Development Environment

docs_build/dev/BUILD_PR.md

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
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+
- Clarify that only `.env.example` is committed to the repository.
35+
- Clarify that real `.env` files are user/environment-owned and must live outside the repo clone or be injected by deployment.
36+
- Document the external `/env/<target>/.env` layout next to the `/GFS/` repo clone.
37+
- Do not change runtime behavior.
2738
- Create required Codex reports under `docs_build/dev/reports/`.
2839
- Create repo-structured delta ZIP under `tmp/`.
2940

@@ -33,17 +44,16 @@ This `BUILD_PR.md` and the user request are the source of truth for `PR_26177_OW
3344
- `docs_build/dev/PROJECT_INSTRUCTIONS.md`
3445
- `docs_build/dev/ProjectInstructions/PROJECT_INSTRUCTIONS.md`
3546
- `docs_build/dev/ProjectInstructions/README.txt`
47+
- `docs_build/dev/ProjectInstructions/addendums/environment_configuration_standards.md`
3648
- `docs_build/dev/ProjectInstructions/addendums/environment_governance_model.md`
37-
- `docs_build/dev/ProjectInstructions/addendums/postgres_only.md`
3849
- `docs_build/dev/ProjectInstructions/addendums/release_gate.md`
39-
- `docs_build/dev/admin-notes/index.txt`
4050
- `.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`
51+
- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards.md`
52+
- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_branch-validation.md`
53+
- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_requirement-checklist.md`
54+
- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_validation-lane.md`
55+
- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_manual-validation-notes.md`
56+
- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_instruction-compliance-checklist.md`
4757
- `docs_build/dev/reports/codex_review.diff`
4858
- `docs_build/dev/reports/codex_changed_files.txt`
4959

@@ -53,24 +63,27 @@ This `BUILD_PR.md` and the user request are the source of truth for `PR_26177_OW
5363
- No UI changes.
5464
- No engine core changes.
5565
- No `start_of_day` folder changes.
56-
- No `.env`, `.env.dev`, `.env.ist`, `.env.uat`, or `.env.prd` secret/value edits.
66+
- No actual `.env`, `.env.local`, `.env.dev`, `.env.ist`, `.env.uat`, `.env.prod`, or `.env.prd` secret/value file edits.
67+
- No committed real `.env.*` copy-source files.
5768
- No API implementation changes.
5869
- No storage implementation changes.
5970
- No database migration or DDL changes.
71+
- No feature flag implementation changes.
6072

6173
## Validation
6274

6375
Run exactly:
6476

6577
```powershell
66-
git status
6778
git diff --check
6879
```
6980

81+
Playwright is not required unless runtime files change.
82+
7083
## Artifact
7184

7285
Create repo-structured delta ZIP:
7386

7487
```text
75-
tmp/PR_26177_OWNER_050-environment-governance-model_delta.zip
88+
tmp/PR_26177_OWNER_051-environment-configuration-standards_delta.zip
7689
```

docs_build/dev/PROJECT_INSTRUCTIONS.md

Lines changed: 40 additions & 3 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
@@ -519,11 +520,37 @@ Required Cloudflare R2 top-level prefixes:
519520

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

522-
The following files are copy-source files only:
523+
Only `.env.example` is committed to the repository.
524+
525+
Real `.env` files are user/environment-owned and must live outside the repo clone or be injected by deployment.
526+
527+
Official external environment file names when a copy-source file is used outside the repo clone:
528+
- `.env.local`
523529
- `.env.dev`
524530
- `.env.ist`
525531
- `.env.uat`
526-
- `.env.prd` is the legacy copy-source filename for PROD values; new environment governance uses the `PROD` environment name.
532+
- `.env.prod`
533+
534+
Example external layout:
535+
- `/env/local/.env`
536+
- `/env/dev/.env`
537+
- `/env/ist/.env`
538+
- `/env/uat/.env`
539+
- `/env/prod/.env`
540+
- `/GFS/` repo clone
541+
542+
The app/runtime reads `.env` values supplied by the target environment. It must not require real `.env` files to be committed inside the repo clone.
543+
544+
`.env.prd` is legacy technical debt only. New environment governance uses `.env.prod` for external PROD copy-source naming and the `PROD` environment name.
545+
546+
Allowed `GAMEFOUNDRY_ENVIRONMENT` values:
547+
- `local`
548+
- `dev`
549+
- `ist`
550+
- `uat`
551+
- `prod`
552+
553+
`GAMEFOUNDRY_ENVIRONMENT_LABEL` is display-only and must not drive runtime behavior, API/service selection, database selection, storage selection, or feature behavior.
527554

528555
Valid environment stages are:
529556
- `Local (VS Code)`
@@ -552,6 +579,16 @@ Do not introduce runtime parameters such as:
552579

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

582+
Host/domain configuration:
583+
- Local (VS Code) uses `127.0.0.1` hostnames.
584+
- DEV, IST, UAT, and PROD use configured `*.gamefoundrystudio.com` hostnames.
585+
- Host/domain differences are configuration values only and must not create separate deployable artifacts or environment-specific code.
586+
587+
Feature flag governance:
588+
- Feature flags must not create permanent environment-specific behavior.
589+
- Feature flags may be used only for staged rollout, testing, or emergency mitigation.
590+
- Feature flags must be removed, promoted to normal behavior, or documented as active temporary controls when the rollout, test, or mitigation ends.
591+
555592
## RUNTIME SCRIPT NAMING GOVERNANCE
556593

557594
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: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
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+
Only `.env.example` is committed to the repository.
29+
30+
Real `.env` files are user/environment-owned and must live outside the repo clone or be injected by deployment.
31+
32+
Official external environment copy-source file names when a copy-source file is used outside the repo clone:
33+
34+
- `.env.local`
35+
- `.env.dev`
36+
- `.env.ist`
37+
- `.env.uat`
38+
- `.env.prod`
39+
40+
Example external layout:
41+
42+
- `/env/local/.env`
43+
- `/env/dev/.env`
44+
- `/env/ist/.env`
45+
- `/env/uat/.env`
46+
- `/env/prod/.env`
47+
- `/GFS/` repo clone
48+
49+
The app/runtime reads `.env` values supplied by the target environment.
50+
51+
Runtime startup still reads `.env` values only. The official flow is for each environment to supply those values from outside the repo clone or through deployment injection before validation/startup.
52+
53+
`.env.prd` is legacy technical debt only. Do not introduce new references to `.env.prd` except when documenting migration or historical compatibility.
54+
55+
## Environment Identity
56+
57+
Allowed `GAMEFOUNDRY_ENVIRONMENT` values:
58+
59+
- `local`
60+
- `dev`
61+
- `ist`
62+
- `uat`
63+
- `prod`
64+
65+
`GAMEFOUNDRY_ENVIRONMENT` identifies the active configuration lane. It must not cause application, runtime, API/service, database, storage, or feature behavior forks.
66+
67+
`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.
68+
69+
## Host And Domain Configuration
70+
71+
Local (VS Code) uses `127.0.0.1` hostnames.
72+
73+
DEV, IST, UAT, and PROD use configured `*.gamefoundrystudio.com` hostnames.
74+
75+
Host/domain differences are configuration values only. They must not create separate deployable artifacts or environment-specific code.
76+
77+
## R2 Prefix Configuration
78+
79+
Required Cloudflare R2 top-level prefixes:
80+
81+
- Local (VS Code): `/local/`
82+
- DEV: `/dev/`
83+
- IST: `/ist/`
84+
- UAT: `/uat/`
85+
- PROD: `/prod/`
86+
87+
R2 project, backup, export, import, or future storage paths must stay under the matching environment prefix.
88+
89+
## API/Service Contract Configuration
90+
91+
One shared API/service contract is required across Local (VS Code), DEV, IST, UAT, and PROD.
92+
93+
Rules:
94+
95+
- API URLs may differ by `.env` only.
96+
- Do not split Local API and Public API contracts.
97+
- Do not create environment-specific API/service contracts.
98+
- Browser/UI/runtime code must use the same API/service contract shape in every environment.
99+
100+
## Feature Flag Governance
101+
102+
Feature flags must not create permanent environment-specific behavior.
103+
104+
Allowed feature flag uses:
105+
106+
- staged rollout
107+
- testing
108+
- emergency mitigation
109+
110+
Feature flags must be removed, promoted to normal behavior, or documented as active temporary controls when the rollout, test, or mitigation ends.
111+
112+
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)