Skip to content
Merged
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,79 @@
# PR_26175_DELTA_008-api-client-service-coverage

## Summary

Team Delta expanded API client service coverage using the page/service testing model from PR_26175_DELTA_006 and the runtime lane discipline continued in PR_26175_DELTA_007.

This PR adds `npm run test:service:api` as a service-level lane for shared API client behavior. It reuses the existing Node test-file runner, keeps `npm test` as the site-wide/all-tests command, and does not create any team-specific test runner or Delta-named command.

## Scope

- Team: Delta
- Branch: `PR_26175_DELTA_008-api-client-service-coverage`
- Runtime code changed: `src/api/session-api-client.js`
- Tests changed: `tests/dev-runtime/ServerApiClientStandardization.test.mjs`
- Test command changed: `package.json`
- UI changed: none
- New test runner: none
- Team-named command: none

## Coverage Added

The new `test:service:api` lane covers:

- Shared server API request routing through configured `apiUrl`
- Static-only server API route failures
- Server tool constants and function calls
- Server repository client initialization and method routing
- Blocked repository validation when server initialization fails
- Session logout data-boundary handling
- Existing public API URL client coverage

## Runtime Impact

PASS - Runtime behavior change is limited to fixing `logoutSessionUser()` to use the existing `requireSessionApiData(...)` server boundary instead of an undefined helper. The API remains backward compatible and now returns standardized session data or restore guidance.

## Requirement Checklist

| Requirement | Status | Notes |
|---|---|---|
| One PR purpose only | PASS | API client service coverage only. |
| Team Delta ownership only | PASS | Shared runtime/API client testability is Delta-owned. |
| Branch from updated main | PASS | Branch created after PR_007 merge and main sync. |
| Expand API client service coverage | PASS | Added `test:service:api` and expanded shared API client tests. |
| Reuse existing test infrastructure | PASS | Reuses `scripts/run-node-test-files.mjs`. |
| Add/update `test:service:api` only if needed | PASS | A focused API service lane did not exist. |
| Do not create team-specific commands | PASS | No Delta-named npm command added. |
| Do not add a new test runner | PASS | Existing runner reused. |
| Do not duplicate PR_006 or PR_007 | PASS | Adds API service coverage, separate from page/service lane setup and runtime coverage. |
| Keep `npm test` site-wide/all-tests | PASS | Existing `npm test` remains unchanged. |
| No unrelated cleanup | PASS | Changes are limited to API coverage and the covered API boundary fix. |
| No UI changes | PASS | No UI files changed. |
| No browser-owned product data | PASS | No browser persistence or product JSON contracts changed. |
| No silent fallbacks or hidden defaults | PASS | Tests assert explicit server API errors and restore guidance. |

## Validation Lane Report

| Command | Status | Notes |
|---|---|---|
| `node --check src/api/session-api-client.js` | PASS | Syntax valid. |
| `node --check tests/dev-runtime/ServerApiClientStandardization.test.mjs` | PASS | Syntax valid. |
| `npm run test:service:api` | PASS | 2/2 targeted Node test files passed, 13 tests passed. |
| Package command assertion | PASS | `npm test` and `test:service:api` present; `test:delta-runtime` absent. |
| Delta harness absence check | PASS | `scripts/run-delta-runtime-validation.mjs` absent. |
| Delta command grep | PASS | No matches for Delta-named test commands in package scripts, scripts, source, or dev-runtime tests. |
| `git diff --check` | PASS | No whitespace errors. |

## Manual Validation Notes

- Confirmed `npm test` still points to `node ./scripts/run-node-tests.mjs`.
- Confirmed `test:service:api` is page/service-level and not team-owned.
- Confirmed no Team Delta-specific validation harness was added.
- Confirmed the session logout client now uses the same server data-boundary helper used by sign-in and current-session reads.
- Playwright was not run because this PR changes shared API client service coverage and no browser UI files.

## ZIP

Repo-structured delta ZIP:

`tmp/PR_26175_DELTA_008-api-client-service-coverage_delta.zip`
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# PR_26175_DELTA_008 Branch Validation

| Check | Status | Notes |
|---|---|---|
| Started from main | PASS | Checked out `main` before merging PR_007. |
| Pulled latest main | PASS | `git pull --ff-only` completed. |
| Main worktree clean before merge | PASS | `git status --short` returned clean. |
| Main/origin sync before merge | PASS | `git rev-list --left-right --count main...origin/main` returned `0 0`. |
| PR_007 approved merge completed | PASS | PR_26175_DELTA_007 was merged first. |
| Returned to main after merge | PASS | Main was checked out after PR_007 merge. |
| Pulled latest after merge | PASS | Main fast-forwarded to `57ef3bfee`. |
| Main clean/synced after merge | PASS | Worktree clean and `main...origin/main` returned `0 0`. |
| PR_008 branch created from updated main | PASS | Branch `PR_26175_DELTA_008-api-client-service-coverage` created from `57ef3bfee`. |

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

- Confirmed the API service lane is discoverable by service name: `npm run test:service:api`.
- Confirmed `npm test` remains the site-wide/all-tests command.
- Confirmed no `test:delta-runtime` command exists.
- Confirmed `scripts/run-delta-runtime-validation.mjs` does not exist.
- Confirmed the changed runtime file is limited to `src/api/session-api-client.js`.
- Confirmed the logout change is directly covered by new tests for success and missing server data restore guidance.
- Confirmed no UI, Playwright, browser storage, project JSON, runtime workspace JSON, or status bar files were modified.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# PR_26175_DELTA_008 Requirements Checklist

| Requirement | Status | Notes |
|---|---|---|
| Expand API client service coverage | PASS | Added shared server API, repository, tool, session, and public API URL coverage. |
| Use page/service testing model | PASS | New command is `test:service:api`. |
| Reuse existing test infrastructure | PASS | Uses `scripts/run-node-test-files.mjs`. |
| Add/update `test:service:api` only if needed | PASS | No focused API service command existed. |
| No team-specific test command | PASS | No Delta-named npm command added. |
| No new test runner | PASS | No runner script added. |
| Do not duplicate PR_006 | PASS | Does not alter the page/service test-lane setup beyond adding API service lane. |
| Do not duplicate PR_007 | PASS | Does not expand `test:service:runtime`. |
| Keep `npm test` site-wide | PASS | `npm test` remains `node ./scripts/run-node-tests.mjs`. |
| No unrelated cleanup | PASS | Only API client coverage, one covered API boundary fix, reports, and artifacts changed. |
| No UI changes | PASS | No UI files changed. |
| No browser-owned product data | PASS | No persisted browser data or project/workspace JSON contracts changed. |
| No silent fallbacks | PASS | Tests assert explicit route failures and blocked validation. |
| No hidden defaults | PASS | No implicit product/runtime defaults added. |
| Required reports | PASS | Report packet and Codex artifacts created. |
| Repo-structured ZIP | PASS | `tmp/PR_26175_DELTA_008-api-client-service-coverage_delta.zip`. |

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# PR_26175_DELTA_008 Validation Lane

## Commands

```powershell
node --check src/api/session-api-client.js
node --check tests/dev-runtime/ServerApiClientStandardization.test.mjs
npm run test:service:api
$pkg = Get-Content -Raw package.json | ConvertFrom-Json; if ($pkg.scripts.PSObject.Properties.Name -contains 'test:delta-runtime') { throw 'test:delta-runtime exists' }; if (-not ($pkg.scripts.PSObject.Properties.Name -contains 'test')) { throw 'npm test missing' }; if (-not ($pkg.scripts.PSObject.Properties.Name -contains 'test:service:api')) { throw 'test:service:api missing' }; if ($pkg.scripts.test -ne 'node ./scripts/run-node-tests.mjs') { throw 'npm test changed unexpectedly' }
if (Test-Path scripts/run-delta-runtime-validation.mjs) { throw 'unexpected delta runtime script' }
rg -n "delta-runtime|run-delta-runtime|test:delta" package.json scripts src/api tests/dev-runtime
git diff --check
```

## Results

| Command | Status |
|---|---|
| `node --check src/api/session-api-client.js` | PASS |
| `node --check tests/dev-runtime/ServerApiClientStandardization.test.mjs` | PASS |
| `npm run test:service:api` | PASS |
| Package command assertion | PASS |
| Delta harness absence check | PASS |
| Delta command grep | PASS - no matches |
| `git diff --check` | PASS |

## API Service Files

`npm run test:service:api` passed:

- `tests/dev-runtime/ServerApiClientStandardization.test.mjs`
- `tests/dev-runtime/PublicApiUrlClient.test.mjs`

## Browser / Playwright

SKIP - No browser UI files changed.

28 changes: 16 additions & 12 deletions docs_build/dev/reports/codex_changed_files.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# git status --short
M package.json
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage.md
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_branch-validation.md
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_manual-validation-notes.md
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_requirements-checklist.md
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_validation-lane.md
M src/api/session-api-client.js
M tests/dev-runtime/ServerApiClientStandardization.test.mjs
?? docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage.md
?? docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_branch-validation.md
?? docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_manual-validation-notes.md
?? docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_requirements-checklist.md
?? docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_validation-lane.md

# git ls-files --others --exclude-standard
docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage.md
docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_branch-validation.md
docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_manual-validation-notes.md
docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_requirements-checklist.md
docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_validation-lane.md
docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage.md
docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_branch-validation.md
docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_manual-validation-notes.md
docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_requirements-checklist.md
docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_validation-lane.md

# git diff --stat
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
package.json | 1 +
src/api/session-api-client.js | 2 +-
.../ServerApiClientStandardization.test.mjs | 320 +++++++++++++++++++++
3 files changed, 322 insertions(+), 1 deletion(-)
Loading
Loading