Files
suaveplan/openspec/archive/2026-05-16-add-storage-cdn/tasks.md
2026-05-27 23:29:53 +01:00

3.3 KiB

Tasks — storage-cdn

Every checkbox MUST reflect work actually done in this change.

1. Spec authoring

  • 1.1 Read openspec/specs/storage/spec.md and confirm capability boundary
  • 1.2 Read openspec/AGENTS.md §0c, §13, §14
  • 1.3 Read sibling change openspec/changes/add-storage-http/ for the family conventions
  • 1.4 Draft proposal.md, design.md, specs/storage-cdn/spec.md, tasks.md
  • 1.5 Numbered Requirement/Scenario checklist per §0c step 6

2. Scaffolding

  • 2.1 Create packages/storage/storage-cdn/ mirroring packages/storage/storage-http/ conventions (types-only — no benchmarks)
  • 2.2 package.json v0.0.0, "sideEffects": false, subpath exports
  • 2.3 Deps: @suaveplan/error, @suaveplan/storage, @suaveplan/types, zod, tslib (workspace/catalog)
  • 2.4 DevDeps: @suaveplan/testing, @vitest/coverage-istanbul, typescript, vite, vite-plugin-dts, vitest
  • 2.5 tsconfig, vite.config.ts, vitest.config.ts via createTestConfig

3. Implementation

  • 3.1 src/error-codes.ts — defineCodes("STORAGE_CDN", [...]) with 8 codes, StorageCdnError class
  • 3.2 src/types/cdn-capabilities.types.ts — CdnCapabilities interface + DEFAULT_CDN_CAPABILITIES
  • 3.3 src/types/sign-url.types.ts + .schemas.ts — SignUrlOptions + Zod schema
  • 3.4 src/types/cdn-adapter.types.ts — CdnAdapterOptions base interface
  • 3.5 src/cdn-adapter/cdn-adapter.ts — CdnAdapter abstract class extending AbstractStorage, three abstract methods, defaultPurgeNotSupported()/defaultSignUrlNotSupported() helpers
  • 3.6 src/sign-url/sign-url.ts — schema parse + error mapping
  • 3.7 src/guards/guards.ts — isCdnAdapter, assertCdnAdapter
  • 3.8 src/storage-augment.ts — declare module "@suaveplan/storage" slot for cdn?: CdnCapabilities
  • 3.9 src/index.ts — explicit named re-exports

4. Tests

  • 4.1 src/cdn-adapter/cdn-adapter.test.ts — defaults, helpers throw documented codes
  • 4.2 src/cdn-adapter/cdn-adapter.spec-conformance.test.ts — type conformance, augmentation slot optional, tier-purity grep
  • 4.3 src/sign-url/sign-url.test.ts — schema rejects invalid ttl/method
  • 4.4 src/guards/guards.test.ts — narrowing + assert throws
  • 4.5 src/error-codes/error-codes.test.ts — every code reachable (provider codes forward-referenced)
  • 4.6 Every it(...) carries { timeout: 5000 }
  • 4.7 All test imports via @suaveplan/testing/runner (§7)

5. Documentation

  • 5.1 Sibling .md for every implementation .ts
  • 5.2 README.md documents the family and links the two provider proposals

6. Gates

  • 6.1 bun run check
  • 6.2 bunx turbo lint typecheck test --filter=@suaveplan/storage-cdn
  • 6.3 bunx turbo test:coverage --filter=@suaveplan/storage-cdn (100/100/100/100)
  • 6.4 bun scripts/lint/check-test-runner-imports.ts
  • 6.5 Tier-purity grep returns empty
  • 6.6 bun scripts/openspec-conformance.ts @suaveplan/storage-cdn

7. Manifest & archival

  • 7.1 bun scripts/folder-reorg/generate-manifest.ts
  • 7.2 Update STATUS.md
  • 7.3 Fold specs/storage-cdn/spec.md → openspec/specs/storage-cdn/spec.md
  • 7.4 Move change folder → openspec/archive/<yyyy-mm-dd>-add-storage-cdn/