chore(deps): remove dependencies nothing uses #561

Merged
sharang merged 1 commits from chore/remove-unused-deps into main 2026-10-09 18:58:28 +00:00
Owner

Architecture review item A5: drop dependencies that are declared but never referenced. Only Cargo.toml and Cargo.lock change; no source changes, so behaviour stays the same.

Found with cargo machete, then checked by grepping each crate's src, tests, bin/ and macro/path usage (including the dashboard's server/web feature-gated code).

Candidates

Crate Dependency Result
compliance-dast chromiumoxide removed (Chrome is driven over CDP via tokio-tungstenite)
compliance-dast bollard removed (the docker CLI is called instead)
compliance-agent jsonwebtoken removed
compliance-agent futures-core removed
compliance-dashboard dioxus-logger kept: dioxus_logger::init in bin/main.rs under #[cfg(feature = "web")]
compliance-dashboard secrecy removed, plus dep:secrecy in the server feature (secrets go through compliance_core::secret_box)
compliance-mcp tower-http removed
compliance-smoke reqwest removed

Also flagged by machete and removed after the same check:

  • compliance-dashboard: bson, plus dep:bson in server (the code uses the mongodb::bson re-export)
  • compliance-dast: bson, mongodb, serde, thiserror (the only "mongodb" hit is a "mongodb://" string)
  • compliance-graph: serde_json, thiserror, uuid

The bson chrono-0_4 feature stays on through compliance-core, which declares it unconditionally.

Out of scope (not workspace members): fuzz/ (compliance-core in a stub target) and fixtures/nightly/firmware/cargo-embedded (cortex-m/cortex-m-rt are link-time crates, so machete flags them wrongly).

No [workspace.dependencies] entry was orphaned, so the root Cargo.toml doesn't change.

Lockfile

21 packages removed: chromiumoxide (+ cdp/pdl/types), bollard (+ stubs), async-tungstenite, hyperlocal, hyper-named-pipe, tungstenite 0.23, futures-timer, which, home, winreg, winsafe, and older duplicate versions of hashbrown, heck, indexmap, rustix, linux-raw-sys and schemars. Nothing was added or bumped. The only + lines are dependency references losing their version suffix now that a single version is left.

Verification

  • cargo fmt --all --check
  • clippy -D warnings --all-targets: agent, mcp, smoke, dashboard (server and web) all clean
  • cargo clippy -p compliance-dast -p compliance-graph -- -D warnings is clean. With --all-targets, clippy fails on items_after_test_module in 8 dast tool files and graph/src/parsers/rust_parser.rs. That code is unchanged from main and CI doesn't clippy these crates, so it is not fixed here.
  • Tests: dast lib 63 passed, graph lib 86, agent lib 895 (7 ignored), dashboard lib (server) 103, mcp bins 37, smoke 0 (has no tests)

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p

Architecture review item A5: drop dependencies that are declared but never referenced. Only Cargo.toml and Cargo.lock change; no source changes, so behaviour stays the same. Found with `cargo machete`, then checked by grepping each crate's src, tests, bin/ and macro/path usage (including the dashboard's `server`/`web` feature-gated code). ## Candidates | Crate | Dependency | Result | |---|---|---| | compliance-dast | `chromiumoxide` | removed (Chrome is driven over CDP via `tokio-tungstenite`) | | compliance-dast | `bollard` | removed (the docker CLI is called instead) | | compliance-agent | `jsonwebtoken` | removed | | compliance-agent | `futures-core` | removed | | compliance-dashboard | `dioxus-logger` | **kept**: `dioxus_logger::init` in `bin/main.rs` under `#[cfg(feature = "web")]` | | compliance-dashboard | `secrecy` | removed, plus `dep:secrecy` in the `server` feature (secrets go through `compliance_core::secret_box`) | | compliance-mcp | `tower-http` | removed | | compliance-smoke | `reqwest` | removed | Also flagged by machete and removed after the same check: - compliance-dashboard: `bson`, plus `dep:bson` in `server` (the code uses the `mongodb::bson` re-export) - compliance-dast: `bson`, `mongodb`, `serde`, `thiserror` (the only "mongodb" hit is a `"mongodb://"` string) - compliance-graph: `serde_json`, `thiserror`, `uuid` The bson `chrono-0_4` feature stays on through `compliance-core`, which declares it unconditionally. Out of scope (not workspace members): `fuzz/` (`compliance-core` in a stub target) and `fixtures/nightly/firmware/cargo-embedded` (`cortex-m`/`cortex-m-rt` are link-time crates, so machete flags them wrongly). No `[workspace.dependencies]` entry was orphaned, so the root Cargo.toml doesn't change. ## Lockfile 21 packages removed: chromiumoxide (+ cdp/pdl/types), bollard (+ stubs), async-tungstenite, hyperlocal, hyper-named-pipe, tungstenite 0.23, futures-timer, which, home, winreg, winsafe, and older duplicate versions of hashbrown, heck, indexmap, rustix, linux-raw-sys and schemars. Nothing was added or bumped. The only `+` lines are dependency references losing their version suffix now that a single version is left. ## Verification - `cargo fmt --all --check` - clippy `-D warnings --all-targets`: agent, mcp, smoke, dashboard (`server` and `web`) all clean - `cargo clippy -p compliance-dast -p compliance-graph -- -D warnings` is clean. With `--all-targets`, clippy fails on `items_after_test_module` in 8 dast tool files and `graph/src/parsers/rust_parser.rs`. That code is unchanged from main and CI doesn't clippy these crates, so it is not fixed here. - Tests: dast lib 63 passed, graph lib 86, agent lib 895 (7 ignored), dashboard lib (server) 103, mcp bins 37, smoke 0 (has no tests) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang added 1 commit 2026-10-09 18:45:22 +00:00
chore(deps): remove dependencies nothing uses
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 10m54s
a4db3ae43e
cargo machete plus a grep of every source, test and bin file found these
declared but never referenced:

- compliance-agent: jsonwebtoken, futures-core
- compliance-dashboard: bson, secrecy (server feature; reached through
  mongodb::bson and compliance_core::secret_box instead)
- compliance-dast: chromiumoxide, bollard, bson, mongodb, serde, thiserror
- compliance-graph: serde_json, thiserror, uuid
- compliance-mcp: tower-http
- compliance-smoke: reqwest

No code changes; Cargo.lock only loses 21 packages.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang force-pushed chore/remove-unused-deps from 05e06a42d1 to a4db3ae43e 2026-10-09 18:45:22 +00:00 Compare
sharang merged commit a3735b12b7 into main 2026-10-09 18:58:28 +00:00
Sign in to join this conversation.