agentic-env-index / docs /selecting.md
Battam's picture
update dataset card and meta tables
c4f91a4 verified
|
Raw History Blame Contribute Delete
43.7 kB

Selecting rows

Every table in this repository is Parquet. One row of data/<source>/<batch>/part-*.parquet is one downloadable item: a file, an archive member, a WARC record, a byte range or an API response. The tables under meta/ are small and say which rows are worth using.

A batch still being collected also has data/<source>/<batch>/part-tail.parquet: the rows that do not yet fill a numbered part file. It is replaced as collection goes on and its rows move into the next part-<number>.parquet once that file fills, so for tail rows row_file and row_index are not stable. Globs such as part-*.parquet or */*.parquet include it. A finished batch has no tail file: all of its rows are in numbered part files.

Row fields

Field Meaning
source Source name (see meta/sources.json).
batch Batch inside the source (one snapshot or collection run).
collection Collection name inside the source.
ext File extension without the dot, as found at the source.
uri Address to download from (HTTPS where the source offers it).
range_offset, range_length Byte range inside the file at uri, for records stored inside a larger file.
member_path, parent_pointer_id Path of a member inside an archive, and the archive's pointer.
zip_local_header_offset, zip_compression_method, zip_compressed_size Where a zip member's bytes sit, so it can be read with range requests.
size_bytes Size of the item in bytes (empty when the source does not say).
media_type Media type when the source states one.
sha256, sha1, md5, crc32 Hashes as raw bytes; use lower(hex(sha256)) for the hex form.
origin_url, origin_time The page the item was found on and when it was captured.
truncated Why stored content was cut short (empty when it was not).
license_spdx, license_training_ok, license_redistribution_ok, license_notes The row's own license when it differs from the batch license.
extra Anything else the full pointer carries, as JSON; fetch.py rebuilds the full pointer from it.
row_file, row_index Where the row sits: the data file (source/batch/part file) and the row number in it, counting from 0. Not stored in the data files; tools/fetch.py adds them when reading, the starter files carry them. meta/duplicates.parquet names rows by them.

Tables under meta/

  • meta/batches.parquet: one row per source and batch: license tiers (training_ok, redistribution_ok), reachability from the last link check, the overall size cap used by tools/fetch.py (max_size_bytes), content categories, and the constants and rules used to rebuild full pointers.
  • meta/duplicates.parquet: rows the default filter removes as duplicates, each named by its place in the data files (batch, row_file, row_index), with the reason and the copy that is kept (keep_*): natural_key, another row with the same source, uri, range_offset and member_path was kept (the one from the latest batch; within one batch the first in file order), and that kept row has natural_key_conflict true in tools/fetch.py output; superseded, the row belongs to a snapshot replaced by a newer batch (keep_batch); same_sha256, same_sha1, same_md5, another row with the same hash was kept.
  • meta/bench_overlap.parquet: rows found in public benchmark tasks: scope row matches one row, scope container matches a whole collection; hit_class says how the match was made. When one row is a copy of benchmark data (benchmark_copy), its whole collection is listed only if the collection is one self-contained unit: one package, code repository, dataset or model repository (collection_kind "unit" in meta/sources.json, except the collections named in bucket_collections). Where collections are buckets (by file type, crawl, date, site and the like), only that row is listed. Only rows of files that were compared with the benchmark list can be found here (see meta/bench_checked.parquet).
  • meta/bench_checked.parquet: which rows were compared with the benchmark list. It lists only what was checked: scope file has one row per data file (row_file) every pointer file behind which was scanned (reason scanned); the tail file of a batch still being collected is never listed, since it is replaced as collection goes on. Scope container lists collections whose name matches a benchmark and that await a ruling (reason pending_ruling). The one row with scope unlisted (reason not_listed) applies to every data file not listed here: files not compared yet and files published after this table was built. default_keep says whether the default filter keeps the rows.
  • meta/tags.parquet: use tags (for example data-processing or help-requests) for each source, batch, collection, extension, metadata value and content category, with row counts and the reference size cap of the tag's content class (max_size_bytes).
  • meta/size_caps.json: reference size caps: for each content class the typical size of benchmark task files of that class, and the overall cap over all benchmark task files; how each was derived (sample count, percentile, value) and how it is recalibrated; provisional. They do not remove rows: tools/fetch.py uses the overall cap when downloading, or the class caps with --cap per-class.
  • meta/sources.json: per-source details, including the layout used to rebuild full pointers.
  • meta/coverage.json: totals by license tier, source, unit, size and tag.

starter/<tag>.parquet holds a sample of about ten thousand rows per tag that pass the default filter, spread over sources (at most 30% from one source), extensions and size classes.

cards/<source>.yaml is a source card: what the files of one source are (types, structure, what a task could be built from, risks), how a sample was drawn and read, and for every field evidence.<field>.fill: auto (computed from the index, refreshed daily), judgment (from sample files that were downloaded and read, with the basis and the files used), derived (a fixed rule over other fields) or unfilled (no evidence yet). Read the evidence before relying on a field; ratios count the sample, not the whole source.

The default filter

The default subset only contains rows of data files that were compared with the benchmark list (AA-Briefcase-Lite, APEX-Agents, Agents' Last Exam, AndroidWorld, AutomationBench, BrowseComp, BrowseComp-Plus, CyberGym, DeepSWE, EnterpriseOps-Gym, Finance Agent, FrontierSWE v2, GDPval, Harvey LAB, MCP Atlas, MCPMark, Multi-SWE-bench, NL2Repo, OSWorld, OSWorld 2, SWE-bench Multilingual, SWE-bench Multimodal, SWE-bench Pro, SWE-bench Verified, SciCode, Terminal-Bench, Toolathlon, WideSearch, tau2-bench), as of 2026-10-05T14:11:22+0800, minus the copies of benchmark data found there and duplicate copies of the same file. Rows of files that were not compared, of the tail file of a batch still being collected, of files published after meta/bench_checked.parquet was built and of collections awaiting a ruling are left out; meta/bench_checked.parquet lists the data files that were compared and the collections awaiting a ruling, and any file it does not list counts as not compared. License tiers, sizes and versions do not remove rows; the queries below choose by them. Truncated rows, empty files and rows of batches whose link check was partial stay in; the reference counts below count them. A row passes when all of these hold:

  • not_duplicate: the row is not listed in meta/duplicates.parquet (one copy of each duplicated file is kept; of rows that share a natural key only the latest is kept).
  • not_in_benchmark_row / not_in_benchmark_container: the row and its collection are not in meta/bench_overlap.parquet with hit class benchmark_copy, task_file, data_address (copies of benchmark data found in the rows that were compared, including collections derived from a benchmark).
  • checked_for_benchmarks: the row's data file is listed in meta/bench_checked.parquet as compared with the benchmark list (checked true), and its collection is not listed there as awaiting a ruling; rows of files not listed there (not compared yet, or published after that table was built) do not pass.

tools/fetch.py applies it unless you pass --no-default-filter. Size caps apply only when downloading: by default the overall cap of meta/size_caps.json (the 99th percentile of all benchmark task files) guards against huge files; --cap per-class uses the reference cap of the row's content class and --max-size N uses N bytes. A row above its cap is recorded as too_large and not downloaded; a row of unknown size is downloaded up to the cap.

Rows per source

Every row of the index is counted once: either it is in the default subset or it is removed by the first rule of the default filter it fails (duplicate copies first, then copies of benchmark data, then rows that were not compared with the benchmark list). Rows equals Default subset plus In a benchmark plus Duplicate copy plus Not checked.

Source Rows Default subset In a benchmark Duplicate copy Not checked
ansible-galaxy-collections 52,784 52,784 0 0 0
apache-jira 1,179,062 1,049,601 0 129,461 0
arquivo-pt 85,980 85,977 0 3 0
artifact-hub-helm-charts 127,281 123,337 0 3,944 0
arxiv-source 3,165,721 3,165,721 0 0 0
bioinformatics-public-archives 278,202 278,202 0 0 0
centos-cbs-build-logs 113,676 113,676 0 0 0
chromium-luci-builds 8,665,027 7,926,998 0 738,029 0
common-crawl 148,118,699 138,519,418 71 9,599,210 0
conda-forge-packages 3,369,245 3,369,245 0 0 0
cpan-distributions 165,740 161,803 0 3,937 0
cran 25,299 25,284 0 15 0
crates-io 3,252,145 3,252,144 1 0 0
ctftime 75,162 75,101 0 61 0
datacite-dois 33,962,027 33,101,911 0 3,278 856,838
debian-bugs 2,244,932 2,244,932 0 0 0
debian-sources 115,614 111,237 0 4,377 0
debian-ubuntu-binary-packages 676,230 671,424 0 4,806 0
discourse-forums 12,203,622 11,876,328 0 128,823 198,471
docker-hub 593,368 364,320 0 229,048 0
egov-japan-data 292,050 292,050 0 0 0
end-of-term-web-archive 337,638,097 334,734,149 420 2,903,528 0
enron-spreadsheets-emails 14 14 0 0 0
eu-cellar-documents 1,921,815 1,910,370 0 11,445 0
european-parliament-plenary 1,233,677 1,228,256 0 5,421 0
f-droid-apps 196,376 196,370 0 6 0
fatcat-files 47,096,418 46,846,051 29 250,338 0
fedora-koji-build-logs 119,036 0 0 0 119,036
freebsd-bugzilla 573,793 571,150 0 2,643 0
fuse-spreadsheets 1 1 0 0 0
fuse-spreadsheets-common-crawl 249,376 242,373 0 7,003 0
gcc-bugzilla 186,889 186,706 0 183 0
gh-archive-hourly 136,799 136,799 0 0 0
github-gap-language-repos 7,028,005 6,469,659 0 0 558,346
github-release-assets 69,081 0 0 1,437 67,644
go-module-proxy-zips 59,120,216 59,113,479 6,737 0 0
govdocs1 1,000 1,000 0 0 0
govdocs1-files 986,279 986,279 0 0 0
govinfo-bulk-data 419,274 419,274 0 0 0
hackage-packages 154,127 153,030 0 1,097 0
hacker-news-threads 4,790,481 4,790,481 0 0 0
harvard-dataverse 948,347 0 1 33,906 914,440
homebrew-packages 81,275 76,896 0 4,379 0
hyperkitty-mailing-list-archives 80,365 80,365 0 0 0
if-archive 23,819 22,495 0 1,324 0
internet-archive-open-licensed 3,026,414 2,616,210 0 330,988 79,216
kaggle-file-listings 205,735 0 0 0 205,735
kde-webkit-gentoo-bugzilla 1,781,696 1,407,850 0 15,036 358,810
kernel-bugzilla 125,846 125,660 0 186 0
launchpad-ubuntu-bugs 97,333 0 0 1,972 95,361
lean-toolchains-and-packages 37,933 37,748 2 183 0
libreoffice-bugzilla 244,962 244,589 0 373 0
lichess 1,369 1,369 0 0 0
linux-kernel-mail-archives 405 405 0 0 0
loghub 19 19 0 0 0
mastodon-public-timelines 4,914,927 4,753,253 0 161,674 0
mendeley-data 130,156 0 0 7,171 122,985
modelscope 8,726,153 7,513,418 20,237 955,302 237,196
mozilla-bugzilla 3,896,234 3,872,911 0 23,323 0
mozilla-treeherder-ci-logs 37,531 0 0 0 37,531
napierone-digital-corpora 1,056 1,041 0 15 0
napierone-files 659,576 659,576 0 0 0
npm 51,767,788 51,106,932 0 482 660,374
nuget 636,597 563,278 0 0 73,319
nvd-cve 381,690 381,690 0 0 0
opendev-zuul-ci 27,332 27,332 0 0 0
openstreetmap-planet 27,295,635 27,295,635 0 0 0
osv-vulnerabilities 2,616,111 2,251,600 0 364,511 0
pmc-open-access 4,847,928 4,088,751 0 394,096 365,081
project-gutenberg 2,024,683 2,024,635 48 0 0
pypi 45,486,331 23,809,929 377 21,676,025 0
reddit-threads-arctic-shift 318,856 0 0 0 318,856
redhat-bugzilla 1,382,531 683,388 0 6,499 692,644
rosetta-code-github-mirror 148,991 148,991 0 0 0
rubygems 452,442 0 0 0 452,442
safedocs-cc-main-2021-31 13,457,931 12,179,826 0 1,278,105 0
sec-edgar-filings 18,788,783 18,788,783 0 0 0
smithsonian-open-access 9,311,739 9,311,739 0 0 0
solver-benchmark-instances 108,083 0 0 0 108,083
sourceware-public-inbox 168 168 0 0 0
stackexchange-api-posts 3,084,502 3,082,901 0 1,601 0
stackexchange-dump 3,629 364 0 3,265 0
ubuntu-irc-logs 456,106 456,106 0 0 0
uk-parliament-hansard 1,370,783 1,370,781 0 2 0
wikimedia-talk-dumps 1,563 1,563 0 0 0
worldbank-open-data 33,928 33,789 0 139 0
zenodo10k-slides 10,448 10,393 0 55 0
zulip-public-chats 1,300,638 1,226,067 0 74,571 0
all 891,018,987 845,105,380 27,923 39,363,276 6,522,408

Reference counts over the rows of the default subset (none of them removes a row): Size unknown, rows whose size the source does not state; Over class cap, rows larger than the reference cap of their content class (the largest max_size_bytes among their tags in meta/tags.parquet, otherwise the overall cap), which tools/fetch.py --cap per-class would not download; Truncated, rows whose stored content was cut short (field truncated); Empty file, rows whose stated size is 0 bytes; Link check partial, rows of batches whose last link check reached only part of the sample (reachability partial in meta/batches.parquet); and the rows in each license tier for training and for redistribution (the row's own tier when it has one, otherwise the batch tier).

Source Size unknown Over class cap Truncated Empty file Link check partial Training yes Training conditional Training no Training unknown Redistribution yes Redistribution conditional Redistribution no Redistribution unknown
ansible-galaxy-collections 52,784 0 0 0 0 36,969 9 918 14,888 19,061 18,480 0 15,243
apache-jira 0 0 0 1 0 0 0 0 1,049,601 0 0 0 1,049,601
arquivo-pt 82,215 1,908 0 0 0 0 0 0 85,977 0 0 85,977 0
artifact-hub-helm-charts 123,337 0 0 0 0 21,886 0 0 101,451 19,295 2,591 0 101,451
arxiv-source 0 257,642 0 0 0 633,568 172,937 0 2,359,216 603,318 203,187 1,904,032 455,184
bioinformatics-public-archives 237,457 36,311 0 0 0 266,294 0 0 11,908 266,274 20 0 11,908
centos-cbs-build-logs 0 107 0 0 0 0 0 0 113,676 0 0 0 113,676
chromium-luci-builds 7,926,998 0 0 0 0 0 0 0 7,926,998 0 0 0 7,926,998
common-crawl 0 85,594,811 8,626,564 0 0 0 0 0 138,519,418 0 0 0 138,519,418
conda-forge-packages 0 85,579 0 0 0 3,176,854 0 0 192,391 2,448,828 728,026 0 192,391
cpan-distributions 0 22 0 2 0 115,204 0 0 46,599 11,658 103,546 0 46,599
cran 0 0 0 0 0 25,284 0 0 0 8,305 16,979 0 0
crates-io 0 0 0 0 0 3,129,852 16,827 0 105,465 2,843,317 303,362 0 105,465
ctftime 33,023 0 0 0 0 0 0 75,101 0 0 0 0 75,101
datacite-dois 33,099,731 1,608 0 0 0 32,844,639 3,156 0 254,116 32,844,584 3,211 0 254,116
debian-bugs 0 53 0 0 0 0 0 0 2,244,932 0 0 0 2,244,932
debian-sources 0 260 0 0 0 111,237 0 0 0 0 111,237 0 0
debian-ubuntu-binary-packages 0 8,640 0 0 0 622,961 0 0 48,463 0 622,961 0 48,463
discourse-forums 0 0 0 0 0 1,096,598 4,568,031 0 6,211,699 306,221 5,250,767 0 6,319,340
docker-hub 0 238,875 0 101 0 0 364,320 0 0 0 0 0 364,320
egov-japan-data 244,867 5,582 0 0 0 289,283 3 0 2,764 289,283 3 0 2,764
end-of-term-web-archive 0 53,625,978 0 0 0 334,734,149 0 0 0 334,734,149 0 0 0
enron-spreadsheets-emails 0 14 0 0 0 14 0 0 0 14 0 0 0
eu-cellar-documents 1,396,072 176,462 0 0 0 1,910,370 0 0 0 1,910,370 0 0 0
european-parliament-plenary 712,457 73,728 0 1 0 1,228,256 0 0 0 1,228,256 0 0 0
f-droid-apps 0 25,349 0 0 0 196,138 0 0 232 55,865 140,273 0 232
fatcat-files 26,966 41,935,035 0 0 0 0 0 0 46,846,051 0 0 0 46,846,051
fedora-koji-build-logs 0 0 0 0 0 0 0 0 0 0 0 0 0
freebsd-bugzilla 0 0 0 66 0 0 0 0 571,150 0 0 0 571,150
fuse-spreadsheets 0 1 0 0 0 1 0 0 0 1 0 0 0
fuse-spreadsheets-common-crawl 0 5,945 7,745 0 0 0 0 0 242,373 0 0 0 242,373
gcc-bugzilla 53 0 0 2 0 0 0 0 186,706 0 0 0 186,706
gh-archive-hourly 0 135,003 0 0 0 0 0 0 136,799 0 0 0 136,799
github-gap-language-repos 0 784 0 150,907 0 3,524,474 0 0 2,945,185 2,765,762 758,712 0 2,945,185
github-release-assets 0 0 0 0 0 0 0 0 0 0 0 0 0
go-module-proxy-zips 59,113,479 0 0 0 0 34,641,585 77,603 0 24,394,291 29,215,449 5,503,739 0 24,394,291
govdocs1 0 1,000 0 0 0 1,000 0 0 0 1,000 0 0 0
govdocs1-files 0 165,940 0 0 0 986,279 0 0 0 986,279 0 0 0
govinfo-bulk-data 0 16,192 0 0 419,274 419,274 0 0 0 419,274 0 0 0
hackage-packages 0 0 0 0 0 141,534 0 0 11,496 128,458 13,076 0 11,496
hacker-news-threads 4,790,481 0 0 0 0 0 0 4,790,481 0 0 0 4,790,481 0
harvard-dataverse 0 0 0 0 0 0 0 0 0 0 0 0 0
homebrew-packages 29,220 1,434 0 0 0 66,985 0 0 9,911 44,273 22,712 0 9,911
hyperkitty-mailing-list-archives 80,365 0 0 0 0 0 0 0 80,365 0 0 0 80,365
if-archive 0 150 0 0 0 0 0 22,344 151 0 0 22,344 151
internet-archive-open-licensed 0 145,408 0 0 0 32,210 11,137 0 2,572,863 31,323 12,024 0 2,572,863
kaggle-file-listings 0 0 0 0 0 0 0 0 0 0 0 0 0
kde-webkit-gentoo-bugzilla 0 0 0 333 0 0 0 0 1,407,850 0 0 0 1,407,850
kernel-bugzilla 0 0 0 22 0 0 0 0 125,660 0 0 0 125,660
launchpad-ubuntu-bugs 0 0 0 0 0 0 0 0 0 0 0 0 0
lean-toolchains-and-packages 872 22,220 0 0 0 21,258 0 0 16,490 21,218 40 0 16,490
libreoffice-bugzilla 0 0 0 240 0 244,589 0 0 0 0 244,589 0 0
lichess 0 390 0 0 0 1,369 0 0 0 1,289 80 0 0
linux-kernel-mail-archives 405 0 0 0 405 0 0 405 0 0 0 0 405
loghub 0 7 0 0 0 0 19 0 0 0 19 0 0
mastodon-public-timelines 1,144,744 0 0 0 0 0 0 1,807,989 2,945,264 0 0 0 4,753,253
mendeley-data 0 0 0 0 0 0 0 0 0 0 0 0 0
modelscope 0 1,704,415 0 0 0 6,343,508 412,468 0 757,442 6,209,100 543,210 4,097 757,011
mozilla-bugzilla 0 0 0 645 0 0 0 0 3,872,911 0 0 0 3,872,911
mozilla-treeherder-ci-logs 0 0 0 0 0 0 0 0 0 0 0 0 0
napierone-digital-corpora 0 592 0 0 0 1,009 0 0 32 0 1,009 0 32
napierone-files 0 35,555 0 0 0 614,567 0 0 45,009 0 614,567 0 45,009
npm 51,106,932 0 0 0 0 41,174,515 162,200 0 9,770,217 38,289,409 3,047,306 0 9,770,217
nuget 0 379 0 0 0 1 0 0 563,277 1 0 0 563,277
nvd-cve 0 0 0 0 0 381,690 0 0 0 381,690 0 0 0
opendev-zuul-ci 0 15 0 0 0 0 0 0 27,332 0 0 0 27,332
openstreetmap-planet 14,266,744 3,620 0 11 0 27,295,629 0 0 6 0 27,295,629 0 6
osv-vulnerabilities 0 10 0 0 0 451,106 0 0 1,800,494 381,508 69,598 0 1,800,494
pmc-open-access 0 897,081 0 0 0 2,371,295 1,317,229 0 400,227 2,371,266 909,071 408,187 400,227
project-gutenberg 942,231 1,659 0 11 0 2,001,011 0 0 23,624 0 2,001,011 23,624 0
pypi 0 209,692 0 1 0 19,530,642 59,074 0 4,220,213 16,599,815 2,989,901 0 4,220,213
reddit-threads-arctic-shift 0 0 0 0 0 0 0 0 0 0 0 0 0
redhat-bugzilla 0 0 0 105 0 0 0 0 683,388 0 0 0 683,388
rosetta-code-github-mirror 0 0 0 84 0 0 0 0 148,991 0 0 0 148,991
rubygems 0 0 0 0 0 0 0 0 0 0 0 0 0
safedocs-cc-main-2021-31 0 5,278,828 0 0 0 0 0 0 12,179,826 0 0 0 12,179,826
sec-edgar-filings 18,788,783 0 0 0 0 18,788,783 0 0 0 18,788,783 0 0 0
smithsonian-open-access 0 5,018,412 0 1,691 0 9,311,739 0 0 0 9,311,739 0 0 0
solver-benchmark-instances 0 0 0 0 0 0 0 0 0 0 0 0 0
sourceware-public-inbox 168 0 0 0 0 0 0 0 168 0 0 0 168
stackexchange-api-posts 0 0 0 0 0 0 0 3,082,901 0 0 3,082,901 0 0
stackexchange-dump 0 82 0 0 0 2 0 362 0 0 2 362 0
ubuntu-irc-logs 229,171 0 0 0 0 0 456,106 0 0 0 456,106 0 0
uk-parliament-hansard 1,370,781 0 0 0 0 1,370,781 0 0 0 1,370,781 0 0 0
wikimedia-talk-dumps 0 669 0 0 0 1,563 0 0 0 47 1,516 0 0
worldbank-open-data 484 2,429 0 0 0 33,333 299 0 157 33,149 483 0 157
zenodo10k-slides 0 3,266 0 0 0 10,211 143 0 39 9,988 366 0 39
zulip-public-chats 0 0 0 0 0 0 0 1,226,067 0 0 1,226,067 0 0
all 195,800,820 195,719,142 8,634,309 154,223 419,679 550,201,499 7,621,561 11,006,568 276,275,752 504,950,400 56,298,377 7,239,104 276,617,499

Querying with DuckDB

Run these statements once (DuckDB 1.1 or newer reads hf:// paths; set HF_TOKEN for higher rate limits). They define the views used below: p rows, b batches, d duplicates, o benchmark overlap, c benchmark check coverage, t tags.

CREATE OR REPLACE VIEW p AS SELECT * EXCLUDE (filename, file_row_number), regexp_extract(replace(filename, '\', '/'), '[^/]+/[^/]+/[^/]+$') AS row_file, file_row_number AS row_index FROM read_parquet('hf://datasets/Battam/agentic-env-index/data/*/*/*.parquet', union_by_name = true, filename = true, file_row_number = true);
CREATE OR REPLACE VIEW b AS SELECT * FROM read_parquet('hf://datasets/Battam/agentic-env-index/meta/batches.parquet');
CREATE OR REPLACE VIEW d AS SELECT * FROM read_parquet('hf://datasets/Battam/agentic-env-index/meta/duplicates.parquet');
CREATE OR REPLACE VIEW o AS SELECT * FROM read_parquet('hf://datasets/Battam/agentic-env-index/meta/bench_overlap.parquet');
CREATE OR REPLACE VIEW t AS SELECT * FROM read_parquet('hf://datasets/Battam/agentic-env-index/meta/tags.parquet');
CREATE OR REPLACE VIEW c AS SELECT * FROM read_parquet('hf://datasets/Battam/agentic-env-index/meta/bench_checked.parquet');
CREATE OR REPLACE VIEW selected AS
SELECT p.*, (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.pointer_id') WHEN coalesce(json_contains(json_extract(p.extra, '$._absent'), '"pointer_id"'), false) THEN NULL WHEN json_type(p.extra, '$.pointer_id') IS NOT NULL THEN json_extract_string(p.extra, '$.pointer_id') WHEN json_type(p.extra, '$.pid') IS NOT NULL THEN p.source || ':' || p.collection || ':' || json_extract_string(p.extra, '$.pid') WHEN p.parent_pointer_id IS NOT NULL AND p.member_path IS NOT NULL THEN CASE WHEN length(p.parent_pointer_id) - length(replace(p.parent_pointer_id, ':', '')) >= 2 THEN p.source || ':' || p.collection || ':' || substr(p.parent_pointer_id, strpos(p.parent_pointer_id, ':') + strpos(substr(p.parent_pointer_id, strpos(p.parent_pointer_id, ':') + 1), ':') + 1) || '!/' || p.member_path END WHEN b.pid_segments IS NOT NULL THEN p.source || ':' || p.collection || ':' || array_to_string(list_slice(string_split((CASE WHEN b.uri_swap_to IS NOT NULL AND json_extract_string(p.extra, '$._uri_orig') IS NULL THEN CASE WHEN starts_with(p.uri, b.uri_swap_to) AND ends_with(p.uri, b.uri_swap_suffix) AND length(p.uri) >= length(b.uri_swap_to) + length(b.uri_swap_suffix) THEN b.uri_swap_from || substr(p.uri, length(b.uri_swap_to) + 1, length(p.uri) - length(b.uri_swap_to) - length(b.uri_swap_suffix)) END ELSE p.uri END), '/'), -b.pid_segments, -1), '/') || CASE WHEN b.pid_at_offset THEN '@' || CAST(p.range_offset AS VARCHAR) ELSE '' END END) AS pointer_id, p.size_bytes IS NULL AS size_unknown,
  (CASE WHEN coalesce(nullif(CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.license_override.training_ok') WHEN json_type(p.extra, '$.license_override') IS NOT NULL THEN json_extract_string(p.extra, '$.license_override.training_ok') WHEN (p.license_spdx IS NOT NULL OR p.license_training_ok IS NOT NULL OR p.license_redistribution_ok IS NOT NULL OR p.license_notes IS NOT NULL) THEN p.license_training_ok WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"license_override"'), false) THEN b.const_training_ok END, ''), b.training_ok) IN ('yes', 'conditional', 'no') THEN coalesce(nullif(CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.license_override.training_ok') WHEN json_type(p.extra, '$.license_override') IS NOT NULL THEN json_extract_string(p.extra, '$.license_override.training_ok') WHEN (p.license_spdx IS NOT NULL OR p.license_training_ok IS NOT NULL OR p.license_redistribution_ok IS NOT NULL OR p.license_notes IS NOT NULL) THEN p.license_training_ok WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"license_override"'), false) THEN b.const_training_ok END, ''), b.training_ok) ELSE 'unknown' END) AS training_tier,
  (CASE WHEN coalesce(nullif(CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.license_override.redistribution_ok') WHEN json_type(p.extra, '$.license_override') IS NOT NULL THEN json_extract_string(p.extra, '$.license_override.redistribution_ok') WHEN (p.license_spdx IS NOT NULL OR p.license_training_ok IS NOT NULL OR p.license_redistribution_ok IS NOT NULL OR p.license_notes IS NOT NULL) THEN p.license_redistribution_ok WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"license_override"'), false) THEN b.const_redistribution_ok END, ''), b.redistribution_ok) IN ('yes', 'conditional', 'no') THEN coalesce(nullif(CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.license_override.redistribution_ok') WHEN json_type(p.extra, '$.license_override') IS NOT NULL THEN json_extract_string(p.extra, '$.license_override.redistribution_ok') WHEN (p.license_spdx IS NOT NULL OR p.license_training_ok IS NOT NULL OR p.license_redistribution_ok IS NOT NULL OR p.license_notes IS NOT NULL) THEN p.license_redistribution_ok WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"license_override"'), false) THEN b.const_redistribution_ok END, ''), b.redistribution_ok) ELSE 'unknown' END) AS redistribution_tier,
  coalesce((SELECT max(t.max_size_bytes) FROM t WHERE t.source = p.source AND t.batch = p.batch AND t.collection IS NOT DISTINCT FROM p.collection AND t.ext IS NOT DISTINCT FROM p.ext AND t.meta_value IS NOT DISTINCT FROM (CASE WHEN b.meta_key IS NOT NULL THEN (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.source_meta.' || b.meta_key) WHEN json_type(p.extra, '$.source_meta') IS NOT NULL THEN json_extract_string(p.extra, '$.source_meta.' || b.meta_key) WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"source_meta"'), false) THEN json_extract_string(b.const_source_meta, '$.' || b.meta_key) END) END) AND t.content IS NOT DISTINCT FROM CAST((CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract(p.extra, '$._row.content') WHEN json_type(p.extra, '$.content') IS NOT NULL THEN json_extract(p.extra, '$.content') WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"content"'), false) THEN b.const_content END) AS VARCHAR)), b.max_size_bytes) AS class_cap_bytes,
  EXISTS (SELECT 1 FROM d WHERE d.reason = 'natural_key' AND d.keep_source = p.source AND d.keep_batch = p.batch AND d.keep_row_file = p.row_file AND d.keep_row_index = p.row_index) AS natural_key_conflict,
  coalesce((SELECT bool_and(c.checked) FROM c WHERE c.scope = 'file' AND c.row_file = p.row_file), (SELECT bool_and(c.checked) FROM c WHERE c.scope = 'unlisted'), false) AND NOT EXISTS (SELECT 1 FROM c WHERE c.scope = 'container' AND NOT c.checked AND c.source = p.source AND c.collection = split_part(p.collection, '@', 1)) AS checked_for_benchmarks
FROM p JOIN b ON b.source = p.source AND b.batch = p.batch
WHERE NOT EXISTS (SELECT 1 FROM d WHERE d.source = p.source AND d.uri = p.uri AND d.range_offset IS NOT DISTINCT FROM p.range_offset AND d.member_path IS NOT DISTINCT FROM p.member_path AND d.batch = p.batch AND d.row_file = p.row_file AND d.row_index = p.row_index)
  AND NOT EXISTS (SELECT 1 FROM o WHERE o.scope = 'row' AND o.hit_class IN ('benchmark_copy', 'task_file', 'data_address') AND o.source = p.source AND o.uri = p.uri AND o.range_offset IS NOT DISTINCT FROM p.range_offset AND o.member_path IS NOT DISTINCT FROM p.member_path)
  AND NOT EXISTS (SELECT 1 FROM o WHERE o.scope = 'container' AND o.hit_class IN ('benchmark_copy', 'task_file', 'data_address') AND o.source = p.source AND o.collection = split_part(p.collection, '@', 1))
  AND coalesce((SELECT bool_and(c.default_keep) FROM c WHERE c.scope = 'file' AND c.row_file = p.row_file), (SELECT bool_and(c.default_keep) FROM c WHERE c.scope = 'unlisted'), false) AND NOT EXISTS (SELECT 1 FROM c WHERE c.scope = 'container' AND NOT c.default_keep AND c.source = p.source AND c.collection = split_part(p.collection, '@', 1));

The query reads the row tables remotely and only the columns it needs; a full pass over every source moves a few gigabytes. Add p.source IN (...) or read data/<source>/*/*.parquet to stay small. The view adds training_tier and redistribution_tier (yes, conditional, no or unknown) and class_cap_bytes (the reference size cap of the row's content class) and natural_key_conflict (true when other rows with the same natural key were removed as duplicates and this one, from the latest batch, was kept) and checked_for_benchmarks (true when the row was compared with the benchmark list and its collection is not awaiting a ruling).

Ready-made queries

Each query runs on the selected view above.

  1. Only rows that may be used for training (training tier yes or conditional):
SELECT p.source, p.uri, p.size_bytes, p.training_tier FROM selected p
WHERE p.training_tier IN ('yes', 'conditional') LIMIT 20;

python tools/fetch.py --tier yes,conditional --limit 20 --dry-run

  1. Only the latest version of each package. Latest means the version released last (by release time, so a fix released later for an older line counts as the latest); all files of that version are kept, and rows without a version or a release time are left out. Package ecosystems and the release time used:
Source Release time
pypi source_meta.upload_time
npm source_meta.published
crates-io source_meta.created_at
cran none (the snapshot lists only the current version of each package)
conda-forge-packages source_meta.timestamp
ansible-galaxy-collections source_meta.published
artifact-hub-helm-charts source_meta.created
go-module-proxy-zips source_meta.index_timestamp
hackage-packages source_meta.uploaded

Not ordered by this query:

  • debian-sources: rows carry no release time, and Debian versions need the dpkg ordering rules, which plain SQL does not have; each suite lists one version per source package, so choose a suite with source_meta.suite instead.
  • nuget, rubygems: no release-time field is defined for these rows yet; every version is kept.
CREATE OR REPLACE VIEW latest_version AS
WITH v AS (
  SELECT p.*, concat_ws('/', p.collection, (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.source_meta.' || 'chart') WHEN json_type(p.extra, '$.source_meta') IS NOT NULL THEN json_extract_string(p.extra, '$.source_meta.' || 'chart') WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"source_meta"'), false) THEN json_extract_string(b.const_source_meta, '$.' || 'chart') END)) AS package, (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.source_meta.' || 'version') WHEN json_type(p.extra, '$.source_meta') IS NOT NULL THEN json_extract_string(p.extra, '$.source_meta.' || 'version') WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"source_meta"'), false) THEN json_extract_string(b.const_source_meta, '$.' || 'version') END) AS version,
    try_cast(CASE p.source WHEN 'pypi' THEN (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.source_meta.' || 'upload_time') WHEN json_type(p.extra, '$.source_meta') IS NOT NULL THEN json_extract_string(p.extra, '$.source_meta.' || 'upload_time') WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"source_meta"'), false) THEN json_extract_string(b.const_source_meta, '$.' || 'upload_time') END) WHEN 'npm' THEN (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.source_meta.' || 'published') WHEN json_type(p.extra, '$.source_meta') IS NOT NULL THEN json_extract_string(p.extra, '$.source_meta.' || 'published') WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"source_meta"'), false) THEN json_extract_string(b.const_source_meta, '$.' || 'published') END) WHEN 'crates-io' THEN (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.source_meta.' || 'created_at') WHEN json_type(p.extra, '$.source_meta') IS NOT NULL THEN json_extract_string(p.extra, '$.source_meta.' || 'created_at') WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"source_meta"'), false) THEN json_extract_string(b.const_source_meta, '$.' || 'created_at') END) WHEN 'cran' THEN '1970-01-01T00:00:00Z' WHEN 'conda-forge-packages' THEN (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.source_meta.' || 'timestamp') WHEN json_type(p.extra, '$.source_meta') IS NOT NULL THEN json_extract_string(p.extra, '$.source_meta.' || 'timestamp') WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"source_meta"'), false) THEN json_extract_string(b.const_source_meta, '$.' || 'timestamp') END) WHEN 'ansible-galaxy-collections' THEN (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.source_meta.' || 'published') WHEN json_type(p.extra, '$.source_meta') IS NOT NULL THEN json_extract_string(p.extra, '$.source_meta.' || 'published') WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"source_meta"'), false) THEN json_extract_string(b.const_source_meta, '$.' || 'published') END) WHEN 'artifact-hub-helm-charts' THEN (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.source_meta.' || 'created') WHEN json_type(p.extra, '$.source_meta') IS NOT NULL THEN json_extract_string(p.extra, '$.source_meta.' || 'created') WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"source_meta"'), false) THEN json_extract_string(b.const_source_meta, '$.' || 'created') END) WHEN 'go-module-proxy-zips' THEN (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.source_meta.' || 'index_timestamp') WHEN json_type(p.extra, '$.source_meta') IS NOT NULL THEN json_extract_string(p.extra, '$.source_meta.' || 'index_timestamp') WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"source_meta"'), false) THEN json_extract_string(b.const_source_meta, '$.' || 'index_timestamp') END) WHEN 'hackage-packages' THEN (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.source_meta.' || 'uploaded') WHEN json_type(p.extra, '$.source_meta') IS NOT NULL THEN json_extract_string(p.extra, '$.source_meta.' || 'uploaded') WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"source_meta"'), false) THEN json_extract_string(b.const_source_meta, '$.' || 'uploaded') END) END AS TIMESTAMPTZ) AS released
  FROM selected p JOIN b ON b.source = p.source AND b.batch = p.batch
  WHERE p.source IN ('pypi', 'npm', 'crates-io', 'cran', 'conda-forge-packages', 'ansible-galaxy-collections', 'artifact-hub-helm-charts', 'go-module-proxy-zips', 'hackage-packages')
), best AS (
  SELECT source, package, arg_max(version, released) AS version FROM (
    SELECT source, package, version, max(released) AS released FROM v
    WHERE version IS NOT NULL AND released IS NOT NULL GROUP BY ALL)
  GROUP BY ALL
)
SELECT v.* FROM v JOIN best ON best.source = v.source AND best.package = v.package AND best.version = v.version;
SELECT source, package, version, count(*) AS files FROM latest_version GROUP BY ALL ORDER BY 1, 2 LIMIT 20;
  1. Only rows within the reference size cap of their content class (rows of unknown size stay in; tools/fetch.py --cap per-class stops their download at the same cap):
