Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ python -m venv .venv && .venv/Scripts/python -m pip install -e ".[dev]"
- Precision (2026-11-21, after #45): 69/124 useful (55.6%); Django 1.43 / 10 commits (over the ≤ 1
target), others ≤ 0.62.
`forgot-related-file` has 0 useful warnings in 45 labelled; candidate to become opt-in.
- `--github` measured (2026-11-01): precision unchanged, +7 useful warnings, almost no demotions.
- `--github` re-measured (2026-11-27, after #45): precision 55.6% → 54.5% (+9 useful, +10 noise), recall
11 → 12 of 71 on target. Opt-in, not default. `regressions.py run --github` exists. Lead from it:
`[Bugfix] …` subjects are misread as a project tag (React `9d67847`), an offline classifier gap.
- Tried and dropped (2026-11-01): "fix word + PR number" as an offline fix rule: +85 warnings at 22%
useful. Don't retry it without a narrower signal (see bench/RESULTS.md).
- Known recall limit: tracing only passes commits classified as refactors, so a big non-refactor rewrite
Expand Down
18 changes: 18 additions & 0 deletions bench/RESULTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,24 @@ python bench/regressions.py run --repo <clone> --file bench/regressions/<owner>-
python bench/regressions.py report bench/regressions/*.json
```

### `--github` on both measures (2026-11-27)

Re-run on today's code (after #45) for the four GitHub-tracked repos, with issue and PR labels
(`blot bench --replay 500 --github`, `regressions.py run --github`). Django is unchanged, since its
GitHub Issues are off.

| | Without `--github` | With `--github` |
|---|---|---|
| Precision, all five | 69/124 (55.6%) | 78/143 (54.5%): +9 useful, +10 noise |
| Real regressions warned on target | 11/71 | 12/71 |

Labels mostly *upgrade* commits (194 upgraded, 4 demoted), so they widen coverage at about the same
precision. The one regression gained is React `553440bd1`: the warning lands on the hunk the later
fix touched, citing `9d67847` "[Bugfix] Dropped updates inside a suspended tree". That fix is
plain from its subject, but without labels Blot misses it because it reads `[Bugfix]` as a project
tag like `[DevTools]`, an offline classification gap worth measuring on its own. `--github` stays an
opt-in, not a default. The 6 new replay warnings are labelled (reasons prefixed "--github replay").

## Reproduce

```bash
Expand Down
30 changes: 30 additions & 0 deletions bench/labels/expressjs-express.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,36 @@
"cited": "d2de128",
"verdict": "noise",
"reason": "dev dependency bump; cited commit was a deps bump"
},
{
"sha": "3bb6d96ba",
"subject": "examples: demonstrate sub directory download",
"check": "removed-fix",
"path": "examples/downloads/index.js",
"line": 13,
"cited": "e606d99",
"verdict": "noise",
"reason": "--github replay: an example page's link list changed; cited fix (Unicode filenames) untouched"
},
{
"sha": "da4d763ff",
"subject": "Improved fix for open redirect allow list bypass",
"check": "removed-fix",
"path": "lib/response.js",
"line": 908,
"cited": "a003cfa",
"verdict": "useful",
"reason": "--github replay: the improved open-redirect fix changes String(url) from fix #5554"
},
{
"sha": "0b746953c",
"subject": "Improved fix for open redirect allow list bypass",
"check": "removed-fix",
"path": "lib/response.js",
"line": 908,
"cited": "a003cfa",
"verdict": "useful",
"reason": "--github replay: the improved open-redirect fix changes String(url) from fix #5554 (same change, other branch)"
}
]
}
30 changes: 30 additions & 0 deletions bench/labels/facebook-react.json
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,36 @@
"cited": "96aca5f",
"verdict": "useful",
"reason": "changes the ping callbacks in the stack-overflow fix #30419"
},
{
"sha": "01c4d03d8",
"subject": "[DevTools] Clear element inspection if host element not owned by any renderer is selected (#35504)",
"check": "removed-fix",
"path": "packages/react-devtools-shared/src/backend/agent.js",
"line": 941,
"cited": "f963c80",
"verdict": "noise",
"reason": "--github replay: cited commit is a feature (\"Implement best renderer\") a label promoted"
},
{
"sha": "c0060cf2a",
"subject": "[DevTools] Enable support for the React DevTools Client to connect to different host/port/path (#35886)",
"check": "removed-fix",
"path": "packages/react-devtools/app.html",
"line": 161,
"cited": "aef9303",
"verdict": "noise",
"reason": "--github replay: destructuring extended with new fields; cited commit is an upgrade"
},
{
"sha": "aac12ce59",
"subject": "[DevTools] chore: extract pure functions from fiber/renderer.js (#35924)",
"check": "removed-fix",
"path": "packages/react-devtools-shared/src/backend/fiber/renderer.js",
"line": 4535,
"cited": "24f215c",
"verdict": "noise",
"reason": "--github replay: a refactor passes a new leading argument to the fix's call"
}
]
}
15 changes: 13 additions & 2 deletions bench/regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ def fix_proximity(finding: dict, culprit_hunks: dict, touched: set[tuple[str, in
return "fix-touched-file" if in_file else "other"


def run(data: dict, config: Config, progress=None) -> dict:
def run(data: dict, config: Config, progress=None, github: bool = False) -> dict:
"""With `github`, commit facts also use issue/PR labels, as after `blot index --github`
(labels are read as they are today, as in `blot bench --replay --github`)."""
repo = data["repo"]
head = run_git(repo, "rev-parse", "HEAD").strip()
if head != data["head"]:
Expand All @@ -297,6 +299,12 @@ def run(data: dict, config: Config, progress=None) -> dict:
try:
build_index(repo, full=True, config=config, db_path=os.path.join(tmp, "full.db"))
full = Store.open(repo, os.path.join(tmp, "full.db"))
if github:
from blot.github import enrich

got = enrich(repo, full)
data["github"] = got.status if got.status != "ok" else (
f"{got.fetched} issues/PRs fetched, {got.upgraded} commits upgraded, {got.demoted} demoted")
history = [(info.sha, paths) for info, _, paths in _read_history(repo, head)]
checks = all_checks(config)
for i, pair in enumerate(data["pairs"], 1):
Expand Down Expand Up @@ -379,6 +387,7 @@ def main(argv: list[str] | None = None) -> int:
p = sub.add_parser("run")
p.add_argument("--repo", required=True)
p.add_argument("--file", required=True)
p.add_argument("--github", action="store_true", help="also use issue/PR labels (needs the gh CLI)")
p = sub.add_parser("report")
p.add_argument("files", nargs="+")
args = parser.parse_args(argv)
Expand All @@ -395,7 +404,9 @@ def main(argv: list[str] | None = None) -> int:
data = json.load(f)
data["repo"] = args.repo
data = run(data, load_config(args.repo),
progress=lambda i, n: print(f"replayed {i}/{n}", file=sys.stderr))
progress=lambda i, n: print(f"replayed {i}/{n}", file=sys.stderr), github=args.github)
if data.get("github"):
print(f"github: {data['github']}")
_save(args.file, data)
print(f"{sum(bool(p['findings']) for p in data['pairs'])}/{len(data['pairs'])} culprits warned")
else:
Expand Down
Loading