4.2 KiB
4.2 KiB
Tasks — Add @suaveplan/storage-browser-indexeddb
1. Spec authoring
- 1.1 Read
../suaveplan/enterprise/storage-browser.mdend-to-end (IndexedDB half) - 1.2 Read
openspec/specs/storage/spec.mdandopenspec/specs/storage-browser-opfs/spec.md - 1.3 Read
openspec/AGENTS.mdSections 13 and 14 - 1.4 Draft
proposal.mdfromopenspec/templates/proposal.md - 1.5 Fill
## Source mappingtable — every requirement cites a line range or is justified in the "no source line" table - 1.6 Draft
specs/storage-browser-indexeddb/spec.mdfromopenspec/templates/spec-delta.md - 1.7 Every requirement in the spec delta carries a
**Verified by:**line naming concreteit(...)titles
2. Implementation
- 2.1
src/constants/index.ts—MAX_KEY_LENGTH,DEFAULT_DB_NAME,DEFAULT_STORE_NAME,DEFAULT_VERSION,EXPIRES_AT_INDEX - 2.2
src/error-codes/error-codes.ts—INDEXEDDB_CODES(11 codes) +IndexedDbError - 2.3
src/key-sanitizer/key-sanitizer.ts— strict key boundary - 2.4
src/idb-adapter/idb-adapter.ts— lazydefaultIndexedDB()+isIndexedDbAvailable() - 2.5
src/types/idb-like.types.ts— structural IDBFactory surface - 2.6
src/types/indexeddb-storage.types.ts—IndexedDbStorageOptions+ Zod schema +IndexedDbEntry - 2.7
src/otel/otel.ts— meter, instruments,recordOpdispatcher - 2.8
src/indexeddb-storage/indexeddb-storage.ops.ts—openDatabase,withStore,promisifyRequest,paginateKeys,collectLiveEntries - 2.9
src/indexeddb-storage/indexeddb-storage.errors.ts— DOMException mapping + assert helpers - 2.10
src/indexeddb-storage/indexeddb-storage.crud.ts— CRUD primitives - 2.11
src/indexeddb-storage/indexeddb-storage.config.ts—resolveOptions+recordedOpwrapper - 2.12
src/indexeddb-storage/indexeddb-storage.ts—IndexedDbStorageclass +createIndexedDbStoragefactory - 2.13
src/registry/registry.ts—registerIndexedDbProviderwith factory module augmentation
3. Tests
- 3.1 Unit tests at
src/indexeddb-storage/indexeddb-storage.test.tscovering every CRUD/metadata/TTL/list/abort/error path - 3.2 Spec-conformance tests at
src/indexeddb-storage/indexeddb-storage.spec-conformance.test.tspinning type/observability/strict-mode/lifecycle scenarios - 3.3 Targeted feature tests for key-sanitizer, idb-adapter, error-codes, otel, registry
- 3.4 Every
it(...)carries{ timeout: 5000 }or 30000
4. Documentation
- 4.1 Sibling
.mdfor every implementation.ts - 4.2
README.mdlinks every co-located.mdunder## Modules - 4.3 Update CLAUDE.md package listing — deferred to after manifest regenerates (gen script + STATUS update lives in 13b refresh; CLAUDE.md hand-edit unnecessary for this addition because the listing is generated from MANIFEST + STATUS via
bun scripts/folder-reorg/generate-manifest.ts)
5. Pre-archive verification
- 5.1
bun run check - 5.2
bunx turbo lint typecheck test --filter=@suaveplan/storage-browser-indexeddb - 5.3
bunx turbo test:coverage --filter=@suaveplan/storage-browser-indexeddb(100/100/100/100) - 5.4
bun scripts/openspec-conformance.ts @suaveplan/storage-browser-indexeddb - 5.5
bunx turbo build --filter=@suaveplan/storage-browser-indexeddb
6. Pre-archive 7-row checklist
- 6.1 Generics threaded; type-level claims under
expectTypeOfwhere applicable - 6.2 Zod schemas wired at every declared boundary (
IndexedDbStorageOptionsSchemaon constructor) - 6.3 Every error code in
error-codes/error-codes.tsis thrown / constructed by at least one production path or test - 6.4 Strict-mode behaviors tested both on and off (n/a — no strict-mode flag on this package)
- 6.5 OTel instruments asserted with a real in-memory MeterProvider
- 6.6 Lifecycle dedup tested (concurrent first-touch operations share a single open promise)
- 6.7 No retroactive ticks
7. Archive
- 7.1 Fold spec delta into
openspec/specs/storage-browser-indexeddb/spec.md - 7.2 Move
openspec/changes/storage-browser-indexeddb/→openspec/archive/<yyyy-mm-dd>-storage-browser-indexeddb/ - 7.3 Refresh
MANIFEST.mdviabun scripts/folder-reorg/generate-manifest.ts