chore: remove dead code + unused dependencies#249
Merged
Conversation
A workspace-wide dead-code hunt (grep-verified, cross-checked by a full build) found unreferenced functions and unused Cargo dependencies. All removals are confirmed by `cargo build --workspace --all-targets` + clippy + the full test suite staying green. Dead functions (zero references anywhere, incl. tests): - `RunLedger::count_by_status` (escurel-runner-core) — the `/debug/ledger` surface uses the tenant-agnostic `count_all_by_status` instead. - `QuotaError::from_bucket` (escurel-quota) — never invoked. - `ServerConfig::test_defaults` (escurel-server) — a test constructor that was never adopted. (+ the now-unused `QuotaExhausted` / `AlwaysReady` imports they left behind.) Unused dependencies (verified no use in the crate; `cargo build` confirms): escurel-auth (async-trait), escurel-cli (futures, tokio-stream), escurel-eval (anyhow), escurel-explore-bff (serde), escurel-loader (tracing), escurel-obs (tracing-core, serde), escurel-runner (serde), escurel-runner-core (anyhow, serde), escurel-runner-harness (tracing), escurel-tui (serde_json), escurel-test-support (escurel-types, secrecy). Deliberately LEFT (not dead — future hooks / public API): the sql_view `with_unsigned_extensions` admin opt-in scaffolding; the escurel-types `Admin*Request` DTOs (public wire types); `escurel-storage`'s `aws-config` (feature-gated under `s3`, needs a per-feature build to verify — deferred). Test plan: full fmt/clippy/test/build gate green; no behavioural change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Part 3 of the spec-alignment sweep — a workspace-wide dead-code cleanup (the audit's "clean up dead/redundant code" track). A grep-verified hunt, cross-checked by a full build + clippy + test run, found unreferenced functions and unused dependencies.
Dead functions (zero references anywhere, including tests):
RunLedger::count_by_status(escurel-runner-core) — the/debug/ledgersurface uses the tenant-agnosticcount_all_by_status.QuotaError::from_bucket(escurel-quota) — never invoked.ServerConfig::test_defaults(escurel-server) — a never-adopted test constructor.QuotaExhausted/AlwaysReadyimports they left dangling.)Unused dependencies (12 crates, 15 deps —
cargo build --workspace --all-targetsconfirms none were needed): async-trait, futures, tokio-stream, anyhow (×2), serde (×4), tracing (×2), tracing-core, serde_json, escurel-types, secrecy. Cargo.lock pruned to match.Deliberately left (not dead — future hooks / public wire API):
sql_viewwith_unsigned_extensionsadmin opt-in scaffolding (planned security hook);escurel-typesAdmin*RequestDTOs (public wire types, may have external consumers);escurel-storage'saws-config(feature-gated unders3— verifying it needs a per-feature build; deferred to keep this PR default-features-safe).Test plan
No behavioural change. Full local gate green:
fmt --check,clippy --workspace --all-targets -D warnings,test --workspace --all-targets,build --workspace --release.🤖 Generated with Claude Code
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.