Skip to content

docs(adr): finish the reputation-floor removal and drop a dead attack vector - #1452

Merged
thiras merged 1 commit into
mainfrom
codex/1438-remove-min-reputation-floor
Jul 25, 2026
Merged

thiras merged 1 commit into
mainfrom
codex/1438-remove-min-reputation-floor

Conversation

@altanoruc

@altanoruc altanoruc commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #1456 (min-reputation rejection floor, #1438) and #1418 (reputation network tier). This branch predated #1456 and originally carried the same floor removal; the rebase drops everything #1456 already landed — the selection.rs changes, ADR 001's "graded weight, not a veto" paragraph, ADR 037's candidate-pool wording, and the CHANGELOG entry. What remains are the stale sites those two PRs left behind.

ADR 039 § Source set and selection

The floor was the only path by which reputation entered multi-source admission. #1456 removed the floor clause but left preferring lower RTT and lower rate in its place, so the admitted set ranked on RTT and rate alone — contradicting this ADR's own Cross-ADR Impact entry, which states selection uses the same RTT, price, reputation, and diversity inputs as ADR 001.

Now cites ADR 001's unified selection score — its own verbatim term, defined at ADR 001 § Node Selection Algorithm as rate_per_mb × rtt_ms × (1 / max(reputation, 0.1)²) and implemented in crates/node/src/selection.rs. Citing the formula rather than paraphrasing it also closes a standing rot vector: the old wording was already a lossy restatement that silently dropped reputation, wrong against ADR 001 even before #1456.

The collusive-reporting vector no longer exists

Two rejected-alternative entries in adr/_history/alternatives-pre-launch.md and one live paragraph in adr/appendix-blob-cache-eviction.md argued that coupling reputation to eviction "creates a collusive-reporting vector".

That vector was a coalition sending negative ReputationReport messages to push a competitor below an eviction threshold. #1418 deleted ReputationReport, the cdn/reputation/v1 topic, and all cross-node aggregation — reputation is now local-only, so no peer can move another node's score and the premise is gone. #1418 removed the argument from appendix-peer-table-eviction.md but missed its two archive compressions and the parallel claim in appendix-blob-cache-eviction.md, which that PR never touched.

Dropped in all three places, leaving the two rationales the live appendix still states: conflates discovery with selection, and reputation is noisy in the tail. The rejections themselves are unchanged.

Notes

Docs only: 3 files, +4/-4. No code, no contract surface, no gas snapshot, no public-API snapshot change. Downstream repos unaffected — finance/params.py carries no selection parameters.

Deliberately not fixed here, both pre-existing and wider than this change:

#1438 is already closed by #1456; this PR intentionally uses no closing keyword.

Summary by CodeRabbit

  • Documentation
    • Updated technical guidance for selecting multiple sources to use a combined score based on transfer rate, latency, and reputation.
    • Clarified that reputation influences source selection, while cache and peer retention remain governed by recency.
    • Streamlined supporting decision records and rationale.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Free

Run ID: 7b0a7083-01c6-46b5-9834-ae1c9e0ab029

📥 Commits

Reviewing files that changed from the base of the PR and between 7e22020 and 0c480f4.

📒 Files selected for processing (3)
  • adr/039-multi-source-parallel-fetch.md
  • adr/_history/alternatives-pre-launch.md
  • adr/appendix-blob-cache-eviction.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • adr/_history/alternatives-pre-launch.md

Walkthrough

The ADR updates multi-source admission to use a unified score incorporating rate, RTT, and reputation. Related eviction-policy documentation clarifies that reputation affects selection, not cache or peer-table eviction.

Changes

Reputation selection guidance

Layer / File(s) Summary
Update multi-source admission scoring
adr/039-multi-source-parallel-fetch.md
Multi-source candidates are ranked by a unified rate, RTT, and reputation score while existing probing, diversity, and fallback behavior remains unchanged.
Clarify eviction policy rationale
adr/_history/alternatives-pre-launch.md, adr/appendix-blob-cache-eviction.md
Eviction documentation retains recency-based retention and removes references to reputation floors, collusive reporting, and related coupling risks.

Estimated code review effort: 2 (Simple) | ~10 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands.

@altanoruc altanoruc changed the title Remove the minimum-reputation rejection floor refactor(node): remove reputation rejection floor Jul 24, 2026
@github-actions

github-actions Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Coverage report

Total: 81.09% (was 81.07%, ▲ +0.01%) — 52476/64715 lines

