一键导入
dead-code-sweep
// Use when user wants to Find and remove genuine dead code using deadcode + vulture. Filters known false positives (dataclass fields, protocol methods, dunder hooks). Run before a cleanup commit.
// Use when user wants to Find and remove genuine dead code using deadcode + vulture. Filters known false positives (dataclass fields, protocol methods, dunder hooks). Run before a cleanup commit.
Use when user wants to Run the Arc Raiders AutoScrapper validation stack after edits. Use for linting, typing, tests, workflow checks, and broader repo validation.
Use when user wants to Update Metaforge snapshots and bundled default rules
Use when user wants to Validate OCR changes against failure corpus before shipping
Add a new OCR regression fixture from an ocr_debug image. Use when a scan misidentified an item and you want to lock in the correct result as a test case.
Use when user wants to Run full validation, push branch, and open a PR with appropriate context notes
Workflow for safely adding, removing, or renaming persisted config fields in config.py. Use whenever editing dataclass fields in src/autoscrapper/config.py. Covers incrementing CONFIG_VERSION, writing a migration function, and validating the round-trip.
| name | dead-code-sweep |
| description | Use when user wants to Find and remove genuine dead code using deadcode + vulture. Filters known false positives (dataclass fields, protocol methods, dunder hooks). Run before a cleanup commit. |
Finds unreferenced code using two complementary tools and removes confirmed dead code.
uv run deadcode src/ 2>&1
uv run vulture src/ --min-confidence 80 2>&1
Before removing anything, verify each reported symbol is actually unused:
grep -rn 'symbol_name' src/ tests/ scripts/
Known false positive patterns - do NOT remove these:
@dataclass fields look like unused assignments but are accessed via instance.field__slots__ entries: Accessed dynamically; scanners miss attribute accesson_* / compose / action_*: Called by framework via event dispatchBENCHMARK_REPORTS_DIR, FIXED_FAILURE_CORPUS_PATH etc.: Imported by scripts outside src/Verification workflow for each candidate:
grep -rn 'ClassName\|method_name\|CONSTANT_NAME' src/ tests/ scripts/ .github/ - if any matches beyond definition, it's live@dataclass), NamedTuple, or ProtocolOnly remove when grep confirms zero callers and the symbol has no interface obligation.
After removal, run:
uv run ruff check src/ tests/ uv run pytest --tb=short -q
Both must pass before committing.
git add CHANGED_FILES git commit -m "chore: remove dead code (SYMBOLS_REMOVED)"
RateLimitInfo (api/models.py) - removed 2026-04-16; was a dataclass with zero callerscenter_by_index (interaction/inventory_grid.py) - removed 2026-04-16; only definition, no callersdeadcode misses cross-module script usage (e.g., update_report.py functions called by scripts/) - always grep before removingvulture at --min-confidence 80 still produces false positives for dataclass fields; verify before acting