Skip to content

Commit b94cf52

Browse files
author
Delta Team
committed
Merge remote-tracking branch 'origin/main' into pr/26175-CHARLIE-008-system-health-current-database-health
2 parents 2603aeb + 0e25639 commit b94cf52

20 files changed

Lines changed: 1435 additions & 179 deletions

assets/toolbox/idea-board/js/index.js

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ function previousStatusForRestore(record) {
129129
: "Refining";
130130
}
131131

132+
function isEditableStatus(status) {
133+
return editableStatusOptions.includes(status);
134+
}
135+
132136
function rememberPreviousStatus(record) {
133137
if (record.status !== "Archived") {
134138
record.previousStatus = record.status;
@@ -433,10 +437,11 @@ function ideaIdFromText(text) {
433437
}
434438

435439
function saveIdeaRow(root, row) {
440+
if (!requireAuthenticatedWrite(root)) return;
436441
const idea = row.querySelector("[data-idea-board-idea-input]")?.value.trim();
437442
const pitch = row.querySelector("[data-idea-board-pitch-input]")?.value.trim();
438443
const status = row.querySelector("[data-idea-board-idea-status-input]")?.value;
439-
if (!idea || !pitch || !status) {
444+
if (!idea || !pitch || !isEditableStatus(status)) {
440445
updateStatus(root, "Enter an idea, pitch, and status before saving.");
441446
return;
442447
}
@@ -475,6 +480,7 @@ function saveIdeaRow(root, row) {
475480
}
476481

477482
function saveNoteRow(root, row) {
483+
if (!requireAuthenticatedWrite(root)) return;
478484
const ideaId = row.dataset.ideaId;
479485
const idea = ideaRecord(ideaId);
480486
if (idea && isLockedIdea(idea)) {
@@ -529,6 +535,7 @@ function toggleNotes(root, ideaId) {
529535
}
530536

531537
function deleteIdea(root, ideaId) {
538+
if (!requireAuthenticatedWrite(root)) return;
532539
const index = ideaTable.findIndex((record) => record.ideaId === ideaId);
533540
if (index < 0) {
534541
updateStatus(root, "Idea Board could not delete that idea.");
@@ -584,6 +591,20 @@ function currentSessionState() {
584591
}
585592
}
586593

594+
function requireAuthenticatedWrite(root) {
595+
const sessionState = currentSessionState();
596+
if (!sessionState.apiAvailable) {
597+
updateStatus(root, "API session status could not be verified. Try again shortly.");
598+
return false;
599+
}
600+
if (!sessionState.authenticated) {
601+
updateStatus(root, "Sign in before saving Idea Board changes.");
602+
window.location.href = signInUrl();
603+
return false;
604+
}
605+
return true;
606+
}
607+
587608
function createProject(root, ideaId) {
588609
const record = ideaRecord(ideaId);
589610
if (!record) {
@@ -594,16 +615,7 @@ function createProject(root, ideaId) {
594615
updateStatus(root, "Set this idea to Ready before creating a project.");
595616
return;
596617
}
597-
const sessionState = currentSessionState();
598-
if (!sessionState.apiAvailable) {
599-
updateStatus(root, "Sign-in status could not be verified. Try again shortly.");
600-
return;
601-
}
602-
if (!sessionState.authenticated) {
603-
updateStatus(root, "Sign in to create a Game Hub project.");
604-
window.location.href = signInUrl();
605-
return;
606-
}
618+
if (!requireAuthenticatedWrite(root)) return;
607619
const repository = gameHubProjectRepository();
608620
const project = repository.createGame({
609621
name: record.idea,
@@ -634,6 +646,7 @@ function archiveIdea(root, ideaId) {
634646
updateStatus(root, "Idea Board could not archive that idea.");
635647
return;
636648
}
649+
if (!requireAuthenticatedWrite(root)) return;
637650
if (record.status !== "Archived") record.previousStatus = record.status;
638651
record.status = "Archived";
639652
record.updated = today();
@@ -653,6 +666,7 @@ function restoreIdea(root, ideaId) {
653666
updateStatus(root, "Idea Board could not restore that idea.");
654667
return;
655668
}
669+
if (!requireAuthenticatedWrite(root)) return;
656670
record.status = previousStatusForRestore(record);
657671
record.previousStatus = record.status;
658672
record.updated = today();
@@ -738,6 +752,7 @@ function handleNoteAction(root, actionControl) {
738752
updateStatus(root, "Editing note.");
739753
render(root);
740754
} else if (action === "delete") {
755+
if (!requireAuthenticatedWrite(root)) return;
741756
const index = noteTable.findIndex((note) => note.noteId === noteId && note.ideaId === ideaId && !note.system);
742757
if (index >= 0) {
743758
noteTable.splice(index, 1);
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# PR_26175_ALFA_015 - Alfa Foundation Consolidation
2+
3+
Branch: `PR_26175_ALFA_015-alfa-foundation-consolidation`
4+
Team: Alfa
5+
Source PRs represented: #96, #97, #98, #99, #100, #101
6+
Playwright impacted: YES
7+
8+
## Executive Summary
9+
10+
This PR carries forward a concrete runtime consolidation from the Alfa foundation stack onto current `main`.
11+
12+
Current `main` already contains the broad Game Hub, Game Journey, and Idea Board foundation behavior from the #96-#101 chain. Instead of recreating stale branch conflicts or producing another report-only PR, this branch fixes a remaining Game Journey repository issue in that foundation layer:
13+
14+
- Recommended target records now calculate their insertion order from the resolved bucket note, not the legacy default design-pass note.
15+
- The Game Journey Playwright coverage now asserts that the persisted Hero recommended target belongs to the Objects bucket with the expected bucket-local order.
16+
17+
## Runtime Files Changed
18+
19+
| File | Change |
20+
| --- | --- |
21+
| `src/dev-runtime/persistence/tool-repositories/game-journey-mock-repository.js` | Updates recommended target item ordering to use the resolved Game Journey bucket note key. |
22+
23+
## Tests Updated
24+
25+
| File | Change |
26+
| --- | --- |
27+
| `tests/playwright/tools/GameJourneyTool.spec.mjs` | Adds regression assertions for persisted recommended target `gameKey` and bucket-local `order`. |
28+
29+
## Reports Generated
30+
31+
| File | Purpose |
32+
| --- | --- |
33+
| `docs_build/dev/reports/PR_26175_ALFA_015-alfa-foundation-consolidation.md` | This implementation and validation report. |
34+
| `docs_build/dev/reports/codex_changed_files.txt` | Changed file inventory for the PR. |
35+
| `docs_build/dev/reports/codex_review.diff` | Review diff for the PR. |
36+
| `tmp/PR_26175_ALFA_015-alfa-foundation-consolidation_delta.zip` | Repo-structured delta ZIP. |
37+
38+
## Branch Validation
39+
40+
| Check | Result | Notes |
41+
| --- | --- | --- |
42+
| Started from `main` | PASS | `main` confirmed before branch creation. |
43+
| Worktree clean before branch | PASS | No local changes before branch creation. |
44+
| `main` and `origin/main` synced | PASS | Local/origin sync confirmed as `0 0`. |
45+
| `git pull --ff-only` before branch | PASS | Already up to date. |
46+
| Runtime scope only | PASS | Runtime change is limited to Game Journey mock repository behavior. |
47+
| No unrelated cleanup | PASS | Generated validation coverage noise was restored after the blocked Playwright run. |
48+
49+
## Requirement Checklist
50+
51+
| Requirement | Result | Notes |
52+
| --- | --- | --- |
53+
| Read all Project Instructions | PASS | Active files and archived history markers were read before implementation. |
54+
| Implement actual runtime changes from #96-#101 foundation scope | PASS | Corrects Game Journey recommended target ordering in the foundation repository layer. |
55+
| Do not create report-only PR | PASS | Includes runtime and test changes. |
56+
| Carry forward real code changes onto current `main` | PASS | Applies a current-main consolidation fix rather than stale branch artifacts. |
57+
| Runtime files changed | PASS | `game-journey-mock-repository.js` changed. |
58+
| Tests updated | PASS | `GameJourneyTool.spec.mjs` changed. |
59+
| Reports generated | PASS | Required report files are included. |
60+
| Playwright impacted | PASS | Marked as impacted and targeted lane invoked. |
61+
| Run targeted tests only | PASS | Only the requested targeted Playwright specs were invoked. |
62+
| Create repo-structured ZIP under `tmp/` | PASS | ZIP generated at the required path. |
63+
| Do not delete branches | PASS | No branch deletion performed. |
64+
| Do not merge GitHub PRs directly | PASS | No source PRs were merged directly. |
65+
66+
## Validation Lane Report
67+
68+
| Validation | Result | Command / Notes |
69+
| --- | --- | --- |
70+
| Direct repository smoke | PASS | Inline Node smoke verified Hero target persists to the Objects bucket with `order: 2`. |
71+
| Diff whitespace check | PASS | `git diff --check` returned no whitespace errors; Git reported an existing CRLF warning for the touched spec. |
72+
| Playwright browser install | FAIL | `npx playwright install chromium` timed out after 600 seconds and did not install `chromium-1217`. |
73+
| Targeted Playwright lane | BLOCKED | `npx playwright test tests/playwright/tools/IdeaBoardTableNotes.spec.mjs tests/playwright/tools/GameJourneyTool.spec.mjs tests/playwright/tools/GameHubMockRepository.spec.mjs --reporter=line` failed all 37 tests before launch because `C:\Users\davidq\AppData\Local\ms-playwright\chromium-1217\chrome-win64\chrome.exe` is missing. |
74+
75+
## Manual Validation Notes
76+
77+
- Manual browser validation was not performed because the local Playwright Chromium executable is missing.
78+
- The direct repository smoke covers the changed persistence behavior without browser startup.
79+
- The requested Playwright specs were invoked and failed before executing product behavior due to the missing browser dependency.
80+
- No runtime code outside the Alfa Game Journey foundation path was modified.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# PR_26175_ALFA_016 - Alfa Parent Child Table Consolidation
2+
3+
Branch: `PR_26175_ALFA_016-alfa-parent-child-table-consolidation`
4+
Team: Alfa
5+
Source PRs represented: #103, #104, #105
6+
Playwright impacted: YES
7+
8+
## Executive Summary
9+
10+
This PR consolidates the remaining current-main-safe Game Hub parent/child table runtime work from PRs #103, #104, and #105.
11+
12+
Current `main` already contained the Source Idea and Readiness Output child table behavior from the earlier stack. This branch preserves those current-main implementations and adds the remaining parent/child layout pieces:
13+
14+
- marks the Games table as the Open Games parent table,
15+
- adds an Open Games table caption,
16+
- adds a Game Summary child table under expanded game rows,
17+
- keeps Source Idea as a separate child table when source idea details exist,
18+
- keeps Readiness Output as a separate child table.
19+
20+
No status bar files were modified.
21+
22+
## Runtime Files Changed
23+
24+
| File | Change |
25+
| --- | --- |
26+
| `toolbox/game-hub/game-hub.js` | Adds Open Games parent-table identity/caption and a Game Summary child table. Preserves Source Idea and Readiness Output as separate child tables. |
27+
28+
No `toolbox/game-hub/index.html` or `assets/theme-v2/css/tables.css` change was required.
29+
30+
## Tests Updated
31+
32+
| File | Change |
33+
| --- | --- |
34+
| `tests/playwright/tools/GameHubMockRepository.spec.mjs` | Updates Game Hub table assertions for Open Games parent-table identity, Game Summary child table, Source Idea child table, and Readiness Output child table. |
35+
| `tests/playwright/tools/IdeaBoardTableNotes.spec.mjs` | Updates the Idea Board to Game Hub flow assertions for the expanded Game Hub child table sequence. |
36+
37+
## Reports Generated
38+
39+
| File | Purpose |
40+
| --- | --- |
41+
| `docs_build/dev/reports/PR_26175_ALFA_016-alfa-parent-child-table-consolidation.md` | This implementation and validation report. |
42+
| `docs_build/dev/reports/codex_changed_files.txt` | Changed file inventory. |
43+
| `docs_build/dev/reports/codex_review.diff` | Review diff. |
44+
| `tmp/PR_26175_ALFA_016-alfa-parent-child-table-consolidation_delta.zip` | Repo-structured delta ZIP. |
45+
46+
## Branch Validation
47+
48+
| Check | Result | Notes |
49+
| --- | --- | --- |
50+
| Started from `main` | PASS | `main` confirmed before branch creation. |
51+
| Pulled latest `origin/main` | PASS | `git pull --ff-only` fast-forwarded before branch creation. |
52+
| Worktree clean before branch | PASS | No local changes before branch creation. |
53+
| Local/origin sync before branch | PASS | Sync confirmed as `0 0`. |
54+
| Scope limited to Alfa Game Hub parent/child tables | PASS | Runtime change is limited to Game Hub table rendering. |
55+
| Status bar untouched | PASS | No diff in status bar JS/CSS/tests. |
56+
57+
## Requirement Checklist
58+
59+
| Requirement | Result | Notes |
60+
| --- | --- | --- |
61+
| Read all Project Instructions | PASS | Active Project Instructions and history snapshots were read. |
62+
| Implement remaining current-main-safe runtime changes from #103, #104, #105 | PASS | Added the remaining parent table identity and Game Summary child table while preserving current Source Idea and Readiness Output behavior. |
63+
| Focus on Game Hub parent/child table layout | PASS | Open Games is now explicitly marked/captioned as the parent table. |
64+
| Focus on Source Idea child table | PASS | Source Idea remains a dedicated child table for source-linked games. |
65+
| Focus on Readiness Output child table | PASS | Readiness Output remains a dedicated child table. |
66+
| Do not create report-only PR | PASS | Runtime and test files changed. |
67+
| Do not change status bar work | PASS | Status bar files have no diff. |
68+
| Do not install Chromium | PASS | Chromium install was not attempted. |
69+
| If Playwright browser is missing, document blocked and continue | PASS | Chromium is missing and Playwright validation is documented as blocked. |
70+
| Required reports and ZIP | PASS | Required reports are included and ZIP was created under `tmp/`. |
71+
72+
## Validation Lane Report
73+
74+
| Validation | Result | Command / Notes |
75+
| --- | --- | --- |
76+
| Runtime syntax check | PASS | `node --check toolbox/game-hub/game-hub.js` |
77+
| Game Hub spec syntax check | PASS | `node --check tests/playwright/tools/GameHubMockRepository.spec.mjs` |
78+
| Idea Board spec syntax check | PASS | `node --check tests/playwright/tools/IdeaBoardTableNotes.spec.mjs` |
79+
| Diff whitespace check | PASS | `git diff --check`; Git reported line-ending warnings only for touched specs. |
80+
| Inline style guard | PASS | `rg -n "<[s]tyle|[s]tyle=" toolbox/game-hub/game-hub.js toolbox/game-hub/index.html tests/playwright/tools/GameHubMockRepository.spec.mjs tests/playwright/tools/IdeaBoardTableNotes.spec.mjs assets/theme-v2/css/tables.css` returned no matches. |
81+
| Status bar scope check | PASS | `git diff -- assets/theme-v2/css/status.css assets/theme-v2/js/toolbox-status-bar.js tests/playwright/tools/ToolboxSelectedGameStatusBar.spec.mjs` returned no diff. |
82+
| Playwright targeted browser lane | BLOCKED | Local Chromium is missing at `C:\Users\davidq\AppData\Local\ms-playwright\chromium-1217\chrome-win64\chrome.exe`. Per instruction, Chromium was not installed. |
83+
84+
## Manual Validation Notes
85+
86+
- Manual browser validation was not performed because Playwright Chromium is missing locally.
87+
- Current-main Source Idea behavior was preserved: source-linked games render Source Idea as a child table; games without source details do not show an empty Source Idea child table.
88+
- Readiness Output remains separate from Source Idea.
89+
- The Game Summary child table intentionally includes Project, Purpose, and Status only to preserve the current simplified Game Hub table model and avoid reintroducing owner/role columns.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# PR_26175_ALFA_017 - Alfa Game Hub Interactions Consolidation
2+
3+
## Executive Summary
4+
5+
PASS - Consolidated the current-main-safe Batch C Game Hub interaction behavior from GitHub PRs #107 through #113.
6+
7+
This PR carries forward the remaining runtime-safe Game Hub child-row behavior: every expanded game parent row now exposes the same two child rows, Source Idea first and Readiness Output second, even when the game does not yet have source idea details. Existing current-main behavior for selected-game button state, guest save redirects, table-row add/edit flows, and removed standalone panels was preserved.
8+
9+
## Runtime Files Changed
10+
11+
| File | Change |
12+
| --- | --- |
13+
| `toolbox/game-hub/game-hub.js` | Always renders Source Idea and Readiness Output child rows for expanded game rows; aligns `aria-controls` with both child row IDs. |
14+
| `tests/playwright/tools/GameHubMockRepository.spec.mjs` | Updates focused Game Hub expectations for ordinary games to require the stable two-child-row structure and Source Idea fallback content. |
15+
16+
## Source PR Coverage
17+
18+
| Source PR | Batch C Area | Current-Main Resolution |
19+
| --- | --- | --- |
20+
| #107 | Game row child rows | Carried forward the stable Source Idea + Readiness Output child-row contract. |
21+
| #108 | Parent table centered in main panel / columns | Already present on current main without reintroducing obsolete Owner/Role/Next Tool columns. |
22+
| #109 | Actions/setup cleanup | Already present; Open Game Journey and Game Setup controls remain absent. |
23+
| #110 | Row add/edit selected state | Already present; add/edit rows remain table-native. |
24+
| #111 | Guest save redirect | Already present; save actions continue redirecting guests to `account/sign-in.html`. |
25+
| #112 | Selected-game button state | Already present; row/cell selected markers remain absent. |
26+
| #113 | Selected button and Game Crew label cleanup | Selected button styling already present; Game Crew label is no longer relevant on current main. |
27+
28+
## Requirement Checklist
29+
30+
| Requirement | Status | Notes |
31+
| --- | --- | --- |
32+
| Start from `main` | PASS | Initial gate passed before branch creation. |
33+
| Hard stop if branch/worktree/sync invalid | PASS | `main`, clean worktree, local/origin sync `0 0` confirmed before branch creation. |
34+
| Read all Project Instructions | PASS | Active Project Instructions and history snapshots were reviewed before edits. |
35+
| Implement current-main-safe Batch C runtime changes | PASS | Implemented the remaining stable Source Idea + Readiness Output child-row behavior. |
36+
| Do not create report-only PR | PASS | Runtime and Playwright test files changed. |
37+
| Do not change status bar work | PASS | Status bar diff check was empty. |
38+
| Do not reintroduce removed standalone panels | PASS | No panel markup was restored. |
39+
| Do not use browser-owned product data as source of truth | PASS | Change uses existing repository/API-driven Game Hub state only. |
40+
| Do not install Chromium | PASS | Chromium was not installed. |
41+
| Required reports created | PASS | `codex_review.diff`, `codex_changed_files.txt`, and this report are included. |
42+
| Repo-structured ZIP under `tmp/` | PASS | ZIP created after report generation. |
43+
44+
## Validation Lane
45+
46+
| Command | Status | Result |
47+
| --- | --- | --- |
48+
| `node --check toolbox/game-hub/game-hub.js` | PASS | JavaScript syntax valid. |
49+
| `node --check tests/playwright/tools/GameHubMockRepository.spec.mjs` | PASS | Test file syntax valid. |
50+
| `node --check tests/playwright/tools/IdeaBoardTableNotes.spec.mjs` | PASS | Targeted adjacent test syntax valid. |
51+
| `node --check tests/playwright/tools/GameJourneyTool.spec.mjs` | PASS | Targeted adjacent test syntax valid. |
52+
| `git diff --check -- toolbox/game-hub/game-hub.js tests/playwright/tools/GameHubMockRepository.spec.mjs` | PASS | Exit code 0; Git emitted a non-blocking CRLF working-copy warning for the test file. |
53+
| `git diff -- assets/theme-v2/css/status.css assets/theme-v2/js/toolbox-status-bar.js tests/playwright/tools/ToolboxSelectedGameStatusBar.spec.mjs` | PASS | Empty diff; status bar work untouched. |
54+
| `npx playwright test tests/playwright/tools/IdeaBoardTableNotes.spec.mjs tests/playwright/tools/GameJourneyTool.spec.mjs tests/playwright/tools/GameHubMockRepository.spec.mjs` | BLOCKED | Timed out with no diagnostics before the narrower browser check. |
55+
| `npx playwright test tests/playwright/tools/GameHubMockRepository.spec.mjs -g "Game Hub creates, opens, and deletes mock games|Game Hub validates game parent rows and child tables|Game Hub readiness child rows update from mock game state" --workers=1 --reporter=line --timeout=30000` | BLOCKED | Browser executable missing at `C:\Users\davidq\AppData\Local\ms-playwright\chromium-1217\chrome-win64\chrome.exe`. Chromium was not installed per instruction. |
56+
57+
## Manual Validation Notes
58+
59+
- Reviewed source PR metadata and file patches for #107, #108, #109, #110, #111, #112, and #113.
60+
- Compared the final Batch C branch state against current main and preserved current-main additions, including selected-game change notifications and required Add Game validation.
61+
- Confirmed the implementation does not modify `toolbox-status-bar.js`, `status.css`, or `ToolboxSelectedGameStatusBar.spec.mjs`.
62+
- Confirmed no runtime JSON contract changes and no browser-owned product data source was introduced.
63+
- Browser validation remains blocked until the local Playwright Chromium executable is available.
64+
65+
## Branch Validation
66+
67+
PASS - Work began from clean, synced `main`; implementation was made on `PR_26175_ALFA_017-alfa-game-hub-interactions-consolidation`.

0 commit comments

Comments
 (0)