Skip to content

Commit 0ea187c

Browse files
committed
Audit browser storage product data - PR_26160_079-browser-storage-product-data-audit
1 parent 26224da commit 0ea187c

2 files changed

Lines changed: 82 additions & 12 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# PR_26160_079 Browser Storage Product Data Audit
2+
3+
Generated: 2026-06-09
4+
5+
## Branch Validation
6+
7+
| Check | Expected | Actual | Status |
8+
| --- | --- | --- | --- |
9+
| Current branch | `main` | `main` | PASS |
10+
11+
## Scope
12+
13+
Audited active `localStorage` and `sessionStorage` usage for product data, with focus on Toolbox, Admin, and Colors paths. Deprecated archive paths, reports, generated artifacts, and `node_modules` were excluded from the active-code decision.
14+
15+
## Requirement Checklist
16+
17+
| Requirement | Status | Evidence |
18+
| --- | --- | --- |
19+
| Audit `localStorage` / `sessionStorage` usage for product data | PASS | Static audits listed below. |
20+
| Report anything that should move behind API/DB adapter | PASS | `toolboxaid.projectSystem.activeManifest` is identified as a product-shaped Workspace manifest persistence path that should move in a future Workspace/API migration. |
21+
| Do not remove runtime-only UI state | PASS | Runtime-only handoff, dirty-session, live preview, inspector, and header state were preserved. |
22+
| Migrate only safe Toolbox/Admin/Colors product data if found | PASS | No safe scoped Toolbox/Admin/Colors storage migration was found; no runtime changes made. |
23+
| Produce per-PR reports, diff, changed files, validation notes, ZIP | PASS | Report and package artifacts generated for this PR. |
24+
25+
## Active Storage Findings
26+
27+
| File | Storage | Key / Data | Classification | Runtime Effect | Recommendation |
28+
| --- | --- | --- | --- | --- | --- |
29+
| `src/shared/toolbox/projectSystem.js` | `localStorage` | `toolboxaid.projectSystem.activeManifest` via `ACTIVE_PROJECT_STORAGE_KEY` | Product-shaped Workspace manifest persistence | Stores active workspace manifest and tool state snapshots between interactions. | MIGRATE in a dedicated Workspace/API PR. Not migrated here because it crosses Workspace lifecycle, tool adapters, dirty-state, save/open, and manifest validation behavior. |
30+
| `src/tools/common/WorkspaceDirtyNotifier.js` | `sessionStorage` | `workspace.tools.<toolId>` and host context id | Runtime-only unsaved workspace dirty handoff | Marks hosted Workspace Manager tool payload dirty inside the browser session. | KEEP. This is temporary draft/dirty state allowed by governance. |
31+
| `src/tools/common/GameManifestLoader.js` | `sessionStorage` | `hostContextId` Workspace launch context | Runtime-only launch handoff | Loads a manifest passed by Workspace Manager for hosted tool launches. | KEEP for now; consider API-backed hosted-launch context during Workspace migration. |
32+
| `src/shared/toolbox/toolHostSharedContext.js` | `sessionStorage`, fallback `localStorage` | `toolboxaid.toolHost.context.<contextId>` | Runtime-only hosted tool context | Stores temporary context for tool-to-tool hosted launches. | KEEP. Not durable product SSoT. |
33+
| `src/shared/toolbox/platformShell.js` | `localStorage` | `toolboxaid.toolsPlatform.headerExpanded` | UI preference | Remembers tool header expanded/collapsed state. | KEEP. UI state only. |
34+
| `src/shared/toolbox/platformShell.js` | `localStorage` / `sessionStorage` through storage services | `toolboxaid.toolsPlatform.launchSignature` and `toolboxaid.*` cleanup | Runtime launch cleanup / UI state | Clears stale transient launch/tool state when entering a new workspace launch. | KEEP. Not product SSoT. |
35+
| `src/shared/toolbox/livePreviewSyncChannel.js` | `localStorage` fallback | `__toolboxaid_live_preview_sync_v1__` | Runtime message bridge fallback | Broadcasts live preview state when `BroadcastChannel` is unavailable. | KEEP. Transient sync bridge only. |
36+
| `src/shared/toolbox/debugInspectorData.js` | None directly | Reads passed local/session storage entries into diagnostics | Diagnostic display | Displays storage snapshots supplied by caller. | KEEP. Diagnostic only. |
37+
| `src/dev-runtime/persistence/mock-db-store.js` | `localStorage` | `gamefoundry.mockDb.v1`, `gamefoundry.mockDb.sessionUser.v1`, `gamefoundry.mockDb.sessionMode.v1` | Dev-runtime Local Mem persistence and local session state | Persists Local Mem DB/session mode/session user for local development. | KEEP within `src/dev-runtime/` for this PR. It is the configured Local Mem persistence mechanism, not a page-local Toolbox/Admin/Colors product array. |
38+
| `src/shared/contracts/*.js` | None directly | Contract terms include `localStorage` / `sessionStorage` | Contract metadata | Defines allowed storage labels in product contracts. | KEEP. No runtime storage read/write. |
39+
| `src/engine/persistence/*.js` | Generic storage adapters | Browser storage service classes | Shared infrastructure | Storage abstraction used by multiple runtime features. | KEEP. Engine migration is out of scope. |
40+
41+
## Toolbox/Admin/Colors Result
42+
43+
Targeted scan of `toolbox/colors`, `admin`, and `assets/theme-v2/js` found no direct `localStorage` or `sessionStorage` use. No safe active Toolbox/Admin/Colors product-data migration was available in this PR.
44+
45+
## Deferred Migration Item
46+
47+
`src/shared/toolbox/projectSystem.js` still stores the active Workspace manifest in `localStorage`. That is product-shaped state and should move to an API/service contract backed by a DB adapter. The safe path should be a dedicated Workspace persistence PR because the current code coordinates:
48+
49+
- active workspace manifest load/save/close
50+
- dirty-state detection
51+
- tool adapter state capture/apply
52+
- external preset application
53+
- shared asset/palette handoff cleanup
54+
- Workspace Manager hosted launch behavior
55+
56+
## Validation
57+
58+
| Lane | Status | Command | Evidence |
59+
| --- | --- | --- | --- |
60+
| Branch guard | PASS | `git branch --show-current` | Returned `main`. |
61+
| Active Colors/Admin/theme storage scan | PASS | `rg -n "localStorage\|sessionStorage" toolbox/colors admin assets/theme-v2/js --glob '!**/node_modules/**'` | No matches. |
62+
| Active toolbox/runtime storage scan | PASS | `rg -n "localStorage\|sessionStorage" src/shared/toolbox src/tools/common src/dev-runtime/persistence/mock-db-store.js --glob '!**/node_modules/**'` | Findings classified above. |
63+
| Static diff validation | PASS | `git diff --check` | No whitespace errors. |
64+
65+
## Skipped Lanes
66+
67+
| Lane | Status | Reason |
68+
| --- | --- | --- |
69+
| Playwright | SKIP | Audit/report-only PR with no runtime or UI behavior changes. |
70+
| Full samples validation | SKIP | Samples and shared sample loaders were not changed. |
71+
72+
## Manual Test Notes
73+
74+
No manual browser walkthrough was required because PR_079 only documents storage ownership and does not change runtime behavior.
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
11
# Testing Lane Execution Report
22

