Skip to content

incentive: ADR 003 client-reputation admission control is dead code — #317 follow-up never landed #1552

Closed

Description

@thiras

crates/incentive/src/client_reputation.rs implements the ADR 003 client-reputation ledger (the statistical deterrent against clients that take a credit window of bytes and abandon the stream), but nothing constructs or consumes it. The only references outside the module are the re-exports in crates/incentive/src/lib.rs:76-77 (verified by grep across crates/ at HEAD b2a9651).

The module's own comments (client_reputation.rs:400, :561, :603) defer wiring to "the cdn/client/v1 wiring (#317 follow-up)". #317 is closed and the handler shipped (crates/node/src/handlers/client/mod.rs) — without the reputation hook. The only ClientReputationStore impl is MemoryClientReputationStore (non-durable, test-oriented); no redb-backed impl exists despite buyer_channel_redb.rs establishing the pattern.

Consequence: ADR 003's admission control against abandoning clients is unenforced. Nothing accumulates across connections, so an abandoning client pays no penalty beyond the per-stream credit window.

Scope:

  • redb-backed ClientReputationStore (pattern: crates/incentive/src/buyer_channel_redb.rs)
  • construct the ledger in runtime bring-up and thread it into the cdn/client/v1 admission path
  • config surface for the knobs ClientReputationConfig already defines (full surfacing: schema, resolver, validate summary, template, docs)
  • loopback tests for deny/allow at the admission boundary

Activity

  1. added
    prio:high
    rust
    on Aug 1, 2026
  2. github-actions commented on Aug 1, 2026

    @github-actions

    🎯 Triage report

    crates/incentive/src/client_reputation.rs implements the ADR 003 client-reputation ledger but is entirely unwired — no construction, no admission hook in the cdn/client/v1 handler, and no durable redb backend. The #317 follow-up that was supposed to wire it never landed. As a result, the statistical deterrent against stream-abandoning clients is completely unenforced at runtime.

    📊 Assessment

    Dimension Value Reasoning
    Type Task Well-scoped implementation work with an explicit checklist; not a regression or new capability
    Labels technical, high, rust, testing Already has technical, high, rust; adding testing for the required loopback tests
    Coding agent Suitable Requirements are concrete, scope is self-contained, pattern (buyer_channel_redb.rs) and target location (handlers/client/mod.rs) are identified

    🔗 Similar issues

    💡 Notes and suggestions

    Implementation path

    1. redb-backed store — model after crates/incentive/src/buyer_channel_redb.rs. Implement ClientReputationStore for a RedbClientReputationStore. The MemoryClientReputationStore can stay for unit/integration tests.

    2. Runtime construction — construct the store in node bring-up (look for where buyer_channel_redb is constructed; do the same for the reputation store). Thread it into crates/node/src/handlers/client/mod.rs at the admission point.

    3. Config surface — ClientReputationConfig already exists. Wire it into the common config schema (crates/common/), add a field to the config resolver, and update the config template + docs. Follow the pattern established by other incentive-adjacent config knobs.

    4. Loopback tests — write tests that exercise deny/allow at the admission boundary. The e2e crate (anvil-e2e feature) or integration tests inside incentive with MemoryClientReputationStore are both viable options.

    Key files

    • crates/incentive/src/client_reputation.rs — the ledger (comments at :400, :561, :603 note deferred wiring)
    • crates/incentive/src/buyer_channel_redb.rs — redb pattern to follow
    • crates/node/src/handlers/client/mod.rs — admission hook insertion point

    Generated by Agentic Triage for #1552 · sonnet46 · 21.5 AIC · ⌖ 5.65 AIC · ⊞ 6K · ◷

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
  3. added
    kind:test
    on Aug 1, 2026
  4. alpergundogdu commented on Aug 5, 2026

    @alpergundogdu
    Contributor

    Closing this out by removing the client-reputation ledger rather than wiring it in.

    The triage scoped the fix as "construct the ledger and thread it into the cdn/client/v1 admission path." Stepping back, that admission control does not earn its place:

    • The threat it guards is already bounded mechanically, per-channel. The abandoning-client / voucher-withholding loss is capped at one credit window per encounter by the self-enforcing pause plus the seller-side pre-flight deposit guard (ADR 037 / node: cache-miss pull-through pays upstream for the entire blob before collecting any downstream voucher #856 / serve: hoist a pre-spend deposit check above the buffered/range/local fill tiers #1519). A node never fronts more than one window against a channel, and refuses a channel that cannot cover it. An accumulating cross-connection ledger adds nothing on top of a bound that already holds on the very first byte.
    • It is unenforceable. Reputation keyed to channel.client accumulates against a wallet address. Wallets are free to create, so any client at its reject threshold opens a fresh channel from a new key and resets to the new-client tier. The ledger imposes cost only on clients too naive to rotate.
    • The client already pays to misbehave. Every openChannel locks real USDC and costs gas; there is no free credit facility. A client that abandons a stream has already sunk the deposit and the downstream bandwidth. There is nothing left for a reputation penalty to deter.
    • It risks punishing honest resumes. A client that crashes mid-stream and reconnects is indistinguishable from one withholding vouchers. The correct behavior is to resume on the same channel under the same window (bytes already pulled, served from cache) — which is exactly what the channel-bound pause does and what a client-bound penalty would get wrong.

    The module (crates/incentive/src/client_reputation.rs, 1603 lines) had no constructor or consumer — only the lib.rs re-exports. It's deleted along with those exports.

    ADR 003 is updated to match: §Voucher withholding now states the mechanism explicitly (pause keyed to the channel and its next higher-nonce voucher, resume-safe, no cross-connection accumulation), and §Corrupted delivery drops the client-reputation acceptance-policy framing. Node-selection reputation is untouched — that's a separate, legitimate signal.

    PR incoming.

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

Metadata

Metadata

Assignees

Labels

kind:testprio:highrust

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions