2.9 KiB
2.9 KiB
Tasks — network-discovery-hybrid
Phase 1: Scaffold
- 1.1 Create
packages/network/network-discovery-hybrid/with feature-module layout. - 1.2
package.jsonat0.1.0,"sideEffects": false, subpath exports. - 1.3 Declare optional peer-deps on the five sibling discovery packages with
peerDependenciesMeta.{...}.optional: true. - 1.4 Test config via
createTestConfig();tests/dep-graph.test.ts.
Phase 2: Types + errors
- 2.1 Port
types.ts→src/types/types.ts+ sibling.md. - 2.2
defineCodes("NET_DISC_HYBRID", [...])per parity checklist. - 2.3 Zod schemas for
HybridDiscoveryConfig,StrategyConfig,StrategyPriority.
Phase 3: Core orchestrator
- 3.1 Port
HybridDiscoveryManagerorchestrator. - 3.2 Port
StrategyManager(health + priority). - 3.3 Port
Lifecyclestart/stop FSM. - 3.4 Port
PeerTrackerdeduped peer set withPeerSource. - 3.5 Port
StrategyLoaderdynamic loader (resolves optional peer-deps lazily).
Phase 4: Banned-mock removal
- 4.1 DELETE
__mocks__/strategy-mock.ts— do not port. - 4.2 Author a real in-package
TestStrategyfixture implementingDiscoveryStrategydeterministically (novi.mock/jest.mock). - 4.3 Verify zero
: anyusage in production source.
Phase 5: Observability
- 5.1 Counter
hybrid.peer_sources_total{strategy}. - 5.2 Histogram
hybrid.strategy_health_score{strategy}. - 5.3 Gauge
hybrid.active_strategies.
Phase 6: Integration (REAL strategies — no mocks)
- 6.1 Integration test: register all five Wave-2 siblings, verify peer dedup with
PeerSourcecorrectness. - 6.2 Integration test: simulate degradation of one strategy (cut signaling), verify priority-based fallback to next-healthiest.
- 6.3 Integration test: lifecycle (start all → stop one → restart) idempotency.
Phase 7: Tests + docs
- 7.1 Unit tests via
@suaveplan/testing/runner. - 7.2 fast-check property tests: peer dedup commutativity, priority-order stability.
- 7.3 100/100/100/100 coverage gate.
- 7.4 Sibling
.mdper.tsimpl file. - 7.5 Root
README.mdwith basic + advanced examples.
Phase 8: Verification
- 8.1
bunx turbo lint typecheck test --filter=@suaveplan/network-discovery-hybridgreen. - 8.2
bunx turbo test:coverage --filter=@suaveplan/network-discovery-hybrid100/100/100/100. - 8.3
bun run docs:check --filter=@suaveplan/network-discovery-hybridgreen. - 8.4
MANIFEST.mdregen. - 8.5
STATUS.mdrow flipped.
Pre-archive checklist
- Row 1 — Phase 8 green.
- Row 2 — Parity 🚫 list empty (mocks/stories both legitimately dropped with justification).
- Row 3 —
openspec/specs/network-discovery-hybrid/spec.mdwritten. - Row 4 — Integration test against all five real siblings passes.
- Row 5 — Folder archived.