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

4.7 KiB

Tasks: add-payment-provider-stripe

Every checkbox reflects work actually done in this change. No retroactive ticking.

1. Spec authoring

  • 1.1 Read ../suaveplan/enterprise/payment-providers.md end-to-end
  • 1.2 Read openspec/specs/payment-providers/spec.md (slim-core canonical spec)
  • 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 — every requirement cites a line range in the upstream source or appears in the "no source line" table with justification
  • 1.6 Draft specs/payment-provider-stripe/spec.md from openspec/templates/spec-delta.md
  • 1.7 Every requirement in the spec delta carries a **Verified by:** line naming concrete it(...) titles

2. Implementation

  • 2.1 Scaffold packages/universal/payment-provider-stripe/ (package.json at 0.1.0, vite.config.ts, vitest.config.ts, tsconfig.json, tsconfig.lib.json)
  • 2.2 Implement src/stripe/stripe.types.ts — StripeConfig, StripeIntent, StripeRefund wire-format types
  • 2.3 Implement src/stripe/stripe.ts — StripeProvider class, every PaymentProvider method routed through httpRequest with Bearer auth + Idempotency-Key forwarding, mappers from Stripe domain to PaymentIntent / Refund, every error raised through the slim-core PaymentProviderError
  • 2.4 src/stripe/index.ts — explicit named barrel
  • 2.5 src/index.ts — package root barrel re-exporting StripeProvider + StripeConfig
  • 2.6 package.json#exports — root + ./stripe/stripe subpath

3. Tests

  • 3.1 src/stripe/stripe.test.ts — covers every public method, Bearer-auth header presence, Idempotency-Key forwarding when caller supplies it AND absence when caller omits, every status / refund-status / refund-reason branch, payment-method absence, provider: "stripe" discriminant propagation on raised errors, injected FetchLike + caller signal forwarding
  • 3.2 tests/dep-graph.test.ts — pins universal-tier purity (no node: / bun: / fs / path / stream / net / http / crypto imports under src/)
  • 3.3 Every it(...) carries { timeout: 5000 }
  • 3.4 Zero vi.mock / vi.stubGlobal / jest.mock — all tests use real recording FetchLike closures

4. Documentation

  • 4.1 src/stripe/stripe.md — sibling doc with Purpose, Features, Basic Usage, Advanced Usage, API Reference, Implementation Notes (≥200 words excl. code)
  • 4.2 README.md at package root linking the module doc under ## Modules
  • 4.3 Update CLAUDE.md package listing under the Network or Foundation section — add payment-provider-stripe to the payment-providers family description

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

  • 5.1 bun run check — Biome 0/0/0 across the monorepo
  • 5.2 bunx turbo lint typecheck test --filter=@suaveplan/payment-provider-stripe — green
  • 5.3 bunx turbo test:coverage --filter=@suaveplan/payment-provider-stripe — 100/100/100/100
  • 5.4 bun scripts/openspec-conformance.ts @suaveplan/payment-provider-stripe — exit 0 (PASS 0 error, 0 warn, 0 info)
  • 5.5 bunx turbo build --filter=@suaveplan/payment-provider-stripe — green

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

  • 6.1 Generics threaded; literal name: "stripe" pinned at the type level
  • 6.2 Wire-format Stripe responses parsed through typed StripeIntent / StripeRefund interfaces
  • 6.3 Every slim-core error code raised by httpRequest flows through this provider with provider: "stripe" discriminant
  • 6.4 N/A — no strict-mode toggle on the provider
  • 6.5 N/A — no OTel instruments in this change
  • 6.6 N/A — provider holds no in-flight dedup state
  • 6.7 No retroactive tick
  • 6.8 No export * in any feature barrel — scan returns zero output
  • 6.9 No direct vitest / bun:test imports — scan returns zero output

7. Root-doc refresh (§13b)

  • 7.1 bun scripts/folder-reorg/generate-manifest.ts — MANIFEST.md refreshed (258 packages, 34 plugins; new row for payment-provider-stripe)
  • 7.2 bun scripts/generate-missing.ts — DEFERRED: pre-existing failure on missing FOLDERS.yml (unrelated to this change)
  • 7.3 Added @suaveplan/payment-provider-stripe row to STATUS.md
  • 7.4 Added per-package paragraph to SUMMARY.md
  • 7.5 bunx markdownlint-cli2 --fix — exit 0; no findings in touched files

8. Archive

  • 8.1 Fold specs/payment-provider-stripe/spec.md into openspec/specs/payment-provider-stripe/spec.md
  • 8.2 Move openspec/changes/add-payment-provider-stripe/ → openspec/archive/2026-05-17-add-payment-provider-stripe/