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
kind:featureNew capability or a change to current behaviorprio:lowWhen convenientrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Follow-up polish from the multi-agent review of #911. No defects — these are minor consistency/hardening nits intentionally split out of the PR rather than bundled.
Resolver/type boundary parity test. The window≤budget invariant is enforced in two places — resolve_cache (crates/common/src/config/mod.rs:1287, <=) and LeechCaps::new (crates/node/src/leech_governor.rs:118, >). LeechCaps::new has an initial == budget boundary test; the resolver does not. Add a resolver-level pull_ahead_bytes == max_unrecouped_leech_bytes test so the two enforcers can't silently diverge if one comparison is later changed.
Typed scale_saturating (optional).Percent::scale_saturating(self, bytes: u64) -> u64 (crates/config-types/src/percent.rs) drops back to raw u64. Consider (bytes: Bytes) -> Bytes to keep the scaled result typed — weigh against the governor's intentionally-u64 per-peer counters (PeerLeech.served/pulled).
WindowExceedsBudget payload typing. Its fields are raw u64 (crates/node/src/leech_governor.rs:51-52); Bytes would make the unit typing end-to-end through the error type.
Dead doc link.crates/config-types/src/percent.rs:9 links [\SHARE_RATIO_SCALE`]`, but that const is private — renders as a dead link in published docs. Drop the brackets or note it's internal.
Cross-crate doc reference.crates/config-types/src/bytes.rs:4-8 says "the same structs," but those structs live in the node crate, not config-types. Name the consumer (e.g. the node's LeechCapsConfig) for locatability.
Context: #911 introduced the Bytes/Percent transparent newtypes for the seed-leech cap knobs.
Post-review polish split out of PR #911, which introduced Bytes/Percent transparent newtypes for the seed-leech cap knobs. All five items are no-defect consistency/hardening nits: one missing boundary test, two raw-u64 fields that should be typed, and two inaccurate doc comments. No functional impact today.
📊 Assessment
Dimension
Value
Reasoning
Type
Task
Five discrete, bounded work items — no design discovery needed
Labels
enhancement, technical, rust, low
Consistent with sibling issues #894 and #910; polish nits with no user-visible impact
Coding agent
Suitable
Four of five items (test parity, WindowExceedsBudget field typing, two doc fixes) are fully mechanical. Item 2 (scale_saturating return type) is marked optional and carries a design note in the issue body — an agent can implement it if it judges the trade-off documented there acceptable, or skip it and leave a comment.
Resolver boundary test (crates/common/src/config/mod.rs ~L1287) — Add a resolve_cache test where pull_ahead_bytes == max_unrecouped_leech_bytes and assert it resolves OK (mirrors the initial == budget test already in LeechCaps::new). Low risk, copy-adapt the existing governor test.
WindowExceedsBudget fields (crates/node/src/leech_governor.rs:51-52) — Straightforward: change u64 → Bytes on the two error-struct fields and update any Display/Debug formatting that renders them.
Dead doc link (crates/config-types/src/percent.rs:9) — Replace [\SHARE_RATIO_SCALE`]` with either a plain backtick span or an explicit "internal constant" note. One-liner.
Cross-crate doc reference (crates/config-types/src/bytes.rs:4-8) — Replace the vague "the same structs" with the concrete name LeechCapsConfig (in crates/node/src/leech_governor.rs) so readers can grep for it.
Sequencing note: Items 3–5 are independent. Item 1 depends on nothing. Item 2 has a soft dependency on #910 and is marked optional — safe to defer or skip in the same PR.
kind:featureNew capability or a change to current behaviorprio:lowWhen convenientrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Activity
github-actions commentedon Jun 15, 2026
🎯 Triage report
Post-review polish split out of PR #911, which introduced
Bytes/Percenttransparent newtypes for the seed-leech cap knobs. All five items are no-defect consistency/hardening nits: one missing boundary test, two raw-u64fields that should be typed, and two inaccurate doc comments. No functional impact today.📊 Assessment
enhancement,technical,rust,lowWindowExceedsBudgetfield typing, two doc fixes) are fully mechanical. Item 2 (scale_saturatingreturn type) is marked optional and carries a design note in the issue body — an agent can implement it if it judges the trade-off documented there acceptable, or skip it and leave a comment.🔗 Similar issues
Bytes/Percentnewtype proposal and scoping rationaleBytesthrough leech-governor accumulators andclient.rswindow math (full-arithmetic variant); partially overlaps with item 2 of this issue💡 Notes and suggestions
Item-by-item breakdown:
Resolver boundary test (
crates/common/src/config/mod.rs~L1287) — Add aresolve_cachetest wherepull_ahead_bytes == max_unrecouped_leech_bytesand assert it resolves OK (mirrors theinitial == budgettest already inLeechCaps::new). Low risk, copy-adapt the existing governor test.Typed
scale_saturating(optional) — The trade-off is documented in the issue: governor accumulators (PeerLeech.served/pulled) are intentionallyu64, so aBytes → Bytesreturn would require.get()unwraps at the call sites inside the governor. If node: thread Bytes through leech-governor accumulators + client.rs window math (full-arithmetic newtype, follow-up to #894) #910 is resolved first (making those accumulatorsBytes), this item becomes clean; consider sequencing accordingly or skipping until node: thread Bytes through leech-governor accumulators + client.rs window math (full-arithmetic newtype, follow-up to #894) #910 lands.WindowExceedsBudgetfields (crates/node/src/leech_governor.rs:51-52) — Straightforward: changeu64→Byteson the two error-struct fields and update anyDisplay/Debugformatting that renders them.Dead doc link (
crates/config-types/src/percent.rs:9) — Replace[\SHARE_RATIO_SCALE`]` with either a plain backtick span or an explicit "internal constant" note. One-liner.Cross-crate doc reference (
crates/config-types/src/bytes.rs:4-8) — Replace the vague "the same structs" with the concrete nameLeechCapsConfig(incrates/node/src/leech_governor.rs) so readers can grep for it.Sequencing note: Items 3–5 are independent. Item 1 depends on nothing. Item 2 has a soft dependency on #910 and is marked optional — safe to defer or skip in the same PR.
Add this agentic workflows to your repo
To install this agentic workflow, run
test(common): cover Bytes/Percent TOML round-trip; hide LeechCaps::ne…
refactor(node): type-encode seed-leech cap units with Bytes/Percent n…
refactor(node): thread Bytes through leech-governor + window math (#910…