Skip to content

count a media item once, whatever address serves its bytes - #48

Open
anuraggdubey wants to merge 1 commit into
MultiAgency:mainfrom
anuraggdubey:fix/media-counts-distinct-items
Open

anuraggdubey wants to merge 1 commit into
MultiAgency:mainfrom
anuraggdubey:fix/media-counts-distinct-items

Conversation

@anuraggdubey

Copy link
Copy Markdown
Contributor

Fixes #45.

A media criterion counted every cited link that loaded with a matching content type. #36 made sources count a page once per SHA-256, but media never got that change. One file behind several addresses, such as a.png?1, a.png?2 and a.png?3, a mirror, or http and https, met any min.

Changes

  • checks.ts: in case "media", the loaded items are de-duplicated by sha256 with the same filter sources uses, so the same bytes count once. evidence is built from those items, so each one is recorded once.
  • docs/verifiability.md: the media row says min counts distinct items, and that links whose responses are the same bytes count once, as the sources row does.

Tests

  • New: one image behind a.png?1, a.png?2 and a mirror counts once. With min: 3 it fails with "1 of the needed 3 image items load", records one evidence entry, and still fetches each address once.
  • New: three addresses that differ only by query, each serving its own bytes, still pass with "3 image items load" and three evidence entries.
  • The issue's reproduction, verbatim, now fails with one item instead of passing with three.
  • Without the fix, the same-bytes test fails. pnpm typecheck passes, and pnpm test:e2e passes 55/55.

Not included

  • Fetching: each address is still fetched once, because its bytes can't be known without fetching it.
  • e2e/outlayer-evaluator has no media check, so only the app changes.

A media criterion counted every cited link that loaded, so one file behind several addresses (a query string, a
mirror, http and https) met any min. Its items now count once per SHA-256, as sources pages do, and each is
recorded once in the evidence.

Fixes MultiAgency#45.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A media check counts the same bytes at several addresses as several items

1 participant