Skip to content

Use git-pkgs modules for manifest and version handling #2

Description

@andrew

Yul currently carries ecosystem-specific manifest parsers and registry clients. PR #1 records the current behavior before replacing those pieces.

Use the modules rather than the git-pkgs/git-pkgs executable. The hook checks prospective before/after content, while the executable works from repository and lockfile state.

Proposed sequence:

  • Replace npm, requirements.txt, and pyproject.toml parsing with git-pkgs/manifests.
  • Use git-pkgs/vers to identify exact pins and compare versions using ecosystem rules.
  • Resolve latest versions through git-pkgs/enrichment, using enrichment.NewEcosystemsClient() explicitly. This avoids GIT_PKGS_DIRECT or global Git configuration changing hook behavior.
  • Read PackageInfo.LatestVersion rather than maintaining npm, PyPI, and Maven HTTP clients in Yul.
  • Keep Yul responsible for reconstructing edits, comparing before and after dependencies, failing open on lookup errors, formatting mismatches, and returning exit code 2.
  • Add an injectable resolver around enrichment calls so tests do not need real network requests.

Maven needs upstream work or a temporary exception. Yul currently checks parents, dependency management, plugins, plugin dependencies, extensions, and profile-scoped declarations. The git-pkgs/manifests Maven parser currently returns effective project dependencies, while git-pkgs/pom intentionally excludes plugin and build configuration. Keep the current Maven parser until those declaration types can be returned without losing behavior.

The migration should confirm that PackageInfo.LatestVersion preserves the expected npm, PyPI, and Maven latest-release values. Two related direct-backend gaps are tracked in git-pkgs/registries#49 and git-pkgs/enrichment#52.

Measure binary size and cold-start time because git-pkgs/manifests registers all parsers and git-pkgs/registries registers every registry through registries/all. The hook runs for every matching edit, so its client timeout must also remain shorter than the Claude Code hook timeout.

The migration is complete when the characterization tests from #1 still pass, no supported Maven coordinate type is lost, and npm, PyPI, and Maven use the shared module APIs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions