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

3.2 KiB

Tasks — @suaveplan/api-graphql-ui-altair

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.6
  • 1.2 Read umbrella Stage 7 acceptance
  • 1.3 Read sibling openspec/changes/api-graphql-ui-graphiql/ for structural parity
  • 1.4 Read openspec/AGENTS.md Sections 13 and 14
  • 1.5 Draft proposal.md
  • 1.6 Draft specs/api-graphql-ui-altair/spec.md
  • 1.7 Every requirement carries a **Verified by:** line

2. Implementation

  • 2.1 Scaffold packages/api/api-graphql-ui-altair/
  • 2.2 src/options/options.ts — AltairUiOptions Zod schema
  • 2.3 src/factory/create-altair-ui.ts — createAltairUi(opts) returning RouterPlugin
  • 2.4 src/html/render-shell.ts — Altair HTML shell with embedded config
  • 2.5 src/assets/assets.ts — static-asset map from altair-static
  • 2.6 src/headers/csp.ts — Content-Security-Policy header
  • 2.7 src/instruments/instruments.ts — graphql.ui.requests_total{ ui: "altair" } counter
  • 2.8 src/error-codes.ts — 2 GRAPHQL_UI_ALTAIR_* codes
  • 2.9 src/index.ts — explicit named re-exports

3. Tests

  • 3.1 Unit tests, every it(...) { timeout: 5000 }
  • 3.2 Conformance test pins mount + embedded-config
  • 3.3 Asset reachability tests
  • 3.4 Playwright end-to-end ({ timeout: 30000 })
  • 3.5 All tests import from @suaveplan/testing/runner

4. Documentation

  • 4.1 Sibling .md per implementation file
  • 4.2 README.md calling out: opt-in, bundled assets only, alternative to GraphiQL

5. Pre-archive verification

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

6. Pre-archive 7-row checklist

  • 6.1 Generics where applicable; expectTypeOf on literal-type claims
  • 6.2 Zod schema on options
  • 6.3 Both error codes thrown
  • 6.4 Strict-mode tested
  • 6.5 OTel counter asserted with in-memory MeterProvider
  • 6.6 Lifecycle dedup N/A
  • 6.7 No retroactive tick

7. Archive

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