SELECT p.source, p.uri, p.size_bytes, p.class_cap_bytes FROM selected p
WHERE p.size_bytes IS NULL OR p.size_bytes <= p.class_cap_bytes LIMIT 20;

python tools/fetch.py --cap per-class --limit 20 --out ./files (rows above the class cap are recorded as too_large and not downloaded)

Examples

  1. Rows tagged data-processing, CSV files only:
SELECT p.source, p.uri, p.size_bytes FROM selected p JOIN b ON b.source = p.source AND b.batch = p.batch WHERE lower(p.ext) = 'csv' AND EXISTS (SELECT 1 FROM t WHERE t.source = p.source AND t.batch = p.batch AND t.collection IS NOT DISTINCT FROM p.collection AND t.ext IS NOT DISTINCT FROM p.ext AND t.meta_value IS NOT DISTINCT FROM (CASE WHEN b.meta_key IS NOT NULL THEN (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.source_meta.' || b.meta_key) WHEN json_type(p.extra, '$.source_meta') IS NOT NULL THEN json_extract_string(p.extra, '$.source_meta.' || b.meta_key) WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"source_meta"'), false) THEN json_extract_string(b.const_source_meta, '$.' || b.meta_key) END) END) AND t.content IS NOT DISTINCT FROM CAST((CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract(p.extra, '$._row.content') WHEN json_type(p.extra, '$.content') IS NOT NULL THEN json_extract(p.extra, '$.content') WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"content"'), false) THEN b.const_content END) AS VARCHAR) AND t.tag IN ('data-processing')) LIMIT 20;

python tools/fetch.py --tag data-processing --ext csv --limit 20 --out ./files

  1. Rows tagged office-spreadsheets, smallest first:
SELECT p.source, p.uri, p.size_bytes FROM selected p JOIN b ON b.source = p.source AND b.batch = p.batch WHERE EXISTS (SELECT 1 FROM t WHERE t.source = p.source AND t.batch = p.batch AND t.collection IS NOT DISTINCT FROM p.collection AND t.ext IS NOT DISTINCT FROM p.ext AND t.meta_value IS NOT DISTINCT FROM (CASE WHEN b.meta_key IS NOT NULL THEN (CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract_string(p.extra, '$._row.source_meta.' || b.meta_key) WHEN json_type(p.extra, '$.source_meta') IS NOT NULL THEN json_extract_string(p.extra, '$.source_meta.' || b.meta_key) WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"source_meta"'), false) THEN json_extract_string(b.const_source_meta, '$.' || b.meta_key) END) END) AND t.content IS NOT DISTINCT FROM CAST((CASE WHEN starts_with(coalesce(p.extra, ''), '{"_row":') THEN json_extract(p.extra, '$._row.content') WHEN json_type(p.extra, '$.content') IS NOT NULL THEN json_extract(p.extra, '$.content') WHEN NOT coalesce(json_contains(json_extract(p.extra, '$._absent'), '"content"'), false) THEN b.const_content END) AS VARCHAR) AND t.tag IN ('office-spreadsheets')) ORDER BY p.size_bytes LIMIT 20;

python tools/fetch.py --tag office-spreadsheets --limit 20 --dry-run

  1. Rows tagged sysadmin-devops, from the starter sample:
SELECT source, ext, count(*) FROM read_parquet('hf://datasets/Battam/agentic-env-index/starter/sysadmin-devops.parquet') GROUP BY ALL ORDER BY 3 DESC;

python tools/fetch.py --starter sysadmin-devops --out ./starter

python tools/fetch.py --print-sql ... prints the exact query the script runs, so any selection can be repeated in DuckDB. The script checks size and every hash of each download and writes fetch_manifest.jsonl with one line per selected row. With --check-content it also flags downloads that are hard to use (scanned PDFs, error pages saved as files, extensions that do not match the content) in the manifest field content_check; this needs the file command and poppler-utils, and a check whose tool is missing is skipped and named there.