Skip to content

Commit 47246ec

Browse files
committed
Remove SQLite runtime and enforce single Supabase Postgres service path - PR_26167_180-183-single-service-contract-stack
1 parent a5bea8c commit 47246ec

50 files changed

Lines changed: 114713 additions & 26110 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# Game Foundry Studio local development environment
22

3-
# Supabase Auth and Supabase Postgres are the default DEV auth/product data providers.
4-
# Missing Supabase configuration reports provider diagnostics instead of falling back.
5-
GAMEFOUNDRY_AUTH_PROVIDER=supabase-auth
6-
GAMEFOUNDRY_DB_PROVIDER=supabase-postgres
3+
# Supabase Auth and Supabase Postgres are the DEV auth/product data path.
4+
# Missing Supabase configuration reports diagnostics instead of falling back.
75

86
# Supabase DEV browser-safe configuration.
97
# Leave values empty in this example; local values belong in .env.local.

docs_build/dev/codex_commands.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,3 +1929,146 @@ Required reports:
19291929

19301930
Packaging:
19311931
- `tmp/PR_26167_180-account-pages-remove-local-db-browser-contract_delta.zip`
1932+
1933+
1934+
## PR_26167_180-remove-sqlite-runtime-provider
1935+
1936+
Changes:
1937+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
1938+
- Verified the current branch is `main`.
1939+
- Removed Local DB from the supported runtime product-data provider selection.
1940+
- Forced local API startup product data to `supabase-postgres`, ignoring stale `local-db` product-data configuration.
1941+
- Removed Local DB fallback branches from server product-data assertions, persistence, Toolbox registry snapshots, and DB snapshot routing.
1942+
- Lazy-loaded SQLite behind legacy local adapter endpoints so startup no longer imports or opens SQLite.
1943+
- Updated targeted provider contract validation for the unsupported Local DB product-data path.
1944+
1945+
Validation:
1946+
- `node --check scripts/start-local-api-server.mjs`
1947+
- `node --check src/dev-runtime/auth/provider-contract-stubs.mjs`
1948+
- `node --check src/dev-runtime/server/local-api-router.mjs`
1949+
- `node --check tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
1950+
- `node --test tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
1951+
- Bare `node .\scripts\validate-supabase-dev.mjs` reached validation but failed local TLS trust before app-level checks.
1952+
- `$env:NODE_OPTIONS='--use-system-ca'; node .\scripts\validate-supabase-dev.mjs`
1953+
- `npm run dev:local-api` startup capture on temporary port `5580`.
1954+
- Static sanity scan for removed Local DB product-data branch patterns.
1955+
- `git diff --check`
1956+
- Full samples smoke skipped because samples were not in scope.
1957+
1958+
Required reports:
1959+
- `docs_build/dev/reports/PR_26167_180-remove-sqlite-runtime-provider.md`
1960+
- `docs_build/dev/reports/codex_changed_files.txt`
1961+
- `docs_build/dev/reports/codex_review.diff`
1962+
1963+
Packaging:
1964+
- `tmp/PR_26167_180-remove-sqlite-runtime-provider_delta.zip`
1965+
1966+
1967+
## PR_26167_181-supabase-postgres-single-product-data-path
1968+
1969+
Changes:
1970+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
1971+
- Verified the current branch is `main`.
1972+
- Removed active Local DB fallback branches from Toolbox vote snapshot/write/order/metadata APIs.
1973+
- Kept product-data registry, DB snapshot, Toolbox vote, and repository API paths on Supabase Postgres through server-side contracts.
1974+
- Added targeted regression coverage that Local DB-selected Toolbox vote routes fail visibly.
1975+
- Updated the Project Workspace Playwright harness to use fake configured Supabase/Postgres instead of forcing `local-db`.
1976+
1977+
Validation:
1978+
- `node --check scripts\start-local-api-server.mjs`
1979+
- `node --check src\dev-runtime\auth\provider-contract-stubs.mjs`
1980+
- `node --check src\dev-runtime\server\local-api-router.mjs`
1981+
- `node --check tests\dev-runtime\SupabaseProductDataCutover.test.mjs`
1982+
- `node --check tests\playwright\tools\RootToolsFutureState.spec.mjs`
1983+
- `node --test tests\dev-runtime\SupabaseProductDataCutover.test.mjs`
1984+
- `node --test tests\dev-runtime\ProductDataProviderContractHardening.test.mjs`
1985+
- `node --test tests\dev-runtime\SupabaseProviderContractStub.test.mjs`
1986+
- Bare `node .\scripts\validate-supabase-dev.mjs` reached validation but failed local TLS trust before app-level checks.
1987+
- `$env:NODE_OPTIONS='--use-system-ca'; node .\scripts\validate-supabase-dev.mjs`
1988+
- `npm run test:workspace-v2` initially failed due a local-db Playwright harness; after harness update, rerun passed. Command name is legacy and user-facing language is Project Workspace.
1989+
- Static scan for removed Toolbox vote Local DB fallback patterns.
1990+
- Full samples smoke skipped because samples were not in scope.
1991+
1992+
Required reports:
1993+
- `docs_build/dev/reports/PR_26167_181-supabase-postgres-single-product-data-path.md`
1994+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
1995+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
1996+
- `docs_build/dev/reports/codex_changed_files.txt`
1997+
- `docs_build/dev/reports/codex_review.diff`
1998+
1999+
Packaging:
2000+
- `tmp/PR_26167_181-supabase-postgres-single-product-data-path_delta.zip`
2001+
2002+
2003+
## PR_26167_182-remove-provider-selection-runtime
2004+
2005+
Changes:
2006+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
2007+
- Verified the current branch is `main`.
2008+
- Removed runtime provider selector controls from the provider contract snapshot.
2009+
- Fixed the runtime path to Supabase Auth plus Supabase Postgres.
2010+
- Ignored legacy `GAMEFOUNDRY_AUTH_PROVIDER` and `GAMEFOUNDRY_DB_PROVIDER` values with safe diagnostics.
2011+
- Removed Local DB/auth mode switching branches from local API session and provider runtime paths.
2012+
- Preserved Admin DB Viewer source labels as diagnostic-only metadata.
2013+
2014+
Validation:
2015+
- `node --check src\dev-runtime\auth\provider-contract-stubs.mjs`
2016+
- `node --check src\dev-runtime\server\local-api-router.mjs`
2017+
- `node --check scripts\start-local-api-server.mjs`
2018+
- `node --check tests\dev-runtime\SupabaseProviderContractStub.test.mjs`
2019+
- `node --check tests\dev-runtime\SupabaseProductDataCutover.test.mjs`
2020+
- `node --check tests\playwright\tools\RootToolsFutureState.spec.mjs`
2021+
- `node --test tests\dev-runtime\SupabaseProviderContractStub.test.mjs`
2022+
- `node --test tests\dev-runtime\SupabaseProductDataCutover.test.mjs`
2023+
- `node --test tests\dev-runtime\ProductDataProviderContractHardening.test.mjs`
2024+
- Bare `node .\scripts\validate-supabase-dev.mjs` reached validation but failed local TLS trust before app-level checks.
2025+
- `$env:NODE_OPTIONS='--use-system-ca'; node .\scripts\validate-supabase-dev.mjs`
2026+
- `npm run test:workspace-v2` passed. Command name is legacy and user-facing language is Project Workspace.
2027+
- Full samples smoke skipped because samples were not in scope.
2028+
2029+
Required reports:
2030+
- `docs_build/dev/reports/PR_26167_182-remove-provider-selection-runtime.md`
2031+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
2032+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
2033+
- `docs_build/dev/reports/codex_changed_files.txt`
2034+
- `docs_build/dev/reports/codex_review.diff`
2035+
2036+
Packaging:
2037+
- `tmp/PR_26167_182-remove-provider-selection-runtime_delta.zip`
2038+
2039+
2040+
## PR_26167_183-single-service-contract-validation
2041+
2042+
Changes:
2043+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
2044+
- Verified the current branch is `main`.
2045+
- Extended `scripts/validate-browser-env-agnostic.mjs` to validate Account auth page service contracts, product API/service contracts, product-data fallback prevention, user-facing implementation wording, and deprecated Local DB/SQLite technical debt.
2046+
- Reworded AI Assistant wireframe provider copy to provider-neutral AI connection copy.
2047+
- Reworded an Assets upload diagnostic to avoid Local DB wording in product UI.
2048+
2049+
Validation:
2050+
- `node --check scripts\validate-browser-env-agnostic.mjs`
2051+
- `node --check toolbox\assets\assets.js`
2052+
- `node --check assets\theme-v2\js\account-auth-service.js`
2053+
- `node --check assets\theme-v2\js\account-auth-actions.js`
2054+
- `node --check assets\theme-v2\js\login-session.js`
2055+
- `npm run validate:browser-env-agnostic`
2056+
- `node --test tests\dev-runtime\ProductDataProviderContractHardening.test.mjs`
2057+
- `node --test tests\dev-runtime\SupabaseProductDataCutover.test.mjs`
2058+
- `node --test tests\dev-runtime\SupabaseProviderContractStub.test.mjs`
2059+
- Bare `node .\scripts\validate-supabase-dev.mjs` reached validation but failed local TLS trust before app-level checks.
2060+
- `npm run validate:supabase-dev`
2061+
- `npx playwright test tests/playwright/tools/StaticOnlyLoginApiRequired.spec.mjs tests/playwright/account/SupabaseSignInSession.spec.mjs`
2062+
- `npm run test:workspace-v2` passed. Command name is legacy and user-facing language is Project Workspace.
2063+
- Full samples smoke skipped because samples were not in scope.
2064+
2065+
Required reports:
2066+
- `docs_build/dev/reports/PR_26167_183-single-service-contract-validation.md`
2067+
- `docs_build/dev/reports/environment_agnostic_browser_gate_report.md`
2068+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
2069+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
2070+
- `docs_build/dev/reports/codex_changed_files.txt`
2071+
- `docs_build/dev/reports/codex_review.diff`
2072+
2073+
Packaging:
2074+
- `tmp/PR_26167_183-single-service-contract-validation_delta.zip`

docs_build/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Remove Account Local DB browser contract - PR_26167_180-account-pages-remove-local-db-browser-contract
1+
Validate single service contract paths - PR_26167_183-single-service-contract-validation
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# PR_26167_180-remove-sqlite-runtime-provider
2+
3+
## Summary
4+
- Removed Local DB/SQLite from the supported product-data provider selection list.
5+
- Forced `npm run dev:local-api` startup to use `supabase-postgres` for product data, even when an old `GAMEFOUNDRY_DB_PROVIDER=local-db` value is present.
6+
- Removed Local DB product-data branches from server product-data assertions, persistence, Toolbox registry snapshots, and DB snapshot routing.
7+
- Lazy-loaded the SQLite adapter only when legacy local adapter endpoints are invoked, so startup no longer imports or opens SQLite.
8+
9+
## Branch Validation
10+
- PASS - Current branch was `main`.
11+
12+
## Requirement Checklist
13+
- PASS - Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before PR work.
14+
- PASS - Hard-stopped branch check passed on `main`.
15+
- PASS - Removed SQLite/local-db from active product-data provider selection; `SUPPORTED_DATABASE_PROVIDERS` now contains only `supabase-postgres`.
16+
- PASS - Removed active product-data fallback paths that previously allowed Local DB to satisfy product-data reads/writes.
17+
- PASS - `npm run dev:local-api` startup now reports `Local API product data provider: supabase-postgres` and explicitly ignores an old `local-db` product-data value.
18+
- PASS - SQLite is no longer imported or opened during server startup; the legacy adapter loads only if legacy local adapter endpoints are invoked.
19+
- PASS - Browser pages were not changed to branch by DEV/UAT/PROD.
20+
- PASS - No silent fallback to SQLite/local-db remains for product-data routes.
21+
- PASS - Historical Local DB route/adapter strings remain as deprecated technical debt for legacy admin/testing endpoints only; they no longer participate in active product-data provider selection.
22+
- PASS - No secrets or `.env.local` files were changed or committed.
23+
24+
## Validation Lane Report
25+
- PASS - `node --check scripts/start-local-api-server.mjs`
26+
- PASS - `node --check src/dev-runtime/auth/provider-contract-stubs.mjs`
27+
- PASS - `node --check src/dev-runtime/server/local-api-router.mjs`
28+
- PASS - `node --check tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
29+
- PASS - Targeted provider/runtime test: `node --test tests/dev-runtime/SupabaseProviderContractStub.test.mjs` (32 passed).
30+
- INFO - Initial bare `node .\scripts\validate-supabase-dev.mjs` reached Supabase validation but failed local TLS trust before app-level checks (`UNABLE_TO_VERIFY_LEAF_SIGNATURE` / `SELF_SIGNED_CERT_IN_CHAIN`).
31+
- PASS - Required Supabase DEV validation using Windows system CA trust: `$env:NODE_OPTIONS='--use-system-ca'; node .\scripts\validate-supabase-dev.mjs` (overall PASS; direct PostgreSQL TLS remained WARN while REST/API identity readiness passed).
32+
- PASS - `npm run dev:local-api` started on temporary port `5580` long enough to confirm startup selected `supabase-postgres`, ignored `local-db`, and emitted no SQLite startup warning.
33+
- PASS - Static sanity scan confirmed removed Local DB product-data branch patterns no longer appear in the touched runtime/provider contract paths.
34+
- PASS - `git diff --check`
35+
- SKIPPED - Full samples smoke per request and because samples are not in scope.
36+
37+
## Manual Validation Notes
38+
- Startup output included:
39+
- `Local API auth provider: supabase-auth.`
40+
- `Local API product data provider: supabase-postgres.`
41+
- `Local API ignored unsupported product data provider local-db; Supabase Postgres is required.`
42+
- Startup stderr was empty after lazy-loading SQLite, confirming the server no longer imports SQLite during startup.
43+
- Provider contract diagnostics now mark `GAMEFOUNDRY_DB_PROVIDER=local-db` as unsupported for product data rather than activating a Local DB product-data path.
44+
- `/api/local-db/snapshot` remains a historical route name, but product-data snapshot routing now requires Supabase Postgres and fails visibly for unsupported database selections.
45+
46+
## Test Data Cleanup
47+
- N/A - This PR did not create persistent validation records.
48+
49+
## Remaining Follow-Up Blockers
50+
- None for this PR scope.
51+
- Deprecated Local DB route names and legacy local adapter code remain for admin/testing compatibility and should be removed or quarantined by later cleanup PRs when those surfaces have replacement contracts.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# PR_26167_181-supabase-postgres-single-product-data-path
2+
3+
## Summary
4+
- Removed active Local DB product-data fallback branches from Toolbox vote snapshot, vote write, vote ordering, metadata update, metadata reorder, registry snapshot, and DB snapshot server API paths.
5+
- Routed the touched product-data API paths through the existing server API/service contract to Supabase Postgres only.
6+
- Updated the Project Workspace Playwright harness to use a fake configured Supabase/Postgres service instead of forcing `local-db`, keeping validation hermetic and avoiding real Supabase writes.
7+
- Added targeted regression coverage proving Local DB-selected Toolbox vote routes now fail visibly instead of serving local product data.
8+
9+
## Branch Validation
10+
- PASS - Current branch was `main`.
11+
12+
## Requirement Checklist
13+
- PASS - Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before PR work.
14+
- PASS - Hard-stopped branch check passed on `main`.
15+
- PASS - Product data for the touched Toolbox vote, registry, snapshot, and repository API paths now routes through the server API/service contract to Supabase Postgres only.
16+
- PASS - Configured connection values are used; no site behavior branching by DEV/UAT/PROD label was added.
17+
- PASS - Users, roles, and user_roles continue to resolve through the Supabase/Postgres-backed service path via `currentSessionForRoute()` and the Supabase provider contract tests.
18+
- PASS - Removed active Local DB product-data fallback branches from the touched product-data API paths; remaining Local DB helper code is legacy/admin/testing support and is not an active product-data provider path.
19+
- PASS - No browser-owned product data, page-local product arrays, hidden defaults, or silent fallback were introduced.
20+
- PASS - No secrets or `.env.local` files were changed or committed.
21+
22+
## Validation Lane Report
23+
- PASS - `node --check scripts\start-local-api-server.mjs`
24+
- PASS - `node --check src\dev-runtime\auth\provider-contract-stubs.mjs`
25+
- PASS - `node --check src\dev-runtime\server\local-api-router.mjs`
26+
- PASS - `node --check tests\dev-runtime\SupabaseProductDataCutover.test.mjs`
27+
- PASS - `node --check tests\playwright\tools\RootToolsFutureState.spec.mjs`
28+
- PASS - Targeted product-data/API test: `node --test tests\dev-runtime\SupabaseProductDataCutover.test.mjs` (4 passed).
29+
- PASS - Targeted provider/API contract test: `node --test tests\dev-runtime\ProductDataProviderContractHardening.test.mjs` (3 passed).
30+
- PASS - Targeted auth/session/provider test: `node --test tests\dev-runtime\SupabaseProviderContractStub.test.mjs` (32 passed).
31+
- INFO - Initial bare `node .\scripts\validate-supabase-dev.mjs` reached validation but failed local Node TLS trust before app-level checks (`UNABLE_TO_VERIFY_LEAF_SIGNATURE` / `SELF_SIGNED_CERT_IN_CHAIN`).
32+
- PASS - Required Supabase DEV validation using Windows system CA trust: `$env:NODE_OPTIONS='--use-system-ca'; node .\scripts\validate-supabase-dev.mjs` (overall PASS; direct PostgreSQL TLS remained WARN while REST/API identity readiness passed).
33+
- FAIL then PASS - `npm run test:workspace-v2` initially failed because the Project Workspace Playwright harness forced `GAMEFOUNDRY_DB_PROVIDER=local-db`; after changing the harness to fake configured Supabase/Postgres, the rerun passed (5 passed). The command name is legacy; user-facing language is Project Workspace.
34+
- PASS - Static scan found no remaining `return this.toolboxVoteSnapshot()` or `Persisting Toolbox` Local DB vote write fallback in `src/dev-runtime/server/local-api-router.mjs`.
35+
- PASS - Playwright V8 coverage report generated at `docs_build/dev/reports/playwright_v8_coverage_report.txt`; server-side changed runtime JS is reported as advisory WARN because browser V8 coverage cannot collect Node server modules.
36+
- PASS - `git diff --check`
37+
- SKIPPED - Full samples smoke per request and because samples are not in scope.
38+
39+
## Manual Validation Notes
40+
- `/api/toolbox/registry/snapshot` and Toolbox page rendering validated through the Project Workspace Playwright lane using the server API and fake Supabase/Postgres REST endpoints.
41+
- `/api/toolbox/votes/snapshot` with `GAMEFOUNDRY_DB_PROVIDER=local-db` now returns a visible failure requiring Supabase Postgres instead of serving Local DB product data.
42+
- Toolbox vote writes in targeted tests use server-owned keys and POST to Supabase-style `toolbox_votes`.
43+
- Toolbox repository creation/persistence in targeted tests writes through Supabase-style product tables.
44+
45+
## Test Data Cleanup
46+
- PASS - No persistent Supabase validation data was created.
47+
- INFO - The Project Workspace Playwright lane used an in-memory fake Supabase/Postgres service and closed it after the run.
48+
- INFO - Targeted product-data tests used in-memory fake Supabase/Postgres services and closed them after each test.
49+
50+
## Remaining Follow-Up Blockers
51+
- None for this PR scope.

0 commit comments

Comments
 (0)