Files
suaveplan/openspec/archive/2026-05-26-foundation-fix-gap-5-cleanup/tasks.md
2026-05-27 23:29:53 +01:00

1.3 KiB

Tasks

  • Widen RequestContext.tenant to TenantContext | null in packages/api-stack/api/api-types/src/plugin-context/plugin-context.types.ts.
  • Widen RequestContext.tenantId to TenantId | null at the same site.
  • Add nullability rationale to the RequestContext TSDoc block — pointer to gap-5 + handler null-check guidance.
  • Strip as never from tenant and tenantId assignments in packages/api-stack/api/api-host/src/request-pipeline/request-pipeline-helpers.ts.
  • Replace capabilities/instruments as never casts with explicit as RequestContext["capabilities"] / as RequestContext["instruments"] plus a multi-line comment explaining the generic-erasure boundary.
  • Audit handler-side consumers (apps/demo, apps/testbed, e2e/foundation-stack, api-plugin-*); confirm none dereference ctx.tenant.X without ?. and no code change needed.
  • bunx turbo lint typecheck test build --filter=@suaveplan/api-types --filter=@suaveplan/api-host green.
  • bunx turbo test:coverage --filter=@suaveplan/api-host --filter=@suaveplan/api-types green.
  • cd e2e/foundation-stack && bunx playwright test — 11/11 green.
  • Fold MODIFIED delta into openspec/specs/api-types/spec.md.
  • Archive change folder under openspec/archive/2026-05-26-foundation-fix-gap-5-cleanup/.