# Tasks — Migrate storage-browser-localstorage ## 1. Spec authoring - [x] 1.1 Read `../suaveplan/enterprise/storage-browser.md` end-to-end - [x] 1.2 No prior `openspec/specs/storage-browser-localstorage/spec.md` — new capability - [x] 1.3 Read `openspec/AGENTS.md` §13 + §14 - [x] 1.4 Draft `proposal.md` - [x] 1.5 Fill `## Source mapping` with line citations - [x] 1.6 Draft `specs/storage-browser-localstorage/spec.md` (delta) - [x] 1.7 Every requirement carries `**Verified by:**` ## 2. Implementation - [x] 2.1 Scaffold `packages/storage/storage-browser-localstorage/` mirroring `storage-browser-opfs` - [x] 2.2 `error-codes.ts` — 10-code `LOCAL_STORAGE_CODES` registry + `LocalStorageError` - [x] 2.3 `constants/index.ts` — `MAX_KEY_LENGTH = 256`, `DEFAULT_NAMESPACE = "suaveplan:storage"` - [x] 2.4 `types/` — `StorageLike` (DOM-compatible structural interface) + `LocalStorageStorageOptions` + Zod schema - [x] 2.5 `key-sanitizer/` — `sanitizeKey()` boundary - [x] 2.6 `envelope/` — base64 encode/decode + JSON envelope codec - [x] 2.7 `in-memory-storage/` — real-implementation `Storage`-shaped test fixture (Map-backed) - [x] 2.8 `local-storage-adapter/` — `defaultLocalStorage()` + `isLocalStorageAvailable()` sentinel probe - [x] 2.9 `otel/` — instrument set + recorder + provider override - [x] 2.10 `local-storage/local-storage.ts` — `LocalStorageStorage extends AbstractStorage` - [x] 2.11 `local-storage/local-storage.errors.ts` — error mapping (quota code 22 / 1014, security-error) - [x] 2.12 `local-storage/local-storage.ops.ts` — list/clear/getSize helpers - [x] 2.13 `registry/registry.ts` — `registerLocalStorageProvider()` explicit-call ## 3. Tests - [x] 3.1 `local-storage.test.ts` — CRUD, list, metadata, TTL, namespace, abort - [x] 3.2 `local-storage.spec-conformance.test.ts` — capabilities, all codes thrown, OTel emission, `AbstractStorage` instance - [x] 3.3 `key-sanitizer.test.ts`, `envelope.test.ts`, `in-memory-storage.test.ts`, `local-storage-adapter.test.ts`, `otel.test.ts`, `registry.test.ts` - [x] 3.4 Every `it(...)` has `{ timeout: 5000 }` ## 4. Documentation - [x] 4.1 Sibling `.md` for every `.ts` impl file - [x] 4.2 `README.md` with Modules section - [x] 4.3 No CLAUDE.md update needed (separate edit pass — done at archival time alongside other packages) ## 5. Pre-archive verification - [x] 5.1 `bun run check` - [x] 5.2 `bunx turbo lint typecheck test --filter=@suaveplan/storage-browser-localstorage` - [x] 5.3 `bunx turbo test:coverage --filter=...` — 100/100/100/100 - [x] 5.4 `bun scripts/openspec-conformance.ts @suaveplan/storage-browser-localstorage` - [x] 5.5 `bunx turbo build --filter=...` ## 6. Pre-archive checklist - [x] 6.1 Generics threaded - [x] 6.2 Zod schemas wired - [x] 6.3 Every error code thrown by a production path - [x] 6.4 Strict-mode behaviour tested - [x] 6.5 OTel emitted from production paths, asserted via in-memory `MeterProvider` - [x] 6.6 Lifecycle dedup tested (sentinel probe idempotent) - [x] 6.7 No retroactive ticks ## 7. Archive - [x] 7.1 Fold spec delta into `openspec/specs/storage-browser-localstorage/spec.md` - [x] 7.2 Move change folder to `openspec/archive/2026-05-12-storage-browser-localstorage/` - [x] 7.3 Refresh MANIFEST.md