[P1][phase:b] Expand reachability roots: __all__, __init__ re-exports, and annotation references #116
Labels
No labels
area:ci
area:docs
area:engineering
area:framework-fp
area:test-coverage
dogfood:fn
dogfood:fp
dogfood:friction
dogfood:tp
phase:b
phase:c
severity:critical
severity:high
severity:low
severity:medium
source:deepseek-v4-pro
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pdurlej/fallow-py#116
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: evidence-derived from the 2026-06-15 real-world precision audit (
docs/dogfood/real-world-precision-2026-06-15.md).Problem
unused-symbol(2%) andunused-module(0%) measured the lowest precision of all correctness rules. Beyond the non-package-tree cause (#package-root ticket), the residual false positives come from reachability roots the analyzer does not count:__init__.py/ listed in__all__are "unused" internally but are the library's entire purpose.App = Celery # XXX compat,TaskType = type # backwards compat.TypeVars and type aliases used only inside type annotations are flagged unused because annotation references are not counted.Evidence (real repos)
flask/app.py:T_shell_context_processor,T_teardown,T_template_filter,T_template_global—TypeVars used only as decorator/annotation bounds → flagged unused-symbolhttpx/_client.py:T,U(TypeVars),EventHook(type alias) → flagged unusedcelery/app/base.py:App = Celery # XXX compat→ flagged unusedcelery/app/task.py:TaskType = type # backwards compatibility→ flagged unusedProposed fix
Expand the reachability root set used by
unused-symbol/unused-module:__all__and names re-exported from any__init__.pyas reachable (public API).# compat/ backwards-compat heuristic (or simply: aliases re-exported publicly are reachable).Acceptance criteria
TypeVars used only in annotations are no longer flagged unused (flask,httpxexamples clear).__all__/ re-exported from__init__.pyare not flagged unused.benchmarks/fp-cases/annotation-only-typevar/and.../public-compat-alias/fixtures added and pass.unused-symbol/unused-moduleprecision rising from the 2% / 0% baseline.Priority
P1. Highest-volume rules in the corpus (2,840 + 1,813 findings). After package-root detection lands, this is the next-largest FP reservoir.
Opened by
claude(Opus 4.8) from the 2026-06-15 precision audit. Audit PR: #113.