Skip to content

Commit 9fd5396

Browse files
committed
PR_26175_CHARLIE_020-admin-api-registry
1 parent 83f144c commit 9fd5396

14 files changed

Lines changed: 352 additions & 215 deletions

admin/system-health.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ <h2>Admin</h2>
4242
<p>Environment Map</p>
4343
<p>Environment Capabilities</p>
4444
<p>Health API Contract</p>
45+
<p>Admin API Registry</p>
4546
<p>Service Health</p>
4647
<p>Configuration Summary</p>
4748
<p>Manual Health Actions</p>
@@ -137,6 +138,22 @@ <h2 id="admin-system-health-title">System Health Tables</h2>
137138
</tbody>
138139
</table>
139140
</div>
141+
<div class="table-wrapper">
142+
<table class="data-table" aria-label="Admin API registry">
143+
<caption>Admin API Registry</caption>
144+
<thead>
145+
<tr>
146+
<th scope="col">Method</th>
147+
<th scope="col">Route</th>
148+
<th scope="col">Owner</th>
149+
<th scope="col">Status</th>
150+
</tr>
151+
</thead>
152+
<tbody data-admin-system-health-api-registry-rows>
153+
<tr><td>GET</td><td>Waiting for safe API status</td><td>Team Charlie</td><td data-health-status="PENDING" title="Reason: Admin API registry has not loaded yet." aria-label="PENDING: Admin API registry has not loaded yet.">PENDING</td></tr>
154+
</tbody>
155+
</table>
156+
</div>
140157
<section class="content-stack" aria-label="Service health summary">
141158
<div>
142159
<div class="kicker">Current Deployment</div>

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class AdminSystemHealthController {
6464
]));
6565
this.historyRows = root.querySelector("[data-admin-system-health-history-rows]");
6666
this.apiContractRows = root.querySelector("[data-admin-system-health-api-contract-rows]");
67+
this.apiRegistryRows = root.querySelector("[data-admin-system-health-api-registry-rows]");
6768
this.capabilityRows = root.querySelector("[data-admin-system-health-capability-rows]");
6869
this.actionRows = root.querySelector("[data-admin-system-health-action-rows]");
6970
this.actionButtons = Array.from(root.querySelectorAll("[data-admin-system-health-action]"));
@@ -147,6 +148,7 @@ class AdminSystemHealthController {
147148
this.renderRuntimeHealthPending(reason);
148149
this.renderEnvironmentCapabilitiesPending(reason);
149150
this.renderApiContractPending(reason);
151+
this.renderAdminApiRegistryPending(reason);
150152
this.renderServiceHealthPending(reason);
151153
this.renderConfigurationSummaryPending(reason);
152154
this.renderScheduledMonitoringPending(reason);
@@ -326,6 +328,47 @@ class AdminSystemHealthController {
326328
this.capabilityRows.replaceChildren(fragment);
327329
}
328330

331+
renderAdminApiRegistryPending(reason) {
332+
if (!this.apiRegistryRows) {
333+
return;
334+
}
335+
const row = document.createElement("tr");
336+
row.append(
337+
this.createCell("GET"),
338+
this.createCell("not available"),
339+
this.createCell("Team Charlie"),
340+
this.createStatusCell("PENDING", reason),
341+
);
342+
this.apiRegistryRows.replaceChildren(row);
343+
}
344+
345+
renderAdminApiRegistry(adminApiRegistry = {}) {
346+
if (!this.apiRegistryRows) {
347+
return;
348+
}
349+
if (adminApiRegistry?.secretsExposed === true || adminApiRegistry?.secretEditingAllowed === true) {
350+
this.renderAdminApiRegistryPending("Safe Admin API registry response was blocked because it exposed secret controls.");
351+
return;
352+
}
353+
const rows = Array.isArray(adminApiRegistry.rows) ? adminApiRegistry.rows : [];
354+
if (!rows.length) {
355+
this.renderAdminApiRegistryPending("Safe Admin System Health API returned no Admin API registry rows.");
356+
return;
357+
}
358+
const fragment = document.createDocumentFragment();
359+
rows.forEach((registryRow) => {
360+
const row = document.createElement("tr");
361+
row.append(
362+
this.createCell(registryRow.method),
363+
this.createCell(`${registryRow.path} - ${registryRow.purpose}`),
364+
this.createCell(registryRow.owner),
365+
this.createStatusCell(registryRow.status, adminApiRegistry.message),
366+
);
367+
fragment.append(row);
368+
});
369+
this.apiRegistryRows.replaceChildren(fragment);
370+
}
371+
329372
renderServiceHealthPending(reason) {
330373
if (!this.serviceCards) {
331374
return;
@@ -749,6 +792,7 @@ class AdminSystemHealthController {
749792
this.renderRuntimeHealth(data?.runtimeHealth || {});
750793
this.renderEnvironmentCapabilities(data?.environmentCapabilities || {});
751794
this.renderApiContract(data?.apiContract || {});
795+
this.renderAdminApiRegistry(data?.adminApiRegistry || {});
752796
this.renderServiceHealth(data?.serviceHealth || {});
753797
this.renderConfigurationSummary(data?.configurationSummary || {});
754798
this.renderScheduledMonitoring(data?.scheduledMonitoring || {});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# PR_26175_CHARLIE_020 Branch Validation
2+
3+
- PASS: Continued on `pr/26175-CHARLIE-010-system-health-history-and-closeout`.
4+
- PASS: Stacked on PR_26175_CHARLIE_019.
5+
- PASS: No merge performed.
6+
- PASS: No rebase performed.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# PR_26175_CHARLIE_020 Manual Validation Notes
2+
3+
- Verified Admin API Registry table renders on System Health.
4+
- Verified System Health, Infrastructure, Operations, and Admin navigation routes are listed.
5+
- Verified no additional route probes were introduced.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# PR_26175_CHARLIE_020 Requirement Checklist
2+
3+
- PASS: Added Admin API Registry.
4+
- PASS: Registry is read-only.
5+
- PASS: Registry is server-owned.
6+
- PASS: Browser renders API-owned registry state.
7+
- PASS: Required reports generated.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# PR_26175_CHARLIE_020 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.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# PR_26175_CHARLIE_020 Admin API Registry
2+
3+
## Scope
4+
5+
Team: Charlie
6+
7+
Purpose: Add a read-only Admin API Registry to System Health.
8+
9+
## Changes
10+
11+
- Added server-owned `adminApiRegistry` to the System Health status API.
12+
- Added Admin API Registry table to `admin/system-health.html`.
13+
- Listed System Health, Infrastructure, Operations, and Admin navigation routes used by the admin health surface.
14+
- Updated API and Playwright tests.
15+
16+
## Validation
17+
18+
- PASS: Targeted System Health API/unit tests.
19+
- PASS: Targeted System Health Playwright tests.
20+
- PASS: Syntax checks.
21+
- PASS: `git diff --check`.
22+
23+
## Artifact
24+
25+
- `tmp/PR_26175_CHARLIE_020-admin-api-registry_delta.zip`

docs_build/dev/reports/codex_changed_files.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ 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_019-environment-capabilities-branch-validation.md
10-
?? docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-manual-validation-notes.md
11-
?? docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-requirement-checklist.md
12-
?? docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-validation.md
13-
?? docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities.md
9+
?? docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-branch-validation.md
10+
?? docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-manual-validation-notes.md
11+
?? docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-requirement-checklist.md
12+
?? docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-validation.md
13+
?? docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry.md
1414

1515
# git ls-files --others --exclude-standard
16-
docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-branch-validation.md
17-
docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-manual-validation-notes.md
18-
docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-requirement-checklist.md
19-
docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-validation.md
20-
docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities.md
16+
docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-branch-validation.md
17+
docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-manual-validation-notes.md
18+
docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-requirement-checklist.md
19+
docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-validation.md
20+
docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry.md
2121

2222
# git diff --stat
23-
admin/system-health.html | 16 ++++++
24-
assets/theme-v2/js/admin-system-health.js | 42 ++++++++++++++
23+
admin/system-health.html | 17 +++++++++
24+
assets/theme-v2/js/admin-system-health.js | 44 ++++++++++++++++++++++
2525
.../dev/reports/coverage_changed_js_guardrail.txt | 2 +-
26-
.../dev/reports/playwright_v8_coverage_report.txt | 6 +-
27-
src/dev-runtime/server/local-api-router.mjs | 64 ++++++++++++++++++++++
28-
tests/dev-runtime/AdminHealthOperations.test.mjs | 7 +++
29-
.../tools/AdminHealthOperationsPage.spec.mjs | 8 +++
30-
7 files changed, 141 insertions(+), 4 deletions(-)
26+
.../dev/reports/playwright_v8_coverage_report.txt | 4 +-
27+
src/dev-runtime/server/local-api-router.mjs | 28 ++++++++++++++
28+
tests/dev-runtime/AdminHealthOperations.test.mjs | 13 +++++++
29+
.../tools/AdminHealthOperationsPage.spec.mjs | 7 ++++
30+
7 files changed, 112 insertions(+), 3 deletions(-)

0 commit comments

Comments
 (0)