Files
suaveplan/openspec/archive/2026-05-17-add-currency-providers/tasks.md
2026-05-27 23:29:53 +01:00

3.9 KiB

Tasks — add @suaveplan/currency-providers

Every checkbox MUST reflect work actually done in this change.

1. Spec authoring

  • 1.1 Read ../suaveplan/enterprise/currency-providers.md end-to-end
  • 1.2 openspec/specs/currency-providers/spec.md does not exist — confirmed
  • 1.3 Read openspec/AGENTS.md Sections 13 and 14
  • 1.4 Draft proposal.md from openspec/templates/proposal.md
  • 1.5 Fill in ## Source mapping table — every requirement cites line range or is in "no source line" table
  • 1.6 Draft specs/currency-providers/spec.md from openspec/templates/spec-delta.md
  • 1.7 Every requirement carries a **Verified by:** line naming concrete it(...) titles

2. Implementation

  • 2.1 Scaffold packages/finance/currency-providers/ (package.json, tsconfig.json, tsconfig.lib.json, vite.config.ts, vitest.config.ts, tests/setup/polyfills.ts, README.md)
  • 2.2 src/types/configs.ts — ApiKeyConfig, NoKeyConfig, HttpFetchOptions (named interfaces, no inline shapes)
  • 2.3 src/error-codes/error-codes.ts — CURRENCY_PROVIDER_CODES registry + CurrencyProviderError discriminated class
  • 2.4 src/providers/ecb/ecb.ts — ECB XML provider with injectable FetchLike
  • 2.5 src/providers/fixer/fixer.ts — Fixer.io provider with API key
  • 2.6 src/providers/open-exchange-rates/open-exchange-rates.ts
  • 2.7 src/providers/binance/binance.ts
  • 2.8 src/providers/coingecko/coingecko.ts + getCoinGeckoId
  • 2.9 src/providers/coinmarketcap/coinmarketcap.ts
  • 2.10 src/providers/cryptocompare/cryptocompare.ts
  • 2.11 src/providers/kraken/kraken.ts
  • 2.12 src/providers/virtual/virtual.ts — virtual-currency provider with runtime mutators
  • 2.13 src/index.ts — explicit named re-exports (no export *)
  • 2.14 Subpath exports declared in package.json for every public module

3. Tests

  • 3.1 Per-provider <name>.test.ts covering every scenario, with real FetchLike injection (no vi.mock / vi.stubGlobal)
  • 3.2 src/error-codes/error-codes.test.ts — every CURRENCY_PROVIDER.* code reachable; SuaveplanError contract preserved
  • 3.3 Every it(...) carries { timeout: 5000 }
  • 3.4 All test files import runner primitives from @suaveplan/testing/runner

4. Documentation

  • 4.1 Sibling .md for every implementation .ts (≥200 words, basic + advanced examples, full API reference)
  • 4.2 README.md links every co-located .md under ## Modules

5. Pre-archive verification (the 5-gate triple)

  • 5.1 bun run check — Biome 0 errors / 0 warnings / 0 info
  • 5.2 bunx turbo lint typecheck test --filter=@suaveplan/currency-providers — green
  • 5.3 bunx turbo test:coverage --filter=@suaveplan/currency-providers — 100/100/100/100
  • 5.4 bun scripts/openspec-conformance.ts @suaveplan/currency-providers — exit 0
  • 5.5 bunx turbo build --filter=@suaveplan/currency-providers — green

6. Pre-archive checklist (AGENTS.md Section 13)

  • 6.1 Generics threaded — every public type uses named interfaces
  • 6.2 Zod schemas N/A — package uses no Zod at boundary (configs are plain interfaces)
  • 6.3 Every error code in error-codes.ts thrown by at least one production path
  • 6.4 No strict-mode behaviors to test on/off — providers have no strict-mode setting
  • 6.5 OTel N/A — deferred per ## Out of scope
  • 6.6 No lifecycle dedup claimed (deferred coalescing — see ## Out of scope)
  • 6.7 No retroactive tick
  • 6.8 No export * in any feature-module barrel
  • 6.9 No direct vitest / bun:test imports

7. Archive

  • 7.1 Fold spec delta into openspec/specs/currency-providers/spec.md
  • 7.2 Move openspec/changes/add-currency-providers/ → openspec/archive/2026-05-17-add-currency-providers/
  • 7.3 Refresh MANIFEST.md, MISSING.yml, STATUS.md, SUMMARY.md