Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# PR_26175_DELTA_007-runtime-api-client-service-tests

## Summary

Team Delta added service-level API client coverage for the standardized Browser -> Server API -> Data Source boundary.

This PR fixes the session logout API client to use the same `requireServerApiData(...)` unwrap path as the other session client calls. It also adds targeted tests proving logout uses the configured server API URL, returns `payload.data`, and preserves the session-specific restore guidance when server data is missing.

## Scope

- Team: Delta
- Branch: `PR_26175_DELTA_007-runtime-api-client-service-tests`
- Runtime file changed: `src/api/session-api-client.js`
- Test file changed: `tests/dev-runtime/ServerApiClientStandardization.test.mjs`
- Service test command added: `npm run test:service:api-client`
- Site-wide command preserved: `npm test`

## Runtime Impact

PASS - Session logout now follows the standardized server-data boundary instead of calling an undefined helper.

## API / Data Impact

PASS - No API routes or persisted data contracts changed. The browser API client still calls `/session/logout` with `POST` and reads server-owned `payload.data`.

## Requirement Checklist

| Requirement | Status | Notes |
|---|---|---|
| One PR purpose only | PASS | API client service testability only. |
| Team Delta ownership only | PASS | API clients and runtime test coverage are Delta-owned. |
| No team-specific test runner | PASS | No Delta-named runner or command added. |
| No `scripts/run-delta-runtime-validation.mjs` | PASS | File was not added. |
| No `test:delta-runtime` | PASS | Script was not added. |
| Testing organized by service/page level | PASS | Added `test:service:api-client`. |
| Keep `npm test` as site-wide command | PASS | Existing `npm test` is unchanged. |
| No UI changes | PASS | No UI files changed. |
| No browser-owned product data | PASS | Test stubs only the server API response; no persisted browser data source added. |
| No silent fallbacks or hidden defaults | PASS | Missing server data still throws explicit restore guidance. |

## Validation Lane Report

| Command | Status | Notes |
|---|---|---|
| `node --check src/api/session-api-client.js` | PASS | API client syntax valid. |
| `node --check tests/dev-runtime/ServerApiClientStandardization.test.mjs` | PASS | Test syntax valid. |
| `npm run test:service:api-client` | PASS | 1 targeted file, 6 tests passed. |
| `git diff --check` | PASS | No whitespace errors. |
| `npm run codex:review-artifacts` | PASS | Regenerated `codex_review.diff` and `codex_changed_files.txt`. |

## Manual Validation Notes

- Confirmed `package.json` keeps `npm test` unchanged.
- Confirmed no Team Delta-specific validation command was introduced.
- Confirmed session logout test uses mocked server API data instead of browser-owned persisted state.
- Playwright was not run; this is a Node service/API-client coverage change.

## ZIP

Expected repo-structured delta ZIP:

`tmp/PR_26175_DELTA_007-runtime-api-client-service-tests_delta.zip`

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# PR_26175_DELTA_007 Branch Validation

| Check | Status | Evidence |
|---|---|---|
| Started from `main` | PASS | `main` was checked out and fast-forward pulled before work began. |
| Local/origin sync before branch | PASS | `git rev-list --left-right --count main...origin/main` returned `0 0`. |
| Worktree clean before branch | PASS | `git status --short` returned no entries. |
| Working branch | PASS | `PR_26175_DELTA_007-runtime-api-client-service-tests`. |
| Direct commit to `main` avoided | PASS | Changes were made only on the PR branch. |

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# PR_26175_DELTA_007 Manual Validation Notes

- Reviewed changed files for API-client-only scope.
- Confirmed no UI files changed.
- Confirmed no persisted browser-owned product data was introduced.
- Confirmed no `scripts/run-delta-runtime-validation.mjs` file was added.
- Confirmed no `test:delta-runtime` script was added.
- Confirmed `npm test` remains the site-wide/all-tests command.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# PR_26175_DELTA_007 Requirements Checklist

| Requirement | Status | Notes |
|---|---|---|
| Branch from updated main | PASS | Branch created after fast-forward pull and sync check. |
| Build smallest scoped change | PASS | Fixed session logout unwrap and added focused API client tests. |
| Validate targeted tests | PASS | `npm run test:service:api-client` passed. |
| Required reports created | PASS | PR report, branch validation, checklist, validation lane, manual notes, review diff, changed files. |
| Repo-structured ZIP created | PASS | `tmp/PR_26175_DELTA_007-runtime-api-client-service-tests_delta.zip`. |
| Open PR | PENDING | Opened after commit and push. |
| Stop before merge approval | PASS | This PR is draft/open only; no merge performed. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# PR_26175_DELTA_007 Validation Lane

