|
| 1 | +# PR_26175_CHARLIE_002-system-health-dashboard |
| 2 | + |
| 3 | +## Summary |
| 4 | + |
| 5 | +Implemented the approved System Health dashboard increment for safe Local API startup diagnostics. |
| 6 | + |
| 7 | +The dashboard now surfaces a server-owned Local API Startup Diagnostics table that reports: |
| 8 | + |
| 9 | +- approved startup diagnostics format availability |
| 10 | +- Environment Variables section masking/redaction behavior |
| 11 | +- configured startup bind target |
| 12 | +- configured site URL status |
| 13 | +- configured or derived API URL |
| 14 | +- configured API URL port |
| 15 | +- configurable multiple runtime ports as `PENDING` and `deferred/cancelled` |
| 16 | + |
| 17 | +The implementation preserves existing Postgres, R2, Runtime Environment, Limits, Diagnostics Plan, and Diagnostics Log behavior. |
| 18 | + |
| 19 | +## Scope Controls |
| 20 | + |
| 21 | +| Requirement | Result | Notes | |
| 22 | +|---|---:|---| |
| 23 | +| Active branch remains `PR_26172_CHARLIE_repository-compliance-stack` | PASS | Work stayed on the Charlie stack branch. | |
| 24 | +| Implement only approved System Health dashboard scope | PASS | Changes are limited to Admin System Health dashboard/API status and targeted tests. | |
| 25 | +| Preserve existing Postgres behavior | PASS | Existing database status rendering and server payload remain intact. | |
| 26 | +| Preserve existing R2 behavior | PASS | Existing storage status and connectivity action behavior remain intact. | |
| 27 | +| Preserve Runtime Environment behavior | PASS | Existing runtime environment masking/rendering remains intact. | |
| 28 | +| Preserve Limits behavior | PASS | Existing limits/capacity rows and usage placeholders remain intact. | |
| 29 | +| Preserve Diagnostics Plan and Diagnostics Log behavior | PASS | Existing tables remain; only Local API startup diagnostics table was added. | |
| 30 | +| Use PASS/WARN/FAIL/PENDING correctly | PASS | Real known-good checks are `PASS`; missing configured site URL is `WARN`; deferred multiple runtime ports is `PENDING`. | |
| 31 | +| Do not expose secrets | PASS | URL credentials are redacted, secret values are not returned, and tests assert no raw credentials appear. | |
| 32 | +| Do not implement telemetry | PASS | No telemetry collection, storage, route, or metric implementation was added. | |
| 33 | +| Do not implement configurable runtime ports | PASS | Multiple runtime ports are explicitly reported as `PENDING` / `deferred/cancelled`. | |
| 34 | + |
| 35 | +## Files Changed |
| 36 | + |
| 37 | +- `admin/system-health.html` |
| 38 | +- `assets/theme-v2/js/admin-system-health.js` |
| 39 | +- `src/dev-runtime/server/local-api-router.mjs` |
| 40 | +- `tests/dev-runtime/AdminHealthOperations.test.mjs` |
| 41 | +- `tests/playwright/tools/AdminHealthOperationsPage.spec.mjs` |
| 42 | +- `docs_build/dev/reports/PR_26175_CHARLIE_002-system-health-dashboard.md` |
| 43 | +- `docs_build/dev/reports/PR_26175_CHARLIE_002-system-health-dashboard-manual-validation-notes.md` |
| 44 | +- `docs_build/dev/reports/PR_26175_CHARLIE_002-system-health-dashboard-instruction-compliance-checklist.md` |
| 45 | +- `docs_build/dev/reports/codex_review.diff` |
| 46 | +- `docs_build/dev/reports/codex_changed_files.txt` |
| 47 | + |
| 48 | +## Implementation Notes |
| 49 | + |
| 50 | +- Added `systemHealthLocalApiStartupDiagnostics()` in the Local API router so the browser receives structured, sanitized diagnostics instead of parsing startup console output. |
| 51 | +- Added a `localApiStartup` payload to `/api/admin/system-health/status`. |
| 52 | +- Added Local API Startup Diagnostics table markup to `admin/system-health.html`. |
| 53 | +- Extended `assets/theme-v2/js/admin-system-health.js` to render startup diagnostic rows using the existing shared status helpers. |
| 54 | +- Added API-level tests for local startup diagnostics rows, deferred runtime ports, and URL credential redaction. |
| 55 | +- Added Playwright coverage for the new dashboard table and static markup. |
| 56 | + |
| 57 | +## Validation Lane Report |
| 58 | + |
| 59 | +| Command | Result | |
| 60 | +|---|---:| |
| 61 | +| `git diff --check` | PASS | |
| 62 | +| `node --test tests/dev-runtime/LocalApiStartupLogging.test.mjs` | PASS, 2 tests | |
| 63 | +| `node --test tests/dev-runtime/AdminHealthOperations.test.mjs` | PASS, 4 tests | |
| 64 | +| `npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs` | PASS, 3 tests | |
| 65 | + |
| 66 | +## Skipped Lanes |
| 67 | + |
| 68 | +- Full samples smoke: skipped; the scope is Admin System Health dashboard diagnostics only. |
| 69 | +- Broad Playwright suite: skipped; targeted System Health coverage passed. |
| 70 | +- Telemetry validation: skipped; telemetry was explicitly out of scope and not implemented. |
| 71 | +- Configurable runtime port validation: skipped; configurable multiple runtime ports were explicitly deferred/cancelled and not implemented. |
| 72 | + |
| 73 | +## Dependency Notes |
| 74 | + |
| 75 | +The current branch already contains the approved Local API startup diagnostics formatter shape: |
| 76 | + |
| 77 | +- deterministic `Environment Variables` section |
| 78 | +- deterministic `All Runtime Ports being used by Service` section |
| 79 | +- secret-like value masking |
| 80 | +- URL credential redaction |
| 81 | + |
| 82 | +Validation confirmed the startup formatter remains intact through `tests/dev-runtime/LocalApiStartupLogging.test.mjs`. |
| 83 | + |
| 84 | +## ZIP Artifact |
| 85 | + |
| 86 | +Repo-structured delta ZIP: |
| 87 | + |
| 88 | +- `tmp/PR_26175_CHARLIE_002-system-health-dashboard_delta.zip` |
0 commit comments