Repository navigation
chore: sweep dead code and small defects across core, config, typeshed, testkit, workspace - #139
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (12)
💤 Files with no reviewable changes (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe PR removes unused public APIs, simplifies parser and package metadata code, limits async JSON-RPC headers to 16 MiB, and recovers workspace caches from poisoned mutexes. It also centralizes capped decompression and updates the changelog. ChangesConfiguration cleanup
Parser and type API cleanup
Async JSON-RPC limits
Workspace resilience
Typeshed and package metadata
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to This PR removes unused internal code and narrows APIs while adding bounded async decoding and poisoned-cache recovery; the reported checks pass, and no actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 47.73% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 44 functions across 7 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — all 13 files of this cleanup sweep, with every deletion and visibility demotion grepped workspace-wide and both behavioral changes traced, built, and tested locally.
- ry-core:
RType::with_membersdeleted (zero references repo-wide,fuzz/andeditors/included);RParser::spandrops its unused_srcparameter across all call sites;byte_col_to_char_colrewritten as a semantically identicaltake_while().count(). - ry-config: dead
config_hashremoved (serde_jsoncorrectly retained —baseline.rsstill uses it);DEFAULT_MAX_SERIALIZED_BYTESand the threeDEFAULT_INDEX_*constants privatized;InvalidIndexmessage interior spaces fixed (nothing pinned the old string); thecollapsible_ifallow is gone with the one masked nest collapsed;diagnostic_pathborrows the caller's&Pathwith unchanged semantics. - ry-typeshed:
BAYES_JSONandFunctionSigWithKeydeleted (zero consumers); the 34*_JSONembeds privatized whileSOURCEcorrectly stayspub(ry-clireads it, main.rs:1124);load_package'sis_known_packagegate is semantically identical to the oldfind(...)?;discover_stub_files/load_stub_filedemoted to private — the CLI's validator goes throughvalidate_stub_dirs(main.rs:1164), so the old "public so tools use it" doc was indeed stale. - ry-testkit:
child_iddeleted;decode_asyncnow enforces the same 16 MiB header cap asdecode_blocking. The cap arithmetic checks out (per-linetake(remaining + 1),header_bytes <= MAXinvariant prevents underflow, exactly-at-cap headers still pass, and the body remains bounded by the sharedchecked_length). Both new tests are meaningful — without the fix, the reject test would surfaceUnexpectedEofrather thanInvalidData. - ry-workspace: poisoned-mutex recovery on both
serialized_inventorylock sites (the cache guards no invariant, sointo_inner()is sound); the three bzip2/gzip/xz arms collapse intoCompression+decode_cappedwith byte-identical behavior (same magic bytes, sameread_cap, samedegraded/emptymapping); theSourceBindingsdoc paragraph moved to its real owner;is_file_eligible_with_excludesprivatized; the S3method generic is bound once with the necessary clones. - Verification run locally:
cargo check --workspace --all-targetsclean (proves no cross-crate breakage from the demotions), 175 tests across the five crates with 0 failures including the two new async decoder tests,cargo clippy --all-targets -- -D warningsclean on all five,cargo fmt --checkclean. The public-API reductions carry no semver exposure:ry-testkitandry-workspacearepublish = false, and the rest land inside the unreleased 0.9.0.
openai-compatible/glm-5.3 | 𝕏
…dead-code # Conflicts: # CHANGELOG.md

Summary
Sweeps dead code and small defects across five crates. Every deletion was grepped across the whole workspace first. Only two changes alter behavior: the poisoned-cache recovery and the async decoder cap. Both have changelog entries. The rest is internal cleanup.
Changes
ry-core
RType::with_members. Zero callers anywhere._srcparameter fromRParser::spanand its 36 call sites.byte_col_to_char_colwithchar_indices().take_while(...).count(). The old loop carried alet _ = ch;wart.ry-config
config_hash. Zero callers.serde_jsonstays a dependency:baseline.rsuses it.DEFAULT_MAX_SERIALIZED_BYTESand the threeDEFAULT_INDEX_*constants private. They are only used in-crate.InvalidIndexerror message.#![allow(clippy::collapsible_if)]and collapse the two nestedifs it was masking.diagnostic_pathnow borrows the caller's&Pathinstead of allocating aPathBufjust tostrip_prefix.ry-typeshed
BAYES_JSON(deprecated alias) andFunctionSigWithKey. Zero consumers.*_JSONembeds private.SOURCEstays public:ry-clireads it.load_package: an explicitis_known_packagecheck, then the map build, then the lookup. The oldlet _ = PACKAGE_SPECS.iter().find(...)?was a find used only to early-return.load_base().expect()callers.discover_stub_filesandload_stub_fileto private. Their docs claimed external tools use them; the CLI goes throughvalidate_stub_dirsinstead. Docs now state what they do.ry-testkit
JsonRpcProcess::child_id. Zero callers.publication_markdoc comment. It was pasted twice.decode_asyncnow enforcesMAX_MESSAGE_BYTESon headers, mirroringdecode_blocking. Two new tests cover the oversized-header rejection and the happy path. This required a test-only tokiort/macrosdev-dependency.ry-workspace
serialized_inventoryrecovers from a poisoned mutex viaunwrap_or_else(|poisoned| poisoned.into_inner()). A panic elsewhere no longer cascade-panics the LSP. The cache guards no invariant, so recovery is safe.decode_cappedand aCompressiontag. The three near-identical bzip2/gzip/xz arms collapse into one match.SourceBindingsdoc paragraph ontosource_package_dynamic_bindings, which lacked a doc. The orphaned summary sentence stays with the struct.is_file_eligible_with_excludesto private. Only in-crate callers exist; external code usesis_file_eligible.args.first().and_then(static_name)twice.CHANGELOG
Two
### Fixedentries under## [Unreleased]: the poisoned-cache recovery and the async decoder cap.Verification
cargo fmt --check -p ry-core -p ry-config -p ry-typeshed -p ry-testkit -p ry-workspace— clean.cargo clippy -p <crate> --all-targets -- -D warningsfor all five crates — no warnings.cargo test -p <crate>for all five crates — 92, 31, 25, 17, and 10 tests pass, 0 failures.cargo check --workspace— clean.cargo check -p ry-cli -p ry-lsp— clean, proving no cross-crate breakage.Summary by CodeRabbit
Bug Fixes
Refactoring