diff --git a/admin/system-health.html b/admin/system-health.html index 5294d7d6e..0810945e9 100644 --- a/admin/system-health.html +++ b/admin/system-health.html @@ -6,7 +6,7 @@ System Health - Game Foundry Studio LLC - + @@ -18,7 +18,7 @@
Admin

System Health

-

Review the foundation view for environment, Postgres, Cloudflare R2, runtime configuration, capacity, and diagnostics.

+

Review current deployment health for environment, Postgres, Cloudflare R2, runtime configuration, capacity, and diagnostics.

@@ -67,7 +67,7 @@

Admin

-
Foundation
+
Current Deployment

System Health Tables

@@ -400,7 +400,7 @@

Manual Health Actions

CLOUDFLARE_R2_ACCESS_KEY_ID********PASS - CLOUDFLARE_R2_BUCKETConfigured bucket placeholderPENDING + CLOUDFLARE_R2_BUCKETLoadingPENDING CLOUDFLARE_R2_SECRET_ACCESS_KEY********PASS DATABASE_URL********PASS GAMEFOUNDRY_ENVIRONMENTDEV / IST / UAT / PRDPASS @@ -419,11 +419,11 @@

Manual Health Actions

- DB SizePending metricThreshold not connectedPENDING - ConnectionsPending metricPool usage not connectedPENDING - StoragePending metricBucket usage not connectedPENDING - Class A OpsPending metricR2 write/list budget not connectedPENDING - Class B OpsPending metricR2 read budget not connectedPENDING + DB SizeUnavailableProvider telemetry not configuredPENDING + ConnectionsUnavailablePool telemetry not configuredPENDING + StorageUnavailableBucket usage telemetry not configuredPENDING + Class A OpsUnavailableR2 write/list telemetry not configuredPENDING + Class B OpsUnavailableR2 read telemetry not configuredPENDING
@@ -439,15 +439,15 @@

Manual Health Actions

- Postgres ConnectionConnection success, latency, and actionable failure detailServer-owned Postgres health readerPENDING - Postgres Migration ReaderCurrent migration version and pending migration signalServer-owned Postgres migration readerPENDING - R2 Bucket ConfiguredConfigured bucket name presence without exposing secretsServer-owned Cloudflare R2 configuration readerPENDING - R2 ListList operation availability and scoped prefix resultServer-owned Cloudflare R2 storage diagnosticPENDING - R2 ReadHealth object read availabilityServer-owned Cloudflare R2 storage diagnosticPENDING - R2 WriteHealth object write availabilityServer-owned Cloudflare R2 storage diagnosticPENDING - R2 DeleteHealth object cleanup availabilityServer-owned Cloudflare R2 storage diagnosticPENDING - Runtime Environment MaskingMasked display verification for secret-bearing variablesServer-owned runtime environment diagnosticPENDING - Limits/Capacity MetricsDB size, connections, storage usage, and R2 Class A/Class B operation signalsServer-owned metrics diagnosticPENDING + Postgres ConnectionConnection success, latency, and actionable failure detailServer-owned Postgres health readerPENDING + Postgres Migration ReaderCurrent migration version and migration signalServer-owned Postgres migration readerPENDING + R2 Bucket ConfiguredConfigured bucket name presence without exposing secretsServer-owned Cloudflare R2 configuration readerPENDING + R2 ListList operation availability and scoped prefix resultServer-owned Cloudflare R2 storage diagnosticPENDING + R2 ReadDiagnostic object read availabilityServer-owned Cloudflare R2 storage diagnosticPENDING + R2 WriteDiagnostic object write availabilityServer-owned Cloudflare R2 storage diagnosticPENDING + R2 DeleteDiagnostic object cleanup availabilityServer-owned Cloudflare R2 storage diagnosticPENDING + Runtime Environment MaskingMasked display verification for secret-bearing variablesServer-owned runtime environment diagnosticPENDING + Limits/Capacity MetricsDB size, connections, storage usage, and R2 Class A/Class B operation signalsServer-owned metrics diagnosticPENDING @@ -472,8 +472,8 @@

Diagnostics

PASSDatabase HealthPostgres is the only planned database provider. - PASSRuntime EnvironmentSecret values are masked in the foundation view. - PENDINGDiagnosticsLive diagnostics log wiring is intentionally deferred. + PASSRuntime EnvironmentSecret values are masked in System Health. + PENDINGDiagnosticsExpanded diagnostics streaming is not configured. diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md new file mode 100644 index 000000000..7cbe75d98 --- /dev/null +++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md @@ -0,0 +1,40 @@ +# PR_26177_CHARLIE_006-system-health-dashboard-complete + +Team: Charlie +Branch: PR_26177_CHARLIE_006-system-health-dashboard-complete +Base: main +Scope: System Health Dashboard completion polish + +## Summary + +- Removed stale foundation and placeholder wording from the Admin System Health dashboard source. +- Kept unavailable provider metrics explicit with safe `PENDING` status and clear reasons. +- Updated service health cards to display `PASS`, `WARN`, `FAIL`, or `NOT CONFIGURED` directly. +- Preserved the Web UI to API/service contract flow; the browser still renders only server-owned System Health data. +- Added targeted assertions for placeholder removal, service status display, secret masking, current-environment-only checks, and externalized Theme V2 script/style rules. + +## Changed Files + +- `admin/system-health.html` +- `src/dev-runtime/server/local-api-router.mjs` +- `tests/dev-runtime/AdminHealthOperations.test.mjs` +- `tests/playwright/tools/AdminHealthOperationsPage.spec.mjs` +- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md` +- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md` +- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md` +- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md` +- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md` +- `docs_build/dev/reports/codex_changed_files.txt` +- `docs_build/dev/reports/codex_review.diff` + +## Validation + +- PASS: `node --check src/dev-runtime/server/local-api-router.mjs` +- PASS: `node --check tests/dev-runtime/AdminHealthOperations.test.mjs` +- PASS: `node --check tests/playwright/tools/AdminHealthOperationsPage.spec.mjs` +- PASS: `node --test tests/dev-runtime/AdminHealthOperations.test.mjs tests/api/admin-system-health/contract.test.mjs` +- PASS: `npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1` + +## Artifact + +- `tmp/PR_26177_CHARLIE_006-system-health-dashboard-complete_delta.zip` diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md new file mode 100644 index 000000000..2368a289b --- /dev/null +++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md @@ -0,0 +1,13 @@ +# PR_26177_CHARLIE_006 Branch Validation + +Result: PASS + +Checks: +- PASS: Started from `main`. +- PASS: Worktree was clean before branch creation. +- PASS: Local/origin sync was `0/0` before branch creation. +- PASS: Branch `PR_26177_CHARLIE_006-system-health-dashboard-complete` was created from current `main`. +- PASS: Scope stayed within System Health Dashboard completion. +- PASS: No `start_of_day` files changed. +- PASS: No direct commits to `main`. +- PASS: PR branch retained for review. diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md new file mode 100644 index 000000000..75244edcf --- /dev/null +++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md @@ -0,0 +1,9 @@ +# PR_26177_CHARLIE_006 Manual Validation Notes + +- Confirmed System Health dashboard copy no longer contains stale `foundation PR`, `foundation view`, `placeholder`, `Pending metric`, or `intentionally not wired` wording. +- Confirmed provider metrics that are not available remain visibly marked `PENDING` with explanatory reasons. +- Confirmed service cards retain existing Theme V2 card layout while displaying direct health status values. +- Confirmed secret-like runtime variables remain masked as `********`. +- Confirmed current-environment System Health behavior remains intact; peer environments are reference-only. +- Confirmed no runtime/UI/API/database files outside the scoped System Health files were changed. +- Confirmed no `start_of_day` files were changed. diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md new file mode 100644 index 000000000..1127e0ea8 --- /dev/null +++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md @@ -0,0 +1,17 @@ +# PR_26177_CHARLIE_006 Requirement Checklist + +- PASS: Environment Summary remains current-deployment only. +- PASS: Postgres Health remains API/service-owned and displays safe values only. +- PASS: R2/Storage Health remains current-environment only. +- PASS: Runtime Environment Variables render from server-owned diagnostics. +- PASS: Runtime variables remain alphabetically sorted by key. +- PASS: Secret-like runtime values remain masked. +- PASS: Service Health cards now display direct `PASS`, `WARN`, `FAIL`, or `NOT CONFIGURED` text. +- PASS: Stale foundation and placeholder wording removed from the dashboard source. +- PASS: Empty/error states remain explicit `PENDING`, `WARN`, or `FAIL` with reasons. +- PASS: Theme V2 layout and externalized scripts/styles preserved. +- PASS: No inline styles, style blocks, script blocks, or inline event handlers introduced. +- PASS: Browser does not own authoritative product data. +- PASS: No MEM DB, local-mem, fake-login, browser storage SSoT, silent fallback, hidden default, or SQLite direction introduced. +- PASS: Targeted tests updated and run. +- PASS: Required reports and delta ZIP created. diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md new file mode 100644 index 000000000..408c9ac5d --- /dev/null +++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md @@ -0,0 +1,20 @@ +# PR_26177_CHARLIE_006 Validation Lane + +Impacted lanes: +- Admin System Health page +- Local API Admin System Health status contract +- System Health Playwright page coverage + +Commands: +- PASS: `node --check src/dev-runtime/server/local-api-router.mjs` +- PASS: `node --check tests/dev-runtime/AdminHealthOperations.test.mjs` +- PASS: `node --check tests/playwright/tools/AdminHealthOperationsPage.spec.mjs` +- PASS: `node --test tests/dev-runtime/AdminHealthOperations.test.mjs tests/api/admin-system-health/contract.test.mjs` + - 6 tests passed. +- PASS: `npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1` + - 3 tests passed. + +Skipped lanes: +- Full samples smoke was not run; this PR only touches targeted Admin System Health dashboard behavior and tests. + +Result: PASS diff --git a/docs_build/dev/reports/codex_changed_files.txt b/docs_build/dev/reports/codex_changed_files.txt index 48675b782..332821506 100644 --- a/docs_build/dev/reports/codex_changed_files.txt +++ b/docs_build/dev/reports/codex_changed_files.txt @@ -1,14 +1,28 @@ -docs_build/dev/BUILD_PR.md -docs_build/dev/PLAN_PR.md -docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md -docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md -docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions.md -docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_branch-validation.md -docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_instruction-compliance-checklist.md -docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_manual-validation-notes.md -docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_requirement-checklist.md -docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_validation-lane.md -docs_build/dev/reports/codex_changed_files.txt -docs_build/dev/reports/codex_review.diff -src/shared/math/randomHelpers.js -src/shared/validation/assert.js +# git status --short +M admin/system-health.html + M docs_build/dev/reports/codex_changed_files.txt + M docs_build/dev/reports/codex_review.diff + M src/dev-runtime/server/local-api-router.mjs + M tests/dev-runtime/AdminHealthOperations.test.mjs + M tests/playwright/tools/AdminHealthOperationsPage.spec.mjs +?? docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md +?? docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md +?? docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md +?? docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md +?? docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md + +# git ls-files --others --exclude-standard +docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md +docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md +docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md +docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md +docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md + +# git diff --stat +admin/system-health.html | 40 +- + docs_build/dev/reports/codex_changed_files.txt | 42 +- + docs_build/dev/reports/codex_review.diff | 765 +++++++++------------ + src/dev-runtime/server/local-api-router.mjs | 10 +- + tests/dev-runtime/AdminHealthOperations.test.mjs | 3 +- + .../tools/AdminHealthOperationsPage.spec.mjs | 4 +- + 6 files changed, 393 insertions(+), 471 deletions(-) \ No newline at end of file diff --git a/docs_build/dev/reports/codex_review.diff b/docs_build/dev/reports/codex_review.diff index 8534f5bf7..7728be52f 100644 --- a/docs_build/dev/reports/codex_review.diff +++ b/docs_build/dev/reports/codex_review.diff @@ -1,458 +1,1140 @@ -diff --git a/docs_build/dev/BUILD_PR.md b/docs_build/dev/BUILD_PR.md -index 2f3f00812..edc9a0b75 100644 ---- a/docs_build/dev/BUILD_PR.md -+++ b/docs_build/dev/BUILD_PR.md -@@ -1,39 +1,40 @@ --# PR_26177_DELTA_055-random-seed-enhancements -+# PR_26177_DELTA_056-shared-validation-assertions - - ## Purpose - --Enhance `RandomSeed` with matching procedural convenience methods. -+Move generic validation/assertion helpers out of random helper code into a shared validation module. - - ## Source Of Truth - --This `BUILD_PR.md`, `PLAN_PR.md`, the user request, and `docs_build/dev/ProjectInstructions.zip` are the source of truth for `PR_26177_DELTA_055-random-seed-enhancements`. -+This `BUILD_PR.md`, `PLAN_PR.md`, the user request, and `docs_build/dev/ProjectInstructions.zip` are the source of truth for `PR_26177_DELTA_056-shared-validation-assertions`. - - ## OWNER Override And Team Assignment - --OWNER override approved: Continue Team Delta random utility stack with `PR_26177_DELTA_055-random-seed-enhancements`. -+OWNER override approved: Continue Team Delta random utility stack with `PR_26177_DELTA_056-shared-validation-assertions`. - - Team Delta owns Shared JS, runtime utilities, technical debt remediation, and runtime test coverage. - - ## Stack - --- Base branch: `PR_26177_DELTA_054-random-utility` --- This PR depends on the shared helper module from PR_053 and the stack context from PR_054. -+- Base branch: `PR_26177_DELTA_055-random-seed-enhancements` -+- This PR depends on the random helper module from PR_053, `Random` from PR_054, and `RandomSeed` enhancements from PR_055. - - ## Exact Scope - --- Update `RandomSeed` to use shared helper logic where appropriate. --- Add: -- - `shuffle(array)` -- - `chance(percent)` -- - `weightedPick(weightedItems)` -- - `saveState()` -- - `restoreState(state)` --- Preserve existing `RandomSeed` sequence compatibility. --- Same seed must still reproduce same sequence. --- Reseeding must still reproduce same sequence. --- Add targeted unit tests for new methods. --- No adoption changes in existing game logic. -+- Create `src/shared/validation/assert.js`. -+- Move generic assertion helpers from random helper code into `assert.js`. -+- Include only generic reusable validation functions needed by current random helpers: -+ - `assertArray` -+ - `assertFiniteNumber` -+ - `assertOrderedRange` -+- Update random helper code to import from `src/shared/validation/assert.js`. -+- Preserve existing `Random` and `RandomSeed` behavior. -+- Do not change public API. -+- Do not expand into unrelated validation functions yet. -+- Add/update targeted unit tests if needed. - - No UI changes. -+- No API/database changes. -+- No unrelated cleanup. - - Create required Codex reports under `docs_build/dev/reports/`. - - Create repo-structured delta ZIP under `tmp/`. - -@@ -43,20 +44,21 @@ Team Delta owns Shared JS, runtime utilities, technical debt remediation, and ru - - `docs_build/dev/BUILD_PR.md` - - `docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md` - - `docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md` --- `src/shared/math/RandomSeed.js` --- `tests/shared/RandomSeed.test.mjs` --- `docs_build/dev/reports/PR_26177_DELTA_055-random-seed-enhancements.md` --- `docs_build/dev/reports/PR_26177_DELTA_055-random-seed-enhancements_branch-validation.md` --- `docs_build/dev/reports/PR_26177_DELTA_055-random-seed-enhancements_requirement-checklist.md` --- `docs_build/dev/reports/PR_26177_DELTA_055-random-seed-enhancements_validation-lane.md` --- `docs_build/dev/reports/PR_26177_DELTA_055-random-seed-enhancements_manual-validation-notes.md` --- `docs_build/dev/reports/PR_26177_DELTA_055-random-seed-enhancements_instruction-compliance-checklist.md` -+- `src/shared/validation/assert.js` -+- `src/shared/math/randomHelpers.js` -+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions.md` -+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_branch-validation.md` -+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_requirement-checklist.md` -+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_validation-lane.md` -+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_manual-validation-notes.md` -+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_instruction-compliance-checklist.md` - - `docs_build/dev/reports/codex_review.diff` - - `docs_build/dev/reports/codex_changed_files.txt` - - ## Out Of Scope - --- No seeded `next()` algorithm changes. -+- No public API changes. -+- No new unrelated validation helpers. - - No existing game logic adoption changes. - - No UI changes. - - No browser storage changes. -@@ -70,9 +72,9 @@ Team Delta owns Shared JS, runtime utilities, technical debt remediation, and ru - Run exactly: - - ```powershell --node ./scripts/run-node-test-files.mjs tests/shared/RandomSeed.test.mjs tests/shared/RandomHelpers.test.mjs --node --check src/shared/math/RandomSeed.js --node --check tests/shared/RandomSeed.test.mjs -+node ./scripts/run-node-test-files.mjs tests/shared/RandomHelpers.test.mjs tests/shared/Random.test.mjs tests/shared/RandomSeed.test.mjs -+node --check src/shared/validation/assert.js -+node --check src/shared/math/randomHelpers.js - git diff --check - ``` - -@@ -83,5 +85,5 @@ Playwright is not required because this PR does not change UI or browser runtime - Create repo-structured delta ZIP: - - ```text --tmp/PR_26177_DELTA_055-random-seed-enhancements_delta.zip -+tmp/PR_26177_DELTA_056-shared-validation-assertions_delta.zip - ``` -diff --git a/docs_build/dev/PLAN_PR.md b/docs_build/dev/PLAN_PR.md -index 87120e264..de53f9020 100644 ---- a/docs_build/dev/PLAN_PR.md -+++ b/docs_build/dev/PLAN_PR.md -@@ -1,42 +1,43 @@ --# PLAN_PR: PR_26177_DELTA_055-random-seed-enhancements -+# PLAN_PR: PR_26177_DELTA_056-shared-validation-assertions - - ## Purpose - --Enhance `RandomSeed` with matching procedural convenience methods. -+Move generic validation/assertion helpers out of random helper code into a shared validation module. - - ## Owner And Assignment - - - Team: Delta --- OWNER override approved: Continue Team Delta random utility stack with `PR_26177_DELTA_055-random-seed-enhancements`. --- Stack base: `PR_26177_DELTA_054-random-utility`. -+- OWNER override approved: Continue Team Delta random utility stack with `PR_26177_DELTA_056-shared-validation-assertions`. -+- Stack base: `PR_26177_DELTA_055-random-seed-enhancements`. - - ## Scope - --- Update `RandomSeed` to use shared helper logic where appropriate. --- Add: -- - `shuffle(array)` -- - `chance(percent)` -- - `weightedPick(weightedItems)` -- - `saveState()` -- - `restoreState(state)` --- Preserve existing `RandomSeed` sequence compatibility. --- Same seed must still reproduce same sequence. --- Reseeding must still reproduce same sequence. --- Add targeted unit tests for new methods. --- No adoption changes in existing game logic. -+- Create `src/shared/validation/assert.js`. -+- Move generic assertion helpers from random helper code into `assert.js`. -+- Include only generic reusable validation functions needed by current random helpers: -+ - `assertArray` -+ - `assertFiniteNumber` -+ - `assertOrderedRange` -+- Update random helper code to import from `src/shared/validation/assert.js`. -+- Preserve existing `Random` and `RandomSeed` behavior. -+- Do not change public API. -+- Do not expand into unrelated validation functions yet. -+- Add/update targeted unit tests if needed. - - No UI changes. -+- No API/database changes. -+- No unrelated cleanup. - - ## Implementation Plan - --1. Update `src/shared/math/RandomSeed.js` to reuse `randomHelpers.js` for procedural helper methods. --2. Keep the existing seeded `next()` algorithm unchanged. --3. Add state save/restore methods. --4. Extend `tests/shared/RandomSeed.test.mjs` with sequence compatibility, new method, and state tests. -+1. Add `src/shared/validation/assert.js` with only the required generic assertion helpers. -+2. Remove duplicated generic assertions from `src/shared/math/randomHelpers.js`. -+3. Import the shared assertions from `randomHelpers.js`. -+4. Run targeted random helper, `Random`, and `RandomSeed` tests. - 5. Produce required PR reports and repo-structured ZIP. - - ## Acceptance Criteria - --- Existing seeded sequence values remain compatible. --- Same seed and reseeding behavior remain deterministic. --- New procedural methods use the same seeded random stream. --- State save/restore resumes the sequence from the saved point. -+- Existing random helper behavior is preserved. -+- Existing `Random` and `RandomSeed` behavior is preserved. -+- Public random APIs are unchanged. -+- Shared assertion module stays limited to the current reusable validation helpers. -diff --git a/docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md b/docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md -index 9dcd7244d..6341fdf34 100644 ---- a/docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md -+++ b/docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md -@@ -31,7 +31,7 @@ If a team has no assignment, no active branch, and no active PR, it is inactive - | Team Alfa | none | none | none | Available | Active ownership lane | - | Team Bravo | none | none | none | Available | Active ownership lane | - | Team Charlie | none | none | none | Available | Active ownership lane | --| Team Delta | PR_26177_DELTA_055-random-seed-enhancements | PR_26177_DELTA_055-random-seed-enhancements | PR_26177_DELTA_055-random-seed-enhancements | Active | OWNER override approved: Continue Team Delta random utility stack with PR_26177_DELTA_055-random-seed-enhancements | -+| Team Delta | PR_26177_DELTA_056-shared-validation-assertions | PR_26177_DELTA_056-shared-validation-assertions | PR_26177_DELTA_056-shared-validation-assertions | Active | OWNER override approved: Continue Team Delta random utility stack with PR_26177_DELTA_056-shared-validation-assertions | - | Team Golf | none | none | none | Available | Replacement active ownership lane for retired Team Gamma | - | Team OWNER | none | none | none | Available | Governance Phase 1 complete | - -diff --git a/docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md b/docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md -index 3b49412c4..9735b4bd4 100644 ---- a/docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md -+++ b/docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md -@@ -7,7 +7,7 @@ - | Team Alfa | none | none | none | Available | - | Team Bravo | none | none | none | Available | - | Team Charlie | none | none | none | Available | --| Team Delta | PR_26177_DELTA_055-random-seed-enhancements | PR_26177_DELTA_055-random-seed-enhancements | PR_26177_DELTA_055-random-seed-enhancements | Active | -+| Team Delta | PR_26177_DELTA_056-shared-validation-assertions | PR_26177_DELTA_056-shared-validation-assertions | PR_26177_DELTA_056-shared-validation-assertions | Active | - | Team Golf | none | none | none | Available | - | Team OWNER | none | none | none | Available | - -@@ -50,13 +50,13 @@ Current OWNER clarification: - - Status: Active - --Active assignment: PR_26177_DELTA_055-random-seed-enhancements. -+Active assignment: PR_26177_DELTA_056-shared-validation-assertions. - --Active branch: PR_26177_DELTA_055-random-seed-enhancements. -+Active branch: PR_26177_DELTA_056-shared-validation-assertions. - --Active PR: PR_26177_DELTA_055-random-seed-enhancements. -+Active PR: PR_26177_DELTA_056-shared-validation-assertions. - --OWNER override approved: Continue Team Delta random utility stack with PR_26177_DELTA_055-random-seed-enhancements. -+OWNER override approved: Continue Team Delta random utility stack with PR_26177_DELTA_056-shared-validation-assertions. +diff --git a/admin/system-health.html b/admin/system-health.html +index 5294d7d6e..0810945e9 100644 +--- a/admin/system-health.html ++++ b/admin/system-health.html +@@ -6,7 +6,7 @@ + + + System Health - Game Foundry Studio LLC +- ++ + + + +@@ -18,7 +18,7 @@ +
+
Admin
+

System Health

+-

Review the foundation view for environment, Postgres, Cloudflare R2, runtime configuration, capacity, and diagnostics.

++

Review current deployment health for environment, Postgres, Cloudflare R2, runtime configuration, capacity, and diagnostics.

+
+
+
+@@ -67,7 +67,7 @@ +
+
+
+-
Foundation
++
Current Deployment
+

System Health Tables

+
+
+@@ -400,7 +400,7 @@ + + + CLOUDFLARE_R2_ACCESS_KEY_ID********PASS +- CLOUDFLARE_R2_BUCKETConfigured bucket placeholderPENDING ++ CLOUDFLARE_R2_BUCKETLoadingPENDING + CLOUDFLARE_R2_SECRET_ACCESS_KEY********PASS + DATABASE_URL********PASS + GAMEFOUNDRY_ENVIRONMENTDEV / IST / UAT / PRDPASS +@@ -419,11 +419,11 @@ + + + +- DB SizePending metricThreshold not connectedPENDING +- ConnectionsPending metricPool usage not connectedPENDING +- StoragePending metricBucket usage not connectedPENDING +- Class A OpsPending metricR2 write/list budget not connectedPENDING +- Class B OpsPending metricR2 read budget not connectedPENDING ++ DB SizeUnavailableProvider telemetry not configuredPENDING ++ ConnectionsUnavailablePool telemetry not configuredPENDING ++ StorageUnavailableBucket usage telemetry not configuredPENDING ++ Class A OpsUnavailableR2 write/list telemetry not configuredPENDING ++ Class B OpsUnavailableR2 read telemetry not configuredPENDING + + +
+@@ -439,15 +439,15 @@ + + + +- Postgres ConnectionConnection success, latency, and actionable failure detailServer-owned Postgres health readerPENDING +- Postgres Migration ReaderCurrent migration version and pending migration signalServer-owned Postgres migration readerPENDING +- R2 Bucket ConfiguredConfigured bucket name presence without exposing secretsServer-owned Cloudflare R2 configuration readerPENDING +- R2 ListList operation availability and scoped prefix resultServer-owned Cloudflare R2 storage diagnosticPENDING +- R2 ReadHealth object read availabilityServer-owned Cloudflare R2 storage diagnosticPENDING +- R2 WriteHealth object write availabilityServer-owned Cloudflare R2 storage diagnosticPENDING +- R2 DeleteHealth object cleanup availabilityServer-owned Cloudflare R2 storage diagnosticPENDING +- Runtime Environment MaskingMasked display verification for secret-bearing variablesServer-owned runtime environment diagnosticPENDING +- Limits/Capacity MetricsDB size, connections, storage usage, and R2 Class A/Class B operation signalsServer-owned metrics diagnosticPENDING ++ Postgres ConnectionConnection success, latency, and actionable failure detailServer-owned Postgres health readerPENDING ++ Postgres Migration ReaderCurrent migration version and migration signalServer-owned Postgres migration readerPENDING ++ R2 Bucket ConfiguredConfigured bucket name presence without exposing secretsServer-owned Cloudflare R2 configuration readerPENDING ++ R2 ListList operation availability and scoped prefix resultServer-owned Cloudflare R2 storage diagnosticPENDING ++ R2 ReadDiagnostic object read availabilityServer-owned Cloudflare R2 storage diagnosticPENDING ++ R2 WriteDiagnostic object write availabilityServer-owned Cloudflare R2 storage diagnosticPENDING ++ R2 DeleteDiagnostic object cleanup availabilityServer-owned Cloudflare R2 storage diagnosticPENDING ++ Runtime Environment MaskingMasked display verification for secret-bearing variablesServer-owned runtime environment diagnosticPENDING ++ Limits/Capacity MetricsDB size, connections, storage usage, and R2 Class A/Class B operation signalsServer-owned metrics diagnosticPENDING + + + +@@ -472,8 +472,8 @@ + + + PASSDatabase HealthPostgres is the only planned database provider. +- PASSRuntime EnvironmentSecret values are masked in the foundation view. +- PENDINGDiagnosticsLive diagnostics log wiring is intentionally deferred. ++ PASSRuntime EnvironmentSecret values are masked in System Health. ++ PENDINGDiagnosticsExpanded diagnostics streaming is not configured. + + + +diff --git a/docs_build/dev/reports/codex_changed_files.txt b/docs_build/dev/reports/codex_changed_files.txt +index 48675b782..713a4c0d7 100644 +--- a/docs_build/dev/reports/codex_changed_files.txt ++++ b/docs_build/dev/reports/codex_changed_files.txt +@@ -1,14 +1,28 @@ +-docs_build/dev/BUILD_PR.md +-docs_build/dev/PLAN_PR.md +-docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md +-docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md +-docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions.md +-docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_branch-validation.md +-docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_instruction-compliance-checklist.md +-docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_manual-validation-notes.md +-docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_requirement-checklist.md +-docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_validation-lane.md +-docs_build/dev/reports/codex_changed_files.txt +-docs_build/dev/reports/codex_review.diff +-src/shared/math/randomHelpers.js +-src/shared/validation/assert.js ++# git status --short ++M admin/system-health.html ++ M docs_build/dev/reports/coverage_changed_js_guardrail.txt ++ M docs_build/dev/reports/playwright_v8_coverage_report.txt ++ M src/dev-runtime/server/local-api-router.mjs ++ M tests/dev-runtime/AdminHealthOperations.test.mjs ++ M tests/playwright/tools/AdminHealthOperationsPage.spec.mjs ++?? docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md ++?? docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md ++?? docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md ++?? docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md ++?? docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md ++ ++# git ls-files --others --exclude-standard ++docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md ++docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md ++docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md ++docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md ++docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md ++ ++# git diff --stat ++admin/system-health.html | 40 +++++++++++----------- ++ .../dev/reports/coverage_changed_js_guardrail.txt | 6 ++-- ++ .../dev/reports/playwright_v8_coverage_report.txt | 33 ++++++++---------- ++ src/dev-runtime/server/local-api-router.mjs | 10 +++--- ++ tests/dev-runtime/AdminHealthOperations.test.mjs | 3 +- ++ .../tools/AdminHealthOperationsPage.spec.mjs | 4 ++- ++ 6 files changed, 47 insertions(+), 49 deletions(-) +\ No newline at end of file +diff --git a/docs_build/dev/reports/codex_review.diff b/docs_build/dev/reports/codex_review.diff +index 8534f5bf7..963b44f35 100644 +--- a/docs_build/dev/reports/codex_review.diff ++++ b/docs_build/dev/reports/codex_review.diff +@@ -1,458 +1,363 @@ +-diff --git a/docs_build/dev/BUILD_PR.md b/docs_build/dev/BUILD_PR.md +-index 2f3f00812..edc9a0b75 100644 +---- a/docs_build/dev/BUILD_PR.md +-+++ b/docs_build/dev/BUILD_PR.md +-@@ -1,39 +1,40 @@ +--# PR_26177_DELTA_055-random-seed-enhancements +-+# PR_26177_DELTA_056-shared-validation-assertions +- +- ## Purpose +- +--Enhance `RandomSeed` with matching procedural convenience methods. +-+Move generic validation/assertion helpers out of random helper code into a shared validation module. +- +- ## Source Of Truth +- +--This `BUILD_PR.md`, `PLAN_PR.md`, the user request, and `docs_build/dev/ProjectInstructions.zip` are the source of truth for `PR_26177_DELTA_055-random-seed-enhancements`. +-+This `BUILD_PR.md`, `PLAN_PR.md`, the user request, and `docs_build/dev/ProjectInstructions.zip` are the source of truth for `PR_26177_DELTA_056-shared-validation-assertions`. +- +- ## OWNER Override And Team Assignment +- +--OWNER override approved: Continue Team Delta random utility stack with `PR_26177_DELTA_055-random-seed-enhancements`. +-+OWNER override approved: Continue Team Delta random utility stack with `PR_26177_DELTA_056-shared-validation-assertions`. +- +- Team Delta owns Shared JS, runtime utilities, technical debt remediation, and runtime test coverage. +- +- ## Stack +- +--- Base branch: `PR_26177_DELTA_054-random-utility` +--- This PR depends on the shared helper module from PR_053 and the stack context from PR_054. +-+- Base branch: `PR_26177_DELTA_055-random-seed-enhancements` +-+- This PR depends on the random helper module from PR_053, `Random` from PR_054, and `RandomSeed` enhancements from PR_055. +- +- ## Exact Scope +- +--- Update `RandomSeed` to use shared helper logic where appropriate. +--- Add: +-- - `shuffle(array)` +-- - `chance(percent)` +-- - `weightedPick(weightedItems)` +-- - `saveState()` +-- - `restoreState(state)` +--- Preserve existing `RandomSeed` sequence compatibility. +--- Same seed must still reproduce same sequence. +--- Reseeding must still reproduce same sequence. +--- Add targeted unit tests for new methods. +--- No adoption changes in existing game logic. +-+- Create `src/shared/validation/assert.js`. +-+- Move generic assertion helpers from random helper code into `assert.js`. +-+- Include only generic reusable validation functions needed by current random helpers: +-+ - `assertArray` +-+ - `assertFiniteNumber` +-+ - `assertOrderedRange` +-+- Update random helper code to import from `src/shared/validation/assert.js`. +-+- Preserve existing `Random` and `RandomSeed` behavior. +-+- Do not change public API. +-+- Do not expand into unrelated validation functions yet. +-+- Add/update targeted unit tests if needed. +- - No UI changes. +-+- No API/database changes. +-+- No unrelated cleanup. +- - Create required Codex reports under `docs_build/dev/reports/`. +- - Create repo-structured delta ZIP under `tmp/`. +- +-@@ -43,20 +44,21 @@ Team Delta owns Shared JS, runtime utilities, technical debt remediation, and ru +- - `docs_build/dev/BUILD_PR.md` +- - `docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md` +- - `docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md` +--- `src/shared/math/RandomSeed.js` +--- `tests/shared/RandomSeed.test.mjs` +--- `docs_build/dev/reports/PR_26177_DELTA_055-random-seed-enhancements.md` +--- `docs_build/dev/reports/PR_26177_DELTA_055-random-seed-enhancements_branch-validation.md` +--- `docs_build/dev/reports/PR_26177_DELTA_055-random-seed-enhancements_requirement-checklist.md` +--- `docs_build/dev/reports/PR_26177_DELTA_055-random-seed-enhancements_validation-lane.md` +--- `docs_build/dev/reports/PR_26177_DELTA_055-random-seed-enhancements_manual-validation-notes.md` +--- `docs_build/dev/reports/PR_26177_DELTA_055-random-seed-enhancements_instruction-compliance-checklist.md` +-+- `src/shared/validation/assert.js` +-+- `src/shared/math/randomHelpers.js` +-+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions.md` +-+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_branch-validation.md` +-+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_requirement-checklist.md` +-+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_validation-lane.md` +-+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_manual-validation-notes.md` +-+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_instruction-compliance-checklist.md` +- - `docs_build/dev/reports/codex_review.diff` +- - `docs_build/dev/reports/codex_changed_files.txt` +- +- ## Out Of Scope +- +--- No seeded `next()` algorithm changes. +-+- No public API changes. +-+- No new unrelated validation helpers. +- - No existing game logic adoption changes. +- - No UI changes. +- - No browser storage changes. +-@@ -70,9 +72,9 @@ Team Delta owns Shared JS, runtime utilities, technical debt remediation, and ru +- Run exactly: +- +- ```powershell +--node ./scripts/run-node-test-files.mjs tests/shared/RandomSeed.test.mjs tests/shared/RandomHelpers.test.mjs +--node --check src/shared/math/RandomSeed.js +--node --check tests/shared/RandomSeed.test.mjs +-+node ./scripts/run-node-test-files.mjs tests/shared/RandomHelpers.test.mjs tests/shared/Random.test.mjs tests/shared/RandomSeed.test.mjs +-+node --check src/shared/validation/assert.js +-+node --check src/shared/math/randomHelpers.js +- git diff --check +- ``` +- +-@@ -83,5 +85,5 @@ Playwright is not required because this PR does not change UI or browser runtime +- Create repo-structured delta ZIP: +- +- ```text +--tmp/PR_26177_DELTA_055-random-seed-enhancements_delta.zip +-+tmp/PR_26177_DELTA_056-shared-validation-assertions_delta.zip +- ``` +-diff --git a/docs_build/dev/PLAN_PR.md b/docs_build/dev/PLAN_PR.md +-index 87120e264..de53f9020 100644 +---- a/docs_build/dev/PLAN_PR.md +-+++ b/docs_build/dev/PLAN_PR.md +-@@ -1,42 +1,43 @@ +--# PLAN_PR: PR_26177_DELTA_055-random-seed-enhancements +-+# PLAN_PR: PR_26177_DELTA_056-shared-validation-assertions +- +- ## Purpose +- +--Enhance `RandomSeed` with matching procedural convenience methods. +-+Move generic validation/assertion helpers out of random helper code into a shared validation module. +- +- ## Owner And Assignment +- +- - Team: Delta +--- OWNER override approved: Continue Team Delta random utility stack with `PR_26177_DELTA_055-random-seed-enhancements`. +--- Stack base: `PR_26177_DELTA_054-random-utility`. +-+- OWNER override approved: Continue Team Delta random utility stack with `PR_26177_DELTA_056-shared-validation-assertions`. +-+- Stack base: `PR_26177_DELTA_055-random-seed-enhancements`. +- +- ## Scope +- +--- Update `RandomSeed` to use shared helper logic where appropriate. +--- Add: +-- - `shuffle(array)` +-- - `chance(percent)` +-- - `weightedPick(weightedItems)` +-- - `saveState()` +-- - `restoreState(state)` +--- Preserve existing `RandomSeed` sequence compatibility. +--- Same seed must still reproduce same sequence. +--- Reseeding must still reproduce same sequence. +--- Add targeted unit tests for new methods. +--- No adoption changes in existing game logic. +-+- Create `src/shared/validation/assert.js`. +-+- Move generic assertion helpers from random helper code into `assert.js`. +-+- Include only generic reusable validation functions needed by current random helpers: +-+ - `assertArray` +-+ - `assertFiniteNumber` +-+ - `assertOrderedRange` +-+- Update random helper code to import from `src/shared/validation/assert.js`. +-+- Preserve existing `Random` and `RandomSeed` behavior. +-+- Do not change public API. +-+- Do not expand into unrelated validation functions yet. +-+- Add/update targeted unit tests if needed. +- - No UI changes. +-+- No API/database changes. +-+- No unrelated cleanup. +- +- ## Implementation Plan +- +--1. Update `src/shared/math/RandomSeed.js` to reuse `randomHelpers.js` for procedural helper methods. +--2. Keep the existing seeded `next()` algorithm unchanged. +--3. Add state save/restore methods. +--4. Extend `tests/shared/RandomSeed.test.mjs` with sequence compatibility, new method, and state tests. +-+1. Add `src/shared/validation/assert.js` with only the required generic assertion helpers. +-+2. Remove duplicated generic assertions from `src/shared/math/randomHelpers.js`. +-+3. Import the shared assertions from `randomHelpers.js`. +-+4. Run targeted random helper, `Random`, and `RandomSeed` tests. +- 5. Produce required PR reports and repo-structured ZIP. +- +- ## Acceptance Criteria +- +--- Existing seeded sequence values remain compatible. +--- Same seed and reseeding behavior remain deterministic. +--- New procedural methods use the same seeded random stream. +--- State save/restore resumes the sequence from the saved point. +-+- Existing random helper behavior is preserved. +-+- Existing `Random` and `RandomSeed` behavior is preserved. +-+- Public random APIs are unchanged. +-+- Shared assertion module stays limited to the current reusable validation helpers. +-diff --git a/docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md b/docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md +-index 9dcd7244d..6341fdf34 100644 +---- a/docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md +-+++ b/docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md +-@@ -31,7 +31,7 @@ If a team has no assignment, no active branch, and no active PR, it is inactive +- | Team Alfa | none | none | none | Available | Active ownership lane | +- | Team Bravo | none | none | none | Available | Active ownership lane | +- | Team Charlie | none | none | none | Available | Active ownership lane | +--| Team Delta | PR_26177_DELTA_055-random-seed-enhancements | PR_26177_DELTA_055-random-seed-enhancements | PR_26177_DELTA_055-random-seed-enhancements | Active | OWNER override approved: Continue Team Delta random utility stack with PR_26177_DELTA_055-random-seed-enhancements | +-+| Team Delta | PR_26177_DELTA_056-shared-validation-assertions | PR_26177_DELTA_056-shared-validation-assertions | PR_26177_DELTA_056-shared-validation-assertions | Active | OWNER override approved: Continue Team Delta random utility stack with PR_26177_DELTA_056-shared-validation-assertions | +- | Team Golf | none | none | none | Available | Replacement active ownership lane for retired Team Gamma | +- | Team OWNER | none | none | none | Available | Governance Phase 1 complete | +- +-diff --git a/docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md b/docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md +-index 3b49412c4..9735b4bd4 100644 +---- a/docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md +-+++ b/docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md +-@@ -7,7 +7,7 @@ +- | Team Alfa | none | none | none | Available | +- | Team Bravo | none | none | none | Available | +- | Team Charlie | none | none | none | Available | +--| Team Delta | PR_26177_DELTA_055-random-seed-enhancements | PR_26177_DELTA_055-random-seed-enhancements | PR_26177_DELTA_055-random-seed-enhancements | Active | +-+| Team Delta | PR_26177_DELTA_056-shared-validation-assertions | PR_26177_DELTA_056-shared-validation-assertions | PR_26177_DELTA_056-shared-validation-assertions | Active | +- | Team Golf | none | none | none | Available | +- | Team OWNER | none | none | none | Available | +- +-@@ -50,13 +50,13 @@ Current OWNER clarification: +- +- Status: Active +- +--Active assignment: PR_26177_DELTA_055-random-seed-enhancements. +-+Active assignment: PR_26177_DELTA_056-shared-validation-assertions. +- +--Active branch: PR_26177_DELTA_055-random-seed-enhancements. +-+Active branch: PR_26177_DELTA_056-shared-validation-assertions. +- +--Active PR: PR_26177_DELTA_055-random-seed-enhancements. +-+Active PR: PR_26177_DELTA_056-shared-validation-assertions. +- +--OWNER override approved: Continue Team Delta random utility stack with PR_26177_DELTA_055-random-seed-enhancements. +-+OWNER override approved: Continue Team Delta random utility stack with PR_26177_DELTA_056-shared-validation-assertions. +- +- ## Team Bravo +- +-diff --git a/src/shared/math/randomHelpers.js b/src/shared/math/randomHelpers.js +-index 5df891668..103ae7db5 100644 +---- a/src/shared/math/randomHelpers.js +-+++ b/src/shared/math/randomHelpers.js +-@@ -1,3 +1,5 @@ +-+import { assertArray, assertFiniteNumber, assertOrderedRange } from "../validation/assert.js"; +-+ +- function assertRandomNext(randomNext) { +- if (typeof randomNext !== "function") { +- throw new TypeError("randomNext must be a function."); +-@@ -15,27 +17,6 @@ function readRandomValue(randomNext) { +- return value; ++diff --git a/admin/system-health.html b/admin/system-health.html ++index 5294d7d6e..0810945e9 100644 ++--- a/admin/system-health.html +++++ b/admin/system-health.html ++@@ -6,7 +6,7 @@ ++ ++ ++ System Health - Game Foundry Studio LLC ++- +++ ++ ++ ++ ++@@ -18,7 +18,7 @@ ++
++
Admin
++

