# Tasks — network-trystero-server ## Phase 1: Scaffold - [ ] 1.1 Create `packages/network/network-trystero-server/`, server-tier marker comment in main entry point. - [ ] 1.2 `package.json` at `0.1.0`, `"engines": { "node": ">=20" }`, NO `browser` field. - [ ] 1.3 Test config via `createTestConfig()`; `tests/dep-graph.test.ts`. ## Phase 2: Types + errors - [ ] 2.1 Port public types. - [ ] 2.2 `defineCodes` registry. - [ ] 2.3 Zod schemas for every public option struct. ## Phase 3: Core daemon - [ ] 3.1 Port the main server class + lifecycle. - [ ] 3.2 Port supporting modules (connection mgmt, message handler, etc.). - [ ] 3.3 Thread `AbortSignal` through every async path. ## Phase 4: Observability - [ ] 4.1 OTel spans for lifecycle + per-request. - [ ] 4.2 Counters + histograms. - [ ] 4.3 Health / readiness / liveness endpoints. ## Phase 5: Tests + docs - [ ] 5.1 Unit tests via `@suaveplan/testing/runner`. - [ ] 5.2 Integration tests via `@suaveplan/testing-integration` (no mocks; boot real server). - [ ] 5.3 100/100/100/100 coverage gate. - [ ] 5.4 Sibling `.md` per `.ts` impl file. - [ ] 5.5 Root `README.md` with run-the-daemon instructions. ## Phase 6: Verification - [ ] 6.1 `bunx turbo lint typecheck test --filter=@suaveplan/network-trystero-server` green. - [ ] 6.2 `bunx turbo test:coverage --filter=@suaveplan/network-trystero-server` 100/100/100/100. - [ ] 6.3 `bun run docs:check` green. - [ ] 6.4 `MANIFEST.md` regen. - [ ] 6.5 `STATUS.md` row flipped. ## Pre-archive checklist - [ ] Row 1 — Phase 6 green. - [ ] Row 2 — In-process integration test passes. - [ ] Row 3 — `openspec/specs/network-trystero-server/spec.md` written. - [ ] Row 4 — Folder archived.