Skip to content

Pin skill-miss dedup across independent diagnostics collectors - #570

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-5739-verify-plugin-skill-missing-summary-stays-deduplicated-as-the
Aug 23, 2026
Merged

Pin skill-miss dedup across independent diagnostics collectors#570
TheGreatAxios merged 1 commit into
mainfrom
cl-5739-verify-plugin-skill-missing-summary-stays-deduplicated-as-the

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Closes CL-5739.

This is a pinned-invariant PR, not a bug fix. The originally reported line (count of 4 with 5 names, 2 repeated) does not reproduce in the current codebase: formatPluginWarningsSummary derives its count and its name list from the same deduplicated Set, so a single call cannot produce a mismatch. That guarantee was already added and is already pinned by an existing test ("names a skill once however many sources missed it").

The remaining gap called out in the ticket is structural, not observed: the startup path runs the summary through seven independent call sites (discovery, tool-plugins, trust, verify, add-path, profile resolution), each owning its own PluginLoadDiagnostics collector and formatting independently. Nothing merges warnings across collectors today. This isn't a live bug because only the discovery collector currently emits skill-miss warnings, but it's an opening: a second collector reporting the same skill would print two separate lines.

Added a test that constructs two independent collectors (simulating discovery + profile resolution) each reporting overlapping missing skills, merges their warnings, and confirms formatPluginWarningsSummary still collapses to one deduplicated line. This pins the invariant that would need to hold if the collectors are ever consolidated, and would fail if dedup logic regressed to array-based counting.

No behavior change. Consolidating the collectors into one shared instance is left as the ticket's separate "evaluate" item, not implemented here.

The startup path runs the skill-miss summary through seven independent
call sites, each with its own PluginLoadDiagnostics collector. Add a
test confirming formatPluginWarningsSummary still dedupes correctly
when warnings originate from multiple separate collectors, guarding
the invariant as more collectors are added to the chain.
@linear-code

linear-code Bot commented Aug 23, 2026

Copy link
Copy Markdown

CL-5739

@TheGreatAxios
TheGreatAxios merged commit c8496ff into main Aug 23, 2026
5 checks passed
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.

1 participant