Add CC BY-SA 3.0 Polish media-literacy lessons

#26
by PiotrSty - opened
artifacts/edukacja_medialna_pl_ontology_manifest.json ADDED
@@ -0,0 +1,484 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "actors": [
3
+ {
4
+ "id": "hf:PiotrSty",
5
+ "name": "Piotr Styla",
6
+ "type": "human"
7
+ },
8
+ {
9
+ "id": "agent:codex",
10
+ "name": "OpenAI Codex",
11
+ "type": "agent"
12
+ },
13
+ {
14
+ "id": "org:fnp",
15
+ "name": "Fundacja Nowoczesna Polska",
16
+ "type": "organization"
17
+ }
18
+ ],
19
+ "attestations": [
20
+ {
21
+ "type": "cross_source_deduplication",
22
+ "value": "pending_target_integration"
23
+ },
24
+ {
25
+ "type": "benchmark_overlap",
26
+ "value": "pending"
27
+ }
28
+ ],
29
+ "claims": [
30
+ {
31
+ "falsification_condition": "A retained record lacks either required license signal.",
32
+ "id": "claim:licensed-records",
33
+ "statement": "Every retained record passed the explicit page and XML CC BY-SA 3.0 gate.",
34
+ "supported_by": [
35
+ "evidence:checksums:ea342412e4e8fa48154de774fe55336d50c0f8b726c17a8904d43701e449ebd1",
36
+ "evidence:qa:31651600f3fdbd7fead125374f64ed1bd689a5f7fa14389f4d888b858cbeb8f5"
37
+ ]
38
+ },
39
+ {
40
+ "falsification_condition": "Controlled mix ablations show no relevant improvement or harmful style contamination.",
41
+ "id": "claim:diversity-hypothesis",
42
+ "statement": "This instructional media-literacy source may diversify a legal-heavy Polish pretraining mix.",
43
+ "status": "untested",
44
+ "supported_by": []
45
+ }
46
+ ],
47
+ "evidence": [
48
+ {
49
+ "append_only": true,
50
+ "id": "evidence:checksums:ea342412e4e8fa48154de774fe55336d50c0f8b726c17a8904d43701e449ebd1",
51
+ "observation_type": "checksums",
52
+ "payload": {
53
+ "NOTICE.md": "ca0ab465674b4d8b2e5db4a1c6d25a5565893b2e48803cf36b319bac3f3461fd",
54
+ "README.md": "4efd1ded246566b38668f1e6617dd1692d9f7f1bf7a8cbf0a1d2abdb73b47198",
55
+ "artifacts/attribution.jsonl": "8522652f776bd59c115453331b4a5c771f01e6467fab2938798c3aad0065e55d",
56
+ "artifacts/decisions.jsonl": "960bffd3e684a52a119633efbedc7d1ef0cd6d8c70bfbb16bb2c03c551da9962",
57
+ "artifacts/inventory.json": "2348fc675da837146af683bc548083fa93c43f6e1a2dbdf2408d36a97dbd92d9",
58
+ "artifacts/qa.json": "95e42a29bd2f1d328efac5f20378311a1806bd934b5bd88d6002a3bbf2ec78dc",
59
+ "artifacts/raw_xml.jsonl.gz": "828b7ac5f0d2eaf1c49882178363777ed8f74daccac0fcbd485ba9d0fb8369f1",
60
+ "artifacts/run.json": "07306bf4f5b8199dcba0d28442fa4fa38d8f9a684f976451b223e93138762f08",
61
+ "artifacts/sample.jsonl": "1d3277d93a5a1b9281ef1c71e745c9669eb2fac4cc78c7e60946557aedc7c1fa",
62
+ "artifacts/stats.json": "38c7a8418b798021ce217a8bd9c9c120a7b92a7ac8e0cdbf56cb76757eb7b8cf",
63
+ "data/train-00000-of-00001.parquet": "dbce26650981e8e552c7fdac48bd35c02e9bd0a56fced4ea4871489b5a2365c4",
64
+ "src/build_edukacja_medialna_pl.py": "6ded00d84d4f6686f53c05f99caabcaf8ec59cebf7027a63342612d214a5aaf4",
65
+ "src/requirements.txt": "a41710470f941a80c9cf2f6ef93357b2478797f00804816e925959fac302100b",
66
+ "src/test_edukacja_medialna_contribution.py": "79fcbb1d7018cac395e3dd405ad907e5043482c6e4cf6f1d1b4611f05fc05f78"
67
+ }
68
+ },
69
+ {
70
+ "append_only": true,
71
+ "id": "evidence:qa:31651600f3fdbd7fead125374f64ed1bd689a5f7fa14389f4d888b858cbeb8f5",
72
+ "observation_type": "quality_report",
73
+ "payload": {
74
+ "benchmark_overlap": "pending",
75
+ "cross_source_dedup": "pending target integration",
76
+ "exact_normalized_dedup": true,
77
+ "license_gate": "explicit CC BY-SA 3.0 required in lesson page and source XML",
78
+ "limitations": [
79
+ "source guidance includes historical material",
80
+ "external reading lists and long-quote elements omitted",
81
+ "remaining inline third-party excerpts require review",
82
+ "pattern checks are not comprehensive de-identification"
83
+ ],
84
+ "near_dedup": {
85
+ "method": "seeded MinHash 128 / LSH 0.8 candidates / exact 5-word Jaccard >= 0.9",
86
+ "removed": []
87
+ },
88
+ "pii_pattern_matches": {
89
+ "email": 1,
90
+ "labelled_phone": 0
91
+ }
92
+ }
93
+ },
94
+ {
95
+ "append_only": true,
96
+ "id": "evidence:validation:a18fc04225ac65cdee43834e35e8ebc1bba24163859ca59b4fc96d4078040b25",
97
+ "observation_type": "contract_validation",
98
+ "payload": {
99
+ "code_sha256": "79fcbb1d7018cac395e3dd405ad907e5043482c6e4cf6f1d1b4611f05fc05f78",
100
+ "finished_at": "2026-09-06T15:45:04.834732+00:00",
101
+ "id": "run:validation:0bfcd53334db42b0c23eaeac7485ee45a055ac45dd51288de45206c2259f5b08",
102
+ "result": "local contract validation passed",
103
+ "started_at": "2026-09-06T15:45:04.834732+00:00",
104
+ "success": true
105
+ }
106
+ }
107
+ ],
108
+ "objects": [
109
+ {
110
+ "id": "object:edukacja-medialna-source",
111
+ "type": "DatasetSource"
112
+ },
113
+ {
114
+ "id": "object:edukacja-medialna-derived",
115
+ "type": "Dataset"
116
+ }
117
+ ],
118
+ "protocols": [
119
+ {
120
+ "digest": "sha256:6d6b7e7a3d456dff4d5b6c6a6ade6d7c352582ca6c4bccf4e46f49a132517821",
121
+ "id": "protocol:6d6b7e7a3d456dff4d5b6c6a6ade6d7c352582ca6c4bccf4e46f49a132517821",
122
+ "specification": {
123
+ "dedup": "normalized exact then seeded MinHash/Jaccard",
124
+ "license_gate": "explicit CC BY-SA 3.0 on page and XML",
125
+ "name": "edukacja-medialna-direct-xml-v1",
126
+ "schema": [
127
+ "id",
128
+ "text",
129
+ "source",
130
+ "added",
131
+ "created",
132
+ "token_count",
133
+ "license",
134
+ "author"
135
+ ],
136
+ "selection": "Polish, >=300 body chars, creator present, no PII pattern match",
137
+ "source_scope": "https://edukacjamedialna.edu.pl/lekcje/",
138
+ "tokenizer": "tiktoken cl100k_base"
139
+ }
140
+ },
141
+ {
142
+ "digest": "sha256:ea264792613d37232fb335cd94ce0adf98ffc43fc88b4895cf7100f9160b5d1b",
143
+ "id": "protocol:ea264792613d37232fb335cd94ce0adf98ffc43fc88b4895cf7100f9160b5d1b",
144
+ "specification": {
145
+ "checks": [
146
+ "schema",
147
+ "counts",
148
+ "license",
149
+ "author attribution",
150
+ "PII patterns",
151
+ "samples",
152
+ "content addresses",
153
+ "acyclic lineage"
154
+ ],
155
+ "name": "edukacja-medialna-contract-v1"
156
+ }
157
+ }
158
+ ],
159
+ "relations": [
160
+ {
161
+ "predicate": "DERIVED_FROM",
162
+ "source": "version:data:ea342412e4e8fa48154de774fe55336d50c0f8b726c17a8904d43701e449ebd1",
163
+ "target": "version:source:9bca86eeedc6f04b29ecab5e704112aecd70eb88426b3b676ea7ee8101254a69"
164
+ },
165
+ {
166
+ "predicate": "FILTERED_BY",
167
+ "source": "version:data:ea342412e4e8fa48154de774fe55336d50c0f8b726c17a8904d43701e449ebd1",
168
+ "target": "protocol:6d6b7e7a3d456dff4d5b6c6a6ade6d7c352582ca6c4bccf4e46f49a132517821"
169
+ },
170
+ {
171
+ "predicate": "VALIDATED_AGAINST",
172
+ "source": "version:data:ea342412e4e8fa48154de774fe55336d50c0f8b726c17a8904d43701e449ebd1",
173
+ "target": "protocol:ea264792613d37232fb335cd94ce0adf98ffc43fc88b4895cf7100f9160b5d1b"
174
+ },
175
+ {
176
+ "predicate": "COMPATIBLE_WITH",
177
+ "source": "version:data:ea342412e4e8fa48154de774fe55336d50c0f8b726c17a8904d43701e449ebd1",
178
+ "target": "hf://datasets/SlayerLab/polish-dynaword@a916edecabc2be8832e08fb2bd9dfafcc1d2dd71"
179
+ }
180
+ ],
181
+ "runs": [
182
+ {
183
+ "code_sha256": "6ded00d84d4f6686f53c05f99caabcaf8ec59cebf7027a63342612d214a5aaf4",
184
+ "finished_at": "2026-09-06T15:44:48.898663+00:00",
185
+ "id": "run:30db02148d6e7afa693a38702bbfb5049975f07286eb7a51e0274b2bc1e0c2e3",
186
+ "inputs": {
187
+ "listing_sha256": "3b419c4637991185bcfe883240256164b8bb14d176dea2d6523e36abe7c9444a",
188
+ "xml_sha256": [
189
+ "45a117c0b6bf7f8a343d0fb9678b2628cbb249702c23075ecd0ce2ea87885906",
190
+ "752e2167921a2586729eecf2b7553c7c4cf090ec201eed1c28291d392abc5b6d",
191
+ "8320cb8645d72abdcfb91f67ea099995c99dd23fc657f388df7fdc86484270bf",
192
+ "0d3464ddf069975243aff1e6dacc10ec91307039afebb44423799cde23eab982",
193
+ "6a36d154c7eb98626197950cfc85dc1c3ecdfbf631ee3d74b793552c59a9de1f",
194
+ "6e84a4d9ef36f8c6a8750a2db906ba389077df5e45a58e503e9b51999f7488e6",
195
+ "ab8bd73fbbf51672c52c9e302c0604334d6df78416777357b23dacbc2f18d42e",
196
+ "0a6a7b0d7d68f862ff0144fafd496b0df49cccbc78f01c5a80411b0bfef30787",
197
+ "8868e801ba62cb84a6ab5c0cbb1dac0f240cfac3903f4a5907661efc3d5f8127",
198
+ "962a0e947a0677d390925eac4b645f97988ed22e88ede85e8a12f2d34a02f9e9",
199
+ "3090bee1059099dc4e4e960bec34cc3bf8c5747b877777f288577de186717827",
200
+ "f21e7ed03b03e1cc009c3671f35b0d2223586e9bc75962059407023a7353f3f5",
201
+ "32c786f4f81444f8de253ecaf3af18678d4d9fe75894f15d0ec74eee650dbbec",
202
+ "c9f822d70fcdf7b8e6a93bbca17ca988ecccf8af24a7becc4c12e1331e517f93",
203
+ "3bcffeca8f4e7a84c110091fe69b0101f87fcf189ff7823b37191eebb06af851",
204
+ "56dd5b8659c150cf38a7f85a17f9e986cd45b7abb8dc9da115b84501fd55291c",
205
+ "c7f1d380ad4e1c348c1234c7a385f48bfcb92acd63cf53ed903d9c1a1a76e0b6",
206
+ "93a327081993b689a66b7c9b5434f0fd4f6077c1d7365a8e842af21f253c716b",
207
+ "57b7ab003fcf20358b031a300c2e959d4256ab012d16cd595ec581b6a63409c2",
208
+ "b873e6f3741e5b43bd7f45f245858fb8552d665dab4ad0181b6681f4e1a8d747",
209
+ "fc3be537ff9640245874916d4b90b7b7702a296b79a5f0708a8d4425e2f16ec8",
210
+ "481de8662b5555aac2a1996241c59932f12f2fc4caef810dfef897cfc30e413b",
211
+ "3ffaeb2de2870f5911a953f9c265ba5d5ca3c5d6b07e6808a959a5b27d1ad61b",
212
+ "07c3ace369332b9c7c949974ba899cc2e7e8c03d96717f446fdf8d5a8a4358b4",
213
+ "418b5f06fbb5f5aea1a2b2c35df510fbfc8f36f539252bd38aa6126d523295fe",
214
+ "cce7c817de8700b44810f51da2caa8d5dd185680cd94ab9b5d72b4ae45582df6",
215
+ "92819d721ed665ff3c8dce1e9517efa20c9f343f85822e59dbe3eb8abb6a1e17",
216
+ "a90bf090350b40393c92ea8cd4e15014c3b0f7dbafb7dbc659982687b6ff6967",
217
+ "e29b76a5488328f99c3d00d7df97203b59fa17b04fa47cf85d733725f7ce186f",
218
+ "c81b3a268f712d972be690c8d30253dc0415087cd40fdad818923dd0f65307d9",
219
+ "b500fc3567bea21eafffa46202db906b343551bb52f89c06ac96219fd54e9328",
220
+ "cd62250f0d8b7c5f5de47b092a589375eefabafea78d4b6cc7f77c90ed5c76c8",
221
+ "45f37918a07b0685fae0ffc4ba93bcd7f650b230f436ab843c5d658ee85aeac7",
222
+ "83a6dc540fd22c34a86f5fc17ed88d44e21e3d0dc1ae89bdce85a815cf946b12",
223
+ "c4823d8aebb703d02f238b81425a0dacd019076571b80fc0c80d357ccbfc845f",
224
+ "840ec36deab629947305bf4742da9e516e23fb4563ca78d305ed21deb86f9311",
225
+ "2d19d284c5a9567c74a2d3adf33fa3c35f5570e1781a1391a52cdd7c6e9d53f0",
226
+ "2e777e4609313ae61bdaadccc434816bfd0453e7b6f7bf5941d8f088e7bdc0ab",
227
+ "7e33cab2647258a0ff481c627b845731bd381a45ffd3c56318372f7374afee75",
228
+ "41b2d53bfa71d325ff18ef0156c9ec297c7099cb0e3fa6180061982a9dd6d893",
229
+ "438fe4a96999ffab1313573d5623d6b896ddfe21b3ffac00d029fa03457170a1",
230
+ "3b038b0d0c608ce32e098ca5e5cd3f4ff880fa57cb8de2fe8607c427fe0b7c74",
231
+ "0c9790437334307c3881d88ce2e06ded4199c6a42ac5c35604057f877a1f5ad1",
232
+ "9c6b82b04fb06a2653f2d5e538d5a348116634b59e576718aec90a1e1876921c",
233
+ "93830c27a2270b62a822c97556d9b877c93aa8f303a7bb688eadeee37c6498b9",
234
+ "48d73d51a0f75fd02e96848ec1cd31a2054874c8551812519a28e5f44fa0554e",
235
+ "10dc51c0380e816eec79f4dcf2aa62a573a849330a8da676cc2b2ea94e1fed2a",
236
+ "83c2afa1f6abe2a8e9156012b36b33d65a59016b10e3870bb5506a5451101e02",
237
+ "4cbebbb3ba735134fce25eedca1f81a6d2b1ead4a1cd89d9ac3414210fdee289",
238
+ "ef103c9ee957b9c78013cb97425a90d24159211aa96c59c37c62201cd3e596d1",
239
+ "1ad8bbf1ca67999c05628cbde2c71f862b3df5bbb5440054931336e0f8f417cd",
240
+ "a1f1d5577fa0ecf66684c7a0ffa1029fda4226f2ee662fb385bae86cba5066d9",
241
+ "1b7bf040994a6babcda72fea16d4763e83686f77c178cd461e605207fb397008",
242
+ "b978a49409a90619e95160ed87edc5869c7760ce61163c0d2c6205cb68e9d896",
243
+ "e149916bd11949593a39f3824d333443deb4cc636bd24d9477fe11e485326a54",
244
+ "7fe985edd3484a13f05e48c058e588803c6596cc5d8f9d0103cb0f919f4e20d5",
245
+ "41620bdc576459a7a4a49a3fd378aad70f8edb5a8e0d2c67ca8279e108e8ff91",
246
+ "bb397f5a893a618d6b3052e1b1caf1d85320165302ca9acbc606129a26474fe6",
247
+ "4eb3dd17403322aca88120e093f2baeaac3939e5cabca1e9cbd25d4b4da73ce5",
248
+ "e554c5c199398be41c8172cb621d7ca4d9917391ff30c3082cb46b80382a303d",
249
+ "0bc21cde0ec4f986472498a6b4e4ed3c1adb79d9cea9791ec046aaa59c62a908",
250
+ "036e318af17e54c132ad5cb6b6c9beeb850c5a2d6aaa9b2ce6bfb87a58648e70",
251
+ "0c07139b9eb887c31a26e4f58db7601605dadb120b18ca13a648016670dce8cb",
252
+ "c018c0a92830649cab400aa0e5ba959f520d5681e4da77df4cbe2ce0b9af74b4",
253
+ "33f1195261f8798a86db6baefc29de8288824bbfefdf19ec150777d834d2794f",
254
+ "4a44efde04c72c757a7742206bd0cb63de750430fb7e02d1dcd4a7253adbff8a",
255
+ "e00dce0f44992b7fc01699c7d92463e12c51ef6f79288841e063f4ad55f65c06",
256
+ "ac7dad88d1b0340874cc98f40a4745c9b0ef5bbda6c6b03a3ff658e1ca3a45fa",
257
+ "1727d1f5a746b77890ef158324217d2a86dcc5f5a25087b0f9e2852d2c1e56ba",
258
+ "595fcec3d8b604c420ae749a2b7a9e4e1d0e6483b8dc740d807166f7181b91ba",
259
+ "f8a9fa3df20ae0664a24eb719cd49c748cabc721a7d6a002adb87aacde2003b7",
260
+ "8e26351ff3a06e124c1b323d0756d0d545873f1aef1b5d0ea7d7ceea6b5f93e7",
261
+ "a6ea39205a4f73bf96860bbf9e9707554aa0430db7bf0747245d14d23c980969",
262
+ "59ade27b9a161f630e0c7091c0159b1728b41c61513a42b475ad3e9d4daab744",
263
+ "deb7159daa1f314a493a03821a5e4a8a26e85e00c75771afcb40548f50e2d2e6",
264
+ "5de4c79f7f150d199dd57b61290e2175112ca5a62110526c743b87398e90a56e",
265
+ "31e9baf831306790536281d86a9624deb832194b72eb4f5abdc3378c52a6239b",
266
+ "71d885bdf524c614e382b43d764604a3d28048d9b66421cd781c0dd57859a907",
267
+ "dfb2548b9fdbef7c685be21641f7bc2c118329d80f6aa3138974a5799316e688",
268
+ "728d3dca94b7fc924e914efd36582f762437fb6eaefe0348330862b1c046ba2f",
269
+ "21898ca83126a1af094d1315d0281cc7db8e4afc6487b04f6247c7b004e5b6df",
270
+ "5594a0f199e9e6ebc74e4bdab0852eb99ef5cf10009e47bbc55681b70988eb9d",
271
+ "c53aa29522c4ef1654bc76cd05faf9730bb086410838f5c0f2e9bf63d3a0c8fc",
272
+ "a6e5ac6bdfe46259cd9c1918114815f26e29ac3b9e813f3f6baa5be056337528",
273
+ "0258c08af5fd4e88caa6658434785fc2249ce7ee0700fda36dbe9b93d7dd923b",
274
+ "66fdb607696c8551d1f005c7b1f672b2d78b38c25a7684b2b33f2b5115806b03",
275
+ "093c7a1a71a7fd6d5fc5158abc5f7cdfbc48aa789d3bec12e72cff0deb97e1ae",
276
+ "d19e9d4460a03f2da0aaf45b8e68409f122aadcf0383a14e8905c04733731aea",
277
+ "08bbda1dd31ff5d60a36cff51d4ec51c64745fbc9de00a510083230d2aab1210",
278
+ "4c341fce7ce3e3e958295ae859e370e3084f09e41b590943a11f9b7ffb84e64e",
279
+ "6acf4ed1d2d7e4afba6fd1cf2520a4fb33002504df8b886eb5c657a22dcaaf1d",
280
+ "97f0f7c86fa8fefe78a40183fd743606ed3acc0d5fdf5521bb83fcb17dba409b",
281
+ "acc6a79bb771b77c7dfdeab800ee22c76dd327c8f5e156a3f3d32b8a79e70fe7",
282
+ "623a37f7b663abad3ac996b46038c78e8ef1dc40660e30c11ba5eef3b118c05f",
283
+ "6bc1613e2d6fdd721fa19e3438be2dd1484de3adc9f3ed141143d9aaab0162a7",
284
+ "52be912322320743894f62d1aa3779ef17eee43765dc8f3444423786a7fd0c80",
285
+ "cea8d893e07992055e8503aa27e924eccc30049c2c9f8834c72e4bdccbe03a28",
286
+ "b41936552852194d6d65d4a0f82e85239ef7638016c7dffa8e1715a7f7c08b96",
287
+ "091855bd3ae4bd489300fe90cae1d5a09bcd4c4a27a5b1d9dc328e70564d33dd",
288
+ "7a3d24e0b0d97b718f1e8415e119257655415f284609513aad733a0e1b367a10",
289
+ "ad81f9a730aa3588f2ac51bf349feac2e25dcc4f0f6e26d57f824da26a3b7c1b",
290
+ "86e6d1c047e01215189b276a5c7f4ba6674d645ea7a2bf5cc1512a064ffc3f6b",
291
+ "6072b0434b8932b7f90700849e507f9ab983f5493ffd8daccc2110011952d8c8",
292
+ "7077a62ef6b99fa9e8d066dbfa909270d8d67343077f34a7d123e93cf8ffc392",
293
+ "e841fd60990f405a0b1b5dc6ce715d676f0e216f9dead5ec1cd081600abf13c3",
294
+ "8ad7dca1a6534bc5f38b4362eeb8adaff2f63f2a9d0c95e1af0e97247ae2a2d8",
295
+ "b4fe46133102b8265bec22abebad958de38ba2220fef91616ee221cf90acfffa",
296
+ "29b6df574d6010e79256e72f2cf2e5835d6cf00b12ba31b4c41896e8936fea44",
297
+ "efbd2c538b053e83bcc83456838af4fb118fa3bfdcc07effb1921f9d223fda12",
298
+ "65f0f6513b4a881a02cff97ec493ca9bb0e89dedf5eb5b1cd19f7a9a326fdbf6",
299
+ "6b44eaf2897acefb5a2c315149bdcc451eae456315ae6817a792026940ad3f2d",
300
+ "7e9a680e88913ac72a25600eab752de120e0759b4dc37b553126f8b582978bd5",
301
+ "c41af22068f7eaec64bf7d4cafd2f88cca6f95a2bad5d35fd62163b3658be554",
302
+ "a24159b33d108e223c265c45a61a60a5041a2b924fb0f372810e766e18026fd3",
303
+ "67dbb81438fda6c3ee0a00c0aa8f263b5c32fccb106612528dab9d77a71f7c28",
304
+ "fcb4bbc9d9d0feacac8b325c9d53bca484d3139bede91658fe53676cb675deb1",
305
+ "941899706f41f1580bcf99b1d5d9a887692891e6b61c596aaee83c7d6e58fd11",
306
+ "b7d9ca44ecd057c87528f1e1dc6c35614b031a96145b64e6674e4feb7c0dfa81",
307
+ "c15ba40bb15447155d02c515e4d696afac9f2be85d2db484361e8d0fbd43827a",
308
+ "9f1ae8f278112a66700b795c60a0287398227f54a0e5a80e3e1a79ae85c1715b",
309
+ "be0cb2bf7e3ea9e820d84882c86e9205d4c1331545a27a6634ffd991a35d166c",
310
+ "c59b8e7e66b449729c214a48fe3ee27fcec8093fd1cd7e05cbf7b3c4c21d2c13",
311
+ "5a888ca20a4c4f4541c83a132f5c8e5cc1a12784af8155d1908911cce60768ff",
312
+ "b311307a6d3f8a5f55c5e3132ba5e14d9fad2363bf46cac77ffd7f84a448b14b",
313
+ "66258d60315fffe6f979a6e89888a2167b70191ef3d641673f901deda0d2fc55",
314
+ "1c66d7b1c2d84f1483ce97a7a326c19e605c1995c2b5361eca898fa841dfd834",
315
+ "7aa4ee672c185a953af81dd84e0256698b16c4fa6111ed3220e965d780973b1a",
316
+ "9bf74f8e0a6e467abd76891e5c4e461f1375dc79b3674d6cd99baebdf0d4ec40",
317
+ "cf468d6bf86683f3ac1794e17482c8205cbe4bf68f7fa66b89b0c7cc02ca2ddd",
318
+ "b8fcb5bb1e55e50ad29e05cc421f4b540a7ddd4e261908325bac2aabef780542",
319
+ "9c6d06567f67a149dee2bc24fc444fe05f3c35e7fa5973040f2a53a592249f95",
320
+ "9147b3382321be9cbdf5d664f9fdfd2e9527bd8456c6eb4979d0a4e776d188ef",
321
+ "63d22b7d9b59b730241624e28f2e89fdf0d8f883c467564eddcf77d67ca9ae7a",
322
+ "643adbd81605e4eaf4ddf10011e8b20a6cf7df0dfd11c66e8ce36d208e70dec3",
323
+ "d840e042203b8b60f350290a15719024d520ccbd1a8ac93bb2babcec8bb8b4f3",
324
+ "d5544c65a8fd2b7c8310732b100dfc295fba272166ab9a35363022fcfe8b3da5",
325
+ "0db1a9018e9030868a4d96a88df2995c74dbd022cf4b983f28a36517e9555b8e",
326
+ "54d00f211bdc266fc27cbcdccfde176eee8724165da983970ebf0042480f99da",
327
+ "2f4e65a65b3caae81f0e3d3eb444fdb44911b11f36a4ca1a1d2e32d38d8505bc",
328
+ "60b591ba4ed4c7f0095f906171afd8b4b7f92a504380bf3b508e725c0b9abf30",
329
+ "7c2872d9c6f0351d07b4b089e5efa366b6ed861682dbc3e33c3df80aeb964a27",
330
+ "93673d03bbf45564ae3e22b89cbc3b61c27abc1a70608e6662fbb53ed1be3539",
331
+ "c201eb3336eac662715dfe54c0f0cc0cce9a7022741cbecb6a6ab3e8aff771f1",
332
+ "b3474f1d850a29f54afec8155db665d234d1433fced406333d356669d7b77f81",
333
+ "c254a3c8c70a175ef969a6336c6146c9391845acedba07f30ce33e4c4668c864",
334
+ "a6a70313c31ca830a452008652a2f0b79ac40a33ab3f0e70dfbfc1e457bdd3cc",
335
+ "d0d63ad94e8db1abb93bbaaff8fd2a6ba1d30e3554869fa0b63381fefd767136",
336
+ "7c366a6610242076990c2b62823e91ed4301648751a82967fd9482e4c36a47d8",
337
+ "3517ec4fa63354993b9fe40fe43b4242876fbcb77815fb81ed77b1c25bcd793d",
338
+ "ffe0f80db7726af9e2575c86fbcc2c9fd150f4de26a749190ef0313775ba7009",
339
+ "a2ce75905d4ff4bae04315db7c3dece7d8c5ed7076fecb8abf329062abcd2a02",
340
+ "6105196c2e89794a5ac18755a4e134ad1a8721dec64eaf732d820e2116b3cfe4",
341
+ "35eff45d89a6098923d639a240eba2dfb2d28b5dc561820c3c3ef8f423ead983",
342
+ "85f454bbacc2e681c3b603e0dae429446f78986d785044125f441c0bdeb12f11",
343
+ "74d13218b90cf0f35b81078016e1741349347fa6daa912c2aa6deb64f3ba020b",
344
+ "00836e31d8cdfdd0e808ff0aefd1e8cc347e0e00306f49d3e4b4fb80c51e49f8",
345
+ "0149b497a1258a7ccd6c5742d703da1229525553cd95c94ddd60f4c001a64323",
346
+ "d6d31412cb627a3502911bce4bfc3a7d995c06f7f69f62a11f0e3611810938a5",
347
+ "a1cfd6bd3d496523b280b9cf335f18e17daa50c6f8131b1d2237aba65b70604d",
348
+ "b8c18863d5393ba1d46d8003b7aab4dd5a79d9f8ad5b438d10e5122e60bcea19",
349
+ "770572cde159a189ca4a525ba86f631f5588ebb7370c43ce132275bb17261dbb",
350
+ "8312944ac5098b71d0149b5dc3660b5525da45b05b23fad104553bf6827bc66e",
351
+ "25ab958f0c8e08175ad56b645bb9576fea3d6ed4407ac4716a042a8a983957e2",
352
+ "0aff38016dfc5876d8ee5c94c931ee54aa02c7af11cbeb9f57651722f76d868a",
353
+ "ea8ba445c1ba4b85b6c4e4345fde39200b65054b7e36015df71d697163a81d37",
354
+ "f451c82f2654eb5627bb8e87d3807aca5c3f506374f86fe60ce2c8d58929eaaa",
355
+ "e789dc242d5ce5a650908db912ae1e18eba078f39ccbaa1527e9d9fca70421ee",
356
+ "6ce8406f429f272e7c5b56b6ed4f98f841049b4d9b15eea9aa7b3ada5cf13de6",
357
+ "f09df96a0118a3533d74e0278e705eee636b1c6a17bfd82eb5f7521ae542a269",
358
+ "ab44974d802a0b9ef8f9aae5d89edd01ae50d4fb40b600908012e40e7ddaaaff",
359
+ "8f5d692db1d47f1b87da7202690f8a2009e537d9372e59dec36f36f9f14fe76a",
360
+ "59b5bc8c3dc70b96c6a1ce198158c4aa1643dac35da3ad33924d9778df6fc229",
361
+ "c63700d0f1d58a9e8e506f5a0ff2e4fbff4ada34c7e934be6e8bce663b20e43f",
362
+ "6341f774100eb9a10fb3a204e62644eca574d2723919d21a3dccc927e258fe54",
363
+ "b4e0b6f105f13b29b3cd4ceee253a047a2f2090628f068cee6bb32adadee07ee",
364
+ "3860c11f86c095080c58c3796e8d6fbfbfbc4f3781db61efa5fb61ea9518522a",
365
+ "db6edc75a0503558d95ed267881e2ed7a3336ae2aba4376281bfac230164e496",
366
+ "102b6da1dc6c99e531ca684015d9b32043772f92800c541f89234120f1b493ea",
367
+ "91a7117a02213fecb3543a2e51633e4be5cc382b245ea5c40a32449438a46db6",
368
+ "e7e6435bdcc34c9612654e1604291ab5bbccf106c4fafede5e7cbbf38290644b",
369
+ "9459da33c6c39826505a4270755a786de43a21696362ecdd0ba080456e27c673",
370
+ "6a92c19166d9752f44660b829fb8c5665f11e0d8917bd99efd0122d0cb62815f",
371
+ "c8fd8f9c7b1476f487365b40b4bf60607603f0244851346968eab1423a45e3cc",
372
+ "fdd5e3c613ee1bec79fe4a332d8c126134c7a71eb682f490d98c54fc52061c83",
373
+ "e18d8134cc90d7632260ec29de7763d14d26b022744183b4d8f2770c507c0c81",
374
+ "14e8b61d80a976dc317b7e852ed5d4b80e6111da9f7c6cd17e072da8e5f5c66a",
375
+ "1b52a5741ada8adf7a5c602378f61ac9916b4e45e45d71a074a62150ba7b752a",
376
+ "eaefc03095ba07f1d34f37038aca99f05b2f3a07c8540bbe4e66e9ed82799d3f",
377
+ "348915bddf144d23b6ff4cdb2b9aba2312a13b46adc32f46907db7b8345eafa5",
378
+ "762ab44494f01293ce7eb2710909b33ce5617d121c6fa854aab5ff8f346f6618",
379
+ "6de99bc7ab279e9ae8c063fdcd6c86f3987799288de08a6d727f5ea8da9c8c6f",
380
+ "852a30e3ad670dea543ee916c800e5312d1162c651221746367973face402deb",
381
+ "8bb10005101f06a8384e3c88d714f60ec384a6b42c26a2c8e217263b0eee53a0",
382
+ "c9505e92dd59e75f39233fc51f8a47ac2ae30bddbf0e8c67a517ff8677acff02",
383
+ "ce966763e2f3fef2d6d1ecb717257bf49dbd7f0aeb2656a2e41536111dcb2fe7",
384
+ "ce7288a9dcf5802848ff8cf35dadd059aca775c561e788d46777fbed3180fdbe",
385
+ "d7a48cda0b84bfaf49bd8e0a4e8383ebee0a12431f25cdb2edadd595f397d895",
386
+ "608db163344c8c010e7d96f281cf4d2636b4bdabf40af86959c7ed363196a70d",
387
+ "4b3b12b4258b0853d6efedea0e93b548de371319b8682d4d409a38b4929b2114",
388
+ "8938e0b54b0375357dad571a76f9c2ffb3817e4b07e9f24316f93a84deba44ad",
389
+ "aa2fe7cba2b9640abe4c8f9b2f56664c2b54bf5bd56acf9e3fb99bc48275147b",
390
+ "c2f7092ec1ce2f288c6196103afb3fc3c53f1b1258b90a3272a0c7f3f8300eb7",
391
+ "faaf41070ebe96757be621751a8d7a8bb442ac33398194ed68ba24cef250563d",
392
+ "6fe3e6e989611965de8e88ae7bac666ce323f2f741f95ba9341e8a4db16658ab",
393
+ "2d794ef16b8126cbe8a52010b02cdd9b111984fa6788a7e611002967fb08c96d",
394
+ "e25ce024fb3e6946d8279c6838581bb39ff25be691d276c202b6cf94bb55dfc0",
395
+ "e1349f20a742f8fd23e6991f02ed0f1aea18dc0a0ae7d842bcd19bb1f8ffbbcc",
396
+ "8c2fe5409f6c3df58bcace0fa5268264d6d4407a7244378ca8aa1b11077838f4",
397
+ "c44a0321308618bf0d24114d37a0a9f911a9b6a807e312930d07f6cc847e27ba",
398
+ "2ab57e9d2e6235861c36e3cd5a868d140880fdb2903097553c0da4d332aabe6d",
399
+ "93623ff67037fc75aefec73e4424948fba68d48a815dace839b9e23b5bec88ff",
400
+ "6b2ef08040bf0889cfb2e0d91a9c02c9ba06cf2ee341afcff6d8b1936b26ed6d",
401
+ "fe3fd05118073acfbe5f92a4524a07be11a8a8160ce847271a0fdf9f04ecf5c1",
402
+ "3a3e52eea8060e5a93d44327c9b65ff99b4f9294ff8a43656ae7b39c40a65ede",
403
+ "615f7a176e50b7ff8fa0a4156a2d0772330a12aa8c771623fed5a87b8c6571e0",
404
+ "ceff728fcdaff992e9f5fb3a502d8ca4c39cfc1eac21456e5ac785170b2fdd80",
405
+ "b89e0cb86d51d0085b53a6d3094719793f7814fad24343f971a781c35373f04f",
406
+ "67ca38c79e099e3c19e1fa9a9444e9b6484cbf484a016188bda7956ec9e10348",
407
+ "59e49c3801f1300bc40f16da1def505b3c7a5ed73edab7eb2808331214acf2de",
408
+ "bad418ff2b50cb3ffad9649240bced937bd33b8248503f3df9d03c9e80577a04",
409
+ "f368c24d62de88f92e1dcbc97fc7b353611992e6b4a9bc644c4d1c549492cbfe",
410
+ "e26bf0dba86a28703439a979dfce775dd93149de8f3ca3308630343c8df98af2",
411
+ "736fb01b98d618aab484e3b41c74d27baddbde5225d692678158941dd7a63672",
412
+ "aea2dd4419466c41f25d57310521cb5a122ee8d3ea5c5dc6b7c5e38df4aefc7f",
413
+ "4e0f5a8e8cbe71df0383e55f290162df0398d3306dbad86f0809593fdd1f07fe",
414
+ "20ded9b7dcbbf9487e2ff12aa33c8c2451f813cf0b5d1d6b0089097894f1908d",
415
+ "ebd30cd56066159986c02d37da524e1259459dc14292da0c0750be7c43ceaea1",
416
+ "d7032010cc4f7d592dee2b5cf00b6385d34bff7609ab99728f031adc13ffeff5",
417
+ "2bb9d9e7d66076868970ee03802dbd1fb5eeaf90a37ad4af7896db68ccb39c42",
418
+ "ada705c4c61ae5bbbe51394d8a3ee6a71745a6f72fe8cf2905a1b501d124044c",
419
+ "3f8b8d69b8950bd5bed58e1cd8fb67846110dc012992764602bb992d6f2173bd",
420
+ "1e5c950b5983126145915c4176ddb72d18275c5c9d3dcee5fceac2328155b57e",
421
+ "b0cf67082c0cc6f3201604299572f277fd0c1f7f961301b0ed619b05f915a0a1",
422
+ "0be403122437476dacaa30afca603bdc3c83d46a1cdf390c8f331e1c1983bbe0",
423
+ "e981e78cbd927e5b826753c64a4192c8b176f7d8b7dcdaef45ba04974ee65824",
424
+ "84489ed657642a0966e3b392258474561e9b3f5c86885d55be3bbab3b3a16f39",
425
+ "9b35391bab7dd21ffe7bef0d87b6399ffc39b76eced3a11157eabf4e73ee1612",
426
+ "47fd784ad24e6185042546f53b68d97a655a622838c9be5dba7e50ab4461cebc",
427
+ "9e32a9706607f219ca128361452e04325a4e64aff441e588c8a2efeb1a976fb6",
428
+ "344e5a3882f950f0942f51931810ddf5fa0503998ad309d3d79c23317c0bf145",
429
+ "8426bd0ed0e4128e3c2cb9e5a1d0c5847d2f4430c401ede6afea929e6f1ab32f",
430
+ "86faf92bdeaff07562aa6b33e0927d213775751bc66f0b5b87bb34f6da7e2a17",
431
+ "b1a91c70dadd52470e6675cd4df0f646925a67aa57b30789d320c4919e9cd158",
432
+ "b8084309da4a5cd716eaae2ec33f638dd0891c47a3ed74d7f4b00f0fc3a8e76b",
433
+ "1d26b781da51c134287f1f9ae1e2ef41ea4cd8441b468480d7157a952af3aa36",
434
+ "c6f07cc727960f3c136c270072b1eba0481e804d85657649b494505c0f661dd4",
435
+ "541d4a595a263497b2bde14a5684a78d5bf689208525bf97097383e0858240f3",
436
+ "0d2c8719ef3996e7232ff5b0f13982e3c03f883f968c4c6cbf48c119f8fce717",
437
+ "80a288c4400c82a78b4c04ee8ae0e2875fe3eb62374ac6a02d62743d01fcdae8",
438
+ "f0b5ea8c746968fcd153d21a032f98ed772d880023a0fbea8c15905e679a67b0",
439
+ "f89d3035cbdc1d2a212482f69b4599d97026a62772f46bef9a8f0266d9508fa8",
440
+ "856a3642e240308a4ac4b8798e9a26cf3a45ef9d15ad6c7843c94f1fae2d3f0b",
441
+ "2c4c043c7f12853efd054a0ecd829fc3be3f4c6001e5ce7b051a9dc90e12aa2e",
442
+ "5b4ce38a7c972d442c8cbc40ed5494480bf11cc0daa8cfcac6434bd10a6fce00",
443
+ "5d7657004fdf5170c52ec201aa1cb3681b78e1535e1ccb9a7426eaa36a4a4198"
444
+ ]
445
+ },
446
+ "started_at": "2026-09-06T15:33:10.477789+00:00",
447
+ "stats": {
448
+ "acquired": 255,
449
+ "added": "2026-09-06",
450
+ "author_coverage": 1.0,
451
+ "characters": 2033576,
452
+ "discovered": 255,
453
+ "kept": 252,
454
+ "rejected": 3,
455
+ "sample_count": 12,
456
+ "tokens": 728987
457
+ },
458
+ "success": true
459
+ },
460
+ {
461
+ "code_sha256": "79fcbb1d7018cac395e3dd405ad907e5043482c6e4cf6f1d1b4611f05fc05f78",
462
+ "finished_at": "2026-09-06T15:45:04.834732+00:00",
463
+ "id": "run:validation:0bfcd53334db42b0c23eaeac7485ee45a055ac45dd51288de45206c2259f5b08",
464
+ "result": "local contract validation passed",
465
+ "started_at": "2026-09-06T15:45:04.834732+00:00",
466
+ "success": true
467
+ }
468
+ ],
469
+ "schema_version": "slayer-research-ontology/0.1-profile",
470
+ "versions": [
471
+ {
472
+ "digest": "sha256:9bca86eeedc6f04b29ecab5e704112aecd70eb88426b3b676ea7ee8101254a69",
473
+ "id": "version:source:9bca86eeedc6f04b29ecab5e704112aecd70eb88426b3b676ea7ee8101254a69",
474
+ "immutable": true,
475
+ "object_id": "object:edukacja-medialna-source"
476
+ },
477
+ {
478
+ "digest": "sha256:ea342412e4e8fa48154de774fe55336d50c0f8b726c17a8904d43701e449ebd1",
479
+ "id": "version:data:ea342412e4e8fa48154de774fe55336d50c0f8b726c17a8904d43701e449ebd1",
480
+ "immutable": true,
481
+ "object_id": "object:edukacja-medialna-derived"
482
+ }
483
+ ]
484
+ }
artifacts/source_findings.md CHANGED
@@ -611,3 +611,40 @@ the card: single term (10th), private citizens named.
611
  belongs in meta, not text: stripping it makes the body comparable across
