|
1 | | -# PR_26158_022 Browser Mock Remaining Audit |
| 1 | +# PR_26158_024 Browser Mock Remaining Audit |
2 | 2 |
|
3 | | -## Audit Scope |
| 3 | +## Scope |
4 | 4 |
|
5 | | -Active browser/tool files changed or adjacent to PR_26158_020/021: |
| 5 | +Focused audit for browser-visible files and adjacent server/API cleanup touched in PR_26158_024: |
6 | 6 |
|
| 7 | +- `admin/db-viewer.html` |
7 | 8 | - `admin/db-viewer.js` |
8 | | -- `assets/theme-v2/js/login-session.js` |
9 | | -- `assets/theme-v2/js/tool-display-mode.js` |
10 | | -- `admin/tools-progress.js` |
11 | | -- `toolbox/tools-page-accordions.js` |
12 | | -- `toolbox/project-journey/project-journey.js` |
13 | | -- toolbox API clients under `toolbox/*/*-api-client.js` |
14 | | -- engine API clients under `src/engine/api/` |
| 9 | +- `src/engine/api/mock-db-api-client.js` |
| 10 | +- `src/engine/api/mock-db-viewer-ui.js` |
| 11 | +- `src/dev-runtime/server/mock-api-router.mjs` |
| 12 | +- `src/dev-runtime/persistence/mock-db-store.js` |
| 13 | +- `tests/playwright/tools/AdminDbViewer.spec.mjs` |
| 14 | +- `tests/playwright/tools/LoginSessionMode.spec.mjs` |
15 | 15 |
|
16 | | -## Findings |
| 16 | +## Static Import Boundary |
17 | 17 |
|
18 | 18 | | Check | Status | Evidence | |
19 | 19 | | --- | --- | --- | |
20 | | -| Active browser files import `src/dev-runtime` directly. | PASS | Focused `rg` found no active browser entry imports after migration. | |
21 | | -| Active browser files import mock repositories directly. | PASS | Remaining `*-mock-repository.js` imports are repository/server-dev implementation files only. | |
22 | | -| Active browser files import `mock-db-store` or dev persistence. | PASS | `src/engine/persistence/mock-db-store.js` was removed; browser files use API clients. | |
23 | | -| Active browser files import static Toolbox registry records directly. | PASS | Toolbox page, Project Journey, Admin Tools Progress, and Tool Display Mode now use `toolbox/tool-registry-api-client.js`. | |
24 | | -| Active browser files keep page-local mock DB snapshots or fake records. | PASS | Palette invalid/empty source modes are server-owned; DB Viewer reads `/api/mock-db/snapshot`. | |
25 | | -| Active browser files use `localStorage`/`sessionStorage` for mock DB/session fallback. | PASS | Migrated files use session/Mock DB API clients; permitted Workspace/sessionStorage contracts in unrelated shared runtime files were not modified. | |
| 20 | +| Browser files import `src/dev-runtime` directly. | PASS | `rg -n '^import .*src/dev-runtime|import\\(.*src/dev-runtime' assets admin toolbox src -g '*.js' -g '!src/dev-runtime/**' ...` returned no matches. | |
| 21 | +| Browser files import static `toolRegistry.js` directly. | PASS | `rg -n '^import .*toolRegistry\\.js|import\\(.*toolRegistry\\.js' ...` returned no matches. | |
| 22 | +| Browser files import mock repositories directly. | PASS | Refined `rg` excluding repository implementation files returned no matches. | |
26 | 23 |
|
27 | | -## Remaining Matches And Classification |
| 24 | +## Local Mode Cleanup |
28 | 25 |
|
29 | | -`rg` still finds mock/dev strings in these categories: |
30 | | - |
31 | | -- `src/dev-runtime/server/mock-api-router.mjs`: PASS, server/dev runtime API owner. |
32 | | -- `toolbox/*/*-mock-repository.js`, `toolbox/colors/palette-workspace-repository.js`, `toolbox/colors/palette-source-mock-db.js`: PASS, server/dev-only repository/data source modules imported by the dev server router. |
33 | | -- `src/shared/toolbox/*` imports of `toolbox/toolRegistry.js`: AUDIT NOTE, product registry/shared shell metadata outside the active browser files changed by this migration pass. The adjacent active consumers were migrated to the server-backed registry endpoint. |
| 26 | +| Check | Status | Evidence | |
| 27 | +| --- | --- | --- | |
| 28 | +| Local login shows only Local Mem and Local DB. | PASS | Login Playwright lane asserts exact labels. | |
| 29 | +| DEV/UAT/Prod are not local login buttons. | PASS | Login Playwright lane asserts no DEV, UAT, or Prod buttons. | |
| 30 | +| Server rejects legacy `modeId: "local"`. | PASS | API contract probe returned 500 with `Unknown local login environment: local`. | |
| 31 | +| Local DB does not fall back to Local Mem. | PASS | API contract probe verified Local DB snapshot fails with `Local DB adapter not configured`. | |
| 32 | +| DB Viewer user-facing wording says Local Mem DB. | PASS | Admin DB Viewer Playwright asserts Local Mem DB headings, status text, clear/seed controls, and dialogs. | |
34 | 33 |
|
35 | | -## Command Evidence |
| 34 | +## Remaining Internal Matches |
36 | 35 |
|
37 | | -- `rg -n "dev-runtime|toolRegistry\\.js|mock-db-store|mock-repository|palette-workspace-repository|palette-source-mock-db|localStorage|sessionStorage" admin assets/theme-v2/js toolbox src/engine/api -g "*.js" -g "*.mjs" --glob "!archive/**" --glob "!**/start_of_day/**" --glob "!node_modules/**" --glob "!tmp/**"` |
38 | | -- Remaining results were only server/dev repository implementation modules. |
| 36 | +- `toolbox/*/*-mock-repository.js` and `toolbox/colors/palette-workspace-repository.js` remain server/data-source implementation modules, not active browser entry imports. |
| 37 | +- `/api/mock-db/*` route names and `mock-db-*` module filenames remain stable internal API contracts. |
| 38 | +- Internal exception text `Invalid mock DB audit user key` remains in non-user-facing audit validation. |
0 commit comments