Skip to content

Commit 49e83a9

Browse files
committed
PR_26175_CHARLIE_016-scheduled-health-monitoring
1 parent c5b44c1 commit 49e83a9

14 files changed

Lines changed: 426 additions & 481 deletions

admin/system-health.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ <h2>Admin</h2>
4343
<p>Service Health</p>
4444
<p>Configuration Summary</p>
4545
<p>Manual Health Actions</p>
46+
<p>Scheduled Health Monitoring</p>
4647
<p>Local API Startup</p>
4748
<p>Database Health</p>
4849
<p>Storage Health</p>
@@ -162,6 +163,21 @@ <h3>Manual Health Actions</h3>
162163
</table>
163164
</div>
164165
</section>
166+
<div class="table-wrapper">
167+
<table class="data-table" aria-label="Scheduled health monitoring">
168+
<caption>Scheduled Health Monitoring</caption>
169+
<thead>
170+
<tr>
171+
<th scope="col">Field</th>
172+
<th scope="col">Current Deployment</th>
173+
<th scope="col">Status</th>
174+
</tr>
175+
</thead>
176+
<tbody data-admin-system-health-scheduled-rows>
177+
<tr><td>Scheduled Health Monitoring</td><td>Not Configured</td><td data-health-status="PENDING" title="Reason: scheduled health monitoring has not loaded yet." aria-label="PENDING: scheduled health monitoring has not loaded yet.">PENDING</td></tr>
178+
</tbody>
179+
</table>
180+
</div>
165181
<div class="table-wrapper">
166182
<table class="data-table" aria-label="Local API startup diagnostics">
167183
<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
@@ -66,6 +66,7 @@ class AdminSystemHealthController {
6666
this.actionRows = root.querySelector("[data-admin-system-health-action-rows]");
6767
this.actionButtons = Array.from(root.querySelectorAll("[data-admin-system-health-action]"));
6868
this.configurationRows = root.querySelector("[data-admin-system-health-configuration-rows]");
69+
this.scheduledRows = root.querySelector("[data-admin-system-health-scheduled-rows]");
6970
this.serviceCards = root.querySelector("[data-admin-system-health-service-cards]");
7071
this.startupRows = root.querySelector("[data-admin-system-health-startup-rows]");
7172
this.runtimeRows = root.querySelector("[data-admin-system-health-runtime-rows]");
@@ -143,6 +144,7 @@ class AdminSystemHealthController {
143144
this.renderRuntimeHealthPending(reason);
144145
this.renderServiceHealthPending(reason);
145146
this.renderConfigurationSummaryPending(reason);
147+
this.renderScheduledMonitoringPending(reason);
146148
this.renderHistoryPending(reason);
147149
}
148150

@@ -338,6 +340,45 @@ class AdminSystemHealthController {
338340
this.configurationRows.replaceChildren(fragment);
339341
}
340342

343+
renderScheduledMonitoringPending(reason) {
344+
if (!this.scheduledRows) {
345+
return;
346+
}
347+
const row = document.createElement("tr");
348+
row.append(
349+
this.createCell("Scheduled Health Monitoring"),
350+
this.createCell("Not Configured"),
351+
this.createStatusCell("PENDING", reason),
352+
);
353+
this.scheduledRows.replaceChildren(row);
354+
}
355+
356+
renderScheduledMonitoring(scheduledMonitoring = {}) {
357+
if (!this.scheduledRows) {
358+
return;
359+
}
360+
if (scheduledMonitoring?.secretsExposed === true || scheduledMonitoring?.secretEditingAllowed === true) {
361+
this.renderScheduledMonitoringPending("Safe scheduled monitoring response was blocked because it exposed secret controls.");
362+
return;
363+
}
364+
const rows = Array.isArray(scheduledMonitoring.rows) ? scheduledMonitoring.rows : [];
365+
if (!rows.length) {
366+
this.renderScheduledMonitoringPending("Safe Admin System Health API returned no scheduled monitoring rows.");
367+
return;
368+
}
369+
const fragment = document.createDocumentFragment();
370+
rows.forEach((scheduledRow) => {
371+
const row = document.createElement("tr");
372+
row.append(
373+
this.createCell(scheduledRow.field),
374+
this.createCell(scheduledRow.value),
375+
this.createStatusCell(scheduledRow.status, scheduledMonitoring.message),
376+
);
377+
fragment.append(row);
378+
});
379+
this.scheduledRows.replaceChildren(fragment);
380+
}
381+
341382
renderStartupPending(reason) {
342383
if (!this.startupRows) {
343384
return;
@@ -585,6 +626,7 @@ class AdminSystemHealthController {
585626
this.renderRuntimeHealth(data?.runtimeHealth || {});
586627
this.renderServiceHealth(data?.serviceHealth || {});
587628
this.renderConfigurationSummary(data?.configurationSummary || {});
629+
this.renderScheduledMonitoring(data?.scheduledMonitoring || {});
588630
this.renderHealthCheckHistory(data?.healthCheckHistory || []);
589631
this.renderRuntimeEnvironment(data?.runtimeEnvironment || {});
590632
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# PR_26175_CHARLIE_016 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_015.
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_016 Manual Validation Notes
2+
3+
- Verified Scheduled Health Monitoring renders on `admin/system-health.html`.
4+
- Verified Not Configured appears instead of fake scheduler success.
5+
- Verified the table includes last run, next run, duration, recent result, and failures/warnings.
6+
- Verified no scheduler side effects or cross-environment 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_016 Requirement Checklist
2+
3+
- PASS: Added Scheduled Health Monitoring foundation.
4+
- PASS: Shows last scheduled run.
5+
- PASS: Shows next scheduled run if available.
6+
- PASS: Shows duration.
7+
- PASS: Shows recent result.
8+
- PASS: Shows failures/warnings.
9+
- PASS: Shows production-safe Not Configured state when scheduler is not implemented.
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_016 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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# PR_26175_CHARLIE_016 Scheduled Health Monitoring
2+
3+
## Scope
4+
5+
Team: Charlie
6+
7+
Purpose: Add the Scheduled Health Monitoring foundation to Admin System Health Phase 2.
8+
9+
## Changes
10+
11+
- Added server-owned `scheduledMonitoring` to the Admin System Health status API.
12+
- Added Scheduled Health Monitoring table for last scheduled run, next scheduled run, duration, recent result, and failures/warnings.
13+
- Returned production-safe Not Configured values because no scheduler contract is implemented.
14+
- Updated API and Playwright System Health tests.
15+
16+
## Architecture Notes
17+
18+
- PASS: Scheduler success is not faked.
19+
- PASS: Not Configured state is explicit and safe.
20+
- PASS: Current environment only.
21+
- PASS: Browser renders API-owned state only.
22+
- PASS: No cross-environment checks were added.
23+
24+
## Artifact
25+
26+
- `tmp/PR_26175_CHARLIE_016-scheduled-health-monitoring_delta.zip`

docs_build/dev/reports/codex_changed_files.txt

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,28 @@ M admin/system-health.html
33
M assets/theme-v2/js/admin-system-health.js
44
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
55
M docs_build/dev/reports/playwright_v8_coverage_report.txt
6-
M src/api/admin-system-health-api-client.js
76
M src/dev-runtime/server/local-api-router.mjs
87
M tests/dev-runtime/AdminHealthOperations.test.mjs
98
M tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
10-
?? docs_build/dev/reports/PR_26175_CHARLIE_015-manual-health-actions-branch-validation.md
11-
?? docs_build/dev/reports/PR_26175_CHARLIE_015-manual-health-actions-manual-validation-notes.md
12-
?? docs_build/dev/reports/PR_26175_CHARLIE_015-manual-health-actions-requirement-checklist.md
13-
?? docs_build/dev/reports/PR_26175_CHARLIE_015-manual-health-actions-validation.md
14-
?? docs_build/dev/reports/PR_26175_CHARLIE_015-manual-health-actions.md
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
1514

1615
# git ls-files --others --exclude-standard
17-
docs_build/dev/reports/PR_26175_CHARLIE_015-manual-health-actions-branch-validation.md
18-
docs_build/dev/reports/PR_26175_CHARLIE_015-manual-health-actions-manual-validation-notes.md
19-
docs_build/dev/reports/PR_26175_CHARLIE_015-manual-health-actions-requirement-checklist.md
20-
docs_build/dev/reports/PR_26175_CHARLIE_015-manual-health-actions-validation.md
21-
docs_build/dev/reports/PR_26175_CHARLIE_015-manual-health-actions.md
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
2221

2322
# git diff --stat
24-
admin/system-health.html | 30 ++++++
25-
assets/theme-v2/js/admin-system-health.js | 116 ++++++++++++++++++---
26-
.../dev/reports/coverage_changed_js_guardrail.txt | 3 +-
27-
.../dev/reports/playwright_v8_coverage_report.txt | 12 ++-
28-
src/api/admin-system-health-api-client.js | 10 ++
29-
src/dev-runtime/server/local-api-router.mjs | 92 ++++++++++++++++
30-
tests/dev-runtime/AdminHealthOperations.test.mjs | 38 +++++++
31-
.../tools/AdminHealthOperationsPage.spec.mjs | 10 ++
32-
8 files changed, 291 insertions(+), 20 deletions(-)
23+
admin/system-health.html | 16 +++++++++
24+
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 +++++++++++++++++++++
28+
tests/dev-runtime/AdminHealthOperations.test.mjs | 6 ++++
29+
.../tools/AdminHealthOperationsPage.spec.mjs | 8 +++++
30+
7 files changed, 117 insertions(+), 5 deletions(-)

0 commit comments

Comments
 (0)