Skip to content

Commit 1a63c19

Browse files
committed
Add System Health environment comparison
1 parent 8455fb6 commit 1a63c19

15 files changed

Lines changed: 305 additions & 699 deletions

admin/system-health.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ <h2>Admin</h2>
4040
<div class="accordion-body content-stack">
4141
<p>Environment Identity</p>
4242
<p>Environment Map</p>
43+
<p>Environment Health Comparison</p>
4344
<p>Environment Capabilities</p>
4445
<p>Health API Contract</p>
4546
<p>Admin API Registry</p>
@@ -110,6 +111,25 @@ <h2 id="admin-system-health-title">System Health Tables</h2>
110111
</tbody>
111112
</table>
112113
</div>
114+
<div class="table-wrapper">
115+
<table class="data-table" aria-label="Environment health comparison">
116+
<caption>Environment Health Comparison</caption>
117+
<thead>
118+
<tr>
119+
<th scope="col">Environment</th>
120+
<th scope="col">Hosting model</th>
121+
<th scope="col">Runtime expectation</th>
122+
<th scope="col">Database model</th>
123+
<th scope="col">Storage folder</th>
124+
<th scope="col">State</th>
125+
<th scope="col">Status</th>
126+
</tr>
127+
</thead>
128+
<tbody data-admin-system-health-environment-comparison-rows>
129+
<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>
130+
</tbody>
131+
</table>
132+
</div>
113133
<div class="table-wrapper">
114134
<table class="data-table" aria-label="Environment capabilities">
115135
<caption>Environment Capabilities</caption>

