Skip to content

bug(hive): suggestion contributor_count counts observations, not distinct contributors #928

Closed

Description

@AmitoVrito

Found while reviewing #924.

In HiveAggregator.suggestions (src/synapsekit/hive/aggregator.py), contributor_count is computed as len(values), where values is the list of pattern values across all envelopes. Because a single contributor can submit multiple envelopes per day (up to max_contributions_per_day), this counts observations, not distinct contributors — inflating both contributor_count and the derived confidence, which are surfaced to users as a trust signal.

Fix: track the set of distinct contributor_ids exhibiting each pattern key and use its length for contributor_count. Add a regression test where one contributor submits N envelopes for the same key and asserts contributor_count reflects distinct contributors, not observations.

Activity

  1. added
    bug
    on Aug 12, 2026
  2. added 2 commits that reference this issue on Aug 12, 2026
    af7311b
    7576299
  3. AmitoVrito commented on Aug 12, 2026

    @AmitoVrito
    CollaboratorAuthor

    Fixed in #924 (commit 7576299) — contributor_count now counts distinct contributor_ids per pattern key, with a regression test. CI green. Lands on main when #924 merges.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions