ADR-015: Fix fabricated llm-infra-* Cargo dependencies - #2
Merged
Conversation
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
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.
Implements the
benchmark-exchangeportion of ADR-015 (step 5 of its implementation plan).The problem
Cargo.toml:104-112declared nine dependencies asllm-infra-{core,config,logging,tracing,errors,cache,retry,ratelimit,client}atversion = "0.2"againstgithub.com/LLM-Dev-Ops/infra, cascading to 14workspace = truelines incrates/{common,api-rest,infrastructure,sdk}.None of them resolved. Verified against the real upstream:
infrapublishes flat, unprefixed crates (infra-config,infra-otel, …), neverllm-infra-*at any commit.infrais at 0.1.0, soversion = "0.2"is unsatisfiable.infrais not published to crates.io at all — it is git-only, with zero tags.core,logging,tracing, orclientcrate under any prefix.On
mainthis is a hard resolution failure, not just a warning:What changed
Nine fabricated names mapped onto the seven real crates, as git dependencies pinned to rev
a8bc89c(infra has no tags; this is currentorigin/main):llm-infra-configinfra-configllm-infra-errorsinfra-errorsllm-infra-cacheinfra-cachellm-infra-retryinfra-retryllm-infra-ratelimitinfra-rate-limitllm-infra-logginginfra-otel(collapsed — no logging crate exists)llm-infra-tracinginfra-otel(collapsed — no tracing crate exists)llm-infra-clientinfra-httpllm-infra-corellm-infra-clientmaps toinfra-httprather thaninfra-llm-client: the consuming code wants generic HTTP client abstractions with retry and circuit breaking (HttpClient,RetryConfig,CircuitBreakerConfig), whereasinfra-llm-clientis 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-retryexportsRetryPolicy/retry_with_policy/ExponentialBackoff, notRetryConfig/retry_with_backoff, socrates/common/src/lib.rsis remapped to the real items and the two redundantinfra_logging/infra_tracingfacades collapse into oneinfra_otel.crates/infrastructure/src/lib.rsdrops itsinfra::coremodule. 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:
Note on how to reproduce the compile checks below. On this branch as committed,
cargo check -p llm-benchmark-commonexits 101, with exactly one error —cannot find module or crate 'tracing'inllm-benchmark-domain, the unrelated pre-existing bug described in the next section.commonitself is never reached. To verify this PR's change you must first addtracing = { workspace = true }tocrates/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) andsdk— compile clean, forced to a genuine recompile rather than a cache hit:(Exit codes captured by redirect, not through a pipe, so no
tail/grepmasks cargo's status.)crates/infrastructure's infra facade also compiles — there are no errors in itslib.rsand none referencing anyinfra_*crate.Fabricated types, not just fabricated names
Worth calling out explicitly, because a pure
Cargo.tomlrename 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.The single named import is the one that mattered, and it was importing types that do not exist:
RetryConfigandretry_with_backoffare nowhere ininfra-retry(RetryConfigactually lives ininfra-errors). It is remapped to the realRetryPolicy/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 --workspacestill fails, but only in crates this PR does not touch and which have no infra dependency. These were masked onmainbecause 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.crates/domain/src/publication.rs:983callstracing::warn!butcrates/domain/Cargo.tomldeclares notracingdependency —error[E0433]: cannot find module or crate 'tracing'.crates/application—error[E0432]: unresolved import 'sha2'plus four missingserde::Serializeimpls onPublishBenchmarkRequest,ValidateBenchmarkRequest,UpdatePublicationRequest,TransitionStatusRequest.crates/infrastructure/src/external_consumers/ruvector.rs— 16 ×error[E0433]: cannot find module or crate 'reqwest';reqwestis not declared in that crate's manifest. Plus one never-type-fallback future-compat error in the localsrc/cache.rs:348.I confirmed (1) is genuinely independent by temporarily adding
tracingtocrates/domainlocally, which letdomaincompile 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.lockis gitignored in this repo, so none is committed and--lockedis not meaningful here.This branch is independent of PR #1 (ADR-0001, npm dependency separation); the two do not overlap.