chore(scripts): add feature_dep_audit.sh — Phase 8a baseline tool (refs #195)#292
Merged
Merged
Conversation
#195) Mirrors clone_alloc_audit.sh (Phase 6a) and trait_generic_audit.sh (Phase 7a) in shape and rigor. Walks every crate's Cargo.toml + src/ tree and emits a Markdown inventory of: * Per-crate feature surface (count, default? dep:-gated, optional deps, cfg(feature) site count, # Features rustdoc presence). * Per-feature contract (activations, default? use-sites) per playbook §988 — what it enables / what deps it adds / public-API impact / semver claim. * Optional-dep cross-check (every `optional = true` dep should be referenced by exactly one feature via `dep:foo`). * Consumer-side `default-features = false` overrides (skips TOML comment lines so rustdoc mentions of the syntax don't false-flag). * `deny.toml [bans].skip-tree` inventory with rationale. Optional cargo cross-checks behind flags: * `--with-cargo` runs `cargo tree --workspace -d --depth 0` and `cargo machete`; groups duplicate-version crates by name with distinct-version multiplicity, cross-checks against the skip-tree, surfaces NEW unjustified dups. * `--with-deny` additionally runs `cargo deny check` and tabulates the four-category pass. Baseline run at SHA 33f22b5 (Phase 7 closeout) captures: * 3 features across 14 crates (uffs-cli, uffs-client, uffs-mcp); none currently has a `# Features` rustdoc section (Phase 8b fills this in). * 17 cfg(feature) prod-path use-sites. * 0 orphan optional deps; 2 deliberate consumer-side `default-features = false` overrides (uffs-cli → uffs-client, uffs-polars → polars). * 12 distinct duplicate-version crate groups: 4 in skip-tree (foldhash, getrandom, hashbrown, itertools), 8 surfaced via `multiple-versions = \"warn\"` only (RustCrypto family + polars-transitive rand_*). * 0 unused direct deps (`cargo machete` green). The script is read-only and idempotent; rerunning on a future SHA produces a diffable delta. No suppression hacks, no behavior change. Refs #195.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 8a baseline tool — mirrors
clone_alloc_audit.sh(Phase 6a) andtrait_generic_audit.sh(Phase 7a) in shape and rigor. Read-only inventory script. No behavior change.What it does
Walks every crate's
Cargo.toml+src/tree and emits a Markdown inventory of:dep:-gated,optional = truedeps,cfg(feature)site count,# Featuresrustdoc presence.optional = truedep should be referenced by exactly one feature viadep:foo.default-features = falseoverrides (skips TOML comment lines so rustdoc mentions of the syntax don't false-flag).deny.toml [bans].skip-treeinventory with rationale.Optional cargo cross-checks behind flags:
--with-cargorunscargo tree --workspace -d --depth 0(deduped by(name, version)so same-version doubles aren't reported) andcargo machete, cross-checks duplicates against the skip-tree, surfaces NEW unjustified dups.--with-denyadditionally runscargo deny checkand tabulates the four-category pass.Baseline run @
33f22b572(Phase 7 closeout)# Featuresrustdoccfg(feature)prod-path use-sitesdefault-features = falseoverrideswarn-only)cargo macheteunused depscargo deny checkAcceptance
clone_alloc_audit.sh(Phase 6a) andtrait_generic_audit.sh(Phase 7a).shellcheckclean (info-only SC2016 hits matching the pre-existing scripts).Phase-8 rules adherence
warn-only duplicate groups; it does not silence them.Refs #195.