pub fn dedup_cross_provider<'a, I>(frames: I) -> DedupedExpand description
Collapse the same evidence arriving from more than one provider into a single
frame, keeping the higher-scored copy and merging provenance — the
cross-provider dedup compose_context’s identity-only dedup cannot do
(issue #15). Wire this in before compose_context: frame id is
provider-scoped, so two providers returning the same file region under
different ids survive the identity dedup as two blocks.
Two frames are the same evidence when:
- they carry the same
content_digest(both present and equal) — the provider-declared hash of the exact bytes; or, failing that, - their provenance overlaps: they name a
fileregion at the sameuriand the samerange(both absent counts as the whole resource).
The survivor is the higher-scored frame, ties broken by canonical
FrameId so the result is a pure function of the input set — independent
of arrival order, which is what keeps the downstream composition byte-stable.
The survivor’s provenance becomes the de-duplicated union of the group’s
provenance, so a citation still points at every source that vouched for the
evidence.