Files
suaveplan/openspec/archive/2026-05-12-storage-browser-indexeddb/tasks.md
2026-05-27 23:29:53 +01:00

65 lines
4.2 KiB
Markdown

# Tasks — Add @suaveplan/storage-browser-indexeddb
## 1. Spec authoring
- [x] 1.1 Read `../suaveplan/enterprise/storage-browser.md` end-to-end (IndexedDB half)
- [x] 1.2 Read `openspec/specs/storage/spec.md` and `openspec/specs/storage-browser-opfs/spec.md`
- [x] 1.3 Read `openspec/AGENTS.md` Sections 13 and 14
- [x] 1.4 Draft `proposal.md` from `openspec/templates/proposal.md`
- [x] 1.5 Fill `## Source mapping` table — every requirement cites a line range or is justified in the "no source line" table
- [x] 1.6 Draft `specs/storage-browser-indexeddb/spec.md` from `openspec/templates/spec-delta.md`
- [x] 1.7 Every requirement in the spec delta carries a `**Verified by:**` line naming concrete `it(...)` titles
## 2. Implementation
- [x] 2.1 `src/constants/index.ts` — `MAX_KEY_LENGTH`, `DEFAULT_DB_NAME`, `DEFAULT_STORE_NAME`, `DEFAULT_VERSION`, `EXPIRES_AT_INDEX`
- [x] 2.2 `src/error-codes/error-codes.ts` — `INDEXEDDB_CODES` (11 codes) + `IndexedDbError`
- [x] 2.3 `src/key-sanitizer/key-sanitizer.ts` — strict key boundary
- [x] 2.4 `src/idb-adapter/idb-adapter.ts` — lazy `defaultIndexedDB()` + `isIndexedDbAvailable()`
- [x] 2.5 `src/types/idb-like.types.ts` — structural IDBFactory surface
- [x] 2.6 `src/types/indexeddb-storage.types.ts` — `IndexedDbStorageOptions` + Zod schema + `IndexedDbEntry`
- [x] 2.7 `src/otel/otel.ts` — meter, instruments, `recordOp` dispatcher
- [x] 2.8 `src/indexeddb-storage/indexeddb-storage.ops.ts` — `openDatabase`, `withStore`, `promisifyRequest`, `paginateKeys`, `collectLiveEntries`
- [x] 2.9 `src/indexeddb-storage/indexeddb-storage.errors.ts` — DOMException mapping + assert helpers
- [x] 2.10 `src/indexeddb-storage/indexeddb-storage.crud.ts` — CRUD primitives
- [x] 2.11 `src/indexeddb-storage/indexeddb-storage.config.ts` — `resolveOptions` + `recordedOp` wrapper
- [x] 2.12 `src/indexeddb-storage/indexeddb-storage.ts` — `IndexedDbStorage` class + `createIndexedDbStorage` factory
- [x] 2.13 `src/registry/registry.ts` — `registerIndexedDbProvider` with factory module augmentation
## 3. Tests
- [x] 3.1 Unit tests at `src/indexeddb-storage/indexeddb-storage.test.ts` covering every CRUD/metadata/TTL/list/abort/error path
- [x] 3.2 Spec-conformance tests at `src/indexeddb-storage/indexeddb-storage.spec-conformance.test.ts` pinning type/observability/strict-mode/lifecycle scenarios
- [x] 3.3 Targeted feature tests for key-sanitizer, idb-adapter, error-codes, otel, registry
- [x] 3.4 Every `it(...)` carries `{ timeout: 5000 }` or 30000
## 4. Documentation
- [x] 4.1 Sibling `.md` for every implementation `.ts`
- [x] 4.2 `README.md` links every co-located `.md` under `## Modules`
- [x] 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 `expectTypeOf` where applicable
- [ ] 6.2 Zod schemas wired at every declared boundary (`IndexedDbStorageOptionsSchema` on constructor)
- [ ] 6.3 Every error code in `error-codes/error-codes.ts` is 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.md` via `bun scripts/folder-reorg/generate-manifest.ts`