3.5 KiB
3.5 KiB
Tasks — migrate-api-plugin-contacts
1. Spec authoring
- 1.1 Read
../suaveplan/enterprise/api-plugin-contacts.mdend-to-end - 1.2 Read
openspec/specs/api-plugin-contacts/spec.md(does not exist yet — new package) - 1.3 Read
openspec/AGENTS.mdSections 13 and 14 - 1.4 Draft
proposal.mdfromopenspec/templates/proposal.md - 1.5 Fill in
## Source mappingtable - 1.6 Draft
specs/api-plugin-contacts/spec.mdfromopenspec/templates/spec-delta.md - 1.7 Every requirement carries a
**Verified by:**line naming concreteit(...)titles
2. Implementation
- 2.1 Scaffold package (
package.json,tsconfig*,vite.config.ts,vitest.config.ts, README) - 2.2 Port SurrealQL schema to
surql/tables/{contact,contact_group,group_membership}.surql - 2.3 Define
CONTACTS_API_CODES+ContactsApiError(12 codes) - 2.4 Define OTel instruments (4 counters + 2 histograms)
- 2.5 Implement typed Hono
ContextVariableMap+ServiceRegistryaugmentations - 2.6 Implement
SurrealContactRepositoryagainstContactStore - 2.7 Implement
SurrealGroupRepositoryagainstGroupStorewithmaxGroupDepthenforcement - 2.8 Implement
SurrealMembershipRepositoryagainstMembershipStore - 2.9 Implement typed
buildTreehelper - 2.10 Implement contact route builders (list, create, get, update, delete, bulk-import, merge)
- 2.11 Implement group route builders (list, create, get, update, delete, tree, move)
- 2.12 Implement group-member route builders (list, add, remove, resolve)
- 2.13 Implement
createContactsPluginfactory wiring config validation, ServiceRegistry slots, middleware, schema migration - 2.14 Root barrel re-exports all public symbols including
ContactsPluginConfigSchema
3. Tests
- 3.1 Unit tests at
src/**/*.test.tscovering every public symbol - 3.2 Spec-conformance tests at
src/api-plugin-contacts.spec-conformance.test.ts - 3.3 Real-SurrealDB integration tests under
tests/integration/ - 3.4 Every
it(...)carries{ timeout: 5000 }(or up to 180_000 for testcontainer beforeAll)
4. Documentation
- 4.1 Sibling
.mdfor every implementation.ts - 4.2 README links every co-located
.mdunder## Modules - 4.3 Update
CLAUDE.mdpackage listing — add### Contactssection
5. Pre-archive verification (the 5-gate triple)
- 5.1
bun run check— Biome 0/0/0 - 5.2
bunx turbo lint typecheck test --filter=@suaveplan/api-plugin-contacts— green - 5.3
bunx turbo test:coverage --filter=@suaveplan/api-plugin-contacts— 100/100/100/100 - 5.4
bun scripts/openspec-conformance.ts @suaveplan/api-plugin-contacts— exit 0 - 5.5
bunx turbo build --filter=@suaveplan/api-plugin-contacts— green
6. Pre-archive 7-row checklist
- 6.1 Generics threaded;
expectTypeOfassertions on public types - 6.2 Zod schemas wired at every declared boundary
- 6.3 Every error code thrown by ≥1 production path
- 6.4 Strict-mode behaviors tested both on and off (depth enforcement on/off)
- 6.5 OTel instruments emitted from production paths and asserted with real
MeterProvider - 6.6 Lifecycle dedup tested where claimed (idempotent membership add)
- 6.7 No retroactive tick
7. Archive
- 7.1 Fold spec delta into
openspec/specs/api-plugin-contacts/spec.md - 7.2 Move change folder to
openspec/archive/2026-05-20-migrate-api-plugin-contacts/ - 7.3 Refresh
MANIFEST.md