assets/theme-v2/js/admin-system-health.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class AdminSystemHealthController {
6969
this.historyRows = root.querySelector("[data-admin-system-health-history-rows]");
7070
this.apiContractRows = root.querySelector("[data-admin-system-health-api-contract-rows]");
7171
this.apiRegistryRows = root.querySelector("[data-admin-system-health-api-registry-rows]");
72+
this.environmentComparisonRows = root.querySelector("[data-admin-system-health-environment-comparison-rows]");
7273
this.capabilityRows = root.querySelector("[data-admin-system-health-capability-rows]");
7374
this.featureFlagRows = root.querySelector("[data-admin-system-health-feature-flag-rows]");
7475
this.actionRows = root.querySelector("[data-admin-system-health-action-rows]");
@@ -160,6 +161,7 @@ class AdminSystemHealthController {
160161
this.renderPostgresMetricsPending(reason);
161162
this.renderStoragePending(reason);
162163
this.renderRuntimeHealthPending(reason);
164+
this.renderEnvironmentComparisonPending(reason);
163165
this.renderEnvironmentCapabilitiesPending(reason);
164166
this.renderApiContractPending(reason);
165167
this.renderAdminApiRegistryPending(reason);
@@ -203,6 +205,53 @@ class AdminSystemHealthController {
203205
this.setEnvironmentStatus("lastHealthCheck", environmentIdentity.lastHealthCheck ? "PASS" : "WARN", reason);
204206
}
205207

208+
renderEnvironmentComparisonPending(reason) {
209+
if (!this.environmentComparisonRows) {
210+
return;
211+
}
212+
const row = document.createElement("tr");
213+
row.append(
214+
this.createCell("Environment comparison"),
215+
this.createCell("Reference-only"),
216+
this.createCell("not available"),
217+
this.createCell("Reference-only"),
218+
this.createCell("Reference-only"),
219+
this.createCell("Unavailable"),
220+
this.createStatusCell("PENDING", reason),
221+
);
222+
this.environmentComparisonRows.replaceChildren(row);
223+
}
224+
225+
renderEnvironmentComparison(environmentComparison = {}) {
226+
if (!this.environmentComparisonRows) {
227+
return;
228+
}
229+
if (environmentComparison?.secretsExposed === true || environmentComparison?.secretEditingAllowed === true) {
230+
this.renderEnvironmentComparisonPending("Safe environment comparison response was blocked because it exposed secret controls.");
231+
return;
232+
}
233+
const rows = Array.isArray(environmentComparison.rows) ? environmentComparison.rows : [];
234+
if (!rows.length) {
235+
this.renderEnvironmentComparisonPending("Safe Admin System Health API returned no environment comparison rows.");
236+
return;
237+
}
238+
const fragment = document.createDocumentFragment();
239+
rows.forEach((comparisonRow) => {
240+
const row = document.createElement("tr");
241+
row.append(
242+
this.createCell(comparisonRow.displayName),
243+
this.createCell(comparisonRow.hostingModel),
244+
this.createCell(comparisonRow.runtimeExpectation),
245+
this.createCell(comparisonRow.databaseModel),
246+
this.createCell(comparisonRow.storageFolder),
247+
this.createCell(comparisonRow.state),
248+
this.createStatusCell(comparisonRow.status, comparisonRow.summary || environmentComparison.message),
249+
);
250+
fragment.append(row);
251+
});
252+
this.environmentComparisonRows.replaceChildren(fragment);
253+
}
254+
206255
renderStoragePending(reason) {
207256
["bucket", "list", "upload", "read", "delete", "lastChecked"].forEach((key) => {
208257
this.setStorageStatus(key, "PENDING", reason);
@@ -893,6 +942,7 @@ class AdminSystemHealthController {
893942
return;
894943
}
895944
this.renderEnvironmentIdentity(data?.environmentIdentity || {});
945+
this.renderEnvironmentComparison(data?.environmentComparison || {});
896946
this.renderPostgresStatus(data?.databaseStatus || {});
897947
this.renderStartupDiagnostics(data?.localApiStartup || {});
898948
this.renderStorageStatus(data?.storageStatus || {});
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# PR_26177_CHARLIE_031-environment-health-comparison
2+
3+
Team: Charlie
4+
Branch: pr/26177-CHARLIE-031-environment-health-comparison
5+
Base: pr/26177-CHARLIE-030-r2-storage-health-expanded-validation
6+
Lifecycle: Build / Validation
7+
Repair: Rebased onto repaired PR_26177_CHARLIE_030 branch on 2026-06-25.
8+
9+
## Scope
10+
- Added a server-owned Environment Health Comparison payload and System Health table.
11+
- Shows Local (VS Code), DEV, IST, UAT, and PROD as a reference comparison view.
12+
- Marks only the current deployment as actively checked; peer environments are reference-only Not Configured or Unavailable.
13+
14+
## Changed Files
15+
- admin/system-health.html
16+
- assets/theme-v2/js/admin-system-health.js
17+
- src/dev-runtime/server/local-api-router.mjs
18+
- tests/api/admin-system-health/contract.test.mjs
19+
- tests/dev-runtime/AdminHealthOperations.test.mjs
20+
- tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
21+
- docs_build/dev/reports/coverage_changed_js_guardrail.txt
22+
- docs_build/dev/reports/playwright_v8_coverage_report.txt
23+
24+
## Validation
25+
- PASS: node --check src/dev-runtime/server/local-api-router.mjs
26+
- PASS: node --check assets/theme-v2/js/admin-system-health.js
27+
- PASS: node --test tests/api/admin-system-health/contract.test.mjs
28+
- PASS: node --test tests/dev-runtime/AdminHealthOperations.test.mjs
29+
- PASS: npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1 --reporter=line
30+
- PASS: git diff --check
31+
32+
## ZIP
33+
- Generated after repair: C:\Users\DavidQ\Documents\GitHub\HTML-JavaScript-Gaming\tmp\PR_26177_CHARLIE_031-environment-health-comparison_delta.zip
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# PR_26177_CHARLIE_031-environment-health-comparison Branch Validation
2+
3+
Branch: pr/26177-CHARLIE-031-environment-health-comparison
4+
Expected stack base: pr/26177-CHARLIE-030-r2-storage-health-expanded-validation
5+
Current status at validation:
6+
## pr/26177-CHARLIE-031-environment-health-comparison
7+
Updated onto repaired PR_26177_CHARLIE_030 stack base.
8+
9+
Result: PASS
10+
11+
Checks:
12+
- PASS: Branch created from PR 030 branch for the approved stacked chain.
13+
- PASS: Active branch matches PR identity.
14+
- PASS: Worktree contained only scoped PR changes and generated validation reports.
15+
- PASS: Branch is based on repaired PR 030 branch.
16+
- PASS: Rebase conflict scope was generated report artifacts only.
17+
- PASS: No start_of_day files modified.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# PR_26177_CHARLIE_031-environment-health-comparison Manual Validation Notes
2+
3+
- Confirmed Environment Health Comparison appears as a reference-only table.
4+
- Confirmed DEV current deployment shows Current in the Playwright environment.
5+
- Confirmed peer rows show Not Configured or Unavailable and are not actively checked.
6+
- Confirmed PROD displays with R2 /prd without changing the existing PRD Environment Map.
7+
- Confirmed no secrets or peer-environment health probes are exposed.
8+
- Confirmed branch repair conflict was limited to generated report artifacts.
9+
- Confirmed no start_of_day files changed.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# PR_26177_CHARLIE_031-environment-health-comparison Requirement Checklist
2+
3+
- PASS: Added a single System Health comparison view.
4+
- PASS: Includes Local (VS Code), DEV, IST, UAT, and PROD.
5+
- PASS: Shows clear state/status indicators per environment.
6+
- PASS: Local (VS Code) represents local static server/API/developer runtime expectations.
7+
- PASS: Unavailable or non-current environments do not have to pass.
8+
- PASS: No silent defaults; peer rows explicitly show Not Configured or Unavailable.
9+
- PASS: No cross-environment active checks added.
10+
- PASS: Browser UI consumes API/service contract.
11+
- PASS: No unrelated files or start_of_day files modified.
12+
- PASS: Rebased onto repaired PR_26177_CHARLIE_030 branch.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# PR_26177_CHARLIE_031-environment-health-comparison Validation Lane Report
2+
3+
Impacted lanes:
4+
- runtime: Local API Admin System Health status payload.
5+
- contract: Admin System Health API contract tests.
6+
- UI: Admin System Health Theme V2 table rendering.
7+
- Playwright: targeted Admin System Health page spec.
8+
9+
Commands:
10+
- PASS: node --check src/dev-runtime/server/local-api-router.mjs
11+
- PASS: node --check assets/theme-v2/js/admin-system-health.js
12+
- PASS: node --test tests/api/admin-system-health/contract.test.mjs
13+
- PASS: node --test tests/dev-runtime/AdminHealthOperations.test.mjs
14+
- PASS: npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1 --reporter=line
15+
- PASS: git diff --check
16+
17+
Skipped lanes:
18+
- Full samples smoke skipped; comparison view is Admin System Health only.
19+
- Full Project Workspace suite skipped; targeted Admin/System Health coverage was sufficient.
20+
21+
Result: PASS
Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,44 @@
1-
# git diff --name-only pr/26177-CHARLIE-029-system-health-postgres-metrics-panel --
1+
# git diff --name-only pr/26177-CHARLIE-030-r2-storage-health-expanded-validation --
22
admin/system-health.html
33
assets/theme-v2/js/admin-system-health.js
4-
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation.md
5-
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_branch-validation.md
6-
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_manual-validation-notes.md
7-
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_requirements-checklist.md
8-
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_validation-lane.md
4+
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison.md
5+
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_branch-validation.md
6+
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_manual-validation-notes.md
7+
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_requirements-checklist.md
8+
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_validation-lane.md
99
docs_build/dev/reports/codex_changed_files.txt
1010
docs_build/dev/reports/codex_review.diff
1111
docs_build/dev/reports/coverage_changed_js_guardrail.txt
1212
docs_build/dev/reports/playwright_v8_coverage_report.txt
13-
src/api/admin-system-health-api-client.js
1413
src/dev-runtime/server/local-api-router.mjs
1514
tests/api/admin-system-health/contract.test.mjs
1615
tests/dev-runtime/AdminHealthOperations.test.mjs
1716
tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
1817

1918
# git status --short
20-
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation.md
21-
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_branch-validation.md
22-
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_manual-validation-notes.md
23-
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_requirements-checklist.md
24-
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_validation-lane.md
19+
M docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison.md
20+
M docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_branch-validation.md
21+
M docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_manual-validation-notes.md
22+
M docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_requirements-checklist.md
23+
M docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_validation-lane.md
2524
M docs_build/dev/reports/codex_review.diff
25+
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
2626
M docs_build/dev/reports/playwright_v8_coverage_report.txt
2727

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

0 commit comments

Comments
 (0)