File Coverage Lines Δ
crates/client-pull/src/discovery.rs 96.38% 718/745 ● 0.00%
crates/node/src/selection.rs 97.31% 434/446 ▼ 0.61%
History
Commit Total Δ vs base
db3bbb0 81.09% ▲ +0.02%
7e22020 (HEAD) 81.09% ▲ +0.01%

Copy link
Copy Markdown
Contributor Author

Review

The Rust removal is clean and matches the #1438 scope exactly — DEFAULT_MIN_REPUTATION, apply_reputation_floor, and the three _with_floor variants are gone, rank_candidates / top_n collapse onto the scoring path, and the REPUTATION_FLOOR = 0.1 denominator clamp plus the reputation² term are untouched. No behavior change: the sole production caller (node_origin.rs:1083) already passed the disabled default.

Verified locally on db3bbb0:

  • cargo clippy -p decdn-node -p decdn-client-pull --all-targets -- -D warnings — clean
  • cargo test -p decdn-node --lib selection — 33 passed
  • No residual min_reputation / *_with_floor / DEFAULT_MIN_REPUTATION identifiers, and no remaining links to the deleted #minimum-reputation-rejection-floor anchor
  • The public entry points keep direct coverage (~15 tests still call rank_candidates / top_n), and score_negative_reputation_clamps_to_floor still pins the negative-input clamp, so the 0.61% dip on selection.rs is floor-only lines
  • CI is 23/23 green

Three things worth addressing before this leaves draft.

1. ADR 039 drops reputation from source selection entirely, not just the floor

adr/039-multi-source-parallel-fetch.md:25 now reads:

The client probes each for live availability, RTT, and rate_per_mb … The client admits up to max_sources, preferring lower RTT and lower rate.

Pre-PR, the floor was the only path by which reputation entered multi-source admission. Removing it leaves reputation with no role in choosing sources — which contradicts adr/039-multi-source-parallel-fetch.md:110 (unchanged by this PR):

[ADR 001 § Node Selection Algorithm]: selection becomes set-valued for large blobs — the client admits and ranks a set of full holders rather than choosing one, using the same RTT, price, reputation, and diversity inputs.

This also undercuts the issue's core rationale — that poor nodes stay de-prioritized by reputation² — because on this path they no longer are. The one-line fix that keeps both statements true is to rank by the ADR 001 score rather than by RTT+rate:

The client admits up to max_sources, ranking candidates by the ADR 001 selection score (rate_per_mb × rtt_ms × 1/max(reputation, 0.1)²).

That converts the hard filter into the graded weight, which is exactly what #1438 argues we keep. (Alternative: strike "reputation" from line 110 — but that's a real design change, not a doc cleanup, and it should be called out as one.)

2. Stale CHANGELOG entry

CHANGELOG.md:241-246 (under [Unreleased] → Added) still advertises the deleted APIs:

Minimum-reputation rejection floor for node selection: the new rank_candidates_with_floor / top_n_with_floor selection APIs drop sub-floor candidates before scoring…

