Skip to content

Commit 7ddd9bf

Browse files
committed
Add runtime health JSON endpoint
1 parent 7fe5f7b commit 7ddd9bf

13 files changed

Lines changed: 371 additions & 400 deletions
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# PR_26177_CHARLIE_032-runtime-health-json-endpoints
2+
3+
Team: Charlie
4+
Branch: pr/26177-CHARLIE-032-runtime-health-json-endpoints
5+
Base: pr/26177-CHARLIE-031-environment-health-comparison
6+
Lifecycle: Build / Validation
7+
8+
## Scope
9+
- Added GET /api/runtime/health as a structured Local API JSON health endpoint.
10+
- Endpoint includes environment, API status, database status, storage status, and timestamp.
11+
- Endpoint is server-owned, does not expose secrets, and does not give the browser direct database ownership.
12+
13+
## Changed Files
14+
- src/dev-runtime/server/local-api-router.mjs
15+
- tests/api/admin-system-health/contract.test.mjs
16+
- tests/dev-runtime/AdminHealthOperations.test.mjs
17+
- tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
18+
- docs_build/dev/reports/coverage_changed_js_guardrail.txt
19+
- docs_build/dev/reports/playwright_v8_coverage_report.txt
20+
21+
## Validation
22+
- PASS: node --check src/dev-runtime/server/local-api-router.mjs
23+
- PASS: node --test tests/api/admin-system-health/contract.test.mjs
24+
- PASS: node --test tests/dev-runtime/AdminHealthOperations.test.mjs
25+
- PASS: npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1 --reporter=line
26+
- PASS: git diff --check
27+
28+
## ZIP
29+
- Pending until commit: C:\Users\DavidQ\Documents\GitHub\HTML-JavaScript-Gaming\tmp\PR_26177_CHARLIE_032-runtime-health-json-endpoints_delta.zip
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# PR_26177_CHARLIE_032-runtime-health-json-endpoints Branch Validation
2+
3+
Branch: pr/26177-CHARLIE-032-runtime-health-json-endpoints
4+
Expected stack base: pr/26177-CHARLIE-031-environment-health-comparison
5+
Current status at validation:
6+
## pr/26177-CHARLIE-032-runtime-health-json-endpoints
7+
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
8+
M docs_build/dev/reports/playwright_v8_coverage_report.txt
9+
M src/dev-runtime/server/local-api-router.mjs
10+
M tests/api/admin-system-health/contract.test.mjs
11+
M tests/dev-runtime/AdminHealthOperations.test.mjs
12+
M tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
13+
14+
Result: PASS
15+
16+
Checks:
17+
- PASS: Branch created from PR 031 branch for the approved stacked chain.
18+
- PASS: Active branch matches PR identity.
19+
- PASS: Worktree contained only scoped PR changes and generated validation reports.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# PR_26177_CHARLIE_032-runtime-health-json-endpoints Manual Validation Notes
2+
3+
- Confirmed GET /api/runtime/health returns JSON through the Local API router.
4+
- Confirmed payload includes environment, API, database, storage, and timestamp fields.
5+
- Confirmed payload excludes configured API/site credentials and secret values.
6+
- Confirmed System Health API Contract/Admin API Registry list the runtime health endpoint.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# PR_26177_CHARLIE_032-runtime-health-json-endpoints Requirement Checklist
2+
3+
- PASS: Added structured Local API JSON health endpoint.
4+
- PASS: Includes environment details.
5+
- PASS: Includes API status.
6+
- PASS: Includes DB status when available.
7+
- PASS: Includes storage status when available.
8+
- PASS: Includes timestamp.
9+
- PASS: Does not expose secrets or URL credentials.
10+
- PASS: Browser UI remains API/service-contract based.
11+
- PASS: No direct browser database access added.
12+
- PASS: No unrelated files or start_of_day files modified.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# PR_26177_CHARLIE_032-runtime-health-json-endpoints Validation Lane Report
2+
3+
Impacted lanes:
4+
- runtime: Local API route contract.
5+
- contract: Admin System Health API contract tests.
6+
- UI-adjacent: Admin System Health API registry display.
7+
- Playwright: targeted Admin System Health page spec.
8+
9+
Commands:
10+
- node --check src/dev-runtime/server/local-api-router.mjs
11+
- node --test tests/api/admin-system-health/contract.test.mjs
12+
- node --test tests/dev-runtime/AdminHealthOperations.test.mjs
13+
- npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1 --reporter=line
14+
- git diff --check
15+
16+
Skipped lanes:
17+
- Full samples smoke skipped; no samples/runtime game code changed.
18+
- Full Project Workspace suite skipped; endpoint and Admin registry were covered by targeted tests.
19+
20+
Result: PASS
Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
# git status --short
2-
M admin/system-health.html
3-
M assets/theme-v2/js/admin-system-health.js
4-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
2+
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
53
M docs_build/dev/reports/playwright_v8_coverage_report.txt
64
M src/dev-runtime/server/local-api-router.mjs
75
M tests/api/admin-system-health/contract.test.mjs
86
M tests/dev-runtime/AdminHealthOperations.test.mjs
97
M tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
10-
?? docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison.md
11-
?? docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_branch-validation.md
12-
?? docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_manual-validation-notes.md
13-
?? docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_requirements-checklist.md
14-
?? docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_validation-lane.md
8+
?? docs_build/dev/reports/PR_26177_CHARLIE_032-runtime-health-json-endpoints.md
9+
?? docs_build/dev/reports/PR_26177_CHARLIE_032-runtime-health-json-endpoints_branch-validation.md
10+
?? docs_build/dev/reports/PR_26177_CHARLIE_032-runtime-health-json-endpoints_manual-validation-notes.md
11+
?? docs_build/dev/reports/PR_26177_CHARLIE_032-runtime-health-json-endpoints_requirements-checklist.md
12+
?? docs_build/dev/reports/PR_26177_CHARLIE_032-runtime-health-json-endpoints_validation-lane.md
1513

