Initial Commit
This commit is contained in:
66
openspec/archive/2026-05-17-add-money/tasks.md
Normal file
66
openspec/archive/2026-05-17-add-money/tasks.md
Normal file
@@ -0,0 +1,66 @@
|
||||
# Tasks — Add @suaveplan/money
|
||||
|
||||
## 1. Spec authoring
|
||||
|
||||
- [x] 1.1 Read `../suaveplan/enterprise/money.md` end-to-end
|
||||
- [x] 1.2 Read `openspec/specs/money/spec.md` (does not exist — this is a new package)
|
||||
- [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 in `## Source mapping` table — every requirement cites a line range OR appears in the "no source line" table with justification
|
||||
- [x] 1.6 Draft `specs/money/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 Scaffold `packages/finance/money/` (package.json, tsconfig.json, tsconfig.lib.json, vite.config.ts, vitest.config.ts, tests/setup/polyfills.ts)
|
||||
- [x] 2.2 Implement `src/error-codes/error-codes.ts` (`MONEY_CODES` registry + `MoneyError` class)
|
||||
- [x] 2.3 Implement `src/types/common.ts` (re-export of all public types)
|
||||
- [x] 2.4 Implement `src/currencies/currencies.ts` (registry + 30 fiat + 5 crypto built-ins + helpers)
|
||||
- [x] 2.5 Implement `src/money/money.ts` (`Money` class + `applyRounding` + hardened `parseDecimalString`)
|
||||
- [x] 2.6 Implement `src/formatter/formatter.ts` (`formatMoney` + `formatMoneyCompact`)
|
||||
- [x] 2.7 Implement `src/allocator/allocator.ts` (allocators + aggregators)
|
||||
- [x] 2.8 Write root `src/index.ts` barrel with explicit named re-exports
|
||||
- [x] 2.9 Write per-feature `index.ts` barrels with explicit named re-exports
|
||||
|
||||
## 3. Tests
|
||||
|
||||
- [x] 3.1 `src/error-codes/error-codes.test.ts` — every `MONEY.*` code reachable from a real call site
|
||||
- [x] 3.2 `src/money/money.test.ts` — constructors, arithmetic, comparison, conversion, JSON round-trip, rounding modes, parse error
|
||||
- [x] 3.3 `src/currencies/currencies.test.ts` — lookup, registration, virtual-currency helpers, unknown-currency raise
|
||||
- [x] 3.4 `src/formatter/formatter.test.ts` — locale matrix, options matrix, compact formatter
|
||||
- [x] 3.5 `src/allocator/allocator.test.ts` — total-preservation invariant, all raise cases, aggregator cross-currency raise
|
||||
- [x] 3.6 Every `it(...)` carries `{ timeout: 5000 }`
|
||||
- [x] 3.7 Every test imports runner primitives from `@suaveplan/testing/runner`
|
||||
|
||||
## 4. Documentation
|
||||
|
||||
- [x] 4.1 Sibling `.md` for every implementation `.ts` (≥200 words, basic + advanced examples, full API reference)
|
||||
- [x] 4.2 README at package root linking every co-located `.md` under `## Modules`
|
||||
- [x] 4.3 Update root `STATUS.md` and `SUMMARY.md` rows for `@suaveplan/money` (Pending → Completed)
|
||||
|
||||
## 5. Pre-archive verification (the 5-gate triple)
|
||||
|
||||
- [x] 5.1 `bun run check` — Biome clean across touched files
|
||||
- [x] 5.2 `bunx turbo lint typecheck test --filter=@suaveplan/money` — green
|
||||
- [x] 5.3 `bunx turbo test:coverage --filter=@suaveplan/money` — 100/100/100/100
|
||||
- [x] 5.4 Spec-conformance: every requirement in spec.md has a real test that pins it
|
||||
- [x] 5.5 `bunx turbo build --filter=@suaveplan/money` — green
|
||||
|
||||
## 6. Pre-archive 9-row checklist (SKILL.md Step 7)
|
||||
|
||||
- [x] 6.1 Generics threaded; `expectTypeOf` assertions where literal types matter (N/A — package surface is value-level, not type-level beyond standard generics)
|
||||
- [x] 6.2 Zod schemas wired at every declared boundary (N/A — package has no network boundary; explicitly deferred to `@suaveplan/api-schemas`)
|
||||
- [x] 6.3 Every error code in `MONEY_CODES` thrown by at least one production path
|
||||
- [x] 6.4 Strict-mode behaviors tested both on and off (N/A — package has no strict-mode toggle)
|
||||
- [x] 6.5 OTel instruments emitted from production paths (N/A — universal-tier package; no observability surface in this migration)
|
||||
- [x] 6.6 Lifecycle dedup tested where claimed (N/A — package is stateless aside from the module-level currency map, which has its own tests)
|
||||
- [x] 6.7 No retroactive tick — every box above reflects work done in this change
|
||||
- [x] 6.8 No `export *` in any feature-module barrel (verified by §13 step 4a)
|
||||
- [x] 6.9 No direct `vitest` / `bun:test` imports in test files (verified by §13 step 4b)
|
||||
|
||||
## 7. Archive
|
||||
|
||||
- [x] 7.1 Fold spec delta into `openspec/specs/money/spec.md`
|
||||
- [x] 7.2 Move `openspec/changes/add-money/` → `openspec/archive/2026-05-17-add-money/`
|
||||
- [x] 7.3 Refresh `MANIFEST.md` via `bun scripts/folder-reorg/generate-manifest.ts`
|
||||
- [x] 7.4 Refresh `MISSING.yml` via `bun scripts/generate-missing.ts` (if applicable)
|
||||
Reference in New Issue
Block a user