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

3.8 KiB

Tasks — Add @suaveplan/booking

1. Spec authoring

  • 1.1 Read ../suaveplan/enterprise/booking.md end-to-end
  • 1.2 Read openspec/specs/booking/spec.md (does not exist — new package)
  • 1.3 Read openspec/AGENTS.md Sections 13 and 14
  • 1.4 Draft proposal.md from openspec/templates/proposal.md
  • 1.5 Fill in ## Source mapping table
  • 1.6 Draft specs/booking/spec.md from openspec/templates/spec-delta.md
  • 1.7 Every requirement in the spec delta carries a **Verified by:** line naming concrete it(...) titles

2. Implementation

  • 2.1 Scaffold packages/security/booking/ (package.json, tsconfig.lib.json, vite.config.ts, vitest.config.ts, tests/setup/polyfills.ts)
  • 2.2 Implement src/error-codes/ — BOOKING_CODES registry + BookingError class with discriminants
  • 2.3 Implement src/types/ — every public type module verbatim (bookable, booking, booking-hooks, capacity, config, events, layout, pricing, rules, temporal)
  • 2.4 Implement src/hooks/ — in-package Hooks<TMap> with sync/async/result variants + types
  • 2.5 Implement src/utils/ and src/constants/
  • 2.6 Implement src/temporal/ — windows, recurrence, slots
  • 2.7 Implement src/conflict/ — detector registry + 4 built-ins
  • 2.8 Implement src/pricing/ — calculator, seasonal, dynamic
  • 2.9 Implement src/rules/ — evaluator + condition factories
  • 2.10 Implement src/availability/ — resolver registry + 3 strategies
  • 2.11 Implement src/domains/ — base + 6 preset factories
  • 2.12 Implement src/schemas/ — Zod schemas for entities + config
  • 2.13 Implement src/core/ — engine, state-machine, event-bus
  • 2.14 Write root src/index.ts with explicit named re-exports
  • 2.15 Write per-feature index.ts barrels with explicit named re-exports

3. Tests

  • 3.1 Unit tests per feature module covering every scenario in the spec delta
  • 3.2 Spec-conformance: src/conformance.spec-conformance.test.ts pinning barrel + subpath + tier-purity invariants
  • 3.3 Every it(...) carries { timeout: 5000 }
  • 3.4 Every test imports runner primitives from @suaveplan/testing/runner

4. Documentation

  • 4.1 Sibling .md for every implementation .ts (≥200 words, basic + advanced examples, full API reference)
  • 4.2 README at package root linking every co-located .md under ## Modules
  • 4.3 Update root STATUS.md, MANIFEST.md, MISSING.yml, SUMMARY.md for @suaveplan/booking

5. Pre-archive verification (5-gate triple)

  • 5.1 bun run check / bunx biome check
  • 5.2 bunx turbo lint typecheck test --filter=@suaveplan/booking
  • 5.3 bunx turbo test:coverage --filter=@suaveplan/booking — 100/100/100/100
  • 5.4 Spec-conformance: every requirement in spec.md has a real test that pins it
  • 5.5 bunx turbo build --filter=@suaveplan/booking

6. Pre-archive 9-row checklist

  • 6.1 Generics threaded (BookingEngine<TBookableMeta, TBookingMeta>, Hooks<TMap>)
  • 6.2 Zod schemas wired at every declared boundary
  • 6.3 Every error code in BOOKING_CODES thrown by at least one production path
  • 6.4 N/A — no strict-mode toggle in this package
  • 6.5 N/A — OTel observability surface deferred per Out of Scope
  • 6.6 N/A — no lifecycle dedup primitives in this surface
  • 6.7 No retroactive tick — every box reflects work done in this change
  • 6.8 No export * in any feature-module barrel
  • 6.9 No direct vitest / bun:test imports in test files

7. Archive

  • 7.1 Fold spec delta into openspec/specs/booking/spec.md
  • 7.2 Move openspec/changes/add-booking/ → openspec/archive/2026-05-17-add-booking/
  • 7.3 Refresh MANIFEST.md via bun scripts/folder-reorg/generate-manifest.ts
  • 7.4 Refresh MISSING.yml via bun scripts/generate-missing.ts