Skip to content

Commit 20a6eea

Browse files
committed
Rework game crew foundation corrections
1 parent c15715c commit 20a6eea

17 files changed

Lines changed: 1131 additions & 671 deletions

‎assets/toolbox/game-crew/js/index.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ elements.add?.addEventListener("click", () => {
154154
if (redirectGuestWriteAction()) {
155155
return;
156156
}
157-
const result = repository.readAddMemberPlaceholder();
157+
const result = repository.addMember();
158158
setText(elements.action, result.message);
159159
setText(elements.log, result.message);
160+
render();
160161
});
161162

162163
elements.refresh?.addEventListener("click", () => {
@@ -172,10 +173,11 @@ elements.table?.addEventListener("click", (event) => {
172173
if (redirectGuestWriteAction()) {
173174
return;
174175
}
175-
const result = repository.readRemoveMemberPlaceholder(remove.dataset.gameCrewRemove);
176+
const result = repository.removeMember(remove.dataset.gameCrewRemove);
176177
setText(elements.selected, result.member?.displayName || "Selected member");
177178
setText(elements.action, result.message);
178179
setText(elements.log, result.message);
180+
render();
179181
});
180182

181183
render();

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

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎docs_build/database/game-crew/dml.sql‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎docs_build/database/game-crew/seed.json‎

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# PR_26177_ALFA_059 Branch Validation
1+
# PR_26177_ALFA_059-game-crew-foundation Branch Validation
22

3-
| Check | Result | Evidence |
4-
| --- | --- | --- |
5-
| Branch | PASS | `PR_26177_ALFA_059-game-crew-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 Crew foundation, DB docs, targeted tests, and required reports. |
8-
| Runtime architecture | PASS | Browser reads Game Crew through the API repository; server owns member rows. |
9-
| No full invitations/permissions | PASS | Add/remove controls return Creator-safe planned-state guidance only. |
10-
| SQLite/tmp dependency | PASS | Scoped Game Crew surface search found no SQLite or `tmp/local-api` runtime references. |
3+
Generated: 2026-06-26 18:44:40 UTC
4+
5+
- Branch check: PASS - current branch is `PR_26177_ALFA_059-game-crew-foundation`.
6+
- Scope check: PASS - changes are limited to Game Crew UI/API tests/reports/package artifacts.
7+
- Architecture check: PASS - targeted validation proves Browser -> API -> Database membership persistence.
8+
- Current game check: PASS - status bar and Game Crew project context both show Demo Game.
9+
- Validation result: PASS.
Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
# PR_26177_ALFA_059 Manual Validation Notes
1+
# PR_26177_ALFA_059-game-crew-foundation Manual Validation Notes
22

3-
## Reviewed
4-
- Game Crew page loads Theme V2 chrome and the shared Tool Display Mode component.
5-
- Active project displays as `Demo Game`.
6-
- Owner summary displays `User 1`.
7-
- Member count displays `3`.
8-
- Member table includes `User 1`, `DavidQ`, and `User 3`.
9-
- Repository table count shows `project_members`.
10-
- Add Member shows planned invitation guidance for signed-in users.
11-
- Remove on a non-owner shows planned removal guidance.
12-
- Guest Add Member redirects to `account/sign-in.html`.
3+
Generated: 2026-06-26 18:44:40 UTC
134

14-
## Not In Scope
15-
- Full member invitations.
16-
- Permissions, ownership transfer, or role enforcement.
17-
- Applying database migrations to the developer workstation database.
5+
- Loaded /toolbox/game-crew/index.html and confirmed the status bar selected game is Demo Game.
6+
- Confirmed Demo Game owner is User 1 and member rows include User 1, DavidQ, and User 3.
7+
- Clicked Add Member and confirmed User 2 appears as Member and persists to DB.
8+
- Reloaded the page and confirmed User 2 remains until removed.
9+
- Removed User 2, reloaded, and confirmed the active member count returned to 3.
10+
- Verified guest Add Member and Remove redirect to account/sign-in.html.
Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
# PR_26177_ALFA_059-game-crew-foundation Report
22

3+
Generated: 2026-06-26 18:44:40 UTC
4+
Branch: `PR_26177_ALFA_059-game-crew-foundation`
5+
Base: `main`
6+
Current HEAD before packaging: `3e48789a9`
7+
38
## Summary
4-
- Replaced the static Game Crew wireframe with an API-backed project crew foundation.
5-
- Added a server-owned Game Crew repository that exposes `project_members` rows with ULID-shaped keys and audit-field readiness.
6-
- Rendered the active project, owner, member count, member table, table counts, and Creator-safe guidance in the Theme V2 tool surface.
7-
- Added placeholder add/remove member behavior without implementing invitations, permission changes, or full membership workflows.
9+
PR059 makes Game Crew a human-testable API/DB-backed tool. It displays the current Game Hub game, owner, and member list, supports a simple Add Member and Remove Member flow, persists membership rows, and survives refresh/reload.
810

9-
## Changed Areas
10-
- Game Crew UI: `toolbox/game-crew/index.html`, `assets/toolbox/game-crew/js/index.js`.
11-
- API/dev-runtime: Game Crew repository, server repository routing/constants, mock DB tool grouping.
12-
- Database docs: `project_members` DDL/DML/seed entrypoints under `docs_build/database`.
13-
- Targeted Playwright: `tests/playwright/tools/GameCrewFoundation.spec.mjs`.
11+
## Implementation Notes
12+
- The Playwright lane asserts the shared status bar selected game and the Game Crew project context are both Demo Game.
13+
- Member roles stay limited to Owner and Member.
14+
- Guest browser add/remove actions redirect to sign-in, and direct guest API writes return 401.
15+
- No invitation, permission, SQLite, tmp, mock-db-store, or new mock repository scope was added.
1416

1517
## Validation
16-
- PASS: `node --check` on changed JS/MJS files.
17-
- PASS: `git diff --check`.
18-
- PASS: `npx playwright test tests/playwright/tools/GameCrewFoundation.spec.mjs --workers=1 --reporter=line` (`3 passed`).
19-
20-
## Notes
21-
- Invitations, ownership transfer, and permission enforcement remain intentionally out of scope.
22-
- Guest member-change actions redirect to `account/sign-in.html`.
23-
- Product/runtime wording uses `API`; the only local-server mechanics are in test setup.
18+
- PASS - node --check assets/toolbox/game-crew/js/index.js
19+
- PASS - node --check src/dev-runtime/server/local-api-router.mjs
20+
- PASS - node --check tests/playwright/tools/GameCrewFoundation.spec.mjs
21+
- PASS - git diff --check (line-ending notices only)
22+
- PASS - npx playwright test tests/playwright/tools/GameCrewFoundation.spec.mjs --workers=1 --reporter=line (5 passed)
Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
# PR_26177_ALFA_059 Requirement Checklist
1+
# PR_26177_ALFA_059-game-crew-foundation Requirement Checklist
22

3-
| Requirement | Result | Notes |
4-
| --- | --- | --- |
5-
| Browser -> API -> Database architecture | PASS | Game Crew UI uses `createServerRepositoryClient("game-crew")`. |
6-
| Product/runtime wording says API | PASS | Game Crew page copy uses API wording. |
7-
| One API contract across environments | PASS | No environment-specific Game Crew product code path was added. |
8-
| Environment differences are config/.env only | PASS | Game Crew 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 are DB seed documentation only. |
12-
| Browser does not own product data | PASS | No browser storage product-data source was added. |
13-
| API/server owns authoritative keys | PASS | Game Crew repository creates ULID-shaped member keys. |
14-
| Audit fields | PASS | `project_members` rows include `createdAt`, `updatedAt`, `createdBy`, and `updatedBy`. |
15-
| Ownership references `users.key` | PASS | DDL references `users(key)` for member/audit user fields. |
16-
| Project owner/member display | PASS | Page renders Demo Game owner and active crew members. |
17-
| Add/remove placeholder behavior | PASS | Controls show planned-state guidance; no invitation or permission workflow was implemented. |
18-
| Guest save redirect | PASS | Guest add-member action redirects to `account/sign-in.html`. |
19-
| 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:44:40 UTC
4+
5+
- PASS - Game Crew is a human-testable tool, not a landing page.
6+
- PASS - Tool shows the current Game Hub game context and matches the status bar selected game.
7+
- PASS - Tool shows project owner and active member list.
8+
- PASS - Signed-in Creator can add a Member through the API/DB path.
9+
- PASS - Signed-in Creator can remove a Member through the API/DB path, and refresh/reload preserves removal.
10+
- PASS - Roles remain limited to Owner and Member; invitations and permissions are not implemented.
11+
- PASS - Guest add and remove actions redirect to account/sign-in.html in browser tests.
12+
- PASS - Guest add and remove API writes return 401.
13+
- PASS - project_members DDL uses users.key ownership/audit references.
14+
- PASS - No SQLite, tmp runtime dependency, JSON source of truth, mock-db-store expansion, or new mock repository file was added.
Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
# PR_26177_ALFA_059 Validation Lane
1+
# PR_26177_ALFA_059-game-crew-foundation Validation Lane
22

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

12-
## Result
13-
PASS
14-
15-
## Evidence
16-
- Playwright Game Crew lane: `3 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-crew/js/index.js
6+
- PASS - node --check src/dev-runtime/server/local-api-router.mjs
7+
- PASS - node --check tests/playwright/tools/GameCrewFoundation.spec.mjs
8+
- PASS - git diff --check (line-ending notices only)
9+
- PASS - npx playwright test tests/playwright/tools/GameCrewFoundation.spec.mjs --workers=1 --reporter=line (5 passed)
Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
A assets/toolbox/game-crew/js/index.js
2-
A docs_build/database/ddl/game-crew.sql
3-
A docs_build/database/dml/game-crew.sql
4-
A docs_build/database/game-crew/ddl.sql
5-
A docs_build/database/game-crew/dml.sql
6-
A docs_build/database/game-crew/seed.json
7-
A docs_build/database/seed/game-crew.json
8-
A docs_build/database/seed/guest/game-crew.json
9-
A docs_build/dev/reports/PR_26177_ALFA_059-game-crew-foundation_branch-validation.md
10-
A docs_build/dev/reports/PR_26177_ALFA_059-game-crew-foundation_manual-validation-notes.md
11-
A docs_build/dev/reports/PR_26177_ALFA_059-game-crew-foundation_report.md
12-
A docs_build/dev/reports/PR_26177_ALFA_059-game-crew-foundation_requirement-checklist.md
13-
A docs_build/dev/reports/PR_26177_ALFA_059-game-crew-foundation_validation-lane.md
14-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
15-
M docs_build/dev/reports/playwright_v8_coverage_report.txt
16-
M src/dev-runtime/persistence/mock-db-store.js
17-
A src/dev-runtime/persistence/tool-repositories/game-crew-mock-repository.js
18-
M src/dev-runtime/server/local-api-router.mjs
19-
A tests/playwright/tools/GameCrewFoundation.spec.mjs
20-
M toolbox/game-crew/index.html
21-
M docs_build/dev/reports/codex_changed_files.txt
22-
M docs_build/dev/reports/codex_review.diff
1+
assets/toolbox/game-crew/js/index.js
2+
docs_build/database/ddl/game-crew.sql
3+
docs_build/database/dml/game-crew.sql
4+
docs_build/database/seed/game-crew.json
5+
docs_build/database/seed/guest/game-crew.json
6+
docs_build/dev/reports/PR_26177_ALFA_059-game-crew-foundation_branch-validation.md
7+
docs_build/dev/reports/PR_26177_ALFA_059-game-crew-foundation_manual-validation-notes.md
8+
docs_build/dev/reports/PR_26177_ALFA_059-game-crew-foundation_report.md
9+
docs_build/dev/reports/PR_26177_ALFA_059-game-crew-foundation_requirement-checklist.md
10+
docs_build/dev/reports/PR_26177_ALFA_059-game-crew-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/server/local-api-router.mjs
16+
tests/playwright/tools/GameCrewFoundation.spec.mjs
17+
toolbox/game-crew/index.html

0 commit comments

Comments
 (0)