feat(tools): Packagist enrichment in get_dependency_blast_radius - #107
Open
manus-use wants to merge 1 commit into
Open
feat(tools): Packagist enrichment in get_dependency_blast_radius#107manus-use wants to merge 1 commit into
manus-use wants to merge 1 commit into
Conversation
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_packagisttoget_dependency_blast_radius.py, bringing PHP/Packagist package coverage to the blast-radius tool.What changed
src/manus_agent/tools/get_dependency_blast_radius.py_PACKAGIST_PKG_URL—https://packagist.org/packages/{name}.json_extract_packagist_latest_stable(versions)— filters out dev/branch aliases (names containingdev) and returns the highest stable version usingversion_normalizedfor correct sort ordering_extract_packagist_first_release(pkg)— prefers the top-leveltimefield (package first-indexed date); falls back to the oldesttimevalue across all version entries_enrich_packagist(name)— single API call pattern:downloads.total,downloads.monthly,downloads.daily— download statsweekly_downloads = monthly // 4— weekly proxy so_blast_scoreworks correctly (PHP packages have no weekly endpoint)dependent_packages_countfrompkg.dependents— Packagist tracks this nativelyfavers— Packagist star-equivalentlatest_version— latest stable (dev excluded)total_versions— total version countfirst_release_date+age_years— derived from packagetimefieldhome_pagefrompkg.repositorydescriptiontruncated to 120 charsZsuffix,+HH:MMoffset, naive TZ, sub-second fractions (any precision)datetime.now(timezone.utc)used instead of deprecatedutcnow()_enrich_packagedispatch: newelif eco_lower in ("packagist", "php", "composer")branchtests/test_dependency_blast_radius.py25 new tests across 4 new classes:
TestExtractPackagistLatestStableTestExtractPackagistFirstReleaseTestEnrichPackagistTestEnrichPackageDispatch(additions)Highlights:
test_weekly_downloads_is_monthly_divided_by_four— verifies the proxy formulatest_weekly_downloads_none_when_monthly_absent— graceful degradationtest_blast_score_critical_for_large_monthly_downloads— 20M monthly → weekly proxy 5M → CRITICALtest_blast_score_uses_dependent_packages_count— 60K dependents → CRITICALtest_full_output_contains_packagist_fields— end-to-end integration test for CLI output linesDesign decisions
/packages/{name}.jsonresponse. Thedownloadsblock includes total, monthly, and daily.dependentsandfaversare top-level fields.monthly // 4is a conservative approximation. This ensures_blast_scoreproduces meaningful labels (symfony/http-foundation has 16M monthly → 4M weekly → CRITICAL).2.0.x-devanddev-main. These are filtered by the presence ofdev(case-insensitive) before sorting byversion_normalized.timefield — the top-levelpackage.timeis Packagist's "when this package was first indexed" and reliably gives the earliest release date without scanning all version timestamps.Existing open PRs checked — confirmed no overlap
#51 (silent-patches), #53 (cve-timeline), #54 (version-range), #58 (vendor-response), #60 (poc-freshness), #64 (sbom-scan), #65 (temporal-priority), #67 (variant-cluster), #74 (epss-decay), #75 (exploit-maturity), #76 (vulnerability-triage-card), #77 (cve-report-generator), #78 (diff-report), #79 (reachability-scorer), #80 (epss-watchlist), #82 (attack-surface-scorer), #83 (watch-alert), #85 (cli-integration-tests), #86 (patch-lag-rating), #87 (kev-context-dimension), #88 (readme-scoring-workflow), #89 (core-tools-test-suite), #90 (exploit-search-tools-tests), #96 (maven-first-release-date), #97 (osv), #98 (pypi-first-release-date), #100 (npm-first-release-date), #103 (enrich-crates), #104 (enrich-rubygems), #105 (enrich-nuget), #106 (enrich-go) — none overlap with Packagist enrichment.
Test count delta
test_dependency_blast_radius.py