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
20 changes: 20 additions & 0 deletions admin/system-health.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ <h2>Admin</h2>
<div class="accordion-body content-stack">
<p>Environment Identity</p>
<p>Environment Map</p>
<p>Environment Health Comparison</p>
<p>Environment Capabilities</p>
<p>Health API Contract</p>
<p>Admin API Registry</p>
Expand Down Expand Up @@ -110,6 +111,25 @@ <h2 id="admin-system-health-title">System Health Tables</h2>
</tbody>
</table>
</div>
<div class="table-wrapper">
<table class="data-table" aria-label="Environment health comparison">
<caption>Environment Health Comparison</caption>
<thead>
<tr>
<th scope="col">Environment</th>
<th scope="col">Hosting model</th>
<th scope="col">Runtime expectation</th>
<th scope="col">Database model</th>
<th scope="col">Storage folder</th>
<th scope="col">State</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody data-admin-system-health-environment-comparison-rows>
<tr><td>Environment comparison</td><td>Reference-only</td><td>Waiting for safe API status</td><td>Reference-only</td><td>Reference-only</td><td>Unavailable</td><td data-health-status="PENDING" title="Reason: environment comparison has not loaded yet." aria-label="PENDING: environment comparison has not loaded yet.">PENDING</td></tr>
</tbody>
</table>
</div>
<div class="table-wrapper">
<table class="data-table" aria-label="Environment capabilities">
<caption>Environment Capabilities</caption>
Expand Down
50 changes: 50 additions & 0 deletions assets/theme-v2/js/admin-system-health.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class AdminSystemHealthController {
this.historyRows = root.querySelector("[data-admin-system-health-history-rows]");
this.apiContractRows = root.querySelector("[data-admin-system-health-api-contract-rows]");
this.apiRegistryRows = root.querySelector("[data-admin-system-health-api-registry-rows]");
this.environmentComparisonRows = root.querySelector("[data-admin-system-health-environment-comparison-rows]");
this.capabilityRows = root.querySelector("[data-admin-system-health-capability-rows]");
this.featureFlagRows = root.querySelector("[data-admin-system-health-feature-flag-rows]");
this.actionRows = root.querySelector("[data-admin-system-health-action-rows]");
Expand Down Expand Up @@ -160,6 +161,7 @@ class AdminSystemHealthController {
this.renderPostgresMetricsPending(reason);
this.renderStoragePending(reason);
this.renderRuntimeHealthPending(reason);
this.renderEnvironmentComparisonPending(reason);
this.renderEnvironmentCapabilitiesPending(reason);
this.renderApiContractPending(reason);
this.renderAdminApiRegistryPending(reason);
Expand Down Expand Up @@ -203,6 +205,53 @@ class AdminSystemHealthController {
this.setEnvironmentStatus("lastHealthCheck", environmentIdentity.lastHealthCheck ? "PASS" : "WARN", reason);
}

renderEnvironmentComparisonPending(reason) {
if (!this.environmentComparisonRows) {
return;
}
const row = document.createElement("tr");
row.append(
this.createCell("Environment comparison"),
this.createCell("Reference-only"),
this.createCell("not available"),
this.createCell("Reference-only"),
this.createCell("Reference-only"),
this.createCell("Unavailable"),
this.createStatusCell("PENDING", reason),
);
this.environmentComparisonRows.replaceChildren(row);
}

renderEnvironmentComparison(environmentComparison = {}) {
if (!this.environmentComparisonRows) {
return;
}
if (environmentComparison?.secretsExposed === true || environmentComparison?.secretEditingAllowed === true) {
this.renderEnvironmentComparisonPending("Safe environment comparison response was blocked because it exposed secret controls.");
return;
}
const rows = Array.isArray(environmentComparison.rows) ? environmentComparison.rows : [];
if (!rows.length) {
this.renderEnvironmentComparisonPending("Safe Admin System Health API returned no environment comparison rows.");
return;
}
const fragment = document.createDocumentFragment();
rows.forEach((comparisonRow) => {
const row = document.createElement("tr");
row.append(
this.createCell(comparisonRow.displayName),
this.createCell(comparisonRow.hostingModel),
this.createCell(comparisonRow.runtimeExpectation),
this.createCell(comparisonRow.databaseModel),
this.createCell(comparisonRow.storageFolder),
this.createCell(comparisonRow.state),
this.createStatusCell(comparisonRow.status, comparisonRow.summary || environmentComparison.message),
);
fragment.append(row);
});
this.environmentComparisonRows.replaceChildren(fragment);
}

renderStoragePending(reason) {
["bucket", "list", "upload", "read", "delete", "lastChecked"].forEach((key) => {
this.setStorageStatus(key, "PENDING", reason);
Expand Down Expand Up @@ -893,6 +942,7 @@ class AdminSystemHealthController {
return;
}
this.renderEnvironmentIdentity(data?.environmentIdentity || {});
this.renderEnvironmentComparison(data?.environmentComparison || {});
this.renderPostgresStatus(data?.databaseStatus || {});
this.renderStartupDiagnostics(data?.localApiStartup || {});
this.renderStorageStatus(data?.storageStatus || {});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# PR_26177_CHARLIE_031-environment-health-comparison

Team: Charlie
Branch: pr/26177-CHARLIE-031-environment-health-comparison
Base: pr/26177-CHARLIE-030-r2-storage-health-expanded-validation
Lifecycle: Build / Validation
Repair: Rebased onto repaired PR_26177_CHARLIE_030 branch on 2026-06-25.

## Scope
- Added a server-owned Environment Health Comparison payload and System Health table.
- Shows Local (VS Code), DEV, IST, UAT, and PROD as a reference comparison view.
- Marks only the current deployment as actively checked; peer environments are reference-only Not Configured or Unavailable.

## Changed Files
- admin/system-health.html
- assets/theme-v2/js/admin-system-health.js
- src/dev-runtime/server/local-api-router.mjs
- tests/api/admin-system-health/contract.test.mjs
- tests/dev-runtime/AdminHealthOperations.test.mjs
- tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
- docs_build/dev/reports/coverage_changed_js_guardrail.txt
- docs_build/dev/reports/playwright_v8_coverage_report.txt

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

## ZIP
- Generated after repair: C:\Users\DavidQ\Documents\GitHub\HTML-JavaScript-Gaming\tmp\PR_26177_CHARLIE_031-environment-health-comparison_delta.zip
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# PR_26177_CHARLIE_031-environment-health-comparison Branch Validation

Branch: pr/26177-CHARLIE-031-environment-health-comparison
Expected stack base: pr/26177-CHARLIE-030-r2-storage-health-expanded-validation
Current status at validation:
## pr/26177-CHARLIE-031-environment-health-comparison
Updated onto repaired PR_26177_CHARLIE_030 stack base.

Result: PASS

Checks:
- PASS: Branch created from PR 030 branch for the approved stacked chain.
- PASS: Active branch matches PR identity.
- PASS: Worktree contained only scoped PR changes and generated validation reports.
- PASS: Branch is based on repaired PR 030 branch.
- PASS: Rebase conflict scope was generated report artifacts only.
- PASS: No start_of_day files modified.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# PR_26177_CHARLIE_031-environment-health-comparison Manual Validation Notes

- Confirmed Environment Health Comparison appears as a reference-only table.
- Confirmed DEV current deployment shows Current in the Playwright environment.
- Confirmed peer rows show Not Configured or Unavailable and are not actively checked.
- Confirmed PROD displays with R2 /prd without changing the existing PRD Environment Map.
- Confirmed no secrets or peer-environment health probes are exposed.
- Confirmed branch repair conflict was limited to generated report artifacts.
- Confirmed no start_of_day files changed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# PR_26177_CHARLIE_031-environment-health-comparison Requirement Checklist

- PASS: Added a single System Health comparison view.
- PASS: Includes Local (VS Code), DEV, IST, UAT, and PROD.
- PASS: Shows clear state/status indicators per environment.
- PASS: Local (VS Code) represents local static server/API/developer runtime expectations.
- PASS: Unavailable or non-current environments do not have to pass.
- PASS: No silent defaults; peer rows explicitly show Not Configured or Unavailable.
- PASS: No cross-environment active checks added.
- PASS: Browser UI consumes API/service contract.
- PASS: No unrelated files or start_of_day files modified.
- PASS: Rebased onto repaired PR_26177_CHARLIE_030 branch.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# PR_26177_CHARLIE_031-environment-health-comparison Validation Lane Report

Impacted lanes:
- runtime: Local API Admin System Health status payload.
- contract: Admin System Health API contract tests.
- UI: Admin System Health Theme V2 table rendering.
- Playwright: targeted Admin System Health page spec.

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

Skipped lanes:
- Full samples smoke skipped; comparison view is Admin System Health only.
- Full Project Workspace suite skipped; targeted Admin/System Health coverage was sufficient.

Result: PASS
59 changes: 29 additions & 30 deletions docs_build/dev/reports/codex_changed_files.txt
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
# git diff --name-only pr/26177-CHARLIE-029-system-health-postgres-metrics-panel --
# git diff --name-only pr/26177-CHARLIE-030-r2-storage-health-expanded-validation --
admin/system-health.html
assets/theme-v2/js/admin-system-health.js
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation.md
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_branch-validation.md
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_manual-validation-notes.md
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_requirements-checklist.md
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_validation-lane.md
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison.md
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_branch-validation.md
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_manual-validation-notes.md
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_requirements-checklist.md
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_validation-lane.md
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
src/api/admin-system-health-api-client.js
src/dev-runtime/server/local-api-router.mjs
tests/api/admin-system-health/contract.test.mjs
tests/dev-runtime/AdminHealthOperations.test.mjs
tests/playwright/tools/AdminHealthOperationsPage.spec.mjs

# git status --short
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation.md
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_branch-validation.md
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_manual-validation-notes.md
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_requirements-checklist.md
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_validation-lane.md
M docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison.md
M docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_branch-validation.md
M docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_manual-validation-notes.md
M docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_requirements-checklist.md
M docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_validation-lane.md
M docs_build/dev/reports/codex_review.diff
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
M docs_build/dev/reports/playwright_v8_coverage_report.txt

# git diff --stat pr/26177-CHARLIE-029-system-health-postgres-metrics-panel --
admin/system-health.html | 13 +-
assets/theme-v2/js/admin-system-health.js | 41 +-
...IE_030-r2-storage-health-expanded-validation.md | 35 +
...health-expanded-validation_branch-validation.md | 17 +
...-expanded-validation_manual-validation-notes.md | 9 +
...h-expanded-validation_requirements-checklist.md | 13 +
...e-health-expanded-validation_validation-lane.md | 22 +
docs_build/dev/reports/codex_changed_files.txt | 70 +-
docs_build/dev/reports/codex_review.diff | 988 +++++++++++----------
.../dev/reports/coverage_changed_js_guardrail.txt | 6 +-
.../dev/reports/playwright_v8_coverage_report.txt | 17 +-
src/api/admin-system-health-api-client.js | 4 +
src/dev-runtime/server/local-api-router.mjs | 105 ++-
tests/api/admin-system-health/contract.test.mjs | 19 +
tests/dev-runtime/AdminHealthOperations.test.mjs | 6 +
.../tools/AdminHealthOperationsPage.spec.mjs | 8 +-
16 files changed, 851 insertions(+), 522 deletions(-)
# git diff --stat pr/26177-CHARLIE-030-r2-storage-health-expanded-validation --
admin/system-health.html | 20 +
assets/theme-v2/js/admin-system-health.js | 50 ++
...77_CHARLIE_031-environment-health-comparison.md | 33 +
...ironment-health-comparison_branch-validation.md | 17 +
...nt-health-comparison_manual-validation-notes.md | 9 +
...ent-health-comparison_requirements-checklist.md | 12 +
...nvironment-health-comparison_validation-lane.md | 21 +
docs_build/dev/reports/codex_changed_files.txt | 71 +--
docs_build/dev/reports/codex_review.diff | 663 +--------------------
.../dev/reports/coverage_changed_js_guardrail.txt | 3 +-
.../dev/reports/playwright_v8_coverage_report.txt | 8 +-
src/dev-runtime/server/local-api-router.mjs | 76 +++
tests/api/admin-system-health/contract.test.mjs | 13 +
tests/dev-runtime/AdminHealthOperations.test.mjs | 9 +
.../tools/AdminHealthOperationsPage.spec.mjs | 11 +
15 files changed, 305 insertions(+), 711 deletions(-)
Loading
Loading