- HY-01: openapiv3 -> dev-dependencies (test-only usage) - HY-05: drop bytes (src sites renamed to axum::body::Bytes re-export), keep parking_lot (genuinely used); tokio "full" -> the seven features actually used (macros, rt-multi-thread, io-util, net, fs, time, sync) - HY-08: test-support extends wss; dev tokio-tungstenite matches the wss feature set - HY-12: tokio-tungstenite 0.28 -> 0.29 to match axum's tungstenite; duplicate roots in cargo tree -d: 9 -> 6 (tungstenite, cpufeatures, rand dupes collapsed) - HY-07 ride-along: READ_SLOTS privatized - CON-10 residue: verified already fixed (full_surface required-features) Verified: cargo test (300), --all-features (371+36), --features mcp (355+9), --features wss (316), check --no-default-features, clippy (all-targets and --all-features, -D warnings), fmt --check
6.1 KiB
id, name, status, depends_on, scope, risk, impact, level, tags
| id | name | status | depends_on | scope | risk | impact | level | tags | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| review-001-dependency-hygiene | Dependency and feature hygiene (HY-01, HY-05, HY-08, HY-12, CON-10) | completed | narrow | trivial | project | implementation |
|
Description
Review 001 hygiene findings that are pure Cargo.toml / dependency work — mechanical, parallelizable, worth landing any time:
- HY-01 [major]:
openapiv3is a production dependency used only inside#[cfg(test)](to_openapi.rs:1103). Move to[dev-dependencies]. - HY-05:
bytesdeclared, zero direct use in src/ (only axum's re-export);parking_lotdeclared, zero direct use;tokiofeatures =["full"]drags inprocess/signalextras. Prune to what's used. - HY-08:
tokio-tungstenitedeclared three times with different feature sets (wss,test-support, dev-deps); maketest-supportextendwss(also resolves CON-10's class of fragility) — noterequired-featuresfix itself is tracked in review-001-consumer-adapter-hygiene (CON-10). - HY-12: duplicate dependency roots (
getrandom 0.3/0.4,cpufeatures 0.2/0.3) driven bytokio-tungstenite 0.28here vstungstenite 0.29via axum's ws — align versions to collapse. - Related slack: HY-07 (
READ_SLOTSpub constant leak in a public module — privatize or document) can ride along.
Deliberately deferred to a later pass: HY-02 (the 110-warning
missing_docs sweep — better done once the remediation stabilizes the
API), HY-04 (test-support unwrap, documented as intentional), HY-06
(ExponentialBackoff in public API — revisit when the client config
settles), HY-10 (stale docs — several overlap fixes landing in other
tasks), HY-11 (docs/ in the package — needs a publishing decision).
Acceptance Criteria
openapiv3in dev-dependencies onlycargo tree -dduplicate roots reduced (getrandom/cpufeatures collapse)- Unused deps pruned; tokio features tightened (build passes in default,
mcp-only,wss,--all-features,--no-default-features) - HY-07 resolved (privatized or documented)
- Full feature matrix still green: default,
--all-features,mcp-only,wss-only,--no-default-features
References
- docs/reviews/001-initial-implementation-review.md (Part H, HY-01, HY-05, HY-07, HY-08, HY-12)
Notes
HY-05 nuance:
bytesturned out to be load-bearing in src/ — fivebytes::Bytessites (byte_adapter.rs, server/adapter.rs, adapters/forward.rs) had been relying on the declared dependency (axum's re-export satisfies the same items, so the mechanical fix was to rename toaxum::body::Bytes, which axum re-exports from bytes — no behavior change).parking_lotis genuinely used (server/adapter.rs, websocket/upgrade.rsMutex) — kept.HY-12: aligning tokio-tungstenite to 0.29 (matching axum's tungstenite 0.29) collapsed
tungstenite0.28/0.29,cpufeatures0.2/0.3, andrand0.9/0.10 duplicate roots.cargo tree -droot count went from 9 to 6 (getrandom 0.3/0.4 and hashbrown 0.16/0.17 remain — both are required by unrelated crates: getrandom 0.4 via alkcall/uuid/retry-policies, 0.3 via jsonschema/ahash; hashbrown 0.17 via indexmap/h2, 0.16 via referencing).syn2/3 also remains (thiserror 2 vs rmcp 1.8).cargo updatewas run;retry-policiespinned to 0.5.1 (--precise) because its 0.5.2 bump pulledrand0.10 back in (via getrandom-only rand_core 0.10).HY-08:
test-supportfeature now extendswss(declared via["wss"]equivalent — both activate the same optional tokio-tungstenite dep); the wss-feature feature set already matched the dev-deps set (connect+ handshake-capable, default-features off), so the dev-dependency declaration was aligned to that exact set.CON-10 residue: already fixed before this task landed —
[[test]] full_surfacehasrequired-features = ["mcp", "test-support"]; verified bycargo test --features mcppassing.HY-07:
READ_SLOTSprivatized (pub const→const) in src/websocket/byte_adapter.rs; it is internal plumbing (inbound backpressure slot count), not part of the public API. No external references existed (verified by grep over src/, tests/, docs/).
Summary
Completed as specified. Changes:
- HY-01:
openapiv3moved from[dependencies]to[dev-dependencies](both use sites are test-only: to_openapi.rs unit test, tests/full_surface.rs).- HY-05:
bytesremoved after renaming the fivebytes::Bytessites toaxum::body::Bytes(axum's re-export of the same type; no behavior change).parking_lotkept — genuinely used. tokiofeatures = ["full"]tightened to["macros", "rt-multi-thread", "io-util", "net", "fs", "time", "sync"], derived from actual usage (tokio::test→ macros+rt, io/ duplex/split → io-util, TcpListener/TcpStream → net, tokio::fs → fs, time/sleep/timeout/interval → time, mpsc/oneshot/watch/Semaphore → sync;select!/pin!/join!are core,process/signalwere pure slack fromfull).- HY-08:
test-supportextendswss; dev-deps tokio-tungstenite pinned to the same feature set as the wss feature.- HY-12: tokio-tungstenite/tungstenite 0.28 → 0.29 aligned with the version axum 0.8's
wsfeature uses. Duplicate roots: 9 → 6 (tungstenite 0.28/0.29, tokio-tungstenite 0.28/0.29, cpufeatures 0.2/0.3, rand 0.9/0.10 collapsed; remaining: getrandom 0.3/0.4, hashbrown 0.16/0.17, syn 2/3 — all required by distinct unrelated crates, not alignable from this crate).- HY-07:
READ_SLOTSprivatized.- CON-10: verified already fixed (
required-features = ["mcp", "test-support"]onfull_surface).Verification matrix (all green):
cargo test— 300 passedcargo test --all-features— 371 + 9 + 6 + 8 + 13 passedcargo test --features mcp— 355 + 9 passedcargo test --features wss— 316 passedcargo check --no-default-features— compilescargo clippy --all-targets -- -D warnings— cleancargo clippy --all-features --all-targets -- -D warnings— cleancargo fmt --check— cleancargo tree -d— duplicate roots 9 → 6