Skip to content

AGENTS.md's dependency-edge list disagrees with cargo metadata on nine crates #595

Description

@justin13888

AGENTS.md's "Dependency edges (a crate depends on those to its right)" list is the repository's
own map of the workspace graph, and CLAUDE.md is a symlink to it, so it is the first thing both
a contributor and a tool read. Nine of its edges no longer match cargo metadata.

Measured with:

cargo metadata --no-deps --format-version 1 \
  | jq -r '.packages[] | "\(.name): \([.dependencies[]
      | select((.kind//"normal")=="normal" or (.kind//"normal")=="build") | .name] | join(", "))"' \
  | sort
Crate AGENTS.md says cargo metadata says Gap
gamut-deflate ← core (nothing) claims an edge that does not exist. crates/gamut-deflate/src/lib.rs:6 — "with no internal dependencies of its own"; the manifest has no [dependencies] table at all
gamut-dsp ← core (shared with the gamut-color / gamut-bitstream line) (nothing) claims an edge that does not exist. The line is right for gamut-color and gamut-bitstream and wrong for gamut-dsp
gamut-isobmff ← core, bitstream ← core claims gamut-bitstream, which it does not use
gamut-riff ← core, bitstream ← core same line, same gap
gamut-jpeg ← core, color, dsp ← codec-abi, color, core, dsp missing gamut-codec-abi
gamut-heic ← isobmff, core, color ← codec-abi, color, core, isobmff missing gamut-codec-abi
gamut-png ← core, deflate (+ miniz_oxide) ← codec-abi, core, deflate, miniz_oxide missing gamut-codec-abi
gamut-webp ← avif's list + riff (so: av1, isobmff, core, color, codec-abi, riff) ← codec-abi, color, core, dsp, riff claims gamut-av1 and gamut-isobmff, which it does not use; missing gamut-dsp
gamut-tiff ← ifd, core, bitstream ← bitstream, core, deflate, ifd, miniz_oxide missing gamut-deflate and miniz_oxide
gamut-dng ← ifd, bitstream, color, metadata, core (+ miniz_oxide) ← bitstream, color, core, deflate, ifd, jxl, metadata, miniz_oxide missing gamut-deflate and gamut-jxl

Three of these matter beyond tidiness:

  1. gamut-codec-abi is missing from three consumers' edges (gamut-jpeg, gamut-heic,
    gamut-png) in the same document that describes the codec-abi seam as the one door a backend
    enters by. A reader reconstructing the seam's reach from the edge list gets three crates fewer
    than there are.
  2. gamut-dng ← gamut-jxl is an undocumented edge between two format crates, and it is not
    an obvious one from either crate's description.
  3. The two "← nothing" crates are not the ones the document names. It says gamut-codec-abi
    is "dependency-free (not even on gamut-core)" — true — while gamut-deflate and gamut-dsp
    are equally dependency-free and are both listed as ← core.

Suggested fix

Re-derive the whole edge list from cargo metadata once, and consider a mise task that
compares the list against the graph, in the shape of check-readme-crates
(tooling/check-readme-crates/run.sh) — the same failure mode (a hand-maintained summary of the
workspace that nothing read) and the same remedy.

Why filed rather than fixed

Found while correcting the README crates table (#425, PR #526) — the gamut-deflate row now
states that the crate has no runtime dependency of its own, which AGENTS.md contradicted. That
one line is corrected in PR #526 because the PR's own diff would otherwise contradict it; the
other eight edges are a separate audit of a different document section, and widening a
documentation PR past its stated boundary is what the PR exists to argue against.

Related

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions