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
18 changes: 18 additions & 0 deletions admin/system-health.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ <h2>Admin</h2>
<p>Local API Startup</p>
<p>Database Health</p>
<p>Storage Health</p>
<p>Health Check History</p>
<p>Runtime Environment</p>
<p>Limits &amp; Capacity</p>
<p>Diagnostics Plan</p>
Expand Down Expand Up @@ -152,6 +153,23 @@ <h2 id="admin-system-health-title">System Health Tables</h2>
</tbody>
</table>
</div>
<div class="table-wrapper">
<table class="data-table" aria-label="Health check history">
<caption>Health Check History</caption>
<thead>
<tr>
<th scope="col">Time</th>
<th scope="col">Environment</th>
<th scope="col">Area</th>
<th scope="col">Result</th>
<th scope="col">Summary</th>
</tr>
</thead>
<tbody data-admin-system-health-history-rows>
<tr><td>Loading</td><td>Loading</td><td>Current environment</td><td data-health-status="PENDING" title="Reason: health check history has not loaded yet." aria-label="PENDING: health check history has not loaded yet.">PENDING</td><td>Waiting for safe API status.</td></tr>
</tbody>
</table>
</div>
<div class="table-wrapper">
<table class="data-table" aria-label="Runtime environment">
<caption>Runtime Environment - Alphabetical Variables</caption>
Expand Down
42 changes: 42 additions & 0 deletions assets/theme-v2/js/admin-system-health.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class AdminSystemHealthController {
node.dataset.adminSystemHealthStorageStatus,
node,
]));
this.historyRows = root.querySelector("[data-admin-system-health-history-rows]");
this.startupRows = root.querySelector("[data-admin-system-health-startup-rows]");
this.runtimeRows = root.querySelector("[data-admin-system-health-runtime-rows]");
}
Expand Down Expand Up @@ -107,6 +108,7 @@ class AdminSystemHealthController {
});
this.renderStartupPending(reason);
this.renderStoragePending(reason);
this.renderHistoryPending(reason);
}

renderEnvironmentIdentity(environmentIdentity = {}) {
Expand Down Expand Up @@ -222,6 +224,45 @@ class AdminSystemHealthController {
}
}

renderHistoryPending(reason) {
if (!this.historyRows) {
return;
}
const row = document.createElement("tr");
row.append(
this.createCell("not available"),
this.createCell("current environment"),
this.createCell("Health Check History"),
this.createStatusCell("PENDING", reason),
this.createCell("Safe health check history is not available."),
);
this.historyRows.replaceChildren(row);
}

renderHealthCheckHistory(historyRows = []) {
if (!this.historyRows) {
return;
}
const rows = Array.isArray(historyRows) ? historyRows : [];
if (!rows.length) {
this.renderHistoryPending("Safe Admin System Health API returned no current-environment health check history rows.");
return;
}
const fragment = document.createDocumentFragment();
rows.forEach((historyRow) => {
const row = document.createElement("tr");
row.append(
this.createCell(historyRow.checkedAt),
this.createCell(historyRow.environmentName),
this.createCell(historyRow.area),
this.createStatusCell(historyRow.result || historyRow.status, historyRow.summary),
this.createCell(historyRow.summary),
);
fragment.append(row);
});
this.historyRows.replaceChildren(fragment);
}

