Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 26 additions & 27 deletions docs_build/dev/BUILD_PR.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,59 @@
# PR_26175_ALFA_005-game-hub-audit-findings-cleanup
# PR_26175_ALFA_006-game-hub-create-project-validation

## Purpose
Clean up the targeted Game Hub audit findings from `PR_26175_ALFA_004-game-hub-completion-status-audit`.
Add creator-facing validation for the Game Hub create-project row so blank game names do not silently create fallback projects.

## Source Of Truth
This `BUILD_PR.md` is the source of truth for `PR_26175_ALFA_005-game-hub-audit-findings-cleanup`.
This `BUILD_PR.md` is the source of truth for `PR_26175_ALFA_006-game-hub-create-project-validation`.

## Exact Scope
- Resolve the targeted Game Hub Playwright failures recorded by the ALFA_004 audit.
- Keep the cleanup focused on stale or over-broad test expectations unless product code is required by validation.
- Preserve the existing Game Hub table workflow behavior.
- Preserve the shared toolbox selected-game status bar behavior.
- Preserve Game Journey completion-metrics API/service behavior.
- Do not implement unrelated product or UI changes.

## ALFA_004 Findings To Clean Up
- `tests/playwright/tools/GameHubMockRepository.spec.mjs:238`: duplicate `Open Game Hub` link strict-mode conflict after the shared toolbox status bar added its own Game Hub action.
- `tests/playwright/tools/GameHubMockRepository.spec.mjs:257`: stale expectation that no `Game Status` label exists.
- `tests/playwright/tools/GameHubMockRepository.spec.mjs:582`: stale guest-mode expectation that no `Game Status` label exists.
- `tests/playwright/tools/GameHubMockRepository.spec.mjs:1019`: toolbox role-filter lane records known `500 /api/game-journey/completion-metrics` requests outside the Game Hub table workflow.
- Validate the Game Hub add-game row before calling the repository create method.
- Block signed-in creator saves when the game name is blank or whitespace-only.
- Keep the add-game row open after validation failure.
- Show a creator-safe validation message in the existing Game Hub status log.
- Mark the game name input invalid for accessibility.
- Preserve valid create/open/delete behavior.
- Preserve guest save redirect behavior.
- Preserve API/service/repository contracts.
- Add targeted Playwright coverage for the create validation path.

## Exact Targets
- `docs_build/dev/BUILD_PR.md`
- `toolbox/game-hub/game-hub.js`
- `tests/playwright/tools/GameHubMockRepository.spec.mjs`
- `docs_build/dev/reports/PR_26175_ALFA_005-game-hub-audit-findings-cleanup_report.md`
- `docs_build/dev/reports/PR_26175_ALFA_005-game-hub-audit-findings-cleanup_validation-lane.md`
- `docs_build/dev/reports/PR_26175_ALFA_005-game-hub-audit-findings-cleanup_requirements-checklist.md`
- `docs_build/dev/reports/PR_26175_ALFA_006-game-hub-create-project-validation_report.md`
- `docs_build/dev/reports/PR_26175_ALFA_006-game-hub-create-project-validation_validation-lane.md`
- `docs_build/dev/reports/PR_26175_ALFA_006-game-hub-create-project-validation_requirements-checklist.md`
- `docs_build/dev/reports/codex_review.diff`
- `docs_build/dev/reports/codex_changed_files.txt`

## Out Of Scope
- No Game Hub product or UI behavior changes unless targeted validation proves they are required.
- No Game Journey completion-metrics product/API/service changes.
- No API/service contract changes.
- No repository/API/service contract changes.
- No Game Journey completion-metrics changes.
- No shared toolbox status bar changes.
- No unrelated Game Hub workflow changes.
- No browser-owned product data as source of truth.
- No silent fallbacks.
- No silent create-name fallback in the Game Hub page flow.
- No inline styles, style blocks, or page-local CSS.
- No engine core changes.
- No `start_of_day` folder changes.

## Validation
Run:
Run targeted create-project validation:

```powershell
npx playwright test tests/playwright/tools/GameHubMockRepository.spec.mjs --workers=1
npx playwright test tests/playwright/tools/GameHubMockRepository.spec.mjs --workers=1 --grep "Game Hub creates, opens, and deletes mock games"
```

Also verify the changed source does not introduce inline styles or style blocks:
Also verify changed source does not introduce inline styles or style blocks:

```powershell
rg -n "<[s]tyle|[s]tyle=" tests/playwright/tools/GameHubMockRepository.spec.mjs docs_build/dev/BUILD_PR.md docs_build/dev/reports/PR_26175_ALFA_005-game-hub-audit-findings-cleanup_report.md docs_build/dev/reports/PR_26175_ALFA_005-game-hub-audit-findings-cleanup_validation-lane.md docs_build/dev/reports/PR_26175_ALFA_005-game-hub-audit-findings-cleanup_requirements-checklist.md
rg -n "<[s]tyle|[s]tyle=" toolbox/game-hub/game-hub.js tests/playwright/tools/GameHubMockRepository.spec.mjs docs_build/dev/BUILD_PR.md docs_build/dev/reports/PR_26175_ALFA_006-game-hub-create-project-validation_report.md docs_build/dev/reports/PR_26175_ALFA_006-game-hub-create-project-validation_validation-lane.md docs_build/dev/reports/PR_26175_ALFA_006-game-hub-create-project-validation_requirements-checklist.md
```

## Artifact
Create repo-structured delta ZIP:

```text
tmp/PR_26175_ALFA_005-game-hub-audit-findings-cleanup_delta.zip
tmp/PR_26175_ALFA_006-game-hub-create-project-validation_delta.zip
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# PR_26175_ALFA_006-game-hub-create-project-validation Report

## Overall Status
PASS

Game Hub now validates the add-game row before a signed-in creator can create a project with a blank or whitespace-only name. The fix stays in the Game Hub page boundary and preserves the repository/API/service contract.

## Evidence Matrix

| Requirement | Status | Evidence |
| --- | --- | --- |
| Replace BUILD source of truth with ALFA_006 | PASS | `docs_build/dev/BUILD_PR.md:1` identifies `PR_26175_ALFA_006-game-hub-create-project-validation`. |
| Validate create row before repository create | PASS | `saveAddedGame` calls `validateAddedGameFields` before `repository.createGame`: `toolbox/game-hub/game-hub.js:681`, `toolbox/game-hub/game-hub.js:703`, `toolbox/game-hub/game-hub.js:707`. |
| Block blank or whitespace-only names | PASS | Validation trims the name and returns before save when empty: `toolbox/game-hub/game-hub.js:684`, `toolbox/game-hub/game-hub.js:685`, `toolbox/game-hub/game-hub.js:691`. |
| Keep add row open and show creator-safe message | PASS | Validation does not re-render or call the repository on failure and writes `Enter a game name before saving.` to the existing status log: `toolbox/game-hub/game-hub.js:690`. |
| Mark invalid input accessibly | PASS | The add-game input is required and receives `aria-invalid`: `toolbox/game-hub/game-hub.js:445`, `toolbox/game-hub/game-hub.js:687`. |
| Preserve valid create/open/delete behavior | PASS | Existing create/open/delete test still creates `Launch Test Game`, opens it, edits it, creates an archive game, and deletes the open game: `tests/playwright/tools/GameHubMockRepository.spec.mjs:386`, `tests/playwright/tools/GameHubMockRepository.spec.mjs:425`. |
| Preserve guest save redirect behavior | PASS | `ensureProjectRecordsSaveAllowedForSave` still runs before validation, so guest save handling remains unchanged: `toolbox/game-hub/game-hub.js:700`. |
| Preserve API/service/repository contract | PASS | No API, service, or repository files changed. |
| No silent create-name fallback in page flow | PASS | Targeted test verifies blank and whitespace saves do not create `Untitled Game`: `tests/playwright/tools/GameHubMockRepository.spec.mjs:379`, `tests/playwright/tools/GameHubMockRepository.spec.mjs:384`. |

## Validation Summary
- PASS: `npx playwright test tests/playwright/tools/GameHubMockRepository.spec.mjs --workers=1 --grep "Game Hub creates, opens, and deletes mock games"` produced 1 passed, 0 failed.
- PASS: changed-source style scan found no inline style or style-block matches.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# PR_26175_ALFA_006-game-hub-create-project-validation Requirements Checklist

- PASS: BUILD_PR.md was replaced with ALFA_006 as the source of truth.
- PASS: Game Hub validates the add-game row before repository create.
- PASS: Blank creator saves are blocked.
- PASS: Whitespace-only creator saves are blocked.
- PASS: The add-game row stays open after validation failure.
- PASS: A creator-safe validation message appears in the existing Game Hub status log.
- PASS: The game name input is marked invalid for accessibility.
- PASS: Valid create/open/delete behavior is preserved.
- PASS: Guest save redirect behavior is preserved.
- PASS: API/service/repository contracts are preserved.
- PASS: No browser-owned product data is used as source of truth.
- PASS: No silent create-name fallback remains in the Game Hub page flow.
- PASS: No inline styles, style blocks, or page-local CSS were added.
- PASS: Targeted Playwright validation passed.
- PASS: Required reports were created.
- PASS: Repo-structured delta ZIP was created.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# PR_26175_ALFA_006-game-hub-create-project-validation Validation Lane

## Commands
```powershell
npx playwright test tests/playwright/tools/GameHubMockRepository.spec.mjs --workers=1 --grep "Game Hub creates, opens, and deletes mock games"
```

Result: PASS, 1 passed and 0 failed.

```powershell
rg -n "<[s]tyle|[s]tyle=" toolbox/game-hub/game-hub.js tests/playwright/tools/GameHubMockRepository.spec.mjs docs_build/dev/BUILD_PR.md docs_build/dev/reports/PR_26175_ALFA_006-game-hub-create-project-validation_report.md docs_build/dev/reports/PR_26175_ALFA_006-game-hub-create-project-validation_validation-lane.md docs_build/dev/reports/PR_26175_ALFA_006-game-hub-create-project-validation_requirements-checklist.md
```

Result: PASS, no matches.

## Notes
- The targeted lane verifies blank-name validation, whitespace-name validation, valid create/open/delete behavior, and existing Game Hub table behavior in the create workflow.
- No product data source, API, service, or repository contract changes were made.
7 changes: 4 additions & 3 deletions docs_build/dev/reports/codex_changed_files.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
docs_build/dev/BUILD_PR.md
toolbox/game-hub/game-hub.js
tests/playwright/tools/GameHubMockRepository.spec.mjs
docs_build/dev/reports/PR_26175_ALFA_005-game-hub-audit-findings-cleanup_report.md
docs_build/dev/reports/PR_26175_ALFA_005-game-hub-audit-findings-cleanup_validation-lane.md
docs_build/dev/reports/PR_26175_ALFA_005-game-hub-audit-findings-cleanup_requirements-checklist.md
docs_build/dev/reports/PR_26175_ALFA_006-game-hub-create-project-validation_report.md
docs_build/dev/reports/PR_26175_ALFA_006-game-hub-create-project-validation_validation-lane.md
docs_build/dev/reports/PR_26175_ALFA_006-game-hub-create-project-validation_requirements-checklist.md
docs_build/dev/reports/codex_changed_files.txt
docs_build/dev/reports/codex_review.diff
Loading
Loading