Skip to content

feat(insights): Scope duplicate file detection by app component (EME-884)#570

Open
cameroncooke wants to merge 1 commit intomainfrom
feat/scope-duplicate-detection-by-component
Open

feat(insights): Scope duplicate file detection by app component (EME-884)#570
cameroncooke wants to merge 1 commit intomainfrom
feat/scope-duplicate-detection-by-component

Conversation

@cameroncooke
Copy link
Contributor

@cameroncooke cameroncooke commented Feb 27, 2026

Scope duplicate file/directory detection by app component so that files intentionally duplicated across separate embedded bundles (main app, watch app, App Clip) are not flagged as false-positive duplicates.

Files and directories are partitioned by component scope before running the existing duplicate detection algorithm per scope. The main artifact (path .) maps to a default scope, and sub-components (watch, clip) each get their own. When no components are provided the entire file set falls into a single scope, preserving backward compatibility.

Also modernises type hints (Dict/List/Set → builtins, Sequence from collections.abc) and adds a backward-compat regression test.

Before

Screenshot 2026-02-27 at 16 32 05

After

Screenshot 2026-02-27 at 16 31 53

Linear EME-884

Partition files and directories by component scope (main app, watch app,
App Clip) before running duplicate detection so that files intentionally
duplicated across separate embedded app bundles are not flagged as false
positives. When no components are provided, all files fall into a single
scope preserving backward compatibility.

Co-Authored-By: Claude <noreply@anthropic.com>
@cameroncooke cameroncooke marked this pull request as ready for review February 27, 2026 16:54
@cameroncooke cameroncooke changed the title feat(insights): Scope duplicate file detection by app component feat(insights): Scope duplicate file detection by app component (EME-884) Feb 27, 2026
@linear
Copy link

linear bot commented Feb 27, 2026

Copy link
Member

@trevor-e trevor-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for fixing. So sounds like Watch/ and AppClip/ each have their own Frameworks/ directories and cannot share with the main app bundle? That makes sense in my head since I think they would have different code signing and such in order to run independently from the main app. And I'm assuming symlinking between them would also not work at all?

I'm a bit confused by your before/after screenshots, should the eduardo file not show up as red after your fix?

@cameroncooke
Copy link
Contributor Author

Nice, thanks for fixing. So sounds like Watch/ and AppClip/ each have their own Frameworks/ directories and cannot share with the main app bundle? That makes sense in my head since I think they would have different code signing and such in order to run independently from the main app. And I'm assuming symlinking between them would also not work at all?

I'm a bit confused by your before/after screenshots, should the eduardo file not show up as red after your fix?

@trevor-e so watch and app clips are their own .app bundles as you say they are bundled in the main bundle but installed separately. I'm not aware of any strategy to share resources, symlinks may work but this would be pretty non-standard I expect.

Regarding the screenshots in the before image the insights table shows duplicate files. In second it shows no flagged duplicates. Also app savings total is now significantly lower as it's not more representative of actual savings you can make not false positives that we had previously. Lastly the images all still red because they are flagged as optimisable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants