4.4 KiB
4.4 KiB
Tasks — add @suaveplan/currency
Every checkbox MUST reflect work actually done in this change.
1. Spec authoring
- 1.1 Read
../suaveplan/enterprise/currency.mdend-to-end - 1.2
openspec/specs/currency/spec.mddoes not exist — confirmed - 1.3 Read
openspec/AGENTS.mdSections 13 and 14 - 1.4 Draft
proposal.mdfromopenspec/templates/proposal.md - 1.5 Fill in
## Source mappingtable — every requirement cites a line range - 1.6 Draft
specs/currency/spec.mdfromopenspec/templates/spec-delta.md - 1.7 Every requirement carries a
**Verified by:**line naming concreteit(...)titles
2. Implementation
- 2.1 Scaffold
packages/finance/currency/(package.json,tsconfig.json,tsconfig.lib.json,vite.config.ts,vitest.config.ts,tests/setup/polyfills.ts,README.md) - 2.2
src/types/common.ts—CurrencyProvider,ExchangeRate,RateFetchOptions,RateFetchResult,VirtualCurrencyConfig,ConverterConfig,ConvertOptions,ConversionResult(all named interfaces; no inline shapes) - 2.3
src/error-codes/error-codes.ts—CURRENCY_CODESregistry +CurrencyError extends SuaveplanError<CurrencyErrorCode>with optionalfrom/to/providerNamediscriminants - 2.4
src/schemas/schemas.ts— Zod schemas +parseConverterConfig/parseConvertOptions/parseVirtualCurrencyConfig/parseRateFetchOptionshelpers that throwCurrencyError - 2.5
src/rate-cache/rate-cache.ts—RateCacheclass with TTL eviction, direct / inverse / triangulated lookup - 2.6
src/provider/provider.ts—InMemoryProviderclass +createStaticProviderfactory honouring AbortSignal - 2.7
src/converter/converter.ts—CurrencyConverterclass with fallback chain, triangulation, virtual currency, AbortSignal, Zod-validated boundary, enrichedConversionResult - 2.8
src/index.ts— explicit named re-exports - 2.9 Sub-path exports declared in
package.jsonfor every public module
3. Tests
- 3.1
src/converter/converter.test.ts— every requirement scenario - 3.2
src/rate-cache/rate-cache.test.ts— every requirement scenario - 3.3
src/provider/provider.test.ts— every requirement scenario - 3.4
src/error-codes/error-codes.test.ts— everyCURRENCY.*code reachable from a call site; SuaveplanError contract preserved - 3.5
src/schemas/schemas.test.ts— every Zod schema accepts a valid payload and rejects each documented bad shape - 3.6 Every
it(...)carries{ timeout: 5000 } - 3.7 All test files import runner primitives from
@suaveplan/testing/runner
4. Documentation
- 4.1 Sibling
.mdfor every implementation.ts(≥200 words, basic + advanced examples, full API reference) - 4.2
README.mdlinks every co-located.mdunder## Modules - 4.3 Update
MANIFEST.md/STATUS.md/SUMMARY.md/MISSING.ymlon archive
5. Pre-archive verification (the 5-gate triple)
- 5.1
bun run check— Biome 0 errors / 0 warnings / 0 info on touched files - 5.2
bunx turbo lint typecheck test --filter=@suaveplan/currency— green - 5.3
bunx turbo test:coverage --filter=@suaveplan/currency— 100/100/100/100 - 5.4
bun scripts/openspec-conformance.ts @suaveplan/currency— exit 0 (if script applies) - 5.5
bunx turbo build --filter=@suaveplan/currency— green
6. Pre-archive 9-row checklist (skill SKILL.md step 7)
- 6.1 Generics threaded; literal-type assertions on every literal-type claim
- 6.2 Zod schemas wired at every declared boundary (
CurrencyConverterconstructor +convert/convertAmount/getRateentry) - 6.3 Every
CURRENCY.*code thrown by at least one production path - 6.4 Strict-mode behaviours (AbortSignal cancellation; identity short-circuit) tested
- 6.5 No OTel instruments shipped this change (deferred — see proposal
## Out of scope) - 6.6 Lifecycle dedup tested (virtual-currency reseed after every provider fetch)
- 6.7 No retroactive tick — every box above reflects work done in this change
- 6.8 No
export *in any feature-module barrel - 6.9 No direct
vitest/bun:testimports in test files
7. Archive
- 7.1 Fold spec delta into
openspec/specs/currency/spec.md - 7.2 Move
openspec/changes/add-currency/→openspec/archive/2026-05-17-add-currency/ - 7.3 Refresh
MANIFEST.md,MISSING.yml,STATUS.md,SUMMARY.md