Skip to content

Commit 6355e5a

Browse files
committed
Unblock local Postgres product data runtime validation - PR_26167_196-local-postgres-runtime-unblock
1 parent cdd329f commit 6355e5a

9 files changed

Lines changed: 1174 additions & 849 deletions
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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.
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
# git status --short
2-
AM docs_build/dev/reports/PR_26167_195-product-data-uses-database-url.md
3-
M docs_build/dev/reports/codex_changed_files.txt
4-
M docs_build/dev/reports/codex_review.diff
5-
M docs_build/dev/reports/environment_agnostic_browser_gate_report.md
6-
M src/dev-runtime/auth/provider-contract-stubs.mjs
7-
A src/dev-runtime/persistence/postgres-connection-client.mjs
8-
A tests/dev-runtime/ProductDataDatabaseUrl.test.mjs
1+
# PR_26167_196 scoped changed files
2+
M docs_build/dev/reports/environment_agnostic_browser_gate_report.md
3+
M package.json
4+
M src/dev-runtime/persistence/postgres-connection-client.mjs
5+
M src/dev-runtime/server/local-api-router.mjs
6+
A docs_build/dev/reports/PR_26167_196-local-postgres-runtime-unblock.md
7+
A scripts/start-local-postgres.mjs
8+
A scripts/validate-local-postgres-runtime.mjs
99

10-
# git diff HEAD --stat -- PR195 files
11-
.../PR_26167_195-product-data-uses-database-url.md | 53 ++
12-
.../environment_agnostic_browser_gate_report.md | 4 +-
13-
src/dev-runtime/auth/provider-contract-stubs.mjs | 77 ++-
14-
.../persistence/postgres-connection-client.mjs | 581 +++++++++++++++++++++
15-
tests/dev-runtime/ProductDataDatabaseUrl.test.mjs | 62 +++
16-
5 files changed, 731 insertions(+), 46 deletions(-)
10+
# Required reports generated
11+
M docs_build/dev/reports/codex_changed_files.txt
12+
M docs_build/dev/reports/codex_review.diff
13+
14+
# Artifact
15+
tmp/PR_26167_196-local-postgres-runtime-unblock_delta.zip
16+
17+
# Note
18+
ZIP remains ignored by git and is not staged.

0 commit comments

Comments
 (0)