Fixed with a one-line change in `merge.mjs`. All 5 tests now pass, and the 2 new regression tests failed before the fix.

**Root cause (from reading the source):** at `merge.mjs:10`, `byEmail.set(key,{...contact})` ran on every incoming row, including duplicates. The `if` only chose which counter to increase, so `added` and `skipped` were right but the stored contact was still overwritten. Overwriting a key in a `Map` keeps its original position, which is why the order looked fine while the name was replaced.

**Regression tests added to `merge.test.mjs`:**
1. An existing contact wins over an import with the same email after trim/lowercase (checks the full result: contacts, `added`, `skipped`).
2. Among incoming duplicates the first row wins, and insertion order is kept (existing first, then new emails in order).
3. The function returns fresh objects and doesn't change its inputs.

**Before the fix (observed):** 3 passed, 2 failed.
- Test 1 got `{email:' a@example.test ', name:'Import'}` instead of `name:'Established'`.
- Test 2 got `B2` instead of `B1`.
- Counts were correct in both, which confirms the counters weren't the problem.
- Test 3 also passed before the fix. It guards the contract rather than reproducing this bug.

**Fix:** the store now only happens for new emails:
```js
if(byEmail.has(key))skipped++;else{added++;byEmail.set(key,{...contact});}
```

**After the fix (observed):** `node --test merge.test.mjs` gives 5 passed, 0 failed.

**From reasoning only, not covered by a test:**
- Duplicates within the existing array aren't handled, because the contract says existing emails are already unique.
- The returned email keeps its original form (e.g. `'A@example.test'`). Only the lookup key is normalized, which is how the code already behaved.
- `{...c}` makes shallow copies. Nested fields would still be shared, but the contract doesn't mention any.

I only changed `merge.mjs` and `merge.test.mjs`: no new files, dependencies or commits.