3-
PR: PR_26160_078-colors-db-table-ownership
3+
PR: PR_26160_079-browser-storage-product-data-audit
44
Generated: 2026-06-09
55
Full samples validation: SKIPPED
66

77
## Summary
88

9-
PASS: 5
10-
WARN: 1
9+
PASS: 4
1110
FAIL: 0
12-
SKIP: 3
11+
SKIP: 2
1312

1413
## Executed Lanes
1514

1615
| Lane | Status | Command | Evidence |
1716
| --- | --- | --- | --- |
1817
| Branch guard | PASS | `git branch --show-current` | Returned `main`. |
19-
| Changed-file syntax check | PASS | `node --check toolbox/colors/colors.js` | Exited 0. |
20-
| Colors source-table static audit | PASS | `rg -n "palette_source_swatches\|sourcePalette\|listSourceSwatches\|sourcePaletteOptions\|sourcePaletteRecordCount\|data-palette-source" toolbox/colors src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js` | No active Colors page/repository hits. |
21-
| Colors Playwright | PASS | `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs --reporter=line` | 9 passed. Covers Colors grid rendering, editing, selection/pinning, reload/save behavior, tag behavior, symbol-free validation, and absence of active source-browser controls. |
18+
| Active Colors/Admin/theme storage scan | PASS | `rg -n "localStorage\|sessionStorage" toolbox/colors admin assets/theme-v2/js --glob '!**/node_modules/**'` | No matches. |
19+
| Active toolbox/runtime storage scan | PASS | `rg -n "localStorage\|sessionStorage" src/shared/toolbox src/tools/common src/dev-runtime/persistence/mock-db-store.js --glob '!**/node_modules/**'` | Findings classified in `browser-storage-product-data-audit-report.md`. |
2220
| Static diff validation | PASS | `git diff --check` | No whitespace errors. |
23-
| V8 coverage report | WARN | Generated by targeted Colors Playwright run | Advisory report updated; changed browser JS collected for Colors. |
2421

2522
## Skipped Lanes
2623

2724
| Lane | Status | Reason |
2825
| --- | --- | --- |
29-
| Full samples validation | SKIP | The PR changes Colors table-display ownership cleanup and reports only; samples and sample loaders are unchanged. |
30-
| DB Viewer Playwright | SKIP | PR_078 does not change DB Viewer UI/runtime; PR_077 covered table classification display. |
31-
| Unrelated Toolbox/Admin migration | SKIP | Out of scope for Colors palette table ownership. |
26+
| Playwright | SKIP | PR_079 is audit/report-only and does not change runtime or UI behavior. |
27+
| Full samples validation | SKIP | Samples and shared sample loaders were not changed. |
3228

3329
## Manual Test Notes
3430

35-
No additional manual walkthrough was required. Static audit found no active Colors dependency on `palette_source_swatches`; targeted Colors Playwright confirmed grid/edit/save behavior remains intact.
31+
No manual browser walkthrough was required. The audit found no safe scoped Toolbox/Admin/Colors product-data migration; `toolboxaid.projectSystem.activeManifest` is documented as a deferred Workspace/API migration item.

0 commit comments

Comments
 (0)