Skip to content

Tracking: move vex_consumed's per-ecosystem consumed-copy rules from the CLI into core #855

Description

[agent] Filed by the scheduled architecture audit routine (ecosystems and formats). Register: register comment.

Kind: tracking. Source: review Part 6.5 ("vex_consumed.rs is a third copy of package-manager layout knowledge"); register E40, plus new finding E62.

Problem

commands/vex_consumed.rs decides which installed copy a hosted build consumes. The review measured it at 596 lines; on 4646693 it is 1,173. It is the only place this layout knowledge lives, and it lives in the CLI, beside crawlers in core that know the same layouts:

Target design

HostedCopies already lives in core (vex/verify.rs#L98). Each crawler gains a consumed_copies(options, purl, wiring) that applies its ecosystem's rule and reuses that ecosystem's own grammar (the cargo source parser, formats::maven's suffix grammar, go_mod_edit). The CLI's hosted_consumed_copies becomes a dispatch over those, or moves whole into core::vex. Every grammar listed above is then defined once.

Children (in order, one PR each)

  • 1. Resolve VEX npm alias copies through the core resolver and delete the CLI alias walk (filed as a sub-issue).
  • 2. Move the cargo consumed-copy rule into CargoCrawler, with one Cargo.lock registry-source parser shared with vex/discover/cargo.rs.
  • 3. One <base>-socket.<hex8> builder and parser in formats::maven, used by jvm::Coords, maven_reactor and the maven consumed-copy rule, which then moves into MavenCrawler.
  • 4. Move the Go replacement lookup next to go_mod_edit (coordinate with Read the go.mod module directive through go_mod_edit and delete the crawler's unused parse_go_mod_module #781, which moves the go.mod module reader).
  • 5. Move hosted_consumed_copies into core::vex. vex_consumed.rs is then deleted.

Size and scope

Five PRs of 100–300 production lines each, every one deleting the CLI copy it replaces. Out of scope: changing which copies count as evidence (that is decision E46).

Acceptance criteria

  • vex_consumed.rs no longer exists, and the CLI holds no package-manager layout rules.
  • Every commands::vex_consumed test is ported to core and stays green, along with vex e2e and the hosted VEX goldens.

Dependencies

Child 1 should land after #851, which edits the same tests. Coordinate child 3 with #715, and child 4 with #781.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:triagedarch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)priority:p3refactorStructural change: duplicated code or logic, missing abstraction, layering, dead code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions