48 lines
2.6 KiB
Markdown
48 lines
2.6 KiB
Markdown
# Tasks — Migrate @suaveplan/health-check to genesis
|
|
|
|
## 0. Pre-flight (non-negotiable)
|
|
|
|
- [x] 0.1 `git status` clean inside `.claude/worktrees/agent-ae4f1a1bd61f6b11d`
|
|
- [x] 0.2 Account for every worktree returned by `git worktree list` (this agent's worktree + main checkout + other live agent)
|
|
- [x] 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
|
|
|
|
- [x] 1.1 Read upstream `/mnt/s/web/suaveplan/packages/server/health-check/` end-to-end
|
|
- [x] 1.2 Read `openspec/AGENTS.md` Sections 13 and 14
|
|
- [x] 1.3 Draft `proposal.md` with `## Source mapping` table
|
|
- [x] 1.4 Draft `specs/health-check/spec.md` with `## ADDED Requirements` + `**Verified by:**` lines
|
|
|
|
## 2. Implementation
|
|
|
|
- [x] 2.1 `src/types/` — shared types incl. `HealthEventMap`, `TcpConnectFn`, `TcpSocketLike`, injectable fetch/connect on configs
|
|
- [x] 2.2 `src/error-codes/` — `HEALTH_CHECK_CODES` + public-ctor `HealthCheckError`
|
|
- [x] 2.3 `src/telemetry/` — OTel meter (counter + counter + histogram)
|
|
- [x] 2.4 `src/health-checker/` — `HealthChecker` with injectable `Clock`/`TimersLike`/`LoggerLike` + `EventBus<HealthEventMap>`
|
|
- [x] 2.5 `src/http-check/` — `createHttpCheck` with injectable `fetchImpl`
|
|
- [x] 2.6 `src/tcp-check/` — `createTcpCheck` with injectable `TcpConnectFn`
|
|
- [x] 2.7 `src/response-builder/` — `ResponseBuilder` mapping statuses to HTTP codes
|
|
- [x] 2.8 `src/index.ts` — explicit named re-exports only
|
|
|
|
## 3. Tests
|
|
|
|
- [x] 3.1 Unit tests co-located at `src/<feature>/<feature>.test.ts`
|
|
- [x] 3.2 100/100/100/100 coverage gate met (istanbul)
|
|
- [x] 3.3 Every `it(...)` carries `{ timeout: 5000 }`
|
|
- [x] 3.4 All tests import from `@suaveplan/testing/runner`
|
|
|
|
## 4. Documentation
|
|
|
|
- [x] 4.1 Sibling `.md` for every non-exempt implementation file (≥200 words, six sections)
|
|
- [x] 4.2 Root `README.md` with module list + install + usage
|
|
|
|
## 5. Verification
|
|
|
|
- [x] 5.1 `bunx turbo lint typecheck test --filter=@suaveplan/health-check` green
|
|
- [x] 5.2 `bunx turbo test:coverage --filter=@suaveplan/health-check` ≥ 100/100/100/100
|
|
- [x] 5.3 `bunx turbo build --filter=@suaveplan/health-check` green
|
|
- [x] 5.4 `grep -rnE "from ['\"](vitest|bun:test)['\"]" packages/observability/monitor/health-check/src/` empty
|
|
- [x] 5.5 `grep -rn "biome-ignore\|TODO\|FIXME\|XXX" packages/observability/monitor/health-check/src/` empty
|
|
- [x] 5.6 `bun scripts/lint/check-feature-layout.ts | grep health-check` empty
|
|
- [x] 5.7 `bun scripts/folder-reorg/generate-manifest.ts` refreshed `MANIFEST.md`
|