Skip to content

chore(vulture): exclude build artifacts and prune stale whitelist entries - #1151

Merged
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:chore/vulture-exclude-build-and-prune-whitelist
Jun 17, 2026
Merged

chore(vulture): exclude build artifacts and prune stale whitelist entries#1151
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:chore/vulture-exclude-build-and-prune-whitelist

Conversation

@tcoratger

Copy link
Copy Markdown
Collaborator

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].paths includes packages, so vulture recursed into the gitignored packages/testing/build/ tree, which duplicates the real source under packages/testing/src/. Every package symbol was reported a second time (5 of the 6 findings). Added exclude = ["*/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.
  • Changes limited to pyproject.toml and vulture_whitelist.py.

🤖 Generated with Claude Code

…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>
@tcoratger
tcoratger merged commit 90c0ffd into leanEthereum:main Jun 17, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant