## TL;DR
The diff is flagging noise: formatting differences, case normalization, or benign type widenings that do not break anything. Tune the diff to compare semantically (normalized names, meaningful type changes only) and allowlist the known-benign patterns. A diff that cries wolf on every run gets ignored, which is how a real breaking change slips through.

```text
agent loop detected: schema diff keeps flagging false positives, diff broken
```

## Use this when
- A schema diff flags the same benign changes repeatedly.
- The agent re-checks and re-flags without progress.
- Real changes get lost in the noise.

## Not for this skill when
- The diff flags a real breaking change. Act on it.
- The diff crashes. Fix the diff tool.

## Steps
1. Collect the flagged changes and classify each as benign or real. Note the classification. Verify: the noise is separated from signal
2. Tune the diff: normalize case and formatting, ignore benign widenings. Note the new rules. Verify: the diff compares meaning, not text
3. Allowlist the known-benign patterns explicitly with reasons. Note the allowlist. Verify: the exceptions are documented
4. Re-run the diff and confirm it is quiet on the benign cases. Note the clean run. Verify: the noise is gone
5. Verify it still catches a real breaking change with a canary test. Note the canary. Verify: the diff still works

## Variant phrasings
### schema diff false positives
The tool-shaped search.
### noisy schema comparison
The paraphrase.

Compatibility: Schema diff tooling generally; the pattern applies to any comparator. Agent loop-breaking is behavior.

## Why it happens
Diffs compare representations, and representations differ in ways that do not matter: quoted versus unquoted identifiers, int versus bigint on a small column, column order. An agent that treats every diff output as an incident loops forever on noise. Semantic comparison plus an explicit allowlist turns the diff from a noise machine into a signal: it is quiet when nothing meaningful changed, which is what makes its alarms worth hearing.

## Edge cases / pitfalls
- An allowlist that grows to cover everything is a diff that does nothing. Review the allowlist periodically.
- Type narrowings are never benign; only widenings can be. Encode that asymmetry in the rules.
- The canary test matters: without it you cannot tell a tuned diff from a broken one.
- Case normalization hides real case-sensitivity bugs on some warehouses. Know your warehouse's rules before normalizing.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_AwwWzLLFMzp1nBniYdD0Mw
