Skip to content

reputation: outbound report capture + selection-consumes-reputation (gated on node-to-node pull-through orchestration) #831

Closed

Description

@thiras

Context

Follow-up to #326. The reputation vertical (engine + gossip transport + node wiring) is in place, and the inbound path is being made live by the settlement-indexer + admin_v1_reputation follow-up (live reporter weights + observability). Two pieces of ADR 008 / ADR 001 coverage remain, and both are blocked on the node-to-node cache-miss pull-through orchestration not yet existing in production.

Verified test-only (no production call site today):

  • client_requester::stream_fetch, buyer_channel::open_or_reuse_channel, dht/lookup::find_providers, selection::rank_candidates
  • no node-side peer-probing task (only probe_relay for relay reachability + the decdn probe CLI)
  • CacheEngine pull-through fetches from origins only — there is no NodeOrigin/pull-from-peer branch
  • cdn/client/v1 handler returns NotFound on cache miss (crates/node/src/handlers/client.rs:476); the discover→select→open-channel→pull→populate orchestration is explicitly deferred (crates/node/src/runtime/mod.rs:~839, "needs provider-discovery (ADR 001/022)")

Scope (this issue)

Once the pull-through orchestration exists, wire:

  1. Outbound report capture (ADR 008 §Local Score + §Gossip Protocol). Construct LocalReputation (currently constructed nowhere) and, at the node-as-client pull site, record an Outcome (Delivered{bytes,elapsed} / Corruption / Unreachable) about the upstream provider into both LocalReputation::record(provider, outcome) and the reputation ObservationBuffer::observe(provider, metrics). This is what makes the node actually emit ReputationReports (the publisher already runs; the buffer is currently never fed). Also feed reachability from the node-side probe path if/when one exists.

  2. Selection consumes the combined score (ADR 001 node selection). Populate selection::Candidate.reputation from decdn_reputation::combined_score(local.score(peer), network.score(peer, now), cfg) at the provider-selection site (the find_providers → rank_candidates call path), so reputation finally influences which upstream nodes get picked (the 1/max(reputation,0.1)² penalty already exists in selection.rs).

Blocked by

The node-to-node cache-miss pull-through orchestration (ADR-022 delivery): a NodeOrigin/pull-from-peer branch + the cache-miss hook that discovers providers, selects one, opens a buyer channel (BuyerChannelService::open_or_reuse_channel, already bootstrapped but idle), pulls via stream_fetch, and populates the cache. Related: #763 (buyer-channel robustness, "gated on the not-yet-wired cache-miss hook"), #746 (pull-through integration test).

Acceptance criteria

  • A node that pulls a blob from an upstream provider records a local outcome and queues an outbound ReputationReport, which peers receive and aggregate.
  • Provider selection for cache-miss pulls ranks candidates using the combined local+network reputation score.

References

Activity

  1. added
    status:blocked
    rust
    on Jun 6, 2026
  2. github-actions commented on Jun 6, 2026

    @github-actions

    🎯 Triage report

    This is a well-specified follow-up to #326 that closes the remaining two ADR 008/ADR 001 gaps in the reputation subsystem: (1) making nodes actually emit ReputationReports by feeding the currently-idle ObservationBuffer from pull-through outcomes, and (2) routing the combined reputation score into provider selection so the 1/max(reputation,0.1)2 penalty in selection.rs has real data. Both pieces are hard-blocked on the node-to-node cache-miss pull-through orchestration, which does not yet exist in production (the cdn/client/v1 handler returns NotFound on cache miss today). Labels and blocking relationships are correctly stated; the code pointers are verified.

    📊 Assessment

    Dimension Value Reasoning
    Type Task Wiring existing subsystems together; no design uncertainty, no new API surface
    Labels unchanged technical, blocked, rust, prod-blocking are all accurate; existing labels cover the issue well
    Coding agent Not suitable Blocked by a prerequisite that does not exist; cannot be started until the pull-through orchestration (ADR-022 delivery) lands

    🔗 Similar issues

    💡 Notes and suggestions

    What is already in place (nothing needs to be written from scratch):

    • ObservationBuffer::observe() and LocalReputation::record() exist in crates/reputation/; the gossip publisher runs but its buffer is never fed.
    • selection::rank_candidates and the 1/max(reputation,0.1)2 penalty are already in selection.rs; Candidate.reputation just needs to be populated.
    • BuyerChannelService::open_or_reuse_channel and stream_fetch are bootstrapped but idle.
    • decdn_reputation::combined_score(local, network, cfg) is the public combinator to call at the selection site.

    Implementation checklist once the pull-through orchestration lands:

    • Construct LocalReputation in reputation_wiring.rs (currently constructed nowhere) and inject it into the pull-through path.
    • At the cache-miss pull site (inside the new NodeOrigin/pull-from-peer branch), record Outcome::Delivered { bytes, elapsed } / Corruption / Unreachable into both LocalReputation::record(provider, outcome) and ObservationBuffer::observe(provider, metrics).
    • At the find_providers → rank_candidates call site, populate selection::Candidate.reputation from decdn_reputation::combined_score(local.score(peer), network.score(peer, now), cfg).
    • Verify acceptance criteria: a pull from an upstream provider (a) queues an outbound ReputationReport receivable by peers, and (b) selection order reflects the combined score.

    Ordering note: #746 (pull-through integration test) and this issue share the same unlock condition. Whoever lands the pull-through orchestration should coordinate so reputation wiring and the integration test land together or in quick succession — otherwise the integration test will exercise a code path where Candidate.reputation is still zeroed.

    Generated by Agentic Triage for issue #831 · sonnet46 632.5K · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
  3. self-assigned this
    on Jun 6, 2026
  4. thiras commented on Jun 10, 2026

    @thiras
    ContributorAuthor

    Implemented and merged in #834 (squash c602c52 on main): node-to-node cache-miss pull-through + outbound report capture and selection-consumes-reputation. Closing as fully resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ruststatus:blocked

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions