Skip to content

Commit 54f245e

Browse files
committed
Add Supabase provider contract stubs without activating external auth - PR_26164_120-supabase-provider-contract-stub
1 parent 8561ad2 commit 54f245e

8 files changed

Lines changed: 1053 additions & 394 deletions
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
docs_build/dev/reports/pr119-supabase-environment-checklist.md
1+
src/dev-runtime/auth/provider-contract-stubs.mjs
2+
src/dev-runtime/server/local-api-router.mjs
3+
tests/dev-runtime/SupabaseProviderContractStub.test.mjs
4+
docs_build/dev/reports/pr120-supabase-provider-contract-stub.md
5+
docs_build/dev/reports/playwright_v8_coverage_report.txt
6+
docs_build/dev/reports/coverage_changed_js_guardrail.txt
27
docs_build/dev/reports/codex_changed_files.txt
38
docs_build/dev/reports/codex_review.diff

docs_build/dev/reports/codex_review.diff

Lines changed: 601 additions & 290 deletions
Large diffs are not rendered by default.

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,9 @@ Missing changed runtime JS files are WARN, not FAIL.
66
Source: Playwright/Chromium built-in V8 coverage from the active Playwright run.
77

88
Changed runtime JS files considered:
9-
(0%) admin/db-viewer.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
10-
(0%) assets/theme-v2/js/login-session.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
11-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
12-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
13-
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
14-
(0%) src/dev-runtime/seed/server-seed-loader.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
9+
(0%) src/dev-runtime/auth/provider-contract-stubs.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
1510
(0%) src/dev-runtime/server/local-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
16-
(0%) src/dev-runtime/server/local-api-server.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
17-
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
18-
(0%) src/engine/api/local-db-viewer-ui.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
19-
(0%) src/engine/api/mock-db-api-client.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
20-
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21-
(0%) toolbox/game-journey/game-journey.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
22-
(10%) assets/theme-v2/js/local-db-page-data.js - executed lines 299/299; executed functions 3/29
23-
(20%) src/engine/api/local-db-api-client.js - executed lines 19/19; executed functions 1/5
2411

2512
Guardrail warnings:
26-
(0%) admin/db-viewer.js - WARNING: changed runtime JS file missing from coverage; advisory only
27-
(0%) assets/theme-v2/js/login-session.js - WARNING: changed runtime JS file missing from coverage; advisory only
28-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: changed runtime JS file missing from coverage; advisory only
29-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file missing from coverage; advisory only
30-
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - WARNING: changed runtime JS file missing from coverage; advisory only
31-
(0%) src/dev-runtime/seed/server-seed-loader.mjs - WARNING: changed runtime JS file missing from coverage; advisory only
13+
(0%) src/dev-runtime/auth/provider-contract-stubs.mjs - WARNING: changed runtime JS file missing from coverage; advisory only
3214
(0%) src/dev-runtime/server/local-api-router.mjs - WARNING: changed runtime JS file missing from coverage; advisory only
33-
(0%) src/dev-runtime/server/local-api-server.mjs - WARNING: changed runtime JS file missing from coverage; advisory only
34-
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file missing from coverage; advisory only
35-
(0%) src/engine/api/local-db-viewer-ui.js - WARNING: changed runtime JS file missing from coverage; advisory only
36-
(0%) src/engine/api/mock-db-api-client.js - WARNING: changed runtime JS file missing from coverage; advisory only
37-
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: changed runtime JS file missing from coverage; advisory only
38-
(0%) toolbox/game-journey/game-journey.js - WARNING: changed runtime JS file missing from coverage; advisory only
39-
(10%) assets/theme-v2/js/local-db-page-data.js - WARNING: advisory low coverage below 50%; executed lines 299/299; executed functions 3/29
40-
(20%) src/engine/api/local-db-api-client.js - WARNING: advisory low coverage below 50%; executed lines 19/19; executed functions 1/5

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 8 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -12,89 +12,23 @@ Note: entry percentages use function coverage when available, otherwise line cov
1212
Note: coverage entries are aggregated across every page/tool where coverageReporter.start(page) and coverageReporter.stop(page) ran.
1313

1414
Exercised tool entry points detected:
15-
(71%) Toolbox Index - exercised 10 runtime JS files
15+
(0%) Toolbox Index - not exercised by this Playwright run
1616
(0%) Tool Template V2 - not exercised by this Playwright run
17-
(58%) Theme V2 Shared JS - exercised 3 runtime JS files
17+
(63%) Theme V2 Shared JS - exercised 2 runtime JS files
1818

1919
Changed runtime JS files covered:
20-
(0%) admin/db-viewer.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21-
(0%) assets/theme-v2/js/login-session.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
22-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
23-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
24-
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
25-
(0%) src/dev-runtime/seed/server-seed-loader.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
20+
(0%) src/dev-runtime/auth/provider-contract-stubs.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2621
(0%) src/dev-runtime/server/local-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
27-
(0%) src/dev-runtime/server/local-api-server.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
28-
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
29-
(0%) src/engine/api/local-db-viewer-ui.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
30-
(0%) src/engine/api/mock-db-api-client.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
31-
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
32-
(0%) toolbox/game-journey/game-journey.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
33-
(10%) assets/theme-v2/js/local-db-page-data.js - executed lines 299/299; executed functions 3/29
34-
(20%) src/engine/api/local-db-api-client.js - executed lines 19/19; executed functions 1/5
3522

3623
Files with executed line/function counts where available:
37-
(10%) assets/theme-v2/js/local-db-page-data.js - executed lines 299/299; executed functions 3/29
38-
(20%) src/engine/api/local-db-api-client.js - executed lines 19/19; executed functions 1/5
39-
(25%) src/engine/api/session-api-client.js - executed lines 68/68; executed functions 3/12
40-
(29%) src/engine/input/NormalizedInputRegistry.js - executed lines 341/341; executed functions 6/21
41-
(33%) src/engine/api/toolbox-votes-api-client.js - executed lines 46/46; executed functions 2/6
42-
(56%) toolbox/colors/colors.js - executed lines 1848/1848; executed functions 115/204
43-
(58%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 11/19
44-
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 9/14
45-
(66%) toolbox/controls/controls.js - executed lines 667/667; executed functions 41/62
46-
(68%) toolbox/game-workspace/game-workspace.js - executed lines 281/281; executed functions 19/28
47-
(76%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 722/722; executed functions 52/68
48-
(89%) toolbox/tool-registry-api-client.js - executed lines 152/152; executed functions 25/28
49-
(91%) toolbox/game-design/game-design.js - executed lines 254/254; executed functions 21/23
50-
(91%) toolbox/tools-page-accordions.js - executed lines 965/965; executed functions 103/113
51-
(100%) toolbox/colors/palette-api-client.js - executed lines 28/28; executed functions 4/4
52-
(100%) toolbox/controls/controls-api-client.js - executed lines 12/12; executed functions 2/2
53-
(100%) toolbox/game-design/game-design-api-client.js - executed lines 13/13; executed functions 2/2
54-
(100%) toolbox/game-workspace/game-workspace-api-client.js - executed lines 12/12; executed functions 2/2
24+
(59%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 722/722; executed functions 38/64
25+
(100%) assets/theme-v2/js/login-session.js - executed lines 45/45; executed functions 7/7
5526

5627
Uncovered or low-coverage changed JS files:
57-
(0%) admin/db-viewer.js - WARNING: uncovered changed runtime JS file; advisory only
58-
(0%) assets/theme-v2/js/login-session.js - WARNING: uncovered changed runtime JS file; advisory only
59-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: uncovered changed runtime JS file; advisory only
60-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: uncovered changed runtime JS file; advisory only
61-
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - WARNING: uncovered changed runtime JS file; advisory only
62-
(0%) src/dev-runtime/seed/server-seed-loader.mjs - WARNING: uncovered changed runtime JS file; advisory only
28+
(0%) src/dev-runtime/auth/provider-contract-stubs.mjs - WARNING: uncovered changed runtime JS file; advisory only
6329
(0%) src/dev-runtime/server/local-api-router.mjs - WARNING: uncovered changed runtime JS file; advisory only
64-
(0%) src/dev-runtime/server/local-api-server.mjs - WARNING: uncovered changed runtime JS file; advisory only
65-
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: uncovered changed runtime JS file; advisory only
66-
(0%) src/engine/api/local-db-viewer-ui.js - WARNING: uncovered changed runtime JS file; advisory only
67-
(0%) src/engine/api/mock-db-api-client.js - WARNING: uncovered changed runtime JS file; advisory only
68-
(0%) src/engine/api/mock-db-viewer-ui.js - WARNING: uncovered changed runtime JS file; advisory only
69-
(0%) toolbox/game-journey/game-journey.js - WARNING: uncovered changed runtime JS file; advisory only
70-
(10%) assets/theme-v2/js/local-db-page-data.js - WARNING: advisory low coverage; executed lines 299/299
71-
(20%) src/engine/api/local-db-api-client.js - WARNING: advisory low coverage; executed lines 19/19
7230

7331
Changed JS files considered:
74-
(0%) admin/db-viewer.js - changed JS file not collected as browser runtime coverage
75-
(0%) assets/theme-v2/js/login-session.js - changed JS file not collected as browser runtime coverage
76-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - changed JS file not collected as browser runtime coverage
77-
(0%) src/dev-runtime/persistence/mock-db-store.js - changed JS file not collected as browser runtime coverage
78-
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - changed JS file not collected as browser runtime coverage
79-
(0%) src/dev-runtime/seed/server-seed-loader.mjs - changed JS file not collected as browser runtime coverage
32+
(0%) src/dev-runtime/auth/provider-contract-stubs.mjs - changed JS file not collected as browser runtime coverage
8033
(0%) src/dev-runtime/server/local-api-router.mjs - changed JS file not collected as browser runtime coverage
81-
(0%) src/dev-runtime/server/local-api-server.mjs - changed JS file not collected as browser runtime coverage
82-
(0%) src/dev-runtime/server/mock-api-router.mjs - changed JS file not collected as browser runtime coverage
83-
(0%) src/engine/api/local-db-viewer-ui.js - changed JS file not collected as browser runtime coverage
84-
(0%) src/engine/api/mock-db-api-client.js - changed JS file not collected as browser runtime coverage
85-
(0%) src/engine/api/mock-db-viewer-ui.js - changed JS file not collected as browser runtime coverage
86-
(0%) tests/dev-runtime/DbSeedIntegrity.test.mjs - changed JS file not collected as browser runtime coverage
87-
(0%) tests/dev-runtime/DevRuntimeBoundary.test.mjs - changed JS file not collected as browser runtime coverage
88-
(0%) tests/helpers/playwrightRepoServer.mjs - changed JS file not collected as browser runtime coverage
89-
(0%) tests/playwright/tools/AdminDbViewer.spec.mjs - changed JS file not collected as browser runtime coverage
90-
(0%) tests/playwright/tools/GameConfigurationMockRepository.spec.mjs - changed JS file not collected as browser runtime coverage
91-
(0%) tests/playwright/tools/GameJourneyTool.spec.mjs - changed JS file not collected as browser runtime coverage
92-
(0%) tests/playwright/tools/InputMappingV2Tool.spec.mjs - changed JS file not collected as browser runtime coverage
93-
(0%) tests/playwright/tools/LoginSessionMode.spec.mjs - changed JS file not collected as browser runtime coverage
94-
(0%) tests/playwright/tools/ObjectsTool.spec.mjs - changed JS file not collected as browser runtime coverage
95-
(0%) tests/playwright/tools/StaticOnlyLoginApiRequired.spec.mjs - changed JS file not collected as browser runtime coverage
96-
(0%) tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs - changed JS file not collected as browser runtime coverage
97-
(0%) tests/playwright/tools/ToolboxRoutePages.spec.mjs - changed JS file not collected as browser runtime coverage
98-
(0%) toolbox/game-journey/game-journey.js - changed JS file not collected as browser runtime coverage
99-
(10%) assets/theme-v2/js/local-db-page-data.js - changed JS file with browser V8 coverage
100-
(20%) src/engine/api/local-db-api-client.js - changed JS file with browser V8 coverage
34+
(0%) tests/dev-runtime/SupabaseProviderContractStub.test.mjs - changed JS file not collected as browser runtime coverage
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# PR_26164_120 Supabase Provider Contract Stub
2+
3+
## Branch Validation
4+
5+
- PASS: Current branch is `main`.
6+
- Expected branch: `main`.
7+
- Worktree before changes: clean.
8+
9+
## Scope
10+
11+
- PASS: Started from `docs_build/dev/reports/pr119-supabase-environment-checklist.md`.
12+
- PASS: Provider contract stubs only.
13+
- PASS: Supabase was not made active.
14+
- PASS: Current Local DB provider remains active.
15+
- PASS: No real Supabase keys or secrets were added.
16+
- PASS: Passwords are not stored in app tables.
17+
- PASS: Sign-in runtime behavior is unchanged.
18+
- PASS: Browser -> API/Service Contract -> Database is preserved.
19+
20+
## Supabase Provider Stub Audit
21+
22+
Added `src/dev-runtime/auth/provider-contract-stubs.mjs`.
23+
24+
Contract contents:
25+
26+
- `AUTH_PROVIDER_CONTRACT_OPERATIONS`
27+
- `PROVIDER_DATA_BOUNDARY_RULE`
28+
- `SupabaseAuthProviderStub`
29+
- `SupabasePostgresProviderStub`
30+
- `createProviderContractSnapshot`
31+
32+
Stub behavior:
33+
34+
- Local DB remains the active auth provider.
35+
- Local DB remains the active database provider.
36+
- Supabase Auth is represented as a future provider stub only.
37+
- Supabase Postgres is represented as a future provider stub only.
38+
- Selecting Supabase through environment variables produces visible diagnostics if required config is missing.
39+
- Supabase stubs throw diagnostics if called directly.
40+
- No Supabase package import exists.
41+
- No Supabase runtime client is created.
42+
43+
Local API exposure:
44+
45+
- `/api/providers/contract`
46+
- `/api/session/provider-contract`
47+
- `/api/data-source/adapter-contract` now includes `providerContract`.
48+
49+
The provider contract payload exposes browser-safe missing variable names only for Supabase Auth. Server-only secret names and values are not exposed through browser API payloads.
50+
51+
## Required Environment Variables
52+
53+
Documented without values:
54+
55+
- `GAMEFOUNDRY_AUTH_PROVIDER`
56+
- `GAMEFOUNDRY_DB_PROVIDER`
57+
- `GAMEFOUNDRY_SUPABASE_URL`
58+
- `GAMEFOUNDRY_SUPABASE_ANON_KEY`
59+
- `GAMEFOUNDRY_SUPABASE_SERVICE_ROLE_KEY`
60+
- `GAMEFOUNDRY_SUPABASE_DATABASE_URL`
61+
62+
Server-only variables remain server-only. The Local API provider contract intentionally reports only that server-only values are required; it does not return their names or values.
63+
64+
## Secrets Audit
65+
66+
- PASS: No package dependency changes.
67+
- PASS: No Supabase URL values were added.
68+
- PASS: No JWT-like values were added.
69+
- PASS: No service-role values were added.
70+
- PASS: No database URL values were added.
71+
- PASS: No password table DDL was added.
72+
- PASS: No password hashes, reset secrets, or verification secrets were added.
73+
- PASS: Test placeholders are synthetic and are asserted not to appear in API payloads.
74+
75+
## Requirement Checklist
76+
77+
- PASS: Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before execution.
78+
- PASS: Verified current branch is `main` before making changes.
79+
- PASS: Started from `docs_build/dev/reports/pr119-supabase-environment-checklist.md`.
80+
- PASS: Scoped this PR to provider contract stubs only.
81+
- PASS: Did not make Supabase active.
82+
- PASS: Did not add real Supabase keys or secrets.
83+
- PASS: Did not store passwords in app tables.
84+
- PASS: Did not change sign-in behavior.
85+
- PASS: Added provider contract stubs for future Supabase Auth.
86+
- PASS: Added provider contract stubs for future Supabase Postgres.
87+
- PASS: Kept current Local DB provider active.
88+
- PASS: Added visible diagnostics if Supabase provider is selected without configuration.
89+
- PASS: Documented required environment variables without values.
90+
- PASS: Ensured browser API payloads never receive service-role key values.
91+
- PASS: Preserved Browser -> API/Service Contract -> Database.
92+
93+
## Validation
94+
95+
- PASS: `node --check src/dev-runtime/auth/provider-contract-stubs.mjs`
96+
- PASS: `node --check src/dev-runtime/server/local-api-router.mjs`
97+
- PASS: `node --check tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
98+
- PASS: `node --test tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
99+
- PASS: `node --test tests/dev-runtime/DevRuntimeBoundary.test.mjs`
100+
- PASS: `node --test tests/dev-runtime/DbSeedIntegrity.test.mjs`
101+
- PASS: Local API startup probe on `127.0.0.1:5521`
102+
- PASS: Provider contract route returns active auth/database provider as `local-db`
103+
- PASS: Session route returns mode `local-db`
104+
- PASS: Sign-in page returns HTTP 200 through Local API
105+
- PASS: `npx playwright test tests/playwright/tools/LoginSessionMode.spec.mjs -g "Sign-in page uses a production-safe account form without public Local DB controls" --project=playwright`
106+
- PASS: Playwright V8 coverage report produced.
107+
- WARN: Browser V8 coverage reports changed dev-runtime server files as not collected by browser coverage; these are Node-side modules and are covered by targeted Node tests.
108+
109+
## Manual Validation Notes
110+
111+
- `git diff --check`: PASS.
112+
- Runtime files changed: PASS, scoped to dev-runtime provider contract and Local API router.
113+
- Dependencies added: PASS, none.
114+
- Supabase dependency added: PASS, none.
115+
- Secret-like additions: PASS, none found in added diff.
116+
- Password tables added: PASS, none.
117+
- Sign-in behavior changed: PASS, placeholder sign-in Playwright test still passes.
118+
- Local API still starts: PASS.
119+
- Playwright impacted: Yes, targeted sign-in placeholder test passed.
120+
- Samples smoke test: SKIP, no samples changed and PR scope is provider contract stubs.
121+
122+
## Required Outputs
123+
124+
- PASS: `docs_build/dev/reports/pr120-supabase-provider-contract-stub.md`
125+
- PASS: `docs_build/dev/reports/codex_review.diff`
126+
- PASS: `docs_build/dev/reports/codex_changed_files.txt`
127+
- PASS: `tmp/PR_26164_120-supabase-provider-contract-stub_delta.zip`

0 commit comments

Comments
 (0)