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