1614
# git ls-files --others --exclude-standard
17-
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison.md
18-
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_branch-validation.md
19-
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_manual-validation-notes.md
20-
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_requirements-checklist.md
21-
docs_build/dev/reports/PR_26177_CHARLIE_031-environment-health-comparison_validation-lane.md
15+
docs_build/dev/reports/PR_26177_CHARLIE_032-runtime-health-json-endpoints.md
16+
docs_build/dev/reports/PR_26177_CHARLIE_032-runtime-health-json-endpoints_branch-validation.md
17+
docs_build/dev/reports/PR_26177_CHARLIE_032-runtime-health-json-endpoints_manual-validation-notes.md
18+
docs_build/dev/reports/PR_26177_CHARLIE_032-runtime-health-json-endpoints_requirements-checklist.md
19+
docs_build/dev/reports/PR_26177_CHARLIE_032-runtime-health-json-endpoints_validation-lane.md
2220

2321
# git diff --stat
24-
admin/system-health.html | 20 ++++++
25-
assets/theme-v2/js/admin-system-health.js | 50 ++++++++++++++
26-
.../dev/reports/coverage_changed_js_guardrail.txt | 2 +-
27-
.../dev/reports/playwright_v8_coverage_report.txt | 6 +-
28-
src/dev-runtime/server/local-api-router.mjs | 76 ++++++++++++++++++++++
29-
tests/api/admin-system-health/contract.test.mjs | 13 ++++
30-
tests/dev-runtime/AdminHealthOperations.test.mjs | 9 +++
31-
.../tools/AdminHealthOperationsPage.spec.mjs | 11 ++++
32-
8 files changed, 183 insertions(+), 4 deletions(-)
22+
.../dev/reports/coverage_changed_js_guardrail.txt | 1 -
23+
.../dev/reports/playwright_v8_coverage_report.txt | 2 -
24+
src/dev-runtime/server/local-api-router.mjs | 48 ++++++++++++++++++++++
25+
tests/api/admin-system-health/contract.test.mjs | 9 ++++
26+
tests/dev-runtime/AdminHealthOperations.test.mjs | 12 ++++++
27+
.../tools/AdminHealthOperationsPage.spec.mjs | 2 +
28+
6 files changed, 71 insertions(+), 3 deletions(-)

0 commit comments

Comments
 (0)