thefinalboss commited on
Commit
bccb2b4
·
verified ·
1 Parent(s): 23efb0a

Checker: annexe licences corpus_diverse_v1 (0313) + audit manifestes v2 (0308) + scripts

Browse files
v3_scale/checker/recount/audit_manifests_v2_0308.json ADDED
@@ -0,0 +1,781 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "build_license_counts": {
3
+ "Apache-2.0": [
4
+ 21,
5
+ 98874011
6
+ ],
7
+ "BSD-3-Clause": [
8
+ 6,
9
+ 26999928
10
+ ],
11
+ "MIT": [
12
+ 29,
13
+ 103479151
14
+ ],
15
+ "curl (MIT/X derivative)": [
16
+ 1,
17
+ 8391247
18
+ ],
19
+ "zlib": [
20
+ 1,
21
+ 1029227
22
+ ]
23
+ },
24
+ "n_repos": 58,
25
+ "excluded": [
26
+ "hashicorp/terraform",
27
+ "redis/redis",
28
+ "AutoMapper/AutoMapper",
29
+ "akka/akka"
30
+ ],
31
+ "multi_license_files": [
32
+ "django/django",
33
+ "BurntSushi/ripgrep",
34
+ "serde-rs/serde",
35
+ "rust-lang/cargo",
36
+ "alacritty/alacritty",
37
+ "libuv/libuv"
38
+ ],
39
+ "ml_lic_v2": {
40
+ "author": "SPIRA Hashing",
41
+ "generated_by": "/workspace/spira_shared/hashing_gen/recount_div1/make_manifests_v2.py",
42
+ "inputs_sha256": {
43
+ "build_stage1": "9c1f250db5fa09e2133fad42be0cba64499fde9f223fd6090ad9bee396611c42",
44
+ "broad_gutenberg_v1_manifest": "5ab579c5d8163a51e2b6dc85c28c2faf49ef4656e6e74d84421c76d9a635fd4c",
45
+ "corpus_gutenberg_v2_manifest": "23946761ff37acfeb7bc7671a531fca12ae00abea933550adf3eee3af99f2f07",
46
+ "broad_local_v1_corpus_manifest": "31dea9c394773250ac87e174f21aa6a162b2bbc7320684c52a96f52051ff5cf3"
47
+ },
48
+ "rule": "licences tir\u00e9es UNIQUEMENT des fichiers de build list\u00e9s ; absente => \u00ab non consign\u00e9e \u00bb ; rien de devin\u00e9",
49
+ "multi_lang_v1": {
50
+ "source": "multi_lang_v1/build_stage1.json (champ license par d\u00e9p\u00f4t) \u2014 seule source utilis\u00e9e",
51
+ "repos_kept": 58,
52
+ "content_bytes_total": 238773564,
53
+ "by_license": {
54
+ "MIT": {
55
+ "repos": 29,
56
+ "bytes": 103479151,
57
+ "share_of_content_bytes": 0.433378
58
+ },
59
+ "Apache-2.0": {
60
+ "repos": 21,
61
+ "bytes": 98874011,
62
+ "share_of_content_bytes": 0.414091
63
+ },
64
+ "BSD-3-Clause": {
65
+ "repos": 6,
66
+ "bytes": 26999928,
67
+ "share_of_content_bytes": 0.113078
68
+ },
69
+ "curl (MIT/X derivative)": {
70
+ "repos": 1,
71
+ "bytes": 8391247,
72
+ "share_of_content_bytes": 0.035143
73
+ },
74
+ "zlib": {
75
+ "repos": 1,
76
+ "bytes": 1029227,
77
+ "share_of_content_bytes": 0.00431
78
+ }
79
+ },
80
+ "flag_missing_license": "aucun",
81
+ "flag_non_permissive": "aucun (selon le classement PERM/BAD de multi_lang_v1/build.py)",
82
+ "excluded_repos_build_file": [
83
+ {
84
+ "repo": "hashicorp/terraform",
85
+ "commit": "55988303ba5651e41e2c9097e208468c8eb3da4b",
86
+ "why": "license_not_permissive_or_unrecognized:BUSL-1.1:LICENSE"
87
+ },
88
+ {
89
+ "repo": "redis/redis",
90
+ "commit": "81d653f5dc8d472a0d4f7dd328be720021580731",
91
+ "why": "license_not_permissive_or_unrecognized:GPL:LICENSE.txt"
92
+ },
93
+ {
94
+ "repo": "AutoMapper/AutoMapper",
95
+ "commit": "f0ecba7a97d1403973825fb3cbe2733e6216ff9a",
96
+ "why": "license_not_permissive_or_unrecognized:RPL-1.5:LICENSE.md"
97
+ },
98
+ {
99
+ "repo": "akka/akka",
100
+ "commit": "838fe7279217fb185a098abb84808c134f299161",
101
+ "why": "license_not_permissive_or_unrecognized:BUSL-1.1:LICENSE,COPYING.protobuf"
102
+ }
103
+ ],
104
+ "remarks": [
105
+ "Licence d\u00e9tect\u00e9e par d\u00e9p\u00f4t (regex sur LICENSE*/COPYING*, multi_lang_v1/build.py), un seul libell\u00e9 enregistr\u00e9 par d\u00e9p\u00f4t ; pas de suivi par fichier.",
106
+ "\u00ab curl (MIT/X derivative) \u00bb est le libell\u00e9 du build, pas un identifiant SPDX.",
107
+ "D\u00e9p\u00f4ts avec plusieurs fichiers de licence alors qu'un seul libell\u00e9 est enregistr\u00e9 (le build ne dit pas s'il s'agit d'une double licence) : voir multi_license_files_recorded_as_one.",
108
+ "D\u00e9p\u00f4ts \u00e0 0 octet retenu : ['dylanaraps/neofetch', 'apple/swift-argument-parser']."
109
+ ],
110
+ "multi_license_files_recorded_as_one": [
111
+ {
112
+ "repo": "django/django",
113
+ "license_recorded": "BSD-3-Clause",
114
+ "license_file": "LICENSE,LICENSE.python"
115
+ },
116
+ {
117
+ "repo": "BurntSushi/ripgrep",
118
+ "license_recorded": "MIT",
119
+ "license_file": "LICENSE-MIT,UNLICENSE,COPYING"
120
+ },
121
+ {
122
+ "repo": "serde-rs/serde",
123
+ "license_recorded": "Apache-2.0",
124
+ "license_file": "LICENSE-APACHE,LICENSE-MIT"
125
+ },
126
+ {
127
+ "repo": "rust-lang/cargo",
128
+ "license_recorded": "Apache-2.0",
129
+ "license_file": "LICENSE-APACHE,LICENSE-MIT"
130
+ },
131
+ {
132
+ "repo": "alacritty/alacritty",
133
+ "license_recorded": "Apache-2.0",
134
+ "license_file": "LICENSE-APACHE,LICENSE-MIT"
135
+ },
136
+ {
137
+ "repo": "libuv/libuv",
138
+ "license_recorded": "MIT",
139
+ "license_file": "LICENSE,LICENSE-docs,LICENSE-extra"
140
+ }
141
+ ],
142
+ "per_repo": [
143
+ {
144
+ "repo": "psf/requests",
145
+ "commit": "611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60",
146
+ "license": "Apache-2.0",
147
+ "license_file": "LICENSE",
148
+ "bytes_kept": 334211,
149
+ "files_kept": 34
150
+ },
151
+ {
152
+ "repo": "pallets/flask",
153
+ "commit": "d086db856be187255b8ec61ef409357393020f32",
154
+ "license": "BSD-3-Clause",
155
+ "license_file": "LICENSE.txt",
156
+ "bytes_kept": 486917,
157
+ "files_kept": 75
158
+ },
159
+ {
160
+ "repo": "django/django",
161
+ "commit": "0e128d524d0a7c55a955570d6e5da983ac6ce6c7",
162
+ "license": "BSD-3-Clause",
163
+ "license_file": "LICENSE,LICENSE.python",
164
+ "bytes_kept": 8413530,
165
+ "files_kept": 1333
166
+ },
167
+ {
168
+ "repo": "scikit-learn/scikit-learn",
169
+ "commit": "59106029d483678e79825f753bde67f8ade4332b",
170
+ "license": "BSD-3-Clause",
171
+ "license_file": "COPYING",
172
+ "bytes_kept": 8424057,
173
+ "files_kept": 692
174
+ },
175
+ {
176
+ "repo": "encode/httpx",
177
+ "commit": "b5addb64f0161ff6bfe94c124ef76f6a1fba5254",
178
+ "license": "BSD-3-Clause",
179
+ "license_file": "LICENSE.md",
180
+ "bytes_kept": 404301,
181
+ "files_kept": 52
182
+ },
183
+ {
184
+ "repo": "expressjs/express",
185
+ "commit": "1c6f1b0fe4000977b9a7b4f34097e4d527dd9824",
186
+ "license": "MIT",
187
+ "license_file": "LICENSE",
188
+ "bytes_kept": 560914,
189
+ "files_kept": 141
190
+ },
191
+ {
192
+ "repo": "lodash/lodash",
193
+ "commit": "2b5e6f7399a7b48005140b5d5c6bc6c0e62919a8",
194
+ "license": "MIT",
195
+ "license_file": "LICENSE",
196
+ "bytes_kept": 13667,
197
+ "files_kept": 8
198
+ },
199
+ {
200
+ "repo": "webpack/webpack",
201
+ "commit": "7978462575e6f5a02b6b7a2c6d7b6b236ce76175",
202
+ "license": "MIT",
203
+ "license_file": "LICENSE",
204
+ "bytes_kept": 8389112,
205
+ "files_kept": 1240
206
+ },
207
+ {
208
+ "repo": "axios/axios",
209
+ "commit": "aa54a5e1e0e50cd1a2561b854ae5490ff589d065",
210
+ "license": "MIT",
211
+ "license_file": "LICENSE",
212
+ "bytes_kept": 1026876,
213
+ "files_kept": 262
214
+ },
215
+ {
216
+ "repo": "mrdoob/three.js",
217
+ "commit": "e27dfa95ae7f453b5d7a9a36ffdb563f7c9b529b",
218
+ "license": "MIT",
219
+ "license_file": "LICENSE",
220
+ "bytes_kept": 8396389,
221
+ "files_kept": 863
222
+ },
223
+ {
224
+ "repo": "microsoft/vscode",
225
+ "commit": "1184ad4d45794110deb6b897ea83b15aac44ed89",
226
+ "license": "MIT",
227
+ "license_file": "LICENSE.txt",
228
+ "bytes_kept": 1378837,
229
+ "files_kept": 226
230
+ },
231
+ {
232
+ "repo": "vuejs/core",
233
+ "commit": "0ff253bfba3ee8d3d65448bd44ad890fd01b0ecd",
234
+ "license": "MIT",
235
+ "license_file": "LICENSE",
236
+ "bytes_kept": 4533129,
237
+ "files_kept": 518
238
+ },
239
+ {
240
+ "repo": "angular/angular",
241
+ "commit": "c27695f278a88ce5e74f7504320dae5a53862236",
242
+ "license": "MIT",
243
+ "license_file": "LICENSE",
244
+ "bytes_kept": 8392070,
245
+ "files_kept": 1736
246
+ },
247
+ {
248
+ "repo": "nestjs/nest",
249
+ "commit": "9a95605281355d6b89401eb06002c3bc64545838",
250
+ "license": "MIT",
251
+ "license_file": "LICENSE",
252
+ "bytes_kept": 5616113,
253
+ "files_kept": 1887
254
+ },
255
+ {
256
+ "repo": "BurntSushi/ripgrep",
257
+ "commit": "6892bc2b7efe5909cbbeec8f757ed2c4c76b1d30",
258
+ "license": "MIT",
259
+ "license_file": "LICENSE-MIT,UNLICENSE,COPYING",
260
+ "bytes_kept": 1876977,
261
+ "files_kept": 104
262
+ },
263
+ {
264
+ "repo": "tokio-rs/tokio",
265
+ "commit": "8a2408edcfa2b7f19c00428a9d3a8ea6652a083f",
266
+ "license": "MIT",
267
+ "license_file": "LICENSE",
268
+ "bytes_kept": 5764849,
269
+ "files_kept": 784
270
+ },
271
+ {
272
+ "repo": "serde-rs/serde",
273
+ "commit": "0db9b3b504bcb0a7fa9cf001429869519afd3e9a",
274
+ "license": "Apache-2.0",
275
+ "license_file": "LICENSE-APACHE,LICENSE-MIT",
276
+ "bytes_kept": 1246203,
277
+ "files_kept": 207
278
+ },
279
+ {
280
+ "repo": "rust-lang/cargo",
281
+ "commit": "cad07cf8e597397fff5d0f6cb79c9f870c0b1dd2",
282
+ "license": "Apache-2.0",
283
+ "license_file": "LICENSE-APACHE,LICENSE-MIT",
284
+ "bytes_kept": 8403116,
285
+ "files_kept": 827
286
+ },
287
+ {
288
+ "repo": "alacritty/alacritty",
289
+ "commit": "542147067dd016fc5f49120ef0ba605a98a4e3a7",
290
+ "license": "Apache-2.0",
291
+ "license_file": "LICENSE-APACHE,LICENSE-MIT",
292
+ "bytes_kept": 1080257,
293
+ "files_kept": 91
294
+ },
295
+ {
296
+ "repo": "gin-gonic/gin",
297
+ "commit": "0f09c3a9b4626d9fe9979cf4d0521d6ae32ab646",
298
+ "license": "MIT",
299
+ "license_file": "LICENSE",
300
+ "bytes_kept": 697100,
301
+ "files_kept": 98
302
+ },
303
+ {
304
+ "repo": "spf13/cobra",
305
+ "commit": "adbc8813901bba65827259daa8e22ff94ec1f30e",
306
+ "license": "Apache-2.0",
307
+ "license_file": "LICENSE.txt",
308
+ "bytes_kept": 512600,
309
+ "files_kept": 36
310
+ },
311
+ {
312
+ "repo": "prometheus/prometheus",
313
+ "commit": "a2fda0ef4638518a6a6fb27fc48be88fbd732f4b",
314
+ "license": "Apache-2.0",
315
+ "license_file": "LICENSE",
316
+ "bytes_kept": 8396886,
317
+ "files_kept": 552
318
+ },
319
+ {
320
+ "repo": "gohugoio/hugo",
321
+ "commit": "ed22b85c192dd750cf0bdfb2d2005d31ab3bc0a7",
322
+ "license": "Apache-2.0",
323
+ "license_file": "LICENSE",
324
+ "bytes_kept": 6590268,
325
+ "files_kept": 933
326
+ },
327
+ {
328
+ "repo": "curl/curl",
329
+ "commit": "178e5077b60be91a8dfcbaa22a6bf79e179009ff",
330
+ "license": "curl (MIT/X derivative)",
331
+ "license_file": "COPYING",
332
+ "bytes_kept": 8391247,
333
+ "files_kept": 969
334
+ },
335
+ {
336
+ "repo": "libuv/libuv",
337
+ "commit": "19bbf90e1a7a1526da6daa1c79eec2e3ff8b6c55",
338
+ "license": "MIT",
339
+ "license_file": "LICENSE,LICENSE-docs,LICENSE-extra",
340
+ "bytes_kept": 2645018,
341
+ "files_kept": 338
342
+ },
343
+ {
344
+ "repo": "madler/zlib",
345
+ "commit": "767c4c947852e143f582c85f14cf573411df1b35",
346
+ "license": "zlib",
347
+ "license_file": "LICENSE",
348
+ "bytes_kept": 1029227,
349
+ "files_kept": 75
350
+ },
351
+ {
352
+ "repo": "jqlang/jq",
353
+ "commit": "da4da65c0cfffe0481ebf26ad64346eb45e4f34d",
354
+ "license": "MIT",
355
+ "license_file": "COPYING",
356
+ "bytes_kept": 667825,
357
+ "files_kept": 58
358
+ },
359
+ {
360
+ "repo": "nlohmann/json",
361
+ "commit": "ffcd392be06c871e9a75f7d6b4f4b9c2288bc19c",
362
+ "license": "MIT",
363
+ "license_file": "LICENSE.MIT",
364
+ "bytes_kept": 5279605,
365
+ "files_kept": 573
366
+ },
367
+ {
368
+ "repo": "fmtlib/fmt",
369
+ "commit": "0fc31633e7d53ac895ae0a688b83b7d44f0b0c1f",
370
+ "license": "MIT",
371
+ "license_file": "LICENSE",
372
+ "bytes_kept": 874695,
373
+ "files_kept": 72
374
+ },
375
+ {
376
+ "repo": "google/leveldb",
377
+ "commit": "bb74ef739973a70ca9f0d90788a1da89b788c0ad",
378
+ "license": "BSD-3-Clause",
379
+ "license_file": "LICENSE",
380
+ "bytes_kept": 855586,
381
+ "files_kept": 124
382
+ },
383
+ {
384
+ "repo": "opencv/opencv",
385
+ "commit": "4058787c826610fdb1d6d2e18517d93e3ad9b184",
386
+ "license": "Apache-2.0",
387
+ "license_file": "LICENSE",
388
+ "bytes_kept": 8392271,
389
+ "files_kept": 615
390
+ },
391
+ {
392
+ "repo": "protocolbuffers/protobuf",
393
+ "commit": "5db636d202550a7c6efa49f5ea9742f87e32bab0",
394
+ "license": "BSD-3-Clause",
395
+ "license_file": "LICENSE",
396
+ "bytes_kept": 8415537,
397
+ "files_kept": 758
398
+ },
399
+ {
400
+ "repo": "google/guava",
401
+ "commit": "1b1d120f9cd79ed5dcb1eb1e355e8f48b2b1bc6f",
402
+ "license": "Apache-2.0",
403
+ "license_file": "LICENSE",
404
+ "bytes_kept": 8390932,
405
+ "files_kept": 1054
406
+ },
407
+ {
408
+ "repo": "spring-projects/spring-framework",
409
+ "commit": "b671d1a36a42dbcba0ba3657d1d353d421aa64ba",
410
+ "license": "Apache-2.0",
411
+ "license_file": "LICENSE.txt",
412
+ "bytes_kept": 8391477,
413
+ "files_kept": 1968
414
+ },
415
+ {
416
+ "repo": "square/okhttp",
417
+ "commit": "c3179301fc7d0266c5bf154870c2b0b9da01e7e7",
418
+ "license": "Apache-2.0",
419
+ "license_file": "LICENSE.txt",
420
+ "bytes_kept": 4496384,
421
+ "files_kept": 677
422
+ },
423
+ {
424
+ "repo": "apache/commons-lang",
425
+ "commit": "b9b30efb01e861a16503232bb96b684107e73199",
426
+ "license": "Apache-2.0",
427
+ "license_file": "LICENSE.txt",
428
+ "bytes_kept": 7323827,
429
+ "files_kept": 621
430
+ },
431
+ {
432
+ "repo": "dotnet/aspnetcore",
433
+ "commit": "ceb0eec49d8d2c77f4f7c26b85ddb6e96940dfed",
434
+ "license": "MIT",
435
+ "license_file": "LICENSE.txt",
436
+ "bytes_kept": 8388820,
437
+ "files_kept": 1407
438
+ },
439
+ {
440
+ "repo": "JamesNK/Newtonsoft.Json",
441
+ "commit": "52fa3aef1f2cadcd3a3f874251eddc98d3efbbaa",
442
+ "license": "MIT",
443
+ "license_file": "LICENSE.md",
444
+ "bytes_kept": 6678579,
445
+ "files_kept": 939
446
+ },
447
+ {
448
+ "repo": "rails/rails",
449
+ "commit": "a0fd31e1a4e96c80d3184998c956607004fb7f8c",
450
+ "license": "MIT",
451
+ "license_file": "MIT-LICENSE",
452
+ "bytes_kept": 8394471,
453
+ "files_kept": 1421
454
+ },
455
+ {
456
+ "repo": "jekyll/jekyll",
457
+ "commit": "97c3bdc822df9d5bea4c269b29a28de5a5e29d70",
458
+ "license": "MIT",
459
+ "license_file": "LICENSE",
460
+ "bytes_kept": 712533,
461
+ "files_kept": 160
462
+ },
463
+ {
464
+ "repo": "sinatra/sinatra",
465
+ "commit": "cb22afd7902b566b6eaba6c4ea89739494a65d12",
466
+ "license": "MIT",
467
+ "license_file": "LICENSE",
468
+ "bytes_kept": 673565,
469
+ "files_kept": 146
470
+ },
471
+ {
472
+ "repo": "laravel/framework",
473
+ "commit": "1de9acf2054cb360659200135e5c246320c7f330",
474
+ "license": "MIT",
475
+ "license_file": "LICENSE.md",
476
+ "bytes_kept": 8394381,
477
+ "files_kept": 1819
478
+ },
479
+ {
480
+ "repo": "symfony/symfony",
481
+ "commit": "03b10a6cd71262b770f6496511ff3c896a2de034",
482
+ "license": "MIT",
483
+ "license_file": "LICENSE",
484
+ "bytes_kept": 8390266,
485
+ "files_kept": 1645
486
+ },
487
+ {
488
+ "repo": "guzzle/guzzle",
489
+ "commit": "b920e5fcaf81d761b8fabe600ca90999beaefdb7",
490
+ "license": "MIT",
491
+ "license_file": "LICENSE",
492
+ "bytes_kept": 1779468,
493
+ "files_kept": 135
494
+ },
495
+ {
496
+ "repo": "JetBrains/kotlin-web-site",
497
+ "commit": "4c0c682dfa2799ca98bf97e86640d757cdb7e11e",
498
+ "license": "Apache-2.0",
499
+ "license_file": "LICENSE",
500
+ "bytes_kept": 894608,
501
+ "files_kept": 335
502
+ },
503
+ {
504
+ "repo": "square/kotlinpoet",
505
+ "commit": "e9c64e7e33221d900473a283f1f17f1439c99753",
506
+ "license": "Apache-2.0",
507
+ "license_file": "LICENSE.txt",
508
+ "bytes_kept": 1246878,
509
+ "files_kept": 131
510
+ },
511
+ {
512
+ "repo": "Kotlin/kotlinx.coroutines",
513
+ "commit": "7e0d1b3e9ca83652427ae00dda7d1673f058a743",
514
+ "license": "Apache-2.0",
515
+ "license_file": "LICENSE.txt",
516
+ "bytes_kept": 3943739,
517
+ "files_kept": 1060
518
+ },
519
+ {
520
+ "repo": "ktorio/ktor",
521
+ "commit": "d96280165fc9890217196ed0dffd45228e35987d",
522
+ "license": "Apache-2.0",
523
+ "license_file": "LICENSE",
524
+ "bytes_kept": 8389113,
525
+ "files_kept": 2045
526
+ },
527
+ {
528
+ "repo": "Alamofire/Alamofire",
529
+ "commit": "bda9ed57d72988a3a2ada33d824583541f86eac6",
530
+ "license": "MIT",
531
+ "license_file": "LICENSE",
532
+ "bytes_kept": 1141239,
533
+ "files_kept": 79
534
+ },
535
+ {
536
+ "repo": "apple/swift-nio",
537
+ "commit": "108daca35da6a1b4ed8da29c1dfbd19668b9b8fc",
538
+ "license": "Apache-2.0",
539
+ "license_file": "LICENSE.txt",
540
+ "bytes_kept": 72733,
541
+ "files_kept": 7
542
+ },
543
+ {
544
+ "repo": "vapor/vapor",
545
+ "commit": "1ccd882a17841f7ae1202b80795259c2c0082354",
546
+ "license": "MIT",
547
+ "license_file": "LICENSE",
548
+ "bytes_kept": 1642178,
549
+ "files_kept": 273
550
+ },
551
+ {
552
+ "repo": "scala/scala",
553
+ "commit": "65f01dbd3131320033301b9db4b83a919a4e7da7",
554
+ "license": "Apache-2.0",
555
+ "license_file": "LICENSE",
556
+ "bytes_kept": 8422876,
557
+ "files_kept": 962
558
+ },
559
+ {
560
+ "repo": "playframework/playframework",
561
+ "commit": "f3eb3222f8911f5126ea5b127d86931518421f36",
562
+ "license": "Apache-2.0",
563
+ "license_file": "LICENSE",
564
+ "bytes_kept": 7612801,
565
+ "files_kept": 1626
566
+ },
567
+ {
568
+ "repo": "ohmyzsh/ohmyzsh",
569
+ "commit": "2100c630ba4bd67bb48802c3e7da893a4fdaa1a0",
570
+ "license": "MIT",
571
+ "license_file": "LICENSE.txt",
572
+ "bytes_kept": 932312,
573
+ "files_kept": 372
574
+ },
575
+ {
576
+ "repo": "nvm-sh/nvm",
577
+ "commit": "e780535240ee3ba67048b434cec6f7f509ee7b31",
578
+ "license": "MIT",
579
+ "license_file": "LICENSE.md",
580
+ "bytes_kept": 238163,
581
+ "files_kept": 9
582
+ },
583
+ {
584
+ "repo": "dylanaraps/neofetch",
585
+ "commit": "ccd5d9f52609bbdcd5d8fa78c4fdb0f12954125f",
586
+ "license": "MIT",
587
+ "license_file": "LICENSE.md",
588
+ "bytes_kept": 0,
589
+ "files_kept": 0
590
+ },
591
+ {
592
+ "repo": "sbt/sbt",
593
+ "commit": "6fcb936dc56b9e020c88bb138879ce9b10e2b29f",
594
+ "license": "Apache-2.0",
595
+ "license_file": "LICENSE",
596
+ "bytes_kept": 4732831,
597
+ "files_kept": 1738
598
+ },
599
+ {
600
+ "repo": "apple/swift-argument-parser",
601
+ "commit": "bd10e57565e21be23b144f3770af7f2bfb068ecf",
602
+ "license": "Apache-2.0",
603
+ "license_file": "LICENSE.txt",
604
+ "bytes_kept": 0,
605
+ "files_kept": 0
606
+ }
607
+ ]
608
+ }
609
+ },
610
+ "div_lic_v2": {
611
+ "author": "SPIRA Hashing",
612
+ "generated_by": "/workspace/spira_shared/hashing_gen/recount_div1/make_manifests_v2.py",
613
+ "inputs_sha256": {
614
+ "build_stage1": "9c1f250db5fa09e2133fad42be0cba64499fde9f223fd6090ad9bee396611c42",
615
+ "broad_gutenberg_v1_manifest": "5ab579c5d8163a51e2b6dc85c28c2faf49ef4656e6e74d84421c76d9a635fd4c",
616
+ "corpus_gutenberg_v2_manifest": "23946761ff37acfeb7bc7671a531fca12ae00abea933550adf3eee3af99f2f07",
617
+ "broad_local_v1_corpus_manifest": "31dea9c394773250ac87e174f21aa6a162b2bbc7320684c52a96f52051ff5cf3"
618
+ },
619
+ "rule": "licences tir\u00e9es UNIQUEMENT des fichiers de build list\u00e9s ; absente => \u00ab non consign\u00e9e \u00bb ; rien de devin\u00e9",
620
+ "segments": {
621
+ "broad_local_v1": {
622
+ "bytes": 34835257,
623
+ "license": "non consign\u00e9e",
624
+ "manifest": "broad/broad_local_v1/corpus_manifest.json",
625
+ "licence_key_present": false,
626
+ "what_it_says": {
627
+ "n_documents": 316,
628
+ "composition": {
629
+ "en": 28654965,
630
+ "fr": 214337,
631
+ "code": 6860045
632
+ },
633
+ "books_used": [
634
+ "alice (gid 11)",
635
+ "frankenstein (gid 84)",
636
+ "dorian_gray (gid 174)",
637
+ "two_cities (gid 98)",
638
+ "dracula (gid 345)",
639
+ "metamorphosis (gid 5200)",
640
+ "pride_prejudice (gid 1342)",
641
+ "great_expectations (gid 1400)",
642
+ "sherlock (gid 1661)",
643
+ "moby_dick (gid 2701)",
644
+ "candide_fr (gid 19942)"
645
+ ],
646
+ "code_files_stdlib": 287,
647
+ "stdlib_dir": "/usr/lib/python3.13",
648
+ "broad_extra_sources": [
649
+ "/workspace/kahnn/data/raw/jane_eyre.txt",
650
+ "/workspace/kahnn/data/raw/huck_finn.txt",
651
+ "/workspace/kahnn/data/raw/tom_sawyer.txt",
652
+ "/workspace/kahnn/data/raw/jekyll_hyde.txt",
653
+ "/workspace/kahnn/data/raw/peter_pan.txt",
654
+ "/workspace/kahnn/data/raw/prince.txt",
655
+ "/workspace/kahnn/data/raw/call_of_wild.txt",
656
+ "/workspace/kahnn/data/raw/yellow_wallpaper.txt",
657
+ "/workspace/kahnn/data/raw/tinystories_valid.txt",
658
+ "/workspace/kahnn/data/raw/wikipedia_extracts.txt",
659
+ "/workspace/kahnn/data/code/bisect_cpython.txt",
660
+ "/workspace/kahnn/data/code/collections_abc.txt",
661
+ "/workspace/kahnn/data/code/dataclasses_cpython.txt",
662
+ "/workspace/kahnn/data/code/heapq_cpython.txt",
663
+ "/workspace/kahnn/data/code/json_cpython.txt",
664
+ "/workspace/kahnn/data/code/kahnn_repo_sources.txt",
665
+ "/workspace/kahnn/data/code/pathlib_cpython.txt",
666
+ "/workspace/kahnn/data/code/python_stdlib_tutorial_excerpt.txt",
667
+ "/workspace/kahnn/data/code/typing_cpython.txt"
668
+ ]
669
+ },
670
+ "note": "Le manifeste donne des gid Gutenberg pour les livres et des chemins pour le reste (tinystories, wikipedia_extracts, stdlib Python, sources du d\u00e9p\u00f4t kahnn) mais aucune licence."
671
+ },
672
+ "corpus_gutenberg_v2_part": {
673
+ "bytes": 255975243,
674
+ "license": "non consign\u00e9e",
675
+ "manifest": "corpus_gutenberg_v2/manifest.json",
676
+ "licence_key_present": false,
677
+ "what_it_says": {
678
+ "source": "Project Gutenberg via aleph.pglaf.org (approuv\u00e9 23/10 16 h 04)",
679
+ "builder": "corpus_gutenberg_v2/build_corpus_v2.py",
680
+ "n_books": 568,
681
+ "book_ids_en": 395,
682
+ "book_ids_fr": 173,
683
+ "en_bytes": 186503118,
684
+ "fr_bytes": 69470991,
685
+ "train_sha256": "75afd55a4e800715d6870ec88ed12e5c01a42b6caa53243ad267a35c55525fb3"
686
+ }
687
+ },
688
+ "broad_gutenberg_v1 (= broad_local_v1 + \\n\\n + corpus_gutenberg_v2)": {
689
+ "license": "non consign\u00e9e",
690
+ "manifest": "broad/broad_gutenberg_v1/manifest.json",
691
+ "licence_key_present": false,
692
+ "what_it_says": {
693
+ "construction": "train.bin = broad_local_v1/train.bin + b'\\n\\n' + corpus_gutenberg_v2/train.bin ; test.bin et oneshot.bin = copies de broad_local_v1 (test20k / fresh_en inchang\u00e9s)",
694
+ "corpus_gutenberg_v2.source": "Project Gutenberg via aleph.pglaf.org (approuv\u00e9 23/10 16 h 04)",
695
+ "broad_local_v1.composition": {
696
+ "en": 28654965,
697
+ "fr": 214337,
698
+ "code": 6860045
699
+ }
700
+ }
701
+ },
702
+ "multi_lang_v1": {
703
+ "bytes": 239327199,
704
+ "by_license": {
705
+ "MIT": {
706
+ "repos": 29,
707
+ "bytes": 103479151,
708
+ "share_of_content_bytes": 0.433378
709
+ },
710
+ "Apache-2.0": {
711
+ "repos": 21,
712
+ "bytes": 98874011,
713
+ "share_of_content_bytes": 0.414091
714
+ },
715
+ "BSD-3-Clause": {
716
+ "repos": 6,
717
+ "bytes": 26999928,
718
+ "share_of_content_bytes": 0.113078
719
+ },
720
+ "curl (MIT/X derivative)": {
721
+ "repos": 1,
722
+ "bytes": 8391247,
723
+ "share_of_content_bytes": 0.035143
724
+ },
725
+ "zlib": {
726
+ "repos": 1,
727
+ "bytes": 1029227,
728
+ "share_of_content_bytes": 0.00431
729
+ }
730
+ },
731
+ "flag_missing_license": "aucun",
732
+ "flag_non_permissive": "aucun (selon le classement PERM/BAD de multi_lang_v1/build.py)",
733
+ "per_repo": "voir manifest_multi_lang_v1_v2.json"
734
+ }
735
+ },
736
+ "bytes_by_license_whole_train": {
737
+ "non consign\u00e9e (broad_local_v1)": 34835257,
738
+ "non consign\u00e9e (corpus_gutenberg_v2, Project Gutenberg)": 255975243,
739
+ "MIT (multi_lang_v1)": 103479151,
740
+ "Apache-2.0 (multi_lang_v1)": 98874011,
741
+ "BSD-3-Clause (multi_lang_v1)": 26999928,
742
+ "curl (MIT/X derivative) (multi_lang_v1)": 8391247,
743
+ "zlib (multi_lang_v1)": 1029227,
744
+ "s\u00e9parateurs multi_lang_v1 (\\n<|endoffile|>\\n)": 553635,
745
+ "s\u00e9parateurs \\n\\n entre segments": 4
746
+ },
747
+ "bytes_total": 530137703,
748
+ "share_non_consignee": 0.548557
749
+ },
750
+ "div_total": 530477020,
751
+ "div_code_multilang": 238773564,
752
+ "div_nonrecorded_pct": 54.98889584321673,
753
+ "div_bytes_measured": 530137703,
754
+ "div_nonrecorded_pct_vs_measured": 54.96008628535518,
755
+ "sha_manifest_multi_lang_v1.json": "538030611b09c78c2e68c31bdc466e2006d524782b41181d3acbc59c7a00ce47",
756
+ "sha_manifest_corpus_diverse_v1.json": "c2f664ba53e6ff09ff36804cd7aefa0762fb81febfcfa4ed3e05882bcd0e70e7",
757
+ "sha_manifest_multi_lang_v1_v2.json": "f166f318b2a75d8d0dfcf42298e424a3932e5ce1490e1c5d5f1e17f8d0aa62ef",
758
+ "sha_manifest_corpus_diverse_v1_v2.json": "2eb30d275c75d1343542b4ae7bcb8fb8d09b76b0ec759edceab4b5d3fc8e1e93",
759
+ "smoke": {
760
+ "ah0": {
761
+ "rate_train": 0.06556640625,
762
+ "rate_eval": 0.06859375,
763
+ "theta_mean": null
764
+ },
765
+ "none": {
766
+ "rate_train": 0.06556640625,
767
+ "rate_eval": 0.06859375,
768
+ "theta_mean": 0.0
769
+ },
770
+ "SP1": {
771
+ "rate_train": 0.099609375,
772
+ "rate_eval": 0.099609375,
773
+ "theta_mean": 0.0
774
+ },
775
+ "SP2": {
776
+ "rate_train": 0.0657861328125,
777
+ "rate_eval": 0.06897786458333334,
778
+ "theta_mean": -0.01368551142513752
779
+ }
780
+ }
781
+ }
v3_scale/checker/recount/audit_manifests_v2_0308.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json,hashlib,collections
2
+ S='/workspace/spira_shared/'
3
+ out={}
4
+ b=json.load(open(S+'multi_lang_v1/build_stage1.json'))
5
+ c=collections.defaultdict(lambda:[0,0])
6
+ for r in b['repos']: c[r['license']][0]+=1; c[r['license']][1]+=r['bytes_kept']
7
+ out['build_license_counts']={k:v for k,v in c.items()}
8
+ out['n_repos']=len(b['repos']); out['excluded']=[e['repo'] for e in b.get('excluded_repos',[])] if isinstance(b.get('excluded_repos'),list) else b.get('excluded_repos')
9
+ out['multi_license_files']=[r['repo'] for r in b['repos'] if (',' in str(r.get('license_file','')))]
10
+ m=json.load(open(S+'hashing_gen/recount_div1/manifest_multi_lang_v1_v2.json'))
11
+ d=json.load(open(S+'hashing_gen/recount_div1/manifest_corpus_diverse_v1_v2.json'))
12
+ out['ml_lic_v2']=m['licences_v2']; out['div_lic_v2']=d['licences_v2']
13
+ cb=d['composition_bytes']; tot=sum(cb.values())
14
+ code=sum(v for k,v in cb.items() if k.startswith('code_'))
15
+ out['div_total']=tot; out['div_code_multilang']=code; out['div_nonrecorded_pct']=100*(tot-code)/tot
16
+ out['div_bytes_measured']=d['bytes_measured']
17
+ out['div_nonrecorded_pct_vs_measured']=100*(d['bytes_measured']-code)/d['bytes_measured']
18
+ for f in ['manifest_multi_lang_v1.json','manifest_corpus_diverse_v1.json','manifest_multi_lang_v1_v2.json','manifest_corpus_diverse_v1_v2.json']:
19
+ out['sha_'+f]=hashlib.sha256(open(S+'hashing_gen/recount_div1/'+f,'rb').read()).hexdigest()
20
+ sm=json.load(open(S+'hashing_gen/lever2_sparse/smoke/smoke_sp.json'))['variants']
21
+ out['smoke']={k:{x:v.get(x) for x in ['rate_train','rate_eval']}|{'theta_mean':v.get('sp_stats',{}).get('theta_mean')} for k,v in sm.items()}
22
+ json.dump(out,open('audit_manifests_v2_0308.json','w'),indent=1,default=str)
23
+ print(json.dumps(out,indent=1,default=str)[:5000])
v3_scale/checker/recount/licence_annex_corpus_diverse_v1_0313.json ADDED
The diff for this file is too large to render. See raw diff
 
