Skip to content

Commit 7f4109b

Browse files
committed
Rework game design foundation corrections
1 parent a9056fd commit 7f4109b

16 files changed

Lines changed: 958 additions & 380 deletions

‎docs_build/database/ddl/game-design.sql‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ CREATE TABLE IF NOT EXISTS game_design_documents (
3030
"updatedBy" text NOT NULL REFERENCES users(key)
3131
);
3232

33+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "gamePurpose" text;
34+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "gameType" text;
35+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "genre" text;
36+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "playStyle" text;
37+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "playerMode" text;
38+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "summary" text;
39+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "story" text;
40+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "coreLoop" text;
41+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "winCondition" text;
42+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "loseCondition" text;
43+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "targetAudience" text;
44+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "designNotes" text;
45+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "capabilityDemoAuthoring" boolean NOT NULL DEFAULT false;
46+
ALTER TABLE game_design_documents ADD COLUMN IF NOT EXISTS "capabilityDemoNotes" text;
47+
3348
CREATE INDEX IF NOT EXISTS idx_game_design_documents_gamekey ON game_design_documents ("gameKey");
3449
CREATE INDEX IF NOT EXISTS idx_game_design_documents_createdby ON game_design_documents ("createdBy");
3550
CREATE INDEX IF NOT EXISTS idx_game_design_documents_updatedby ON game_design_documents ("updatedBy");
@@ -47,6 +62,8 @@ CREATE TABLE IF NOT EXISTS game_design_validation_items (
4762
"updatedBy" text NOT NULL REFERENCES users(key)
4863
);
4964

65+
ALTER TABLE game_design_validation_items ADD COLUMN IF NOT EXISTS "field" text;
66+
5067
CREATE INDEX IF NOT EXISTS idx_game_design_validation_items_gamekey ON game_design_validation_items ("gameKey");
5168
CREATE INDEX IF NOT EXISTS idx_game_design_validation_items_createdby ON game_design_validation_items ("createdBy");
5269
CREATE INDEX IF NOT EXISTS idx_game_design_validation_items_updatedby ON game_design_validation_items ("updatedBy");
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# PR_26177_ALFA_060 Branch Validation
1+
# PR_26177_ALFA_060-game-design-foundation Branch Validation
22

3-
| Check | Result | Evidence |
4-
| --- | --- | --- |
5-
| Branch | PASS | `PR_26177_ALFA_060-game-design-foundation` |
6-
| Base gate | PASS | Branch created from clean synced `main` after `main...origin/main` reported `0 0`. |
7-
| Scope | PASS | Changes are limited to Game Design foundation, DB docs, targeted tests, and required reports. |
8-
| Runtime architecture | PASS | Browser saves through the API repository; server owns design rows and keys. |
9-
| No JSON editor | PASS | UI remains form/table based with Creator-facing fields. |
10-
| SQLite/tmp dependency | PASS | Scoped Game Design surface search found no SQLite or `tmp/local-api` runtime references. |
3+
Generated: 2026-06-26 18:48:08 UTC
4+
5+
- Branch check: PASS - current branch is `PR_26177_ALFA_060-game-design-foundation`.
6+
- Scope check: PASS - changes are limited to Game Design seeded data behavior, targeted tests, reports, and package artifacts.
7+
- Architecture check: PASS - targeted validation proves Browser -> API -> Database persistence.
8+
- Current game check: PASS - status bar and Game Design context both show Demo Game.
9+
- Validation result: PASS.
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
# PR_26177_ALFA_060 Manual Validation Notes
1+
# PR_26177_ALFA_060-game-design-foundation Manual Validation Notes
22

3-
## Reviewed
4-
- Game Design loads the active Demo Game context.
5-
- The form presents Creator-facing fields for summary, story, core loop, win condition, lose condition, target audience, and notes.
6-
- Saving complete fields marks Game Design `Ready` and updates the Game Configuration handoff link.
7-
- Output panel renders the saved fields without JSON.
8-
- Capability demo authoring remains game-owned.
9-
- Guest save redirects to `account/sign-in.html`.
3+
Generated: 2026-06-26 18:48:08 UTC
104

11-
## Not In Scope
12-
- Applying DB migrations to the developer workstation database.
13-
- Game engine internals.
14-
- Non-Alfa tools outside the existing Game Design handoff test surface.
5+
- Loaded /toolbox/game-design/index.html and confirmed the status bar selected game is Demo Game.
6+
- Confirmed Demo Game opens with seeded Puzzle/Adventure/Single Player design fields already populated.
7+
- Edited design fields, saved through the API, and verified game_design_documents plus game_design_sections rows.
8+
- Reloaded and confirmed saved Summary and Genre persisted.
9+
- Opened Gravity Demo context and confirmed capability demo design data stays game-owned and separate from Demo Game.
10+
- Verified guest browser save redirects and direct guest API save returns 401.
Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
# PR_26177_ALFA_060-game-design-foundation Report
22

