fix(reliability): clamp max_concurrent to Semaphore::MAX_PERMITS; add ReliabilityConfig::disabled() (LAB-729) - #50
fix(reliability): clamp max_concurrent to Semaphore::MAX_PERMITS; add ReliabilityConfig::disabled() (LAB-729)#5027Bslash6 wants to merge 2 commits into
Conversation
… ReliabilityConfig::disabled() (LAB-729) Expert-panel follow-up on the merged #49 (panel run 2026-07-28, Ray-requested): - MAJ (bug-hunter, verified live): tokio's Semaphore::new panics above MAX_PERMITS (usize::MAX >> 3), and usize::MAX is the natural 'effectively unbounded' sentinel a caller will pass — a public config value must never panic CacheKitBuilder::build(). Clamp to [1, MAX_PERMITS], document on the field, pin with a unit test. - MIN (craftsman): the builder's wrap-or-skip gate hand-enumerated every layer's is_some() and shipped a missed-layer bug once inside #49 already; the check now lives on ReliabilityConfig::is_disabled(), next to the fields, so a future layer can't silently miss the gate. - MIN (craftsman): the documented opt-out was a full struct literal that breaks downstream every time the stack gains a layer (twice now) — ReliabilityConfig::disabled() replaces it in README, rustdoc, and the preset docs.
…sabled() (LAB-729)
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 41 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Applies the surviving findings from the formal expert-panel review of the merged #49 (LAB-729), run 2026-07-28 at high stakes on Ray's request (panel: bug-hunter-supreme, security-specialist, code-craftsman, catchphrase-agent).
Panel verdict on #49: FIX-FIRST → this PR
Semaphore::new(max_concurrent.max(1))panics whenmax_concurrent > tokio::sync::Semaphore::MAX_PERMITS(usize::MAX >> 3).usize::MAXis the natural "effectively unbounded" sentinel a user of this public config will reach for, and it crashed insideCacheKitBuilder::build()with tokio's internal panic. Now clamped to[1, MAX_PERMITS], documented on the field next to the existing "0 behaves as 1" note, pinned bylimiter_clamps_huge_max_concurrent_instead_of_panicking.is_some()— the exact shape that shipped a missed-layer bug once already inside feat(reliability): backpressure — bound backend-op concurrency (LAB-729) #49's own history. The check now lives onReliabilityConfig::is_disabled(), beside the fields, so a future fourth layer cannot silently miss the gate.ReliabilityConfig::disabled()replaces it in the README, builder rustdoc, and preset docs (doctest-covered).Rejected, with reason
macro_tests.rs/reliability_tests.rs. Rejected — the "fix" is a closure-parameterized generic helper intests/common, which costs more machinery than the eight duplicated test-scaffold lines it removes; the catchphrase reviewer's own pass reached the same conclusion for the sibling test fixtures. Revisit if a third copy appears.Clean passes
securepath still fails closed on a shed (empty fail-open arm at both macro splice sites), shed messages carry no secrets (CWE-532), and the in-process limiter crosses no trust boundary.Gates: fmt, clippy
-D warnings, 244 tests + 8 doc-tests, 0 failures.This PR contains only the panel's own prescriptions; the panel report on LAB-729 covers it.