ppuzio Claude Sonnet 5.5 commited on
Commit
4e175ab
·
1 Parent(s): 3bab9f9

open_agh_chemistry_pl: pin the four rights pages in a licence-evidence file

Browse files

Adds data/open_agh_chemistry_pl/open_agh_chemistry_pl.license-evidence.json
(URL, retrieval time, EPUB and rights-page sha256, quoted CC BY-SA 4.0 line per
book, Wayback status, chain with V/I marks, not_checked) and a contract test
tying it to books.json, the registry entry and the parquet. No data change.
No Wayback snapshot of any rights page exists; recorded, not archived.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

artifacts/source_findings.md CHANGED
@@ -1480,3 +1480,29 @@ unresolved, so the release keeps 887 texts and drops 18 in copyright and 95 unre
1480
  `src/clean_1000_novels.py` pins the screen CSV by SHA-256
1481
  (`7fefc75f8fcbd07e5ec98842276765ffef9520b6acb4e24b4751c67cc3d2081c`, also in
1482
  `1000_novels.license-evidence.json`).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1480
  `src/clean_1000_novels.py` pins the screen CSV by SHA-256
1481
  (`7fefc75f8fcbd07e5ec98842276765ffef9520b6acb4e24b4751c67cc3d2081c`, also in
1482
  `1000_novels.license-evidence.json`).
1483
+
1484
+ ## `open_agh_chemistry_pl`: rights pages pinned, no archive copy exists
1485
+
1486
+ **Investigated:** 2026-10-06
1487
+ **Verdict:** no data change; 370 documents stay CC BY-SA 4.0. The licence evidence is now in
1488
+ `data/open_agh_chemistry_pl/open_agh_chemistry_pl.license-evidence.json`. Tracks the 2026-10
1489
+ rights audit action "archive the rights pages".
1490
+
1491
+ ### Verified
1492
+
1493
+ - Re-fetched the four EPUBs (`/rpc/preview/handbooks/{29,1394,37,1893}/epub/light`) on
1494
+ 2026-10-05 23:38 UTC. EPUB and `OEBPS/main.xhtml` sha256 equal the values recorded on
1495
+ 2026-09-05, 4/4.
1496
+ - Each rights page says "Publikacja udostępniona jest na licencji Creative Commons Uznanie
1497
+ Autorstwa - Na tych samych warunkach 4.0." and links the 4.0 deed. No NC marker, no "3.0".
1498
+
1499
+ ### Not established
1500
+
1501
+ - No Wayback snapshot of any rights-bearing URL exists (CDX lookups, read-only; no Save Page
1502
+ Now). The `/handbook/{id}` landing pages are archived, but they are a ~3 kB shell without
1503
+ licence text. A later relabel of the rights pages cannot be ruled out; the bytes are pinned
1504
+ by sha256 instead. A written confirmation from AGH would close the gap.
1505
+ - Whether AGH holds every module's rights (no contract seen).
1506
+
1507
+ **Lesson:** an archive copy was the expected fallback for a licence page, and it did not
1508
+ exist. Pin the bytes when the source is first read.
data/open_agh_chemistry_pl/open_agh_chemistry_pl.license-evidence.json ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "license": "CC-BY-SA-4.0",
3
+ "license_name": "Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)",
4
+ "license_url": "https://creativecommons.org/licenses/by-sa/4.0/",
5
+ "status": "documented-open-cc-by-sa",
6
+ "review_scope": "licence of the four AGH e-textbooks as stated on each book's own rights page; not independent legal advice",
7
+ "checked_at": "2026-10-06",
8
+ "licensor": "AGH Akademia Górniczo-Hutnicza im. Stanisława Staszica w Krakowie (Wydział Odlewnictwa), with the named authors",
9
+ "books": [
10
+ {
11
+ "book_id": 29,
12
+ "title": "Chemia ogólna",
13
+ "rights_page": {
14
+ "url": "https://epodreczniki.open.agh.edu.pl/rpc/preview/handbooks/29/epub/light",
15
+ "member": "OEBPS/main.xhtml",
16
+ "retrieved_at": "Mon, 05 Oct 2026 23:38:09 GMT",
17
+ "last_modified": "Wed, 08 Apr 2026 13:34:13 GMT",
18
+ "epub_sha256": "147f4efe230faaddc23168f23d6c8d9b31a8070a775407e153359be29aa44776",
19
+ "rights_sha256": "dcc0565b004b43edba9404d8afcda827fffc9baf2954c6b4721294751481992e",
20
+ "quoted_licence_line": "Publikacja udostępniona jest na licencji Creative Commons Uznanie Autorstwa - Na tych samych warunkach 4.0.",
21
+ "licence_link": "https://creativecommons.org/licenses/by-sa/4.0/deed.pl",
22
+ "matches_recorded": {
23
+ "epub_sha256": true,
24
+ "rights_sha256": true
25
+ }
26
+ },
27
+ "recorded": {
28
+ "observed_at": "2026-09-05T15:59:15.746945+00:00",
29
+ "epub_sha256": "147f4efe230faaddc23168f23d6c8d9b31a8070a775407e153359be29aa44776",
30
+ "rights_sha256": "dcc0565b004b43edba9404d8afcda827fffc9baf2954c6b4721294751481992e"
31
+ },
32
+ "landing_page": "https://epodreczniki.open.agh.edu.pl/handbook/29"
33
+ },
34
+ {
35
+ "book_id": 1394,
36
+ "title": "Podstawy chemii nieorganicznej – układ okresowy",
37
+ "rights_page": {
38
+ "url": "https://epodreczniki.open.agh.edu.pl/rpc/preview/handbooks/1394/epub/light",
39
+ "member": "OEBPS/main.xhtml",
40
+ "retrieved_at": "Mon, 05 Oct 2026 23:38:10 GMT",
41
+ "last_modified": "Fri, 13 Mar 2026 15:57:21 GMT",
42
+ "epub_sha256": "6ca970872928580c1bbcde272db2e9390fcd0ab57720c08140589f9cc7873b40",
43
+ "rights_sha256": "3b5935a9c0955dee179633434d1bdeb05bfd473cabc759d42b70f98ad80993f9",
44
+ "quoted_licence_line": "Publikacja udostępniona jest na licencji Creative Commons Uznanie Autorstwa - Na tych samych warunkach 4.0.",
45
+ "licence_link": "https://creativecommons.org/licenses/by-sa/4.0/deed.pl",
46
+ "matches_recorded": {
47
+ "epub_sha256": true,
48
+ "rights_sha256": true
49
+ }
50
+ },
51
+ "recorded": {
52
+ "observed_at": "2026-09-05T15:59:18.343541+00:00",
53
+ "epub_sha256": "6ca970872928580c1bbcde272db2e9390fcd0ab57720c08140589f9cc7873b40",
54
+ "rights_sha256": "3b5935a9c0955dee179633434d1bdeb05bfd473cabc759d42b70f98ad80993f9"
55
+ },
56
+ "landing_page": "https://epodreczniki.open.agh.edu.pl/handbook/1394"
57
+ },
58
+ {
59
+ "book_id": 37,
60
+ "title": "Podstawy chemii polimerów",
61
+ "rights_page": {
62
+ "url": "https://epodreczniki.open.agh.edu.pl/rpc/preview/handbooks/37/epub/light",
63
+ "member": "OEBPS/main.xhtml",
64
+ "retrieved_at": "Mon, 05 Oct 2026 23:38:12 GMT",
65
+ "last_modified": "Tue, 09 Dec 2025 17:40:55 GMT",
66
+ "epub_sha256": "ab016c85ceaef10d84ad611debd8327dd5a3b61fec4cd6076e86f4bdb177d3e5",
67
+ "rights_sha256": "9cedb1bce94db91546d93b0b0985bdb4465ddd56addc664355ab12b95815f7fe",
68
+ "quoted_licence_line": "Publikacja udostępniona jest na licencji Creative Commons Uznanie Autorstwa - Na tych samych warunkach 4.0.",
69
+ "licence_link": "https://creativecommons.org/licenses/by-sa/4.0/deed.pl",
70
+ "matches_recorded": {
71
+ "epub_sha256": true,
72
+ "rights_sha256": true
73
+ }
74
+ },
75
+ "recorded": {
76
+ "observed_at": "2026-09-05T15:59:21.482593+00:00",
77
+ "epub_sha256": "ab016c85ceaef10d84ad611debd8327dd5a3b61fec4cd6076e86f4bdb177d3e5",
78
+ "rights_sha256": "9cedb1bce94db91546d93b0b0985bdb4465ddd56addc664355ab12b95815f7fe"
79
+ },
80
+ "landing_page": "https://epodreczniki.open.agh.edu.pl/handbook/37"
81
+ },
82
+ {
83
+ "book_id": 1893,
84
+ "title": "Korozja i ochrona przed korozją",
85
+ "rights_page": {
86
+ "url": "https://epodreczniki.open.agh.edu.pl/rpc/preview/handbooks/1893/epub/light",
87
+ "member": "OEBPS/main.xhtml",
88
+ "retrieved_at": "Mon, 05 Oct 2026 23:38:14 GMT",
89
+ "last_modified": "Sat, 06 Dec 2025 00:00:05 GMT",
90
+ "epub_sha256": "d8597c42c5a32dcc2537fa52bd15b517fb3558bff98117b46797e9084cc26cb3",
91
+ "rights_sha256": "2943952456da69d500210c4162de86e4c1ac9a01f81a44aef0c3c2afecea1d83",
92
+ "quoted_licence_line": "Publikacja udostępniona jest na licencji Creative Commons Uznanie Autorstwa - Na tych samych warunkach 4.0.",
93
+ "licence_link": "https://creativecommons.org/licenses/by-sa/4.0/deed.pl",
94
+ "matches_recorded": {
95
+ "epub_sha256": true,
96
+ "rights_sha256": true
97
+ }
98
+ },
99
+ "recorded": {
100
+ "observed_at": "2026-09-05T15:59:25.181301+00:00",
101
+ "epub_sha256": "d8597c42c5a32dcc2537fa52bd15b517fb3558bff98117b46797e9084cc26cb3",
102
+ "rights_sha256": "2943952456da69d500210c4162de86e4c1ac9a01f81a44aef0c3c2afecea1d83"
103
+ },
104
+ "landing_page": "https://epodreczniki.open.agh.edu.pl/handbook/1893"
105
+ }
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 current bytes are pinned by the sha256 values above. Generation dates of the EPUBs are 2025-12 to 2026-04 (Last-Modified headers)"
113
+ },
114
+ "chain": [
115
+ {
116
+ "hop": "authors -> AGH",
117
+ "basis": "authors and editors named on each rights page as AGH staff; the rights page grants the licence in AGH's name and reserves the rights to authors and AGH (\"Pewne prawa zastrzeżone na rzecz autorów i Akademii Górniczo-Hutniczej\")",
118
+ "mark": "I"
119
+ },
120
+ {
121
+ "hop": "AGH -> public",
122
+ "basis": "each book's own rights page states CC BY-SA 4.0 (quoted_licence_line) and links the 4.0 deed; no NC marker, no \"3.0\" string in the page",
123
+ "url": "see books[].rights_page.url",
124
+ "mark": "V"
125
+ },
126
+ {
127
+ "hop": "EPUB -> polish-dynaword",
128
+ "basis": "src/build_open_agh_pl.py reads OEBPS/main.xhtml of the EPUB and fails closed on a missing by-sa/4.0 link, a missing \"Na tych samych warunkach\", a missing /handbook/{id} or an NC marker; rights_sha256 and epub_sha256 in books.json match the live bytes 4/4 on 2026-10-06",
129
+ "mark": "V"
130
+ }
131
+ ],
132
+ "not_checked": [
133
+ "third-party material inside the books: media are omitted from the dataset; \"3.0 PL\" strings occur only in third-party image captions (Wikimedia, edutab) and 0 of 370 texts contain them (rights audit 2026-10)",
134
+ "whether AGH holds all rights in every module (no contract seen); the rights page is the only grant",
135
+ "history of the rights pages before 2026-09-05 (no archive copy exists)"
136
+ ]
137
+ }
src/test_open_agh_chemistry_pl_contract.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Licence-evidence checks for open_agh_chemistry_pl (rights audit 2026-10).
2
+
3
+ The evidence file pins the four live EPUB rights pages. These tests keep it
4
+ consistent with books.json, the registry entry and the published rows; they do
5
+ not touch the network.
6
+ """
7
+
8
+ import hashlib
9
+ import json
10
+ import re
11
+ from pathlib import Path
12
+
13
+ import pyarrow.parquet as pq
14
+
15
+ from build_open_agh_pl import BOOK_IDS, LICENSE
16
+ from sources import SOURCES
17
+
18
+ KEY = "open_agh_chemistry_pl"
19
+ DATA = Path(__file__).resolve().parents[1] / "data" / KEY
20
+ EVIDENCE = json.loads((DATA / f"{KEY}.license-evidence.json").read_text(encoding="utf-8"))
21
+ BOOKS = {b["id"]: b for b in json.loads((DATA / f"{KEY}.books.json").read_text(encoding="utf-8"))}
22
+ SHA256 = re.compile(r"[0-9a-f]{64}")
23
+
24
+
25
+ def test_evidence_covers_every_book_with_the_recorded_hashes():
26
+ assert sorted(b["book_id"] for b in EVIDENCE["books"]) == sorted(BOOK_IDS) == sorted(BOOKS)
27
+ for entry in EVIDENCE["books"]:
28
+ page, recorded = entry["rights_page"], BOOKS[entry["book_id"]]["license_evidence"]
29
+ assert page["url"] == recorded["epub_url"]
30
+ assert page["epub_sha256"] == recorded["epub_sha256"]
31
+ assert page["rights_sha256"] == recorded["rights_sha256"]
32
+ assert SHA256.fullmatch(page["epub_sha256"]) and SHA256.fullmatch(page["rights_sha256"])
33
+ assert page["matches_recorded"] == {"epub_sha256": True, "rights_sha256": True}
34
+ # the stored rights page must hash to the pinned value and contain the quoted line
35
+ assert hashlib.sha256(recorded["rights_xhtml"].encode("utf-8")).hexdigest() == page["rights_sha256"]
36
+ assert page["quoted_licence_line"] in recorded["rights_text"]
37
+ assert page["licence_link"] in recorded["links"]
38
+
39
+
40
+ def test_licence_is_by_sa_4_0_everywhere_and_never_nc_or_3_0():
41
+ entry = SOURCES[KEY]
42
+ rows = pq.read_table(DATA / f"{KEY}.parquet", columns=["license"]).column("license").to_pylist()
43
+ assert {EVIDENCE["license"], entry["license"], entry["license_spdx"], LICENSE} == {"CC-BY-SA-4.0"}
44
+ assert set(rows) == {"CC-BY-SA-4.0"}
45
+ for entry in EVIDENCE["books"]:
46
+ line = entry["rights_page"]["quoted_licence_line"]
47
+ assert line.endswith("Na tych samych warunkach 4.0.")
48
+ assert "by-sa/4.0" in entry["rights_page"]["licence_link"]
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"])