open_agh_chemistry_pl: cite the 2026-10-06 Wayback captures of the EPUB rights pages (v2#78)

#91
by ppuzio - opened
data/open_agh_chemistry_pl/open_agh_chemistry_pl.license-evidence.json CHANGED
@@ -106,10 +106,42 @@
106
  ],
107
  "wayback": {
108
  "queried": "2026-10-06",
109
- "method": "read-only CDX lookups (web.archive.org/cdx/search/cdx); no Save Page Now request was made",
110
- "rights_pages": "no snapshot of any of the four rights-bearing URLs (/rpc/preview/handbooks/{29,1394,37,1893}/epub/light), of /rest/handbooks/{id}, or of anything under /rpc/preview/handbooks/",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  "landing_pages": "snapshots exist of /handbook/{id} (e.g. https://web.archive.org/web/20260510021229id_/https://epodreczniki.open.agh.edu.pl/handbook/29); the page is a ~3 kB shell with og: meta tags and no licence text, so it is not licence evidence",
112
- "consequence": "a later relabel of the rights pages cannot be ruled out from an archive; the bytes the build verified are pinned by the sha256 values above (book 37 has since been regenerated; see recheck). Generation dates of the EPUBs are 2025-12 to 2026-04 (Last-Modified headers)"
113
  },
114
  "recheck": {
115
  "observed_at": "2026-10-06T10:22:38Z",
 
106
  ],
107
  "wayback": {
108
  "queried": "2026-10-06",
109
+ "method": "read-only CDX lookups (web.archive.org/cdx/search/cdx). On 2026-10-06 at 17:31-17:32 UTC Paweł Puzio requested Save Page Now for the four /epub/light URLs in a browser; each resulting capture was then downloaded in id_ form (original bytes) and hashed",
110
+ "rights_pages": "before 2026-10-06 there was no snapshot of any of the four rights-bearing URLs (/rpc/preview/handbooks/{29,1394,37,1893}/epub/light), of /rest/handbooks/{id}, or of anything under /rpc/preview/handbooks/; the 2026-10-06 captures are listed in captures",
111
+ "captures": [
112
+ {
113
+ "book_id": 1394,
114
+ "wayback_timestamp": "20261006173153",
115
+ "replay_url": "https://web.archive.org/web/20261006173153id_/https://epodreczniki.open.agh.edu.pl/rpc/preview/handbooks/1394/epub/light",
116
+ "content_type": "application/epub+zip",
117
+ "sha256": "6ca970872928580c1bbcde272db2e9390fcd0ab57720c08140589f9cc7873b40",
118
+ "cdx_digest_sha1_base32": "FZRDSRJLBZ3RU64ORAPNC4HGVVOP2EAO"
119
+ },
120
+ {
121
+ "book_id": 1893,
122
+ "wayback_timestamp": "20261006173206",
123
+ "replay_url": "https://web.archive.org/web/20261006173206id_/https://epodreczniki.open.agh.edu.pl/rpc/preview/handbooks/1893/epub/light",
124
+ "content_type": "application/epub+zip",
125
+ "sha256": "d8597c42c5a32dcc2537fa52bd15b517fb3558bff98117b46797e9084cc26cb3",
126
+ "cdx_digest_sha1_base32": "K5YOCHAIGEBPYROZA3LDZ7LZY4N4HJZ3"
127
+ },
128
+ {
129
+ "book_id": 37,
130
+ "wayback_timestamp": "20261006173220",
131
+ "replay_url": "https://web.archive.org/web/20261006173220id_/https://epodreczniki.open.agh.edu.pl/rpc/preview/handbooks/37/epub/light",
132
+ "content_type": "application/epub+zip",
133
+ "sha256": "aabf4a21561473bebe49f2beeeadeed93b1ce665f279a734ca572e798784541f",
134
+ "cdx_digest_sha1_base32": "K6C3OGSLXB7GQXOIH4D55TMBHI3F4TPS"
135
+ }
136
+ ],
137
+ "not_captured": [
138
+ {
139
+ "book_id": 29,
140
+ "reason": "Save Page Now answered the request at 20261006173142 with a delay in registering the snapshot; at 17:44 UTC on 2026-10-06 the replay URL still returned HTTP 404 and CDX had no row, so no capture is cited"
141
+ }
142
+ ],
143
  "landing_pages": "snapshots exist of /handbook/{id} (e.g. https://web.archive.org/web/20260510021229id_/https://epodreczniki.open.agh.edu.pl/handbook/29); the page is a ~3 kB shell with og: meta tags and no licence text, so it is not licence evidence",
144
+ "consequence": "the bytes of books 1394 and 1893 that the build verified, and book 37 as regenerated on 2026-10-06 (recheck), are held in a third-party archive with a timestamp; each capture's sha256 equals those bytes. Book 29 and book 37's pre-regeneration bytes are pinned only by the sha256 values above, so a relabel of those before 2026-10-06 cannot be ruled out from an archive. Generation dates of the EPUBs are 2025-12 to 2026-04 (Last-Modified headers)"
145
  },
146
  "recheck": {
147
  "observed_at": "2026-10-06T10:22:38Z",
src/test_open_agh_chemistry_pl_contract.py CHANGED
@@ -49,10 +49,23 @@ def test_licence_is_by_sa_4_0_everywhere_and_never_nc_or_3_0():
49
  assert not re.search(r"(?i)\bNC\b|by-nc|3\.0", line)
50
 
51
 
52
- def test_missing_wayback_snapshot_is_recorded_not_papered_over():
53
  wayback = EVIDENCE["wayback"]
54
- assert "no snapshot" in wayback["rights_pages"]
55
- assert "no Save Page Now request" in wayback["method"]
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  assert any("history of the rights pages" in item for item in EVIDENCE["not_checked"])
57
 
58
 
 
49
  assert not re.search(r"(?i)\bNC\b|by-nc|3\.0", line)
50
 
51
 
52
+ def test_wayback_captures_hold_the_current_bytes_and_the_gaps_stay_recorded():
53
  wayback = EVIDENCE["wayback"]
54
+ pinned = {b["book_id"]: b["rights_page"] for b in EVIDENCE["books"]}
55
+ # a book the site regenerated is checked against its recheck bytes, every other book against the pinned bytes
56
+ current = {book_id: page["epub_sha256"] for book_id, page in pinned.items()}
57
+ current.update({c["book_id"]: c["epub_sha256"] for c in EVIDENCE["recheck"]["changed"]})
58
+ captured = [c["book_id"] for c in wayback["captures"]]
59
+ missing = [m["book_id"] for m in wayback["not_captured"]]
60
+ assert sorted(captured + missing) == sorted(BOOK_IDS) and len(set(captured)) == len(captured)
61
+ for capture in wayback["captures"]:
62
+ stamp, url = capture["wayback_timestamp"], pinned[capture["book_id"]]["url"]
63
+ assert re.fullmatch(r"20261006\d{6}", stamp)
64
+ assert capture["replay_url"] == f"https://web.archive.org/web/{stamp}id_/{url}"
65
+ assert capture["sha256"] == current[capture["book_id"]]
66
+ assert re.fullmatch(r"[A-Z2-7]{32}", capture["cdx_digest_sha1_base32"])
67
+ assert all(m["reason"] for m in wayback["not_captured"])
68
+ assert "no snapshot" in wayback["rights_pages"] and "Save Page Now" in wayback["method"]
69
  assert any("history of the rights pages" in item for item in EVIDENCE["not_checked"])
70
 
71