ppuzio commited on
Commit
3bab9f9
·
1 Parent(s): a8792dc

1000_novels: rescreen with cited translator death years, pin the screen (837 -> 887 texts) (#65)

Browse files

- 1000_novels: rescreen with cited translator death years (837 -> 888 texts) (4807a4530a9c4a609f3c04a4d8218733c0a0bbeb)
- 1000_novels: drop the Wolne Lektury footer path, pin the screen CSV (888 -> 887 texts) (ead9e973fb8c9334085256ab5b8479e4a95a6a66)
- Merge origin/main (samorzad_gov_pl #64, global_voices) into v026-1000_novels (d705fa1365d00919e6026d92ee4cc524608e9ed5)

artifacts/source_findings.md CHANGED
@@ -1433,3 +1433,50 @@ permission stays the partner's work.
1433
  **Lesson** — the licence covers what the publisher created. A per-post editorial note
1434
  is the only signal of a partner's work, so the filter has to read the note and not only
1435
  the byline.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1433
  **Lesson** — the licence covers what the publisher created. A per-post editorial note
1434
  is the only signal of a partner's work, so the filter has to read the note and not only
1435
  the byline.
1436
+
1437
+ ## `1000_novels` rescreened: unknown authors fail closed, translator death years cited
1438
+
1439
+ **Investigated:** 2026-10-06
1440
+ **Verdict:** keep 888 of 1,000 texts as `public-domain` (was 837); drop 18 in copyright
1441
+ and 94 unresolved. Tracks slayerlabs/polish-dynaword-v2#44.
1442
+
1443
+ ### Verified
1444
+
1445
+ - Screen defect: a known public-domain translator cleared an author whose death year
1446
+ was unknown. `1000_novels_0733` (author "Roux", unidentified) shipped in the
1447
+ first rebuild this way. An unknown author now fails closed unless the work is listed
1448
+ as anonymous.
1449
+ - Translator death years now come from Biblioteka Narodowa / VIAF authority records,
1450
+ cited in `polish-dynaword-v2/scripts/novels_rights_screen.py`. Józef Pracki d. 1882,
1451
+ Edmund Cięglewicz d. 1928, Stanisław Sierosławski d. 1941, Bolesław Londyński d. 1928
1452
+ (22 texts), Ludwik Jenike d. 1903, Adam Stögbauer d. 1916, Kazimierz Bronikowski
1453
+ d. 1909, Maria Cumft-Pieńkowska d. 1920, Izydor Berman d. 1942, Konrad Drzewiecki
1454
+ d. 1922, Stefan Frycz d. 1960.
1455
+ - "tłum. A. W." on 29 Chekhov texts is Antoni Lange (d. 1929): BN catalogues their
1456
+ source edition (*Śmierć urzędnika*, Bibljoteka Groszowa 1926) with "nazwa właśc. tł.:
1457
+ Antoni Lange".
1458
+ - `1000_novels_0981` (Seneca's letter, "PRZEKŁAD", no name) is Żuławski's own
1459
+ translation in his 1914 collection *Bajka o człowieku szczęśliwym*. It is now
1460
+ credited to Seneca with Żuławski as translator.
1461
+ - "Roux" is Saint-Pol-Roux (d. 1940), so `0733` stays in on a cited death year.
1462
+ - `1000_novels_0462` (*Wola mocy*): BN credits Stefan Frycz (d. 1960) as
1463
+ co-translator. It is dropped although its Wolne Lektury footer says public domain. The
1464
+ screen's footer cross-check allowlists it by name.
1465
+ - Net: 53 unresolved and 10 Wolne-Lektury-footer rows move to public domain by term;
1466
+ 1 Wolne-Lektury-footer row moves to in copyright.
1467
+
1468
+ ### Not established
1469
+
1470
+ - "A. L." (`1000_novels_0734`, Schopenhauer 1901): BN records the cryptonym only. The
1471
+ row still rests on its Wolne Lektury footer (Inferred).
1472
+ - Edition rights (Art. 99¹–99²); dedup against `wolne_lektury` / `eltec_pol` (#45).
1473
+
1474
+ **Lesson:** a Wolne Lektury public-domain footer is a claim, not evidence. One of the
1475
+ 12 it covered had a translator who died in 1960.
1476
+
1477
+ **Update (2026-10-06, maintainer decision):** the screen no longer keeps a row on a
1478
+ Wolne Lektury public-domain footer. "A. L." (`1000_novels_0734`) now fails closed as
1479
+ unresolved, so the release keeps 887 texts and drops 18 in copyright and 95 unresolved.
1480
+ `src/clean_1000_novels.py` pins the screen CSV by SHA-256
1481
+ (`7fefc75f8fcbd07e5ec98842276765ffef9520b6acb4e24b4751c67cc3d2081c`, also in
1482
+ `1000_novels.license-evidence.json`).
data/1000_novels/1000_novels.attribution.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5519bac2b956db503b3c80312a9adbeaf77bc6e762a57a725a10a288c14eaa46
3
- size 304759
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ca43c45683ca0ba08aeda5d9f1089c3ca699450e2fca25ff972736f2024f603
3
+ size 323093
data/1000_novels/1000_novels.license-evidence.json CHANGED
@@ -1,19 +1,19 @@
1
  {
2
- "checked_at": "2026-10-05",
3
  "upstream": "https://clarin-pl.eu/dspace/handle/11321/312",
4
  "upstream_record_license": "CC BY 4.0, stated on a metadata-only record (read 2026-09-30); it does not license the texts",
5
  "upstream_rights_statement": "CLARIN-PL (Tomasz Naskręt), email reply received 2026-10-05: the handle currently contains metadata only and does not provide the corpus files for download or redistribution; CLARIN-PL does not distribute the individual novels or translations and does not hold documentation concerning the rights to the individual texts.",
6
  "text_license": "public-domain",
7
- "test": "Polish law (Art. 36): the author and every credited translator died in 1955 or earlier; a credited name without a curated death year fails closed. 12 rows rely on the retained Wolne Lektury footer stating no economic copyright (Inferred: Wolne Lektury's claim, not re-derived).",
8
  "not_assessed": "Edition and critical-edition rights (Art. 99^1-99^2).",
9
  "screen": "polish-dynaword-v2/evidence/1000_novels_rights_screen.csv",
10
  "screen_script": "polish-dynaword-v2/scripts/novels_rights_screen.py",
 
11
  "release_scope": {
12
  "screened": 1000,
13
- "kept": 837,
14
- "pd_by_term": 825,
15
- "pd_per_wolne_lektury": 12,
16
- "dropped_in_copyright": 17,
17
- "dropped_unresolved": 146
18
  }
19
  }
 
1
  {
2
+ "checked_at": "2026-10-06",
3
  "upstream": "https://clarin-pl.eu/dspace/handle/11321/312",
4
  "upstream_record_license": "CC BY 4.0, stated on a metadata-only record (read 2026-09-30); it does not license the texts",
5
  "upstream_rights_statement": "CLARIN-PL (Tomasz Naskręt), email reply received 2026-10-05: the handle currently contains metadata only and does not provide the corpus files for download or redistribution; CLARIN-PL does not distribute the individual novels or translations and does not hold documentation concerning the rights to the individual texts.",
6
  "text_license": "public-domain",
7
+ "test": "Polish law (Art. 36): the author and every credited translator died in 1955 or earlier; an author or credited name without a curated death year fails closed (anonymous works excepted), and a credited translator who died after 1955 makes the text in copyright. Translator death years added 2026-10-06 cite Biblioteka Narodowa / VIAF authority records in the screen script. A Wolne Lektury public-domain footer does not substitute for a death year: 1000_novels_0734 (translator \"A.L.\", not identified) is dropped as unresolved, and 1 row (1000_novels_0462, co-translator Stefan Frycz d. 1960) is dropped against its Wolne Lektury public-domain footer.",
8
  "not_assessed": "Edition and critical-edition rights (Art. 99^1-99^2).",
9
  "screen": "polish-dynaword-v2/evidence/1000_novels_rights_screen.csv",
10
  "screen_script": "polish-dynaword-v2/scripts/novels_rights_screen.py",
11
+ "screen_sha256": "7fefc75f8fcbd07e5ec98842276765ffef9520b6acb4e24b4751c67cc3d2081c",
12
  "release_scope": {
13
  "screened": 1000,
14
+ "kept": 887,
15
+ "pd_by_term": 887,
16
+ "dropped_in_copyright": 18,
17
+ "dropped_unresolved": 95
 
18
  }
19
  }
data/1000_novels/1000_novels.md CHANGED
@@ -8,7 +8,7 @@
8
  - **Language:** Polish (pl)
9
  - **License:** `public-domain` (public domain in Poland; per-row basis in `1000_novels.attribution.jsonl`)
10
  - **Created (range):** unknown
11
- - **Added:** 2026-07-02; rebuilt 2026-10-05 as the public-domain subset
12
 
13
  ## Licensing — traceable basis
14
  The CLARIN-PL record states CC BY 4.0, but CLARIN-PL confirmed on 2026-10-05 that the
@@ -21,41 +21,45 @@ script `polish-dynaword-v2/scripts/novels_rights_screen.py`):
21
 
22
  | status | texts | released |
23
  |---|---:|---|
24
- | public domain by term: the author and every credited translator died in 1955 or earlier (Art. 36) | 825 | yes |
25
- | marked public domain by Wolne Lektury in the retained footer | 12 | yes |
26
- | in copyright; published by Wolne Lektury under CC BY-SA 3.0 | 17 | no |
27
- | author or translator not verified, or the text does not match its file | 146 | no |
28
 
29
- The 12 Wolne Lektury rows rely on Wolne Lektury's statement, not on a death year we
30
- verified. Edition and critical-edition rights (Art. 99¹–99²) are not assessed.
 
 
 
 
31
 
32
  ## Attribution
33
  The `author` column credits the author and, for translations, the translator:
34
  `Hans Christian Andersen (tłum. Cecylia Niewiadomska)`. `1000_novels.attribution.jsonl`
35
  has, per row: author, author's death year, translator, title, how the title was read
36
- (`file`: header text matching the CLARIN file name, 790; `position`: the line beside the
37
- author line, 32; `manual`: read by hand, 15), CLARIN file name, screen status and basis.
38
 
39
  ## Provenance
40
  Pulled from SpeakLeash's public redistribution (`speakleash-ds-pub`, key
41
  `1000_novels_corpus_CLARIN-PL`) of the CLARIN-PL corpus; row *i* matches the *i*-th file
42
  of the CLARIN listing. Rebuilt by `src/clean_1000_novels.py` from the v0.2.5 Parquet
43
- (SHA-256 pinned in the script). Text, `added`, `created` and `token_count` are unchanged.
 
44
 
45
  ## Statistics
46
  | documents | characters | tokens (tiktoken proxy) |
47
  |---:|---:|---:|
48
- | 837 | 129,722,658 | 51,765,528 |
49
 
50
  ## Per-document license metadata
51
  | license | documents |
52
  |---|---:|
53
- | `public-domain` | 837 |
54
 
55
- Author metadata present for **837** documents.
56
 
57
  ## Filters applied
58
- - rights screen: read 1,000 → kept 837 (dropped 17 in copyright, 146 unresolved)
59
  - no length, language, deduplication or OCR filters in this rebuild
60
 
61
  Token counts are a fast tiktoken (cl100k) proxy (~1% off Llama-3); the canonical
 
8
  - **Language:** Polish (pl)
9
  - **License:** `public-domain` (public domain in Poland; per-row basis in `1000_novels.attribution.jsonl`)
10
  - **Created (range):** unknown
11
+ - **Added:** 2026-07-02; rebuilt 2026-10-05 as the public-domain subset; rescreened 2026-10-06
12
 
13
  ## Licensing — traceable basis
14
  The CLARIN-PL record states CC BY 4.0, but CLARIN-PL confirmed on 2026-10-05 that the
 
21
 
22
  | status | texts | released |
23
  |---|---:|---|
24
+ | public domain by term: the author and every credited translator died in 1955 or earlier (Art. 36) | 887 | yes |
25
+ | in copyright: 17 published by Wolne Lektury under CC BY-SA 3.0, 1 with a translator who died in 1960 | 18 | no |
26
+ | author or translator not verified, or the text does not match its file | 95 | no |
 
27
 
28
+ Translator death years added on 2026-10-06 cite Biblioteka Narodowa and VIAF authority
29
+ records, listed in the screen script. They identify the cryptonym "A. W." on 29 Chekhov
30
+ texts as Antoni Lange (d. 1929). They also show that *Wola mocy* (`1000_novels_0462`) was
31
+ co-translated by Stefan Frycz (d. 1960), so it is dropped although its Wolne Lektury footer
32
+ says public domain. A Wolne Lektury public-domain footer alone does not clear a text:
33
+ `1000_novels_0734` (translator "A.L.", not identified) is dropped as unresolved. Edition and critical-edition rights (Art. 99¹–99²) are not assessed.
34
 
35
  ## Attribution
36
  The `author` column credits the author and, for translations, the translator:
37
  `Hans Christian Andersen (tłum. Cecylia Niewiadomska)`. `1000_novels.attribution.jsonl`
38
  has, per row: author, author's death year, translator, title, how the title was read
39
+ (`file`: header text matching the CLARIN file name, 838; `position`: the line beside the
40
+ author line, 32; `manual`: read by hand, 17), CLARIN file name, screen status and basis.
41
 
42
  ## Provenance
43
  Pulled from SpeakLeash's public redistribution (`speakleash-ds-pub`, key
44
  `1000_novels_corpus_CLARIN-PL`) of the CLARIN-PL corpus; row *i* matches the *i*-th file
45
  of the CLARIN listing. Rebuilt by `src/clean_1000_novels.py` from the v0.2.5 Parquet
46
+ and the screen CSV, both pinned by SHA-256 in the script. Text, `added`, `created` and
47
+ `token_count` are unchanged.
48
 
49
  ## Statistics
50
  | documents | characters | tokens (tiktoken proxy) |
51
  |---:|---:|---:|
52
+ | 887 | 130,201,301 | 51,981,548 |
53
 
54
  ## Per-document license metadata
55
  | license | documents |
56
  |---|---:|
57
+ | `public-domain` | 887 |
58
 
59
+ Author metadata present for **887** documents.
60
 
61
  ## Filters applied
62
+ - rights screen: read 1,000 → kept 887 (dropped 18 in copyright, 95 unresolved)
63
  - no length, language, deduplication or OCR filters in this rebuild
64
 
65
  Token counts are a fast tiktoken (cl100k) proxy (~1% off Llama-3); the canonical
data/1000_novels/1000_novels.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2947b057afa57204f3cc2d29752dfc2b2eb1a9482d9449716d849c5b172621d2
3
- size 63085970
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6d568499837a4c2518396849462e16a2203996e077c7d551c0e17cda6f69fd82
3
+ size 63324274
data/1000_novels/1000_novels.stats.json CHANGED
@@ -1,29 +1,28 @@
1
  {
2
  "read": 1000,
3
- "kept": 837,
4
- "drop_rights": 163,
5
  "drop_short": 0,
6
  "drop_lang": 0,
7
  "drop_dup": 0,
8
  "drop_ocr": 0,
9
- "chars": 129722658,
10
- "tokens": 51765528,
11
  "licenses": {
12
- "public-domain": 837
13
  },
14
- "authors_with_value": 837,
15
  "license": "public-domain",
16
  "screen": {
17
- "pd_by_term": 825,
18
- "unresolved": 146,
19
- "in_copyright": 17,
20
- "pd_per_wolne_lektury": 12
21
  },
22
  "titles": {
23
- "file": 790,
24
  "position": 32,
25
- "manual": 15
26
  },
27
  "input_sha256": "27be09e5e2347dcf1a83e94b6c210ca26bdd89365bc3563e88ea5af9846990ea",
28
- "screen_sha256": "f5a68656f8ac7ff5c2a7a284094f944983ad8d33383e3d86cc40a1f31b9f2880"
29
  }
 
1
  {
2
  "read": 1000,
3
+ "kept": 887,
4
+ "drop_rights": 113,
5
  "drop_short": 0,
6
  "drop_lang": 0,
7
  "drop_dup": 0,
8
  "drop_ocr": 0,
9
+ "chars": 130201301,
10
+ "tokens": 51981548,
11
  "licenses": {
12
+ "public-domain": 887
13
  },
14
+ "authors_with_value": 887,
15
  "license": "public-domain",
16
  "screen": {
17
+ "pd_by_term": 887,
18
+ "unresolved": 95,
19
+ "in_copyright": 18
 
20
  },
21
  "titles": {
22
+ "file": 838,
23
  "position": 32,
24
+ "manual": 17
25
  },
26
  "input_sha256": "27be09e5e2347dcf1a83e94b6c210ca26bdd89365bc3563e88ea5af9846990ea",
27
+ "screen_sha256": "7fefc75f8fcbd07e5ec98842276765ffef9520b6acb4e24b4751c67cc3d2081c"
28
  }
src/clean_1000_novels.py CHANGED
@@ -9,7 +9,8 @@ kept only when the per-text rights screen finds it public domain in Poland:
9
  Kept rows are labelled `public-domain`, and `author` credits the author and any translator.
10
  Title, death year, screen basis and CLARIN file name go to `1000_novels.attribution.jsonl`.
11
 
12
- The input is the v0.2.5 Parquet, pinned by SHA-256. Restore it before a rerun:
 
13
  git checkout v0.2.5 -- data/1000_novels/1000_novels.parquet
14
  python3 src/clean_1000_novels.py --screen ../polish-dynaword-v2/evidence/1000_novels_rights_screen.csv
15
  """
@@ -31,9 +32,11 @@ SOURCE = "1000_novels"
31
  ROOT = Path(__file__).resolve().parents[1]
32
  DATA = ROOT / "data" / SOURCE
33
  INPUT_SHA256 = "27be09e5e2347dcf1a83e94b6c210ca26bdd89365bc3563e88ea5af9846990ea" # v0.2.5
 
 
34
  UPSTREAM = "https://clarin-pl.eu/dspace/handle/11321/312"
35
  LICENSE = "public-domain"
36
- KEEP = {"pd_by_term", "pd_per_wolne_lektury"}
37
  SCREENS = KEEP | {"in_copyright", "unresolved"}
38
  # Read off each text's header by hand where the rules below fail: no header, a dedication
39
  # ("H. K. T."), a series title (Proust), a title broken over lines, or a misspelt file name.
@@ -45,6 +48,8 @@ TITLES = {
45
  "proust_w-cieniu-zakwitajacych-dziewczat_tom-III_1937.txt": "W cieniu zakwitających dziewcząt",
46
  "prus_co-sie-z-wielkiej-idei-zrobilo-w-malym-miasteczku.txt": "Co się z wielkiej idei zrobiło w małem miasteczku",
47
  "prus_piesn-swiata_1935.txt": "Pleśń świata",
 
 
48
  "reymont_wampir.txt": "Wampir",
49
  "sienkiewicz_bajka1.txt": "Bajka",
50
  "sienkiewicz_bajka3.txt": "Bajka",
@@ -54,6 +59,7 @@ TITLES = {
54
  "Przygody trzech Rossyan i trzech Anglików w południowej Afryce",
55
  "zapolska_papuzia_1958.txt": "Papuzia",
56
  "zeromski_popioly.txt": "Popioły",
 
57
  "zulawski_z-domu-ojcow_1897.txt": "Z domu ojców",
58
  }
59
  NOT_A_TITLE = re.compile(r"^(tłum|tłumacz|przekład|rozdział|tom|księga|[IVXLC]+\.?$|\d+\.?$)", re.I)
@@ -130,6 +136,10 @@ def credit(author: str, translator: str) -> str:
130
 
131
 
132
  def build(input_path: Path, screen_path: Path, out_dir: Path) -> dict:
 
 
 
 
133
  if sha256(input_path) != INPUT_SHA256:
134
  raise SystemExit(f"{input_path} is not the v0.2.5 Parquet; restore it with "
135
  "`git checkout v0.2.5 -- data/1000_novels/1000_novels.parquet`")
@@ -165,7 +175,7 @@ def build(input_path: Path, screen_path: Path, out_dir: Path) -> dict:
165
  "licenses": {LICENSE: len(kept)}, "authors_with_value": sum(bool(r["author"]) for r in kept),
166
  "license": LICENSE, "screen": dict(Counter(r["screen"] for r in screen.values())),
167
  "titles": dict(Counter(a["title_from"] for a in attribution)),
168
- "input_sha256": INPUT_SHA256, "screen_sha256": sha256(screen_path),
169
  }
170
  staged = {
171
  out_dir / f"{SOURCE}.parquet.tmp": lambda p: pq.write_table(
 
9
  Kept rows are labelled `public-domain`, and `author` credits the author and any translator.
10
  Title, death year, screen basis and CLARIN file name go to `1000_novels.attribution.jsonl`.
11
 
12
+ The input is the v0.2.5 Parquet and the screen CSV, both pinned by SHA-256. Restore the Parquet
13
+ before a rerun:
14
  git checkout v0.2.5 -- data/1000_novels/1000_novels.parquet
15
  python3 src/clean_1000_novels.py --screen ../polish-dynaword-v2/evidence/1000_novels_rights_screen.csv
16
  """
 
32
  ROOT = Path(__file__).resolve().parents[1]
33
  DATA = ROOT / "data" / SOURCE
34
  INPUT_SHA256 = "27be09e5e2347dcf1a83e94b6c210ca26bdd89365bc3563e88ea5af9846990ea" # v0.2.5
35
+ # polish-dynaword-v2 evidence/1000_novels_rights_screen.csv for v0.2.6; also in 1000_novels.license-evidence.json
36
+ SCREEN_SHA256 = "7fefc75f8fcbd07e5ec98842276765ffef9520b6acb4e24b4751c67cc3d2081c"
37
  UPSTREAM = "https://clarin-pl.eu/dspace/handle/11321/312"
38
  LICENSE = "public-domain"
39
+ KEEP = {"pd_by_term"}
40
  SCREENS = KEEP | {"in_copyright", "unresolved"}
41
  # Read off each text's header by hand where the rules below fail: no header, a dedication
42
  # ("H. K. T."), a series title (Proust), a title broken over lines, or a misspelt file name.
 
48
  "proust_w-cieniu-zakwitajacych-dziewczat_tom-III_1937.txt": "W cieniu zakwitających dziewcząt",
49
  "prus_co-sie-z-wielkiej-idei-zrobilo-w-malym-miasteczku.txt": "Co się z wielkiej idei zrobiło w małem miasteczku",
50
  "prus_piesn-swiata_1935.txt": "Pleśń świata",
51
+ "puszkin_basn-o-krolu-saltanie_1924.txt":
52
+ "Baśń o królu Sałtanie, o jego synu, słynnym i potężnym bohaterze Gwidonie, i o pięknej królewnie Łabędziu",
53
  "reymont_wampir.txt": "Wampir",
54
  "sienkiewicz_bajka1.txt": "Bajka",
55
  "sienkiewicz_bajka3.txt": "Bajka",
 
59
  "Przygody trzech Rossyan i trzech Anglików w południowej Afryce",
60
  "zapolska_papuzia_1958.txt": "Papuzia",
61
  "zeromski_popioly.txt": "Popioły",
62
+ "zulawski_list-senki-do-lucjusza_1914.txt": "List Seneki do Lucyljusza",
63
  "zulawski_z-domu-ojcow_1897.txt": "Z domu ojców",
64
  }
