Skip to content

Commit 0da72a3

Browse files
committed
Bootstrap Supabase identity records and provisioning for usable sign in - PR_26166_153-supabase-identity-bootstrap-and-provisioning
1 parent b70b555 commit 0da72a3

35 files changed

Lines changed: 1594 additions & 1463 deletions
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# PR_26166_153-supabase-identity-bootstrap-and-provisioning
2+
3+
## Branch Validation
4+
- PASS: current branch `main`.
5+
- Expected branch: `main`.
6+
7+
## Requirement Checklist
8+
- PASS: `docs_build/dev/PROJECT_INSTRUCTIONS.md` was read before implementation.
9+
- PASS: `GAMEFOUNDRY_DB_PROVIDER=local-db` is preserved; product data remains Local DB.
10+
- PASS: Supabase identity table validation was added for `users`, `roles`, and `user_roles`.
11+
- PASS: `/api/auth/status` now requires Supabase Auth connectivity and identity table reachability before `ready=true`.
12+
- PASS: Create Account creates the Supabase Auth user through the backend API and provisions matching app identity records server-side.
13+
- PASS: Provisioning creates/updates `users`, ensures the default `user` role, and inserts `user_roles` with server-generated keys.
14+
- PASS: Sign In resolves session/user/roles from Supabase identity records.
15+
- PASS: Password Reset remains Supabase Auth only.
16+
- PASS: No secrets or `.env.local` files were committed or modified.
17+
- PASS: Browser pages continue to use backend API contracts only; no browser-owned auth/provider/data logic was added.
18+
- PASS: No silent fallback was added.
19+
- FAIL: Real configured Supabase DEV readiness could not be validated as `ready=true` from this machine because the live connectivity check fails before HTTP with `UNABLE_TO_VERIFY_LEAF_SIGNATURE`.
20+
21+
## Validation Lane Report
22+
- PASS: `node --check src/dev-runtime/server/local-api-router.mjs`
23+
- PASS: `node --check tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
24+
- PASS: `node --check tests/playwright/tools/LoginSessionMode.spec.mjs`
25+
- PASS: `node --test tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
26+
- PASS: `npx playwright test tests/playwright/tools/LoginSessionMode.spec.mjs --grep "Sign-in page uses|Configured account auth actions" --reporter=list`
27+
- PASS: `npm run test:workspace-v2`
28+
- FAIL: Real DEV `/api/auth/status` readiness probe with local `.env.local` values present:
29+
- `selected=true`
30+
- `configured=true`
31+
- `localDbProductDataActive=true`
32+
- `connectivityStatus=failed`
33+
- `identityTablesReady=false`
34+
- `ready=false`
35+
- operator preflight: `Supabase Auth request failed before an HTTP status was available. (UNABLE_TO_VERIFY_LEAF_SIGNATURE)`
36+
37+
## Playwright Impact
38+
- Playwright impacted: Yes.
39+
- Coverage report: `docs_build/dev/reports/playwright_v8_coverage_report.txt`
40+
- Coverage WARN: Node server runtime JS is not collected by browser V8 coverage; browser account auth JS remains covered by the focused auth Playwright run.
41+
42+
## Manual Validation Notes
43+
- Fake Supabase provider validation proves:
44+
- `/api/auth/status` returns `ready=true` when Auth connectivity and identity tables are reachable.
45+
- Create Account provisions one app `users` row, one default `roles` row when needed, and one `user_roles` row.
46+
- Sign In resolves a session using the provisioned identity record and role.
47+
- Missing identity rows fail with the generic production-safe browser message.
48+
- Real DEV validation is blocked by local Node TLS trust, not by missing environment values. Required env presence was verified without printing secret values.
49+
50+
## Skipped Lanes
51+
- Full samples smoke: SKIP. Auth identity bootstrap/provisioning does not touch samples or sample manifests.
52+
53+
## Changed Files
54+
- `src/dev-runtime/server/local-api-router.mjs`
55+
- `tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
56+
- `tests/playwright/tools/LoginSessionMode.spec.mjs`
57+
- Validation/report artifacts under `docs_build/dev/reports/`
58+
59+
## Review Artifacts
60+
- `docs_build/dev/reports/codex_review.diff`
61+
- `docs_build/dev/reports/codex_changed_files.txt`
Lines changed: 23 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# git status --short
2-
M account/sign-in.html
3-
M assets/theme-v2/js/account-auth-actions.js
4-
M assets/theme-v2/js/login-session.js
5-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
6-
M docs_build/dev/reports/dependency_gating_report.md
2+
M docs_build/dev/reports/dependency_gating_report.md
73
M docs_build/dev/reports/dependency_hydration_reuse_report.md
84
M docs_build/dev/reports/execution_graph_reuse_report.md
95
M docs_build/dev/reports/failure_fingerprint_report.md
@@ -23,7 +19,6 @@ M account/sign-in.html
2319
M docs_build/dev/reports/playwright_discovery_ownership_report.md
2420
M docs_build/dev/reports/playwright_discovery_scope_report.md
2521
M docs_build/dev/reports/playwright_structure_audit.md
26-
M docs_build/dev/reports/playwright_v8_coverage_report.txt
2722
M docs_build/dev/reports/retry_suppression_report.md
2823
M docs_build/dev/reports/slow_path_pruning_report.md
2924
M docs_build/dev/reports/static_validation_report.md
@@ -35,60 +30,43 @@ M account/sign-in.html
3530
M docs_build/dev/reports/zero_browser_preflight_report.md
3631
M src/dev-runtime/server/local-api-router.mjs
3732
M tests/dev-runtime/SupabaseProviderContractStub.test.mjs
38-
M tests/playwright/tools/ApiStaticRouteRecovery.spec.mjs
3933
M tests/playwright/tools/LoginSessionMode.spec.mjs
40-
M tests/playwright/tools/StaticOnlyLoginApiRequired.spec.mjs
41-
?? docs_build/dev/reports/PR_26166_148-supabase-auth-readiness-gate.md
42-
?? docs_build/dev/reports/PR_26166_149-sign-in-live-supabase-flow.md
43-
?? docs_build/dev/reports/PR_26166_150-create-account-live-supabase-flow.md
44-
?? docs_build/dev/reports/PR_26166_151-password-reset-live-supabase-flow.md
45-
?? docs_build/dev/reports/PR_26166_152-session-user-role-resolution.md
34+
?? docs_build/dev/reports/PR_26166_153-supabase-identity-bootstrap-and-provisioning.md
4635

4736
# git ls-files --others --exclude-standard
48-
docs_build/dev/reports/PR_26166_148-supabase-auth-readiness-gate.md
49-
docs_build/dev/reports/PR_26166_149-sign-in-live-supabase-flow.md
50-
docs_build/dev/reports/PR_26166_150-create-account-live-supabase-flow.md
51-
docs_build/dev/reports/PR_26166_151-password-reset-live-supabase-flow.md
52-
docs_build/dev/reports/PR_26166_152-session-user-role-resolution.md
37+
docs_build/dev/reports/PR_26166_153-supabase-identity-bootstrap-and-provisioning.md
5338

5439
# git diff --stat
55-
account/sign-in.html | 4 +-
56-
assets/theme-v2/js/account-auth-actions.js | 11 +-
57-
assets/theme-v2/js/login-session.js | 17 +-
58-
.../dev/reports/coverage_changed_js_guardrail.txt | 6 +-
59-
docs_build/dev/reports/dependency_gating_report.md | 2 +-
60-
.../reports/dependency_hydration_reuse_report.md | 4 +-
61-
.../dev/reports/execution_graph_reuse_report.md | 4 +-
40+
docs_build/dev/reports/dependency_gating_report.md | 2 +-
41+
.../reports/dependency_hydration_reuse_report.md | 12 +-
42+
.../dev/reports/execution_graph_reuse_report.md | 16 +-
6243
.../dev/reports/failure_fingerprint_report.md | 2 +-
6344
.../reports/filesystem_scan_reduction_report.md | 2 +-
64-
.../dev/reports/incremental_validation_report.md | 2 +-
45+
.../dev/reports/incremental_validation_report.md | 14 +-
6546
docs_build/dev/reports/lane_compilation_report.md | 2 +-
6647
.../dev/reports/lane_deduplication_report.md | 2 +-
6748
.../dev/reports/lane_input_validation_report.md | 2 +-
6849
.../reports/lane_manifests/workspace-contract.json | 10 +-
69-
.../reports/lane_runtime_optimization_report.md | 2 +-
70-
docs_build/dev/reports/lane_snapshot_report.md | 4 +-
71-
.../reports/lane_snapshots/workspace-contract.json | 22 +-
72-
docs_build/dev/reports/lane_warm_start_report.md | 4 +-
50+
.../reports/lane_runtime_optimization_report.md | 14 +-
51+
docs_build/dev/reports/lane_snapshot_report.md | 12 +-
52+
.../reports/lane_snapshots/workspace-contract.json | 22 +--
53+
docs_build/dev/reports/lane_warm_start_report.md | 12 +-
7354
.../lane_warm_starts/workspace-contract.json | 16 +-
7455
.../dev/reports/monolith_trigger_removal_report.md | 2 +-
75-
.../dev/reports/persistent_lane_manifest_report.md | 6 +-
56+
.../dev/reports/persistent_lane_manifest_report.md | 12 +-
7657
.../playwright_discovery_ownership_report.md | 2 +-
7758
.../reports/playwright_discovery_scope_report.md | 2 +-
7859
.../dev/reports/playwright_structure_audit.md | 2 +-
79-
.../dev/reports/playwright_v8_coverage_report.txt | 48 +++-
8060
docs_build/dev/reports/retry_suppression_report.md | 2 +-
81-
docs_build/dev/reports/slow_path_pruning_report.md | 12 +-
82-
docs_build/dev/reports/static_validation_report.md | 4 +-
83-
.../dev/reports/targeted_file_manifest_report.md | 4 +-
84-
.../dev/reports/test_cleanup_performance_report.md | 14 +-
61+
docs_build/dev/reports/slow_path_pruning_report.md | 16 +-
62+
docs_build/dev/reports/static_validation_report.md | 12 +-
63+
.../dev/reports/targeted_file_manifest_report.md | 8 +-
64+
.../dev/reports/test_cleanup_performance_report.md | 22 +--
8565
.../dev/reports/test_cleanup_routing_report.md | 2 +-
86-
.../dev/reports/testing_lane_execution_report.md | 16 +-
87-
docs_build/dev/reports/validation_cache_report.md | 30 +--
88-
.../dev/reports/zero_browser_preflight_report.md | 2 +-
89-
src/dev-runtime/server/local-api-router.mjs | 246 +++++++++++++++------
90-
.../SupabaseProviderContractStub.test.mjs | 92 +++++---
91-
.../tools/ApiStaticRouteRecovery.spec.mjs | 17 +-
92-
tests/playwright/tools/LoginSessionMode.spec.mjs | 99 +++++++--
93-
.../tools/StaticOnlyLoginApiRequired.spec.mjs | 4 +-
94-
39 files changed, 503 insertions(+), 221 deletions(-)
66+
.../dev/reports/testing_lane_execution_report.md | 52 +++---
67+
docs_build/dev/reports/validation_cache_report.md | 30 ++--
68+
.../dev/reports/zero_browser_preflight_report.md | 10 +-
69+
src/dev-runtime/server/local-api-router.mjs | 195 ++++++++++++++++++++-
70+
.../SupabaseProviderContractStub.test.mjs | 170 ++++++++++++++++--
71+
tests/playwright/tools/LoginSessionMode.spec.mjs | 40 ++++-
72+
32 files changed, 538 insertions(+), 181 deletions(-)

0 commit comments

Comments
 (0)