Skip to content

Move the v5 JVM vendor orchestration and Maven acquisition out of maven_repo.rs into vendor/jvm #972

Description

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

Kind: refactor (mechanical move). Source: review Part 5.7; register E26. Child 1 of #971.

Problem

vendor/maven_repo.rs is named for, and documented as, the legacy single-pom backend. Its production half (L1–L2204 on 9c43dfc) also holds the whole v5 JVM orchestrator and the Maven download layer:

About 1,170 of the ~2,200 production lines are JVM code. As a result:

  • redownload.rs reaches into maven_repo::{not_build_root, acquire_jvm_metadata, acquire_jvm_artifact, write_maven_artifact, LocalSources};
  • agent-mode patch/jvm_jar.rs imports vendor::maven_repo::{maven_registry_base, fetch_registry_bytes};
  • vex/discover/maven.rs imports sha1_sidecar_matches.

No reader can tell which half a change touches, and retiring the legacy backend (#971) can't be a file deletion.

Proposed change

A move only, with no behavior change:

  • vendor/jvm/vendor.rs gets the orchestrator: jvm_shape, legacy_mixed_root, not_build_root, LocalSources, jvm_committed_patch, vendor_maven_jvm, acquire_classifier, verify_unpatched_jar_members, verify_jvm_upstream, collect_*.
  • vendor/jvm/fetch.rs gets the Maven download layer both backends use: maven_registry_base, MAVEN_USER_AGENT, MAX_POM_BYTES, fetch_registry_bytes, fetch_pom_bytes, acquire_upstream_pom, acquire_jvm_artifact, acquire_jvm_metadata, materialise_and_write, write_maven_artifact, artifact_in_sync, sidecar_matches, sha1_sidecar_matches.
  • maven_repo.rs keeps the vendor_maven router, the legacy single-pom forward path, maven_entry, revert_maven_opts and the pom <repository> editing.
  • Callers (redownload.rs, patch/jvm_jar.rs, vex/discover/maven.rs, test_support.rs) import from the new paths. Leave no re-export shims.
  • Move each function's inline tests with it.

Size and scope

Acceptance criteria

  • git diff --stat shows a move: no logic edits beyond paths and visibility (pub(super) → pub(crate) where a sibling module now needs it).
  • maven_repo.rs production code holds no super::jvm:: call except the router's dispatch and revert_maven_opts' is_jvm_entry arm.
  • cargo test -p socket-patch-core vendor:: and the Maven/Gradle CLI e2e suites (e2e_vendor_maven*, e2e_vendor_gradle*) stay green unchanged.
  • cargo clippy --workspace --all-features -- -D warnings is clean.

Dependencies

Land after #876, which edits fetch_registry_bytes in this file. Unblocks #971 children 3–4.

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)pm:mavenMavenpriority: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