feat(tools): RubyGems enrichment in get_dependency_blast_radius - #104
Open
manus-use wants to merge 1 commit into
Open
feat(tools): RubyGems enrichment in get_dependency_blast_radius#104manus-use wants to merge 1 commit into
manus-use wants to merge 1 commit into
Conversation
This was referenced Jul 7, 2026
This was referenced Jul 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
_enrich_rubygems(name)toget_dependency_blast_radius.py, completing the ecosystem-enrichment trilogy extension: npm ✓ PyPI ✓ Maven ✓ crates.io (PR #103) ✓ RubyGems ✓.Ruby packages are a significant attack surface —
rack,nokogiri,rails,devise, andbundlereach have hundreds of millions of downloads. This PR surfaces that exposure clearly in blast-radius output.What changed
src/manus_agent/tools/get_dependency_blast_radius.pyNew constants:
_RUBYGEMS_GEM_URL = "https://rubygems.org/api/v1/gems/{}.json"— gem metadata_RUBYGEMS_VERSIONS_URL = "https://rubygems.org/api/v1/versions/{}.json"— version historyNew helper
_extract_rubygems_first_release(versions):number+created_atISO 8601){first_version, first_release_date, age_years}Zsuffix,+00:00offset, no sub-second{}(graceful)New enricher
_enrich_rubygems(name):/api/v1/gems/{name}.json→total_downloads,recent_downloads(current-version DLs),latest_version,description(truncated to 120 chars),home_page/api/v1/versions/{name}.json→ first-release metadata (isolated try/except; failure does not prevent metadata from being returned)User-Agentheader required (RubyGems public API)_enrich_packagedispatch:rubygems/ruby/gemecosystem strings to_enrich_rubygems_blast_scoreupdate:weekly_proxy = total_downloads / max(age_years * 52, 1)so gems still get a meaningful blast labelOutput rendering:
RubyGems-specific block: Latest version, All-time DLs, Current ver DLs, First released (YYYY-MM-DD, N yrs old, first version), DescriptionDocstring:
tests/test_dependency_blast_radius.py+20 tests across 5 new classes (94 passing in module, 1178 suite-wide):
TestExtractRubygemsFirstReleasecreated_atTestEnrichRubygemsTestEnrichPackageDispatchRubyGemsrubygems,ruby,gemecosystem strings all route correctlyTestBlastScoreRubyGemsFallbackTestBlastRadiusRubyGemsOutputrubygems:rack@2.2.6produces output with All-time DLs, First released, RubyGems labelDesign decisions
weekly_downloads = Noneis set explicitly in the primary result so that the existing npm/PyPI weekly-download output block does NOT render for RubyGems packages (they get their own block instead)import datetimeadded at module level (consistent with how PR feat: add crates.io enrichment to get_dependency_blast_radius #103 handles it in crates.io branch)first_release_dateabsent; gem call failure returns minimal{ecosystem, package_name}dictChecked against existing open PRs — no overlap
Verified no duplicate coverage against all open PRs:
#51, #53, #54, #58, #60, #64, #65, #67, #74, #75, #76, #77, #78, #79, #80, #82, #83, #85, #86, #87, #88, #89, #90, #92, #93, #94, #95, #96, #97, #98, #100, #103
None of these add RubyGems enrichment to
get_dependency_blast_radius.Testing