blot-git 0.7.0__tar.gz → 0.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {blot_git-0.7.0 → blot_git-0.7.2}/.pre-commit-hooks.yaml +1 -1
- {blot_git-0.7.0 → blot_git-0.7.2}/CLAUDE.md +36 -12
- {blot_git-0.7.0 → blot_git-0.7.2}/PKG-INFO +1 -1
- {blot_git-0.7.0 → blot_git-0.7.2}/README.md +14 -2
- {blot_git-0.7.0 → blot_git-0.7.2}/action.yml +1 -1
- {blot_git-0.7.0 → blot_git-0.7.2}/bench/README.md +14 -0
- blot_git-0.7.2/bench/RESULTS.md +357 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/bench/labels/django-django.json +190 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/bench/labels/expressjs-express.json +30 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/bench/labels/facebook-react.json +60 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/bench/labels/pallets-flask.json +10 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/bench/labels/psf-requests.json +30 -0
- blot_git-0.7.2/bench/regressions/django-django.json +3808 -0
- blot_git-0.7.2/bench/regressions/expressjs-express.json +655 -0
- blot_git-0.7.2/bench/regressions/facebook-react.json +4783 -0
- blot_git-0.7.2/bench/regressions/pallets-flask.json +325 -0
- blot_git-0.7.2/bench/regressions/psf-requests.json +1045 -0
- blot_git-0.7.2/bench/regressions.py +429 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/pyproject.toml +1 -1
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/__init__.py +1 -1
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/checks/removed_fix.py +1 -1
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/classify.py +4 -1
- blot_git-0.7.2/src/blot/diff.py +473 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/test_checks.py +80 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/test_classify.py +6 -0
- blot_git-0.7.2/tests/test_diff.py +481 -0
- blot_git-0.7.2/tests/test_regressions.py +125 -0
- blot_git-0.7.2/tests/test_trace.py +61 -0
- blot_git-0.7.0/bench/RESULTS.md +0 -128
- blot_git-0.7.0/src/blot/diff.py +0 -186
- blot_git-0.7.0/tests/test_diff.py +0 -80
- {blot_git-0.7.0 → blot_git-0.7.2}/.gitattributes +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/.github/ISSUE_TEMPLATE/bench_case.md +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/.github/ISSUE_TEMPLATE/check_idea.md +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/.github/pull_request_template.md +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/.github/workflows/blot.yml +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/.github/workflows/ci.yml +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/.github/workflows/release.yml +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/.gitignore +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/CONTRIBUTING.md +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/LICENSE +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/demo/demo.gif +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/demo/make_demo.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/blue/alert.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/blue/faces.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/blue/happy.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/blue/idle.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/blue/sad.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/blue/sleepy.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/blue/walk.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/blue/worried.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/build_sprites.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/mustard/alert.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/mustard/faces.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/mustard/happy.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/mustard/idle.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/mustard/sad.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/mustard/sleepy.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/mustard/walk.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/mustard/worried.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/orange/alert.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/orange/faces.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/orange/happy.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/orange/idle.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/orange/sad.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/orange/sleepy.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/orange/walk.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/orange/worried.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/sage/alert.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/sage/faces.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/sage/happy.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/sage/idle.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/sage/sad.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/sage/sleepy.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/sage/walk.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/assets/sora/sage/worried.svg +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/bench/cases.json +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/docs/EXPLAINER.md +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/docs/PRD.md +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/docs/PYPI.md +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/docs/competitors.md +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/__main__.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/bench.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/checks/__init__.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/checks/base.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/checks/cochange.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/checks/readded_bug.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/cli.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/config.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/fixmap.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/git.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/github.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/guard.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/hooks.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/index.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/mcp.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/report.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/store.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/trace.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/src/blot/why.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/conftest.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/test_action.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/test_bench.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/test_cli.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/test_config.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/test_git.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/test_guard.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/test_hooks.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/test_index.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/test_map.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/test_mcp.py +0 -0
- {blot_git-0.7.0 → blot_git-0.7.2}/tests/test_why_github.py +0 -0
|
@@ -15,7 +15,9 @@ always changes with another (`forgot-related-file`). Mascot: Sora the slime. Own
|
|
|
15
15
|
- `fixmap.py` (`blot map`), `mcp.py` (stdio MCP server, both protocol eras; `install-mcp` in `hooks.py`)
|
|
16
16
|
- `guard.py` (Claude Code hook; installer in `hooks.py`), `why.py`, `github.py` (`index --github` via `gh api graphql`), `bench.py` (cases + `--replay N`)
|
|
17
17
|
- `bench/cases.json` scripted real-world cases (33/33); `bench/labels/` hand verdicts for every replay
|
|
18
|
-
warning on the 5 reference repos; `bench/RESULTS.md` replay numbers and
|
|
18
|
+
warning on the 5 reference repos; `bench/RESULTS.md` replay numbers, precision and recall
|
|
19
|
+
- `bench/regressions.py` (collect / run / report) + `bench/regressions/<repo>.json`: recall on real
|
|
20
|
+
regressions (culprit commits named by a later fix), with hand judgements per pair
|
|
19
21
|
- `action.yml` GitHub Action; `.github/workflows/blot.yml` runs it on Blot's own PRs
|
|
20
22
|
- `assets/sora/build_sprites.py` and `assets/demo/make_demo.py` regenerate the mascot and demo GIF
|
|
21
23
|
- `docs/PRD.md` roadmap; `docs/PYPI.md` is the PyPI page (no relative images there)
|
|
@@ -24,13 +26,15 @@ always changes with another (`forgot-related-file`). Mascot: Sora the slime. Own
|
|
|
24
26
|
```bash
|
|
25
27
|
python -m venv .venv && .venv/Scripts/python -m pip install -e ".[dev]"
|
|
26
28
|
.venv/Scripts/python -m pytest -q
|
|
27
|
-
.venv/Scripts/blot bench --workdir <short path> # must stay 33/33
|
|
29
|
+
.venv/Scripts/blot bench --workdir <short path> # must stay 33/33 (e.g. %LOCALAPPDATA%\Temp\wl\b33)
|
|
28
30
|
```
|
|
29
31
|
- Any change to `classify.py` or a check: on each of the 5 clones, checked out at the `head` in its
|
|
30
32
|
labels file, run `blot bench --replay 500 --labels bench/labels/<repo>.json --update-labels`. Keep a
|
|
31
33
|
rule only if precision rises and no `useful` warning disappears; label any new `null` verdicts
|
|
32
34
|
(rules in bench/README.md). Targets: ≤ 1 warning / 10 commits, precision ≥ 80%.
|
|
33
|
-
- Clones live in `%LOCALAPPDATA%\Temp\wl\
|
|
35
|
+
- Clones live in `%LOCALAPPDATA%\Temp\wl\rp\` (labelled heads; `...\wl\replay\` was wiped by a temp
|
|
36
|
+
cleanup on 2026-11-16) and `...\wl\b33\` (case runs; `wl\bench\` was emptied too, so b33 was cloned from
|
|
37
|
+
`rp\` with `origin` set to GitHub). Temp can be cleared: re-clone if `.git` is empty.
|
|
34
38
|
- `blot check` must stay under ~500 ms and never fail a commit because of Blot's own errors.
|
|
35
39
|
|
|
36
40
|
## Release (each release so far followed this)
|
|
@@ -52,24 +56,44 @@ python -m venv .venv && .venv/Scripts/python -m pip install -e ".[dev]"
|
|
|
52
56
|
- Writing code through bash heredocs mangles `\b`, `\n`, `\s`: use the Edit tool for regexes/strings.
|
|
53
57
|
- `gh api` paths: no leading slash (Git Bash rewrites it).
|
|
54
58
|
|
|
55
|
-
## State (2026-11-
|
|
56
|
-
- Released 0.7.
|
|
59
|
+
## State (2026-11-27)
|
|
60
|
+
- Released 0.7.2: checks, `why`, `map`, `--github`, agent guard (`blot guard` / `install-agent-hook`),
|
|
57
61
|
MCP server (`blot mcp` / `install-mcp`, tools `explain_lines` and `load_bearing_lines`), bench/replay
|
|
58
|
-
with labels, parallel indexing, pre-commit framework (`rev: v0.7.
|
|
62
|
+
with labels, parallel indexing, pre-commit framework (`rev: v0.7.2`), GitHub Action (`@v0.7.2`).
|
|
63
|
+
0.7.1 added the docstring rule (#40) and the structural `KeptLines` matcher (#45); 0.7.2 adds the
|
|
64
|
+
explicit bug-fix marker rule (#56).
|
|
59
65
|
- Live-tested in Claude Code: the guard (2026-11-06: the agent cited fix 8efea0c it was undoing) and MCP
|
|
60
66
|
(2026-11-14: an agent called `load_bearing_lines` on its own and answered correctly).
|
|
61
|
-
Throwaway test folder: `Documents
|
|
67
|
+
Throwaway test folder: `Documents\flask-guard-test` (guard hook + `.mcp.json`).
|
|
62
68
|
- `blot map` takes ~1.5 s on Flask app.py. `trace_lines(whole_file=True)` drops `-C` from the first blame so
|
|
63
69
|
map and why agree; checks still use the old path.
|
|
64
|
-
-
|
|
70
|
+
- Recall (2026-11-25, first measurement, 0.7.1 checks): 137 culprit/fix pairs (newest 40 per repo for
|
|
71
|
+
Django/React), 71 real bugs; 11 warned on target = **15% raw, 11/25 (44%) within Blot's model**.
|
|
72
|
+
Django 10/39, Express 1/8, Flask/requests/React 0. All 6 in-model misses are classification gaps
|
|
73
|
+
(fixes without fix words: "loosen ...", "Make sure ...", "Closes #632", Django `Fixed #N -- Changed`
|
|
74
|
+
at severity 1); none came from tracing or the matcher. 46 misses are outside the model (new code,
|
|
75
|
+
feature lines, build/deps). Re-run with `bench/regressions.py run` after any classify/check change.
|
|
76
|
+
Judging rule: a revert is a bug only if a message/PR/changelog/ticket says what broke.
|
|
77
|
+
- Precision (2026-11-21, after #45): 69/124 useful (55.6%); Django 1.43 / 10 commits (over the ≤ 1
|
|
78
|
+
target), others ≤ 0.62.
|
|
65
79
|
`forgot-related-file` has 0 useful warnings in 45 labelled; candidate to become opt-in.
|
|
66
|
-
- `--github` measured (2026-11-
|
|
80
|
+
- `--github` re-measured (2026-11-27, after #45): precision 55.6% → 54.5% (+9 useful, +10 noise), recall
|
|
81
|
+
11 → 12 of 71 on target. Opt-in, not default. `regressions.py run --github` exists.
|
|
82
|
+
- Kept (2026-11-27): explicit bug-fix markers (`[Bugfix]`, `Bugfix:`, …) make a commit a fix
|
|
83
|
+
(`_FIX_MARKER` in classify.py). Recall 11 → 12 of 71 on target (12/27 within model), precision
|
|
84
|
+
69/124 → 69/125. Rules are now judged on recall (`bench/regressions/`) as well as precision.
|
|
67
85
|
- Tried and dropped (2026-11-01): "fix word + PR number" as an offline fix rule: +85 warnings at 22%
|
|
68
86
|
useful. Don't retry it without a narrower signal (see bench/RESULTS.md).
|
|
69
87
|
- Known recall limit: tracing only passes commits classified as refactors, so a big non-refactor rewrite
|
|
70
|
-
hides older fixes (e.g. Flask `c2705ffd` hides fix #2935 in `ctx.py` `copy()`).
|
|
88
|
+
hides older fixes (e.g. Flask `c2705ffd` hides fix #2935 in `ctx.py` `copy()`). Diagnosed 2026-11-18:
|
|
89
|
+
`c2705ffd` really changed those tokens (`self.session` → `self._session`), so no "unchanged line" rule
|
|
90
|
+
can reach #2935.
|
|
91
|
+
- Tried and dropped (2026-11-18): hop past non-refactor commits when the line survived them unchanged in
|
|
92
|
+
the same file (normalized or KeptLines). Precision 54.6% → 52.8%: lost 8 warnings (4 useful, e.g. Express's
|
|
93
|
+
open-redirect fix), added 6 (1 useful). `map` on app.py went 1.4 → 3.5 s. Exact-only matching changed no
|
|
94
|
+
warning. `tests/test_trace.py` pins why. Unmeasured leads: KeptLines in the refactor hop (Black's
|
|
95
|
+
trailing commas), renamed attributes.
|
|
71
96
|
- Labels match on commit/check/path/cited commit, not line: when a rule moves a warning to another line,
|
|
72
97
|
re-check its label (#40 found two that way).
|
|
73
|
-
- Contributors: Sandro850 (#30, #38, #40). Open issues: #2–#4, #6 (bench cases), #33 (guard reports)
|
|
74
|
-
#36 (keyword-argument noise).
|
|
98
|
+
- Contributors: Sandro850 (#30, #38, #40, #45). Open issues: #2–#4, #6 (bench cases), #33 (guard reports).
|
|
75
99
|
- Launch: dev.to post published 2026-10-24; the CVE sentence there should mention the withdrawn advisory.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: blot-git
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: A pre-commit check that has read your project's history: warns when a change removes a fix, re-adds a fixed bug, or forgets a file that always changes too.
|
|
5
5
|
Project-URL: Homepage, https://github.com/Sym-jay/Blot
|
|
6
6
|
Project-URL: Issues, https://github.com/Sym-jay/Blot/issues
|
|
@@ -22,7 +22,19 @@ It runs locally, needs no account or AI, and stays quiet unless the history give
|
|
|
22
22
|
|
|
23
23
|
*A real run on Flask. Plain `git blame` points to a 2023 commit that only moved this line; Blot traces past it to the 2020 fix that explains it. (Regenerate with `python assets/demo/make_demo.py`.)*
|
|
24
24
|
|
|
25
|
-
> **Status:**
|
|
25
|
+
> **Status:** alpha. The checks, `why`, `map`, the agent guard and the MCP server all work and are tested live; a check takes about 500 ms on Flask. Measured on the last 500 commits of Flask, requests, Express, Django and React, it warns on 0.6–11% of commits, and 69 of its 124 warnings (56%, each labelled by hand) were worth a reviewer's time. Numbers and method: [bench/RESULTS.md](bench/RESULTS.md).
|
|
26
|
+
|
|
27
|
+
## What Blot catches, and what it doesn't
|
|
28
|
+
|
|
29
|
+
Blot catches one kind of regression well: **a change that undoes or breaks an earlier bug fix**. Replayed
|
|
30
|
+
on 71 real regressions from the same five repos (commits that a later fix or revert named as the culprit),
|
|
31
|
+
it warned on the right code before 11 of them were committed. Most regressions are a different kind:
|
|
32
|
+
a bug in brand-new code, or in code that never came from a fix. Blot can't see those, so it caught 11 of the
|
|
33
|
+
25 regressions of its kind (44%), and 15% of all of them.
|
|
34
|
+
|
|
35
|
+
So treat Blot as a reviewer who remembers your project's bug history, not as a bug finder. It stays
|
|
36
|
+
quiet about most changes, and when it speaks, it tells you which earlier fix to check. Details:
|
|
37
|
+
[recall on real regressions](bench/RESULTS.md#recall-real-regressions-measured-2026-11-25).
|
|
26
38
|
|
|
27
39
|
## Meet Sora
|
|
28
40
|
|
|
@@ -182,7 +194,7 @@ jobs:
|
|
|
182
194
|
blot:
|
|
183
195
|
runs-on: ubuntu-latest
|
|
184
196
|
steps:
|
|
185
|
-
- uses: Sym-jay/Blot@v0.7.
|
|
197
|
+
- uses: Sym-jay/Blot@v0.7.2
|
|
186
198
|
```
|
|
187
199
|
|
|
188
200
|
The action checks out the pull request with its full history, installs Blot, runs `blot index` and
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Run Blot on a pull request and show its findings as warning annotations.
|
|
2
2
|
# Usage (in a workflow triggered by pull_request):
|
|
3
|
-
# - uses: Sym-jay/Blot@v0.7.
|
|
3
|
+
# - uses: Sym-jay/Blot@v0.7.2
|
|
4
4
|
# See "Use in CI" in README.md.
|
|
5
5
|
name: Blot
|
|
6
6
|
description: History-aware checks on the commits of a pull request, shown as warning annotations
|
|
@@ -67,3 +67,17 @@ GitHub CLI logged in and a GitHub `origin` or `upstream` remote).
|
|
|
67
67
|
|
|
68
68
|
Target: **at most 1 warning per 10 commits**, and most of those should be worth reading.
|
|
69
69
|
See [RESULTS.md](RESULTS.md) for the latest numbers.
|
|
70
|
+
|
|
71
|
+
## 3. Regressions: recall on real history
|
|
72
|
+
|
|
73
|
+
`regressions.py` finds commits that a later fix names as the culprit (`This reverts commit <sha>`,
|
|
74
|
+
Django's `Regression in <sha>.`, and similar), replays each culprit at its parent like `--replay`
|
|
75
|
+
does, and reports how many Blot warned on. `regressions/<owner>-<repo>.json` holds the pairs, the
|
|
76
|
+
warnings and a hand judgement per pair (`bug`, `verdict`, `note`). `collect` keeps judgements, so
|
|
77
|
+
it can be re-run as history grows. See the docstring in `regressions.py` for the verdicts.
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
python bench/regressions.py collect --repo <clone> --out regressions/<owner>-<repo>.json
|
|
81
|
+
python bench/regressions.py run --repo <clone> --file regressions/<owner>-<repo>.json
|
|
82
|
+
python bench/regressions.py report regressions/*.json
|
|
83
|
+
```
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
# Bench results
|
|
2
|
+
|
|
3
|
+
Measured 2026-10-30 with `blot bench`, on Windows 11, Python 3.12.
|
|
4
|
+
|
|
5
|
+
## Cases: 33/33 correct
|
|
6
|
+
|
|
7
|
+
| Check | Cases | Precision | Recall |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| removed-fix | 24 (16 warn, 8 quiet) | 100% | 100% |
|
|
10
|
+
| readded-bug | 6 (4 warn, 2 quiet) | 100% | 100% |
|
|
11
|
+
| forgot-related-file | 3 (3 quiet) | n/a | n/a |
|
|
12
|
+
|
|
13
|
+
A quiet case now fails if its scripted edit can't be applied (it used to pass without running).
|
|
14
|
+
|
|
15
|
+
The 21 cases added in this round are real commits from the labelled replays below: each one replays
|
|
16
|
+
that commit's own hunk on its parent. Quiet cases pin the noise patterns fixed here so they stay fixed.
|
|
17
|
+
|
|
18
|
+
## Replay: last 500 non-merge commits of 5 repos, every warning labelled
|
|
19
|
+
|
|
20
|
+
Each commit is checked as if it were being committed at that moment, using only the history before
|
|
21
|
+
it. Every warning was then labelled by hand as **useful** or **noise** (rules in
|
|
22
|
+
[README.md](README.md#labels-precision-you-can-re-measure)); the labels live in [`labels/`](labels/),
|
|
23
|
+
so these numbers can be re-measured after any rule change. "Before" is Blot 0.4.0; "after" is this
|
|
24
|
+
release.
|
|
25
|
+
|
|
26
|
+
| Repo | Labelled at | Commits | Warnings / 10 commits, before → after | Precision, before → after |
|
|
27
|
+
|---|---|---|---|---|
|
|
28
|
+
| pallets/flask | `d086db856` | 500 | 0.10 → **0.08** | 3/5 (60%) → **3/4 (75%)** |
|
|
29
|
+
| psf/requests | `611c6162c` | 500 | 0.16 → **0.16** | 2/8 (25%) → **2/8 (25%)** |
|
|
30
|
+
| expressjs/express | `0dee2c52c` | 498 | 0.18 → **0.18** | 5/9 (56%) → **5/9 (56%)** |
|
|
31
|
+
| django/django | `79502d084` | 497 | 1.29 → **1.19** | 40/64 (63%) → **40/59 (68%)** |
|
|
32
|
+
| facebook/react | `9ffcb463b` | 483 | 1.26 → **0.60** | 7/61 (11%) → **7/29 (24%)** |
|
|
33
|
+
| **All** | | 2,478 | 0.59 → **0.44** | 57/147 (39%) → **57/109 (52%)** |
|
|
34
|
+
|
|
35
|
+
The rule changes removed 38 warnings, all of them labelled noise; no useful warning was lost.
|
|
36
|
+
|
|
37
|
+
**Against the PRD targets:** at most 1 warning per 10 commits is met everywhere except Django (1.19).
|
|
38
|
+
Precision of 80% is **not** met: 52% overall, 68% on Django, where most warnings are fixes touching
|
|
39
|
+
code from earlier fixes and CVEs.
|
|
40
|
+
|
|
41
|
+
### What a useful warning looks like
|
|
42
|
+
|
|
43
|
+
- Django `8fd29079e` relaxed the POST permission check that the CVE-2019-19118 fix added.
|
|
44
|
+
- Django `7ff7fcc05` redid the `parse_header_parameters` simplification that an earlier commit had
|
|
45
|
+
reverted as a bug (#36520). Both `removed-fix` and `readded-bug` fired.
|
|
46
|
+
- Flask `cabda59` changed `bp_subdomain is None` to `is not None` on a line from fix #4834; a later
|
|
47
|
+
commit had to fix the behaviour.
|
|
48
|
+
- Express `697547cd` reverted the CVE-2024-51999 patch. That revert was deliberate (the advisory,
|
|
49
|
+
GHSA-pj86-cfqh-vqx6, was later withdrawn), so it is useful as "a security fix is being undone",
|
|
50
|
+
not as a caught regression.
|
|
51
|
+
|
|
52
|
+
### Noise this release removed
|
|
53
|
+
|
|
54
|
+
| Noise (warnings) | Fix |
|
|
55
|
+
|---|---|
|
|
56
|
+
| React feature-flag forks, per-bundler and per-platform copies of one file (27) | co-change skips variants: same name stem and extension (`ReactFeatureFlags.native-fb.js` ↔ `ReactFeatureFlags.js`); `foo.c` ↔ `foo.h` still pair |
|
|
57
|
+
| deleting a whole file (4) | `removed-fix` skips deleted files |
|
|
58
|
+
| commits cited as fixes that weren't: `Fixed #21189: Cleaned up ...`, `Fixed #12882 - Moved ...`, `[DevTools] upgrade to Manifest V3`, `Change Flask.__init__ to accept ...`, error-message wording (6) | `Fixed #N:` / `Fixed #N -` ticket styles judged by their description; cleanups count as refactors; `[Tag]` prefixes and "change" subjects count as features; error messages are routine |
|
|
59
|
+
| docstrings with `backticks` or (asides) (1) | they count as prose |
|
|
60
|
+
|
|
61
|
+
### Since 0.6.0: real docstrings (#40, by @Sandro850)
|
|
62
|
+
|
|
63
|
+
`removed-fix` now parses the old Python file (`ast`, only when a warning is already on its way) and skips
|
|
64
|
+
lines inside real module, class and function docstrings. That removed one Django noise warning. It also
|
|
65
|
+
exposed two of **our** labels as wrong: in Flask `c2705ffd` and Django `ebcb13b3`, the warning used to point at
|
|
66
|
+
a docstring line, but the same change also edits the fix's code (Flask's `copy()` passing
|
|
67
|
+
`session=self.session`, from fix #2935; Django's `isinstance(normalized, (dict, str))` check, from the
|
|
68
|
+
CVE-2026-15307 fix). Now the warning points at the code, and both are relabelled useful.
|
|
69
|
+
|
|
70
|
+
| Repo | Before | After |
|
|
71
|
+
|---|---|---|
|
|
72
|
+
| pallets/flask | 3/4 (75%) | **4/4 (100%)** |
|
|
73
|
+
| django/django | 40/59 (68%) | **41/58 (71%)** |
|
|
74
|
+
| requests, Express, React | unchanged | unchanged |
|
|
75
|
+
| **All five** | 57/109 (52.3%) | **59/108 (54.6%)** |
|
|
76
|
+
|
|
77
|
+
### Since 0.7.0: a structural matcher (#45, by @Sandro850)
|
|
78
|
+
|
|
79
|
+
`removed-fix` decides whether a removed line survives among the added lines (`KeptLines`). The old
|
|
80
|
+
matcher accepted any inserted token outside `_LOGIC`, which flagged an appended keyword argument (it
|
|
81
|
+
inserts `=`) but let real edits through: `value` → `value.strip()`, arguments inserted mid-list,
|
|
82
|
+
matches stitched across hunks. The new matcher is structural: the fix's existing arguments stay token
|
|
83
|
+
for token, new arguments may only be appended to that same call (a `def` only gains parameters with a
|
|
84
|
+
default), and anything it can't verify counts as an edit.
|
|
85
|
+
|
|
86
|
+
| Repo | Before | After |
|
|
87
|
+
|---|---|---|
|
|
88
|
+
| pallets/flask | 4/4 (100%) | 4/4 (100%) |
|
|
89
|
+
| psf/requests | 2/8 (25%) | 2/10 (20%) |
|
|
90
|
+
| expressjs/express | 5/9 (56%) | 5/9 (56%) |
|
|
91
|
+
| django/django | 41/58 (71%), 1.17 / 10 commits | 49/71 (69%), 1.43 / 10 commits |
|
|
92
|
+
| facebook/react | 7/29 (24%) | 9/30 (30%) |
|
|
93
|
+
| **All five** | 59/108 (54.6%) | **69/124 (55.6%)** |
|
|
94
|
+
|
|
95
|
+
The three #36 noise warnings are gone and no useful warning was lost. The stricter matcher adds 19
|
|
96
|
+
warnings (10 useful, e.g. two Django CVE fixes whose code gained `.strip()`; 9 noise). Re-measured
|
|
97
|
+
independently on all five repos before merging. Cost: Django is further over the ≤ 1 / 10 target.
|
|
98
|
+
|
|
99
|
+
### Noise still there (55 warnings)
|
|
100
|
+
|
|
101
|
+
| Pattern | Warnings | Why there's no rule yet |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| co-change partner not needed (React) | 9 | **0 of 45 co-change warnings across all five repos were useful.** See below. |
|
|
104
|
+
| renames, equivalent API swaps (`substr` → `slice`, `req.connection` → `req.socket`) | 11 | a rename and a switch to a different variable look the same on one line |
|
|
105
|
+
| formatter reflows with f-strings, joined lines or re-split strings (requests' Black commit) | 6 | dropping parentheses can change precedence |
|
|
106
|
+
| deleting a legacy module or feature in pieces (React) | 6 | intentional, but only the commit message says so |
|
|
107
|
+
| colour-only template changes (Django's dark mode, `3d34265d`) | 5 | the line really changed; only a reader knows it's cosmetic |
|
|
108
|
+
| other: code moved to another file, fix behaviour kept while restructuring, generic re-added lines | 18 | case by case |
|
|
109
|
+
|
|
110
|
+
**`forgot-related-file` has shown no useful warning yet**: 0/45 before this release, 0/9 after. It
|
|
111
|
+
stays on, because the remaining warnings are rare (React only), but it is the first candidate to
|
|
112
|
+
become opt-in if real-world reports agree.
|
|
113
|
+
|
|
114
|
+
## Does `--github` help? (measured 2026-11-01)
|
|
115
|
+
|
|
116
|
+
`blot bench --replay 500 --github` reads issue and PR labels the way `blot index --github` does.
|
|
117
|
+
Flask, requests, Express and React track bugs on GitHub; Django's GitHub Issues are off (it uses
|
|
118
|
+
Trac), so it is unchanged. New warnings were labelled with the same rules.
|
|
119
|
+
|
|
120
|
+
| Repo | Without `--github` | With `--github` | Commits re-judged by labels |
|
|
121
|
+
|---|---|---|---|
|
|
122
|
+
| pallets/flask | 3/4 (75%) | 3/4 (75%) | 0 |
|
|
123
|
+
| psf/requests | 2/8 (25%) | **4/10 (40%)** | 15 upgraded |
|
|
124
|
+
| expressjs/express | 5/9 (56%) | 5/9 (56%) | 25 upgraded |
|
|
125
|
+
| facebook/react | 7/29 (24%) | **12/40 (30%)** | 154 upgraded, 4 demoted |
|
|
126
|
+
| **All five, with Django** | 57/109 (52.3%) | **64/122 (52.5%)** | |
|
|
127
|
+
|
|
128
|
+
**`--github` doesn't raise precision; it finds more useful warnings** (7 more, with 5 more noise).
|
|
129
|
+
Labels almost never demote a commit (4 of ~3,200 issues and PRs looked up). What they do is
|
|
130
|
+
upgrade commits like `ReactDOM: Fix missing form data ... (#28056)`, which Blot rates as unclear
|
|
131
|
+
without labels: "Fix" isn't at the start, and there's no "fixes #N" or strong defect word.
|
|
132
|
+
|
|
133
|
+
Caveat: labels are read as they are today, so a label added after a commit was made counts too.
|
|
134
|
+
|
|
135
|
+
### Tried and dropped: "a fix word plus a PR number" (2026-11-01)
|
|
136
|
+
|
|
137
|
+
Could a rule do offline what the `bug` label does? Rule tried: a fix word anywhere in the subject
|
|
138
|
+
plus an issue or PR number makes a commit a fix. It added **85 warnings** (React went from 0.60 to
|
|
139
|
+
1.95 per 10 commits), because almost every React and Express subject ends in its PR number. Of 46
|
|
140
|
+
labelled (all of requests' and Express's, 20 of React's), **10 were useful (22%)**. Most were
|
|
141
|
+
`fix(deps): …@^2.0.0` bumps, "Fix Flow type" commits and import lines. Overall precision would fall
|
|
142
|
+
from 52% to about 39%, so the rule was not kept. Its 46 labels stay in `labels/` for any narrower
|
|
143
|
+
attempt. A label written by a maintainer says more than a keyword can.
|
|
144
|
+
|
|
145
|
+
### Tried and dropped: tracing past unchanged lines (2026-11-18)
|
|
146
|
+
|
|
147
|
+
**The gap.** At Flask HEAD, `blot why` and `blot map src/flask/ctx.py` don't link `copy()` to fix
|
|
148
|
+
#2935 (`e08bcf9`). Blame stops at `c2705ffd` ("merge app and request context"), and tracing only goes
|
|
149
|
+
past commits classified as refactors.
|
|
150
|
+
|
|
151
|
+
**Diagnosis: `c2705ffd` really rewrote those lines.** It changed `request=self.request,` /
|
|
152
|
+
`session=self.session,` to `request=self._request,` / `session=self._session,` (the session became
|
|
153
|
+
a lazy property backed by `_session`), dropped `environ=self.request.environ,`, and changed the
|
|
154
|
+
signature to `def copy(self) -> te.Self:`. `git blame -w -M -C -C` also stops at `c2705ffd`. No
|
|
155
|
+
normalized or KeptLines match exists in the parent, so no rule of the form "the line survived
|
|
156
|
+
unchanged" can reach #2935 here. The fix's intent survives; its tokens don't. Replay already warns on
|
|
157
|
+
`c2705ffd` itself (labelled useful), which is when it matters most.
|
|
158
|
+
|
|
159
|
+
**Rule tried anyway, to measure it:** when blame lands on a non-refactor commit that removed a line
|
|
160
|
+
from the same file with the same normalized text (or one the line only reformats, per `KeptLines`),
|
|
161
|
+
hop to the parent like a refactor hop, within `MAX_HOPS`.
|
|
162
|
+
|
|
163
|
+
| Repo | Warnings | Precision, before → with the rule | Lost (useful) | New (useful) |
|
|
164
|
+
|---|---|---|---|---|
|
|
165
|
+
| pallets/flask | 4 → 4 | 4/4 → 3/4 | 1 (1) | 1 (0) |
|
|
166
|
+
| psf/requests | 8 → 9 | 2/8 → 2/9 | 0 | 1 (0) |
|
|
167
|
+
| expressjs/express | 9 → 7 | 5/9 → 4/7 | 2 (1) | 0 |
|
|
168
|
+
| django/django | 58 → 58 | 41/58 → 40/58 | 4 (2) | 4 (1) |
|
|
169
|
+
| facebook/react | 29 → 28 | 7/29 → 7/28 | 1 (0) | 0 |
|
|
170
|
+
| **All five** | **108 → 106** | **59/108 (54.6%) → 56/106 (52.8%)** | **8 (4)** | **6 (1)** |
|
|
171
|
+
|
|
172
|
+
It loses useful warnings because `KeptLines` treats an inserted call as cosmetic, so the rule hops
|
|
173
|
+
past fixes that wrapped a value. Express `76eaa32` changed `this.set('Location', loc)` to
|
|
174
|
+
`this.set('Location', encodeUrl(loc))`, so the warning on the later open-redirect fix
|
|
175
|
+
(`0867302dd`) disappeared. Flask lost the `c2705ffd` warning: `e08bcf9` only added a comma to
|
|
176
|
+
`request=self.request`, and the line it did add, `session=self.session`, gained a trailing comma
|
|
177
|
+
in Black's `025589ee`, which the exact-match refactor hop can't follow. The one useful new warning
|
|
178
|
+
is Django `1b4d021b6`. Cost: `blot check` on the Flask demo went from ~470 to ~485 ms (median of 6),
|
|
179
|
+
and `blot map src/flask/app.py` from 1.4 s to 3.5 s.
|
|
180
|
+
|
|
181
|
+
An **exact-text-only variant** (no `KeptLines`) changed **no warning** on any of the five repos and still cost ~35 ms per check. Neither version was kept. The six new warnings stay
|
|
182
|
+
labelled in `labels/` (reasons prefixed "trace-past-unchanged experiment"). `tests/test_trace.py`
|
|
183
|
+
pins both behaviours: a rewritten line stops the trace, and a fix that wraps a value stays the
|
|
184
|
+
explanation.
|
|
185
|
+
|
|
186
|
+
Two narrower leads came out of this, both unmeasured: let the refactor hop match with `KeptLines`
|
|
187
|
+
(Black's trailing commas, as in `025589ee`), and follow renamed attributes (`self.session` →
|
|
188
|
+
`self._session`).
|
|
189
|
+
|
|
190
|
+
### Tried and dropped: a per-commit warning budget (2026-11-25)
|
|
191
|
+
|
|
192
|
+
Idea: show at most N warnings per commit, ranked by strength (strong defect or CVE wording first, then
|
|
193
|
+
a linked issue), to bring Django under 1 warning per 10 commits. Simulated on the labelled replays
|
|
194
|
+
(after #45), with no new runs:
|
|
195
|
+
|
|
196
|
+
| Budget | Precision | Django, warnings / 10 commits | Useful warnings hidden |
|
|
197
|
+
|---|---|---|---|
|
|
198
|
+
| none | 69/124 (55.6%) | 1.43 | 0 |
|
|
199
|
+
| 3 | 68/114 (59.6%) | 1.37 | 1 |
|
|
200
|
+
| 2 | 65/107 (60.7%) | 1.31 | 4 |
|
|
201
|
+
| 1 | 55/89 (61.8%) | 1.09 | 14 |
|
|
202
|
+
|
|
203
|
+
It doesn't fix the volume: 71 of the 89 commits that warn have a single warning, so Django's rate
|
|
204
|
+
comes from many commits warning once (a Django fix often touches an earlier fix, and 69% of those
|
|
205
|
+
warnings are useful). It also hides useful warnings, because the ranking can't tell them apart: at a
|
|
206
|
+
budget of 2, a requests commit would show two noise warnings and hide its one useful one. The
|
|
207
|
+
precision gain is only noise from a few huge commits being cut. Not kept. If anything, long lists
|
|
208
|
+
could be collapsed in the output ("+4 more") without dropping a warning.
|
|
209
|
+
|
|
210
|
+
## Recall: real regressions (measured 2026-11-25)
|
|
211
|
+
|
|
212
|
+
Precision asks "when Blot warns, is it worth reading?". Recall asks the other half: **of the commits
|
|
213
|
+
that later turned out to cause a bug, how many did Blot warn on when they were committed?** This is
|
|
214
|
+
the first time it has been measured on real history rather than scripted cases.
|
|
215
|
+
|
|
216
|
+
**Pairs.** [`regressions.py`](regressions.py) reads each reference repo's whole history (at the
|
|
217
|
+
labelled heads above) for fix commits that name their culprit by sha: `This reverts commit <sha>`,
|
|
218
|
+
Django's `Regression in <sha>.`, "regression introduced by / caused by / broken in <sha>",
|
|
219
|
+
`Fixes: <sha>`, and React's `Reverts facebook/react#N` / "regression from #N" (mapped to the one
|
|
220
|
+
commit whose subject ends in `(#N)`). From 1,067 references:
|
|
221
|
+
|
|
222
|
+
| Dropped | Count |
|
|
223
|
+
|---|---|
|
|
224
|
+
| older than the 40 newest pairs per repo (Django and React only) | 614 |
|
|
225
|
+
| culprit already named by an earlier fix | 118 |
|
|
226
|
+
| touches no file Blot checks (tests, docs, generated) | 88 |
|
|
227
|
+
| sha not found, or not an ancestor of the fix | 45 |
|
|
228
|
+
| more than 50 files (the replay's `--max-files`) | 25 |
|
|
229
|
+
| culprit is itself a revert (a re-land, not a bug) | 19 |
|
|
230
|
+
| merge commit | 16 |
|
|
231
|
+
| PR number not mapped to exactly one commit | 5 |
|
|
232
|
+
| **kept** | **137** |
|
|
233
|
+
|
|
234
|
+
**Replay.** Each culprit is checked at its parent with only its ancestors visible, as
|
|
235
|
+
`blot bench --replay` does: `_ReplayStore` hides fixes that weren't ancestors, and co-change counts
|
|
236
|
+
come from the culprit's own ancestors. Blot's checks were not changed.
|
|
237
|
+
|
|
238
|
+
**Judgement.** Every pair was judged by hand (notes in [`regressions/`](regressions/)):
|
|
239
|
+
|
|
240
|
+
- `bug`: did the culprit really cause a bug? A revert counts only if the message, PR, changelog
|
|
241
|
+
or ticket says what broke. 66 of the 137 were reverted for other reasons (wrong branch, flag
|
|
242
|
+
rollouts, design changes, "just kidding"), mostly in requests and React. They are left out.
|
|
243
|
+
- `hit-on-target`: Blot warned, and on the code the later fix was about. `hit-elsewhere`: it
|
|
244
|
+
warned, but about something else. To help decide, each warning records `near_fix`: whether
|
|
245
|
+
the fix changed what the culprit wrote in that hunk.
|
|
246
|
+
- `miss-gap`: no warning, but the culprit changed a line from a real earlier fix, and a warning
|
|
247
|
+
there would have been on target. `miss-outside`: the bug is outside Blot's model (new code, or
|
|
248
|
+
lines that came from features).
|
|
249
|
+
|
|
250
|
+
| Repo | Pairs | Real bugs | Warned | On target | Recall, raw | Within Blot's model | Recall within model |
|
|
251
|
+
|---|---|---|---|---|---|---|---|
|
|
252
|
+
| pallets/flask | 7 | 3 | 0 | 0 | 0/3 | 1 | 0/1 |
|
|
253
|
+
| psf/requests | 31 | 4 | 0 | 0 | 0/4 | 2 | 0/2 |
|
|
254
|
+
| expressjs/express | 19 | 8 | 1 | 1 | 1/8 (12%) | 2 | 1/2 |
|
|
255
|
+
| django/django | 40 | 39 | 17 | 10 | 10/39 (26%) | 19 | 10/19 (53%) |
|
|
256
|
+
| facebook/react | 40 | 17 | 1 | 0 | 0/17 | 1 | 0/1 |
|
|
257
|
+
| **All** | 137 | **71** | 19 | **11** | **11/71 (15%)** | 25 | **11/25 (44%)** |
|
|
258
|
+
|
|
259
|
+
"Within Blot's model" = hits + `miss-gap`. Raw recall counts only on-target hits. Counting every
|
|
260
|
+
warning, 19/71 (27%) of culprits got one.
|
|
261
|
+
|
|
262
|
+
**What it means.** Blot catches regressions of one kind: a change that undoes part of an earlier,
|
|
263
|
+
recognisable fix. In Django, where every fix says `Fixed #N --` and regressions often rework
|
|
264
|
+
recent fixes, 10 of 39 regressions were flagged on the right code. Some of them:
|
|
265
|
+
|
|
266
|
+
- `0246f4788` deprecated `constant_time_compare()` and replaced its calls added by fixes #34384
|
|
267
|
+
and #32800. The change broke mixed-type callers (#36572, a release blocker) and was reverted.
|
|
268
|
+
- `7d9aab8da` moved the `_prepare_related_fields_for_save()` call from fix #29497. The fix for
|
|
269
|
+
#37234 moved it back.
|
|
270
|
+
- `821619aa8` simplified away the `hints=` plumbing from fix #13724. The regression (#37300) lost
|
|
271
|
+
instance hints on prefetch querysets.
|
|
272
|
+
- Express `2bba69f63` removed the default OPTIONS response from fix 9c87eed. Issue #1690
|
|
273
|
+
("Default OPTIONS Not Functioning") followed, and the change was reverted.
|
|
274
|
+
|
|
275
|
+
Of the 8 `hit-elsewhere` warnings, 6 cite a real fix in another file or function. In the other 2,
|
|
276
|
+
a generic re-added line (`for field in fields:`) happened to sit in the code the fix changed, but
|
|
277
|
+
the cited fix had nothing to do with it.
|
|
278
|
+
|
|
279
|
+
**Why the rest were missed** (52 real-bug misses):
|
|
280
|
+
|
|
281
|
+
| Reason | Misses |
|
|
282
|
+
|---|---|
|
|
283
|
+
| outside the model: changed lines came from features or other non-fix commits | 23 |
|
|
284
|
+
| outside the model: the bug is in new code (pure additions, new functions or checks) | 18 |
|
|
285
|
+
| **classification: the culprit changed lines from a real fix that Blot didn't recognise as one** | **6** |
|
|
286
|
+
| outside the model: build, dependency or CI breakage (`pyproject.toml`, `package.json`, `tox.ini`) | 5 |
|
|
287
|
+
|
|
288
|
+
All 6 in-model misses are classification gaps, and each fix lacks a fix word:
|
|
289
|
+
requests `b149be5` "loosen URL handling for non-native URL schemes", requests `641f461` "Make sure
|
|
290
|
+
proxies have their scheme attached.", Express `3afbcd0` "JSON and JSONP default to UTF-8 … Closes
|
|
291
|
+
#632", Flask `d4076cf` "strip the ending slash for static_url_path", Django `44dd91e` "Fixed #4015
|
|
292
|
+
-- Changed login() and logout() …" (severity 1: "Changed"), and Django `857b104` "Fixed #34619 --
|
|
293
|
+
Associated FilteredSelectMultiple elements to their label". No miss was caused by tracing or the
|
|
294
|
+
matcher. The Black reformat `9c19aff7` stopped tracing on 5 lines, but each of those culprits was
|
|
295
|
+
caught through another line.
|
|
296
|
+
|
|
297
|
+
React is 0/17. Its regressions were in new code or in lines from feature commits, and most
|
|
298
|
+
reverts there are flag rollouts, which have no bug to catch.
|
|
299
|
+
|
|
300
|
+
Caveats: the newest 40 pairs per repo for Django and React, so fixes from 2025-08 on (Django)
|
|
301
|
+
and 2020-08 on (React); a single judge; reverts without a stated reason count as "not a bug", which
|
|
302
|
+
may undercount real regressions in requests and React.
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
python bench/regressions.py collect --repo <clone> --out bench/regressions/<owner>-<repo>.json # finds pairs, keeps judgements
|
|
306
|
+
python bench/regressions.py run --repo <clone> --file bench/regressions/<owner>-<repo>.json # replays culprits (Django ~2.5 min)
|
|
307
|
+
python bench/regressions.py report bench/regressions/*.json
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### `--github` on both measures (2026-11-27)
|
|
311
|
+
|
|
312
|
+
Re-run on today's code (after #45) for the four GitHub-tracked repos, with issue and PR labels
|
|
313
|
+
(`blot bench --replay 500 --github`, `regressions.py run --github`). Django is unchanged, since its
|
|
314
|
+
GitHub Issues are off.
|
|
315
|
+
|
|
316
|
+
| | Without `--github` | With `--github` |
|
|
317
|
+
|---|---|---|
|
|
318
|
+
| Precision, all five | 69/124 (55.6%) | 78/143 (54.5%): +9 useful, +10 noise |
|
|
319
|
+
| Real regressions warned on target | 11/71 | 12/71 |
|
|
320
|
+
|
|
321
|
+
Labels mostly *upgrade* commits (194 upgraded, 4 demoted), so they widen coverage at about the same
|
|
322
|
+
precision. The one regression gained is React `553440bd1`: the warning lands on the hunk the later
|
|
323
|
+
fix touched, citing `9d67847` "[Bugfix] Dropped updates inside a suspended tree". That fix is
|
|
324
|
+
plain from its subject, but without labels Blot misses it because it reads `[Bugfix]` as a project
|
|
325
|
+
tag like `[DevTools]`, an offline classification gap worth measuring on its own. `--github` stays an
|
|
326
|
+
opt-in, not a default. The 6 new replay warnings are labelled (reasons prefixed "--github replay").
|
|
327
|
+
|
|
328
|
+
### Kept: explicit bug-fix markers (2026-11-27)
|
|
329
|
+
|
|
330
|
+
The lead above, measured on both sides. `[Bugfix] Dropped updates …` was rated a feature: the `[Tag]`
|
|
331
|
+
skip added for `[DevTools] upgrade …` read `[Bugfix]` as a project tag, then "Dropped" as a feature
|
|
332
|
+
verb. Now an explicit marker at the start (`[Bugfix]`, `[Bug fix]`, `[Bug]`, `[Hotfix]`, `[Fix]`,
|
|
333
|
+
`Bugfix:`, `Hotfix:`) makes a commit a fix unless it is routine (docs, tests). About 60 commits in the
|
|
334
|
+
five repos carry one, almost all in React; Django has none, so its results can't change and it wasn't
|
|
335
|
+
re-run.
|
|
336
|
+
|
|
337
|
+
| | Before | With the rule |
|
|
338
|
+
|---|---|---|
|
|
339
|
+
| Real regressions warned on target | 11/71 | **12/71 (17%)** |
|
|
340
|
+
| Within Blot's model | 11/25 | 12/27 (44%) |
|
|
341
|
+
| Precision | 69/124 (55.6%) | 69/125 (55.2%) |
|
|
342
|
+
|
|
343
|
+
Three React regressions changed. Two were "outside the model" only because their removed lines came
|
|
344
|
+
from `Bugfix:` commits that Blot hadn't recognised: `553440bd1` (removing blocking mode) is now
|
|
345
|
+
warned on target, since the bug was the removal itself and Blot flags removing code from fix #19164;
|
|
346
|
+
`6c4bbc783` now warns, but its revert names no bug location, so it counts as elsewhere, the convention
|
|
347
|
+
#53 set for such reverts. `0f1856c49` gained a second warning and stays elsewhere. The one new replay
|
|
348
|
+
warning is noise (an assignment chain reflowed). Precision slips by that one warning, but the rule is
|
|
349
|
+
narrow and the recall gain is real, so it is kept: the first rule judged on recall as well as
|
|
350
|
+
precision.
|
|
351
|
+
|
|
352
|
+
## Reproduce
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
git clone https://github.com/pallets/flask && cd flask && git checkout d086db856
|
|
356
|
+
blot bench --replay 500 --labels path/to/Blot/bench/labels/pallets-flask.json
|
|
357
|
+
```
|