2.3 KiB
2.3 KiB
Tasks — network-discovery-webtorrent
Phase 1: Scaffold
- 1.1 Create
packages/network/network-discovery-webtorrent/with standard feature-module layout. - 1.2
package.jsonat0.1.0,"sideEffects": false, subpath exports per module. - 1.3 Test config via
createTestConfig(). - 1.4
tests/dep-graph.test.ts.
Phase 2: Types + errors
- 2.1 Port public types into
src/types/+ sibling.md. - 2.2
defineCodesregistry per parity checklist. - 2.3 Zod schemas for every public option struct.
Phase 3: Core strategy
- 3.1 Port the
DiscoveryStrategyimplementation module(s) listed in the audit. - 3.2 Replace ad-hoc retry/event utilities with
@suaveplan/retry+@suaveplan/events. - 3.3 Inject
ClockandRngvia@suaveplan/typescontracts. - 3.4 Thread
AbortSignalthrough every async path.
Phase 4: Observability
- 4.1 OTel spans for strategy lifecycle.
- 4.2 Counters for discovered peers / failures.
- 4.3 Histograms for handshake / signaling duration.
Phase 5: Integration
- 5.1 Cross-package integration test with
@suaveplan/network-bootstrap: register this strategy in the discovery chain, run a node, observepeer:foundevents. - 5.2 Optional: register discovered peers into
@suaveplan/service-discovery.
Phase 6: Tests + docs
- 6.1 Unit tests per feature module via
@suaveplan/testing/runner. - 6.2 fast-check property tests where applicable (peer dedup, retry idempotency).
- 6.3 100/100/100/100 coverage gate.
- 6.4 Sibling
.mddoc per.tsimpl file. - 6.5 Root
README.mdwith basic + advanced examples.
Phase 7: Verification
- 7.1
bunx turbo lint typecheck test --filter=@suaveplan/network-discovery-webtorrentgreen. - 7.2
bunx turbo test:coverage --filter=@suaveplan/network-discovery-webtorrent100/100/100/100. - 7.3
bun run docs:check --filter=@suaveplan/network-discovery-webtorrentgreen. - 7.4
MANIFEST.mdregen. - 7.5
STATUS.mdrow flipped from–to✅.
Pre-archive checklist
- Row 1 — Phase 7 green.
- Row 2 — Parity 🚫 list empty.
- Row 3 —
openspec/specs/network-discovery-webtorrent/spec.mdwritten. - Row 4 —
network-bootstrapintegration test passes. - Row 5 — Folder archived.