fix(baseline): key fallow member/component findings by <parent>.<member>#3
Open
robmclarty-minga wants to merge 1 commit into
Open
Conversation
fallow reports unused class/enum members and component inputs/outputs with parent_name/member_name (and component_name/input_name/output_name) rather than a single symbol field, so the dead-code extractor fell back to the file path and collapsed every unused member of a file onto one fingerprint key. A member-heavy report then fingerprinted to far fewer keys than its issue count, which the fullyTracked guard treats as untracked, so the baseline could never mask the slot green. Compose the identity as <parent>.<member> so each member is distinct (on a real 7,970-finding repo the fingerprint count rises from 3,148 to 7,949). Distinct findings that share a line-free identity (overloaded members, a symbol re-exported or imported twice in one file) still legitimately collapse, so a large legacy dead slot can remain untracked; fallow's native regression baseline stays the tool for grandfathering those. Also stop fingerprinting the non-counted workspace_diagnostics and next_steps arrays: neither is in total_issues, and workspace_diagnostics items carry a path, so fingerprinting them pushed the finding count past the issue count and could wrongly mark an otherwise fully-tracked slot as untracked.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
deadfingerprint extractor keys a finding on<file>:<symbol>, where thesymbol comes from the first non-empty field in
SYMBOL_FIELDS(
export_name,name,member, …). But fallow reports class/enum memberswith
parent_name+member_name, and component inputs/outputs withcomponent_name+input_name/output_name— none of which are in that list.So every unused member of a file falls back to a path-only key and they all
collapse onto one fingerprint.
That collapse breaks gating, not just precision.
fallowVerdictonly masks aslot green when
findings.size === issueCount(thefullyTrackedguard). Amember-heavy report fingerprints to far fewer keys than its issue count, so the
guard treats it as untracked and the baseline can never mask it green.
On a real 7,970-finding repo:
total_issuesFix
<container>.<leaf>fromparent_name.member_name/component_name.input_name/component_name.output_name, before falling back to the single-symbolfields. Members in a file are now distinct, e.g.
dead-code:unused_class_members:src/a.ts:Svc.foo.workspace_diagnosticsandnext_stepsarrays.Neither is counted in
total_issues, andworkspace_diagnosticsitems carrya
path, so fingerprinting them pushedfindings.sizepastissueCount—which the
fullyTrackedguard also (correctly) rejects, wrongly marking anotherwise fully-tracked slot untracked.
Scope / honest limitation
This does not guarantee
fullyTrackedfor every large report. Distinctfindings that share a line-free identity — overloaded members, a symbol
re-exported or imported twice in one file — still legitimately collapse (the
residual −21 above). That's inherent to fingerprints that deliberately exclude
line/column. For grandfathering a large legacy
deadslot, fallow's nativeper-category regression baseline remains the right tool; this change makes the
fingerprint baseline correct and precise for the common member/component case
and lets member-level fixes ratchet individually.
Verification
pnpm exec vitest run— 427 passing, incl. 3 new fallow cases(member composition, component composition,
workspace_diagnosticsskipped).tsc --buildclean.node dist/cli.js(self-gate) green except thepackslot, which failsidentically on pristine
mainin my environment (local pnpm version; a directpnpm pack --dry-runexits 0) — unrelated to this change.