The sibling removal (#1396/#1399) updated CHANGELOG.md in the same PR, so the convention is established. Since this entry never shipped in a tagged release and had no operator-visible surface (the entry itself says "no config/env/CLI knob yet"), deleting the bullet is cleaner than adding a "Removed" note — nothing an operator ran is changing.

3. Open question 3 from #1438 is unanswered

The issue asks whether ADR 001 should retain a one-line note that reputation acts only as a graded weight after removal, "so the design intent is explicit and the floor is not silently re-added later". The PR deletes the subsection without it. A sentence after the reputation table — e.g. "Reputation is a graded weight in the score, never a veto: no reputation value removes a candidate from the pool before scoring" — is cheap insurance and directly answers the question. Worth a line in the PR body either way, since the body doesn't record how questions 1–3 were resolved.

Minor / confirm intent

  • ADR 037 proxy candidates now carry no reputation signal at all. The pool at adr/037-regional-proxy-warming.md:28 is unfiltered, and ranking there is deliberately "measured RTT only" for region-spoof resistance — so unlike the ADR 001 path, there is no reputation² term backstopping the removal. Defensible (warming is opt-in/default-off, and discovery.rs never enforced the floor — hence the doc block this PR correctly deletes), but it is a genuine loss of signal rather than a no-op, unlike the rest of the change. Worth an explicit ack.
  • adr/_history/alternatives-pre-launch.md — this rewrites archived rationale ("ADR 008's hard floor" → "ADR 008's reputation weighting"). Fine if the archive is meant to track current terminology; if it's meant to preserve what was argued at the time, leaving those two lines alone is the safer read of adr/README.md's framing of _history/.

Nothing here blocks the removal itself — the code change is right and shipped behavior is unchanged.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Pushed 7e22020 addressing my own review above.

  • ADR 039 — source admission is now ranked by the ADR 001 unified selection score over rate, RTT, and reputation, instead of "preferring lower RTT and lower rate". This restores reputation as the graded weight the removal keeps, and makes the Cross-ADR Impact entry at 039:110 true again.
  • ADR 001 — added "Reputation weights, it does not veto." after the **Inputs:** paragraph, answering open question 3 in Remove the min-reputation rejection floor (ADR 001) #1438 and pinning the intent so the pre-scoring cutoff isn't silently reintroduced.
  • CHANGELOG — deleted the [Unreleased] → Added bullet advertising rank_candidates_with_floor / top_n_with_floor. Removed rather than superseded by a note (unlike feat: remove speculative prefetch mechanism (#1396) #1399's [prefetch] entry) because it never shipped in a tagged release and had no operator-visible surface.

Left as-is, deliberately: the ADR 037 proxy path stays RTT-only — that's an explicit design property there (region-spoof resistance), the code never enforced the floor on that pool, and warming is opt-in/default-off. And the _history/ archive edits, which are the author's call on whether that file tracks current terminology.

Checks run locally on the doc changes: markdownlint-cli2 clean, make -C adr check-refs and check-book-list pass, git diff --check clean. No Rust touched by this commit.


Generated by Claude Code

@altanoruc
altanoruc marked this pull request as ready for review July 24, 2026 19:46
@thiras
thiras force-pushed the codex/1438-remove-min-reputation-floor branch from 7e22020 to 484ab68 Compare July 25, 2026 17:32
@thiras thiras changed the title refactor(node): remove reputation rejection floor docs(adr): finish the reputation-floor removal in ADR 039 and the archive Jul 25, 2026
… vector

Rebased onto main after #1456 landed the min-reputation rejection-floor
removal (#1438). The code removal, ADR 001's "graded weight, not a veto"
paragraph, ADR 037's candidate-pool wording, and the CHANGELOG entry are all
already on main and are dropped from this branch. What remains are the stale
reference sites #1456 did not cover, plus one #1418 left behind.

ADR 039 § Source set and selection. The floor was the only path by which
reputation entered multi-source admission. #1456 removed the floor clause but
left "preferring lower RTT and lower rate" in its place, so the admitted set
ranked on RTT and rate alone — contradicting this ADR's own Cross-ADR Impact
entry, which states selection uses the same RTT, price, reputation, and
diversity inputs as ADR 001. Cite ADR 001's unified selection score instead
(its own term, defined at ADR 001 § Node Selection Algorithm), which carries
reputation as the graded weight the removal keeps. Citing the formula rather
than paraphrasing it also removes a standing rot vector: the old wording was
already a lossy restatement that silently dropped reputation, wrong against
ADR 001 even before #1456.

The collusive-reporting vector no longer exists. Two rejected-alternative
entries in adr/_history/alternatives-pre-launch.md and one live paragraph in
adr/appendix-blob-cache-eviction.md argued that coupling reputation to
eviction "creates a collusive-reporting vector". That vector was a coalition
sending negative ReputationReport messages to push a competitor below an
eviction threshold — and #1418 deleted ReputationReport, the cdn/reputation/v1
topic, and all cross-node aggregation. Reputation is local-only; no peer can
move another node's score, so the premise is gone. #1418 removed the argument
from appendix-peer-table-eviction.md but missed its two archive compressions
and the parallel claim in appendix-blob-cache-eviction.md, which it never
touched. Drop the clause in all three places, leaving the two rationales the
live appendix still states (conflates discovery with selection; reputation is
noisy in the tail). The rejections themselves are unchanged.

Docs only. Not fixed here: "admissible" at ADR 039 §§ 25/55/116 lost its
definition when #1456 removed the floor it referred to, and the archive's
bare section refs (§1, §3, §4, §6-§11) predate #610 dropping ADR section
numbering — both pre-existing and wider than this change.

Co-Authored-By: Claude Opus 5 <[email protected]>
@thiras
thiras force-pushed the codex/1438-remove-min-reputation-floor branch from 484ab68 to 0c480f4 Compare July 25, 2026 17:39
@thiras thiras changed the title docs(adr): finish the reputation-floor removal in ADR 039 and the archive docs(adr): finish the reputation-floor removal and drop a dead attack vector Jul 25, 2026
@thiras
thiras merged commit 0b112a2 into main Jul 25, 2026
24 checks passed
@thiras
thiras deleted the codex/1438-remove-min-reputation-floor branch July 25, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants