chore(scripts): cratemap.go should distinguish dev-dependencies from runtime deps #120

Closed
opened 2026-07-06 19:19:29 +00:00 by funman300 · 1 comment
Owner

Severity: Low (internal tooling)

Problem

scripts/cratemap.go reports [dev-dependencies] as ordinary local deps. Today it prints:

solitaire_data
  local deps: solitaire_core, solitaire_server, solitaire_sync

which reads as a layering violation (data layer → Axum server crate). In reality solitaire_server + axum are dev-only deps used by solitaire_data/tests/sync_round_trip.rs to spin up the test router — the runtime dependency graph is clean.

Since cratemap exists precisely to audit crate boundaries, a false positive here is the worst failure mode: every future review trips over it.

Suggested fix

Parse the section headers in Cargo.toml ([dependencies] vs [dev-dependencies] vs [target.'cfg(...)'.dependencies]) and either:

  • annotate dev deps separately: local deps: solitaire_core, solitaire_sync (dev: solitaire_server), or
  • hide them behind a -dev flag.

Found during scripted repo review, 2026-07-06 — cost real time chasing a phantom architecture violation.

**Severity: Low (internal tooling)** ## Problem `scripts/cratemap.go` reports `[dev-dependencies]` as ordinary local deps. Today it prints: ``` solitaire_data local deps: solitaire_core, solitaire_server, solitaire_sync ``` which reads as a **layering violation** (data layer → Axum server crate). In reality `solitaire_server` + `axum` are dev-only deps used by `solitaire_data/tests/sync_round_trip.rs` to spin up the test router — the runtime dependency graph is clean. Since `cratemap` exists precisely to audit crate boundaries, a false positive here is the worst failure mode: every future review trips over it. ## Suggested fix Parse the section headers in `Cargo.toml` (`[dependencies]` vs `[dev-dependencies]` vs `[target.'cfg(...)'.dependencies]`) and either: - annotate dev deps separately: `local deps: solitaire_core, solitaire_sync (dev: solitaire_server)`, or - hide them behind a `-dev` flag. Found during scripted repo review, 2026-07-06 — cost real time chasing a phantom architecture violation.
Author
Owner

Fixed in the local script (not committed — scripts/*.go are deliberately gitignored as local inspection tooling, see .gitignore:43, so there is no PR for this). cratemap now buckets [dev-dependencies]/[build-dependencies] into a separate dev deps line, with duplicates collapsing onto the runtime line. The runtime graph now correctly shows solitaire_data -> {solitaire_core, solitaire_sync} with solitaire_server as dev-only.

Fixed in the local script (not committed — scripts/*.go are deliberately gitignored as local inspection tooling, see .gitignore:43, so there is no PR for this). cratemap now buckets [dev-dependencies]/[build-dependencies] into a separate `dev deps` line, with duplicates collapsing onto the runtime line. The runtime graph now correctly shows solitaire_data -> {solitaire_core, solitaire_sync} with solitaire_server as dev-only.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#120