Skip to content

ADR-015: Fix fabricated llm-infra-* Cargo dependencies - #2

Merged
nicholas-ruest merged 1 commit into
mainfrom
adr-015/fix-package-naming
Jul 27, 2026
Merged

ADR-015: Fix fabricated llm-infra-* Cargo dependencies#2
nicholas-ruest merged 1 commit into
mainfrom
adr-015/fix-package-naming

Conversation

@nicholas-ruest

@nicholas-ruest nicholas-ruest commented Jul 27, 2026

Copy link
Copy Markdown
Member

Implements the benchmark-exchange portion of ADR-015 (step 5 of its implementation plan).

The problem

Cargo.toml:104-112 declared nine dependencies as llm-infra-{core,config,logging,tracing,errors,cache,retry,ratelimit,client} at version = "0.2" against github.com/LLM-Dev-Ops/infra, cascading to 14 workspace = true lines in crates/{common,api-rest,infrastructure,sdk}.

None of them resolved. Verified against the real upstream:

  • infra publishes flat, unprefixed crates (infra-config, infra-otel, …), never llm-infra-* at any commit.
  • infra is at 0.1.0, so version = "0.2" is unsatisfiable.
  • infra is not published to crates.io at all — it is git-only, with zero tags.
  • There is no core, logging, tracing, or client crate under any prefix.

On main this is a hard resolution failure, not just a warning:

$ cargo metadata --format-version 1
    Updating crates.io index
    Updating git repository `https://github.com/LLM-Dev-Ops/infra`
error: no matching package named `llm-infra-config` found
location searched: Git repository https://github.com/LLM-Dev-Ops/infra
required by package `llm-benchmark-common v0.1.0 (.../crates/common)`

What changed

Nine fabricated names mapped onto the seven real crates, as git dependencies pinned to rev a8bc89c (infra has no tags; this is current origin/main):

Declared Real crate
llm-infra-config infra-config
llm-infra-errors infra-errors
llm-infra-cache infra-cache
llm-infra-retry infra-retry
llm-infra-ratelimit infra-rate-limit
llm-infra-logging infra-otel (collapsed — no logging crate exists)
llm-infra-tracing infra-otel (collapsed — no tracing crate exists)
llm-infra-client infra-http
llm-infra-core dropped — infra has no aggregator crate

llm-infra-client maps to infra-http rather than infra-llm-client: the consuming code wants generic HTTP client abstractions with retry and circuit breaking (HttpClient, RetryConfig, CircuitBreakerConfig), whereas infra-llm-client is an LLM provider adapter this repo does not use.

The declared feature sets were fabricated too"full", "redis", "in-memory", "exponential", "circuit-breaker", "sliding-window", "grpc", "opentelemetry" exist on none of the real crates. They are dropped in favour of defaults.

The facade re-exports named an equally invented API. infra-retry exports RetryPolicy / retry_with_policy / ExponentialBackoff, not RetryConfig / retry_with_backoff, so crates/common/src/lib.rs is remapped to the real items and the two redundant infra_logging / infra_tracing facades collapse into one infra_otel. crates/infrastructure/src/lib.rs drops its infra::core module. Confirmed by grep that no call site outside these two files consumed any of these facades, so nothing else needed touching.

Verification (real output)

Resolution now succeeds, and all seven crates come from the pinned rev:

$ cargo metadata --format-version 1   # METADATA_EXIT=0
  infra-cache      0.1.0  <- git+https://github.com/LLM-Dev-Ops/infra?rev=a8bc89c190f63b139812f30a54e21a25b8f70e81
  infra-config     0.1.0  <- git+https://github.com/LLM-Dev-Ops/infra?rev=a8bc89c190f63b139812f30a54e21a25b8f70e81
  infra-errors     0.1.0  <- git+https://github.com/LLM-Dev-Ops/infra?rev=a8bc89c190f63b139812f30a54e21a25b8f70e81
  infra-http       0.1.0  <- git+https://github.com/LLM-Dev-Ops/infra?rev=a8bc89c190f63b139812f30a54e21a25b8f70e81
  infra-otel       0.1.0  <- git+https://github.com/LLM-Dev-Ops/infra?rev=a8bc89c190f63b139812f30a54e21a25b8f70e81
  infra-rate-limit 0.1.0  <- git+https://github.com/LLM-Dev-Ops/infra?rev=a8bc89c190f63b139812f30a54e21a25b8f70e81
  infra-retry      0.1.0  <- git+https://github.com/LLM-Dev-Ops/infra?rev=a8bc89c190f63b139812f30a54e21a25b8f70e81

Note on how to reproduce the compile checks below. On this branch as committed, cargo check -p llm-benchmark-common exits 101, with exactly one error — cannot find module or crate 'tracing' in llm-benchmark-domain, the unrelated pre-existing bug described in the next section. common itself is never reached. To verify this PR's change you must first add tracing = { workspace = true } to crates/domain/Cargo.toml. I did that locally, ran the checks below, then reverted it; that patch is not part of this commit.

With only that one-line unrelated fix applied, the two crates carrying the riskiest part of this change — common (the remapped retry facade) and sdk — compile clean, forced to a genuine recompile rather than a cache hit:

$ cargo check -p llm-benchmark-common > log 2>&1; echo $?
    Checking llm-benchmark-common v0.1.0 (.../crates/common)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.71s
0

$ cargo check -p llm-benchmark-sdk > log 2>&1; echo $?
    Checking llm-benchmark-sdk v0.1.0 (.../crates/sdk)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.75s
0

(Exit codes captured by redirect, not through a pipe, so no tail/grep masks cargo's status.)

crates/infrastructure's infra facade also compiles — there are no errors in its lib.rs and none referencing any infra_* crate.

Fabricated types, not just fabricated names

Worth calling out explicitly, because a pure Cargo.toml rename would only have moved this failure from "crate not found" to "type not found": every remaining reference to an infra crate in this repo is confined to the two facade files, and all but one are glob re-exports, which compile vacuously whether or not the underlying crate has anything useful in it.

$ grep -rn "use infra_[a-z_]*::" --include=*.rs crates/
crates/infrastructure/src/lib.rs:70:        pub use infra_cache::*;
crates/infrastructure/src/lib.rs:80:        pub use infra_rate_limit::*;
crates/infrastructure/src/lib.rs:90:        pub use infra_http::*;
crates/common/src/lib.rs:87:    pub use infra_retry::{     <- the only named import
crates/common/src/lib.rs:105:    pub use infra_otel::*;

The single named import is the one that mattered, and it was importing types that do not exist: RetryConfig and retry_with_backoff are nowhere in infra-retry (RetryConfig actually lives in infra-errors). It is remapped to the real RetryPolicy / retry_with_policy / ExponentialBackoff, and the fresh compile above is what proves those resolve. No other call site in the repo reads through these facades, so no further rewrites were needed.

Not fixed here — pre-existing, unrelated build failures

cargo build --workspace still fails, but only in crates this PR does not touch and which have no infra dependency. These were masked on main because the workspace never got past dependency resolution; fixing the names surfaced them. ADR-015's Verification §4 anticipates exactly this and gates these fixes on resolution rather than full compilation.

  1. crates/domain/src/publication.rs:983 calls tracing::warn! but crates/domain/Cargo.toml declares no tracing dependency — error[E0433]: cannot find module or crate 'tracing'.
  2. crates/applicationerror[E0432]: unresolved import 'sha2' plus four missing serde::Serialize impls on PublishBenchmarkRequest, ValidateBenchmarkRequest, UpdatePublicationRequest, TransitionStatusRequest.
  3. crates/infrastructure/src/external_consumers/ruvector.rs — 16 × error[E0433]: cannot find module or crate 'reqwest'; reqwest is not declared in that crate's manifest. Plus one never-type-fallback future-compat error in the local src/cache.rs:348.

I confirmed (1) is genuinely independent by temporarily adding tracing to crates/domain locally, which let domain compile and surfaced (2) and (3) behind it; that temporary patch was reverted and is not part of this commit. Each of these is a separate missing-dependency defect that deserves its own scoped PR rather than being bundled into an ADR-015 naming change — flagging for a decision on who picks them up.

Cargo.lock is gitignored in this repo, so none is committed and --locked is not meaningful here.

This branch is independent of PR #1 (ADR-0001, npm dependency separation); the two do not overlap.

The workspace declared llm-infra-{core,config,logging,tracing,errors,cache,
retry,ratelimit,client} at version = "0.2" against github.com/LLM-Dev-Ops/infra.
None of these resolved: infra publishes flat, unprefixed crates at 0.1.0, is
not on crates.io at all, and has never had core/logging/tracing/client crates
under any prefix. `cargo metadata` on main fails with "no matching package
named `llm-infra-config` found".

Map the nine fabricated names onto the seven real crates, as git dependencies
pinned to rev a8bc89c (infra has no tags):

  llm-infra-config    -> infra-config
  llm-infra-errors    -> infra-errors
  llm-infra-cache     -> infra-cache
  llm-infra-retry     -> infra-retry
  llm-infra-ratelimit -> infra-rate-limit
  llm-infra-logging   -> infra-otel   (collapsed; infra has no logging crate)
  llm-infra-tracing   -> infra-otel   (collapsed; infra has no tracing crate)
  llm-infra-client    -> infra-http
  llm-infra-core      -> dropped      (infra has no aggregator crate)

The declared feature sets were fabricated too ("full", "redis", "in-memory",
"exponential", "circuit-breaker", "sliding-window", "grpc"); none exist on the
real crates, so they are dropped in favour of defaults.

The facade re-exports in common/src/lib.rs and infrastructure/src/lib.rs named
an equally invented API. infra-retry exports RetryPolicy and retry_with_policy,
not RetryConfig and retry_with_backoff, so the compatibility layer is remapped
to the real items. No call site outside these two files consumed the facades.

Implements the benchmark-exchange portion of
agentics-enforcement/plans/adr/ADR-015
@nicholas-ruest
nicholas-ruest merged commit 0923674 into main Jul 27, 2026
0 of 6 checks passed
@nicholas-ruest
nicholas-ruest deleted the adr-015/fix-package-naming branch July 27, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant