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

2.6 KiB

Tasks — Migrate @suaveplan/health-check to genesis

0. Pre-flight (non-negotiable)

  • 0.1 git status clean inside .claude/worktrees/agent-ae4f1a1bd61f6b11d
  • 0.2 Account for every worktree returned by git worktree list (this agent's worktree + main checkout + other live agent)
  • 0.3 git merge-base --is-ancestor 5942a30eeb82f16a92479e34d04c1c6d4513f041 HEAD reports true after git fetch /home/paul/web/genesis genesis && git merge FETCH_HEAD --no-edit

1. Spec authoring

  • 1.1 Read upstream /mnt/s/web/suaveplan/packages/server/health-check/ end-to-end
  • 1.2 Read openspec/AGENTS.md Sections 13 and 14
  • 1.3 Draft proposal.md with ## Source mapping table
  • 1.4 Draft specs/health-check/spec.md with ## ADDED Requirements + **Verified by:** lines

2. Implementation

  • 2.1 src/types/ — shared types incl. HealthEventMap, TcpConnectFn, TcpSocketLike, injectable fetch/connect on configs
  • 2.2 src/error-codes/ — HEALTH_CHECK_CODES + public-ctor HealthCheckError
  • 2.3 src/telemetry/ — OTel meter (counter + counter + histogram)
  • 2.4 src/health-checker/ — HealthChecker with injectable Clock/TimersLike/LoggerLike + EventBus<HealthEventMap>
  • 2.5 src/http-check/ — createHttpCheck with injectable fetchImpl
  • 2.6 src/tcp-check/ — createTcpCheck with injectable TcpConnectFn
  • 2.7 src/response-builder/ — ResponseBuilder mapping statuses to HTTP codes
  • 2.8 src/index.ts — explicit named re-exports only

3. Tests

  • 3.1 Unit tests co-located at src/<feature>/<feature>.test.ts
  • 3.2 100/100/100/100 coverage gate met (istanbul)
  • 3.3 Every it(...) carries { timeout: 5000 }
  • 3.4 All tests import from @suaveplan/testing/runner

4. Documentation

  • 4.1 Sibling .md for every non-exempt implementation file (≥200 words, six sections)
  • 4.2 Root README.md with module list + install + usage

5. Verification

  • 5.1 bunx turbo lint typecheck test --filter=@suaveplan/health-check green
  • 5.2 bunx turbo test:coverage --filter=@suaveplan/health-check ≥ 100/100/100/100
  • 5.3 bunx turbo build --filter=@suaveplan/health-check green
  • 5.4 grep -rnE "from ['\"](vitest|bun:test)['\"]" packages/observability/monitor/health-check/src/ empty
  • 5.5 grep -rn "biome-ignore\|TODO\|FIXME\|XXX" packages/observability/monitor/health-check/src/ empty
  • 5.6 bun scripts/lint/check-feature-layout.ts | grep health-check empty
  • 5.7 bun scripts/folder-reorg/generate-manifest.ts refreshed MANIFEST.md