You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
incentive: ADR 003 client-reputation admission control is dead code — #317 follow-up never landed #1552
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.
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
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.
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.
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.
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
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:
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.
Activity
github-actions commentedon Aug 1, 2026
🎯 Triage report
crates/incentive/src/client_reputation.rsimplements the ADR 003 client-reputation ledger but is entirely unwired — no construction, no admission hook in thecdn/client/v1handler, 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
technical,high,rust,testingtechnical,high,rust; addingtestingfor the required loopback testsbuyer_channel_redb.rs) and target location (handlers/client/mod.rs) are identified🔗 Similar issues
ClientReputationLedger; likely merged but the wiring step was never done💡 Notes and suggestions
Implementation path
redb-backed store — model after
crates/incentive/src/buyer_channel_redb.rs. ImplementClientReputationStorefor aRedbClientReputationStore. TheMemoryClientReputationStorecan stay for unit/integration tests.Runtime construction — construct the store in node bring-up (look for where
buyer_channel_redbis constructed; do the same for the reputation store). Thread it intocrates/node/src/handlers/client/mod.rsat the admission point.Config surface —
ClientReputationConfigalready 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 otherincentive-adjacent config knobs.Loopback tests — write tests that exercise deny/allow at the admission boundary. The
e2ecrate (anvil-e2efeature) or integration tests insideincentivewithMemoryClientReputationStoreare 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 followcrates/node/src/handlers/client/mod.rs— admission hook insertion pointAdd this agentic workflow to your repo
To install this agentic workflow, run
alpergundogdu commentedon Aug 5, 2026
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/v1admission path." Stepping back, that admission control does not earn its place:channel.clientaccumulates 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.openChannellocks 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.The module (
crates/incentive/src/client_reputation.rs, 1603 lines) had no constructor or consumer — only thelib.rsre-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.
refactor(incentive): remove unenforceable client-reputation ledger (#…