Skip to content

ADR-015: Fix fabricated infra-* module names (dormant dependency) - #1

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

ADR-015: Fix fabricated infra-* module names (dormant dependency)#1
nicholas-ruest merged 1 commit into
mainfrom
adr-015/fix-package-naming

Conversation

@nicholas-ruest

Copy link
Copy Markdown
Member

Implements the research-lab portion (step 8) of agentics-enforcement/plans/adr/ADR-015Platform Package Naming Authority and Dependency Name Resolution.

The bug

llm-research-api/Cargo.toml:32-40, llm-research-cli:43-45, and llm-research-sdk:43-45 declared nine infra-* crates via .workspace = true.

Unusually for this bug class, the prefix was correct — the infra repo genuinely publishes unprefixed infra-* crates, so no llm- prefix belongs here. The problem was purely ADR-015's Axis B, fabricated module surface: seven of the nine modules do not exist under any prefix. infra has 19 crates and no aggregator, no logging, no tracing, no metrics, no resilience, no health, and spells errors infra-errors.

Compounding it, none of the nine were declared in the root [workspace.dependencies], so .workspace = true had nothing to inherit from.

Why it was dormant

The three crate directories are not listed in the root Cargo.toml members array (which contains only llm-research-lab, llm-research-core, llm-research-agents). Nothing builds them, so nothing surfaced the error. Verified:

$ cargo metadata --no-deps --format-version 1 | jq -c '[.packages[].name]'
["llm-research-lab","llm-research-agents","llm-research-core"]

This is a latent trap, not a live outage — it becomes a hard failure the moment anyone adds these to workspace.members.

The mapping

Declared Real crate Rationale
infra-core dropped infra has no aggregator crate
infra-config infra-config already correct
infra-logging infra-otel
infra-tracing infra-otel infra-otel covers all three (init.rs, span.rs, metrics.rs)
infra-metrics infra-otel
infra-cache infra-cache already correct
infra-resilience infra-retry + infra-rate-limit per ADR-015 step 7
infra-health dropped no equivalent; observability/health.rs stays local
infra-error infra-errors

Changes

  • Cargo.toml — added the six surviving crates to [workspace.dependencies] as git deps pinned to rev a8bc89c190f63b139812f30a54e21a25b8f70e81 on LLM-Dev-Ops/infra. Per ADR-015 decision 4, a pinned rev is required: infra has zero git tags and is not on crates.io, so neither a tag nor a registry form would resolve.
  • llm-research-{api,cli,sdk}/Cargo.toml — the 16 declarations corrected to the real names.
  • llm-research-api/src/lib.rs:30-40 — the pub mod infra re-export block aliased the same seven fabricated crates (pub use infra_core as core; …). Corrected to match; otherwise the manifest fix alone would still fail to compile.
  • PHASE_2B_INFRA_INTEGRATION.md — prepended a correction notice. This document is where the invented surface came from: it describes all nine modules with feature flags as though they shipped, and also claims npm @llm-dev-ops/infra-{logging,tracing,metrics,…} packages that ADR-015 confirms do not exist (the real package is a single @llm-dev-ops/infra with subpath exports). Left uncorrected it would seed the same fabrication again.

Verification — real output

The crates are not workspace members, so they cannot be built in place:

$ cargo metadata --format-version 1 --manifest-path llm-research-sdk/Cargo.toml
error: current package believes it's in a workspace when it's not:
current:   /workspace/agentics-dev/research-lab/llm-research-sdk/Cargo.toml
workspace: /workspace/agentics-dev/research-lab/Cargo.toml

So verification was done two other ways.

1. The pinned rev genuinely resolves all six names. A throwaway crate outside the repo depending on exactly the six declarations added here:

$ cargo metadata --format-version 1
    Updating git repository `https://github.com/LLM-Dev-Ops/infra`
    Updating crates.io index
     Locking 122 packages to latest compatible versions
exit=0

infra-cache      0.1.0  git+https://github.com/LLM-Dev-Ops/infra?rev=a8bc89c…
infra-config     0.1.0  git+https://github.com/LLM-Dev-Ops/infra?rev=a8bc89c…
infra-errors     0.1.0  git+https://github.com/LLM-Dev-Ops/infra?rev=a8bc89c…
infra-otel       0.1.0  git+https://github.com/LLM-Dev-Ops/infra?rev=a8bc89c…
infra-rate-limit 0.1.0  git+https://github.com/LLM-Dev-Ops/infra?rev=a8bc89c…
infra-retry      0.1.0  git+https://github.com/LLM-Dev-Ops/infra?rev=a8bc89c…

All six resolve at the pinned rev. a8bc89c is confirmed present on origin/main, so the pin is fetchable from CI, not just locally.

2. ADR-015's workspace = true rule now passes for every infra-* key. Applying the check ("assert the key exists in the root manifest's [workspace.dependencies]"):

llm-research-api: infra-* declared = ['infra-config','infra-otel','infra-cache','infra-retry','infra-rate-limit','infra-errors']
  unresolved workspace=true keys (8): ['llm-research-storage','llm-research-metrics','llm-research-workflow','jsonwebtoken','sqlx','aws-sdk-s3','aws-config','clickhouse']
llm-research-cli: infra-* declared = ['infra-config','infra-otel']
  unresolved workspace=true keys (10): ['llm-research-sdk','clap','dialoguer','indicatif','console','comfy-table','colored','directories','config','keyring']
llm-research-sdk: infra-* declared = ['infra-retry','infra-rate-limit','infra-errors']
  unresolved workspace=true keys (0): []

Zero infra-* entries remain unresolved. Root cargo metadata --no-deps still exits 0 with members unchanged — no regression to the crates that do build.

Left undone (deliberately)

  • These three directories are still not workspace members. ADR-015 step 8 says to decide explicitly rather than leave this dormant. This PR takes the "declare the real crates" branch rather than the "delete the directories" branch — the code is substantial and live-looking, and deleting it is a product call, not a naming fix. But note the fix is still dormant after this PR: correct now, and unblocked if someone adds them, but not yet exercised by any build.
  • The unresolved non-infra keys above are pre-existing and out of scope. Note that llm-research-{api,cli} cannot become workspace members until those 8 and 10 keys are also added to [workspace.dependencies] — that is the real remaining blocker, and it is a separate change. llm-research-sdk is the one crate with nothing left unresolved.
  • No source was migrated onto the infra APIs. llm-research-api still uses its local observability/, performance/, and resilience/ modules; only the re-export aliases were corrected. Whether infra-otel is a drop-in for the three local observability modules is unverified — it was never compiled against.
  • PHASE_2B_INFRA_INTEGRATION.md body was not rewritten, only annotated. Its per-file tables and code snippets still show the fabricated API.

llm-research-{api,cli,sdk} declared nine `infra-*` dependencies via
`.workspace = true`. The prefix was correct -- the infra repo really does
publish unprefixed `infra-*` crates -- but seven of the nine modules do not
exist under any prefix, and none of the nine were present in the root
`[workspace.dependencies]`, so the `.workspace = true` inheritance had
nothing to resolve against.

Mapped each fabricated name to its real equivalent:

  infra-core        -> dropped (infra has no aggregator crate)
  infra-config      -> infra-config (already correct)
  infra-logging     -> infra-otel
  infra-tracing     -> infra-otel
  infra-metrics     -> infra-otel
  infra-cache       -> infra-cache (already correct)
  infra-resilience  -> infra-retry + infra-rate-limit
  infra-health      -> dropped (no equivalent; health checks stay local)
  infra-error       -> infra-errors

Added the six surviving crates to the root `[workspace.dependencies]` as git
dependencies pinned to rev a8bc89c on LLM-Dev-Ops/infra. The infra repo has
no git tags and nothing published to crates.io, so a pinned rev is the only
resolvable source.

Also corrected the matching re-export block in llm-research-api/src/lib.rs,
which aliased the same seven fabricated crate names, and prepended a
correction notice to PHASE_2B_INFRA_INTEGRATION.md, the document that
described the invented module surface as though it shipped.

This failure was dormant: the three crate directories are not workspace
members, so nothing built them and nothing surfaced the error. It would have
become a hard build failure the moment any of them were added to
`workspace.members`.

Implements the research-lab portion of agentics-enforcement/plans/adr/ADR-015
@nicholas-ruest
nicholas-ruest merged commit 7e0ec19 into main Jul 27, 2026
1 of 7 checks passed
@nicholas-ruest
nicholas-ruest deleted the adr-015/fix-package-naming branch July 27, 2026 20:26
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