## Targeted Lane

`npm run test:service:api-client`

## Results

| Command | Result |
|---|---|
| `node --check src/api/session-api-client.js` | PASS |
| `node --check tests/dev-runtime/ServerApiClientStandardization.test.mjs` | PASS |
| `npm run test:service:api-client` | PASS |
| `git diff --check` | PASS |

## Notes

- The service lane is page/service-level and not named for Team Delta.
- Full `npm test` was not run because this PR is scoped to API client service coverage.

65 changes: 23 additions & 42 deletions docs_build/dev/reports/codex_changed_files.txt
Original file line number Diff line number Diff line change
@@ -1,45 +1,26 @@
# git diff --name-only pr/26177-CHARLIE-029-system-health-postgres-metrics-panel --
admin/system-health.html
assets/theme-v2/js/admin-system-health.js
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation.md
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_branch-validation.md
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_manual-validation-notes.md
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_requirements-checklist.md
docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_validation-lane.md
docs_build/dev/reports/codex_changed_files.txt
docs_build/dev/reports/codex_review.diff
docs_build/dev/reports/coverage_changed_js_guardrail.txt
docs_build/dev/reports/playwright_v8_coverage_report.txt
src/api/admin-system-health-api-client.js
src/dev-runtime/server/local-api-router.mjs
tests/api/admin-system-health/contract.test.mjs
tests/dev-runtime/AdminHealthOperations.test.mjs
tests/playwright/tools/AdminHealthOperationsPage.spec.mjs

# git status --short
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation.md
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_branch-validation.md
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_manual-validation-notes.md
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_requirements-checklist.md
M docs_build/dev/reports/PR_26177_CHARLIE_030-r2-storage-health-expanded-validation_validation-lane.md
M docs_build/dev/reports/codex_changed_files.txt
M docs_build/dev/reports/codex_review.diff
M docs_build/dev/reports/playwright_v8_coverage_report.txt
M package.json
M src/api/session-api-client.js
M tests/dev-runtime/ServerApiClientStandardization.test.mjs
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-api-client-service-tests.md
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-api-client-service-tests_branch-validation.md
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-api-client-service-tests_manual-validation-notes.md
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-api-client-service-tests_requirements-checklist.md
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-api-client-service-tests_validation-lane.md

# git ls-files --others --exclude-standard
docs_build/dev/reports/PR_26175_DELTA_007-runtime-api-client-service-tests.md
docs_build/dev/reports/PR_26175_DELTA_007-runtime-api-client-service-tests_branch-validation.md
docs_build/dev/reports/PR_26175_DELTA_007-runtime-api-client-service-tests_manual-validation-notes.md
docs_build/dev/reports/PR_26175_DELTA_007-runtime-api-client-service-tests_requirements-checklist.md
docs_build/dev/reports/PR_26175_DELTA_007-runtime-api-client-service-tests_validation-lane.md

# git diff --stat pr/26177-CHARLIE-029-system-health-postgres-metrics-panel --
admin/system-health.html | 13 +-
assets/theme-v2/js/admin-system-health.js | 41 +-
...IE_030-r2-storage-health-expanded-validation.md | 35 +
...health-expanded-validation_branch-validation.md | 17 +
...-expanded-validation_manual-validation-notes.md | 9 +
...h-expanded-validation_requirements-checklist.md | 13 +
...e-health-expanded-validation_validation-lane.md | 22 +
docs_build/dev/reports/codex_changed_files.txt | 70 +-
docs_build/dev/reports/codex_review.diff | 988 +++++++++++----------
.../dev/reports/coverage_changed_js_guardrail.txt | 6 +-
.../dev/reports/playwright_v8_coverage_report.txt | 17 +-
src/api/admin-system-health-api-client.js | 4 +
src/dev-runtime/server/local-api-router.mjs | 105 ++-
tests/api/admin-system-health/contract.test.mjs | 19 +
tests/dev-runtime/AdminHealthOperations.test.mjs | 6 +
.../tools/AdminHealthOperationsPage.spec.mjs | 8 +-
16 files changed, 851 insertions(+), 522 deletions(-)
# git diff --stat
docs_build/dev/reports/codex_changed_files.txt | 65 +-
docs_build/dev/reports/codex_review.diff | 1825 +++++++++++++-------
package.json | 1 +
src/api/session-api-client.js | 2 +-
.../ServerApiClientStandardization.test.mjs | 126 ++
5 files changed, 1335 insertions(+), 684 deletions(-)
Loading