Context
The dead-code CI gate (PR #1995) fails only on high-confidence categories (Unused / UnusedPrivateMember / UnusedLocal). PublicCandidate findings do not fail CI and still need human triage.
Measured on origin/v3-beta after #1995 (same scanner flags as the CI gate, without --fail-on):
- Total: 242
- PublicCandidate: 185
- TestOnly: 57
PublicCandidate breakdown (from that scan):
| Bucket |
Count |
internal with zero references |
76 |
public outside ToolContracts |
95 |
public under ToolContracts |
14 |
(Plan notes that referenced 184/74/96/14 were measured on a different branch; use these v3-beta numbers as the starting baseline, and re-measure when triage work starts.)
Suggested order
- Internal zero-reference symbols (76). Callers outside the assembly cannot use them, so "maybe an external consumer needs this" is not a valid keep reason. Deletion decisions are mostly mechanical.
- Public symbols outside ToolContracts (95). Ask whether each must stay
public, not only whether it can be deleted. Many can become internal and then fall into bucket (1).
- Public ToolContracts symbols (14). These are the real extension-API candidates. Only here should a keep attribute (or equivalent) be debated.
Keep attribute
Do not design [UnityCliLoopKeep(reason)] until bucket (3) has concrete examples. Public API cannot be renamed later, and inventing the attribute with zero real keep sites would freeze the wrong shape.
Optional hardening
Consider a count baseline for PublicCandidate (record the current 185, fail CI when a PR increases it). That leaves the existing backlog alone while blocking new inflow.
Context
The dead-code CI gate (PR #1995) fails only on high-confidence categories (
Unused/UnusedPrivateMember/UnusedLocal).PublicCandidatefindings do not fail CI and still need human triage.Measured on
origin/v3-betaafter #1995 (same scanner flags as the CI gate, without--fail-on):PublicCandidate breakdown (from that scan):
internalwith zero referencespublicoutside ToolContractspublicunder ToolContracts(Plan notes that referenced 184/74/96/14 were measured on a different branch; use these v3-beta numbers as the starting baseline, and re-measure when triage work starts.)
Suggested order
public, not only whether it can be deleted. Many can becomeinternaland then fall into bucket (1).Keep attribute
Do not design
[UnityCliLoopKeep(reason)]until bucket (3) has concrete examples. Public API cannot be renamed later, and inventing the attribute with zero real keep sites would freeze the wrong shape.Optional hardening
Consider a count baseline for
PublicCandidate(record the current 185, fail CI when a PR increases it). That leaves the existing backlog alone while blocking new inflow.