Datasets:
Download README.md from typestrict/TS-PRGuard: direct link, hf CLI and curl.
- Browser
- Download file 52.6 kB
-
https://huggingface.co/datasets/typestrict/TS-PRGuard/resolve/main/README.md
- Command line
-
hf download hf://datasets/typestrict/TS-PRGuard/README.md
-
curl -L -o README.md https://huggingface.co/datasets/typestrict/TS-PRGuard/resolve/main/README.md
license: cc-by-4.0
language:
- en
pretty_name: TS-PRGuard
size_categories:
- 10K<n<100K
task_categories:
- text-classification
tags:
- typestrict
- code
- code-review
- pull-requests
- security
- cwe
- breaking-changes
- git
configs:
- config_name: description_match
data_files:
- split: train
path: description_match/train.jsonl.gz
- split: test
path: description_match/test.jsonl.gz
- config_name: complexity
data_files:
- split: train
path: complexity/train.jsonl.gz
- split: test
path: complexity/test.jsonl.gz
- config_name: change_type
data_files:
- split: train
path: change_type/train.jsonl.gz
- split: test
path: change_type/test.jsonl.gz
- config_name: breaking
data_files:
- split: train
path: breaking/train.jsonl.gz
- split: test
path: breaking/test.jsonl.gz
- config_name: breaking_api
data_files:
- split: train
path: breaking_api/train.jsonl.gz
- split: test
path: breaking_api/test.jsonl.gz
- config_name: tests
data_files:
- split: train
path: tests/train.jsonl.gz
- split: test
path: tests/test.jsonl.gz
- config_name: security_fix
data_files:
- split: train
path: security_fix/train.jsonl.gz
- split: test
path: security_fix/test.jsonl.gz
- config_name: security_fix_mobile
data_files:
- split: test
path: security_fix_mobile/test.jsonl.gz
- config_name: security_synthetic
data_files:
- split: train
path: security_synthetic/train.jsonl.gz
- split: test
path: security_synthetic/test.jsonl.gz
Train your own on typestrict.ai |
Docs |
CLI |
All TS models
License: CC BY 4.0 for the labels, each row's code under its repository's license |
Authors: typestrict.ai
TS-PRGuard
37,048 labeled code changes for pull request review, in 11 programming languages and 9 configs. Each row is a real diff from a permissively licensed repository with one answer: does the message describe the change, how big is it, what kind of change is it, does it break compatibility, do the tests cover it, does it fix a vulnerability (and which CWE).
We built it to train the PR Guard decision models on typestrict.ai, and we publish it because the open data for these questions was either non-commercial, noisy, or missing the languages of mobile apps.
- Commercial use: every source and every repository allows it. Non-commercial and research-only sources were left out, without exception.
- Measured labels: an independent review of 300 fresh rows found 297 correct (upper 95% bound on the error of about 2.4%). Every config has its own check, listed below.
- No easy shortcuts: the hints that give the answer away were removed from the text (details in Leakage).
- Mobile included: Kotlin, Swift and Dart in every question, with a public API rule for breaking changes and a checked synthetic set for vulnerabilities.
🧭 Configs
| Config | Question | Labels | Train | Test |
|---|---|---|---|---|
description_match | Does the commit message describe this diff? | matches, does_not_match | 5,723 | 682 |
complexity | How large and spread out is the change? | bands 0 to 4 | 6,056 | 673 |
change_type | What kind of change is it? | feat, fix, refactor, perf, test, build, chore, style, docs, ci | 2,961 | 330 |
breaking | Does the pull request break compatibility? | breaking, not_breaking | 5,337 | 594 |
breaking_api | Does the commit break the public API of a Kotlin, Swift or Dart library? | breaking, not_breaking | 2,950 | 335 |
tests | Do the tests in the change cover it? | covered, not_covered, not_applicable | 5,927 | 709 |
security_fix | Which vulnerability does this commit fix? | first CWE id, or unspecified | 3,267 | 363 |
security_fix_mobile | Same, real fixes in Kotlin, Swift and Dart (test only) | CWE id | 0 | 67 |
security_synthetic | Does this change introduce a vulnerability? | introduces, safe (537 pairs) | 960 | 114 |
| Config | Question | Labels | Train | Test |
|---|---|---|---|---|
description_match | Does the commit message describe this diff? | matches, does_not_match | 5,723 | 682 |
complexity | How large and spread out is the change? | bands 0 to 4 | 6,056 | 673 |
change_type | What kind of change is it? | feat, fix, refactor, perf, test, build, chore, style, docs, ci | 2,961 | 330 |
breaking | Does the pull request break compatibility? | breaking, not_breaking | 5,337 | 594 |
breaking_api | Does the commit break the public API of a Kotlin, Swift or Dart library? | breaking, not_breaking | 2,950 | 335 |
tests | Do the tests in the change cover it? | covered, not_covered, not_applicable | 5,927 | 709 |
security_fix | Which vulnerability does this commit fix? | first CWE id, or unspecified | 3,267 | 363 |
security_fix_mobile | Same, real fixes in Kotlin, Swift and Dart (test only) | CWE id | 0 | 67 |
security_synthetic | Does this change introduce a vulnerability? | introduces, safe (537 pairs) | 960 | 114 |
In the security configs label is the first CWE and cwe holds all of them; 175 rows of security_fix are confirmed fixes whose advisory names no specific CWE (unspecified). In security_synthetic, cwe is the flaw of the pair, in both halves.
from datasets import load_dataset
ds = load_dataset("typestrict/TS-PRGuard", "tests")
row = ds["train"][0]
print(row["label"], row["language"], row["repo"])
print(row["diff"][:500])
Splits
The test split holds about 10% of the rows of each config, chosen by whole repository: no repository has rows in both splits of a config, so a model cannot pass the test by remembering a codebase. The two halves of a synthetic pair are always on the same side. security_fix_mobile is test only, and so are the 73 Kotlin, Swift and Dart rows of security_fix: real vulnerability fixes in these languages are rare, so they measure the models trained on security_synthetic instead of feeding them.
🗂️ Fields
| Field | Type | Meaning |
|---|---|---|
id | string | Stable row id |
config | string | One of the configs above |
label | string | The answer (see the table above) |
language | string | Main language of the change |
repo | string | owner/name on GitHub |
license | string | SPDX id of the repository's license |
source | string | Where the row comes from (see Sources) |
ref | string | Commit SHA, pull request number, or SWE-rebench instance id |
message | string | Commit message or pull request text, with the leaks removed |
files | list of strings | Changed files |
n_files | int | Number of changed files |
diff | string | Unified diff, code files first, cut at 5,000 characters |
cwe | list of strings | CWE ids (security configs only) |
cve | string | CVE id when there is one (security_fix) |
advisory | string | Advisory title, kept out of message (security_fix) |
pair_id, version | string | The two halves of a synthetic pair: vulnerable and safe (security_synthetic) |
| Field | Type | Meaning |
|---|---|---|
id | string | Stable row id |
config | string | One of the configs above |
label | string | The answer (see the table above) |
language | string | Main language of the change |
repo | string | owner/name on GitHub |
license | string | SPDX id of the repository's license |
source | string | Where the row comes from (see Sources) |
ref | string | Commit SHA, pull request number, or SWE-rebench instance id |
message | string | Commit message or pull request text, with the leaks removed |
files | list of strings | Changed files |
n_files | int | Number of changed files |
diff | string | Unified diff, code files first, cut at 5,000 characters |
cwe | list of strings | CWE ids (security configs only) |
cve | string | CVE id when there is one (security_fix) |
advisory | string | Advisory title, kept out of message (security_fix) |
pair_id, version | string | The two halves of a synthetic pair: vulnerable and safe (security_synthetic) |
🏗️ How it was built
- Mining. Commits from the git histories of permissively licensed repositories (including 27 security focused Kotlin, Swift and Dart projects), CommitPack, pull requests labeled as breaking, the GitHub Advisory Database, MoreFixes, and SWE-rebench-V2.
- Rules. Each question has deterministic rules: only repositories with a known permissive license, no generated or vendored files, the complexity band computed on the full diff before the cut, a public API comparison over the whole diff for
breaking_api(default parameters and moved code do not count; apps, examples, generated code and internal packages are excluded). - Independent checks. Every row was checked by a decision model.
change_type,security_fix,security_fix_mobile, thebreakingside ofbreaking_apiandsecurity_syntheticalso went through a second, independent LLM classifier. A row stays only when every check agrees with the label. - Review. Fresh samples of every config were reviewed independently after the filters, and the rules were changed until the error was low (the results are below).
tests
covered and not_covered come from execution: SWE-rebench-V2 runs the tests of each change, and a change is covered when its FAIL_TO_PASS tests are part of it. not_applicable rows are changes that do not ask for a test (docs, configuration, formatting), selected by rules and checked.
security_synthetic
Real vulnerability fixes in Kotlin, Swift and Dart are too few to train on. Each pair takes a real commit with no security relevance and adds, in the same code, one flaw from a catalog of CWEs (vulnerable) and the safe version of the same lines (safe). The rows were written by an LLM and kept only when:
- a blind check, which did not know which half it was reading, found the flaw with the right CWE in the vulnerable half and nothing in the safe half;
- a decision model confirmed that something is really at stake (a test file or unused data does not count).
CWE-208 (timing) and CWE-601 (open redirect) were removed after the final review: on the client side the generator got them wrong most of the time. The 10 CWEs left are 532, 798, 295, 22, 330, 319, 89, 922, 327 and 749. The real fixes of security_fix_mobile are the test that tells whether a model learned the flaw or the style of the generator.
📏 Label quality
Every check below was made on rows the filters had already accepted, by a reviewer that did not take part in the labeling.
| Config | Check | Result |
|---|---|---|
| The six main questions | 300 fresh rows, 50 per question | 297 correct, 2 wrong, 1 unsure |
breaking_api | 50 fresh rows | 49 correct |
security_fix_mobile | 50 rows | 48 correct |
security_synthetic | 52 pairs | 50 correct, 1 wrong, 1 unsure |
| Config | Check | Result |
|---|---|---|
| The six main questions | 300 fresh rows, 50 per question | 297 correct, 2 wrong, 1 unsure |
breaking_api | 50 fresh rows | 49 correct |
security_fix_mobile | 50 rows | 48 correct |
security_synthetic | 52 pairs | 50 correct, 1 wrong, 1 unsure |
The known wrong rows: a feature commit linked to a CVE, a test in a testdata/ folder outside the usual pattern, and a breaking change in an internal package of the Dart SDK.
🧹 Leakage we removed
change_type: the conventional commit prefix (feat:,fix(api):) is removed from the message.breaking: every form of "break" ("breaking change", "[breaking]", "BC break", "non-breaking") and "major version" is masked as[...]in the pull request text, on both labels, so the mask itself gives nothing away.security_fix: the advisory text and the CVE are in their own fields, never inmessage.description_match: the negative message is a specific message from another commit of the same repository with no file in common, so the repository's vocabulary does not give the answer.security_synthetic: both halves come from the same commit and differ only in the changed lines; the blind check found no style that gives the half away.diff: code files come first and the cut is at 5,000 characters; the complexity band is computed before the cut.
📚 Sources
| Source | License | Configs |
|---|---|---|
| Git histories of permissive repositories | Each repository's license | description_match, complexity, breaking_api, tests, security_fix_mobile, security_synthetic |
| bigcode/commitpack | MIT (code under each repository's license) | description_match, complexity, change_type, breaking_api |
| Pull requests labeled as breaking on GitHub | Each repository's license | breaking |
Flutter pull requests labeled c: API break | BSD-3-Clause | breaking_api |
| nebius/SWE-rebench-V2 | CC BY 4.0 | tests |
| GitHub Advisory Database | CC BY 4.0 | security_fix |
| MoreFixes | CC BY 4.0 | security_fix |
| Source | License | Configs |
|---|---|---|
| Git histories of permissive repositories | Each repository's license | description_match, complexity, breaking_api, tests, security_fix_mobile, security_synthetic |
| bigcode/commitpack | MIT (code under each repository's license) | description_match, complexity, change_type, breaking_api |
| Pull requests labeled as breaking on GitHub | Each repository's license | breaking |
Flutter pull requests labeled c: API break | BSD-3-Clause | breaking_api |
| nebius/SWE-rebench-V2 | CC BY 4.0 | tests |
| GitHub Advisory Database | CC BY 4.0 | security_fix |
| MoreFixes | CC BY 4.0 | security_fix |
Repository licenses in the rows: MIT (17,854), Apache-2.0 (10,712), BSD-3-Clause (7,988), BSD-2-Clause (207), ISC (169), Unlicense (56), CC0-1.0 (31), MIT-0 (22), Zlib (4), UPL-1.0 (3), PostgreSQL (1), 0BSD (1). Every row keeps repo, ref and license, so you can trace any diff to its origin and keep its notice.
⚠️ Limitations
- Diffs are cut at 5,000 characters, so a very large change is seen only in part.
breakingfollows the maintainers' own label, which is not always applied the same way across projects.security_fixhas fixes only: read in reverse, the same diff introduces the flaw, which is how we use it for the "introduces" side.description_matchhas no PHP andchange_typehas no Java or PHP: the sources had too few clean rows.- The natural language text is in English.
🚀 Train your own on typestrict.ai
Every config here is one decision. On typestrict.ai you can train a small model on any of them, or on your own pull requests, and get it measured on examples held out from training. The trained model is a small ONNX package that runs on a CPU, in your CI or on your own servers.
curl -fsSL https://typestrict.ai/install.sh | sh && typestrict login
typestrict train --hf typestrict/TS-PRGuard:tests/train.jsonl.gz,tests/test.jsonl.gz \
--goal "Do the tests in the change cover it?" --watch
Links
- typestrict.ai: typestrict.ai, the docs at docs.typestrict.ai
- Open source: CLI and MCP server, skills for AI assistants
- Contact: typestrict.ai/contact
Citation
@misc{typestrict2026prguard,
author = {{typestrict.ai}},
title = {TS-PRGuard: labeled code changes for pull request review},
year = {2026},
url = {https://huggingface.co/datasets/typestrict/TS-PRGuard}
}