runStorageDiagnostics() {
STORAGE_DIAGNOSTIC_ACTIONS.forEach(({ key }) => {
this.setStorageStatus(key, "PENDING", "R2 diagnostic is running through the safe Admin System Health API.");
Expand Down Expand Up @@ -302,6 +343,7 @@ class AdminSystemHealthController {
this.renderStartupDiagnostics(data?.localApiStartup || {});
this.renderStorageStatus(data?.storageStatus || {});
this.runStorageDiagnostics();
this.renderHealthCheckHistory(data?.healthCheckHistory || []);
this.renderRuntimeEnvironment(data?.runtimeEnvironment || {});
} catch (error) {
const message = error instanceof Error ? error.message : "Safe Admin System Health API is unavailable.";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# PR_26175_CHARLIE_010 System Health History and Closeout

## Scope

Team: Charlie

Purpose: Add current-environment Health Check History and close out the System Health stacked expansion chain.

## Chain

- `PR_26175_CHARLIE_006-project-instructions-system-health-infrastructure`
- Branch: `PR_26175_CHARLIE_006-project-instructions-system-health-infrastructure`
- Commit: `c870b812faded383094fb13fc60ae9cfc7f14889`
- Result: pushed to origin, not merged.
- `PR_26175_CHARLIE_007-system-health-environment-identity`
- Branch: `pr/26175-CHARLIE-007-system-health-environment-identity`
- Commit: `6556e73efcd8ae13b51b56288416c88688e67634`
- Draft PR: https://github.com/ToolboxAid/HTML-JavaScript-Gaming/pull/151
- `PR_26175_CHARLIE_008-system-health-current-database-health`
- Branch: `pr/26175-CHARLIE-008-system-health-current-database-health`
- Commit: `2603aeb6e5a7ccca516051953cbd70a5a6c94c4b`
- Draft PR: https://github.com/ToolboxAid/HTML-JavaScript-Gaming/pull/152
- `PR_26175_CHARLIE_009-system-health-current-r2-health`
- Branch: `pr/26175-CHARLIE-009-system-health-current-r2-health`
- Commit: `9740705fbe73dffd43744ab66338f8e4a925eed4`
- Draft PR: https://github.com/ToolboxAid/HTML-JavaScript-Gaming/pull/153
- `PR_26175_CHARLIE_010-system-health-history-and-closeout`
- Branch: `pr/26175-CHARLIE-010-system-health-history-and-closeout`
- Commit and draft PR URL are assigned after this report is committed and pushed.

## Changes

- Added Health Check History to the Admin System Health page.
- Health Check History is derived from the current deployment only:
- Environment Summary
- Database Health
- Storage Health
- Runtime Health
- Warning and failure rows are generated only from current-environment health rows.
- Creator sessions remain blocked from Admin System Health and do not trigger status or storage health requests.

## Governance

- PASS: System Health is one page per deployed environment.
- PASS: Each deployment actively checks only itself.
- PASS: The Environment Map remains a static reference for Local, DEV, IST, UAT, and PRD.
- PASS: System Health does not actively check peer databases or peer R2 folders.
- PASS: Cancelled initiatives remain not doing:
- Environment Isolation & Developer Experience
- multi-port workspace framework
- Alpha/Beta/User runtime separation
- runtime port management initiative

## Validation

- PASS: `node --check src/dev-runtime/server/local-api-router.mjs`
- PASS: `node --check assets/theme-v2/js/admin-system-health.js`
- PASS: `git diff --check`
- PASS: `node --test tests/dev-runtime/AdminHealthOperations.test.mjs`
- PASS: `node --test tests/dev-runtime/PublicEnvironmentConfig.test.mjs`
- PASS: `npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1 --reporter=line`

## Artifacts

- `tmp/PR_26175_CHARLIE_007-system-health-environment-identity_delta.zip`
- `tmp/PR_26175_CHARLIE_008-system-health-current-database-health_delta.zip`
- `tmp/PR_26175_CHARLIE_009-system-health-current-r2-health_delta.zip`
- `tmp/PR_26175_CHARLIE_010-system-health-history-and-closeout_delta.zip`
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# PR_26175_CHARLIE_011 Branch Validation

## Start Gate

- PASS: Current branch was `pr/26175-CHARLIE-010-system-health-history-and-closeout`.
- PASS: Worktree was clean before implementation.
- PASS: Build remained on the current Charlie continuation branch.
- PASS: No rebase was performed.
- PASS: No new root branch was created.

## Final Branch Target

- Branch to push: `pr/26175-CHARLIE-010-system-health-history-and-closeout`
- Expected draft PR to update: https://github.com/ToolboxAid/HTML-JavaScript-Gaming/pull/155
- Merge status: no merge requested or performed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# PR_26175_CHARLIE_011 Manual Validation Notes

## Admin Submenu Order

Visible labels after the change:

`Admin Tools`, `Analytics`, `Controls`, `Creators`, `DB Viewer`, `Environments`, `Game Migration`, `Infrastructure`, `Invites`, `Moderation`, `Operations`, `Platform Settings`, `Ratings`, `Responsibilities`, `Site Setup`, `System Health`, `Tool Votes`

## Route Preservation

The only source navigation reorder moved this existing item:

- `Creators`
- path remained `admin/users.html`
- route remained `admin-users`
- label remained `Creators`

All other Admin navigation objects remained unchanged.

## Open-Page Check

The targeted Playwright navigation test collected every active Admin submenu href from the rendered submenu and requested each page through the local test server. Every response returned a status below HTTP 400.

## Duplicate Check

The targeted Playwright navigation test checks for duplicate rendered labels and duplicate active hrefs. The targeted unit script also checks duplicate labels and existing active paths.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# PR_26175_CHARLIE_011 Requirement Checklist

## Branch Rules

- PASS: Continued on `pr/26175-CHARLIE-010-system-health-history-and-closeout`.
- PASS: Did not return to `main`.
- PASS: Did not rebase.
- PASS: Did not create a new root branch.
- PASS: Hard stop conditions were checked before implementation.

## Objective

- PASS: Admin submenu entries are alphabetized by displayed text.

## Scope

- PASS: Located Admin submenu definition in `src/api/admin-owner-navigation.js`.
- PASS: Sorted submenu entries by displayed text.
- PASS: Preserved routes, URLs, IDs, CSS classes, Theme V2 styling, and existing renderer behavior.
- PASS: Did not rename pages.
- PASS: Did not rename folders.
- PASS: Did not modify page content.
- PASS: No unrelated cleanup.

## Validation

- PASS: Verified submenu labels are alphabetical.
- PASS: Verified every Admin page path exists and every Admin submenu href opens below HTTP 400 in targeted Playwright.
- PASS: Verified no duplicate labels or hrefs.
- PASS: Ran affected Playwright navigation tests.
- PASS: Ran affected targeted unit tests.

## Artifacts

- PASS: `docs_build/dev/reports/codex_review.diff`
- PASS: `docs_build/dev/reports/codex_changed_files.txt`
- PASS: `docs_build/dev/reports/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order.md`
- PASS: validation report
- PASS: branch validation report
- PASS: requirement checklist
- PASS: manual validation notes
- PASS: repository ZIP under `tmp/`
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# PR_26175_CHARLIE_011 Validation Report

## Commands

- PASS: `node --check src/api/admin-owner-navigation.js`
- PASS: `node --input-type=module` alphabetical/duplicate/path verification script
- Result: `PASS labels=17 active=16`
- Order: `Admin Tools | Analytics | Controls | Creators | DB Viewer | Environments | Game Migration | Infrastructure | Invites | Moderation | Operations | Platform Settings | Ratings | Responsibilities | Site Setup | System Health | Tool Votes`
- PASS: `git diff --check`
- Result: no whitespace errors; CRLF conversion warnings only.
- PASS: `node --test tests/dev-runtime/ApiMenuPathCleanup.test.mjs`
- Result: 6 passed.
- PASS: `node --test --test-name-pattern "Admin and Owner navigation are shared" tests/dev-runtime/ArchitectureCleanupApiNavInvitations.test.mjs`
- Result: 1 passed.
- PASS: `npx playwright test tests/playwright/tools/AdminOwnerNavigationBoundary.spec.mjs --workers=1 --reporter=line`
- Result: 4 passed.
- PASS: `npx playwright test tests/playwright/tools/AdminInvitationsNavPage.spec.mjs --workers=1 --reporter=line`
- Result: 3 passed.

## Note

A non-targeted full-file run of `tests/dev-runtime/ArchitectureCleanupApiNavInvitations.test.mjs` was not used for final validation because its first non-navigation test fails on a pre-existing missing `src/engine/api` directory assertion. The affected navigation subtest passed by name.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# PR_26175_CHARLIE_011 Admin Submenu Alphabetical Order

## Scope

Team: Charlie

Purpose: Alphabetize the Admin submenu by visible menu labels only.

## Branch

- Continuation branch: `pr/26175-CHARLIE-010-system-health-history-and-closeout`
- Start gate: PASS
- Current branch matched the expected Charlie continuation branch.
- Worktree was clean before implementation.

## Changes

- Moved `Creators` into its alphabetical position in `src/api/admin-owner-navigation.js`.
- Preserved each Admin menu item label, path, route id, disabled state, and renderer behavior.
- Updated affected navigation tests that pin visible Admin menu label order.
- Added Playwright coverage of:
- alphabetical visible label order
- duplicate detection
- duplicate href detection
- each Admin submenu href opening with an HTTP status below 400

## Non-Changes

- No page files were renamed.
- No folders were renamed.
- No page content was modified.
- No routes, URLs, permissions, icons, IDs, CSS classes, Theme V2 styling, or event handlers were changed.
- No menu outside the Admin submenu was reordered.

## Validation Summary

- PASS: Admin labels are alphabetical.
- PASS: No duplicate Admin labels.
- PASS: No duplicate Admin hrefs.
- PASS: Every active Admin submenu item points to an existing page path.
- PASS: Every Admin submenu href opened with an HTTP status below 400 in the targeted Playwright navigation test.
- PASS: Targeted unit tests passed.
- PASS: Targeted Playwright navigation tests passed.

## Artifact

- `tmp/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order_delta.zip`
23 changes: 14 additions & 9 deletions docs_build/dev/reports/codex_changed_files.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# git status --short


# git diff --name-status main...HEAD
A docs_build/dev/reports/PR_26175_OWNER_049-governance-report-merge-batch.md

# git diff --stat main...HEAD
...6175_OWNER_049-governance-report-merge-batch.md | 128 +++++++++++++++++++++
1 file changed, 128 insertions(+)
docs_build/dev/reports/codex_changed_files.txt
docs_build/dev/reports/codex_review.diff
docs_build/dev/reports/coverage_changed_js_guardrail.txt
docs_build/dev/reports/playwright_v8_coverage_report.txt
docs_build/dev/reports/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order.md
docs_build/dev/reports/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order-branch-validation.md
docs_build/dev/reports/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order-manual-validation-notes.md
docs_build/dev/reports/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order-requirement-checklist.md
docs_build/dev/reports/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order-validation.md
src/api/admin-owner-navigation.js
tests/dev-runtime/ApiMenuPathCleanup.test.mjs
tests/dev-runtime/ArchitectureCleanupApiNavInvitations.test.mjs
tests/playwright/tools/AdminInvitationsNavPage.spec.mjs
tests/playwright/tools/AdminOwnerNavigationBoundary.spec.mjs
Loading
Loading