|
| 1 | +# PR_26167_193-env-runtime-single-file-and-generic-db-url-redo |
| 2 | + |
| 3 | +## Branch Validation |
| 4 | +- PASS - Current branch is `main`. |
| 5 | +- PASS - `docs_build/dev/PROJECT_INSTRUCTIONS.md` was read before redo work. |
| 6 | + |
| 7 | +## Actual Changed Runtime/Config Files |
| 8 | +- PASS - `.gitignore` updated so runtime env files are ignored with `.env` and `.env.*`, while `.env.example`, `.env.sample`, and `.env.template` remain trackable. |
| 9 | +- PASS - `.env` removed from git tracking; local ignored file remains user-managed. |
| 10 | +- PASS - `.env.uat` removed from git tracking; local ignored file remains user-managed. |
| 11 | +- PASS - `scripts/validate-browser-env-agnostic.mjs` expanded from browser/page validation to active app/server/runtime/DB/example environment-branching validation. |
| 12 | +- PASS - Runtime/config files already correct in active source and revalidated: `scripts/start-local-api-server.mjs`, `scripts/validate-supabase-dev.mjs`, `scripts/apply-supabase-dev-ddl.mjs`, `src/dev-runtime/auth/provider-contract-stubs.mjs`, `tests/dev-runtime/SupabaseProviderContractStub.test.mjs`, and `tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs`. |
| 13 | + |
| 14 | +## Requirement Checklist |
| 15 | +- PASS - Runtime loads only `.env`. |
| 16 | +- PASS - Runtime does not auto-load `.env.local`, `.env.uat`, or `.env.prod`. |
| 17 | +- PASS - Tests/validation may explicitly load `.env.local`; `npm run validate:supabase-dev` did so. |
| 18 | +- PASS - `.gitignore` ignores `.env` and `.env.*`. |
| 19 | +- PASS - `.env.example` remains trackable. |
| 20 | +- PASS - `GAMEFOUNDRY_AUTH_PROVIDER` and `GAMEFOUNDRY_DB_PROVIDER` are absent from active runtime startup use. |
| 21 | +- PASS - `GAMEFOUNDRY_SUPABASE_DATABASE_URL` is absent from active non-report paths. |
| 22 | +- PASS - `GAMEFOUNDRY_DATABASE_URL` is used by active runtime/validation/DDL/provider/test paths. |
| 23 | +- PASS - Ignored `.env.local` was normalized to the four required keys without printing values. |
| 24 | +- PASS - Ignored `.env.uat` was normalized to the same key structure without printing values. |
| 25 | +- PASS - No DEV/UAT/PROD deployment-label branching found across active app/server/API/service/DB runtime paths outside tests and validation exceptions. |
| 26 | +- PASS - No local-db/mock-db/SQLite fallback was added by this redo. |
| 27 | +- PASS - No silent fallback was introduced. |
| 28 | + |
| 29 | +## Env Loading Evidence |
| 30 | +- PASS - `scripts/start-local-api-server.mjs` defines `RUNTIME_ENV_FILE = ".env"`. |
| 31 | +- PASS - `rg` found no `.env.local`, `.env.uat`, `.env.prod`, provider env vars, or provider-selection wording in runtime startup. |
| 32 | +- PASS - Runtime validation temporarily copied `.env.local` to ignored `.env`, ran `npm run dev:local-api`, then restored the original local `.env`. |
| 33 | +- PASS - Runtime startup output included `.env loaded for API runtime (4 key(s) applied).` |
| 34 | +- PASS - Runtime startup output included `Configured auth connection: configured.` |
| 35 | +- PASS - Runtime startup output included `Configured database connection: configured.` |
| 36 | + |
| 37 | +## Rename Evidence |
| 38 | +- PASS - Active non-report scan found no `GAMEFOUNDRY_SUPABASE_DATABASE_URL`. |
| 39 | +- PASS - `.env.example`, runtime startup, Supabase DEV validation, DDL apply, provider contract stubs, and targeted tests use `GAMEFOUNDRY_DATABASE_URL`. |
| 40 | +- PASS - Local ignored `.env.local` and `.env.uat` contain `GAMEFOUNDRY_DATABASE_URL`; values were not printed. |
| 41 | + |
| 42 | +## Provider Var Removal Evidence |
| 43 | +- PASS - `scripts/start-local-api-server.mjs` contains no `GAMEFOUNDRY_AUTH_PROVIDER` or `GAMEFOUNDRY_DB_PROVIDER`. |
| 44 | +- PASS - `.env.example` contains no `GAMEFOUNDRY_AUTH_PROVIDER` or `GAMEFOUNDRY_DB_PROVIDER`. |
| 45 | +- PASS - Runtime startup reports Auth connection and Database connection readiness, not provider selection. |
| 46 | + |
| 47 | +## .env.local/.env.uat Creation Evidence |
| 48 | +- PASS - `.env.local`: required key structure present; forbidden provider/old database keys absent; values not printed. |
| 49 | +- PASS - `.env.uat`: required key structure present; forbidden provider/old database keys absent; values not printed. |
| 50 | +- PASS - Both files are ignored by `.gitignore` and excluded from the ZIP. |
| 51 | + |
| 52 | +## No Environment-Branching Evidence |
| 53 | +- PASS - `npm run validate:browser-env-agnostic` wrote `docs_build/dev/reports/environment_agnostic_browser_gate_report.md`. |
| 54 | +- PASS - The expanded gate scanned active roots: `account`, `admin`, `assets/theme-v2/js`, `toolbox`, `src/engine`, `src`, `scripts`, and `docs_build/database`. |
| 55 | +- PASS - The expanded gate scanned runtime example/config files: `.env.example` and `package.json`. |
| 56 | +- PASS - Files scanned: 798. |
| 57 | +- PASS - Deployment-label branching findings: None. |
| 58 | +- PASS - Account page dependency findings: None. |
| 59 | +- PASS - Product service contract findings: None. |
| 60 | +- PASS - User-facing implementation wording findings: None. |
| 61 | +- PASS - Deprecated SQLite/Local DB technical debt findings: None. |
| 62 | + |
| 63 | +## Validation Lane Report |
| 64 | +- PASS - `node --check scripts/validate-browser-env-agnostic.mjs` |
| 65 | +- PASS - `node --check scripts/start-local-api-server.mjs` |
| 66 | +- PASS - `node --check scripts/validate-supabase-dev.mjs` |
| 67 | +- PASS - `node --check scripts/apply-supabase-dev-ddl.mjs` |
| 68 | +- PASS - `node --check src/dev-runtime/auth/provider-contract-stubs.mjs` |
| 69 | +- PASS - `node --check tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs` |
| 70 | +- PASS - `node --check tests/dev-runtime/SupabaseProviderContractStub.test.mjs` |
| 71 | +- PASS - `npm run validate:supabase-dev` |
| 72 | + - PASS - Explicit `.env.local` DEV validation load. |
| 73 | + - PASS - Auth connection URL, anon key, service role key, and database connection URL configured with masked diagnostics. |
| 74 | + - PASS - Supabase Auth/REST identity tables reachable. |
| 75 | + - WARN - Direct PostgreSQL TLS reported `SELF_SIGNED_CERT_IN_CHAIN`; validator marked this advisory because REST/API identity readiness passed. |
| 76 | +- PASS - `npm run dev:local-api` runtime check on alternate port after temporary `.env.local` to `.env` copy. |
| 77 | +- PASS - `npx playwright test tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs --grep "Game Workspace creates|active-game API" --workers=1 --reporter=list` (2 passed). |
| 78 | +- PASS - `npm run validate:browser-env-agnostic` |
| 79 | +- SKIP - Full samples smoke, per instruction. |
| 80 | + |
| 81 | +## Manual Validation Notes |
| 82 | +- `.env.local` and `.env.uat` were updated locally as ignored copy-source files; no secret values were printed, reported, or packaged. |
| 83 | +- Runtime validation used `.env` as the only startup-loaded env file and restored the original ignored `.env` immediately after the check. |
| 84 | +- Targeted Game Workspace validation covered game create/open/delete and active-game API diagnostics without throwing. |
| 85 | +- Redo ZIP excludes `.env`, `.env.local`, `.env.uat`, `tmp/` contents, `.log`, and `.pid` files. |
0 commit comments