Skip to content

Commit 1dcfc08

Browse files
authored
Merge PR_26175_DELTA_008-api-client-service-coverage
Approved EOD merge for Team Delta API client service coverage. Source branch retained.
2 parents 57ef3bf + a1f16ed commit 1dcfc08

10 files changed

Lines changed: 968 additions & 123 deletions
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# PR_26175_DELTA_008-api-client-service-coverage
2+
3+
## Summary
4+
5+
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.
6+
7+
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.
8+
9+
## Scope
10+
11+
- Team: Delta
12+
- Branch: `PR_26175_DELTA_008-api-client-service-coverage`
13+
- Runtime code changed: `src/api/session-api-client.js`
14+
- Tests changed: `tests/dev-runtime/ServerApiClientStandardization.test.mjs`
15+
- Test command changed: `package.json`
16+
- UI changed: none
17+
- New test runner: none
18+
- Team-named command: none
19+
20+
## Coverage Added
21+
22+
The new `test:service:api` lane covers:
23+
24+
- Shared server API request routing through configured `apiUrl`
25+
- Static-only server API route failures
26+
- Server tool constants and function calls
27+
- Server repository client initialization and method routing
28+
- Blocked repository validation when server initialization fails
29+
- Session logout data-boundary handling
30+
- Existing public API URL client coverage
31+
32+
## Runtime Impact
33+
34+
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.
35+
36+
## Requirement Checklist
37+
38+
| Requirement | Status | Notes |
39+
|---|---|---|
40+
| One PR purpose only | PASS | API client service coverage only. |
41+
| Team Delta ownership only | PASS | Shared runtime/API client testability is Delta-owned. |
42+
| Branch from updated main | PASS | Branch created after PR_007 merge and main sync. |
43+
| Expand API client service coverage | PASS | Added `test:service:api` and expanded shared API client tests. |
44+
| Reuse existing test infrastructure | PASS | Reuses `scripts/run-node-test-files.mjs`. |
45+
| Add/update `test:service:api` only if needed | PASS | A focused API service lane did not exist. |
46+
| Do not create team-specific commands | PASS | No Delta-named npm command added. |
47+
| Do not add a new test runner | PASS | Existing runner reused. |
48+
| Do not duplicate PR_006 or PR_007 | PASS | Adds API service coverage, separate from page/service lane setup and runtime coverage. |
49+
| Keep `npm test` site-wide/all-tests | PASS | Existing `npm test` remains unchanged. |
50+
| No unrelated cleanup | PASS | Changes are limited to API coverage and the covered API boundary fix. |
51+
| No UI changes | PASS | No UI files changed. |
52+
| No browser-owned product data | PASS | No browser persistence or product JSON contracts changed. |
53+
| No silent fallbacks or hidden defaults | PASS | Tests assert explicit server API errors and restore guidance. |
54+
55+
## Validation Lane Report
56+
57+
| Command | Status | Notes |
58+
|---|---|---|
59+
| `node --check src/api/session-api-client.js` | PASS | Syntax valid. |
60+
| `node --check tests/dev-runtime/ServerApiClientStandardization.test.mjs` | PASS | Syntax valid. |
61+
| `npm run test:service:api` | PASS | 2/2 targeted Node test files passed, 13 tests passed. |
62+
| Package command assertion | PASS | `npm test` and `test:service:api` present; `test:delta-runtime` absent. |
63+
| Delta harness absence check | PASS | `scripts/run-delta-runtime-validation.mjs` absent. |
64+
| Delta command grep | PASS | No matches for Delta-named test commands in package scripts, scripts, source, or dev-runtime tests. |
65+
| `git diff --check` | PASS | No whitespace errors. |
66+
67+
## Manual Validation Notes
68+
69+
- Confirmed `npm test` still points to `node ./scripts/run-node-tests.mjs`.
70+
- Confirmed `test:service:api` is page/service-level and not team-owned.
71+
- Confirmed no Team Delta-specific validation harness was added.
72+
- Confirmed the session logout client now uses the same server data-boundary helper used by sign-in and current-session reads.
73+
- Playwright was not run because this PR changes shared API client service coverage and no browser UI files.
74+
75+
## ZIP
76+
77+
Repo-structured delta ZIP:
78+
79+
`tmp/PR_26175_DELTA_008-api-client-service-coverage_delta.zip`
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# PR_26175_DELTA_008 Branch Validation
2+
3+
| Check | Status | Notes |
4+
|---|---|---|
5+
| Started from main | PASS | Checked out `main` before merging PR_007. |
6+
| Pulled latest main | PASS | `git pull --ff-only` completed. |
7+
| Main worktree clean before merge | PASS | `git status --short` returned clean. |
8+
| Main/origin sync before merge | PASS | `git rev-list --left-right --count main...origin/main` returned `0 0`. |
9+
| PR_007 approved merge completed | PASS | PR_26175_DELTA_007 was merged first. |
10+
| Returned to main after merge | PASS | Main was checked out after PR_007 merge. |
11+
| Pulled latest after merge | PASS | Main fast-forwarded to `57ef3bfee`. |
12+
| Main clean/synced after merge | PASS | Worktree clean and `main...origin/main` returned `0 0`. |
13+
| PR_008 branch created from updated main | PASS | Branch `PR_26175_DELTA_008-api-client-service-coverage` created from `57ef3bfee`. |
14+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# PR_26175_DELTA_008 Manual Validation Notes
2+
3+
- Confirmed the API service lane is discoverable by service name: `npm run test:service:api`.
4+
- Confirmed `npm test` remains the site-wide/all-tests command.
5+
- Confirmed no `test:delta-runtime` command exists.
6+
- Confirmed `scripts/run-delta-runtime-validation.mjs` does not exist.
7+
- Confirmed the changed runtime file is limited to `src/api/session-api-client.js`.
8+
- Confirmed the logout change is directly covered by new tests for success and missing server data restore guidance.
9+
- Confirmed no UI, Playwright, browser storage, project JSON, runtime workspace JSON, or status bar files were modified.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# PR_26175_DELTA_008 Requirements Checklist
2+
3+
| Requirement | Status | Notes |
4+
|---|---|---|
5+
| Expand API client service coverage | PASS | Added shared server API, repository, tool, session, and public API URL coverage. |
6+
| Use page/service testing model | PASS | New command is `test:service:api`. |
7+
| Reuse existing test infrastructure | PASS | Uses `scripts/run-node-test-files.mjs`. |
8+
| Add/update `test:service:api` only if needed | PASS | No focused API service command existed. |
9+
| No team-specific test command | PASS | No Delta-named npm command added. |
10+
| No new test runner | PASS | No runner script added. |
11+
| Do not duplicate PR_006 | PASS | Does not alter the page/service test-lane setup beyond adding API service lane. |
12+
| Do not duplicate PR_007 | PASS | Does not expand `test:service:runtime`. |
13+
| Keep `npm test` site-wide | PASS | `npm test` remains `node ./scripts/run-node-tests.mjs`. |
14+
| No unrelated cleanup | PASS | Only API client coverage, one covered API boundary fix, reports, and artifacts changed. |
15+
| No UI changes | PASS | No UI files changed. |
16+
| No browser-owned product data | PASS | No persisted browser data or project/workspace JSON contracts changed. |
17+
| No silent fallbacks | PASS | Tests assert explicit route failures and blocked validation. |
18+
| No hidden defaults | PASS | No implicit product/runtime defaults added. |
19+
| Required reports | PASS | Report packet and Codex artifacts created. |
20+
| Repo-structured ZIP | PASS | `tmp/PR_26175_DELTA_008-api-client-service-coverage_delta.zip`. |
21+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# PR_26175_DELTA_008 Validation Lane
2+
3+
## Commands
4+
5+
```powershell
6+
node --check src/api/session-api-client.js
7+
node --check tests/dev-runtime/ServerApiClientStandardization.test.mjs
8+
npm run test:service:api
9+
$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' }
10+
if (Test-Path scripts/run-delta-runtime-validation.mjs) { throw 'unexpected delta runtime script' }
11+
rg -n "delta-runtime|run-delta-runtime|test:delta" package.json scripts src/api tests/dev-runtime
12+
git diff --check
13+
```
14+
15+
## Results
16+
17+
| Command | Status |
18+
|---|---|
19+
| `node --check src/api/session-api-client.js` | PASS |
20+
| `node --check tests/dev-runtime/ServerApiClientStandardization.test.mjs` | PASS |
21+
| `npm run test:service:api` | PASS |
22+
| Package command assertion | PASS |
23+
| Delta harness absence check | PASS |
24+
| Delta command grep | PASS - no matches |
25+
| `git diff --check` | PASS |
26+
27+
## API Service Files
28+
29+
`npm run test:service:api` passed:
30+
31+
- `tests/dev-runtime/ServerApiClientStandardization.test.mjs`
32+
- `tests/dev-runtime/PublicApiUrlClient.test.mjs`
33+
34+
## Browser / Playwright
35+
36+
SKIP - No browser UI files changed.
37+
Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
# git status --short
22
M package.json
3-
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage.md
4-
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_branch-validation.md
5-
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_manual-validation-notes.md
6-
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_requirements-checklist.md
7-
?? docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_validation-lane.md
3+
M src/api/session-api-client.js
4+
M tests/dev-runtime/ServerApiClientStandardization.test.mjs
5+
?? docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage.md
6+
?? docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_branch-validation.md
7+
?? docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_manual-validation-notes.md
8+
?? docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_requirements-checklist.md
9+
?? docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_validation-lane.md
810

911
# git ls-files --others --exclude-standard
10-
docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage.md
11-
docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_branch-validation.md
12-
docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_manual-validation-notes.md
13-
docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_requirements-checklist.md
14-
docs_build/dev/reports/PR_26175_DELTA_007-runtime-service-coverage_validation-lane.md
12+
docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage.md
13+
docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_branch-validation.md
14+
docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_manual-validation-notes.md
15+
docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_requirements-checklist.md
16+
docs_build/dev/reports/PR_26175_DELTA_008-api-client-service-coverage_validation-lane.md
1517

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

0 commit comments

Comments
 (0)