65
  NOT_A_TITLE = re.compile(r"^(tłum|tłumacz|przekład|rozdział|tom|księga|[IVXLC]+\.?$|\d+\.?$)", re.I)
 
136
 
137
 
138
  def build(input_path: Path, screen_path: Path, out_dir: Path) -> dict:
139
+ if (found := sha256(screen_path)) != SCREEN_SHA256:
140
+ raise SystemExit(f"{screen_path} is not the pinned rights screen: SHA-256 {found}, expected "
141
+ f"{SCREEN_SHA256}; regenerate it with polish-dynaword-v2/scripts/novels_rights_screen.py "
142
+ "or update SCREEN_SHA256 and 1000_novels.license-evidence.json together")
143
  if sha256(input_path) != INPUT_SHA256:
144
  raise SystemExit(f"{input_path} is not the v0.2.5 Parquet; restore it with "
145
  "`git checkout v0.2.5 -- data/1000_novels/1000_novels.parquet`")
 
175
  "licenses": {LICENSE: len(kept)}, "authors_with_value": sum(bool(r["author"]) for r in kept),
176
  "license": LICENSE, "screen": dict(Counter(r["screen"] for r in screen.values())),
177
  "titles": dict(Counter(a["title_from"] for a in attribution)),
178
+ "input_sha256": INPUT_SHA256, "screen_sha256": SCREEN_SHA256,
179
  }
180
  staged = {
181
  out_dir / f"{SOURCE}.parquet.tmp": lambda p: pq.write_table(
src/sources.py CHANGED
@@ -710,13 +710,11 @@ SOURCES = {
710
  "Reduced by src/clean_1000_novels.py to the public-domain texts of the "
711
  "per-text rights screen; text unchanged.",
712
  "legal_note": "Public domain in Poland only (Art. 36, life + 70); status in other "
713
- "jurisdictions not assessed. 12 rows rely on Wolne Lektury's "
714
- "public-domain footer. Edition rights (Art. 99^1-99^2) not assessed.",
715
  "license": "public-domain",
716
  "license_spdx": "LicenseRef-Public-Domain-PL",
717
  "traceable": "Only texts in the public domain in Poland are kept: the author and "
718
- "every credited translator died in 1955 or earlier (Art. 36), or the "
719
- "retained Wolne Lektury footer states no economic copyright. Per-text "
720
  "screen: polish-dynaword-v2/evidence/1000_novels_rights_screen.csv; "
721
  "author, translator, title and basis per row in "
722
  "1000_novels.attribution.jsonl. The CLARIN-PL CC BY 4.0 record covers "
 
710
  "Reduced by src/clean_1000_novels.py to the public-domain texts of the "
711
  "per-text rights screen; text unchanged.",
712
  "legal_note": "Public domain in Poland only (Art. 36, life + 70); status in other "
713
+ "jurisdictions not assessed. Edition rights (Art. 99^1-99^2) not assessed.",
 
714
  "license": "public-domain",
715
  "license_spdx": "LicenseRef-Public-Domain-PL",
716
  "traceable": "Only texts in the public domain in Poland are kept: the author and "
717
+ "every credited translator died in 1955 or earlier (Art. 36). Per-text "
 
718
  "screen: polish-dynaword-v2/evidence/1000_novels_rights_screen.csv; "
719
  "author, translator, title and basis per row in "
720
  "1000_novels.attribution.jsonl. The CLARIN-PL CC BY 4.0 record covers "
src/test_1000_novels_contract.py CHANGED
@@ -4,8 +4,9 @@ import json
4
  from pathlib import Path
5
 
6
  import pyarrow.parquet as pq
 
7
 
8
- from clean_1000_novels import credit, file_slug, title_of
9
 
10
  ROOT = Path(__file__).resolve().parents[1]
11
  DATA = ROOT / "data" / "1000_novels"
@@ -17,14 +18,14 @@ def test_schema_counts_and_attribution():
17
  rows = table.select(["id", "source", "license", "author"]).to_pylist()
18
  sidecar = [json.loads(line) for line in (DATA / "1000_novels.attribution.jsonl").read_text(encoding="utf-8").splitlines()]
19
  assert table.column_names == ["id", "text", "source", "added", "created", "token_count", "license", "author"]
20
- assert table.num_rows == stats["kept"] == len(sidecar) == stats["screen"]["pd_by_term"] + stats["screen"]["pd_per_wolne_lektury"]
 
21
  assert len({r["id"] for r in rows}) == table.num_rows
22
  assert {r["source"] for r in rows} == {"1000_novels"}
23
  assert {r["license"] for r in rows} == {a["license"] for a in sidecar} == {"public-domain"}
24
- assert {a["screen"] for a in sidecar} <= {"pd_by_term", "pd_per_wolne_lektury"}
25
  scope = json.loads((DATA / "1000_novels.license-evidence.json").read_text(encoding="utf-8"))["release_scope"]
26
  assert scope == {"screened": stats["read"], "kept": stats["kept"], "pd_by_term": stats["screen"]["pd_by_term"],
27
- "pd_per_wolne_lektury": stats["screen"]["pd_per_wolne_lektury"],
28
  "dropped_in_copyright": stats["screen"]["in_copyright"], "dropped_unresolved": stats["screen"]["unresolved"]}
29
  by_id = {a["id"]: a for a in sidecar}
30
  assert by_id.keys() == {r["id"] for r in rows}
@@ -35,6 +36,20 @@ def test_schema_counts_and_attribution():
35
  assert bool(a["title"]) == (a["title_from"] != "none")
36
 
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  def test_title_rules():
39
  assert file_slug("sienkiewicz_krzyzacy_tom-II_1900.txt") == "krzyzacy-tom-ii"
40
  assert title_of("Henryk Sienkiewicz\nKrzyżacy\nTom II\n", "sienkiewicz_krzyzacy_tom-II_1900.txt", "Henryk Sienkiewicz") == ("Krzyżacy Tom II", "file")
 
4
  from pathlib import Path
5
 
6
  import pyarrow.parquet as pq
7
+ import pytest
8
 
9
+ from clean_1000_novels import SCREEN_SHA256, build, credit, file_slug, title_of
10
 
11
  ROOT = Path(__file__).resolve().parents[1]
12
  DATA = ROOT / "data" / "1000_novels"
 
18
  rows = table.select(["id", "source", "license", "author"]).to_pylist()
19
  sidecar = [json.loads(line) for line in (DATA / "1000_novels.attribution.jsonl").read_text(encoding="utf-8").splitlines()]
20
  assert table.column_names == ["id", "text", "source", "added", "created", "token_count", "license", "author"]
21
+ assert table.num_rows == stats["kept"] == len(sidecar) == stats["screen"]["pd_by_term"]
22
+ assert stats["screen"].keys() <= {"pd_by_term", "in_copyright", "unresolved"}
23
  assert len({r["id"] for r in rows}) == table.num_rows
24
  assert {r["source"] for r in rows} == {"1000_novels"}
25
  assert {r["license"] for r in rows} == {a["license"] for a in sidecar} == {"public-domain"}
26
+ assert {a["screen"] for a in sidecar} == {"pd_by_term"}
27
  scope = json.loads((DATA / "1000_novels.license-evidence.json").read_text(encoding="utf-8"))["release_scope"]
28
  assert scope == {"screened": stats["read"], "kept": stats["kept"], "pd_by_term": stats["screen"]["pd_by_term"],
 
29
  "dropped_in_copyright": stats["screen"]["in_copyright"], "dropped_unresolved": stats["screen"]["unresolved"]}
30
  by_id = {a["id"]: a for a in sidecar}
31
  assert by_id.keys() == {r["id"] for r in rows}
 
36
  assert bool(a["title"]) == (a["title_from"] != "none")
37
 
38
 
39
+
40
+ def test_screen_pin_matches_license_evidence_and_stats():
41
+ evidence = json.loads((DATA / "1000_novels.license-evidence.json").read_text(encoding="utf-8"))
42
+ stats = json.loads((DATA / "1000_novels.stats.json").read_text(encoding="utf-8"))
43
+ assert SCREEN_SHA256 == evidence["screen_sha256"] == stats["screen_sha256"]
44
+
45
+
46
+ def test_build_rejects_an_unpinned_screen(tmp_path):
47
+ screen = tmp_path / "screen.csv"
48
+ screen.write_text("id,screen\n1000_novels_0001,pd_by_term\n", encoding="utf-8")
49
+ with pytest.raises(SystemExit, match="not the pinned rights screen"):
50
+ build(tmp_path / "unused.parquet", screen, tmp_path)
51
+ assert list(tmp_path.iterdir()) == [screen]
52
+
53
  def test_title_rules():
54
  assert file_slug("sienkiewicz_krzyzacy_tom-II_1900.txt") == "krzyzacy-tom-ii"
55
  assert title_of("Henryk Sienkiewicz\nKrzyżacy\nTom II\n", "sienkiewicz_krzyzacy_tom-II_1900.txt", "Henryk Sienkiewicz") == ("Krzyżacy Tom II", "file")