Files
suaveplan/openspec/archive/2026-05-25-api-graphql/tasks.md
2026-05-27 23:29:53 +01:00

3.2 KiB

Tasks — @suaveplan/api-graphql

Every checkbox MUST reflect work actually done in this change.

0. Pre-flight (non-negotiable)

  • 0.1 Confirm clean working tree (git status reports nothing) and no in-flight worktrees with uncommitted work
  • 0.2 Worktree audit complete; isolated agent worktree.
  • 0.3 Confirm the package set in MANIFEST.md matches package count

1. Spec authoring

  • 1.1 Read design doc §10
  • 1.2 Read openspec/specs/api-graphql/spec.md (does not exist yet)
  • 1.3 Read openspec/AGENTS.md Sections 13, 14
  • 1.4 Draft proposal.md
  • 1.5 Source-mapping table
  • 1.6 Draft specs/api-graphql/spec.md
  • 1.7 **Verified by:** line on every requirement

2. Implementation

  • 2.1 Scaffold packages/api-stack/api/api-graphql/ (0.1.0, sideEffects: false, deps locked)
  • 2.2 src/registry/ — abstract GraphqlRegistry + concrete createGraphqlRegistry accumulator with freeze()
  • 2.3 src/resolver/ — Resolver re-export + ResolverMap / ResolverFieldMap
  • 2.4 src/loader/ — LoaderFactory re-export + BatchFn signature
  • 2.5 src/subscription/ — SubscriptionResolver + graphql-ws Zod schema + transport assertion
  • 2.6 src/federation/ — mergeSdl, applyNamespace, parseSdl
  • 2.7 src/directives/ — @auth + @rateLimit descriptors + HOST_DIRECTIVES
  • 2.8 src/engine/ — GraphqlEngine lifecycle interface
  • 2.9 src/capability-id/ — GraphqlCapabilityId literal + runtime constant
  • 2.10 src/error-codes/ — GRAPHQL_CODES (7) + GraphqlError
  • 2.11 src/testing/ — runGraphqlEngineConformance
  • 2.12 src/validators/ — validateResolvers, lookupDirective, lookupLoader
  • 2.13 src/index.ts — explicit named re-exports
  • 2.14 package.json exports per subpath

3. Tests

  • 3.1 Unit tests per feature
  • 3.2 Spec-conformance tests (type-level) for resolver / subscription / engine / capability-id / error-codes
  • 3.3 Federation collision + namespace property tests
  • 3.4 Every it(...) carries { timeout: 5000 }

4. Documentation

  • 4.1 Sibling .md for every implementation .ts (9/9 100%)
  • 4.2 README.md linking every feature module
  • 4.3 No CLAUDE.md update

5. Pre-archive verification

  • 5.1 bun run check — clean
  • 5.2 bunx turbo lint typecheck test --filter=@suaveplan/api-graphql — green (82/82 tests)
  • 5.3 bunx turbo test:coverage --filter=@suaveplan/api-graphql — 100/100/100/100
  • 5.4 bunx turbo build --filter=@suaveplan/api-graphql — green

6. Pre-archive 7-row checklist

  • 6.1 Generics on Resolver<Parent, Args, Result, Caps> + expectTypeOf
  • 6.2 Zod wired on subscription protocol envelope
  • 6.3 Every GRAPHQL_CODES entry thrown by a production path (verified by error-codes.spec-conformance)
  • 6.4 Federation collision strict-mode tested on / off
  • 6.5 OTel — N/A (engines emit)
  • 6.6 Lifecycle dedup — N/A
  • 6.7 No retroactive tick

7. Archive

  • 7.1 Fold spec delta into openspec/specs/api-graphql/spec.md
  • 7.2 Move to openspec/archive/2026-05-25-api-graphql/
  • 7.3 Tick umbrella 1.4 (deferred — umbrella file owner)
  • 7.4 Refresh MANIFEST.md