Files
2026-05-27 23:29:53 +01:00

68 lines
3.3 KiB
Markdown

# Tasks — `@suaveplan/api-tenant-provider`
## 0. Pre-flight
- [x] 0.1 Clean working tree confirmed; worktree on `worktree-agent-a65edefe746eabbf6`
- [x] 0.2 Forked from EXPECTED_BASE e5333ff3 (per §0a Sync)
- [x] 0.3 Manifest check deferred to post-archive `generate-manifest.ts`
## 1. Spec authoring
- [x] 1.1 Read design doc §5.4 (per-tenant jobs)
- [x] 1.2 No prior `openspec/specs/api-tenant-provider/spec.md` (net-new)
- [x] 1.3 Read `openspec/AGENTS.md` §13, §14
- [x] 1.4 `proposal.md` finalised
- [x] 1.5 Source-mapping table in proposal
- [x] 1.6 `specs/api-tenant-provider/spec.md` authored
- [x] 1.7 `**Verified by:**` lines on every requirement
## 2. Implementation
- [x] 2.1 `packages/api-stack/api/api-tenant-provider/` scaffolded — `0.1.0`, `sideEffects: false`, deps: `@suaveplan/api-types`, `@suaveplan/error`, `@suaveplan/types`, `tslib`, `zod`
- [x] 2.2 `src/provider/` — `TenantProvider` interface (`list / count / lookup / dispose`)
- [x] 2.3 `src/tenant-record/` — `TenantRecord` + strict-mode `tenantRecordSchema` (`import z from "zod"`)
- [x] 2.4 `src/pagination/` — `ListOpts`, `encodeCursor`/`decodeCursor`
- [x] 2.5 `src/capability-id/` — `TENANT_PROVIDER_CAPABILITY_ID` + widened `CapabilityId`
- [x] 2.6 `src/error-codes/` — `TENANT_PROVIDER_CODES` (`TENANT_NOT_FOUND`, `SOURCE_UNAVAILABLE`, `INVALID_CURSOR`) + `TenantProviderError`
- [x] 2.7 `src/testing/` — `runTenantProviderConformance(opts)`
- [x] 2.8 `src/index.ts` — explicit named re-exports
- [x] 2.9 `package.json` `exports` per subpath
## 3. Tests
- [x] 3.1 Unit tests per feature (47 tests, 8 files, all pass)
- [x] 3.2 Spec-conformance type tests via `provider.test.ts` + `capability-id.test.ts`
- [x] 3.3 fast-check property test on cursor round-trip
- [x] 3.4 Every `it(...)` carries `{ timeout: 5000 }`
## 4. Documentation
- [x] 4.1 Sibling `.md` for every implementation `.ts` (6/6 — docs:check 100%)
- [x] 4.2 `README.md` linking every `.md`
- [x] 4.3 No CLAUDE.md update
## 5. Pre-archive verification
- [x] 5.1 Lint, typecheck, test all green
- [x] 5.2 `bunx turbo lint typecheck test --filter=@suaveplan/api-tenant-provider` — green
- [x] 5.3 `bunx turbo test:coverage --filter=@suaveplan/api-tenant-provider` — 100/100/100/100
- [x] 5.4 OpenSpec conformance — Verified-by lines present on every requirement
- [x] 5.5 `bunx turbo build --filter=@suaveplan/api-tenant-provider` — green
## 6. Pre-archive 7-row checklist
- [x] 6.1 `TenantProvider` is type-monomorphic; structural `implements` check via `StubProvider`
- [x] 6.2 Zod wired at `TenantRecord` (`tenantRecordSchema`) and `ListOpts` (`listOptsSchema`) boundaries; cursor decode validates via `cursorStateSchema`
- [x] 6.3 Every `TENANT_PROVIDER_CODES` entry constructible and tested
- [x] 6.4 `includeSuspended` tested both directions in conformance harness
- [x] 6.5 OTel — N/A (concrete sources emit; contract package has zero runtime telemetry)
- [x] 6.6 `dispose` idempotent — tested in conformance harness
- [x] 6.7 No retroactive tick — every task checked is genuinely complete
## 7. Archive
- [x] 7.1 Spec delta folded into `openspec/specs/api-tenant-provider/spec.md`
- [x] 7.2 Folder moved to `openspec/archive/2026-05-25-api-tenant-provider/`
- [ ] 7.3 Umbrella tick — deferred to umbrella owner
- [ ] 7.4 `MANIFEST.md` refresh — to be done after merge (script writes from main checkout)