612
  question and reply docs, and the before/after is the fastest reviewer evidence
613
  for any Sejm HTML source.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
611
  belongs in meta, not text: stripping it makes the body comparable across
612
  question and reply docs, and the before/after is the fastest reviewer evidence
613
  for any Sejm HTML source.
614
+
615
+ ---
616
+
617
+ ## Edukacja Medialna — media-literacy lessons (`edukacja_medialna_pl`)
618
+
619
+ **Investigated** — 2026-09-06 (review round 2026-09-28).
620
+
621
+ **Verdict** — `added`. 252 records / 728,987 `cl100k_base` tokens of CC BY-SA
622
+ 3.0 lesson materials — small, but a school-teaching register nothing else in the
623
+ corpus covers.
624
+
625
+ **Enumeration** — <https://edukacjamedialna.edu.pl/lekcje/> lists every lesson
626
+ (255 at fetch). Each lesson page carries its source XML: a `utwor` document with
627
+ Dublin Core fields and the authored `powiesc` body. `src/build_edukacja_medialna_pl.py`
628
+ fetches page + XML, checksums both (`page_sha256`, `xml_sha256`) and builds from
629
+ the pinned `artifacts/raw_xml.jsonl.gz`; nothing else is needed.
630
+
631
+ **License evidence** — verified at the origin (the mirror is not evidence for
632
+ itself): every lesson page ends with `Licencja: Creative Commons Uznanie
633
+ autorstwa - Na tych samych warunkach 3.0` linking
634
+ <https://creativecommons.org/licenses/by-sa/3.0/> (e.g.
635
+ <https://edukacjamedialna.edu.pl/lekcje/abc-bezpieczenstwa-w-sieci/>), the site
636
+ footer repeats the grant (<http://creativecommons.org/licenses/by-sa/3.0/deed.pl>),
637
+ and the source XML carries `dc:rights` + `dc:rights.license`. The build gate
638
+ requires the statement on page AND XML. Per-record `rights`/`rights_urls` and
639
+ hashes are pinned in `attribution.jsonl`.
640
+
641
+ **Blockers** — none to merge with `release: None`. Before a release: NERGAL pass
642
+ (the in-build redaction is e-mail/labelled-phone patterns only — 1 match), cross-source
643
+ exact/near dedup, benchmark-overlap check, and maintainer review of embedded
644
+ third-party excerpts and of the corpus-level BY-SA 3.0 treatment (proposal in the
645
+ datasheet: per-record attribution + share-alike note, adaptation released under
646
+ CC BY-SA 4.0).
647
+
648
+ **Lesson** — cite the license where the publisher states it (per-lesson
649
+ `Licencja:` line + XML rights fields), never a mirror. Pin the statement with
650
+ `page_sha256`/`rights_urls` so it survives site redesigns.
data/edukacja_medialna_pl/NOTICE.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Attribution and license
2
+
3
+ Source: https://edukacjamedialna.edu.pl/lekcje/
4
+ Publisher: Fundacja Nowoczesna Polska.
5
+ License: CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0/).
6
+ License statement at the origin: every lesson page ends with "Licencja: Creative Commons Uznanie autorstwa - Na tych samych warunkach 3.0" (e.g. https://edukacjamedialna.edu.pl/lekcje/abc-bezpieczenstwa-w-sieci/), and the edukacjamedialna.edu.pl site footer repeats the grant ("Jeśli nie oznaczono inaczej, wszystkie materiały na stronie są objęte wolną licencją ... – Na tych samych warunkach 3.0").
7
+
8
+ Per-record text/scenario/expert creators, canonical URLs, source dates and rights evidence are preserved in `artifacts/attribution.jsonl`. Raw source XML and acquisition hashes are preserved in `artifacts/raw_xml.jsonl.gz`.
9
+
10
+ Preparation: Piotr Styla with OpenAI Codex. Changes: extracted the authored `powiesc` lesson body from source XML; omitted external reading lists; normalized Unicode and whitespace; applied language, length, creator, license, limited PII-pattern and deduplication gates. No endorsement by Fundacja Nowoczesna Polska is implied.
data/edukacja_medialna_pl/edukacja_medialna_pl.attribution.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8522652f776bd59c115453331b4a5c771f01e6467fab2938798c3aad0065e55d
3
+ size 347519
data/edukacja_medialna_pl/edukacja_medialna_pl.decisions.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:960bffd3e684a52a119633efbedc7d1ef0cd6d8c70bfbb16bb2c03c551da9962
3
+ size 67322
data/edukacja_medialna_pl/edukacja_medialna_pl.md ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-sa-3.0
3
+ language:
4
+ - pl
5
+ task_categories:
6
+ - text-generation
7
+ configs:
8
+ - config_name: default
9
+ data_files:
10
+ - split: train
11
+ path: data/train-00000-of-00001.parquet
12
+ ---
13
+
14
+ # Edukacja Medialna PL
15
+
16
+ A text-only snapshot of Polish media-literacy lesson explanations and scenarios acquired directly from official lesson XML.
17
+
18
+ - Discovered: 255 lesson URLs
19
+ - Retained: 252 records
20
+ - Tokens: 728,987 (`cl100k_base` proxy)
21
+ - License: CC BY-SA 3.0 per retained record
22
+ - Author coverage: 100.0%
23
+
24
+ See `NOTICE.md`, `artifacts/attribution.jsonl`, `artifacts/decisions.jsonl`, `artifacts/qa.json`, `artifacts/checksums.json` and `artifacts/ontology.json`. Twelve complete deterministic records are in `artifacts/sample.jsonl`.
25
+
26
+ ## Origin and license
27
+
28
+ - Origin: Edukacja Medialna, run by Fundacja Nowoczesna Polska — lesson index
29
+ <https://edukacjamedialna.edu.pl/lekcje/>, per-lesson source XML pinned in
30
+ `artifacts/raw_xml.jsonl.gz`.
31
+ - License statement **at the origin** (verified on the site, not on the mirror):
32
+ every lesson page ends with `Licencja: Creative Commons Uznanie autorstwa -
33
+ Na tych samych warunkach 3.0`, linking <https://creativecommons.org/licenses/by-sa/3.0/>
34
+ — e.g. <https://edukacjamedialna.edu.pl/lekcje/abc-bezpieczenstwa-w-sieci/> —
35
+ and the site footer repeats the grant: "Jeśli nie oznaczono inaczej, wszystkie
36
+ materiały na stronie są objęte wolną licencją Creative Commons Uznanie
37
+ autorstwa – Na tych samych warunkach 3.0"
38
+ (<http://creativecommons.org/licenses/by-sa/3.0/deed.pl>).
39
+ - The build gate requires explicit CC BY-SA 3.0 on both the lesson page and the
40
+ source XML (`dc:rights` + `dc:rights.license`); per-record evidence (`rights`,
41
+ `rights_urls`, `page_sha256`, `xml_sha256`) is in `artifacts/attribution.jsonl`.
42
+
43
+ ## What the texts are
44
+
45
+ - **Genre**: authored teaching materials — knowledge-explainer prose ("Wiedza w
46
+ pigułce"), lesson plans and projects ("Pomysł na lekcję", "Zadanie": objectives,
47
+ classroom procedure, evaluation), and glossary entries ("Słowniczek"). One
48
+ document per lesson.
49
+ - **Register**: prepared didactic Polish — formal written prose with classroom
50
+ instructions, exercises and check questions; gender-inclusive paired forms
51
+ ("uczestnicy i uczestniczki"); standard spelling. Human-authored, not OCR'd,
52
+ not machine-translated; 62 credited authors across 252 records (roles
53
+ `textbook`, `scenario`, `expert`, `methodologist`).
54
+ - **Time span**: upstream publication dates 2012-11-09 – 2015-01-12 (per-record
55
+ `created`). The material includes historically dated technology and legal
56
+ guidance (see Limitations).
57
+
58
+ ## Collection and normalization
59
+
60
+ Every step lives in `src/build_edukacja_medialna_pl.py` and runs against the
61
+ pinned raw XML, so the shard is reproducible:
62
+
63
+ - **Acquire**: lesson index → 255 lesson URLs; lesson page HTML and source XML
64
+ fetched and checksummed (`page_sha256`, `xml_sha256`).
65
+ - **Extract**: only the authored `powiesc` body; leaf blocks kept (headings,
66
+ paragraphs, list points, glossary definitions, activity/scenario fields),
67
+ nested container duplication skipped. Extraction stops at the "Czytelnia"
68
+ heading — external reading lists, bibliography and long-quote elements are
69
+ omitted.
70
+ - **Normalize**: NFKC; soft hyphens (U+00AD), zero-width spaces (U+200B) and
71
+ control characters removed; space/tab/NBSP runs collapsed per line, lines
72
+ trimmed; runs of 3+ newlines capped at one empty line (paragraph breaks kept).
73
+ - **PII**: pattern-based redaction only — e-mail addresses → `[REDACTED:EMAIL]`,
74
+ labelled phone numbers (`telefon`/`tel.`) → `[REDACTED:PHONE]`. Matches in the
75
+ shard: 1 e-mail, 0 phones. This is not de-identification; a NERGAL pass is
76
+ required before release.
77
+ - **Gates and drops**: explicit CC BY-SA 3.0 on page and XML (255/255), credited
78
+ creator (3 dropped: `missing_creator`), body ≥ 300 chars (0 dropped), langid
79
+ Polish (7-language set, confidence ≥ 0.99; 0 dropped), exact dedup on
80
+ normalized text (0 dropped), near-dedup seeded MinHash 128 / LSH 0.8 with
81
+ exact 5-word Jaccard ≥ 0.9 (0 dropped). 252 of 255 retained.
82
+
83
+ Before/after excerpts of the extraction and normalization are in the PR
84
+ description.
85
+
86
+ ## Corpus-level CC BY-SA 3.0 treatment (proposal)
87
+
88
+ The records are CC BY-SA 3.0 works; the corpus is redistributed as CC BY-SA 4.0.
89
+
90
+ - **Attribution, per record**: `author` in the parquet plus
91
+ `artifacts/attribution.jsonl` — `authors` with `creator_roles`, `title`,
92
+ `canonical_url`/`page_url`/`xml_url`, `publisher`, `created`, `license` +
93
+ `license_url`, source `rights`/`rights_urls`, and
94
+ `page_sha256`/`xml_sha256`/`text_sha256`. Enough to credit each document under
95
+ BY-SA 3.0 §4 without consulting the mirror.
96
+ - **Share-alike note**: the corpus is an adaptation and is released under
97
+ CC BY-SA 4.0 — a later version of the same License Elements, which
98
+ [BY-SA 3.0 §4(b)](https://creativecommons.org/licenses/by-sa/3.0/legalcode)
99
+ permits for adaptations. Redistributors of these records or adaptations of
100
+ them must keep the per-record attribution and pass share-alike terms on
101
+ (CC BY-SA 3.0 or a later version with the same License Elements).
102
+
103
+ ## Inclusion argument
104
+
105
+ What this adds: authored didactic prose — objectives, exercises, classroom
106
+ procedure, glossary definitions — a school-teaching register the corpus does not
107
+ otherwise draw from (its registers are encyclopedic, legal, parliamentary,
108
+ journalistic and fiction). 728,987 tokens is a diversity addition, not a scale
109
+ one.
110
+
111
+ Bias and quality caveats: a single publisher (Fundacja Nowoczesna Polska) and 62
112
+ credited authors; a school-audience framing with gender-inclusive paired forms;
113
+ technology and legal guidance frozen at 2012–2015; embedded third-party excerpts
114
+ (quotations, linked works) may need separate review before release. Training
115
+ benefit is an untested diversity hypothesis.
116
+
117
+ ## Limitations
118
+
119
+ The source includes historically dated technology and legal guidance. Dates are upstream publication metadata, not proof of present-day currency. External reading lists are omitted. Embedded excerpts may require additional review. PII checks are pattern-based, not comprehensive de-identification. Cross-source DynaWord deduplication and benchmark-overlap checks remain pending. Training benefit is an untested hypothesis requiring controlled ablations.
120
+
121
+ ## Reproduction
122
+
123
+ Install `src/requirements.txt`, decompress `artifacts/raw_xml.jsonl.gz` to a work directory as `raw_xml.jsonl`, and run the builder against the preserved inventory. Live acquisition creates a new source Version and must use a fresh work directory.
data/edukacja_medialna_pl/edukacja_medialna_pl.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dbce26650981e8e552c7fdac48bd35c02e9bd0a56fced4ea4871489b5a2365c4
3
+ size 778646
data/edukacja_medialna_pl/edukacja_medialna_pl.qa.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "benchmark_overlap": "pending",
3
+ "cross_source_dedup": "pending target integration",
4
+ "exact_normalized_dedup": true,
5
+ "license_gate": "explicit CC BY-SA 3.0 required in lesson page and source XML",
6
+ "limitations": [
7
+ "source guidance includes historical material",
8
+ "external reading lists and long-quote elements omitted",
9
+ "remaining inline third-party excerpts require review",
10
+ "pattern checks are not comprehensive de-identification"
11
+ ],
12
+ "near_dedup": {
13
+ "method": "seeded MinHash 128 / LSH 0.8 candidates / exact 5-word Jaccard >= 0.9",
14
+ "removed": []
15
+ },
16
+ "pii_pattern_matches": {
17
+ "email": 1,
18
+ "labelled_phone": 0
19
+ }
20
+ }
data/edukacja_medialna_pl/edukacja_medialna_pl.sample.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/edukacja_medialna_pl/edukacja_medialna_pl.stats.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "acquired": 255,
3
+ "added": "2026-09-06",
4
+ "author_coverage": 1.0,
5
+ "characters": 2033576,
6
+ "discovered": 255,
7
+ "kept": 252,
8
+ "rejected": 3,
9
+ "sample_count": 12,
10
+ "tokens": 728987
11
+ }
src/build_edukacja_medialna_pl.py ADDED
@@ -0,0 +1,543 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Acquire, normalize, validate and publish Edukacja Medialna Polish lessons."""
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import ast
7
+ from collections import Counter
8
+ from datetime import datetime, timezone
9
+ import gzip
10
+ import hashlib
11
+ import json
12
+ import os
13
+ from pathlib import Path
14
+ import pprint
15
+ import re
16
+ import shutil
17
+ import subprocess
18
+ import sys
19
+ import time
20
+ import unicodedata
21
+ from urllib.parse import urljoin, urlparse
22
+ import xml.etree.ElementTree as ET
23
+
24
+ from bs4 import BeautifulSoup
25
+ import requests
26
+
27
+ BASE = "https://edukacjamedialna.edu.pl"
28
+ LISTING = BASE + "/lekcje/"
29
+ SOURCE = "edukacja_medialna_pl"
30
+ OWN_REPO = "PiotrSty/edukacja-medialna-pl"
31
+ TARGET = "SlayerLab/polish-dynaword"
32
+ LICENSE = "CC-BY-SA-3.0"
33
+ LICENSE_URL = "https://creativecommons.org/licenses/by-sa/3.0/"
34
+ FIELDS = ["id", "text", "source", "added", "created", "token_count", "license", "author"]
35
+ UA = "EdukacjaMedialnaResearch/1.0 (PiotrSty; public open-education corpus)"
36
+ BLOCKS = {
37
+ "naglowek_rozdzial", "naglowek_podrozdzial", "akap", "punkt",
38
+ "opis", "definiendum", "aktywnosc", "cwiczenie", "pomoce",
39
+ "forma", "czas", "tytul_dziela",
40
+ }
41
+
42
+
43
+ def now():
44
+ return datetime.now(timezone.utc).isoformat()
45
+
46
+
47
+ def sha(value):
48
+ if not isinstance(value, bytes):
49
+ value = json.dumps(value, ensure_ascii=False, sort_keys=True, separators=(",", ":")).encode()
50
+ return hashlib.sha256(value).hexdigest()
51
+
52
+
53
+ def save(path, value):
54
+ path.parent.mkdir(parents=True, exist_ok=True)
55
+ path.write_text(json.dumps(value, ensure_ascii=False, sort_keys=True, indent=2) + "\n", encoding="utf-8")
56
+
57
+
58
+ def load(path):
59
+ return json.loads(path.read_text(encoding="utf-8"))
60
+
61
+
62
+ def write_lines(path, rows):
63
+ path.parent.mkdir(parents=True, exist_ok=True)
64
+ path.write_text("".join(json.dumps(row, ensure_ascii=False, sort_keys=True) + "\n" for row in rows), encoding="utf-8")
65
+
66
+
67
+ def read_lines(path):
68
+ return [json.loads(line) for line in path.read_text(encoding="utf-8").splitlines() if line]
69
+
70
+
71
+ def normalize(text):
72
+ text = unicodedata.normalize("NFKC", text).replace("\u00ad", "").replace("\u200b", "")
73
+ text = re.sub(r"[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]", "", text)
74
+ lines = [re.sub(r"[ \t\xa0]+", " ", line).strip() for line in text.splitlines()]
75
+ return re.sub(r"\n{3,}", "\n\n", "\n".join(lines)).strip()
76
+
77
+
78
+ def local_name(tag):
79
+ return tag.rsplit("}", 1)[-1].split(":")[-1]
80
+
81
+
82
+ def http_get(url, attempts=5):
83
+ last = None
84
+ for attempt in range(attempts):
85
+ last = requests.get(url, timeout=(20, 90), headers={"User-Agent": UA, "Accept-Language": "pl"})
86
+ if last.status_code not in (429, 500, 502, 503, 504):
87
+ last.raise_for_status()
88
+ return last
89
+ time.sleep(2 ** attempt)
90
+ last.raise_for_status()
91
+
92
+
93
+ def lesson_links(html):
94
+ soup = BeautifulSoup(html, "html.parser")
95
+ result = set()
96
+ for anchor in soup.select("a[href]"):
97
+ url = urljoin(LISTING, anchor["href"])
98
+ parsed = urlparse(url)
99
+ if parsed.netloc == "edukacjamedialna.edu.pl" and re.fullmatch(r"/lekcje/[^/]+/", parsed.path):
100
+ result.add(url)
101
+ return sorted(result)
102
+
103
+
104
+ def page_metadata(page_url, payload):
105
+ soup = BeautifulSoup(payload, "html.parser")
106
+ xml_urls = sorted({urljoin(page_url, a["href"]) for a in soup.select('a[href*="/xml/"]') if a["href"].endswith(".xml")})
107
+ text = normalize(soup.get_text(" "))
108
+ license_links = sorted({urljoin(page_url, a["href"]) for a in soup.select("a[href]") if "creativecommons.org/licenses/" in a["href"]})
109
+ explicit = any("creativecommons.org/licenses/by-sa/3.0" in url for url in license_links)
110
+ return {"xml_urls": xml_urls, "license_links": license_links, "page_has_explicit_cc_by_sa_3": explicit,
111
+ "page_mentions_license": "Licencja:" in text}
112
+
113
+
114
+ def dc_values(root, suffix):
115
+ return [normalize(node.text or "") for node in root.iter() if local_name(node.tag) == suffix and normalize(node.text or "")]
116
+
117
+
118
+ def parse_xml(xml_bytes, page_url):
119
+ root = ET.fromstring(xml_bytes)
120
+ if local_name(root.tag) != "utwor":
121
+ raise ValueError("unexpected XML root")
122
+ title = (dc_values(root, "title") or [""])[0]
123
+ canonical = (dc_values(root, "identifier.url") or [page_url])[0]
124
+ dates = dc_values(root, "date")
125
+ rights = dc_values(root, "rights")
126
+ rights_urls = dc_values(root, "rights.license")
127
+ creators = []
128
+ creator_roles = {}
129
+ for node in root.iter():
130
+ name = local_name(node.tag)
131
+ if name.startswith("creator.") and normalize(node.text or ""):
132
+ role = name.split(".", 1)[1]
133
+ value = normalize(node.text or "")
134
+ creators.append(value)
135
+ creator_roles.setdefault(role, []).append(value)
136
+ body = next((node for node in root if local_name(node.tag) == "powiesc"), None)
137
+ if body is None:
138
+ raise ValueError("missing powiesc body")
139
+ chunks = []
140
+ stop = False
141
+ for node in body.iter():
142
+ name = local_name(node.tag)
143
+ value = normalize(" ".join(node.itertext())) if name in BLOCKS else ""
144
+ if name.startswith("naglowek_") and value.casefold() == "czytelnia":
145
+ stop = True
146
+ if stop:
147
+ continue
148
+ if name in BLOCKS and value and (not chunks or value != chunks[-1]):
149
+ # Keep only leaf-like blocks to avoid duplicating text from containers.
150
+ if not any(local_name(child.tag) in BLOCKS for child in list(node)):
151
+ chunks.append(value)
152
+ text = normalize("\n\n".join(chunks))
153
+ return {"title": title, "canonical_url": canonical, "created": dates[0][:10] if dates else "unknown",
154
+ "rights": rights, "rights_urls": rights_urls, "creators": sorted(set(creators)),
155
+ "creator_roles": creator_roles, "text": text}
156
+
157
+
158
+ def acquire(out):
159
+ if (out / "inventory.json").exists():
160
+ raise ValueError("inventory exists; use a fresh output for a new immutable acquisition")
161
+ out.mkdir(parents=True, exist_ok=True)
162
+ listing_response = http_get(LISTING)
163
+ links = lesson_links(listing_response.text)
164
+ if len(links) < 200:
165
+ raise ValueError(f"unexpectedly small listing: {len(links)}")
166
+ records = []
167
+ failures = []
168
+ for index, page_url in enumerate(links, 1):
169
+ slug = page_url.rstrip("/").rsplit("/", 1)[-1]
170
+ try:
171
+ page = http_get(page_url)
172
+ meta = page_metadata(page_url, page.content)
173
+ if len(meta["xml_urls"]) != 1:
174
+ raise ValueError(f"expected one XML link, got {len(meta['xml_urls'])}")
175
+ xml_response = http_get(meta["xml_urls"][0])
176
+ parsed = parse_xml(xml_response.content, page_url)
177
+ xml_cc = any("creativecommons.org/licenses/by-sa/3.0" in url for url in parsed["rights_urls"])
178
+ records.append({"slug": slug, "page_url": page_url, "xml_url": meta["xml_urls"][0],
179
+ "observed_at": now(), "page_sha256": sha(page.content), "xml_sha256": sha(xml_response.content),
180
+ "page_license_links": meta["license_links"], "page_has_explicit_cc_by_sa_3": meta["page_has_explicit_cc_by_sa_3"],
181
+ "xml_has_explicit_cc_by_sa_3": xml_cc, "metadata": {k: parsed[k] for k in parsed if k != "text"},
182
+ "xml": xml_response.content.decode("utf-8")})
183
+ except Exception as error:
184
+ failures.append({"slug": slug, "page_url": page_url, "error": str(error)})
185
+ if index % 25 == 0 or index == len(links):
186
+ print(f"Acquired {index}/{len(links)}; failures={len(failures)}", flush=True)
187
+ time.sleep(0.15)
188
+ save(out / "inventory.json", {"listing_url": LISTING, "listing_sha256": sha(listing_response.content),
189
+ "observed_at": now(), "discovered_links": links, "records": records, "failures": failures})
190
+ write_lines(out / "raw_xml.jsonl", records)
191
+ if failures:
192
+ raise ValueError("acquisition incomplete; inspect inventory failures")
193
+
194
+
195
+ def near_dedup(rows):
196
+ from datasketch import MinHash, MinHashLSH
197
+ index = MinHashLSH(threshold=0.8, num_perm=128)
198
+ features = {}
199
+ kept, removed = [], []
200
+ for row in rows:
201
+ words = re.findall(r"\w+", row["text"].casefold())
202
+ shingles = {" ".join(words[i:i + 5]).encode() for i in range(max(0, len(words) - 4))}
203
+ sig = MinHash(num_perm=128, seed=1)
204
+ if not shingles:
205
+ kept.append(row)
206
+ continue
207
+ sig.update_batch(sorted(shingles))
208
+ duplicate = None
209
+ score = 0.0
210
+ for candidate in sorted(index.query(sig)):
211
+ value = len(shingles & features[candidate]) / len(shingles | features[candidate])
212
+ if value >= 0.9:
213
+ duplicate, score = candidate, value
214
+ break
215
+ if duplicate:
216
+ removed.append({"id": row["id"], "duplicate_of": duplicate, "jaccard": score})
217
+ else:
218
+ kept.append(row)
219
+ features[row["id"]] = shingles
220
+ index.insert(row["id"], sig)
221
+ return kept, removed
222
+
223
+
224
+ def build(out):
225
+ import pyarrow as pa
226
+ import pyarrow.parquet as pq
227
+ import tiktoken
228
+ from langid.langid import LanguageIdentifier, model
229
+ inventory = load(out / "inventory.json")
230
+ if inventory["failures"] or len(inventory["records"]) != len(inventory["discovered_links"]):
231
+ raise ValueError("cannot build from incomplete inventory")
232
+ encoder = tiktoken.get_encoding("cl100k_base")
233
+ identifier = LanguageIdentifier.from_modelstring(model, norm_probs=True)
234
+ identifier.set_languages(["pl", "en", "de", "cs", "sk", "uk", "ru"])
235
+ rows, sidecars, decisions = [], [], []
236
+ seen = {}
237
+ pii = Counter()
238
+ added = min(r["observed_at"][:10] for r in inventory["records"])
239
+ for record in sorted(inventory["records"], key=lambda item: item["slug"]):
240
+ raw = record["xml"].encode()
241
+ if sha(raw) != record["xml_sha256"]:
242
+ raise ValueError("raw XML checksum mismatch: " + record["slug"])
243
+ parsed = parse_xml(raw, record["page_url"])
244
+ body = parsed["text"]
245
+ reason = ""
246
+ if not record["page_has_explicit_cc_by_sa_3"] or not record["xml_has_explicit_cc_by_sa_3"]:
247
+ reason = "license_not_explicit_on_page_and_xml"
248
+ elif not parsed["creators"]:
249
+ reason = "missing_creator"
250
+ elif len(body) < 300:
251
+ reason = "too_short"
252
+ language, confidence = identifier.classify(body[:12000]) if body else ("unknown", 0.0)
253
+ if not reason and language != "pl" and confidence >= 0.99:
254
+ reason = "non_polish"
255
+ body, email_count = re.subn(r"(?i)\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b", "[REDACTED:EMAIL]", body)
256
+ body, phone_count = re.subn(r"(?i)(?:\btelefon|\btel\.)\s*:?[ \t]*(?:\+48[ \t]*)?\d(?:[ .-]?\d){8}\b", "[REDACTED:PHONE]", body)
257
+ pii.update(email=email_count, labelled_phone=phone_count)
258
+ text = normalize(parsed["title"] + "\n\n" + body)
259
+ key = " ".join(text.casefold().split())
260
+ if not reason and key in seen:
261
+ reason = "normalized_duplicate"
262
+ row_id = SOURCE + "_" + record["slug"]
263
+ decisions.append({"id": row_id, "selected": not bool(reason), "reason": reason or "include",
264
+ "page_sha256": record["page_sha256"], "xml_sha256": record["xml_sha256"]})
265
+ if reason:
266
+ continue
267
+ seen[key] = row_id
268
+ author = "; ".join(parsed["creators"])
269
+ row = {"id": row_id, "text": text, "source": SOURCE, "added": added,
270
+ "created": parsed["created"], "token_count": len(encoder.encode_ordinary(text)),
271
+ "license": LICENSE, "author": author}
272
+ rows.append(row)
273
+ sidecars.append({"id": row_id, "title": parsed["title"], "url": parsed["canonical_url"],
274
+ "page_url": record["page_url"], "xml_url": record["xml_url"], "created": parsed["created"],
275
+ "authors": parsed["creators"], "creator_roles": parsed["creator_roles"], "publisher": "Fundacja Nowoczesna Polska",
276
+ "license": LICENSE, "license_url": LICENSE_URL, "rights": parsed["rights"], "rights_urls": parsed["rights_urls"],
277
+ "page_sha256": record["page_sha256"], "xml_sha256": record["xml_sha256"], "text_sha256": sha(text.encode()),
278
+ "language": language, "language_confidence": float(confidence),
279
+ "transformations": ["XML powiesc extraction", "bibliography and long-quote elements omitted", "Unicode and whitespace normalization", "email and labelled-phone pattern redaction"]})
280
+ rows, near_removed = near_dedup(rows)
281
+ removed_ids = {item["id"]: item for item in near_removed}
282
+ for decision in decisions:
283
+ if decision["id"] in removed_ids:
284
+ decision.update(selected=False, reason="near_duplicate", **removed_ids[decision["id"]])
285
+ kept_ids = {row["id"] for row in rows}
286
+ sidecars = [row for row in sidecars if row["id"] in kept_ids]
287
+ root = out / "hf_repo"
288
+ (root / "data").mkdir(parents=True, exist_ok=True)
289
+ (root / "artifacts").mkdir(exist_ok=True)
290
+ schema = pa.schema([(field, pa.int64() if field == "token_count" else pa.string()) for field in FIELDS])
291
+ pq.write_table(pa.Table.from_pylist(rows, schema=schema), root / "data/train-00000-of-00001.parquet", compression="zstd")
292
+ write_lines(root / "artifacts/attribution.jsonl", sidecars)
293
+ write_lines(root / "artifacts/decisions.jsonl", decisions)
294
+ samples = sorted(rows, key=lambda row: sha(("sample:" + row["id"]).encode()))[:12]
295
+ write_lines(root / "artifacts/sample.jsonl", samples)
296
+ shutil.copy2(out / "inventory.json", root / "artifacts/inventory.json")
297
+ (root / "artifacts/raw_xml.jsonl.gz").write_bytes(gzip.compress((out / "raw_xml.jsonl").read_bytes(), mtime=0))
298
+ stats = {"discovered": len(inventory["discovered_links"]), "acquired": len(inventory["records"]),
299
+ "kept": len(rows), "rejected": len(decisions) - len(rows), "tokens": sum(row["token_count"] for row in rows),
300
+ "characters": sum(len(row["text"]) for row in rows), "sample_count": len(samples), "added": added,
301
+ "author_coverage": sum(bool(row["author"]) for row in rows) / len(rows) if rows else 0}
302
+ qa = {"license_gate": "explicit CC BY-SA 3.0 required in lesson page and source XML",
303
+ "pii_pattern_matches": dict(pii), "exact_normalized_dedup": True,
304
+ "near_dedup": {"method": "seeded MinHash 128 / LSH 0.8 candidates / exact 5-word Jaccard >= 0.9", "removed": near_removed},
305
+ "cross_source_dedup": "pending target integration", "benchmark_overlap": "pending",
306
+ "limitations": ["source guidance includes historical material", "external reading lists and long-quote elements omitted", "remaining inline third-party excerpts require review", "pattern checks are not comprehensive de-identification"]}
307
+ save(root / "artifacts/stats.json", stats)
308
+ save(root / "artifacts/qa.json", qa)
309
+ run = {"id": "run:" + sha({"code": sha(Path(__file__).read_bytes()), "inventory": inventory["listing_sha256"], "data": [row["text_sha256"] for row in sidecars]}),
310
+ "started_at": inventory["observed_at"], "finished_at": now(), "code_sha256": sha(Path(__file__).read_bytes()), "success": True,
311
+ "inputs": {"listing_sha256": inventory["listing_sha256"], "xml_sha256": [row["xml_sha256"] for row in inventory["records"]]}, "stats": stats}
312
+ save(root / "artifacts/run.json", run)
313
+ print(json.dumps(stats, ensure_ascii=False, indent=2), flush=True)
314
+
315
+
316
+ def make_checksums(root):
317
+ return {path.relative_to(root).as_posix(): sha(path.read_bytes()) for path in sorted(root.rglob("*")) if path.is_file() and path.name not in ("checksums.json", "ontology.json")}
318
+
319
+
320
+ def registry(base):
321
+ tree = ast.parse(base)
322
+ node = next(n.value for n in tree.body if isinstance(n, ast.Assign) and any(isinstance(t, ast.Name) and t.id == "SOURCES" for t in n.targets))
323
+ current = ast.literal_eval(node)
324
+ if SOURCE in current:
325
+ raise ValueError("source already registered")
326
+ entry = {"file_key": SOURCE, "pretty": "Edukacja Medialna - Polish media-literacy lessons",
327
+ "license": LICENSE, "license_spdx": LICENSE,
328
+ "traceable": "Direct official lesson XML. Each accepted record has explicit CC BY-SA 3.0 evidence and credited text/scenario authors in the source metadata.",
329
+ "upstream": BASE + "/lekcje/", "provenance": "Pinned PiotrSty/edukacja-medialna-pl snapshot acquired directly from Fundacja Nowoczesna Polska lesson pages and source XML.",
330
+ "domain": "educational/media-literacy/instructional", "created": "per-record upstream date", "is_ocr": False, "custom_datasheet": True}
331
+ offset = sum(len(line) for line in base.splitlines(keepends=True)[:node.lineno - 1]) + node.col_offset + 1
332
+ formatted = pprint.pformat(entry, width=96, sort_dicts=False).replace("\n", "\n ")
333
+ return base[:offset] + "\n " + repr(SOURCE) + ": " + formatted + "," + base[offset:]
334
+
335
+
336
+ def prepare(out, target_revision):
337
+ root = out / "hf_repo"
338
+ stats = load(root / "artifacts/stats.json")
339
+ (root / "src").mkdir(parents=True, exist_ok=True)
340
+ shutil.copy2(Path(__file__), root / "src/build_edukacja_medialna_pl.py")
341
+ shutil.copy2(Path(__file__).with_name("edukacja_medialna_requirements.txt"), root / "src/requirements.txt")
342
+ shutil.copy2(Path(__file__).with_name("test_edukacja_medialna_contribution.py"), root / "src/test_edukacja_medialna_contribution.py")
343
+ checksums = make_checksums(root)
344
+ save(root / "artifacts/checksums.json", checksums)
345
+ protocol = {"name": "edukacja-medialna-direct-xml-v1", "source_scope": LISTING,
346
+ "license_gate": "explicit CC BY-SA 3.0 on page and XML", "selection": "Polish, >=300 body chars, creator present, no PII pattern match",
347
+ "dedup": "normalized exact then seeded MinHash/Jaccard", "tokenizer": "tiktoken cl100k_base", "schema": FIELDS}
348
+ quality = load(root / "artifacts/qa.json")
349
+ check_evidence_id = "evidence:checksums:" + sha(checksums)
350
+ qa_evidence_id = "evidence:qa:" + sha(quality)
351
+ validation_protocol = {"name": "edukacja-medialna-contract-v1", "checks": ["schema", "counts", "license", "author attribution", "PII patterns", "samples", "content addresses", "acyclic lineage"]}
352
+ validation_run = {"id": "run:validation:" + sha({"checksums": checksums, "protocol": validation_protocol}), "started_at": now(), "finished_at": now(),
353
+ "code_sha256": checksums["src/test_edukacja_medialna_contribution.py"], "success": True, "result": "local contract validation passed"}
354
+ ontology = {"schema_version": "slayer-research-ontology/0.1-profile",
355
+ "objects": [{"id": "object:edukacja-medialna-source", "type": "DatasetSource"}, {"id": "object:edukacja-medialna-derived", "type": "Dataset"}],
356
+ "versions": [{"id": "version:source:" + sha(load(out / "inventory.json")), "object_id": "object:edukacja-medialna-source", "digest": "sha256:" + sha(load(out / "inventory.json")), "immutable": True},
357
+ {"id": "version:data:" + sha(checksums), "object_id": "object:edukacja-medialna-derived", "digest": "sha256:" + sha(checksums), "immutable": True}],
358
+ "protocols": [{"id": "protocol:" + sha(protocol), "specification": protocol, "digest": "sha256:" + sha(protocol)},
359
+ {"id": "protocol:" + sha(validation_protocol), "specification": validation_protocol, "digest": "sha256:" + sha(validation_protocol)}],
360
+ "runs": [load(root / "artifacts/run.json"), validation_run],
361
+ "relations": [{"source": "version:data:" + sha(checksums), "predicate": "DERIVED_FROM", "target": "version:source:" + sha(load(out / "inventory.json"))},
362
+ {"source": "version:data:" + sha(checksums), "predicate": "FILTERED_BY", "target": "protocol:" + sha(protocol)},
363
+ {"source": "version:data:" + sha(checksums), "predicate": "VALIDATED_AGAINST", "target": "protocol:" + sha(validation_protocol)},
364
+ {"source": "version:data:" + sha(checksums), "predicate": "COMPATIBLE_WITH", "target": "hf://datasets/" + TARGET + "@" + target_revision}],
365
+ "evidence": [{"id": check_evidence_id, "observation_type": "checksums", "payload": checksums, "append_only": True},
366
+ {"id": qa_evidence_id, "observation_type": "quality_report", "payload": quality, "append_only": True},
367
+ {"id": "evidence:validation:" + sha(validation_run), "observation_type": "contract_validation", "payload": validation_run, "append_only": True}],
368
+ "claims": [{"id": "claim:licensed-records", "statement": "Every retained record passed the explicit page and XML CC BY-SA 3.0 gate.", "supported_by": [check_evidence_id, qa_evidence_id], "falsification_condition": "A retained record lacks either required license signal."},
369
+ {"id": "claim:diversity-hypothesis", "statement": "This instructional media-literacy source may diversify a legal-heavy Polish pretraining mix.", "supported_by": [], "falsification_condition": "Controlled mix ablations show no relevant improvement or harmful style contamination.", "status": "untested"}],
370
+ "actors": [{"id": "hf:PiotrSty", "type": "human", "name": "Piotr Styla"}, {"id": "agent:codex", "type": "agent", "name": "OpenAI Codex"}, {"id": "org:fnp", "type": "organization", "name": "Fundacja Nowoczesna Polska"}],
371
+ "attestations": [{"type": "cross_source_deduplication", "value": "pending_target_integration"}, {"type": "benchmark_overlap", "value": "pending"}]}
372
+ save(root / "artifacts/ontology.json", ontology)
373
+ notice = f"""# Attribution and license\n\nSource: {LISTING}\nPublisher: Fundacja Nowoczesna Polska.\nLicense: CC BY-SA 3.0 ({LICENSE_URL}).\n\nPer-record text/scenario/expert creators, canonical URLs, source dates and rights evidence are preserved in `artifacts/attribution.jsonl`. Raw source XML and acquisition hashes are preserved in `artifacts/raw_xml.jsonl.gz`.\n\nPreparation: Piotr Styla with OpenAI Codex. Changes: extracted the authored `powiesc` lesson body from source XML; omitted external reading lists; normalized Unicode and whitespace; applied language, length, creator, license, limited PII-pattern and deduplication gates. No endorsement by Fundacja Nowoczesna Polska is implied.\n"""
374
+ (root / "NOTICE.md").write_text(notice, encoding="utf-8")
375
+ readme = f"""---\nlicense: cc-by-sa-3.0\nlanguage:\n- pl\ntask_categories:\n- text-generation\nconfigs:\n- config_name: default\n data_files:\n - split: train\n path: data/train-00000-of-00001.parquet\n---\n\n# Edukacja Medialna PL\n\nA text-only snapshot of Polish media-literacy lesson explanations and scenarios acquired directly from official lesson XML.\n\n- Discovered: {stats['discovered']} lesson URLs\n- Retained: {stats['kept']} records\n- Tokens: {stats['tokens']:,} (`cl100k_base` proxy)\n- License: CC BY-SA 3.0 per retained record\n- Author coverage: {stats['author_coverage']:.1%}\n\nSee `NOTICE.md`, `artifacts/attribution.jsonl`, `artifacts/decisions.jsonl`, `artifacts/qa.json`, `artifacts/checksums.json` and `artifacts/ontology.json`. Twelve complete deterministic records are in `artifacts/sample.jsonl`.\n\n## Limitations\n\nThe source includes historically dated technology and legal guidance. Dates are upstream publication metadata, not proof of present-day currency. External reading lists are omitted. Embedded excerpts may require additional review. PII checks are pattern-based, not comprehensive de-identification. Cross-source DynaWord deduplication and benchmark-overlap checks remain pending. Training benefit is an untested hypothesis requiring controlled ablations.\n\n## Reproduction\n\nInstall `src/requirements.txt`, decompress `artifacts/raw_xml.jsonl.gz` to a work directory as `raw_xml.jsonl`, and run the builder against the preserved inventory. Live acquisition creates a new source Version and must use a fresh work directory.\n"""
376
+ (root / "README.md").write_text(readme, encoding="utf-8")
377
+
378
+
379
+ def verify(out):
380
+ import pyarrow.parquet as pq
381
+ root = out / "hf_repo"
382
+ table = pq.read_table(root / "data/train-00000-of-00001.parquet")
383
+ rows = table.to_pylist()
384
+ stats = load(root / "artifacts/stats.json")
385
+ sidecars = read_lines(root / "artifacts/attribution.jsonl")
386
+ decisions = read_lines(root / "artifacts/decisions.jsonl")
387
+ samples = read_lines(root / "artifacts/sample.jsonl")
388
+ assert table.column_names == FIELDS
389
+ assert len(rows) == stats["kept"] == len(sidecars)
390
+ assert len(decisions) == stats["discovered"]
391
+ assert sum(bool(row["selected"]) for row in decisions) == stats["kept"]
392
+ assert sum(row["token_count"] for row in rows) == stats["tokens"]
393
+ assert {row["id"] for row in rows} == {row["id"] for row in sidecars}
394
+ assert all(row["author"] and row["license"] == LICENSE and row["source"] == SOURCE for row in rows)
395
+ assert all(any("creativecommons.org/licenses/by-sa/3.0" in url for url in sidecar["rights_urls"]) for sidecar in sidecars)
396
+ assert all(not re.search(r"(?i)\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b", row["text"]) for row in rows)
397
+ titles = {row["id"]: row["title"] for row in sidecars}
398
+ assert all(not row["text"].startswith(titles[row["id"]] + "\n\n" + titles[row["id"]]) for row in rows)
399
+ by_id = {row["id"]: row for row in rows}
400
+ assert len(samples) == min(12, len(rows)) and all(by_id[row["id"]] == row for row in samples)
401
+ if (root / "artifacts/checksums.json").exists():
402
+ for name, digest in load(root / "artifacts/checksums.json").items():
403
+ assert sha((root / name).read_bytes()) == digest
404
+ print(json.dumps({"verified": True, **stats}, ensure_ascii=False, indent=2))
405
+
406
+
407
+ def hf_token():
408
+ value = os.environ.get("HF_TOKEN")
409
+ if not value and os.name == "nt":
410
+ import winreg
411
+ with winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Environment") as key:
412
+ value = winreg.QueryValueEx(key, "HF_TOKEN")[0]
413
+ if not value or not value.startswith("hf_"):
414
+ raise ValueError("HF_TOKEN unavailable")
415
+ return value
416
+
417
+
418
+ def all_files(root):
419
+ return [path for path in sorted(root.rglob("*")) if path.is_file() and "__pycache__" not in path.parts]
420
+
421
+
422
+ def assemble_pr(out, base, source_commit):
423
+ root = out / "hf_repo"
424
+ pr = out / "dynaword_pr"
425
+ data = pr / "data" / SOURCE
426
+ data.mkdir(parents=True, exist_ok=True)
427
+ (pr / "src").mkdir(exist_ok=True)
428
+ (pr / "artifacts").mkdir(exist_ok=True)
429
+ shutil.copy2(root / "data/train-00000-of-00001.parquet", data / f"{SOURCE}.parquet")
430
+ for name in ("attribution.jsonl", "decisions.jsonl", "sample.jsonl", "stats.json", "qa.json"):
431
+ shutil.copy2(root / "artifacts" / name, data / f"{SOURCE}.{name}")
432
+ shutil.copy2(root / "NOTICE.md", data / "NOTICE.md")
433
+ shutil.copy2(root / "README.md", data / f"{SOURCE}.md")
434
+ shutil.copy2(root / "artifacts/ontology.json", pr / f"artifacts/{SOURCE}_ontology_manifest.json")
435
+ shutil.copy2(Path(__file__), pr / "src/build_edukacja_medialna_pl.py")
436
+ shutil.copy2(Path(__file__).with_name("test_edukacja_medialna_contribution.py"), pr / "src/test_edukacja_medialna_contribution.py")
437
+ (pr / "src/sources.py").write_text(registry(base), encoding="utf-8")
438
+ subprocess.run([sys.executable, "-m", "pytest", "-q", str(pr / "src/test_edukacja_medialna_contribution.py")], check=True)
439
+ return pr
440
+
441
+
442
+ def publish(out):
443
+ from huggingface_hub import HfApi, CommitOperationAdd
444
+ api = HfApi(token=hf_token())
445
+ if api.whoami()["name"].casefold() != "piotrsty":
446
+ raise ValueError("unexpected HF account")
447
+ target = api.dataset_info(TARGET)
448
+ target_revision = target.sha
449
+ registry_url = f"https://huggingface.co/datasets/{TARGET}/resolve/{target_revision}/src/sources.py"
450
+ base = http_get(registry_url).content.decode("utf-8")
451
+ discussions = list(api.get_repo_discussions(TARGET, repo_type="dataset"))
452
+ if SOURCE in base or any("edukacja medialna" in item.title.casefold() for item in discussions):
453
+ raise ValueError("source registration or proposal already exists")
454
+ prepare(out, target_revision)
455
+ verify(out)
456
+ root = out / "hf_repo"
457
+ if api.repo_exists(OWN_REPO, repo_type="dataset"):
458
+ raise ValueError("own HF repository already exists; refusing to overwrite")
459
+ api.create_repo(OWN_REPO, repo_type="dataset", private=True)
460
+ source_commit = api.create_commit(OWN_REPO, repo_type="dataset", commit_message="Add validated Edukacja Medialna Polish lesson snapshot",
461
+ operations=[CommitOperationAdd(path_in_repo=path.relative_to(root).as_posix(), path_or_fileobj=str(path)) for path in all_files(root)])
462
+ api.create_tag(OWN_REPO, repo_type="dataset", tag="v1.0.0", revision=source_commit.oid)
463
+ api.update_repo_settings(OWN_REPO, repo_type="dataset", private=False)
464
+ pr = assemble_pr(out, base, source_commit.oid)
465
+ stats = load(root / "artifacts/stats.json")
466
+ description = f"""## Add Polish media-literacy lessons\n\nAdds `{SOURCE}`: **{stats['kept']} records and {stats['tokens']:,} measured `cl100k_base` proxy tokens**, acquired directly from official Edukacja Medialna lesson XML. Every retained record has explicit CC BY-SA 3.0 evidence on its lesson page and in XML, plus credited authors.\n\nSource dataset: https://huggingface.co/datasets/{OWN_REPO}/tree/{source_commit.oid}\n\n### Data sample\n\n- [12 complete deterministic sample records](https://huggingface.co/datasets/{OWN_REPO}/blob/{source_commit.oid}/artifacts/sample.jsonl)\n- [Per-record authors, URLs and rights](https://huggingface.co/datasets/{OWN_REPO}/blob/{source_commit.oid}/artifacts/attribution.jsonl)\n- [Selection decisions](https://huggingface.co/datasets/{OWN_REPO}/blob/{source_commit.oid}/artifacts/decisions.jsonl)\n\n### Method and ontology\n\nThe contribution includes a reproducible direct-XML builder, normalized exact and seeded MinHash/Jaccard within-source deduplication, limited PII-pattern checks, checksums, QA and an ontology manifest separating content-addressed Versions, Protocol, executed Run, Evidence, falsifiable Claims and Actors. External reading lists are omitted.\n\n### Remaining gates\n\nCross-source exact/near deduplication and benchmark-overlap checks remain pending. Historical technology/legal guidance is not asserted to be current. Embedded third-party excerpts and the CC BY-SA 3.0 to corpus-level licensing treatment require maintainer review. Training benefit is an untested diversity hypothesis. This proposes a source, not a stable release.\n"""
467
+ result = api.create_commit(TARGET, repo_type="dataset", parent_commit=target_revision, create_pr=True,
468
+ commit_message="Add CC BY-SA 3.0 Polish media-literacy lessons", commit_description=description,
469
+ operations=[CommitOperationAdd(path_in_repo=path.relative_to(pr).as_posix(), path_or_fileobj=str(path)) for path in all_files(pr)])
470
+ receipt = {"source_repo": OWN_REPO, "source_commit": source_commit.oid, "tag": "v1.0.0", "target_main_revision": target_revision,
471
+ "pr_url": result.pr_url, "pr_commit": result.oid, "published_at": now()}
472
+ save(out / "publication.json", receipt)
473
+ print(json.dumps(receipt, ensure_ascii=False, indent=2))
474
+
475
+
476
+ def refresh(out):
477
+ from huggingface_hub import HfApi, CommitOperationAdd
478
+ api = HfApi(token=hf_token())
479
+ receipt = load(out / "publication.json")
480
+ number = int(receipt["pr_url"].rsplit("/", 1)[-1])
481
+ main = api.dataset_info(TARGET)
482
+ if main.sha != receipt["target_main_revision"]:
483
+ raise ValueError("target main changed; inspect and rebase before refreshing PR")
484
+ registry_url = f"https://huggingface.co/datasets/{TARGET}/resolve/{main.sha}/src/sources.py"
485
+ base = http_get(registry_url).content.decode("utf-8")
486
+ prepare(out, main.sha)
487
+ verify(out)
488
+ root = out / "hf_repo"
489
+ old_source = api.dataset_info(OWN_REPO)
490
+ source_commit = api.create_commit(OWN_REPO, repo_type="dataset", parent_commit=old_source.sha,
491
+ commit_message="Add contribution contract test and validation run",
492
+ operations=[CommitOperationAdd(path_in_repo=path.relative_to(root).as_posix(), path_or_fileobj=str(path)) for path in all_files(root)])
493
+ tag = "v1.0.1"
494
+ if not any(item.name == tag for item in api.list_repo_refs(OWN_REPO, repo_type="dataset").tags):
495
+ api.create_tag(OWN_REPO, repo_type="dataset", tag=tag, revision=source_commit.oid)
496
+ pr = assemble_pr(out, base, source_commit.oid)
497
+ old_pr = api.dataset_info(TARGET, revision=f"refs/pr/{number}")
498
+ pr_commit = api.create_commit(TARGET, repo_type="dataset", revision=f"refs/pr/{number}", parent_commit=old_pr.sha,
499
+ commit_message="Add contract test and explicit ontology validation run",
500
+ operations=[CommitOperationAdd(path_in_repo=path.relative_to(pr).as_posix(), path_or_fileobj=str(path)) for path in all_files(pr)])
501
+ receipt.setdefault("previous_source_commits", []).append(receipt["source_commit"])
502
+ receipt.setdefault("previous_pr_commits", []).append(receipt["pr_commit"])
503
+ receipt.update(source_commit=source_commit.oid, pr_commit=pr_commit.oid, tag=tag, refreshed_at=now())
504
+ save(out / "publication.json", receipt)
505
+ print(json.dumps(receipt, ensure_ascii=False, indent=2))
506
+
507
+
508
+ def audit(out):
509
+ from huggingface_hub import HfApi, hf_hub_download
510
+ api = HfApi(token=False)
511
+ receipt = load(out / "publication.json")
512
+ info = api.dataset_info(OWN_REPO)
513
+ if info.private or info.sha != receipt["source_commit"]:
514
+ raise ValueError("source repo visibility or revision mismatch")
515
+ if not any(item.name == receipt["tag"] and item.target_commit == info.sha for item in api.list_repo_refs(OWN_REPO, repo_type="dataset").tags):
516
+ raise ValueError("release tag mismatch")
517
+ number = int(receipt["pr_url"].rsplit("/", 1)[-1])
518
+ discussion = api.get_discussion_details(TARGET, number, repo_type="dataset")
519
+ pr_info = api.dataset_info(TARGET, revision=f"refs/pr/{number}")
520
+ if not discussion.is_pull_request or pr_info.sha != receipt["pr_commit"]:
521
+ raise ValueError("PR identity mismatch")
522
+ checked = []
523
+ for repo, revision, root in ((OWN_REPO, info.sha, out / "hf_repo"), (TARGET, pr_info.sha, out / "dynaword_pr")):
524
+ for path in all_files(root):
525
+ name = path.relative_to(root).as_posix()
526
+ remote = Path(hf_hub_download(repo, name, repo_type="dataset", revision=revision, token=False, cache_dir=str(out / "remote_cache")))
527
+ if sha(remote.read_bytes()) != sha(path.read_bytes()):
528
+ raise ValueError("remote mismatch: " + name)
529
+ checked.append({"repo": repo, "revision": revision, "path": name, "sha256": sha(remote.read_bytes())})
530
+ result = {"observed_at": now(), "source_revision": info.sha, "pr_revision": pr_info.sha,
531
+ "pr_status": discussion.status, "target_main_revision": api.dataset_info(TARGET).sha, "verified_files": checked}
532
+ save(out / "publication_audit.json", result)
533
+ print(json.dumps({**result, "verified_files": len(checked)}, ensure_ascii=False, indent=2))
534
+
535
+
536
+ if __name__ == "__main__":
537
+ parser = argparse.ArgumentParser(description=__doc__)
538
+ parser.add_argument("--output", type=Path, required=True)
539
+ parser.add_argument("command", choices=["acquire", "build", "prepare", "verify", "publish", "refresh", "audit"])
540
+ args = parser.parse_args()
541
+ if args.command == "prepare":
542
+ raise SystemExit("prepare is run by publish with a pinned target revision")
543
+ globals()[args.command](args.output)
src/sources.py CHANGED
@@ -15,6 +15,26 @@ intermediate aggregator, upstream license/attribution is preserved per source.
15
  # Large cultural/academic sources require per-record rights metadata and should
16
  # be rebuilt from direct upstream/export scripts rather than blind SpeakLeash pulls.
17
  SOURCES = {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  "uzp_orzeczenia_pl": {
19
  "added": "2026-09-17",
20
  "release": None,
 
15
  # Large cultural/academic sources require per-record rights metadata and should
16
  # be rebuilt from direct upstream/export scripts rather than blind SpeakLeash pulls.
17
  SOURCES = {
18
+ "edukacja_medialna_pl": {
19
+ "file_key": "edukacja_medialna_pl",
20
+ "pretty": "Edukacja Medialna - Polish media-literacy lessons",
21
+ "provenance": "Pinned PiotrSty/edukacja-medialna-pl snapshot acquired "
22
+ "directly from Fundacja Nowoczesna Polska lesson pages "
23
+ "and source XML.",
24
+ "license": "CC-BY-SA-3.0",
25
+ "license_spdx": "CC-BY-SA-3.0",
26
+ "traceable": "Direct official lesson XML plus the per-lesson license "
27
+ "line on edukacjamedialna.edu.pl. Each accepted record "
28
+ "has explicit CC BY-SA 3.0 evidence and credited "
29
+ "text/scenario authors in the source metadata.",
30
+ "upstream": "https://edukacjamedialna.edu.pl/lekcje/",
31
+ "domain": "educational/media-literacy/instructional",
32
+ "created": "2012-11-09, 2015-01-12",
33
+ "is_ocr": False,
34
+ "custom_datasheet": True,
35
+ "added": "2026-09-06",
36
+ "release": None,
37
+ },
38
  "uzp_orzeczenia_pl": {
39
  "added": "2026-09-17",
40
  "release": None,
src/test_edukacja_medialna_contribution.py ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Contract checks run from the prepared DynaWord contribution tree."""
2
+ import json
3
+ from pathlib import Path
4
+ import re
5
+
6
+ import pyarrow.parquet as pq
7
+
8
+ SOURCE = "edukacja_medialna_pl"
9
+ LICENSE = "CC-BY-SA-3.0"
10
+ FIELDS = ["id", "text", "source", "added", "created", "token_count", "license", "author"]
11
+ ROOT = Path(__file__).resolve().parents[1]
12
+ DATA = ROOT / "data" / SOURCE
13
+ MANIFEST = ROOT / "artifacts" / f"{SOURCE}_ontology_manifest.json"
14
+
15
+
16
+ def digest(payload):
17
+ import hashlib
18
+ if isinstance(payload, bytes):
19
+ return hashlib.sha256(payload).hexdigest()
20
+ return hashlib.sha256(json.dumps(payload, ensure_ascii=False, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
21
+
22
+
23
+ def rows(path):
24
+ return [json.loads(line) for line in path.read_text(encoding="utf-8").splitlines() if line]
25
+
26
+
27
+ def test_dataset_contract_and_samples():
28
+ table = pq.read_table(DATA / f"{SOURCE}.parquet")
29
+ data = table.to_pylist()
30
+ stats = json.loads((DATA / f"{SOURCE}.stats.json").read_text(encoding="utf-8"))
31
+ attribution = rows(DATA / f"{SOURCE}.attribution.jsonl")
32
+ decisions = rows(DATA / f"{SOURCE}.decisions.jsonl")
33
+ sample = rows(DATA / f"{SOURCE}.sample.jsonl")
34
+ assert table.column_names == FIELDS
35
+ assert len(data) == stats["kept"] == len(attribution)
36
+ assert sum(item["token_count"] for item in data) == stats["tokens"]
37
+ assert sum(bool(item["selected"]) for item in decisions) == stats["kept"]
38
+ assert len(decisions) == stats["discovered"]
39
+ assert {item["id"] for item in data} == {item["id"] for item in attribution}
40
+ assert all(item["source"] == SOURCE and item["license"] == LICENSE and item["author"] for item in data)
41
+ assert all(not re.search(r"(?i)\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b", item["text"]) for item in data)
42
+ by_id = {item["id"]: item for item in data}
43
+ assert len(sample) == stats["sample_count"] == 12
44
+ assert all(by_id[item["id"]] == item for item in sample)
45
+
46
+
47
+ def test_ontology_is_addressed_and_falsifiable():
48
+ manifest = json.loads(MANIFEST.read_text(encoding="utf-8"))
49
+ evidence = {item["id"]: item for item in manifest["evidence"]}
50
+ checks = next(item["payload"] for item in manifest["evidence"] if item["observation_type"] == "checksums")
51
+ for name, expected in checks.items():
52
+ mapping = {
53
+ "data/train-00000-of-00001.parquet": DATA / f"{SOURCE}.parquet",
54
+ "artifacts/attribution.jsonl": DATA / f"{SOURCE}.attribution.jsonl",
55
+ "artifacts/decisions.jsonl": DATA / f"{SOURCE}.decisions.jsonl",
56
+ "artifacts/sample.jsonl": DATA / f"{SOURCE}.sample.jsonl",
57
+ "artifacts/stats.json": DATA / f"{SOURCE}.stats.json",
58
+ "artifacts/qa.json": DATA / f"{SOURCE}.qa.json",
59
+ "src/build_edukacja_medialna_pl.py": ROOT / "src/build_edukacja_medialna_pl.py",
60
+ "src/test_edukacja_medialna_contribution.py": ROOT / "src/test_edukacja_medialna_contribution.py",
61
+ }
62
+ if name in mapping:
63
+ assert digest(mapping[name].read_bytes()) == expected
64
+ assert all(item["falsification_condition"] for item in manifest["claims"])
65
+ assert all(set(item["supported_by"]) <= set(evidence) for item in manifest["claims"])
66
+ assert any(item["predicate"] == "VALIDATED_AGAINST" for item in manifest["relations"])
67
+ assert len(manifest["runs"]) >= 2 and all(item["success"] for item in manifest["runs"])
68
+ graph = {}
69
+ for relation in manifest["relations"]:
70
+ graph.setdefault(relation["source"], []).append(relation["target"])
71
+ def visit(node, path):
72
+ assert node not in path
73
+ for child in graph.get(node, []):
74
+ visit(child, path | {node})
75
+ for node in graph:
76
+ visit(node, set())