3+
Generated: 2026-06-26 18:48:08 UTC
4+
Branch: `PR_26177_ALFA_060-game-design-foundation`
5+
Base: `main`
6+
Current HEAD before packaging: `0cedbe78b`
7+
38
## Summary
4-
- Expanded Game Design into a DB/API-backed design foundation for summary, story, core loop, win condition, lose condition, target audience, and design notes.
5-
- Preserved existing Game Type, Genre, Play Style, Player Mode, capability demo authoring, and Game Configuration handoff behavior.
6-
- Added audit-ready `game_design_sections` and `game_design_capability_demos` schema coverage alongside expanded `game_design_documents`.
7-
- Added guest save redirect to `account/sign-in.html`.
9+
PR060 makes Game Design a human-testable API/DB-backed tool with seeded current-game design data. Demo Game loads an existing design, Creators can edit and save it, database rows are asserted, and refresh/reload preserves the saved values.
810

9-
## Changed Areas
10-
- Game Design UI and API client script.
11-
- Game Design server repository fields, validation, section rows, capability rows, and audit fields.
12-
- Mock DB schema metadata and grouped Game Design database docs/seeds.
13-
- Impacted Playwright coverage for Game Design save, guest redirect, capability demos, and toolbox build path.
11+
## Implementation Notes
12+
- `resetDesignData()` now seeds the active Game Hub game before capability demos.
13+
- Tests assert the shared status bar selected game and seeded Demo Game field values before editing.
14+
- Save validation still writes through the API/database path and checks Game Design tables.
15+
- Capability demo authoring remains scoped to Game Hub games.
16+
- No SQLite, tmp runtime dependency, JSON source of truth, mock-db-store expansion, or new mock repository file was added.
1417

1518
## Validation
16-
- PASS: `node --check` on changed JS/MJS files.
17-
- PASS: `git diff --check`.
18-
- PASS: `npx playwright test tests/playwright/tools/GameDesignMockRepository.spec.mjs --workers=1 --reporter=line` (`5 passed`).
19-
20-
## Notes
21-
- No JSON editor or browser-owned product data was introduced.
22-
- Product/runtime wording uses `API`.
23-
- Full migration execution remains outside this PR; docs define the DB contract.
19+
- PASS - node --check assets/toolbox/game-design/js/index.js
20+
- PASS - node --check src/dev-runtime/persistence/tool-repositories/game-design-mock-repository.js
21+
- PASS - node --check src/dev-runtime/server/local-api-router.mjs
22+
- PASS - node --check tests/playwright/tools/GameDesignApiBehavior.spec.mjs
23+
- PASS - git diff --check (line-ending notices only)
24+
- PASS - npx playwright test tests/playwright/tools/GameDesignApiBehavior.spec.mjs --workers=1 --reporter=line (6 passed)
Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
1-
# PR_26177_ALFA_060 Requirement Checklist
1+
# PR_26177_ALFA_060-game-design-foundation Requirement Checklist
22

3-
| Requirement | Result | Notes |
4-
| --- | --- | --- |
5-
| Browser -> API -> Database architecture | PASS | Game Design UI uses the API repository for save/load. |
6-
| Product/runtime wording says API | PASS | Creator-facing page copy uses API wording. |
7-
| One API contract across environments | PASS | No environment-specific Game Design product code path was added. |
8-
| Environment differences are config/.env only | PASS | Game Design behavior does not branch by environment. |
9-
| No SQLite | PASS | No SQLite references added. |
10-
| No tmp runtime dependency | PASS | Runtime does not inspect or depend on tmp paths. |
11-
| No JSON source of truth | PASS | JSON files remain seed documentation only. |
12-
| Browser does not own product data | PASS | No browser storage product-data SSoT was added. |
13-
| API/server owns authoritative keys | PASS | Server repository assigns ULID-shaped keys for design documents, sections, validation rows, and capability rows. |
14-
| Audit fields | PASS | Rows include `createdAt`, `updatedAt`, `createdBy`, and `updatedBy`. |
15-
| Ownership references `users.key` | PASS | DDL references `users(key)` for audit fields. |
16-
| Summary | PASS | Form, output, repository, and DDL include summary. |
17-
| Story | PASS | Form, output, repository, and DDL include story. |
18-
| Core loop | PASS | Form, output, repository, and DDL include core loop. |
19-
| Win condition | PASS | Form, output, repository, and DDL include win condition. |
20-
| Lose condition | PASS | Form, output, repository, and DDL include lose condition. |
21-
| Target audience | PASS | Form, output, repository, and DDL include target audience. |
22-
| Design notes/sections | PASS | Form captures notes and repository emits `game_design_sections`. |
23-
| Guest save redirect | PASS | Playwright verifies redirect to `account/sign-in.html`. |
24-
| Required reports and ZIP | PASS | PR report, branch validation, checklist, lane report, manual notes, `codex_*` reports, and ZIP are produced. |
3+
Generated: 2026-06-26 18:48:08 UTC
4+
5+
- PASS - Center title is Design; Design Workspace wording is absent.
6+
- PASS - Tool loads seeded design data for the current selected Game Hub game.
7+
- PASS - Tool asserts the shared status bar selected game is Demo Game.
8+
- PASS - Read/write behavior remains scoped to the active Game Hub game context.
9+
- PASS - Signed-in Creator can edit fields, save through API/DB, reload, and see persisted values.
10+
- PASS - Editable fields include summary, story, core loop, win/lose conditions, target audience, and notes.
11+
- PASS - Guest browser save redirects to account/sign-in.html and direct guest API save returns 401.
12+
- PASS - No SQLite, tmp runtime dependency, JSON source of truth, mock-db-store expansion, or new mock repository file was added.
13+
- PASS - DDL/DML/seed artifacts remain under docs_build/database/ddl, dml, and seed paths.
Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
# PR_26177_ALFA_060 Validation Lane
1+
# PR_26177_ALFA_060-game-design-foundation Validation Lane
22

3-
## Commands
4-
- `node --check src/dev-runtime/persistence/tool-repositories/game-design-mock-repository.js`
5-
- `node --check assets/toolbox/game-design/js/index.js`
6-
- `node --check src/dev-runtime/persistence/mock-db-store.js`
7-
- `node --check src/dev-runtime/server/local-api-router.mjs`
8-
- `node --check tests/playwright/tools/GameDesignMockRepository.spec.mjs`
9-
- `git diff --check`
10-
- `npx playwright test tests/playwright/tools/GameDesignMockRepository.spec.mjs --workers=1 --reporter=line`
3+
Generated: 2026-06-26 18:48:08 UTC
114

12-
## Result
13-
PASS
14-
15-
## Evidence
16-
- Playwright Game Design lane: `5 passed`.
17-
- Syntax checks passed for changed runtime/test JS/MJS files.
18-
- `git diff --check` exited `0`; only line-ending normalization warnings were printed.
5+
- PASS - node --check assets/toolbox/game-design/js/index.js
6+
- PASS - node --check src/dev-runtime/persistence/tool-repositories/game-design-mock-repository.js
7+
- PASS - node --check src/dev-runtime/server/local-api-router.mjs
8+
- PASS - node --check tests/playwright/tools/GameDesignApiBehavior.spec.mjs
9+
- PASS - git diff --check (line-ending notices only)
10+
- PASS - npx playwright test tests/playwright/tools/GameDesignApiBehavior.spec.mjs --workers=1 --reporter=line (6 passed)
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
M assets/toolbox/game-design/js/index.js
2-
M docs_build/database/ddl/game-design.sql
3-
M docs_build/database/dml/game-design.sql
4-
M docs_build/database/seed/game-design.json
5-
M docs_build/database/seed/guest/game-design.json
6-
A docs_build/dev/reports/PR_26177_ALFA_060-game-design-foundation_branch-validation.md
7-
A docs_build/dev/reports/PR_26177_ALFA_060-game-design-foundation_manual-validation-notes.md
8-
A docs_build/dev/reports/PR_26177_ALFA_060-game-design-foundation_report.md
9-
A docs_build/dev/reports/PR_26177_ALFA_060-game-design-foundation_requirement-checklist.md
10-
A docs_build/dev/reports/PR_26177_ALFA_060-game-design-foundation_validation-lane.md
11-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
12-
M docs_build/dev/reports/playwright_v8_coverage_report.txt
13-
M src/dev-runtime/persistence/mock-db-store.js
14-
M src/dev-runtime/persistence/tool-repositories/game-design-mock-repository.js
15-
M src/dev-runtime/server/local-api-router.mjs
16-
M tests/playwright/tools/GameDesignMockRepository.spec.mjs
17-
M toolbox/game-design/index.html
18-
M docs_build/dev/reports/codex_changed_files.txt
19-
M docs_build/dev/reports/codex_review.diff
1+
assets/toolbox/game-design/js/index.js
2+
docs_build/database/ddl/game-design.sql
3+
docs_build/database/dml/game-design.sql
4+
docs_build/database/seed/game-design.json
5+
docs_build/database/seed/guest/game-design.json
6+
docs_build/dev/reports/PR_26177_ALFA_060-game-design-foundation_branch-validation.md
7+
docs_build/dev/reports/PR_26177_ALFA_060-game-design-foundation_manual-validation-notes.md
8+
docs_build/dev/reports/PR_26177_ALFA_060-game-design-foundation_report.md
9+
docs_build/dev/reports/PR_26177_ALFA_060-game-design-foundation_requirement-checklist.md
10+
docs_build/dev/reports/PR_26177_ALFA_060-game-design-foundation_validation-lane.md
11+
docs_build/dev/reports/codex_changed_files.txt
12+
docs_build/dev/reports/codex_review.diff
13+
docs_build/dev/reports/coverage_changed_js_guardrail.txt
14+
docs_build/dev/reports/playwright_v8_coverage_report.txt
15+
src/dev-runtime/auth/provider-contract-stubs.mjs
16+
src/dev-runtime/persistence/tool-repositories/game-design-mock-repository.js
17+
src/dev-runtime/server/local-api-router.mjs
18+
tests/playwright/tools/GameDesignApiBehavior.spec.mjs
19+
toolbox/game-design/index.html

0 commit comments

Comments
 (0)