Files
2026-05-27 23:29:53 +01:00

4.2 KiB

Tasks — Add @suaveplan/currency-provider-binance

Spec-completeness preflight (AGENTS.md §12a)

  • Numbered checklist of every ### Requirement and #### Scenario drafted in specs/currency-provider-binance/spec.md (5 requirements, 18 scenarios — see ./specs/currency-provider-binance/spec.md).

Scaffold the package

  • Create packages/finance/currency-provider-binance/ directory
  • Author package.json — name, exports map (root + single subpath ./binance/binance), deps on @suaveplan/currency, @suaveplan/currency-providers, @suaveplan/error, @suaveplan/types, tslib; dev-deps on @suaveplan/testing, vitest, vite, vite-plugin-dts, @vitest/coverage-istanbul
  • Author tsconfig.json + tsconfig.lib.json mirroring the slim core
  • Author vite.config.ts with the same external list as the slim core plus @suaveplan/currency-providers
  • Author vitest.config.ts with 100/100/100/100 istanbul thresholds
  • Author tests/setup/polyfills.ts (no polyfills needed — universal-tier)

Implement the provider

  • src/binance/binance.ts — BinanceProvider class, BINANCE_PROVIDER_NAME, BINANCE_DEFAULT_BASE_URL, ensureTickerArray shape guard, decodeRates suffix decoder, filterTargets raising UNKNOWN_CURRENCY, httpRequest delegation with caller signal + timeout forwarding, PARSE_ERROR wrapping of response.json()
  • src/binance/binance.md — sibling doc, six required sections, ≥200 words
  • src/binance/binance.test.ts — happy path (default + custom base), targets filter, custom baseUrl, sanitisation (zero, negative, non-finite, suffix-equals-symbol), every error code reachable, signal forwarding, timeout forwarding, default-fetch fallback
  • src/binance/index.ts — explicit named barrel
  • src/index.ts — explicit named barrel re-exporting the three public symbols

Documentation

  • README.md — H1, one-paragraph description, install snippet, quick start, features list, Modules list linking the sibling .md, Status note
  • Confirm every .ts in src/ has a sibling .md (the §13 step-5 grep returns zero)

Pre-archive gates (AGENTS.md §13)

  • Step 0 — spec reconciliation: every ### Requirement and **Verified by:** resolves to a real file + verbatim test name
  • Step 1 — bunx turbo lint typecheck test --filter=@suaveplan/currency-provider-binance green and bun run check green
  • Step 2 — bunx turbo test:coverage --filter=@suaveplan/currency-provider-binance reports 100/100/100/100 via istanbul
  • Step 3 — bunx turbo build --filter=@suaveplan/currency-provider-binance green
  • Step 4 — banned-pattern grep returns zero
  • Step 4a — barrel-shape grep returns zero
  • Step 4b — test-runner-import grep returns zero
  • Step 5 — missing-.md grep returns zero
  • Step 6 — README present
  • Step 7 — bare-version grep returns zero
  • Step 8 — subpath-export count = 1 (matches feature module count)
  • Step 9 — security-scan grep returns zero
  • Step 10 — dependent sweep (bunx turbo test --filter=...@suaveplan/currency-provider-binance)

Root-doc refresh (AGENTS.md §13b)

  • Update scripts/folder-reorg/assignment.yml — add currency-provider-binance under the commerce: block
  • Re-run bun scripts/folder-reorg/generate-manifest.ts to refresh MANIFEST.md
  • Re-run bun scripts/generate-missing.ts to refresh MISSING.yml
  • Update STATUS.md commerce table to add the @suaveplan/currency-provider-binance row with the shipped surface summary
  • Update SUMMARY.md with a per-package paragraph
  • bunx markdownlint-cli2 --fix across touched root + change files

Archive (AGENTS.md §14)

  • Fold specs/currency-provider-binance/spec.md into openspec/specs/currency-provider-binance/spec.md
  • Move openspec/changes/add-currency-provider-binance/ → openspec/archive/2026-05-17-add-currency-provider-binance/ (authored directly in archive per the task instructions)