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

21 lines
1.3 KiB
Markdown

# Tasks
- [x] Widen `RequestContext.tenant` to `TenantContext | null` in
`packages/api-stack/api/api-types/src/plugin-context/plugin-context.types.ts`.
- [x] Widen `RequestContext.tenantId` to `TenantId | null` at the same site.
- [x] Add nullability rationale to the `RequestContext` TSDoc block —
pointer to gap-5 + handler null-check guidance.
- [x] Strip `as never` from `tenant` and `tenantId` assignments in
`packages/api-stack/api/api-host/src/request-pipeline/request-pipeline-helpers.ts`.
- [x] Replace `capabilities`/`instruments` `as never` casts with
explicit `as RequestContext["capabilities"]` / `as RequestContext["instruments"]`
plus a multi-line comment explaining the generic-erasure boundary.
- [x] 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.
- [x] `bunx turbo lint typecheck test build --filter=@suaveplan/api-types --filter=@suaveplan/api-host` green.
- [x] `bunx turbo test:coverage --filter=@suaveplan/api-host --filter=@suaveplan/api-types` green.
- [x] `cd e2e/foundation-stack && bunx playwright test` — 11/11 green.
- [x] Fold MODIFIED delta into `openspec/specs/api-types/spec.md`.
- [x] Archive change folder under `openspec/archive/2026-05-26-foundation-fix-gap-5-cleanup/`.