## Context ADR 001 specifies a unified node selection score for choosing which peer to request content from after discovery. Currently no selection logic exists. ## Scope (crates/node or a new selection module) - **Score formula**: `rate_per_mb × rtt_ms × (1 / reputation²)` — lower is better - **Reputation floor**: clamp at 0.1 minimum to prevent division by near-zero - **Inputs**: rate_per_mb from ProbeResponse/gossip, RTT from probe timing, reputation from local scoring - **Tie-breaking** (ADR 008): load → geo → stake → random - **Integration**: called after content discovery returns candidate nodes, before opening cdn/client/v1 stream - **Fallback**: max 3 provider attempts before returning error to caller ## References - [ADR 001](adr/001-network.md) - [ADR 008](adr/008-reputation.md)
Activity
feat(selection): tie-break tier 2 (geographic diversity)
feat(selection): tie-break tier 3 (higher stake wins)
feat(selection): tie-break tier 4 (random) and complete ADR 008 §9
fix(selection): pin random seed in geo-diversity test
test(selection): make geo-diversity test invariant-based
feat(selection): add top_n helper and MAX_PROVIDER_ATTEMPTS = 3
fix(selection): scope geo tie-break tracker per tie group
fix(selection): drop intra-doc link to private rank_candidates_with_rng
fix(protocol): bound ProbeResponse.rate_per_mb at the wire boundary (#…
docs(plan): node selection algorithm (issue #322)
feat(selection): add Candidate / RankedCandidate types + module skeleton
feat(selection): compute_score with reputation floor clamp
feat(selection): rank_candidates basic score-ascending sort
feat(selection): tie-break tier 1 (lower load wins within 1% score)
feat(selection): tie-break tier 2 (geographic diversity)
feat(selection): tie-break tier 3 (higher stake wins)
feat(selection): tie-break tier 4 (random) and complete ADR 008 §9
fix(selection): pin random seed in geo-diversity test
test(selection): make geo-diversity test invariant-based
feat(selection): add top_n helper and MAX_PROVIDER_ATTEMPTS = 3
fix(selection): scope geo tie-break tracker per tie group
fix(selection): drop intra-doc link to private rank_candidates_with_rng
feat(node): selection algorithm + ADR 008 §9 tie-break (#322) (#380)