|
1 | | -# PR_26158_025 Browser Mock Remaining Audit |
| 1 | +# PR_26158_026 Browser Mock Remaining Audit |
2 | 2 |
|
3 | 3 | ## Scope |
4 | 4 |
|
5 | | -Focused audit for the Local DB server adapter step: |
| 5 | +Focused audit for enabling Local DB read-only inspection through Admin DB Viewer: |
6 | 6 |
|
| 7 | +- `admin/db-viewer.html` |
7 | 8 | - `admin/db-viewer.js` |
8 | | -- `src/dev-runtime/server/mock-api-router.mjs` |
9 | | -- `src/dev-runtime/persistence/mock-db-store.js` |
10 | | -- `tests/playwright/tools/LoginSessionMode.spec.mjs` |
| 9 | +- `src/engine/api/mock-db-api-client.js` |
| 10 | +- `src/engine/api/mock-db-viewer-ui.js` |
| 11 | +- `tests/playwright/tools/AdminDbViewer.spec.mjs` |
11 | 12 |
|
12 | 13 | ## Static Import Boundary |
13 | 14 |
|
14 | 15 | | Check | Status | Evidence | |
15 | 16 | | --- | --- | --- | |
16 | | -| Browser files import `src/dev-runtime` directly. | PASS | `rg -n 'src/dev-runtime' admin assets toolbox src -g '*.js' -g '*.mjs' -g '!src/dev-runtime/**' -g '!**/*-mock-repository.js' -g '!toolbox/colors/palette-workspace-repository.js' ...` returned no matches. | |
17 | | -| Browser files import mock repositories directly. | PASS | `rg -n 'mock-.*repository' ...` excluding repository implementation files returned no matches. | |
18 | | -| Browser files import static `toolRegistry.js` directly. | PASS | `rg -n 'import .*toolRegistry\\.js|from .*toolRegistry\\.js|import\\(.*toolRegistry\\.js' ...` returned no matches. | |
| 17 | +| Browser files import `src/dev-runtime` directly. | PASS | `rg -n 'src/dev-runtime' admin assets toolbox src -g '*.js' -g '*.mjs' -g '!src/dev-runtime/**' -g '!**/*-mock-repository.js' ...` returned no matches. | |
| 18 | +| Browser files import mock repositories directly. | PASS | `rg -n 'mock-.*repository|LocalDbAdapter|DB implementation' ...` excluding repository implementation files returned no matches. | |
| 19 | +| Browser files import `LocalDbAdapter` or DB implementation modules directly. | PASS | Same focused `rg` returned no browser matches. | |
19 | 20 |
|
20 | | -## Local DB Boundary |
| 21 | +## Local DB Viewer Boundary |
21 | 22 |
|
22 | 23 | | Check | Status | Evidence | |
23 | 24 | | --- | --- | --- | |
24 | | -| Browser flow remains Browser -> API client -> server API -> data source. | PASS | Local DB implementation lives in `src/dev-runtime/server/mock-api-router.mjs`; login and DB Viewer continue to use `/api/session/*` and `/api/mock-db/*`. | |
25 | | -| Browser code does not import Local DB implementation modules. | PASS | No browser import-boundary matches were found. | |
26 | | -| Local Mem behavior remains available. | PASS | LoginSessionMode and AdminDbViewer Playwright lanes passed against Local Mem. | |
27 | | -| Local DB is configured behind the existing server API boundary. | PASS | API contract probe selected `local-db`, resolved users/roles, read snapshots, and verified persisted clear across server restart. | |
28 | | -| Local DB failure is visible and actionable. | PASS | API contract probe with `GAMEFOUNDRY_LOCAL_DB_DISABLE=1` returned a 500 diagnostic naming `Local DB adapter not configured` and the disabled storage cause. | |
29 | | -| UAT/Prod are not local login choices. | PASS | LoginSessionMode Playwright and API contract probe assert only Local Mem and Local DB selector modes. | |
| 25 | +| Browser flow remains Browser -> API client -> server API -> data source. | PASS | DB Viewer still uses `src/engine/api/mock-db-api-client.js` and `/api/mock-db/snapshot`; no browser Local DB imports were added. | |
| 26 | +| Local Mem behavior is preserved. | PASS | AdminDbViewer Playwright retained Local Mem clear/seed, filters, diagnostics, and live persisted tool-record coverage. | |
| 27 | +| Local DB behavior is read-only. | PASS | AdminDbViewer Playwright asserts no Local DB clear/seed/write controls are visible or available. | |
| 28 | +| Local DB renders live server-backed adapter state. | PASS | Playwright and API contract probe mutate/read server state through API routes and verify DB Viewer output. | |
| 29 | +| Local DB missing storage fails visibly. | PASS | Playwright and API contract probe assert `Local DB adapter not configured` diagnostics. | |
| 30 | +| UAT/Prod are not local login choices. | PASS | `/api/session/modes` probe returned exactly `Local Mem` and `Local DB`; UAT/Prod remain server-side deployment metadata only. | |
30 | 31 |
|
31 | 32 | ## Remaining Internal Matches |
32 | 33 |
|
| 34 | +- UAT/Prod strings remain only in the server adapter contract as deployment-only metadata. |
33 | 35 | - `toolbox/*/*-mock-repository.js` and `toolbox/colors/palette-workspace-repository.js` remain server/data-source implementation modules, not active browser entry imports. |
34 | 36 | - `/api/mock-db/*` route names and `mock-db-*` module filenames remain stable internal API contracts. |
0 commit comments