System Health

++-

Review the foundation view for environment, Postgres, Cloudflare R2, runtime configuration, capacity, and diagnostics.

+++

Review current deployment health for environment, Postgres, Cloudflare R2, runtime configuration, capacity, and diagnostics.

++
++
++
++@@ -67,7 +67,7 @@ ++
++
++
++-
Foundation
+++
Current Deployment
++

System Health Tables

++
++
++@@ -400,7 +400,7 @@ ++ ++ ++ CLOUDFLARE_R2_ACCESS_KEY_ID********PASS ++- CLOUDFLARE_R2_BUCKETConfigured bucket placeholderPENDING +++ CLOUDFLARE_R2_BUCKETLoadingPENDING ++ CLOUDFLARE_R2_SECRET_ACCESS_KEY********PASS ++ DATABASE_URL********PASS ++ GAMEFOUNDRY_ENVIRONMENTDEV / IST / UAT / PRDPASS ++@@ -419,11 +419,11 @@ ++ ++ ++ ++- DB SizePending metricThreshold not connectedPENDING ++- ConnectionsPending metricPool usage not connectedPENDING ++- StoragePending metricBucket usage not connectedPENDING ++- Class A OpsPending metricR2 write/list budget not connectedPENDING ++- Class B OpsPending metricR2 read budget not connectedPENDING +++ DB SizeUnavailableProvider telemetry not configuredPENDING +++ ConnectionsUnavailablePool telemetry not configuredPENDING +++ StorageUnavailableBucket usage telemetry not configuredPENDING +++ Class A OpsUnavailableR2 write/list telemetry not configuredPENDING +++ Class B OpsUnavailableR2 read telemetry not configuredPENDING ++ ++ ++
++@@ -439,15 +439,15 @@ ++ ++ ++ ++- Postgres ConnectionConnection success, latency, and actionable failure detailServer-owned Postgres health readerPENDING ++- Postgres Migration ReaderCurrent migration version and pending migration signalServer-owned Postgres migration readerPENDING ++- R2 Bucket ConfiguredConfigured bucket name presence without exposing secretsServer-owned Cloudflare R2 configuration readerPENDING ++- R2 ListList operation availability and scoped prefix resultServer-owned Cloudflare R2 storage diagnosticPENDING ++- R2 ReadHealth object read availabilityServer-owned Cloudflare R2 storage diagnosticPENDING ++- R2 WriteHealth object write availabilityServer-owned Cloudflare R2 storage diagnosticPENDING ++- R2 DeleteHealth object cleanup availabilityServer-owned Cloudflare R2 storage diagnosticPENDING ++- Runtime Environment MaskingMasked display verification for secret-bearing variablesServer-owned runtime environment diagnosticPENDING ++- Limits/Capacity MetricsDB size, connections, storage usage, and R2 Class A/Class B operation signalsServer-owned metrics diagnosticPENDING +++ Postgres ConnectionConnection success, latency, and actionable failure detailServer-owned Postgres health readerPENDING +++ Postgres Migration ReaderCurrent migration version and migration signalServer-owned Postgres migration readerPENDING +++ R2 Bucket ConfiguredConfigured bucket name presence without exposing secretsServer-owned Cloudflare R2 configuration readerPENDING +++ R2 ListList operation availability and scoped prefix resultServer-owned Cloudflare R2 storage diagnosticPENDING +++ R2 ReadDiagnostic object read availabilityServer-owned Cloudflare R2 storage diagnosticPENDING +++ R2 WriteDiagnostic object write availabilityServer-owned Cloudflare R2 storage diagnosticPENDING +++ R2 DeleteDiagnostic object cleanup availabilityServer-owned Cloudflare R2 storage diagnosticPENDING +++ Runtime Environment MaskingMasked display verification for secret-bearing variablesServer-owned runtime environment diagnosticPENDING +++ Limits/Capacity MetricsDB size, connections, storage usage, and R2 Class A/Class B operation signalsServer-owned metrics diagnosticPENDING ++ ++ ++ ++@@ -472,8 +472,8 @@ ++ ++ ++ PASSDatabase HealthPostgres is the only planned database provider. ++- PASSRuntime EnvironmentSecret values are masked in the foundation view. ++- PENDINGDiagnosticsLive diagnostics log wiring is intentionally deferred. +++ PASSRuntime EnvironmentSecret values are masked in System Health. +++ PENDINGDiagnosticsExpanded diagnostics streaming is not configured. ++ ++ ++ ++diff --git a/docs_build/dev/reports/coverage_changed_js_guardrail.txt b/docs_build/dev/reports/coverage_changed_js_guardrail.txt ++index 01a698376..74a29674c 100644 ++--- a/docs_build/dev/reports/coverage_changed_js_guardrail.txt +++++ b/docs_build/dev/reports/coverage_changed_js_guardrail.txt ++@@ -6,9 +6,7 @@ Missing changed runtime JS files are WARN, not FAIL. ++ Source: Playwright/Chromium built-in V8 coverage from the active Playwright run. ++ ++ Changed runtime JS files considered: ++-(0%) src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only ++-(0%) src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only +++(0%) src/dev-runtime/server/local-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only ++ ++ Guardrail warnings: ++-(0%) src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs - WARNING: changed runtime JS file missing from coverage; advisory only ++-(0%) src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs - WARNING: changed runtime JS file missing from coverage; advisory only +++(0%) src/dev-runtime/server/local-api-router.mjs - WARNING: changed runtime JS file missing from coverage; advisory only ++diff --git a/docs_build/dev/reports/playwright_v8_coverage_report.txt b/docs_build/dev/reports/playwright_v8_coverage_report.txt ++index da369bcdb..cc856ba25 100644 ++--- a/docs_build/dev/reports/playwright_v8_coverage_report.txt +++++ b/docs_build/dev/reports/playwright_v8_coverage_report.txt ++@@ -12,33 +12,30 @@ Note: entry percentages use function coverage when available, otherwise line cov ++ Note: coverage entries are aggregated across every page/tool where coverageReporter.start(page) and coverageReporter.stop(page) ran. ++ ++ Exercised tool entry points detected: ++-(76%) Toolbox Index - exercised 1 runtime JS files +++(46%) Toolbox Index - exercised 1 runtime JS files ++ (0%) Tool Template V2 - not exercised by this Playwright run ++-(72%) Theme V2 Shared JS - exercised 4 runtime JS files +++(78%) Theme V2 Shared JS - exercised 5 runtime JS files ++ ++ Changed runtime JS files covered: ++-(0%) src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only ++-(0%) src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only +++(0%) src/dev-runtime/server/local-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only ++ ++ Files with executed line/function counts where available: ++-(36%) src/shared/toolbox/tool-metadata-inventory.js - executed lines 2041/2041; executed functions 12/33 ++-(53%) src/api/server-api-client.js - executed lines 168/168; executed functions 10/19 ++-(64%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 1046/1046; executed functions 63/98 +++(36%) src/api/server-api-client.js - executed lines 168/168; executed functions 5/14 +++(46%) toolbox/tool-registry-api-client.js - executed lines 155/155; executed functions 12/26 ++ (65%) src/api/public-config-client.js - executed lines 209/209; executed functions 17/26 ++-(67%) src/api/game-journey-completion-api-client.js - executed lines 15/15; executed functions 2/3 ++-(73%) assets/toolbox/game-journey/js/index.js - executed lines 1662/1662; executed functions 108/148 ++-(76%) toolbox/tool-registry-api-client.js - executed lines 155/155; executed functions 22/29 +++(75%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 1046/1046; executed functions 76/102 ++ (77%) assets/theme-v2/js/tool-display-mode.js - executed lines 304/304; executed functions 23/30 +++(80%) assets/theme-v2/js/admin-system-health.js - executed lines 920/920; executed functions 74/92 ++ (80%) assets/theme-v2/js/theme-icons.js - executed lines 69/69; executed functions 4/5 ++-(89%) assets/theme-v2/js/toolbox-status-bar.js - executed lines 427/427; executed functions 32/36 ++-(100%) assets/js/shared/game-journey-api-client.js - executed lines 19/19; executed functions 2/2 +++(80%) src/api/admin-owner-navigation.js - executed lines 42/42; executed functions 4/5 +++(83%) assets/js/shared/status.js - executed lines 37/37; executed functions 5/6 +++(91%) assets/theme-v2/js/admin-owner-navigation.js - executed lines 58/58; executed functions 10/11 +++(100%) src/api/admin-system-health-api-client.js - executed lines 31/31; executed functions 5/5 ++ ++ Uncovered or low-coverage changed JS files: ++-(0%) src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs - WARNING: uncovered changed runtime JS file; advisory only ++-(0%) src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs - WARNING: uncovered changed runtime JS file; advisory only +++(0%) src/dev-runtime/server/local-api-router.mjs - WARNING: uncovered changed runtime JS file; advisory only ++ ++ Changed JS files considered: ++-(0%) scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs - changed JS file not collected as browser runtime coverage ++-(0%) src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs - changed JS file not collected as browser runtime coverage ++-(0%) src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs - changed JS file not collected as browser runtime coverage ++-(0%) tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs - changed JS file not collected as browser runtime coverage +++(0%) src/dev-runtime/server/local-api-router.mjs - changed JS file not collected as browser runtime coverage +++(0%) tests/dev-runtime/AdminHealthOperations.test.mjs - changed JS file not collected as browser runtime coverage +++(0%) tests/playwright/tools/AdminHealthOperationsPage.spec.mjs - changed JS file not collected as browser runtime coverage ++diff --git a/src/dev-runtime/server/local-api-router.mjs b/src/dev-runtime/server/local-api-router.mjs ++index f2f927aff..f20e47b4c 100644 ++--- a/src/dev-runtime/server/local-api-router.mjs +++++ b/src/dev-runtime/server/local-api-router.mjs ++@@ -1416,16 +1416,16 @@ function systemHealthRuntimeHealth(environmentIdentity = {}, checkedAt = new Dat ++ ++ function systemHealthServiceDisplayStatus(status, configured = true) { ++ if (configured === false) { ++- return { healthStatus: "PENDING", status: "Not Configured" }; +++ return { healthStatus: "PENDING", status: "NOT CONFIGURED" }; ++ } ++ const normalized = normalizeHealthStatus(status); ++ if (normalized === "PASS") { ++- return { healthStatus: "PASS", status: "Healthy" }; +++ return { healthStatus: "PASS", status: "PASS" }; ++ } ++ if (normalized === "FAIL") { ++- return { healthStatus: "FAIL", status: "Failed" }; +++ return { healthStatus: "FAIL", status: "FAIL" }; ++ } ++- return { healthStatus: "WARN", status: "Warning" }; +++ return { healthStatus: "WARN", status: "WARN" }; + } - ## Team Bravo +--function assertFiniteNumber(value, name) { +-- if (!Number.isFinite(value)) { +-- throw new TypeError(`${name} must be a finite number.`); +-- } +--} +-- +--function assertOrderedRange(min, max) { +-- assertFiniteNumber(min, "min"); +-- assertFiniteNumber(max, "max"); +-- +-- if (max < min) { +-- throw new RangeError("max must be greater than or equal to min."); +-- } +--} +-- +--function assertArray(value, name) { +-- if (!Array.isArray(value)) { +-- throw new TypeError(`${name} must be an array.`); +-- } +--} +-- +- function readWeightedItem(entry) { +- if (!entry || typeof entry !== "object") { +- throw new TypeError("weightedItems entries must be objects."); +-diff --git a/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions.md b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions.md ++ function systemHealthServiceCard({ configured = true, id, label, lastChecked, status = "WARN", summary }) { ++@@ -1694,7 +1694,7 @@ function systemHealthNotificationsFoundation(checkedAt = new Date().toISOString( ++ ]; ++ return { ++ lastChecked: checkedAt, ++- message: "Notifications and alerts are placeholders only; no alert sending contract is configured for this deployment.", +++ message: "Notifications and alerts are Not Configured; no alert sending contract is configured for this deployment.", ++ rows, ++ secretEditingAllowed: false, ++ secretsExposed: false, ++diff --git a/tests/dev-runtime/AdminHealthOperations.test.mjs b/tests/dev-runtime/AdminHealthOperations.test.mjs ++index 59bea182c..57a4af267 100644 ++--- a/tests/dev-runtime/AdminHealthOperations.test.mjs +++++ b/tests/dev-runtime/AdminHealthOperations.test.mjs ++@@ -172,9 +172,10 @@ test("Admin can view operational health while Creator sessions are blocked", asy ++ ["Runtime", "API", "Database", "Storage", "Authentication", "Email", "Background Jobs"], ++ ); ++ assert.equal( ++- health.serviceHealth.services.every((service) => ["Healthy", "Warning", "Failed", "Not Configured"].includes(service.status)), +++ health.serviceHealth.services.every((service) => ["PASS", "WARN", "FAIL", "NOT CONFIGURED"].includes(service.status)), ++ true, ++ ); +++ assert.equal(health.serviceHealth.services.some((service) => service.status === "PASS"), true); ++ assert.equal(health.serviceHealth.services.every((service) => typeof service.summary === "string"), true); ++ assert.equal(JSON.stringify(health.serviceHealth).includes("/uat"), false); ++ assert.deepEqual( ++diff --git a/tests/playwright/tools/AdminHealthOperationsPage.spec.mjs b/tests/playwright/tools/AdminHealthOperationsPage.spec.mjs ++index cf54c49d3..3527df130 100644 ++--- a/tests/playwright/tools/AdminHealthOperationsPage.spec.mjs +++++ b/tests/playwright/tools/AdminHealthOperationsPage.spec.mjs ++@@ -188,7 +188,8 @@ test("Admin System Health renders Postgres diagnostics through the safe status A ++ expect(serviceCardText).toContain(label); ++ }); ++ const serviceStatuses = await serviceCards.locator("[data-health-status]").allTextContents(); ++- expect(serviceStatuses.every((status) => ["Healthy", "Warning", "Failed", "Not Configured"].includes(status.trim()))).toBe(true); +++ expect(serviceStatuses.every((status) => ["PASS", "WARN", "FAIL", "NOT CONFIGURED"].includes(status.trim()))).toBe(true); +++ expect(serviceStatuses).toContain("PASS"); ++ const configurationTable = page.getByRole("table", { name: "Configuration summary" }); ++ await expect(configurationTable).toContainText("Current environment"); ++ await expect(configurationTable).toContainText("Hosting model"); ++@@ -350,6 +351,7 @@ test("Admin System Health operations page keeps scripts and styles external", as ++ expect(pageSource).not.toMatch(/\sstyle\s*=/i); ++ expect(pageSource).not.toMatch(/data-health-status="(?:WARN|FAIL)"/); ++ expect(pageSource).not.toContain("No active failure is declared"); +++ expect(pageSource).not.toMatch(/foundation PR|foundation view|placeholder|Pending metric|intentionally not wired/i); ++ expect(pageSource).not.toContain("SQLite"); ++ expect(pageSource).toContain("Environment Identity"); ++ expect(pageSource).toContain("Environment Map"); ++diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md + new file mode 100644 +-index 000000000..726310533 ++index 000000000..7cbe75d98 + --- /dev/null +-+++ b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions.md +-@@ -0,0 +1,50 @@ +-+# PR_26177_DELTA_056-shared-validation-assertions +++++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md ++@@ -0,0 +1,40 @@ +++# PR_26177_CHARLIE_006-system-health-dashboard-complete + + +-+Date: 2026-06-26 +-+Team: Delta +-+Scope: Shared validation assertions extracted from random helper code +-+Status: PASS +++Team: Charlie +++Branch: PR_26177_CHARLIE_006-system-health-dashboard-complete +++Base: main +++Scope: System Health Dashboard completion polish + + + +## Summary + + +-+- Added `src/shared/validation/assert.js`. +-+- Moved generic reusable assertion helpers out of `src/shared/math/randomHelpers.js`. +-+- Included only the current generic assertion helpers needed by random helpers: `assertArray`, `assertFiniteNumber`, and `assertOrderedRange`. +-+- Updated `randomHelpers.js` to import those assertions from the shared validation module. +-+- Preserved existing `Random`, `RandomSeed`, and random helper behavior. +-+- Did not change public API. +-+- Did not add unrelated validation helpers. +-+- No UI, API, database, or unrelated cleanup changes were made. +-+ +-+## Branch Validation +-+ +-+PASS. Branch `PR_26177_DELTA_056-shared-validation-assertions` was created from clean `PR_26177_DELTA_055-random-seed-enhancements`. +++- Removed stale foundation and placeholder wording from the Admin System Health dashboard source. +++- Kept unavailable provider metrics explicit with safe `PENDING` status and clear reasons. +++- Updated service health cards to display `PASS`, `WARN`, `FAIL`, or `NOT CONFIGURED` directly. +++- Preserved the Web UI to API/service contract flow; the browser still renders only server-owned System Health data. +++- Added targeted assertions for placeholder removal, service status display, secret masking, current-environment-only checks, and externalized Theme V2 script/style rules. + + + +## Changed Files + + +-+- `docs_build/dev/PLAN_PR.md` +-+- `docs_build/dev/BUILD_PR.md` +-+- `docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md` +-+- `docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md` +-+- `src/shared/validation/assert.js` +-+- `src/shared/math/randomHelpers.js` +-+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions.md` +-+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_branch-validation.md` +-+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_requirement-checklist.md` +-+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_validation-lane.md` +-+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_manual-validation-notes.md` +-+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_instruction-compliance-checklist.md` +++- `admin/system-health.html` +++- `src/dev-runtime/server/local-api-router.mjs` +++- `tests/dev-runtime/AdminHealthOperations.test.mjs` +++- `tests/playwright/tools/AdminHealthOperationsPage.spec.mjs` +++- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md` +++- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md` +++- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md` +++- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md` +++- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md` + +- `docs_build/dev/reports/codex_changed_files.txt` + +- `docs_build/dev/reports/codex_review.diff` + + + +## Validation + + +-+- PASS: `node ./scripts/run-node-test-files.mjs tests/shared/RandomHelpers.test.mjs tests/shared/Random.test.mjs tests/shared/RandomSeed.test.mjs` +-+- PASS: `node --check src/shared/validation/assert.js` +-+- PASS: `node --check src/shared/math/randomHelpers.js` +-+- PASS: `git diff --check` +-+- SKIP: Playwright was not run because this PR does not change UI or browser runtime flows. +++- PASS: `node --check src/dev-runtime/server/local-api-router.mjs` +++- PASS: `node --check tests/dev-runtime/AdminHealthOperations.test.mjs` +++- PASS: `node --check tests/playwright/tools/AdminHealthOperationsPage.spec.mjs` +++- PASS: `node --test tests/dev-runtime/AdminHealthOperations.test.mjs tests/api/admin-system-health/contract.test.mjs` +++- PASS: `npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1` + + + +## Artifact + + +-+- `tmp/PR_26177_DELTA_056-shared-validation-assertions_delta.zip` +-diff --git a/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_branch-validation.md b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_branch-validation.md +++- `tmp/PR_26177_CHARLIE_006-system-health-dashboard-complete_delta.zip` ++diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md + new file mode 100644 +-index 000000000..f41b57b1d ++index 000000000..2368a289b + --- /dev/null +-+++ b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_branch-validation.md +-@@ -0,0 +1,15 @@ +-+# PR_26177_DELTA_056-shared-validation-assertions Branch Validation +-+ +-+Status: PASS +-+ +-+## Start Gates +-+ +-+- PASS: Current branch was `PR_26177_DELTA_055-random-seed-enhancements`. +-+- PASS: Worktree was clean before creating PR_056. +-+- PASS: Branch `PR_26177_DELTA_056-shared-validation-assertions` was created from PR_055. +-+ +-+## Scope Confirmation +-+ +-+- PASS: Work is assigned to Team Delta. +-+- PASS: Work is limited to extracting generic assertions used by random helpers. +-+- PASS: No public API, UI, browser storage, API, database, or unrelated cleanup changes were made. +-diff --git a/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_instruction-compliance-checklist.md b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_instruction-compliance-checklist.md +++++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md ++@@ -0,0 +1,13 @@ +++# PR_26177_CHARLIE_006 Branch Validation +++ +++Result: PASS +++ +++Checks: +++- PASS: Started from `main`. +++- PASS: Worktree was clean before branch creation. +++- PASS: Local/origin sync was `0/0` before branch creation. +++- PASS: Branch `PR_26177_CHARLIE_006-system-health-dashboard-complete` was created from current `main`. +++- PASS: Scope stayed within System Health Dashboard completion. +++- PASS: No `start_of_day` files changed. +++- PASS: No direct commits to `main`. +++- PASS: PR branch retained for review. ++diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md + new file mode 100644 +-index 000000000..a34dbd5f3 ++index 000000000..75244edcf + --- /dev/null +-+++ b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_instruction-compliance-checklist.md +-@@ -0,0 +1,11 @@ +-+# PR_26177_DELTA_056-shared-validation-assertions Instruction Compliance Checklist +-+ +-+| Instruction | Status | Notes | +-+|---|---:|---| +-+| Read `ProjectInstructions.zip` and `README.txt` first | PASS | Read `ProjectInstructions/README.txt` before work. | +-+| Create PR_056 as stacked PR on current branch | PASS | Branch was created from `PR_26177_DELTA_055-random-seed-enhancements`. | +-+| Hard stop if branch/worktree gates fail | PASS | Branch and clean worktree gates passed. | +-+| Keep one PR purpose only | PASS | Scope is shared validation assertion extraction. | +-+| Do not change public API | PASS | No public API changes were made. | +-+| Produce required reports | PASS | Reports were added under `docs_build/dev/reports/`. | +-+| Produce repo-structured ZIP under `tmp/` | PASS | ZIP path is `tmp/PR_26177_DELTA_056-shared-validation-assertions_delta.zip`. | +-diff --git a/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_manual-validation-notes.md b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_manual-validation-notes.md +++++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md ++@@ -0,0 +1,9 @@ +++# PR_26177_CHARLIE_006 Manual Validation Notes +++ +++- Confirmed System Health dashboard copy no longer contains stale `foundation PR`, `foundation view`, `placeholder`, `Pending metric`, or `intentionally not wired` wording. +++- Confirmed provider metrics that are not available remain visibly marked `PENDING` with explanatory reasons. +++- Confirmed service cards retain existing Theme V2 card layout while displaying direct health status values. +++- Confirmed secret-like runtime variables remain masked as `********`. +++- Confirmed current-environment System Health behavior remains intact; peer environments are reference-only. +++- Confirmed no runtime/UI/API/database files outside the scoped System Health files were changed. +++- Confirmed no `start_of_day` files were changed. ++diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md + new file mode 100644 +-index 000000000..1d5548e3b ++index 000000000..1127e0ea8 + --- /dev/null +-+++ b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_manual-validation-notes.md +-@@ -0,0 +1,11 @@ +-+# PR_26177_DELTA_056-shared-validation-assertions Manual Validation Notes +-+ +-+Status: PASS +-+ +-+Manual review confirmed: +-+ +-+- The extracted assertions are generic and reusable. +-+- `assert.js` intentionally contains only `assertArray`, `assertFiniteNumber`, and `assertOrderedRange`. +-+- Random helper behavior is preserved through imports from the shared validation module. +-+- `Random` and `RandomSeed` public APIs are unchanged. +-+- No UI, browser storage, API, database, or unrelated files changed. +-diff --git a/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_requirement-checklist.md b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_requirement-checklist.md +++++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md ++@@ -0,0 +1,17 @@ +++# PR_26177_CHARLIE_006 Requirement Checklist +++ +++- PASS: Environment Summary remains current-deployment only. +++- PASS: Postgres Health remains API/service-owned and displays safe values only. +++- PASS: R2/Storage Health remains current-environment only. +++- PASS: Runtime Environment Variables render from server-owned diagnostics. +++- PASS: Runtime variables remain alphabetically sorted by key. +++- PASS: Secret-like runtime values remain masked. +++- PASS: Service Health cards now display direct `PASS`, `WARN`, `FAIL`, or `NOT CONFIGURED` text. +++- PASS: Stale foundation and placeholder wording removed from the dashboard source. +++- PASS: Empty/error states remain explicit `PENDING`, `WARN`, or `FAIL` with reasons. +++- PASS: Theme V2 layout and externalized scripts/styles preserved. +++- PASS: No inline styles, style blocks, script blocks, or inline event handlers introduced. +++- PASS: Browser does not own authoritative product data. +++- PASS: No MEM DB, local-mem, fake-login, browser storage SSoT, silent fallback, hidden default, or SQLite direction introduced. +++- PASS: Targeted tests updated and run. +++- PASS: Required reports and delta ZIP created. ++diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md + new file mode 100644 +-index 000000000..00d322ad0 ++index 000000000..408c9ac5d + --- /dev/null +-+++ b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_requirement-checklist.md +-@@ -0,0 +1,16 @@ +-+# PR_26177_DELTA_056-shared-validation-assertions Requirement Checklist +-+ +-+| Requirement | Status | Notes | +-+|---|---:|---| +-+| Create `src/shared/validation/assert.js` | PASS | New shared validation module added. | +-+| Move generic assertion helpers from random helper code into `assert.js` | PASS | `assertArray`, `assertFiniteNumber`, and `assertOrderedRange` were extracted. | +-+| Include only generic reusable validation functions needed by current random helpers | PASS | No unrelated validation helpers were added. | +-+| Update random helper code to import from `src/shared/validation/assert.js` | PASS | `randomHelpers.js` now imports from shared validation. | +-+| Preserve existing `Random` behavior | PASS | Targeted `Random` tests pass. | +-+| Preserve existing `RandomSeed` behavior | PASS | Targeted `RandomSeed` tests pass. | +-+| Do not change public API | PASS | No public API methods or call sites changed. | +-+| Do not expand into unrelated validation functions yet | PASS | Module includes only the requested assertions. | +-+| Add/update targeted unit tests if needed | PASS | Existing targeted random tests cover behavior after extraction. | +-+| No UI changes | PASS | No UI files changed. | +-+| No API/database changes | PASS | No API or database files changed. | +-+| No unrelated cleanup | PASS | Changes stayed scoped to assertion extraction and reports. | +-diff --git a/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_validation-lane.md b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_validation-lane.md +-new file mode 100644 +-index 000000000..01500c267 +---- /dev/null +-+++ b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_validation-lane.md +-@@ -0,0 +1,25 @@ +-+# PR_26177_DELTA_056-shared-validation-assertions Validation Lane +-+ +-+Status: PASS +-+ +-+## Commands +-+ +-+```powershell +-+node ./scripts/run-node-test-files.mjs tests/shared/RandomHelpers.test.mjs tests/shared/Random.test.mjs tests/shared/RandomSeed.test.mjs +-+node --check src/shared/validation/assert.js +-+node --check src/shared/math/randomHelpers.js +-+git diff --check +-+``` +-+ +-+## Results +-+ +-+- PASS: `tests/shared/RandomHelpers.test.mjs` +-+- PASS: `tests/shared/Random.test.mjs` +-+- PASS: `tests/shared/RandomSeed.test.mjs` +-+- PASS: `src/shared/validation/assert.js` syntax check +-+- PASS: `src/shared/math/randomHelpers.js` syntax check +-+- PASS: `git diff --check` +-+ +-+## Playwright +-+ +-+SKIP. Playwright was not run because this PR does not change UI or browser runtime flows. +-diff --git a/src/shared/validation/assert.js b/src/shared/validation/assert.js +-new file mode 100644 +-index 000000000..ee8974cbc +---- /dev/null +-+++ b/src/shared/validation/assert.js +++++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md + @@ -0,0 +1,20 @@ +-+export function assertArray(value, name) { +-+ if (!Array.isArray(value)) { +-+ throw new TypeError(`${name} must be an array.`); +-+ } +-+} +-+ +-+export function assertFiniteNumber(value, name) { +-+ if (!Number.isFinite(value)) { +-+ throw new TypeError(`${name} must be a finite number.`); +-+ } +-+} +-+ +-+export function assertOrderedRange(min, max) { +-+ assertFiniteNumber(min, "min"); +-+ assertFiniteNumber(max, "max"); +-+ +-+ if (max < min) { +-+ throw new RangeError("max must be greater than or equal to min."); +-+ } +-+} +++# PR_26177_CHARLIE_006 Validation Lane +++ +++Impacted lanes: +++- Admin System Health page +++- Local API Admin System Health status contract +++- System Health Playwright page coverage +++ +++Commands: +++- PASS: `node --check src/dev-runtime/server/local-api-router.mjs` +++- PASS: `node --check tests/dev-runtime/AdminHealthOperations.test.mjs` +++- PASS: `node --check tests/playwright/tools/AdminHealthOperationsPage.spec.mjs` +++- PASS: `node --test tests/dev-runtime/AdminHealthOperations.test.mjs tests/api/admin-system-health/contract.test.mjs` +++ - 6 tests passed. +++- PASS: `npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1` +++ - 3 tests passed. +++ +++Skipped lanes: +++- Full samples smoke was not run; this PR only touches targeted Admin System Health dashboard behavior and tests. +++ +++Result: PASS +diff --git a/src/dev-runtime/server/local-api-router.mjs b/src/dev-runtime/server/local-api-router.mjs +index f2f927aff..f20e47b4c 100644 +--- a/src/dev-runtime/server/local-api-router.mjs ++++ b/src/dev-runtime/server/local-api-router.mjs +@@ -1416,16 +1416,16 @@ function systemHealthRuntimeHealth(environmentIdentity = {}, checkedAt = new Dat -diff --git a/src/shared/math/randomHelpers.js b/src/shared/math/randomHelpers.js -index 5df891668..103ae7db5 100644 ---- a/src/shared/math/randomHelpers.js -+++ b/src/shared/math/randomHelpers.js -@@ -1,3 +1,5 @@ -+import { assertArray, assertFiniteNumber, assertOrderedRange } from "../validation/assert.js"; -+ - function assertRandomNext(randomNext) { - if (typeof randomNext !== "function") { - throw new TypeError("randomNext must be a function."); -@@ -15,27 +17,6 @@ function readRandomValue(randomNext) { - return value; + function systemHealthServiceDisplayStatus(status, configured = true) { + if (configured === false) { +- return { healthStatus: "PENDING", status: "Not Configured" }; ++ return { healthStatus: "PENDING", status: "NOT CONFIGURED" }; + } + const normalized = normalizeHealthStatus(status); + if (normalized === "PASS") { +- return { healthStatus: "PASS", status: "Healthy" }; ++ return { healthStatus: "PASS", status: "PASS" }; + } + if (normalized === "FAIL") { +- return { healthStatus: "FAIL", status: "Failed" }; ++ return { healthStatus: "FAIL", status: "FAIL" }; + } +- return { healthStatus: "WARN", status: "Warning" }; ++ return { healthStatus: "WARN", status: "WARN" }; } --function assertFiniteNumber(value, name) { -- if (!Number.isFinite(value)) { -- throw new TypeError(`${name} must be a finite number.`); -- } --} -- --function assertOrderedRange(min, max) { -- assertFiniteNumber(min, "min"); -- assertFiniteNumber(max, "max"); -- -- if (max < min) { -- throw new RangeError("max must be greater than or equal to min."); -- } --} -- --function assertArray(value, name) { -- if (!Array.isArray(value)) { -- throw new TypeError(`${name} must be an array.`); -- } --} -- - function readWeightedItem(entry) { - if (!entry || typeof entry !== "object") { - throw new TypeError("weightedItems entries must be objects."); -diff --git a/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions.md b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions.md + function systemHealthServiceCard({ configured = true, id, label, lastChecked, status = "WARN", summary }) { +@@ -1694,7 +1694,7 @@ function systemHealthNotificationsFoundation(checkedAt = new Date().toISOString( + ]; + return { + lastChecked: checkedAt, +- message: "Notifications and alerts are placeholders only; no alert sending contract is configured for this deployment.", ++ message: "Notifications and alerts are Not Configured; no alert sending contract is configured for this deployment.", + rows, + secretEditingAllowed: false, + secretsExposed: false, +diff --git a/tests/dev-runtime/AdminHealthOperations.test.mjs b/tests/dev-runtime/AdminHealthOperations.test.mjs +index 59bea182c..57a4af267 100644 +--- a/tests/dev-runtime/AdminHealthOperations.test.mjs ++++ b/tests/dev-runtime/AdminHealthOperations.test.mjs +@@ -172,9 +172,10 @@ test("Admin can view operational health while Creator sessions are blocked", asy + ["Runtime", "API", "Database", "Storage", "Authentication", "Email", "Background Jobs"], + ); + assert.equal( +- health.serviceHealth.services.every((service) => ["Healthy", "Warning", "Failed", "Not Configured"].includes(service.status)), ++ health.serviceHealth.services.every((service) => ["PASS", "WARN", "FAIL", "NOT CONFIGURED"].includes(service.status)), + true, + ); ++ assert.equal(health.serviceHealth.services.some((service) => service.status === "PASS"), true); + assert.equal(health.serviceHealth.services.every((service) => typeof service.summary === "string"), true); + assert.equal(JSON.stringify(health.serviceHealth).includes("/uat"), false); + assert.deepEqual( +diff --git a/tests/playwright/tools/AdminHealthOperationsPage.spec.mjs b/tests/playwright/tools/AdminHealthOperationsPage.spec.mjs +index cf54c49d3..3527df130 100644 +--- a/tests/playwright/tools/AdminHealthOperationsPage.spec.mjs ++++ b/tests/playwright/tools/AdminHealthOperationsPage.spec.mjs +@@ -188,7 +188,8 @@ test("Admin System Health renders Postgres diagnostics through the safe status A + expect(serviceCardText).toContain(label); + }); + const serviceStatuses = await serviceCards.locator("[data-health-status]").allTextContents(); +- expect(serviceStatuses.every((status) => ["Healthy", "Warning", "Failed", "Not Configured"].includes(status.trim()))).toBe(true); ++ expect(serviceStatuses.every((status) => ["PASS", "WARN", "FAIL", "NOT CONFIGURED"].includes(status.trim()))).toBe(true); ++ expect(serviceStatuses).toContain("PASS"); + const configurationTable = page.getByRole("table", { name: "Configuration summary" }); + await expect(configurationTable).toContainText("Current environment"); + await expect(configurationTable).toContainText("Hosting model"); +@@ -350,6 +351,7 @@ test("Admin System Health operations page keeps scripts and styles external", as + expect(pageSource).not.toMatch(/\sstyle\s*=/i); + expect(pageSource).not.toMatch(/data-health-status="(?:WARN|FAIL)"/); + expect(pageSource).not.toContain("No active failure is declared"); ++ expect(pageSource).not.toMatch(/foundation PR|foundation view|placeholder|Pending metric|intentionally not wired/i); + expect(pageSource).not.toContain("SQLite"); + expect(pageSource).toContain("Environment Identity"); + expect(pageSource).toContain("Environment Map"); +diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md new file mode 100644 -index 000000000..726310533 +index 000000000..7cbe75d98 --- /dev/null -+++ b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions.md -@@ -0,0 +1,50 @@ -+# PR_26177_DELTA_056-shared-validation-assertions ++++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md +@@ -0,0 +1,40 @@ ++# PR_26177_CHARLIE_006-system-health-dashboard-complete + -+Date: 2026-06-26 -+Team: Delta -+Scope: Shared validation assertions extracted from random helper code -+Status: PASS ++Team: Charlie ++Branch: PR_26177_CHARLIE_006-system-health-dashboard-complete ++Base: main ++Scope: System Health Dashboard completion polish + +## Summary + -+- Added `src/shared/validation/assert.js`. -+- Moved generic reusable assertion helpers out of `src/shared/math/randomHelpers.js`. -+- Included only the current generic assertion helpers needed by random helpers: `assertArray`, `assertFiniteNumber`, and `assertOrderedRange`. -+- Updated `randomHelpers.js` to import those assertions from the shared validation module. -+- Preserved existing `Random`, `RandomSeed`, and random helper behavior. -+- Did not change public API. -+- Did not add unrelated validation helpers. -+- No UI, API, database, or unrelated cleanup changes were made. -+ -+## Branch Validation -+ -+PASS. Branch `PR_26177_DELTA_056-shared-validation-assertions` was created from clean `PR_26177_DELTA_055-random-seed-enhancements`. ++- Removed stale foundation and placeholder wording from the Admin System Health dashboard source. ++- Kept unavailable provider metrics explicit with safe `PENDING` status and clear reasons. ++- Updated service health cards to display `PASS`, `WARN`, `FAIL`, or `NOT CONFIGURED` directly. ++- Preserved the Web UI to API/service contract flow; the browser still renders only server-owned System Health data. ++- Added targeted assertions for placeholder removal, service status display, secret masking, current-environment-only checks, and externalized Theme V2 script/style rules. + +## Changed Files + -+- `docs_build/dev/PLAN_PR.md` -+- `docs_build/dev/BUILD_PR.md` -+- `docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md` -+- `docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md` -+- `src/shared/validation/assert.js` -+- `src/shared/math/randomHelpers.js` -+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions.md` -+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_branch-validation.md` -+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_requirement-checklist.md` -+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_validation-lane.md` -+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_manual-validation-notes.md` -+- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_instruction-compliance-checklist.md` ++- `admin/system-health.html` ++- `src/dev-runtime/server/local-api-router.mjs` ++- `tests/dev-runtime/AdminHealthOperations.test.mjs` ++- `tests/playwright/tools/AdminHealthOperationsPage.spec.mjs` ++- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete.md` ++- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md` ++- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md` ++- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md` ++- `docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md` +- `docs_build/dev/reports/codex_changed_files.txt` +- `docs_build/dev/reports/codex_review.diff` + +## Validation + -+- PASS: `node ./scripts/run-node-test-files.mjs tests/shared/RandomHelpers.test.mjs tests/shared/Random.test.mjs tests/shared/RandomSeed.test.mjs` -+- PASS: `node --check src/shared/validation/assert.js` -+- PASS: `node --check src/shared/math/randomHelpers.js` -+- PASS: `git diff --check` -+- SKIP: Playwright was not run because this PR does not change UI or browser runtime flows. ++- PASS: `node --check src/dev-runtime/server/local-api-router.mjs` ++- PASS: `node --check tests/dev-runtime/AdminHealthOperations.test.mjs` ++- PASS: `node --check tests/playwright/tools/AdminHealthOperationsPage.spec.mjs` ++- PASS: `node --test tests/dev-runtime/AdminHealthOperations.test.mjs tests/api/admin-system-health/contract.test.mjs` ++- PASS: `npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1` + +## Artifact + -+- `tmp/PR_26177_DELTA_056-shared-validation-assertions_delta.zip` -diff --git a/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_branch-validation.md b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_branch-validation.md ++- `tmp/PR_26177_CHARLIE_006-system-health-dashboard-complete_delta.zip` +diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md new file mode 100644 -index 000000000..f41b57b1d +index 000000000..2368a289b --- /dev/null -+++ b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_branch-validation.md -@@ -0,0 +1,15 @@ -+# PR_26177_DELTA_056-shared-validation-assertions Branch Validation ++++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_branch-validation.md +@@ -0,0 +1,13 @@ ++# PR_26177_CHARLIE_006 Branch Validation + -+Status: PASS ++Result: PASS + -+## Start Gates -+ -+- PASS: Current branch was `PR_26177_DELTA_055-random-seed-enhancements`. -+- PASS: Worktree was clean before creating PR_056. -+- PASS: Branch `PR_26177_DELTA_056-shared-validation-assertions` was created from PR_055. -+ -+## Scope Confirmation -+ -+- PASS: Work is assigned to Team Delta. -+- PASS: Work is limited to extracting generic assertions used by random helpers. -+- PASS: No public API, UI, browser storage, API, database, or unrelated cleanup changes were made. -diff --git a/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_instruction-compliance-checklist.md b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_instruction-compliance-checklist.md ++Checks: ++- PASS: Started from `main`. ++- PASS: Worktree was clean before branch creation. ++- PASS: Local/origin sync was `0/0` before branch creation. ++- PASS: Branch `PR_26177_CHARLIE_006-system-health-dashboard-complete` was created from current `main`. ++- PASS: Scope stayed within System Health Dashboard completion. ++- PASS: No `start_of_day` files changed. ++- PASS: No direct commits to `main`. ++- PASS: PR branch retained for review. +diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md new file mode 100644 -index 000000000..a34dbd5f3 +index 000000000..75244edcf --- /dev/null -+++ b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_instruction-compliance-checklist.md -@@ -0,0 +1,11 @@ -+# PR_26177_DELTA_056-shared-validation-assertions Instruction Compliance Checklist ++++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_manual-validation-notes.md +@@ -0,0 +1,9 @@ ++# PR_26177_CHARLIE_006 Manual Validation Notes + -+| Instruction | Status | Notes | -+|---|---:|---| -+| Read `ProjectInstructions.zip` and `README.txt` first | PASS | Read `ProjectInstructions/README.txt` before work. | -+| Create PR_056 as stacked PR on current branch | PASS | Branch was created from `PR_26177_DELTA_055-random-seed-enhancements`. | -+| Hard stop if branch/worktree gates fail | PASS | Branch and clean worktree gates passed. | -+| Keep one PR purpose only | PASS | Scope is shared validation assertion extraction. | -+| Do not change public API | PASS | No public API changes were made. | -+| Produce required reports | PASS | Reports were added under `docs_build/dev/reports/`. | -+| Produce repo-structured ZIP under `tmp/` | PASS | ZIP path is `tmp/PR_26177_DELTA_056-shared-validation-assertions_delta.zip`. | -diff --git a/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_manual-validation-notes.md b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_manual-validation-notes.md ++- Confirmed System Health dashboard copy no longer contains stale `foundation PR`, `foundation view`, `placeholder`, `Pending metric`, or `intentionally not wired` wording. ++- Confirmed provider metrics that are not available remain visibly marked `PENDING` with explanatory reasons. ++- Confirmed service cards retain existing Theme V2 card layout while displaying direct health status values. ++- Confirmed secret-like runtime variables remain masked as `********`. ++- Confirmed current-environment System Health behavior remains intact; peer environments are reference-only. ++- Confirmed no runtime/UI/API/database files outside the scoped System Health files were changed. ++- Confirmed no `start_of_day` files were changed. +diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md new file mode 100644 -index 000000000..1d5548e3b +index 000000000..1127e0ea8 --- /dev/null -+++ b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_manual-validation-notes.md -@@ -0,0 +1,11 @@ -+# PR_26177_DELTA_056-shared-validation-assertions Manual Validation Notes ++++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_requirements-checklist.md +@@ -0,0 +1,17 @@ ++# PR_26177_CHARLIE_006 Requirement Checklist + -+Status: PASS -+ -+Manual review confirmed: -+ -+- The extracted assertions are generic and reusable. -+- `assert.js` intentionally contains only `assertArray`, `assertFiniteNumber`, and `assertOrderedRange`. -+- Random helper behavior is preserved through imports from the shared validation module. -+- `Random` and `RandomSeed` public APIs are unchanged. -+- No UI, browser storage, API, database, or unrelated files changed. -diff --git a/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_requirement-checklist.md b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_requirement-checklist.md ++- PASS: Environment Summary remains current-deployment only. ++- PASS: Postgres Health remains API/service-owned and displays safe values only. ++- PASS: R2/Storage Health remains current-environment only. ++- PASS: Runtime Environment Variables render from server-owned diagnostics. ++- PASS: Runtime variables remain alphabetically sorted by key. ++- PASS: Secret-like runtime values remain masked. ++- PASS: Service Health cards now display direct `PASS`, `WARN`, `FAIL`, or `NOT CONFIGURED` text. ++- PASS: Stale foundation and placeholder wording removed from the dashboard source. ++- PASS: Empty/error states remain explicit `PENDING`, `WARN`, or `FAIL` with reasons. ++- PASS: Theme V2 layout and externalized scripts/styles preserved. ++- PASS: No inline styles, style blocks, script blocks, or inline event handlers introduced. ++- PASS: Browser does not own authoritative product data. ++- PASS: No MEM DB, local-mem, fake-login, browser storage SSoT, silent fallback, hidden default, or SQLite direction introduced. ++- PASS: Targeted tests updated and run. ++- PASS: Required reports and delta ZIP created. +diff --git a/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md new file mode 100644 -index 000000000..00d322ad0 +index 000000000..408c9ac5d --- /dev/null -+++ b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_requirement-checklist.md -@@ -0,0 +1,16 @@ -+# PR_26177_DELTA_056-shared-validation-assertions Requirement Checklist -+ -+| Requirement | Status | Notes | -+|---|---:|---| -+| Create `src/shared/validation/assert.js` | PASS | New shared validation module added. | -+| Move generic assertion helpers from random helper code into `assert.js` | PASS | `assertArray`, `assertFiniteNumber`, and `assertOrderedRange` were extracted. | -+| Include only generic reusable validation functions needed by current random helpers | PASS | No unrelated validation helpers were added. | -+| Update random helper code to import from `src/shared/validation/assert.js` | PASS | `randomHelpers.js` now imports from shared validation. | -+| Preserve existing `Random` behavior | PASS | Targeted `Random` tests pass. | -+| Preserve existing `RandomSeed` behavior | PASS | Targeted `RandomSeed` tests pass. | -+| Do not change public API | PASS | No public API methods or call sites changed. | -+| Do not expand into unrelated validation functions yet | PASS | Module includes only the requested assertions. | -+| Add/update targeted unit tests if needed | PASS | Existing targeted random tests cover behavior after extraction. | -+| No UI changes | PASS | No UI files changed. | -+| No API/database changes | PASS | No API or database files changed. | -+| No unrelated cleanup | PASS | Changes stayed scoped to assertion extraction and reports. | -diff --git a/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_validation-lane.md b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_validation-lane.md -new file mode 100644 -index 000000000..01500c267 ---- /dev/null -+++ b/docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_validation-lane.md -@@ -0,0 +1,25 @@ -+# PR_26177_DELTA_056-shared-validation-assertions Validation Lane -+ -+Status: PASS -+ -+## Commands -+ -+```powershell -+node ./scripts/run-node-test-files.mjs tests/shared/RandomHelpers.test.mjs tests/shared/Random.test.mjs tests/shared/RandomSeed.test.mjs -+node --check src/shared/validation/assert.js -+node --check src/shared/math/randomHelpers.js -+git diff --check -+``` -+ -+## Results -+ -+- PASS: `tests/shared/RandomHelpers.test.mjs` -+- PASS: `tests/shared/Random.test.mjs` -+- PASS: `tests/shared/RandomSeed.test.mjs` -+- PASS: `src/shared/validation/assert.js` syntax check -+- PASS: `src/shared/math/randomHelpers.js` syntax check -+- PASS: `git diff --check` -+ -+## Playwright -+ -+SKIP. Playwright was not run because this PR does not change UI or browser runtime flows. -diff --git a/src/shared/validation/assert.js b/src/shared/validation/assert.js -new file mode 100644 -index 000000000..ee8974cbc ---- /dev/null -+++ b/src/shared/validation/assert.js ++++ b/docs_build/dev/reports/PR_26177_CHARLIE_006-system-health-dashboard-complete_validation-lane.md @@ -0,0 +1,20 @@ -+export function assertArray(value, name) { -+ if (!Array.isArray(value)) { -+ throw new TypeError(`${name} must be an array.`); -+ } -+} ++# PR_26177_CHARLIE_006 Validation Lane ++ ++Impacted lanes: ++- Admin System Health page ++- Local API Admin System Health status contract ++- System Health Playwright page coverage + -+export function assertFiniteNumber(value, name) { -+ if (!Number.isFinite(value)) { -+ throw new TypeError(`${name} must be a finite number.`); -+ } -+} ++Commands: ++- PASS: `node --check src/dev-runtime/server/local-api-router.mjs` ++- PASS: `node --check tests/dev-runtime/AdminHealthOperations.test.mjs` ++- PASS: `node --check tests/playwright/tools/AdminHealthOperationsPage.spec.mjs` ++- PASS: `node --test tests/dev-runtime/AdminHealthOperations.test.mjs tests/api/admin-system-health/contract.test.mjs` ++ - 6 tests passed. ++- PASS: `npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1` ++ - 3 tests passed. + -+export function assertOrderedRange(min, max) { -+ assertFiniteNumber(min, "min"); -+ assertFiniteNumber(max, "max"); ++Skipped lanes: ++- Full samples smoke was not run; this PR only touches targeted Admin System Health dashboard behavior and tests. + -+ if (max < min) { -+ throw new RangeError("max must be greater than or equal to min."); -+ } -+} ++Result: PASS diff --git a/src/dev-runtime/server/local-api-router.mjs b/src/dev-runtime/server/local-api-router.mjs index f2f927aff..f20e47b4c 100644 --- a/src/dev-runtime/server/local-api-router.mjs +++ b/src/dev-runtime/server/local-api-router.mjs @@ -1416,16 +1416,16 @@ function systemHealthRuntimeHealth(environmentIdentity = {}, checkedAt = new Dat function systemHealthServiceDisplayStatus(status, configured = true) { if (configured === false) { - return { healthStatus: "PENDING", status: "Not Configured" }; + return { healthStatus: "PENDING", status: "NOT CONFIGURED" }; } const normalized = normalizeHealthStatus(status); if (normalized === "PASS") { - return { healthStatus: "PASS", status: "Healthy" }; + return { healthStatus: "PASS", status: "PASS" }; } if (normalized === "FAIL") { - return { healthStatus: "FAIL", status: "Failed" }; + return { healthStatus: "FAIL", status: "FAIL" }; } - return { healthStatus: "WARN", status: "Warning" }; + return { healthStatus: "WARN", status: "WARN" }; } function systemHealthServiceCard({ configured = true, id, label, lastChecked, status = "WARN", summary }) { @@ -1694,7 +1694,7 @@ function systemHealthNotificationsFoundation(checkedAt = new Date().toISOString( ]; return { lastChecked: checkedAt, - message: "Notifications and alerts are placeholders only; no alert sending contract is configured for this deployment.", + message: "Notifications and alerts are Not Configured; no alert sending contract is configured for this deployment.", rows, secretEditingAllowed: false, secretsExposed: false, diff --git a/tests/dev-runtime/AdminHealthOperations.test.mjs b/tests/dev-runtime/AdminHealthOperations.test.mjs index 59bea182c..57a4af267 100644 --- a/tests/dev-runtime/AdminHealthOperations.test.mjs +++ b/tests/dev-runtime/AdminHealthOperations.test.mjs @@ -172,9 +172,10 @@ test("Admin can view operational health while Creator sessions are blocked", asy ["Runtime", "API", "Database", "Storage", "Authentication", "Email", "Background Jobs"], ); assert.equal( - health.serviceHealth.services.every((service) => ["Healthy", "Warning", "Failed", "Not Configured"].includes(service.status)), + health.serviceHealth.services.every((service) => ["PASS", "WARN", "FAIL", "NOT CONFIGURED"].includes(service.status)), true, ); + assert.equal(health.serviceHealth.services.some((service) => service.status === "PASS"), true); assert.equal(health.serviceHealth.services.every((service) => typeof service.summary === "string"), true); assert.equal(JSON.stringify(health.serviceHealth).includes("/uat"), false); assert.deepEqual( diff --git a/tests/playwright/tools/AdminHealthOperationsPage.spec.mjs b/tests/playwright/tools/AdminHealthOperationsPage.spec.mjs index cf54c49d3..3527df130 100644 --- a/tests/playwright/tools/AdminHealthOperationsPage.spec.mjs +++ b/tests/playwright/tools/AdminHealthOperationsPage.spec.mjs @@ -188,7 +188,8 @@ test("Admin System Health renders Postgres diagnostics through the safe status A expect(serviceCardText).toContain(label); }); const serviceStatuses = await serviceCards.locator("[data-health-status]").allTextContents(); - expect(serviceStatuses.every((status) => ["Healthy", "Warning", "Failed", "Not Configured"].includes(status.trim()))).toBe(true); + expect(serviceStatuses.every((status) => ["PASS", "WARN", "FAIL", "NOT CONFIGURED"].includes(status.trim()))).toBe(true); + expect(serviceStatuses).toContain("PASS"); const configurationTable = page.getByRole("table", { name: "Configuration summary" }); await expect(configurationTable).toContainText("Current environment"); await expect(configurationTable).toContainText("Hosting model"); @@ -350,6 +351,7 @@ test("Admin System Health operations page keeps scripts and styles external", as expect(pageSource).not.toMatch(/\sstyle\s*=/i); expect(pageSource).not.toMatch(/data-health-status="(?:WARN|FAIL)"/); expect(pageSource).not.toContain("No active failure is declared"); + expect(pageSource).not.toMatch(/foundation PR|foundation view|placeholder|Pending metric|intentionally not wired/i); expect(pageSource).not.toContain("SQLite"); expect(pageSource).toContain("Environment Identity"); expect(pageSource).toContain("Environment Map");