2.7 KiB
2.7 KiB
Tasks — network-bootstrap
Phase 1: Scaffold
- 1.1 Create
packages/network/network-bootstrap/with standard package layout (per CLAUDE.md feature-module structure). - 1.2 Author
package.jsonat0.1.0,"sideEffects": false, subpath exports per feature module. - 1.3 Wire
tsconfig.json/tsconfig.lib.json/vite.config.ts/vitest.config.tsviacreateTestConfig(). - 1.4 Add
tests/dep-graph.test.tsasserting no cycles.
Phase 2: Port types + errors
- 2.1 Port
bootstrap.types.ts→src/types/types.ts+ sibling.mddoc. - 2.2
defineCodes("NET_BOOTSTRAP", [...])registry:CHAIN_EXHAUSTED,CACHE_CORRUPTED,STRATEGY_TIMEOUT,INVALID_OPTIONS. - 2.3 Zod schemas for every public option struct.
Phase 3: Core
- 3.1 Port
DiscoveryChainwith ordered execution + first-success fallthrough. - 3.2 Port
PeerCachebacked byAbstractStoragefrom@suaveplan/storage. - 3.3 Wire
@suaveplan/retryfor backoff between strategy attempts. - 3.4 Emit
bootstrap:started/:peer-found/:exhaustedonNetworkBus. - 3.5 Thread
AbortSignalthrough every async path.
Phase 4: Plugin + middleware
- 4.1 Port
BootstrapPlugin(NetworkPluginimpl). - 4.2 Port
BootstrapMiddleware(runtime chain augmentation). - 4.3 Conformance test for
NetworkPluginlifecycle (install/start/stop/dispose idempotency).
Phase 5: Observability
- 5.1 OTel spans (
bootstrap.chain.execute). - 5.2 Counters (
bootstrap.peers_found_total{strategy},bootstrap.failures_total{strategy,code}). - 5.3 Histograms (
bootstrap.chain_duration_ms).
Phase 6: Tests + docs
- 6.1 Unit tests per feature module via
@suaveplan/testing/runner. - 6.2 fast-check property tests: chain ordering, cache eviction, retry idempotency.
- 6.3 100/100/100/100 coverage gate.
- 6.4 Sibling
.mddoc per.tsimpl file (docs:checkgreen). - 6.5 Root
README.mdwith basic + advanced examples.
Phase 7: Verification
- 7.1
bunx turbo lint typecheck test --filter=@suaveplan/network-bootstrapgreen. - 7.2
bunx turbo test:coverage --filter=@suaveplan/network-bootstrap100/100/100/100. - 7.3
bun run docs:check --filter=@suaveplan/network-bootstrapgreen. - 7.4
bun scripts/folder-reorg/generate-manifest.tsupdatesMANIFEST.md. - 7.5
STATUS.mdrow flipped from–to✅.
Pre-archive checklist
- Row 1 — Verified by: Phase 7 gates all green.
- Row 2 — Verified by: Parity checklist in
proposal.mdhas zero unresolved 🚫. - Row 3 — Verified by:
openspec/specs/network-bootstrap/spec.mdwritten with## ADDED Requirements. - Row 4 — Verified by: Folder moved to
openspec/archive/<yyyy-mm-dd>-network-bootstrap/.