v3_scale/checker/recount/licence_annex_work/make_annex.py ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Checker — licence annex for corpus_diverse_v1 (does NOT modify Hashing manifests). Inputs: recon_broad_local_v1.json, recon_gutenberg_v2.json."""
3
+ import json, hashlib, sys, collections
4
+ OUT=sys.argv[1]; S="/workspace/spira_shared"
5
+ rb=json.load(open("recon_broad_local_v1.json")); rg=json.load(open("recon_gutenberg_v2.json"))
6
+ PG="public domain in the USA (Project Gutenberg), subject to the PG license terms for the eBook files"
7
+ UNK="UNKNOWN — à vérifier"
8
+ FILE_ID={"alice":11,"frankenstein":84,"dorian_gray":174,"two_cities":98,"dracula":345,"pride_prejudice":1342,"great_expectations":1400,
9
+ "sherlock":1661,"moby_dick":2701,"candide_fr":4650,"jane_eyre":1260,"huck_finn":76,"tom_sawyer":74,"jekyll_hyde":43,"peter_pan":16,
10
+ "prince":1232,"call_of_wild":215,"yellow_wallpaper":1952}
11
+ EVID={11:"byte-identical body vs corpus_gutenberg_v2/raw/pg11.txt (PG header, not COPYRIGHTED)",16:"identical vs corpus_gutenberg_v2/raw/pg16.txt",
12
+ 43:"identical vs corpus_gutenberg_v2/raw/pg43.txt",74:"file START line has title only (no id); body byte-identical vs corpus_gutenberg_v2/raw/pg74.txt",
13
+ 76:"identical vs corpus_gutenberg_v2/raw/pg76.txt",84:"identical vs corpus_gutenberg_v2/raw/pg84.txt",98:"identical vs corpus_gutenberg_v2/raw/pg98.txt",
14
+ 174:"identical vs corpus_gutenberg_v2/raw/pg174.txt",215:"identical vs corpus_gutenberg_v2/raw/pg215.txt",345:"identical vs corpus_gutenberg_v2/raw/pg345.txt",
15
+ 1232:"identical vs https://aleph.pglaf.org/cache/epub/1232/pg1232.txt (fetched 24/10, not COPYRIGHTED)",1260:"identical vs aleph pg1260.txt (fetched 24/10)",
16
+ 1342:"identical vs aleph pg1342.txt (fetched 24/10)",1400:"identical vs aleph pg1400.txt (fetched 24/10)",1952:"identical vs aleph pg1952.txt (fetched 24/10)",
17
+ 2701:"START/END markers EBOOK 2701; body differs by 33 bytes from current aleph pg2701.txt (1234508 vs 1234541; PG revision likely, not verified); not COPYRIGHTED",
18
+ 1661:"local file keeps full PG header: eBook #1661, no COPYRIGHTED notice",4650:"local file keeps full PG header: 'Candide, ou l’optimisme', eBook #4650, no COPYRIGHTED notice. NB: build_corpus_local.py / corpus_manifest.json label it gid 19942 — the file itself says #4650"}
19
+ rows=[]; tot=collections.Counter()
20
+ def add(seg,src,b,lic,ev,**kw):
21
+ rows.append(dict(segment=seg,source=src,bytes=b,license=lic,evidence=ev,**kw)); tot[lic]+=b
22
+ # broad_local_v1
23
+ agg=collections.OrderedDict()
24
+ for d in rb["docs"]:
25
+ if d["bytes_in_train"]==0: continue
26
+ if d["kind"] in("book","extra") and d["name"] in FILE_ID:
27
+ g=FILE_ID[d["name"]]; p=d.get("orig_src") or d["path"]
28
+ add("broad_local_v1",f"PG eBook #{g} ({d['name']})",d["bytes_in_train"],PG,f"{p} ; {EVID[g]} ; URL https://www.gutenberg.org/ebooks/{g}",
29
+ pg_header_footer_stripped=True,partial=d["bytes_in_train"]<d["doc_bytes"])
30
+ elif d["kind"]=="stdlib":
31
+ p=d["path"]; k=("tarfile" if p.endswith("/tarfile.py") else "turtle" if p.endswith("/turtle.py") else "asyncio" if "/asyncio/" in p else "psf")
32
+ agg.setdefault(k,0); agg[k]+=d["bytes_in_train"]
33
+ elif d["name"]=="tinystories_valid" if d["kind"]=="extra" else False:
34
+ add("broad_local_v1","TinyStories validation split (roneneldan/TinyStories, TinyStories-valid.txt)",d["bytes_in_train"],"CDLA-Sharing-1.0",
35
+ d["path"]+" sha256 94e43181…38b4 == HF x-linked-etag of https://huggingface.co/datasets/roneneldan/TinyStories/resolve/main/TinyStories-valid.txt (size 19447282 identical); licence = dataset card cardData.license 'cdla-sharing-1.0' (HF API, dataset sha f54c09fd)")
36
+ elif d["kind"]=="extra" and d["name"]=="wikipedia_extracts":
37
+ add("broad_local_v1","wikipedia_extracts.txt",d["bytes_in_train"],UNK,d["path"]+" ; aucune provenance vérifiable (kahnn/data/DATA.md déclare 'Wikipedia REST summaries, CC BY-SA 4.0' — déclaration non vérifiée)")
38
+ elif d["kind"]=="kcode":
39
+ decl=("kahnn/data/DATA.md déclare 'Same as AFKmoney/kahnn' mais le dépôt /workspace/kahnn n'a aucun fichier LICENSE/COPYING" if "kahnn_repo" in d["path"]
40
+ else "kahnn/data/DATA.md déclare 'CPython 3.12 excerpts, PSF License' — version/source non vérifiées (pas de copie CPython 3.12 sur disque)")
41
+ add("broad_local_v1",d["path"].split("/")[-1],d["bytes_in_train"],UNK,d["path"]+" ; "+decl)
42
+ else: raise SystemExit(f"unclassified {d}")
43
+ CR="/usr/share/doc/libpython3.13-stdlib/copyright"
44
+ add("broad_local_v1","Python 3.13 stdlib /usr/lib/python3.13 (Debian libpython3.13-minimal/-stdlib, dpkg --verify: .py files unmodified) — hors exceptions",agg["psf"],"PSF-2.0 (Python License)",CR+" (section 'Python License'); file list: checker/recount/licence_annex_work/stdlib_files_in_train.txt")
45
+ add("broad_local_v1","stdlib tarfile.py",agg["tarfile"],"MIT-style (Lars Gustaebel)",CR+" 'Files: Lib/tarfile.py'")
46
+ add("broad_local_v1","stdlib turtle.py",agg["turtle"],"zlib-style (Gregor Lingl)",CR+" 'Files: Lib/turtle.py'")
47
+ add("broad_local_v1","stdlib asyncio/* (32 fichiers)",agg["asyncio"],"PSF-2.0 (Python License) — NB Debian glob 'Lib/async*' (notice permissive Sam Rushing, historiquement asyncore/asynchat) le couvre aussi ; les deux sont permissives",CR+" 'Files: Lib/async*'")
48
+ add("broad_local_v1","séparateurs \\n\\n entre documents",rb["separator_bytes_in_train"],"n/a (séparateurs, aucun contenu)","checker/build_corpus_local.py DOC_SEP")
49
+ add("broad_gutenberg_v1 concat","séparateur \\n\\n broad_local_v1|corpus_gutenberg_v2",2,"n/a (séparateurs, aucun contenu)","broad/broad_gutenberg_v1/manifest.json construction")
50
+ # gutenberg_v2
51
+ pd=[x for x in rg["books"] if not x["copyrighted_marker"]]; cr=[x for x in rg["books"] if x["copyrighted_marker"]]
52
+ add("corpus_gutenberg_v2_part",f"{len(pd)} PG eBooks sans mention COPYRIGHTED (liste par livre : per_book_corpus_gutenberg_v2)",sum(x["bytes_in_train"] for x in pd),PG,
53
+ "corpus_gutenberg_v2/build_corpus_v2.py (MIRROR https://aleph.pglaf.org/cache/epub/{id}/pg{id}.txt) + raw/pg{id}.txt présents sur disque, en-tête PG 'eBook #id' dans chaque fichier ; reconstruction octet-exacte (livres non coupés retrouvés verbatim à leur offset)",
54
+ pg_header_footer_stripped=True)
55
+ add("corpus_gutenberg_v2_part",f"{len(cr)} PG eBooks marqués '*** This is a COPYRIGHTED Project Gutenberg eBook ***' : "+",".join(str(x["gid"]) for x in cr),sum(x["bytes_in_train"] for x in cr),UNK,
56
+ "raw/pg{id}.txt : en-tête COPYRIGHTED -> PAS domaine public ; droits propres à chaque eBook, non vérifiés",pg_header_footer_stripped=True)
57
+ add("corpus_gutenberg_v2_part","séparateurs \\n\\n entre livres",2*(len(rg["books"])-1),"n/a (séparateurs, aucun contenu)","build_corpus_v2.py b'\\n\\n'.join")
58
+ add("corpus_diverse_v1 concat","séparateur \\n\\n broad_gutenberg_v1|multi_lang_v1",2,"n/a (séparateurs, aucun contenu)","manifest_corpus_diverse_v1_v2.json segments_measured")
59
+ ml=json.load(open(f"{S}/hashing_gen/recount_div1/manifest_multi_lang_v1_v2.json"))
60
+ for r in ml["sources"]["per_repo"]: tot["__ml_check"]+=r["bytes_measured"]
61
+ # reconcile
62
+ bl=sum(r["bytes"] for r in rows if r["segment"]=="broad_local_v1"); gv=sum(r["bytes"] for r in rows if r["segment"]=="corpus_gutenberg_v2_part")
63
+ seps=sum(r["bytes"] for r in rows if "concat" in r["segment"])
64
+ md=json.load(open(f"{S}/hashing_gen/recount_div1/manifest_corpus_diverse_v1_v2.json"))
65
+ seg={a:(c-b) for a,b,c in md["segments_measured"]["definition"]}
66
+ ML=md["bytes_measured"]-seg["multi_lang_v1"]
67
+ total=bl+gv+seps+seg["multi_lang_v1"]
68
+ unk=sum(r["bytes"] for r in rows if r["license"]==UNK)
69
+ rec={"broad_local_v1_annex":bl,"broad_local_v1_manifest":seg["broad_local_v1"],"corpus_gutenberg_v2_annex":gv,"corpus_gutenberg_v2_manifest":seg["corpus_gutenberg_v2_part"],
70
+ "concat_separators_annex":seps,"concat_separators_manifest":seg["separator_nn_1"]+seg["separator_nn_2"],"multi_lang_v1_manifest":seg["multi_lang_v1"],
71
+ "multi_lang_v1_per_repo_sum":tot.pop("__ml_check"),"multi_lang_v1_inner_separators":ml["structure_measured"]["separator_bytes"],
72
+ "total_annex_plus_multilang":total,"corpus_diverse_v1_bytes_measured":md["bytes_measured"],
73
+ "train_bin_size_on_disk":__import__("os").path.getsize(f"{S}/corpus_diverse_v1/train.bin")}
74
+ rec["ok"]=(bl==rec["broad_local_v1_manifest"] and gv==rec["corpus_gutenberg_v2_manifest"] and seps==rec["concat_separators_manifest"] and total==rec["corpus_diverse_v1_bytes_measured"]==rec["train_bin_size_on_disk"]
75
+ and rec["multi_lang_v1_per_repo_sum"]+rec["multi_lang_v1_inner_separators"]==seg["multi_lang_v1"])
76
+ prev=bl+gv
77
+ ann={"annex":"licence_annex_corpus_diverse_v1","author":"Checker","generated_by":"checker/recount/licence_annex_work/make_annex.py",
78
+ "does_not_modify":["hashing_gen/recount_div1/manifest_corpus_diverse_v1_v2.json","hashing_gen/recount_div1/manifest_multi_lang_v1_v2.json"],
79
+ "manifest_sha256":{p:hashlib.sha256(open(f"{S}/hashing_gen/recount_div1/{p}","rb").read()).hexdigest() for p in ("manifest_corpus_diverse_v1_v2.json","manifest_multi_lang_v1_v2.json")},
80
+ "scope":"octets de corpus_diverse_v1/train.bin sans licence dans les manifestes v2 : broad_local_v1 [0:34835257] + corpus_gutenberg_v2_part [34835259:290810502] (= broad_gutenberg_v1 moins le séparateur) ; multi_lang_v1 inchangé (licences par dépôt du manifeste Hashing)",
81
+ "method":{"broad_local_v1":"rejeu en mémoire de checker/build_corpus_local.py --variant broad (seed 20261022) : train reconstruit sha256 eda07017… == disque, octet par octet ; attribution exacte octet->fichier source",
82
+ "corpus_gutenberg_v2":"strip() de build_corpus_v2.py sur raw/pg{id}.txt, ordre book_ids, books_cut du manifeste ; somme == 255975243 ; tous les livres non coupés retrouvés verbatim",
83
+ "pg_header_footer":"retirés : strip_gutenberg_header (avant '*** START OF' et à partir de '*** END OF') pour broad_local_v1 ; build_corpus_v2.strip() retire en plus toute ligne contenant 'gutenberg' etc. Résidu : 0 occurrence 'gutenberg' dans corpus_gutenberg_v2/train.bin ; 1 occurrence 'Project Gutenberg' dans broad_local_v1/train.bin (note du transcripteur de Moby Dick #2701, offset 24706512 : « one from Project Gutenberg’s archives »), 0 marqueur START/END. Conséquence : le texte de la licence PG n'accompagne pas les octets ; à prendre en compte si redistribution."},
84
+ "rows":rows,
85
+ "bytes_by_license_in_scope":dict(tot),
86
+ "reconciliation":rec,
87
+ "unknown_bytes":unk,
88
+ "unknown_pct_of_corpus_diverse_v1":round(100*unk/md["bytes_measured"],4),
89
+ "unknown_pct_of_previously_unlicensed_part":round(100*unk/prev,4),
90
+ "previously_unlicensed_bytes":prev,"previously_unlicensed_pct":round(100*prev/md["bytes_measured"],4),
91
+ "notes":["metamorphosis (PG #5200, marqué COPYRIGHTED) = holdout oneshot.bin, 0 octet dans train.",
92
+ "frankenstein (#84) tombe entièrement dans test.bin de broad_local_v1 (0 octet train) ; prince (#1232) partiel (139036 o).",
93
+ "Divergence d'étiquette : candide_fr est l'eBook PG #4650 d'après le fichier ; build_corpus_local.py et corpus_manifest.json disent gid 19942.",
94
+ "Recouvrement : PG #11,16,43,74,76,98,174,215,345 sont à la fois dans broad_local_v1 et dans corpus_gutenberg_v2 (#84 retiré par dédup) — doublons dans corpus_diverse_v1, signalé seulement.",
95
+ "Statut 'public domain in the USA' : appliqué seulement aux eBooks sans mention COPYRIGHTED dans l'en-tête PG (vérifiée localement ou sur aleph.pglaf.org). Hors USA : non évalué."],
96
+ "per_book_corpus_gutenberg_v2":[{k:x[k] for k in ("gid","lang","bytes_in_train","bytes_cut_dedup","copyrighted_marker","url","raw","raw_sha256","title")}|{"license":UNK if x["copyrighted_marker"] else PG} for x in rg["books"]]}
97
+ json.dump(ann,open(OUT,"w"),indent=1,ensure_ascii=False)
98
+ print(json.dumps({k:ann[k] for k in ("bytes_by_license_in_scope","reconciliation","unknown_bytes","unknown_pct_of_corpus_diverse_v1","unknown_pct_of_previously_unlicensed_part","previously_unlicensed_pct")},indent=1,ensure_ascii=False))
99
+ for r in rows: print(r["bytes"],"|",r["license"][:40],"|",r["source"][:90])
v3_scale/checker/recount/licence_annex_work/recon_broad_local_v1.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Checker — read-only reconstruction of broad_local_v1/train.bin per document (no file written except JSON out).
3
+ Replays checker/build_corpus_local.py --variant broad logic in memory, checks sha256 vs on-disk train.bin,
4
+ and attributes every train byte to its source file."""
5
+ import glob, hashlib, json, os, random, sys, sysconfig
6
+ sys.path.insert(0, "/workspace/spira_shared/checker")
7
+ import build_corpus_local as B
8
+ BOOKS="/workspace/spira_shared/broad/broad_local_v1/books"
9
+ docs=[]; hold=[]
10
+ for gid,name,h in B.ENGLISH_BOOKS+B.FRENCH_BOOKS:
11
+ p=f"{BOOKS}/{name}.txt"
12
+ if not os.path.exists(p): continue
13
+ raw0=open(p,"rb").read(); raw=B.strip_gutenberg_header(raw0)
14
+ if len(raw)<20000: continue
15
+ src={"kind":"book","name":name,"gid":gid,"staged":p,"orig_src":B.LOCAL_BOOKS[name][1],
16
+ "orig_equal_staged": open(B.LOCAL_BOOKS[name][1],"rb").read()==raw0,
17
+ "header_stripped": raw!=raw0}
18
+ (hold if h else docs).append((("fr" if name.endswith("_fr") else "en"),raw,src))
19
+ stdlib="/usr/lib/python3.13"
20
+ for p in B.collect_code_files(stdlib,B.CODE_BUDGET_BYTES):
21
+ raw=open(p,"rb").read()
22
+ if raw: docs.append(("code",raw,{"kind":"stdlib","path":p}))
23
+ for n in B.BROAD_EXTRA:
24
+ p=f"{B.RAW}/{n}.txt"; raw0=open(p,"rb").read(); raw=B.strip_gutenberg_header(raw0)
25
+ docs.append(("en",raw,{"kind":"extra","name":n,"path":p,"header_stripped":raw!=raw0}))
26
+ for p in sorted(glob.glob("/workspace/kahnn/data/code/*")):
27
+ docs.append(("code",open(p,"rb").read(),{"kind":"kcode","path":p}))
28
+ rng=random.Random(20261022); rng.shuffle(docs)
29
+ SEP=B.DOC_SEP
30
+ stream=SEP.join(d[1] for d in docs)
31
+ n_test=int(len(stream)*0.05); cut=len(stream)-n_test
32
+ b=stream.rfind(SEP,0,cut+n_test//2)
33
+ if b==-1 or b<len(stream)//2: b=cut
34
+ train=stream[:b]
35
+ disk=open("/workspace/spira_shared/broad/broad_local_v1/train.bin","rb").read()
36
+ res={"recon_train_len":len(train),"disk_len":len(disk),
37
+ "recon_sha256":hashlib.sha256(train).hexdigest(),"disk_sha256":hashlib.sha256(disk).hexdigest()}
38
+ res["identical"]=train==disk
39
+ # attribute
40
+ pos=0; per=[]; sepbytes=0
41
+ for i,(dom,raw,src) in enumerate(docs):
42
+ start=pos; end=pos+len(raw)
43
+ in_train=max(0,min(end,b)-start)
44
+ per.append(dict(src,domain=dom,doc_bytes=len(raw),bytes_in_train=in_train,start=start))
45
+ pos=end
46
+ if i<len(docs)-1:
47
+ s=max(0,min(pos+len(SEP),b)-pos); sepbytes+=s; pos+=len(SEP)
48
+ res["separator_bytes_in_train"]=sepbytes
49
+ res["sum_check"]=sum(x["bytes_in_train"] for x in per)+sepbytes
50
+ res["docs"]=per
51
+ json.dump(res,open(sys.argv[1],"w"),indent=1)
52
+ print({k:v for k,v in res.items() if k!="docs"})
v3_scale/checker/recount/licence_annex_work/recon_gutenberg_v2.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Checker — read-only per-book attribution of corpus_gutenberg_v2/train.bin (no write except JSON out).
3
+ Uses strip() from corpus_gutenberg_v2/build_corpus_v2.py, sorted book_ids, books_cut from manifest.
4
+ Checks: each uncut book found verbatim at its expected offset; total == train size; header markers per raw file."""
5
+ import sys, json, re, hashlib, csv
6
+ sys.path.insert(0,"/workspace/spira_shared/corpus_gutenberg_v2")
7
+ import importlib.util
8
+ spec=importlib.util.spec_from_file_location("b","/workspace/spira_shared/corpus_gutenberg_v2/build_corpus_v2.py"); b=importlib.util.module_from_spec(spec); spec.loader.exec_module(b)
9
+ D="/workspace/spira_shared/corpus_gutenberg_v2"
10
+ m=json.load(open(f"{D}/manifest.json")); tr=open(f"{D}/train.bin","rb").read()
11
+ cuts={int(k):v for k,v in m["dedup"]["books_cut"].items()}
12
+ cat={int(r["Text#"]):r for r in csv.DictReader(open(f"{D}/pg_catalog.csv",encoding="utf-8"))}
13
+ en=set(m["book_ids_en"]); pos=0; books=[]; bad=[]
14
+ for i,g in enumerate(m["book_ids"]):
15
+ raw=open(f"{D}/raw/pg{g}.txt","rb").read(); t=b.strip(raw)
16
+ n=len(t)-cuts.get(g,0)
17
+ verbatim = (tr[pos:pos+n]==t) if g not in cuts else None
18
+ if g not in cuts and not verbatim: bad.append(g)
19
+ head=raw[:3000]
20
+ mid=re.search(rb"\*\*\* ?START OF (?:THE|THIS) PROJECT GUTENBERG EBOOK ?(\d+)?",raw[:20000])
21
+ books.append({"gid":g,"lang":"en" if g in en else "fr","bytes_in_train":n,"bytes_cut_dedup":cuts.get(g,0),
22
+ "url":f"https://aleph.pglaf.org/cache/epub/{g}/pg{g}.txt","raw":f"{D}/raw/pg{g}.txt",
23
+ "raw_sha256":hashlib.sha256(raw).hexdigest(),
24
+ "pg_header_present":b"Project Gutenberg" in head,
25
+ "start_marker_id":(mid.group(1).decode() if mid and mid.group(1) else None),
26
+ "copyrighted_marker":bool(re.search(rb"(?i)copyrighted project gutenberg",raw[:5000])),
27
+ "pd_usa_statement":bool(re.search(rb"(?i)for the use of anyone anywhere in the United States",raw[:5000])),
28
+ "title":cat.get(g,{}).get("Title","")[:120],"authors":cat.get(g,{}).get("Authors","")[:120],
29
+ "verbatim_at_offset":verbatim,"offset":pos})
30
+ pos+=n+(2 if i<len(m["book_ids"])-1 else 0)
31
+ out={"train_len":len(tr),"sum_books_plus_seps":pos,"n_books":len(books),"n_separators":len(books)-1,
32
+ "sum_book_bytes":sum(x["bytes_in_train"] for x in books),"uncut_not_verbatim":bad,
33
+ "residual_gutenberg_lines_in_train":len(re.findall(rb"(?i)gutenberg",tr)),
34
+ "books":books}
35
+ json.dump(out,open(sys.argv[1],"w"),indent=1,ensure_ascii=False)
36
+ print({k:v for k,v in out.items() if k!="books"})
37
+ print("copyrighted:",[x["gid"] for x in books if x["copyrighted_marker"]])
38
+ print("no PD-USA stmt:",[x["gid"] for x in books if not x["pd_usa_statement"]][:50], sum(1 for x in books if not x["pd_usa_statement"]))
39
+ print("id mismatch:",[(x["gid"],x["start_marker_id"]) for x in books if x["start_marker_id"] and int(x["start_marker_id"])!=x["gid"]])
40
+ print("no header:",[x["gid"] for x in books if not x["pg_header_present"]])