Skip to content

Commit f75e53c

Browse files
authored
Merge pull request #185 from ToolboxAid/PR_26175_DELTA_003_API_Client_Standardization
PR_26175_DELTA_003: standardize API client data handling
2 parents 801780b + e16f568 commit f75e53c

13 files changed

Lines changed: 627 additions & 50 deletions

docs_build/dev/ProjectInstructions/backlog/BACKLOG_MASTER.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ Current OWNER clarification:
243243

244244
- [x] Delta - Shared JS consolidation
245245
- Completion reference: PR_26175_DELTA_002_Shared_Runtime_Consolidation.
246-
- [ ] Delta - API client consolidation
246+
- [x] Delta - API client consolidation
247+
- Completed by PR_26175_DELTA_003_API_Client_Standardization.
247248
- [x] Delta - Runtime performance audit
248249
- Completion reference: PR_26175_DELTA_001_Runtime_Performance_Optimization.
249250
- [ ] Delta - Engine test coverage improvements
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# PR_26175_DELTA_003 Branch Validation
2+
3+
| Gate | Status | Evidence |
4+
| --- | --- | --- |
5+
| Current branch before work | PASS | `main` after PR_002 merge |
6+
| Worktree before work | PASS | Clean |
7+
| Local/origin sync before work | PASS | `0 0` |
8+
| Team ownership | PASS | Team Delta owns Shared JS, API clients, Runtime, Performance, and technical debt remediation. |
9+
| Work branch | PASS | `PR_26175_DELTA_003_API_Client_Standardization` |
10+
| Previous Delta PR closed | PASS | PR_002 was merged and `main` was verified before PR_003 started. |
11+
| Scope boundary | PASS | Shared server API data helper plus session/setup/DB Viewer adopters and focused test only. |
12+
13+
## Instruction Reads
14+
15+
PASS - All files under `docs_build/dev/ProjectInstructions/` were read before the Delta sequence, and updated instructions were reread after pulling latest `main`.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# PR_26175_DELTA_003 Manual Validation Notes
2+
3+
## Manual Review
4+
5+
- Confirmed the shared API helper remains backward compatible for existing callers.
6+
- Confirmed Session, Admin Setup, and DB Viewer clients retain their previous restore guidance text.
7+
- Confirmed no runtime UI, Theme V2, browser-owned data, or status bar files changed.
8+
9+
## Manual Validation
10+
11+
PASS - Code review found no unrelated runtime behavior change.
12+
13+
## Follow-Up
14+
15+
- Remaining Delta runtime work continues in the next sequential PRs for runtime test expansion and technical debt cleanup.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# PR_26175_DELTA_003 Requirement Checklist
2+
3+
| Requirement | Status | Notes |
4+
| --- | --- | --- |
5+
| Team Delta ownership only | PASS | API client standardization is Delta-owned. |
6+
| One PR purpose | PASS | Shared server API data handling consolidation only. |
7+
| Preserve backward compatibility | PASS | Existing default and domain-specific restore messages are preserved. |
8+
| Update backlog | PASS | `Delta - API client consolidation` marked complete. |
9+
| Update tool state if applicable | PASS | Not applicable; no tool tile/status changed. |
10+
| Produce governance reports | PASS | Summary, branch validation, checklist, validation lane, manual notes, Codex diff, changed-file list, and ZIP. |
11+
| Runtime validation | PASS | Focused node checks and API/dev-runtime tests passed. |
12+
| No unrelated files | PASS | Changes are limited to API clients, focused test, backlog, and reports. |
13+
| No branch deletion | PASS | Source branch retained. |
14+
15+
## Compatibility Notes
16+
17+
- `requireServerApiData(...)` remains source compatible for existing two-argument callers.
18+
- New optional restore guidance avoids local unwrap duplication without weakening domain-specific diagnostics.
19+
- Browser API route resolution behavior is unchanged.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# PR_26175_DELTA_003 Validation Lane
2+
3+
## Commands
4+
5+
```powershell
6+
node --check src/api/server-api-client.js
7+
node --check src/api/session-api-client.js
8+
node --check src/api/admin-setup-api-client.js
9+
node --check src/api/db-viewer-api-client.js
10+
node --check tests/dev-runtime/ServerApiClientStandardization.test.mjs
11+
node tests/dev-runtime/ServerApiClientStandardization.test.mjs
12+
node tests/dev-runtime/PublicApiUrlClient.test.mjs
13+
node tests/dev-runtime/DbViewerConfiguredSnapshot.test.mjs
14+
node tests/dev-runtime/AdminHealthOperations.test.mjs
15+
git diff --check
16+
```
17+
18+
## Results
19+
20+
| Command | Status |
21+
| --- | --- |
22+
| `node --check src/api/server-api-client.js` | PASS |
23+
| `node --check src/api/session-api-client.js` | PASS |
24+
| `node --check src/api/admin-setup-api-client.js` | PASS |
25+
| `node --check src/api/db-viewer-api-client.js` | PASS |
26+
| `node --check tests/dev-runtime/ServerApiClientStandardization.test.mjs` | PASS |
27+
| `node tests/dev-runtime/ServerApiClientStandardization.test.mjs` | PASS |
28+
| `node tests/dev-runtime/PublicApiUrlClient.test.mjs` | PASS |
29+
| `node tests/dev-runtime/DbViewerConfiguredSnapshot.test.mjs` | PASS |
30+
| `node tests/dev-runtime/AdminHealthOperations.test.mjs` | PASS |
31+
| `git diff --check` | PASS |
32+
33+
## Browser Validation
34+
35+
SKIP - No browser UI files changed.
36+
37+
## Playwright Validation
38+
39+
SKIP - API client standardization is covered by focused Node tests.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# PR_26175_DELTA_003_API_Client_Standardization
2+
3+
## Summary
4+
5+
Team Delta standardized remaining local API data unwrap helpers onto the shared `requireServerApiData(...)` client boundary.
6+
7+
`requireServerApiData(...)` now accepts optional client-specific restore guidance while preserving the existing default Browser -> Server API -> Data Source contract message. Session, Admin Setup, and DB Viewer API clients now delegate to the shared helper and keep their previous domain-specific guidance.
8+
9+
## Scope
10+
11+
- Team: Delta
12+
- Backlog item: `Delta - API client consolidation`
13+
- Shared API client changed: `src/api/server-api-client.js`
14+
- API clients consolidated:
15+
- `src/api/session-api-client.js`
16+
- `src/api/admin-setup-api-client.js`
17+
- `src/api/db-viewer-api-client.js`
18+
- Tests added: `tests/dev-runtime/ServerApiClientStandardization.test.mjs`
19+
- Backlog updated: `docs_build/dev/ProjectInstructions/backlog/BACKLOG_MASTER.md`
20+
21+
## Runtime Impact
22+
23+
PASS - API client behavior remains backward compatible.
24+
25+
- Successful server API responses still return `payload.data`.
26+
- Failed server API responses still throw the server error text.
27+
- Missing `data` payloads still emit actionable restore guidance.
28+
- Existing session, setup, and DB Viewer restore messages are preserved through the shared helper.
29+
30+
## Backlog Update
31+
32+
PASS - `Delta - API client consolidation` is marked complete with this PR as the completion reference.
33+
34+
## Tool State Update
35+
36+
SKIP - No Build Path tool status or tool tile state changed.
37+
38+
## Validation Summary
39+
40+
PASS - Focused API client and adjacent dev-runtime validation completed.
41+
42+
See `PR_26175_DELTA_003_API_Client_Standardization-validation.md` for command details.
43+
44+
## Branch Disposition
45+
46+
Source branch should be retained after merge unless OWNER later approves branch deletion.
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
docs_build/dev/ProjectInstructions/backlog/BACKLOG_MASTER.md / updated
2-
src/shared/runtime/snapshotClone.js / updated
3-
src/engine/replay/ReplayModel.js / updated
4-
src/engine/replay/ReplaySystem.js / updated
5-
tests/replay/ReplaySystem.test.mjs / updated
6-
docs_build/dev/reports/PR_26175_DELTA_002_Shared_Runtime_Consolidation.md / added
7-
docs_build/dev/reports/PR_26175_DELTA_002_Shared_Runtime_Consolidation-branch-validation.md / added
8-
docs_build/dev/reports/PR_26175_DELTA_002_Shared_Runtime_Consolidation-requirement-checklist.md / added
9-
docs_build/dev/reports/PR_26175_DELTA_002_Shared_Runtime_Consolidation-validation.md / added
10-
docs_build/dev/reports/PR_26175_DELTA_002_Shared_Runtime_Consolidation-manual-validation-notes.md / added
11-
docs_build/dev/reports/codex_changed_files.txt / updated
12-
docs_build/dev/reports/codex_review.diff / updated
1+
docs_build/dev/ProjectInstructions/backlog/BACKLOG_MASTER.md
2+
docs_build/dev/reports/PR_26175_DELTA_003_API_Client_Standardization-branch-validation.md
3+
docs_build/dev/reports/PR_26175_DELTA_003_API_Client_Standardization-manual-validation-notes.md
4+
docs_build/dev/reports/PR_26175_DELTA_003_API_Client_Standardization-requirement-checklist.md
5+
docs_build/dev/reports/PR_26175_DELTA_003_API_Client_Standardization-validation.md
6+
docs_build/dev/reports/PR_26175_DELTA_003_API_Client_Standardization.md
7+
docs_build/dev/reports/codex_changed_files.txt
8+
docs_build/dev/reports/codex_review.diff
9+
src/api/admin-setup-api-client.js
10+
src/api/db-viewer-api-client.js
11+
src/api/server-api-client.js
12+
src/api/session-api-client.js
13+
tests/dev-runtime/ServerApiClientStandardization.test.mjs

0 commit comments

Comments
 (0)