Skip to content

Commit 4883170

Browse files
committed
PR_26175_CHARLIE_017-health-notifications-foundation
1 parent 49e83a9 commit 4883170

15 files changed

Lines changed: 434 additions & 173 deletions

admin/system-health.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ <h2>Admin</h2>
4444
<p>Configuration Summary</p>
4545
<p>Manual Health Actions</p>
4646
<p>Scheduled Health Monitoring</p>
47+
<p>Notifications &amp; Alerts</p>
4748
<p>Local API Startup</p>
4849
<p>Database Health</p>
4950
<p>Storage Health</p>
@@ -178,6 +179,21 @@ <h3>Manual Health Actions</h3>
178179
</tbody>
179180
</table>
180181
</div>
182+
<div class="table-wrapper">
183+
<table class="data-table" aria-label="Notifications and alerts">
184+
<caption>Notifications &amp; Alerts</caption>
185+
<thead>
186+
<tr>
187+
<th scope="col">Integration</th>
188+
<th scope="col">Current Deployment</th>
189+
<th scope="col">Status</th>
190+
</tr>
191+
</thead>
192+
<tbody data-admin-system-health-notification-rows>
193+
<tr><td>Notifications &amp; Alerts</td><td>Not Configured</td><td data-health-status="PENDING" title="Reason: notifications and alerts have not loaded yet." aria-label="PENDING: notifications and alerts have not loaded yet.">PENDING</td></tr>
194+
</tbody>
195+
</table>
196+
</div>
181197
<div class="table-wrapper">
182198
<table class="data-table" aria-label="Local API startup diagnostics">
183199
<caption>Local API Startup Diagnostics</caption>

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class AdminSystemHealthController {
6767
this.actionButtons = Array.from(root.querySelectorAll("[data-admin-system-health-action]"));
6868
this.configurationRows = root.querySelector("[data-admin-system-health-configuration-rows]");
6969
this.scheduledRows = root.querySelector("[data-admin-system-health-scheduled-rows]");
70+
this.notificationRows = root.querySelector("[data-admin-system-health-notification-rows]");
7071
this.serviceCards = root.querySelector("[data-admin-system-health-service-cards]");
7172
this.startupRows = root.querySelector("[data-admin-system-health-startup-rows]");
7273
this.runtimeRows = root.querySelector("[data-admin-system-health-runtime-rows]");
@@ -145,6 +146,7 @@ class AdminSystemHealthController {
145146
this.renderServiceHealthPending(reason);
146147
this.renderConfigurationSummaryPending(reason);
147148
this.renderScheduledMonitoringPending(reason);
149+
this.renderNotificationsFoundationPending(reason);
148150
this.renderHistoryPending(reason);
149151
}
150152

@@ -379,6 +381,45 @@ class AdminSystemHealthController {
379381
this.scheduledRows.replaceChildren(fragment);
380382
}
381383

384+
renderNotificationsFoundationPending(reason) {
385+
if (!this.notificationRows) {
386+
return;
387+
}
388+
const row = document.createElement("tr");
389+
row.append(
390+
this.createCell("Notifications & Alerts"),
391+
this.createCell("Not Configured"),
392+
this.createStatusCell("PENDING", reason),
393+
);
394+
this.notificationRows.replaceChildren(row);
395+
}
396+
397+
renderNotificationsFoundation(notificationsFoundation = {}) {
398+
if (!this.notificationRows) {
399+
return;
400+
}
401+
if (notificationsFoundation?.secretsExposed === true || notificationsFoundation?.secretEditingAllowed === true) {
402+
this.renderNotificationsFoundationPending("Safe notifications response was blocked because it exposed secret controls.");
403+
return;
404+
}
405+
const rows = Array.isArray(notificationsFoundation.rows) ? notificationsFoundation.rows : [];
406+
if (!rows.length) {
407+
this.renderNotificationsFoundationPending("Safe Admin System Health API returned no notifications rows.");
408+
return;
409+
}
410+
const fragment = document.createDocumentFragment();
411+
rows.forEach((notificationRow) => {
412+
const row = document.createElement("tr");
413+
row.append(
414+
this.createCell(notificationRow.field),
415+
this.createCell(notificationRow.value),
416+
this.createStatusCell(notificationRow.status, notificationsFoundation.message),
417+
);
418+
fragment.append(row);
419+
});
420+
this.notificationRows.replaceChildren(fragment);
421+
}
422+
382423
renderStartupPending(reason) {
383424
if (!this.startupRows) {
384425
return;
@@ -627,6 +668,7 @@ class AdminSystemHealthController {
627668
this.renderServiceHealth(data?.serviceHealth || {});
628669
this.renderConfigurationSummary(data?.configurationSummary || {});
629670
this.renderScheduledMonitoring(data?.scheduledMonitoring || {});
671+
this.renderNotificationsFoundation(data?.notificationsFoundation || {});
630672
this.renderHealthCheckHistory(data?.healthCheckHistory || []);
631673
this.renderRuntimeEnvironment(data?.runtimeEnvironment || {});
632674
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# PR_26175_CHARLIE_012-017 System Health Phase 2 Closeout
2+
3+
## Scope
4+
5+
Team: Charlie
6+
7+
Workstream branch: `pr/26175-CHARLIE-010-system-health-history-and-closeout`
8+
9+
## Completed Phase 2 Slices
10+
11+
- PASS: PR_26175_CHARLIE_012-runtime-health
12+
- PASS: PR_26175_CHARLIE_013-service-health-dashboard
13+
- PASS: PR_26175_CHARLIE_014-configuration-summary
14+
- PASS: PR_26175_CHARLIE_015-manual-health-actions
15+
- PASS: PR_26175_CHARLIE_016-scheduled-health-monitoring
16+
- PASS: PR_26175_CHARLIE_017-health-notifications-foundation
17+
18+
## Architecture Closeout
19+
20+
- PASS: System Health remains one page per deployed environment.
21+
- PASS: Each deployment actively checks only itself.
22+
- PASS: Environment Map remains reference-only.
23+
- PASS: No cross-environment checks were added.
24+
- PASS: Web UI calls API/service contracts.
25+
- PASS: Browser does not own infrastructure health state.
26+
- PASS: Not Configured placeholders do not fake success.
27+
28+
## Validation Closeout
29+
30+
- PASS: Targeted System Health API/unit tests passed for each slice.
31+
- PASS: Targeted System Health Playwright tests passed for each slice.
32+
- PASS: Syntax checks passed for touched JavaScript modules.
33+
- PASS: `git diff --check` passed for each slice with CRLF warnings only.
34+
- NOT RUN: Full samples smoke; not required for System Health Phase 2.
35+
36+
## ZIP Artifacts
37+
38+
- `tmp/PR_26175_CHARLIE_012-runtime-health_delta.zip`
39+
- `tmp/PR_26175_CHARLIE_013-service-health-dashboard_delta.zip`
40+
- `tmp/PR_26175_CHARLIE_014-configuration-summary_delta.zip`
41+
- `tmp/PR_26175_CHARLIE_015-manual-health-actions_delta.zip`
42+
- `tmp/PR_26175_CHARLIE_016-scheduled-health-monitoring_delta.zip`
43+
- `tmp/PR_26175_CHARLIE_017-health-notifications-foundation_delta.zip`
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# PR_26175_CHARLIE_017 Branch Validation
2+
3+
## Branch Rules
4+
5+
- PASS: Continued on `pr/26175-CHARLIE-010-system-health-history-and-closeout`.
6+
- PASS: Stacked on PR_26175_CHARLIE_016.
7+
- PASS: No merge was performed.
8+
- PASS: No rebase was performed.
9+
- PASS: No new root branch was created.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# PR_26175_CHARLIE_017 Manual Validation Notes
2+
3+
- Verified Notifications & Alerts renders on `admin/system-health.html`.
4+
- Verified Email alerts, Admin notifications, Webhook alerts, and Messages integration show Not Configured.
5+
- Verified no send controls or delivery actions were added.
6+
- Verified no peer environment health checks were introduced.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# PR_26175_CHARLIE_017 Requirement Checklist
2+
3+
- PASS: Added Email alerts status placeholder.
4+
- PASS: Added Admin notification status placeholder.
5+
- PASS: Added Webhook status placeholder.
6+
- PASS: Added Messages integration placeholder because a messages service surface exists.
7+
- PASS: Did not add actual sending behavior.
8+
- PASS: Shows Not Configured safely.
9+
- PASS: Added final Phase 2 closeout report.
10+
- PASS: Current environment only.
11+
- PASS: Tests were updated.
12+
- PASS: Required reports were generated.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# PR_26175_CHARLIE_017 Validation Report
2+
3+
## Commands
4+
5+
- PASS: `node --check src/dev-runtime/server/local-api-router.mjs`
6+
- PASS: `node --check assets/theme-v2/js/admin-system-health.js`
7+
- PASS: `git diff --check`
8+
- Result: no whitespace errors; CRLF conversion warnings only.
9+
- PASS: `node --test tests/dev-runtime/AdminHealthOperations.test.mjs`
10+
- Result: 4 passed.
11+
- PASS: `npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1 --reporter=line`
12+
- Result: 3 passed.
13+
14+
## Validation Lane
15+
16+
- Targeted System Health API/unit lane: PASS.
17+
- Targeted System Health Playwright lane: PASS.
18+
- Full samples smoke: not run; not required for this System Health-only slice.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# PR_26175_CHARLIE_017 Health Notifications Foundation
2+
3+
## Scope
4+
5+
Team: Charlie
6+
7+
Purpose: Add Notifications & Alerts foundation placeholders to Admin System Health Phase 2.
8+
9+
## Changes
10+
11+
- Added server-owned `notificationsFoundation` to the Admin System Health status API.
12+
- Added Notifications & Alerts table with Email alerts, Admin notifications, Webhook alerts, and Messages integration placeholders.
13+
- Returned production-safe Not Configured values for every notification path.
14+
- Added final Phase 2 closeout report.
15+
- Updated API and Playwright System Health tests.
16+
17+
## Architecture Notes
18+
19+
- PASS: No email sending was added.
20+
- PASS: No webhook sending was added.
21+
- PASS: No admin notification delivery was added.
22+
- PASS: Messages integration is placeholder-only.
23+
- PASS: Current environment only.
24+
- PASS: Browser renders API-owned state only.
25+
26+
## Artifact
27+
28+
- `tmp/PR_26175_CHARLIE_017-health-notifications-foundation_delta.zip`

docs_build/dev/reports/codex_changed_files.txt

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,27 @@ M admin/system-health.html
66
M src/dev-runtime/server/local-api-router.mjs
77
M tests/dev-runtime/AdminHealthOperations.test.mjs
88
M tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
9-
?? docs_build/dev/reports/PR_26175_CHARLIE_016-scheduled-health-monitoring-branch-validation.md
10-
?? docs_build/dev/reports/PR_26175_CHARLIE_016-scheduled-health-monitoring-manual-validation-notes.md
11-
?? docs_build/dev/reports/PR_26175_CHARLIE_016-scheduled-health-monitoring-requirement-checklist.md
12-
?? docs_build/dev/reports/PR_26175_CHARLIE_016-scheduled-health-monitoring-validation.md
13-
?? docs_build/dev/reports/PR_26175_CHARLIE_016-scheduled-health-monitoring.md
9+
?? docs_build/dev/reports/PR_26175_CHARLIE_012-017-system-health-phase-2-closeout.md
10+
?? docs_build/dev/reports/PR_26175_CHARLIE_017-health-notifications-foundation-branch-validation.md
11+
?? docs_build/dev/reports/PR_26175_CHARLIE_017-health-notifications-foundation-manual-validation-notes.md
12+
?? docs_build/dev/reports/PR_26175_CHARLIE_017-health-notifications-foundation-requirement-checklist.md
13+
?? docs_build/dev/reports/PR_26175_CHARLIE_017-health-notifications-foundation-validation.md
14+
?? docs_build/dev/reports/PR_26175_CHARLIE_017-health-notifications-foundation.md
1415

1516
# git ls-files --others --exclude-standard
16-
docs_build/dev/reports/PR_26175_CHARLIE_016-scheduled-health-monitoring-branch-validation.md
17-
docs_build/dev/reports/PR_26175_CHARLIE_016-scheduled-health-monitoring-manual-validation-notes.md
18-
docs_build/dev/reports/PR_26175_CHARLIE_016-scheduled-health-monitoring-requirement-checklist.md
19-
docs_build/dev/reports/PR_26175_CHARLIE_016-scheduled-health-monitoring-validation.md
20-
docs_build/dev/reports/PR_26175_CHARLIE_016-scheduled-health-monitoring.md
17+
docs_build/dev/reports/PR_26175_CHARLIE_012-017-system-health-phase-2-closeout.md
18+
docs_build/dev/reports/PR_26175_CHARLIE_017-health-notifications-foundation-branch-validation.md
19+
docs_build/dev/reports/PR_26175_CHARLIE_017-health-notifications-foundation-manual-validation-notes.md
20+
docs_build/dev/reports/PR_26175_CHARLIE_017-health-notifications-foundation-requirement-checklist.md
21+
docs_build/dev/reports/PR_26175_CHARLIE_017-health-notifications-foundation-validation.md
22+
docs_build/dev/reports/PR_26175_CHARLIE_017-health-notifications-foundation.md
2123

2224
# git diff --stat
2325
admin/system-health.html | 16 +++++++++
2426
assets/theme-v2/js/admin-system-health.js | 42 ++++++++++++++++++++++
25-
.../dev/reports/coverage_changed_js_guardrail.txt | 2 +-
26-
.../dev/reports/playwright_v8_coverage_report.txt | 8 ++---
27-
src/dev-runtime/server/local-api-router.mjs | 40 +++++++++++++++++++++
27+
.../dev/reports/coverage_changed_js_guardrail.txt | 3 +-
28+
.../dev/reports/playwright_v8_coverage_report.txt | 6 ++--
29+
src/dev-runtime/server/local-api-router.mjs | 35 ++++++++++++++++++
2830
tests/dev-runtime/AdminHealthOperations.test.mjs | 6 ++++
29-
.../tools/AdminHealthOperationsPage.spec.mjs | 8 +++++
30-
7 files changed, 117 insertions(+), 5 deletions(-)
31+
.../tools/AdminHealthOperationsPage.spec.mjs | 7 ++++
32+
7 files changed, 109 insertions(+), 6 deletions(-)

0 commit comments

Comments
 (0)