|
| 1 | +# PR_26167_196-local-postgres-runtime-unblock |
| 2 | + |
| 3 | +Status: BLOCKED |
| 4 | + |
| 5 | +## Branch Validation |
| 6 | +- PASS - Current branch is `main`. |
| 7 | +- PASS - `docs_build/dev/PROJECT_INSTRUCTIONS.md` was read before implementation. |
| 8 | + |
| 9 | +## Summary |
| 10 | +- Added `npm run dev:local-postgres` to start a Docker-backed local Postgres container for `postgresql://postgres:postgres@127.0.0.1:5432/gamefoundry_dev`. |
| 11 | +- Added `npm run validate:local-postgres-runtime` to load only `.env`, apply grouped DDL, seed server-side identity rows, save/read platform banner through the API, assert no Supabase product-data REST call, and exercise Game Workspace create/getActiveGame. |
| 12 | +- Extended the direct Postgres client with a raw query method for setup/validation SQL. |
| 13 | +- Kept platform settings out of tool snapshot persistence so Game Workspace saves do not overwrite banner-owned rows. |
| 14 | + |
| 15 | +## Requirement Checklist |
| 16 | +- PASS - Main branch only: confirmed `main`. |
| 17 | +- PASS - Project instructions read first. |
| 18 | +- PASS - Continued PR_26167_195 direct database URL product-data path. |
| 19 | +- PASS - Added smallest local Postgres setup/run path: `npm run dev:local-postgres`. |
| 20 | +- PASS - Did not reintroduce SQLite, mock-db, local-db, provider switching, or Supabase REST product-data writes. |
| 21 | +- PASS - Supabase URL/keys remain auth-only for runtime Auth checks; product-data adapter uses `GAMEFOUNDRY_DATABASE_URL`. |
| 22 | +- PASS - `platform_settings` banner API path remains owned by the configured database adapter. |
| 23 | +- PASS - Game Workspace active-game browser logic already avoids `undefined.some`; server still rejects malformed `getActiveGame` payloads visibly. |
| 24 | +- PASS - Runtime startup still loads only `.env`. |
| 25 | +- PASS - No environment branching gate passed for active code. |
| 26 | +- BLOCKED - Live local Postgres connection validation could not complete because nothing accepted connections at `127.0.0.1:5432`. |
| 27 | +- BLOCKED - Live local banner save/read and Game Workspace create validation did not run because the database connection failed first. |
| 28 | + |
| 29 | +## Local Postgres Evidence |
| 30 | +- Added helper: `npm run dev:local-postgres`. |
| 31 | +- Helper uses Docker container `gamefoundry-local-postgres`, image `postgres:16`, database `gamefoundry_dev`, and host port `127.0.0.1:5432`. |
| 32 | +- Docker Desktop launch was requested, but Docker CLI readiness calls hung and timed out. |
| 33 | +- `Test-NetConnection 127.0.0.1 -Port 5432`: `TcpTestSucceeded=False`. |
| 34 | +- `npm run validate:local-postgres-runtime`: BLOCKED with `connect ECONNREFUSED 127.0.0.1:5432`. |
| 35 | + |
| 36 | +## Banner Evidence |
| 37 | +- Static/unit evidence: `tests/dev-runtime/ProductDataDatabaseUrl.test.mjs` passed and proves `platform_settings` reads/writes call the configured Postgres client, not Supabase REST. |
| 38 | +- Runtime guard added: `scripts/validate-local-postgres-runtime.mjs` asserts `Supabase platform_settings REST calls=0` after a banner save/read. |
| 39 | +- BLOCKED - The live banner save/read path did not reach execution because local Postgres was unavailable. |
| 40 | + |
| 41 | +## Supabase Not Updated Evidence |
| 42 | +- PASS - Product-data adapter no longer uses Supabase REST table writes. |
| 43 | +- PASS - Local runtime validation script routes Supabase to an Auth-health-only fake endpoint and fails if `/rest/v1/platform_settings` is called. |
| 44 | +- BLOCKED - Live zero-call assertion was not reached because local Postgres refused the connection before API validation began. |
| 45 | + |
| 46 | +## Game Workspace Evidence |
| 47 | +- PASS - `toolbox/game-workspace/game-workspace.js` uses `activeGameMembers(activeGame)` before `.some()`, so missing/malformed active game data does not throw `undefined.some`. |
| 48 | +- PASS - Server repository method validation still rejects malformed `getActiveGame` responses with a visible error. |
| 49 | +- PASS - Tool snapshot persistence now excludes global/platform tables including `platform_settings`. |
| 50 | +- BLOCKED - Live Game Workspace create/getActiveGame validation did not run because local Postgres was unavailable. |
| 51 | + |
| 52 | +## Validation Lane Report |
| 53 | +- PASS - `node --check scripts/start-local-postgres.mjs`. |
| 54 | +- PASS - `node --check scripts/validate-local-postgres-runtime.mjs`. |
| 55 | +- PASS - `node --check src/dev-runtime/persistence/postgres-connection-client.mjs`. |
| 56 | +- PASS - `node --check src/dev-runtime/server/local-api-router.mjs`. |
| 57 | +- PASS - `node --test tests/dev-runtime/ProductDataDatabaseUrl.test.mjs`. |
| 58 | +- PASS - `npm run validate:browser-env-agnostic`. |
| 59 | +- PASS - `git diff --check`. |
| 60 | +- BLOCKED - `npm run dev:local-postgres` did not complete because Docker CLI readiness calls timed out. |
| 61 | +- BLOCKED - `npm run validate:local-postgres-runtime` failed with `ECONNREFUSED 127.0.0.1:5432`. |
| 62 | +- SKIP - Full samples smoke intentionally not run; not in scope. |
| 63 | + |
| 64 | +## Manual Validation Notes |
| 65 | +- To unblock live validation, start Docker Desktop until `docker info` returns promptly, then run `npm run dev:local-postgres`. |
| 66 | +- With Postgres listening, run `npm run validate:local-postgres-runtime`. |
| 67 | +- The validation script restores banner rows and deletes its `PR196 Runtime Game <pid>` row after execution. |
| 68 | +- No secrets were printed in this report. |
0 commit comments