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

3.9 KiB

Tasks — @suaveplan/api-graphql-yoga

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 (git worktree list then git status in each)
  • 0.2 If any worktrees exist under .claude/worktrees/, account for each one: still-active agent, work-pending-merge, or stale-and-prune. Stale worktrees MUST be removed (git worktree remove) before opening a new one — code that has been lost twice on main is the failure mode this guards against.
  • 0.3 Confirm the package set in MANIFEST.md matches find packages -maxdepth 3 -name package.json count. Drift here means a prior change archived without regenerating the manifest.

1. Spec authoring

  • 1.1 Read design doc §10 end-to-end (focus §10.5, §10.6)
  • 1.2 Read umbrella Stage 7 acceptance
  • 1.3 Read openspec/AGENTS.md Sections 13 and 14
  • 1.4 Draft proposal.md
  • 1.5 Draft specs/api-graphql-yoga/spec.md
  • 1.6 Every requirement carries a **Verified by:** line

2. Implementation

  • 2.1 Scaffold packages/api/api-graphql-yoga/
  • 2.2 src/options/options.ts — YogaGraphqlOptions Zod schema
  • 2.3 src/engine/yoga-engine.ts — createYogaGraphqlEngine(opts); implements abstract engine contract
  • 2.4 src/federation/federation.ts — merge plugin schema contributions; collision detection
  • 2.5 src/endpoints/http.ts — mount POST /graphql, GET /graphql/sdl via api-router
  • 2.6 src/endpoints/ui-proxy.ts — proxy /graphql/ui to whichever UI plugin is wired
  • 2.7 src/subscriptions/subscriptions.ts — graphql-ws over api-ws; AsyncIterable from event bus
  • 2.8 src/loaders/loaders.ts — per-request DataLoader; bound to RequestContext
  • 2.9 src/guards/depth-and-complexity.ts — depth limit, complexity limit, persisted-query support
  • 2.10 src/instruments/instruments.ts — OTel counters + histograms + gauge
  • 2.11 src/error-codes.ts — 10 GRAPHQL_YOGA_* codes
  • 2.12 ./testing subpath — re-export runGraphqlEngineConformance bound to the Yoga factory
  • 2.13 src/index.ts — explicit named re-exports

3. Tests

  • 3.1 Unit tests, every it(...) { timeout: 5000 }
  • 3.2 Conformance test runs runGraphqlEngineConformance
  • 3.3 Federation integration test pins collision behaviour
  • 3.4 Subscriptions integration test ({ timeout: 30000 }) against api-ws-broker-in-memory
  • 3.5 End-to-end integration test ({ timeout: 60000 })
  • 3.6 All tests import from @suaveplan/testing/runner

4. Documentation

  • 4.1 Sibling .md per implementation file
  • 4.2 README.md with ## Modules; note this is the default GraphQL engine

5. Pre-archive verification

  • 5.1 bun run check — 0/0/0
  • 5.2 bunx turbo lint typecheck test --filter=@suaveplan/api-graphql-yoga — green
  • 5.3 bunx turbo test:coverage --filter=@suaveplan/api-graphql-yoga — 100/100/100/100
  • 5.4 bun scripts/openspec-conformance.ts @suaveplan/api-graphql-yoga — exit 0
  • 5.5 bunx turbo build --filter=@suaveplan/api-graphql-yoga — green

6. Pre-archive 7-row checklist

  • 6.1 Generics on resolver / loader contracts; expectTypeOf assertions
  • 6.2 Zod schemas at every config boundary
  • 6.3 Every GRAPHQL_YOGA_* code thrown by a production path
  • 6.4 Strict-mode tested (masked-errors on vs off; introspection on vs off)
  • 6.5 OTel instruments asserted against in-memory MeterProvider
  • 6.6 Lifecycle dedup: schema rebuild on plugin reload is debounced AND idempotent
  • 6.7 No retroactive tick

7. Archive

  • 7.1 Fold spec delta into openspec/specs/api-graphql-yoga/spec.md
  • 7.2 Move to openspec/archive/<yyyy-mm-dd>-api-graphql-yoga/
  • 7.3 Tick Stage-7 row in umbrella tasks
  • 7.4 Refresh MANIFEST.md