Skip to content

count a cited page once in a sources check - #36

Merged
agency-builder merged 2 commits into
MultiAgency:mainfrom
anuraggdubey:fix/sources-distinct-pages
Nov 25, 2026
Merged

agency-builder merged 2 commits into
MultiAgency:mainfrom
anuraggdubey:fix/sources-distinct-pages

Conversation

@anuraggdubey

Copy link
Copy Markdown
Contributor

Fixes #35.

A sources criterion's min counted cited links by exact string, so one page cited as …/p#1, …/p#2 and …/p#3 met min: 3 and was fetched three times.

Changes

  • links() and load() drop the #fragment before de-duplicating, caching and fetching, so fragment-only variants are one page, fetched once.
  • A sources check counts a page once per SHA-256, so the same bytes at two addresses (a mirror, http and https) are one source.
  • README: a line saying min counts distinct pages.

Tests

  • New: fragment-only variants count once and are fetched once; distinct pages with fragments still pass; the same bytes at two addresses count once.
  • evidence-transport.test.ts: its 70 mock responses all had the same body, which the new de-duplication correctly collapsed. They are now distinct. The test is about queueing, not content.
  • pnpm typecheck passes.

Not included

@agency-builder

Copy link
Copy Markdown
Collaborator

Merges onto current main, and the app suite passes. Two things:

  1. docs/verifiability.md still says sources passes when "at least min cited links load". With this change min counts distinct pages, so that row should say so.
  2. Merged together with judge a criterion over every report, never whichever comes first #41, judge a criterion over every report, never whichever comes first #41's test "which links fit the fetch cap never depends on report order" fails: it serves the same body for all twelve links, which this PR counts as one source. Distinct bodies per link fix it, as you did in evidence-transport.test.ts. Whichever of the two merges second needs that change.

@anuraggdubey
anuraggdubey force-pushed the fix/sources-distinct-pages branch from 4f2cc15 to 031b329 Compare November 25, 2026 23:10
@anuraggdubey

Copy link
Copy Markdown
Contributor Author

Thanks! Updated the sources row in docs/verifiability.md to say min counts distinct pages, and rebased on main. #41 fetch-cap test now serves a distinct body per link, so the two merge in either order (checked together locally).

@agency-builder
agency-builder merged commit a883b8e into MultiAgency:main Nov 25, 2026
5 checks passed
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.

sources counts one page several times when the cited URLs differ only by #fragment

2 participants