Motivation
During the PseudoMass/Profile.lean reference-0 audit for #4637's PR-3, dev-design found that
the original 22-declaration candidate list (extracted by Lean-importer count alone, i.e. "0
importers") was overcounted: 10/22 were false positives — 7 are live via internal dependency
closure (used within the same file/namespace, just not imported from elsewhere), 3 are cited by
docs/index.md as GJ §17.5 results (docs/tex citation, not a Lean import). True reference-0 count
was 12/22.
Proposal
Change the standing operating procedure for "dead sweep" candidate extraction (used by
dev-refactoring / lean-refactoring dead-code passes) from import-count-only to a two-part
condition:
- Internal dependency closure: a declaration counts as "referenced" if any other declaration
in the repository (including in the same file/namespace) depends on it, not just cross-file
importers.
- docs/tex name citation: a declaration counts as "referenced" if its name is cited in
docs/index.md or tex/proof-guide.tex (i.e. it is presented as a book-progress result),
even if nothing in IsingModel/ imports it.
Only declarations satisfying neither condition should be proposed as reference-0 deletion
candidates.
Scope
This is a general operating-procedure correction for future dead-code / reference-0 sweeps
project-wide, not specific to the alternatingConnectedSubgraphSum cleanup tracked in #4637 (kept
separate so #4637 can close on its own scope without pulling in unrelated process changes).
Acceptance
lean-refactoring (or equivalent dead-sweep tooling/checklist) updated to require both checks
before flagging a declaration as a deletion candidate.
- Re-verify this against the next dead-sweep candidate list before batch deletion.
Related: #4637 (PR-3 Profile.lean scope reduction, 22 → 12, exhibits the false-positive rate this
issue fixes)
Motivation
During the
PseudoMass/Profile.leanreference-0 audit for #4637's PR-3,dev-designfound thatthe original 22-declaration candidate list (extracted by Lean-importer count alone, i.e. "0
importers") was overcounted: 10/22 were false positives — 7 are live via internal dependency
closure (used within the same file/namespace, just not imported from elsewhere), 3 are cited by
docs/index.mdas GJ §17.5 results (docs/tex citation, not a Lean import). True reference-0 countwas 12/22.
Proposal
Change the standing operating procedure for "dead sweep" candidate extraction (used by
dev-refactoring/lean-refactoringdead-code passes) from import-count-only to a two-partcondition:
in the repository (including in the same file/namespace) depends on it, not just cross-file
importers.
docs/index.mdortex/proof-guide.tex(i.e. it is presented as a book-progress result),even if nothing in
IsingModel/imports it.Only declarations satisfying neither condition should be proposed as reference-0 deletion
candidates.
Scope
This is a general operating-procedure correction for future dead-code / reference-0 sweeps
project-wide, not specific to the
alternatingConnectedSubgraphSumcleanup tracked in #4637 (keptseparate so #4637 can close on its own scope without pulling in unrelated process changes).
Acceptance
lean-refactoring(or equivalent dead-sweep tooling/checklist) updated to require both checksbefore flagging a declaration as a deletion candidate.
Related: #4637 (PR-3 Profile.lean scope reduction, 22 → 12, exhibits the false-positive rate this
issue fixes)