chore(vulture): exclude build artifacts and prune stale whitelist entries - #1151
Merged
tcoratger merged 1 commit intoJun 17, 2026
Conversation
…ries Vulture recursed into the gitignored packages/testing/build/ tree, which duplicates the real source, so every package symbol was reported twice. Exclude build directories from the scan to remove those false positives at the root. Whitelist the Validators index-position model_validator, a real validator that runs on every construction but is invisible to static analysis. Drop two stale whitelist entries whose symbols no longer exist anywhere in the codebase: the fork-upgrade method and the route access-tier flag. Their code was already removed; only the whitelist lines lingered. Co-Authored-By: Claude Opus 4.8 (1M context) <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
Vulture (the dead-code gate) was failing on
main. Two distinct causes, fixed at the root rather than by silencing.1. Build artifacts scanned twice
[tool.vulture].pathsincludespackages, so vulture recursed into the gitignoredpackages/testing/build/tree, which duplicates the real source underpackages/testing/src/. Every package symbol was reported a second time (5 of the 6 findings). Addedexclude = ["*/build/*"]so build output is never scanned — this is scoping, not a symbol whitelist, and survives any rebuild.2. One real, invisible-but-used validator
Validators._require_index_matches_position(added in #1147) is a Pydantic@model_validator(mode="after")that enforces validator index == registry position. It runs on every construction but is invisible to static analysis, so it joins the existing "Pydantic validators" section of the whitelist.Whitelist cleanup (no dead code left behind)
Audited all 106 whitelist symbols against the real code. Exactly two referenced symbols that no longer exist anywhere — pure cruft left when their code was deleted:
_.upgrade_state— fork-upgrade protocol method, since removed.is_admin— route access-tier flag, since removed.Both whitelist lines (and their comments) are dropped. Net: the whitelist is tighter (−2 stale, +1 genuine).
Verification
just deadcode(vulture) passes with zero findings.pyproject.tomlandvulture_whitelist.py.🤖 Generated with Claude Code