# Similar issues and grouping suggestions

Bucker groups events into issues by fingerprint. Two issues that are really one bug (the same
failure reached by a slightly different stack, or reworded by a different library version) are
found a second way: by comparing what the issues say. The result appears in three places:

- **Similar issues** on an issue page, with any fix recorded for the neighbours.
- **Grouping suggestions**: pairs of issues that look like the same bug, waiting in the
  project's review queue (Grouping, Review queue).
- **Merge**, in the queue and in the issue stream, to fold the duplicates together.

Nothing is ever merged because it looked similar. A suggestion is a question for a person. The
only automatic merging in the product is the opt-in auto-merge policy, which stays off until an
organization's own confirmed and rejected pairs show it is accurate enough (the precision statistic
on the same screen).

## What is compared

Each issue is turned into a 768-number vector from its exception type and message, its title and
its culprit. Nothing else: not event payloads, not user data, not breadcrumbs, not source code.
Two issues are close when their vectors are.

Two providers can make the vectors.

| Provider | What it understands | Needs |
| --- | --- | --- |
| Local (default) | Shared words, identifiers and character runs. `getUserById` and `findUserById` match; two descriptions of the same failure in different words do not | nothing |
| Hosted | Meaning, so a message and its rewording are close | a hosted embeddings provider configured by Bucker |

The local provider is deterministic and runs inside Bucker, which is why it is the default and the
fallback. Which provider is used is a Bucker service setting, not a setting in your organization;
the hosted one is an OpenAI-compatible embeddings API.

Every vector records the model that made it, and vectors from two models are never compared. When
the provider changes, vectors made by the old one are rebuilt automatically, a project at a time.

If the hosted provider is selected but not fully configured, Bucker keeps grouping on the local provider
and says so: a scan reports why it ran on the local provider. Silently grouping worse is the failure
this avoids; refusing to group is worse still.

### What leaves Bucker

With a hosted provider, an issue's exception type, message, title and culprit are sent to it when
the issue is created and when its vector is rebuilt. They have had the storage-tier scrub
(credentials removed), not the stricter agent-tier pass, so an email address inside an exception
message is sent as stored. Two rules keep things local:

- An organization with **AI features turned off** (its AI switch) always uses the local provider,
  and nothing about its issues is sent.
- **Source code is never sent** to a hosted embeddings provider. Code retrieval for root-cause
  analysis and fix context stays on the local provider. Sending source code would first need a
  per-organization AI-switch check on the code path, which does not exist yet.

See [AI data use](ai-data-use.md) for what else each AI feature may send.

If the provider fails while an issue is being embedded (an outage, a revoked key), the embedding
is not stored, and the next daily scan embeds it; it is not replaced by a local vector, which would
put a weaker vector into a hosted index under the wrong name.

## The daily scan

About once a day, for every project with at least two issues seen in the last week, Bucker embeds
any issue that has no vector from the current provider (up to 500 per project per day, busiest
projects first, 200 projects per day, so a large backlog drains over several days rather than at
once), and then scans for similar pairs at the usual threshold. Pairs you already decided are never
asked again. Bucker can pause the daily scan; **Scan for duplicates** in the queue runs one project
on demand at any time.

## Merging suggestions

Tick the suggestions that are the same bug and press **Merge N selected**. Each is confirmed
(so it counts toward the precision statistic) and merged, up to 50 at a time. For each pair the
older issue survives, because it holds the short ID people have already pasted into tickets.

- A pair that cannot be merged (one side was merged elsewhere, deleted, or someone else decided
  it first) is skipped with its reason and stays in the queue.
- Every merge is audited and can be undone from Grouping, Merge history, with the counters
  restored exactly.
- It needs the right to triage issues in the project.

In the issue stream, select two or more issues of one project and choose **Merge** to pick the
survivor yourself.

```
POST /orgs/:org/projects/:project/grouping-suggestions/merge
{ "suggestionIds": ["...", "..."] }
```

The response lists, per suggestion, `merged` or `skipped` with a reason.

## What this is not

Bucker does not train or fine-tune a model, and it does not merge on similarity alone. The
published wrong-merge rate of automatic embedding merges is high enough that the product keeps a
person in the loop until your own data says otherwise.
