Skip to content

Commit 9bc7a8d

Browse files
committed
Add Supabase Auth pages and local DEV PostgreSQL setup - PR_26163_085-auth-pages-and-dev-db-setup &Move database DDL planning to docs_build and define Admin Site Setup seed direction - PR_26164_091-db-ddl-site-setup-governance
1 parent e5562d3 commit 9bc7a8d

7 files changed

Lines changed: 332 additions & 1929 deletions

admin/site-settings.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<a href="/admin/themes.html">Themes</a>
2828
<a href="/admin/tool-votes.html">Tool Votes</a>
2929
<a href="/admin/users.html">Users</a>
30-
</aside><div class="card"><div class="card-body"><div class="kicker">Status = Planning</div><div class="grid cols-3"><article class="callout"><h2>Purpose</h2><p>Move site-level configuration out of Account and into the Admin information architecture.</p></article><article class="callout"><h2>Future Scope</h2><p>Plan maintenance notices, publishing defaults and environment-level feature flags.</p></article><article class="callout"><h2>Planned Sections</h2><ul><li>General settings</li><li>Publishing defaults</li><li>Maintenance notices</li></ul></article></div></div></div></div></section>
30+
</aside><div class="card"><div class="card-body content-stack"><div class="kicker">Status = Planning</div><div class="grid cols-3"><article class="callout"><h2>Purpose</h2><p>Move site-level configuration out of Account and into the Admin information architecture.</p></article><article class="callout"><h2>Future Scope</h2><p>Plan maintenance notices, publishing defaults and environment-level feature flags.</p></article><article class="callout"><h2>Planned Sections</h2><ul><li>General settings</li><li>Publishing defaults</li><li>Maintenance notices</li></ul></article></div><div class="grid cols-2"><article class="callout"><h2>Site Setup</h2><p>Admin Site Setup is the planned home for long-term setup behavior, including initial roles and other site-owned defaults.</p></article><article class="callout"><h2>Database Setup</h2><p>Codex may prepare and execute DEV database setup only. UAT and production SQL execution remains user-controlled.</p></article></div></div></div></div></section>
3131
</main>
3232
<div data-partial="footer"></div>
3333
<script src="../assets/theme-v2/js/gamefoundry-partials.js" defer></script>

docs_build/database/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Database Artifact Ownership
2+
3+
Database schema and setup review artifacts are owned outside runtime source.
4+
5+
## Ownership
6+
7+
- DEV database DDL belongs in `docs_build/database/ddl/`.
8+
- DEV setup or DML review artifacts belong in `docs_build/database/dml/`.
9+
- DDL must not be placed under `src/` or `docs/`.
10+
- DML files in this folder are temporary setup/review artifacts unless promoted by a future Admin Site Setup workflow.
11+
12+
## Execution Boundary
13+
14+
Codex may execute DEV database setup only.
15+
16+
UAT and production SQL execution is user-controlled. Codex may prepare review artifacts, but it must not execute UAT or production SQL.
17+
18+
Long-term seed behavior belongs in Admin -> Site Setup, not permanent seed SQL. Temporary DML files may document review setup data while the Admin Site Setup workflow is planned.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
-- Game Foundry Studio DEV database DDL
2+
-- Ownership: docs_build/database/ddl/
3+
-- Target DEV database: gamefoundry_dev
4+
-- Scope: app identity tables only. No custom password tables are defined here.
5+
6+
CREATE EXTENSION IF NOT EXISTS pgcrypto;
7+
8+
CREATE TABLE IF NOT EXISTS users (
9+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
10+
auth_provider text,
11+
auth_subject text,
12+
email text,
13+
display_name text NOT NULL DEFAULT 'Creator',
14+
created_at timestamptz NOT NULL DEFAULT now(),
15+
updated_at timestamptz NOT NULL DEFAULT now(),
16+
CONSTRAINT users_auth_identity_unique UNIQUE (auth_provider, auth_subject)
17+
);
18+
19+
CREATE TABLE IF NOT EXISTS roles (
20+
id integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
21+
slug text NOT NULL UNIQUE,
22+
display_name text NOT NULL,
23+
description text NOT NULL DEFAULT '',
24+
created_at timestamptz NOT NULL DEFAULT now(),
25+
updated_at timestamptz NOT NULL DEFAULT now()
26+
);
27+
28+
CREATE TABLE IF NOT EXISTS user_roles (
29+
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
30+
role_id integer NOT NULL REFERENCES roles(id) ON DELETE CASCADE,
31+
created_at timestamptz NOT NULL DEFAULT now(),
32+
PRIMARY KEY (user_id, role_id)
33+
);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- TEMPORARY SETUP/REVIEW ARTIFACT
2+
-- DEV review only. Codex may execute DEV database setup only.
3+
-- UAT and production SQL execution is user-controlled.
4+
-- Long-term seed behavior belongs in Admin -> Site Setup, not permanent seed SQL.
5+
-- Target DEV database: gamefoundry_dev
6+
7+
INSERT INTO roles (slug, display_name, description)
8+
VALUES
9+
('admin', 'Admin', 'Can manage site configuration and review operational setup.'),
10+
('creator', 'Creator', 'Can create and manage games, assets, and publishing workflows.'),
11+
('user', 'User', 'Can use signed-in platform features.'),
12+
('guest', 'Guest', 'Can explore public and guest-safe areas.')
13+
ON CONFLICT (slug) DO UPDATE SET
14+
display_name = EXCLUDED.display_name,
15+
description = EXCLUDED.description,
16+
updated_at = now();
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# PR_26164_091-db-ddl-site-setup-governance
2+
3+
## Branch Validation
4+
5+
PASS: current branch is `main`.
6+
7+
## Scope Summary
8+
9+
PASS: Scoped to database artifact placement, Admin Site Setup planning content, and required reports.
10+
11+
Changed implementation/planning files:
12+
13+
- `admin/site-settings.html`
14+
- `docs_build/database/README.md`
15+
- `docs_build/database/ddl/dev-app-identity-schema.sql`
16+
- `docs_build/database/dml/dev-app-identity-temporary-setup-review.sql`
17+
18+
## Requirement Checklist
19+
20+
| Requirement | Status | Evidence |
21+
| --- | --- | --- |
22+
| Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before execution | PASS | Project instructions were read before implementation. |
23+
| Verify current branch is `main` before changes | PASS | `git branch --show-current` returned `main`. |
24+
| Scope to database artifact placement and Admin Site Setup planning only | PASS | Only database review artifacts, Site Settings planning copy, and reports changed. |
25+
| Do not apply `PR_26163_085` as-is | PASS | Auth pages, auth client wiring, script files, runtime API changes, and Playwright auth tests from the prior setup pass were removed from the working tree before this PR work. |
26+
| Move DEV database DDL ownership to `docs_build/database/ddl/` | PASS | `docs_build/database/ddl/dev-app-identity-schema.sql` owns DEV identity table DDL. |
27+
| Move DEV database DML/setup planning to `docs_build/database/dml/` only as temporary review artifacts | PASS | `docs_build/database/dml/dev-app-identity-temporary-setup-review.sql` is marked `TEMPORARY SETUP/REVIEW ARTIFACT`. |
28+
| Do not place DDL under `src/` or `docs/` | PASS | Validation found no `.sql` or `.ddl` files under `src/` or `docs/`. |
29+
| Document Codex DEV DB execution boundary | PASS | `docs_build/database/README.md` and the DML header state Codex may execute DEV database setup only. |
30+
| Document UAT/PROD SQL execution is user-controlled | PASS | `docs_build/database/README.md`, DML header, and Site Settings planning copy state UAT/production SQL execution is user-controlled. |
31+
| Document long-term seed behavior belongs in Admin -> Site Setup | PASS | `docs_build/database/README.md`, DML header, and Admin Site Settings planning content document this ownership. |
32+
| Add/update Admin Site Setup planning content if an existing admin setup page exists | PASS | Updated existing `admin/site-settings.html` with Site Setup and Database Setup planning cards. |
33+
| Do not introduce Supabase runtime wiring | PASS | Changed implementation/planning files contain no Supabase references and no runtime JS changes were made. |
34+
| Do not reintroduce MEM DB | PASS | Changed implementation/planning files contain no MEM DB references. |
35+
| Do not add custom password tables | PASS | DDL contains `users`, `roles`, and `user_roles` only; no password/hash/salt table or column was added. |
36+
37+
## DDL/DML Location Audit
38+
39+
PASS: DDL statements were found only in `docs_build/database/ddl/dev-app-identity-schema.sql`.
40+
41+
DDL evidence:
42+
43+
- `CREATE EXTENSION IF NOT EXISTS pgcrypto;`
44+
- `CREATE TABLE IF NOT EXISTS users`
45+
- `CREATE TABLE IF NOT EXISTS roles`
46+
- `CREATE TABLE IF NOT EXISTS user_roles`
47+
48+
PASS: No `.sql` or `.ddl` files exist under `src/` or `docs/`.
49+
50+
PASS: The DML/setup file is under `docs_build/database/dml/` and is clearly marked as a temporary setup/review artifact.
51+
52+
## MEM DB Reintroduction Audit
53+
54+
PASS: Scoped implementation/planning files were scanned for MEM DB terminology and did not introduce MEM DB, Local Mem, or MockDbAdapter references.
55+
56+
Scope scanned:
57+
58+
- `admin/site-settings.html`
59+
- `docs_build/database/README.md`
60+
- `docs_build/database/ddl/dev-app-identity-schema.sql`
61+
- `docs_build/database/dml/dev-app-identity-temporary-setup-review.sql`
62+
63+
## Validation Lane Report
64+
65+
Playwright impacted: No.
66+
67+
No Playwright impact. This PR is documentation/database artifact organization and Admin planning copy only.
68+
69+
Validation commands:
70+
71+
- PASS: `git diff --check`
72+
- PASS: changed-file MEM DB reference audit
73+
- PASS: DDL statement location audit
74+
- PASS: no `.sql` or `.ddl` files under `src/` or `docs/`
75+
- PASS: DML temporary setup/review artifact marker audit
76+
- PASS: no Supabase runtime wiring or custom password-table audit
77+
- PASS: changed HTML inline script/style/event-handler audit
78+
79+
## Manual Validation Notes
80+
81+
- Confirmed the existing Admin Site Settings page now includes Site Setup and Database Setup planning cards.
82+
- Confirmed no inline style attributes, `<style>` blocks, inline script blocks, or inline event handlers were added.
83+
- Confirmed this PR does not add runtime JavaScript, Supabase configuration, auth pages, PowerShell database scripts, or Playwright tests.
84+
- Full samples smoke test was not run because the PR is docs/database artifact organization only.
Lines changed: 28 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,28 @@
1-
admin/db-viewer.html
2-
admin/db-viewer.js
3-
admin/environments.html
4-
assets/theme-v2/js/gamefoundry-partials.js
5-
assets/theme-v2/js/login-session.js
6-
docs_build/dev/reports/coverage_changed_js_guardrail.txt
7-
docs_build/dev/reports/dependency_gating_report.md
8-
docs_build/dev/reports/dependency_hydration_reuse_report.md
9-
docs_build/dev/reports/execution_graph_reuse_report.md
10-
docs_build/dev/reports/failure_fingerprint_report.md
11-
docs_build/dev/reports/filesystem_scan_reduction_report.md
12-
docs_build/dev/reports/incremental_validation_report.md
13-
docs_build/dev/reports/lane_compilation_report.md
14-
docs_build/dev/reports/lane_deduplication_report.md
15-
docs_build/dev/reports/lane_input_validation_report.md
16-
docs_build/dev/reports/lane_manifests/workspace-contract.json
17-
docs_build/dev/reports/lane_runtime_optimization_report.md
18-
docs_build/dev/reports/lane_snapshot_report.md
19-
docs_build/dev/reports/lane_snapshots/workspace-contract.json
20-
docs_build/dev/reports/lane_warm_start_report.md
21-
docs_build/dev/reports/lane_warm_starts/workspace-contract.json
22-
docs_build/dev/reports/monolith_trigger_removal_report.md
23-
docs_build/dev/reports/persistent_lane_manifest_report.md
24-
docs_build/dev/reports/playwright_discovery_ownership_report.md
25-
docs_build/dev/reports/playwright_discovery_scope_report.md
26-
docs_build/dev/reports/playwright_structure_audit.md
27-
docs_build/dev/reports/playwright_v8_coverage_report.txt
28-
docs_build/dev/reports/retry_suppression_report.md
29-
docs_build/dev/reports/slow_path_pruning_report.md
30-
docs_build/dev/reports/static_validation_report.md
31-
docs_build/dev/reports/targeted_file_manifest_report.md
32-
docs_build/dev/reports/test_cleanup_performance_report.md
33-
docs_build/dev/reports/test_cleanup_routing_report.md
34-
docs_build/dev/reports/testing_lane_execution_report.md
35-
docs_build/dev/reports/validation_cache_report.md
36-
docs_build/dev/reports/zero_browser_preflight_report.md
37-
login.html
38-
src/dev-runtime/persistence/mock-db-store.js
39-
src/dev-runtime/server/mock-api-router.mjs
40-
src/engine/api/mock-db-api-client.js
41-
src/engine/api/mock-db-viewer-ui.js
42-
tests/dev-runtime/DbSeedIntegrity.test.mjs
43-
tests/dev-runtime/DevRuntimeBoundary.test.mjs
44-
tests/helpers/playwrightRepoServer.mjs
45-
tests/playwright/account/AchievementsPage.spec.mjs
46-
tests/playwright/tools/AdminDbViewer.spec.mjs
47-
tests/playwright/tools/AdminNotesLocalViewer.spec.mjs
48-
tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs
49-
tests/playwright/tools/ApiStaticRouteRecovery.spec.mjs
50-
tests/playwright/tools/AssetToolMockRepository.spec.mjs
51-
tests/playwright/tools/BuildPathProgressSimplification.spec.mjs
52-
tests/playwright/tools/GameJourneyTool.spec.mjs
53-
tests/playwright/tools/LoginSessionMode.spec.mjs
54-
tests/playwright/tools/PaletteToolMockRepository.spec.mjs
55-
tests/playwright/tools/RootToolsFutureState.spec.mjs
56-
tests/playwright/tools/StaticOnlyLoginApiRequired.spec.mjs
57-
tests/playwright/tools/TagsTool.spec.mjs
58-
tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs
59-
tests/playwright/tools/ToolboxRoutePages.spec.mjs
60-
docs_build/dev/reports/PR_26164_090-remove-mem-db-dev.md
61-
docs_build/dev/reports/codex_changed_files.txt
62-
docs_build/dev/reports/codex_review.diff
1+
# codex_changed_files.txt
2+
3+
## git status --short
4+
```
5+
M admin/site-settings.html
6+
A docs_build/database/README.md
7+
A docs_build/database/ddl/dev-app-identity-schema.sql
8+
A docs_build/database/dml/dev-app-identity-temporary-setup-review.sql
9+
A docs_build/dev/reports/PR_26164_091-db-ddl-site-setup-governance.md
10+
M docs_build/dev/reports/codex_changed_files.txt
11+
M docs_build/dev/reports/codex_review.diff
12+
```
13+
14+
## git diff --cached --stat
15+
```
16+
admin/site-settings.html | 2 +-
17+
docs_build/database/README.md | 18 +
18+
.../database/ddl/dev-app-identity-schema.sql | 33 +
19+
.../dev-app-identity-temporary-setup-review.sql | 16 +
20+
.../PR_26164_091-db-ddl-site-setup-governance.md | 84 +
21+
docs_build/dev/reports/codex_changed_files.txt | 89 +-
22+
docs_build/dev/reports/codex_review.diff | 2018 ++------------------
23+
7 files changed, 331 insertions(+), 1929 deletions(-)
24+
```
25+
26+
## git diff --stat
27+
```
28+
```

0 commit comments

Comments
 (0)