# AI citation URL normalization test suite

This is a deliberately synthetic and adversarial regression corpus. It does not fetch URLs, follow redirects, inspect HTML, read canonical links, or claim that two resources are equivalent.

Run the deterministic byte-match check from this directory:

```sh
python3 normalize_urls.py cases.csv > generated.csv
cmp --silent generated.csv expected.csv
```

The command exits `0` when the generated bytes match `expected.csv`. `cases.csv` preserves each raw citation and an optional base URL. The generated columns are `normalized_key`, `status`, `decision`, and `notes`. A `compare` decision only means “eligible for a documented comparison key”; it is not a redirect or content-equivalence finding. `review` flags functional, unknown, or potentially meaningful differences for human adjudication. `rejected` means the syntax is malformed or outside this HTTP(S)-only fixture's scope.

The implementation applies only syntax-level rules: lowercase scheme/host, remove documented default ports, remove dot segments, normalize percent-encoded unreserved characters, remove fragments from the comparison key, and drop named tracking keys (`utm_*`, `gclid`, `fbclid`, `msclkid`). Functional query parameters remain. No blanket query deletion, redirect inference, canonical substitution, trailing-slash rewrite, or live crawl is performed.
