blot-git 0.7.1__tar.gz → 0.7.3__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.
Files changed (118) hide show
  1. {blot_git-0.7.1 → blot_git-0.7.3}/.pre-commit-hooks.yaml +1 -1
  2. {blot_git-0.7.1 → blot_git-0.7.3}/CLAUDE.md +35 -10
  3. {blot_git-0.7.1 → blot_git-0.7.3}/PKG-INFO +1 -1
  4. {blot_git-0.7.1 → blot_git-0.7.3}/README.md +14 -2
  5. {blot_git-0.7.1 → blot_git-0.7.3}/action.yml +1 -1
  6. {blot_git-0.7.1 → blot_git-0.7.3}/bench/README.md +14 -0
  7. blot_git-0.7.3/bench/RESULTS.md +397 -0
  8. {blot_git-0.7.1 → blot_git-0.7.3}/bench/labels/expressjs-express.json +30 -0
  9. {blot_git-0.7.1 → blot_git-0.7.3}/bench/labels/facebook-react.json +40 -0
  10. {blot_git-0.7.1 → blot_git-0.7.3}/bench/labels/pallets-flask.json +10 -0
  11. blot_git-0.7.3/bench/regressions/django-django.json +3808 -0
  12. blot_git-0.7.3/bench/regressions/expressjs-express.json +644 -0
  13. blot_git-0.7.3/bench/regressions/facebook-react.json +4781 -0
  14. blot_git-0.7.3/bench/regressions/pallets-flask.json +325 -0
  15. blot_git-0.7.3/bench/regressions/psf-requests.json +1045 -0
  16. blot_git-0.7.3/bench/regressions.py +437 -0
  17. {blot_git-0.7.1 → blot_git-0.7.3}/pyproject.toml +1 -1
  18. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/__init__.py +1 -1
  19. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/bench.py +3 -3
  20. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/classify.py +4 -1
  21. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/diff.py +37 -15
  22. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/git.py +11 -0
  23. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/index.py +3 -3
  24. blot_git-0.7.3/src/blot/trace.py +385 -0
  25. {blot_git-0.7.1 → blot_git-0.7.3}/tests/conftest.py +5 -2
  26. blot_git-0.7.3/tests/fixtures/exact_hops/django-005c9fc4.diff +52 -0
  27. blot_git-0.7.3/tests/fixtures/exact_hops/django-ac0808f7.diff +25 -0
  28. blot_git-0.7.3/tests/fixtures/exact_hops/express-80e9ffbf.diff +12 -0
  29. blot_git-0.7.3/tests/fixtures/exact_hops/react-b8f82587.diff +61 -0
  30. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_classify.py +6 -0
  31. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_cli.py +78 -0
  32. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_diff.py +68 -1
  33. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_index.py +31 -1
  34. blot_git-0.7.3/tests/test_regressions.py +125 -0
  35. blot_git-0.7.3/tests/test_trace.py +645 -0
  36. blot_git-0.7.3/tests/test_trace_comma.py +197 -0
  37. blot_git-0.7.1/bench/RESULTS.md +0 -195
  38. blot_git-0.7.1/src/blot/trace.py +0 -152
  39. blot_git-0.7.1/tests/test_trace.py +0 -61
  40. {blot_git-0.7.1 → blot_git-0.7.3}/.gitattributes +0 -0
  41. {blot_git-0.7.1 → blot_git-0.7.3}/.github/ISSUE_TEMPLATE/bench_case.md +0 -0
  42. {blot_git-0.7.1 → blot_git-0.7.3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  43. {blot_git-0.7.1 → blot_git-0.7.3}/.github/ISSUE_TEMPLATE/check_idea.md +0 -0
  44. {blot_git-0.7.1 → blot_git-0.7.3}/.github/pull_request_template.md +0 -0
  45. {blot_git-0.7.1 → blot_git-0.7.3}/.github/workflows/blot.yml +0 -0
  46. {blot_git-0.7.1 → blot_git-0.7.3}/.github/workflows/ci.yml +0 -0
  47. {blot_git-0.7.1 → blot_git-0.7.3}/.github/workflows/release.yml +0 -0
  48. {blot_git-0.7.1 → blot_git-0.7.3}/.gitignore +0 -0
  49. {blot_git-0.7.1 → blot_git-0.7.3}/CONTRIBUTING.md +0 -0
  50. {blot_git-0.7.1 → blot_git-0.7.3}/LICENSE +0 -0
  51. {blot_git-0.7.1 → blot_git-0.7.3}/assets/demo/demo.gif +0 -0
  52. {blot_git-0.7.1 → blot_git-0.7.3}/assets/demo/make_demo.py +0 -0
  53. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/blue/alert.svg +0 -0
  54. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/blue/faces.svg +0 -0
  55. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/blue/happy.svg +0 -0
  56. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/blue/idle.svg +0 -0
  57. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/blue/sad.svg +0 -0
  58. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/blue/sleepy.svg +0 -0
  59. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/blue/walk.svg +0 -0
  60. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/blue/worried.svg +0 -0
  61. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/build_sprites.py +0 -0
  62. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/mustard/alert.svg +0 -0
  63. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/mustard/faces.svg +0 -0
  64. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/mustard/happy.svg +0 -0
  65. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/mustard/idle.svg +0 -0
  66. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/mustard/sad.svg +0 -0
  67. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/mustard/sleepy.svg +0 -0
  68. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/mustard/walk.svg +0 -0
  69. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/mustard/worried.svg +0 -0
  70. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/orange/alert.svg +0 -0
  71. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/orange/faces.svg +0 -0
  72. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/orange/happy.svg +0 -0
  73. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/orange/idle.svg +0 -0
  74. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/orange/sad.svg +0 -0
  75. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/orange/sleepy.svg +0 -0
  76. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/orange/walk.svg +0 -0
  77. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/orange/worried.svg +0 -0
  78. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/sage/alert.svg +0 -0
  79. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/sage/faces.svg +0 -0
  80. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/sage/happy.svg +0 -0
  81. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/sage/idle.svg +0 -0
  82. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/sage/sad.svg +0 -0
  83. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/sage/sleepy.svg +0 -0
  84. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/sage/walk.svg +0 -0
  85. {blot_git-0.7.1 → blot_git-0.7.3}/assets/sora/sage/worried.svg +0 -0
  86. {blot_git-0.7.1 → blot_git-0.7.3}/bench/cases.json +0 -0
  87. {blot_git-0.7.1 → blot_git-0.7.3}/bench/labels/django-django.json +0 -0
  88. {blot_git-0.7.1 → blot_git-0.7.3}/bench/labels/psf-requests.json +0 -0
  89. {blot_git-0.7.1 → blot_git-0.7.3}/docs/EXPLAINER.md +0 -0
  90. {blot_git-0.7.1 → blot_git-0.7.3}/docs/PRD.md +0 -0
  91. {blot_git-0.7.1 → blot_git-0.7.3}/docs/PYPI.md +0 -0
  92. {blot_git-0.7.1 → blot_git-0.7.3}/docs/competitors.md +0 -0
  93. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/__main__.py +0 -0
  94. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/checks/__init__.py +0 -0
  95. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/checks/base.py +0 -0
  96. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/checks/cochange.py +0 -0
  97. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/checks/readded_bug.py +0 -0
  98. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/checks/removed_fix.py +0 -0
  99. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/cli.py +0 -0
  100. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/config.py +0 -0
  101. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/fixmap.py +0 -0
  102. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/github.py +0 -0
  103. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/guard.py +0 -0
  104. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/hooks.py +0 -0
  105. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/mcp.py +0 -0
  106. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/report.py +0 -0
  107. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/store.py +0 -0
  108. {blot_git-0.7.1 → blot_git-0.7.3}/src/blot/why.py +0 -0
  109. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_action.py +0 -0
  110. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_bench.py +0 -0
  111. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_checks.py +0 -0
  112. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_config.py +0 -0
  113. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_git.py +0 -0
  114. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_guard.py +0 -0
  115. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_hooks.py +0 -0
  116. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_map.py +0 -0
  117. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_mcp.py +0 -0
  118. {blot_git-0.7.1 → blot_git-0.7.3}/tests/test_why_github.py +0 -0
@@ -1,6 +1,6 @@
1
1
  # Lets users of the pre-commit framework add blot with:
2
2
  # - repo: https://github.com/Sym-jay/Blot
3
- # rev: v0.7.1
3
+ # rev: v0.7.3
4
4
  # hooks: [{id: blot}]
5
5
  # The first commit indexes the repo's history; later commits refresh the index incrementally.
6
6
  - id: blot
@@ -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 precision
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)
@@ -43,7 +45,8 @@ python -m venv .venv && .venv/Scripts/python -m pip install -e ".[dev]"
43
45
 
44
46
  ## Conventions
45
47
  - Work on a branch, open a PR, merge only when the owner says so. Squash-merge.
46
- - No `Co-Authored-By` trailer in commits or PRs (the owner's choice); PR bodies end with the Claude Code line.
48
+ - No Claude attribution anywhere (the owner's choice): no `Co-Authored-By` trailer in commits, and no
49
+ "Generated with Claude Code" line in PRs, issues or comments.
47
50
  - Contributors (e.g. O1sumitkumar) should comment on the issue before starting a PR.
48
51
  - Never claim results that weren't run; label replay findings honestly (e.g. the Express
49
52
  CVE-2024-51999 advisory was later withdrawn, so its revert was deliberate).
@@ -54,20 +57,41 @@ python -m venv .venv && .venv/Scripts/python -m pip install -e ".[dev]"
54
57
  - Writing code through bash heredocs mangles `\b`, `\n`, `\s`: use the Edit tool for regexes/strings.
55
58
  - `gh api` paths: no leading slash (Git Bash rewrites it).
56
59
 
57
- ## State (2026-11-21)
58
- - Released 0.7.1: checks, `why`, `map`, `--github`, agent guard (`blot guard` / `install-agent-hook`),
60
+ ## State (2026-12-06)
61
+ - Released 0.7.3: checks, `why`, `map`, `--github`, agent guard (`blot guard` / `install-agent-hook`),
59
62
  MCP server (`blot mcp` / `install-mcp`, tools `explain_lines` and `load_bearing_lines`), bench/replay
60
- with labels, parallel indexing, pre-commit framework (`rev: v0.7.1`), GitHub Action (`@v0.7.1`).
61
- 0.7.1 adds the docstring rule (#40) and the structural `KeptLines` matcher (#45).
63
+ with labels, parallel indexing, pre-commit framework (`rev: v0.7.3`), GitHub Action (`@v0.7.3`).
64
+ 0.7.1 added the docstring rule (#40) and the structural `KeptLines` matcher (#45); 0.7.2 the
65
+ explicit bug-fix marker rule (#56); 0.7.3 the trailing-comma hop (#58), the hunk-count diff parser
66
+ (#61) and corroborated refactor hops (#62).
62
67
  - Live-tested in Claude Code: the guard (2026-11-06: the agent cited fix 8efea0c it was undoing) and MCP
63
68
  (2026-11-14: an agent called `load_bearing_lines` on its own and answered correctly).
64
69
  Throwaway test folder: `Documents\flask-guard-test` (guard hook + `.mcp.json`).
65
70
  - `blot map` takes ~1.5 s on Flask app.py. `trace_lines(whole_file=True)` drops `-C` from the first blame so
66
71
  map and why agree; checks still use the old path.
67
- - Precision (2026-11-21, after #45): 69/124 useful (55.6%); Django 1.43 / 10 commits (over the ≤ 1
68
- target), others ≤ 0.62.
72
+ - Recall (2026-11-25, first measurement, 0.7.1 checks): 137 culprit/fix pairs (newest 40 per repo for
73
+ Django/React), 71 real bugs; 11 warned on target = **15% raw, 11/25 (44%) within Blot's model**.
74
+ Django 10/39, Express 1/8, Flask/requests/React 0. All 6 in-model misses are classification gaps
75
+ (fixes without fix words: "loosen ...", "Make sure ...", "Closes #632", Django `Fixed #N -- Changed`
76
+ at severity 1); none came from tracing or the matcher. 46 misses are outside the model (new code,
77
+ feature lines, build/deps). Re-run with `bench/regressions.py run` after any classify/check change.
78
+ Judging rule: a revert is a bug only if a message/PR/changelog/ticket says what broke.
79
+ - Precision (2026-11-29, after #58): 70/126 useful (55.6%); Django 1.43 / 10 commits (over the ≤ 1
80
+ target), others ≤ 0.64. Recall 12/71 on target (12/27 within model).
81
+ - #58 (Sandro850): the refactor hop follows Black's trailing commas via a verified AST fallback
82
+ (`RefactorOrigins.find_comma`); simpler index-only versions misattributed identical calls.
83
+ - #61 (2026-12-04): `parse_unified_diff` follows `@@` hunk counts, so `-- `/`++ ` source rows aren't
84
+ file headers; diffs are read as bytes via `git.read_git_diff` and split on LF only. Snapshot readers
85
+ (`why`, `map`, `readded-bug`) still use `splitlines()`.
86
+ - #62 (2026-12-05, closes #59): an exact refactor hop must be corroborated by the refactor's diff
87
+ (same hunk, or neighbouring rows moved with it); ties stop. All results unchanged (70/126, 12/71).
88
+ Cost: slower large traces and replays, more memory; #63 tracks it.
69
89
  `forgot-related-file` has 0 useful warnings in 45 labelled; candidate to become opt-in.
70
- - `--github` measured (2026-11-01): precision unchanged, +7 useful warnings, almost no demotions.
90
+ - `--github` re-measured (2026-11-27, after #45): precision 55.6% → 54.5% (+9 useful, +10 noise), recall
91
+ 11 → 12 of 71 on target. Opt-in, not default. `regressions.py run --github` exists.
92
+ - Kept (2026-11-27): explicit bug-fix markers (`[Bugfix]`, `Bugfix:`, …) make a commit a fix
93
+ (`_FIX_MARKER` in classify.py). Recall 11 → 12 of 71 on target (12/27 within model), precision
94
+ 69/124 → 69/125. Rules are now judged on recall (`bench/regressions/`) as well as precision.
71
95
  - Tried and dropped (2026-11-01): "fix word + PR number" as an offline fix rule: +85 warnings at 22%
72
96
  useful. Don't retry it without a narrower signal (see bench/RESULTS.md).
73
97
  - Known recall limit: tracing only passes commits classified as refactors, so a big non-refactor rewrite
@@ -81,5 +105,6 @@ python -m venv .venv && .venv/Scripts/python -m pip install -e ".[dev]"
81
105
  trailing commas), renamed attributes.
82
106
  - Labels match on commit/check/path/cited commit, not line: when a rule moves a warning to another line,
83
107
  re-check its label (#40 found two that way).
84
- - Contributors: Sandro850 (#30, #38, #40, #45). Open issues: #2–#4, #6 (bench cases), #33 (guard reports).
108
+ - Contributors: Sandro850 (#30, #38, #40, #45, #58, #61, #62). Open issues: #2–#4, #6 (bench cases),
109
+ #33 (guard reports), #48–#51, #63 (speed after #62).
85
110
  - 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.1
3
+ Version: 0.7.3
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:** pre-alpha. Milestones M1 and M2 are done: `blot index` builds the history index (Flask's 3,800 commits in ~2 s), `blot install-hook` wires up git, and `blot check` runs the three checks. On Flask it traces an edit to `self_ref = weakref.ref(self)` past the 2023 file split to the 2020 fix, in under 500 ms. Replayed on the last 500 commits of Flask, requests, Express, Django and React, it warns on 0.6–9.5% of commits, and about half of its warnings (57 of 109, each labelled by hand) are worth a reviewer's time; see [bench/RESULTS.md](bench/RESULTS.md). Roadmap: [PRD](docs/PRD.md#12-milestones-4-weeks-part-time).
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 70 of its 126 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.1
197
+ - uses: Sym-jay/Blot@v0.7.3
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.1
3
+ # - uses: Sym-jay/Blot@v0.7.3
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,397 @@
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
+ ### Kept: following Black's trailing commas (#58, by @Sandro850, 2026-11-29)
191
+
192
+ The first lead, done narrowly. When the refactor hop finds no exact match, it now checks whether the
193
+ line differs only by a trailing comma on the last keyword argument of a Python call, and verifies
194
+ that the two versions of the file have equal ASTs and that the call is the same call. In Flask, the
195
+ `session=self.session` line from fix #2935 can now be followed through Black's `025589ee`.
196
+
197
+ | | Before | After |
198
+ |---|---|---|
199
+ | Precision, all five | 69/125 (55.2%) | **70/126 (55.6%)**: one new useful Flask warning, every other warning identical |
200
+ | Recall | 12/71 | 12/71: all 137 regression pairs unchanged |
201
+
202
+ Simpler versions were measured too and gave the same benchmark results, but they could blame the
203
+ wrong fix when two identical calls change or swap places in one commit (Sandro found this; the first
204
+ version of the PR had the same flaw). The kept version rejects calls whose origin is ambiguous. A
205
+ related weakness in the exact-text hop (identical lines that move) predates #58; #62 fixes it (below).
206
+
207
+ ### Kept: a stricter diff parser and corroborated refactor hops (#61, #62, by @Sandro850, 2026-12-05)
208
+
209
+ Two correctness fixes that change no measured result.
210
+
211
+ - **#61, diff parser.** Removed lines starting with `-- ` and added lines starting with `++ ` (SQL
212
+ comments, for example) were read as file headers, which shifted every later line number in the file
213
+ and could hide a `removed-fix` warning. The parser now follows the `@@` hunk counts, reads Git's output
214
+ as bytes, and splits rows only on LF.
215
+ - **#62, exact refactor hop.** The hop used to take the first removed line with the same normalized
216
+ text, so it could cite a different statement's fix when identical lines moved. It now needs the
217
+ refactor's own diff to back the match: the line was rewritten in the same hunk, or its nearest
218
+ substantive neighbours moved with it. A tie stops the trail at the refactor instead of guessing.
219
+ Among 162 historical hops judged by hand, all 32 wrong ones are gone; 3 correct hops now stop.
220
+
221
+ | | Before | After #61 and #62 |
222
+ |---|---|---|
223
+ | Precision, all five | 70/126 (55.6%) | 70/126: every warning identical, re-run independently |
224
+ | Recall | 12/71 | 12/71: every verdict identical |
225
+ | Flask `blot check` | ~123 ms | ~124 ms |
226
+
227
+ The cost is in large traces: #62 measured a Django forced check 21% slower and retained memory about
228
+ 2.5x, and our replays ran noticeably slower (not yet a controlled A/B). Tracked in #63.
229
+
230
+ ### Tried and dropped: a per-commit warning budget (2026-11-25)
231
+
232
+ Idea: show at most N warnings per commit, ranked by strength (strong defect or CVE wording first, then
233
+ a linked issue), to bring Django under 1 warning per 10 commits. Simulated on the labelled replays
234
+ (after #45), with no new runs:
235
+
236
+ | Budget | Precision | Django, warnings / 10 commits | Useful warnings hidden |
237
+ |---|---|---|---|
238
+ | none | 69/124 (55.6%) | 1.43 | 0 |
239
+ | 3 | 68/114 (59.6%) | 1.37 | 1 |
240
+ | 2 | 65/107 (60.7%) | 1.31 | 4 |
241
+ | 1 | 55/89 (61.8%) | 1.09 | 14 |
242
+
243
+ It doesn't fix the volume: 71 of the 89 commits that warn have a single warning, so Django's rate
244
+ comes from many commits warning once (a Django fix often touches an earlier fix, and 69% of those
245
+ warnings are useful). It also hides useful warnings, because the ranking can't tell them apart: at a
246
+ budget of 2, a requests commit would show two noise warnings and hide its one useful one. The
247
+ precision gain is only noise from a few huge commits being cut. Not kept. If anything, long lists
248
+ could be collapsed in the output ("+4 more") without dropping a warning.
249
+
250
+ ## Recall: real regressions (measured 2026-11-25)
251
+
252
+ Precision asks "when Blot warns, is it worth reading?". Recall asks the other half: **of the commits
253
+ that later turned out to cause a bug, how many did Blot warn on when they were committed?** This is
254
+ the first time it has been measured on real history rather than scripted cases.
255
+
256
+ **Pairs.** [`regressions.py`](regressions.py) reads each reference repo's whole history (at the
257
+ labelled heads above) for fix commits that name their culprit by sha: `This reverts commit <sha>`,
258
+ Django's `Regression in <sha>.`, "regression introduced by / caused by / broken in <sha>",
259
+ `Fixes: <sha>`, and React's `Reverts facebook/react#N` / "regression from #N" (mapped to the one
260
+ commit whose subject ends in `(#N)`). From 1,067 references:
261
+
262
+ | Dropped | Count |
263
+ |---|---|
264
+ | older than the 40 newest pairs per repo (Django and React only) | 614 |
265
+ | culprit already named by an earlier fix | 118 |
266
+ | touches no file Blot checks (tests, docs, generated) | 88 |
267
+ | sha not found, or not an ancestor of the fix | 45 |
268
+ | more than 50 files (the replay's `--max-files`) | 25 |
269
+ | culprit is itself a revert (a re-land, not a bug) | 19 |
270
+ | merge commit | 16 |
271
+ | PR number not mapped to exactly one commit | 5 |
272
+ | **kept** | **137** |
273
+
274
+ **Replay.** Each culprit is checked at its parent with only its ancestors visible, as
275
+ `blot bench --replay` does: `_ReplayStore` hides fixes that weren't ancestors, and co-change counts
276
+ come from the culprit's own ancestors. Blot's checks were not changed.
277
+
278
+ **Judgement.** Every pair was judged by hand (notes in [`regressions/`](regressions/)):
279
+
280
+ - `bug`: did the culprit really cause a bug? A revert counts only if the message, PR, changelog
281
+ or ticket says what broke. 66 of the 137 were reverted for other reasons (wrong branch, flag
282
+ rollouts, design changes, "just kidding"), mostly in requests and React. They are left out.
283
+ - `hit-on-target`: Blot warned, and on the code the later fix was about. `hit-elsewhere`: it
284
+ warned, but about something else. To help decide, each warning records `near_fix`: whether
285
+ the fix changed what the culprit wrote in that hunk.
286
+ - `miss-gap`: no warning, but the culprit changed a line from a real earlier fix, and a warning
287
+ there would have been on target. `miss-outside`: the bug is outside Blot's model (new code, or
288
+ lines that came from features).
289
+
290
+ | Repo | Pairs | Real bugs | Warned | On target | Recall, raw | Within Blot's model | Recall within model |
291
+ |---|---|---|---|---|---|---|---|
292
+ | pallets/flask | 7 | 3 | 0 | 0 | 0/3 | 1 | 0/1 |
293
+ | psf/requests | 31 | 4 | 0 | 0 | 0/4 | 2 | 0/2 |
294
+ | expressjs/express | 19 | 8 | 1 | 1 | 1/8 (12%) | 2 | 1/2 |
295
+ | django/django | 40 | 39 | 17 | 10 | 10/39 (26%) | 19 | 10/19 (53%) |
296
+ | facebook/react | 40 | 17 | 1 | 0 | 0/17 | 1 | 0/1 |
297
+ | **All** | 137 | **71** | 19 | **11** | **11/71 (15%)** | 25 | **11/25 (44%)** |
298
+
299
+ "Within Blot's model" = hits + `miss-gap`. Raw recall counts only on-target hits. Counting every
300
+ warning, 19/71 (27%) of culprits got one.
301
+
302
+ **What it means.** Blot catches regressions of one kind: a change that undoes part of an earlier,
303
+ recognisable fix. In Django, where every fix says `Fixed #N --` and regressions often rework
304
+ recent fixes, 10 of 39 regressions were flagged on the right code. Some of them:
305
+
306
+ - `0246f4788` deprecated `constant_time_compare()` and replaced its calls added by fixes #34384
307
+ and #32800. The change broke mixed-type callers (#36572, a release blocker) and was reverted.
308
+ - `7d9aab8da` moved the `_prepare_related_fields_for_save()` call from fix #29497. The fix for
309
+ #37234 moved it back.
310
+ - `821619aa8` simplified away the `hints=` plumbing from fix #13724. The regression (#37300) lost
311
+ instance hints on prefetch querysets.
312
+ - Express `2bba69f63` removed the default OPTIONS response from fix 9c87eed. Issue #1690
313
+ ("Default OPTIONS Not Functioning") followed, and the change was reverted.
314
+
315
+ Of the 8 `hit-elsewhere` warnings, 6 cite a real fix in another file or function. In the other 2,
316
+ a generic re-added line (`for field in fields:`) happened to sit in the code the fix changed, but
317
+ the cited fix had nothing to do with it.
318
+
319
+ **Why the rest were missed** (52 real-bug misses):
320
+
321
+ | Reason | Misses |
322
+ |---|---|
323
+ | outside the model: changed lines came from features or other non-fix commits | 23 |
324
+ | outside the model: the bug is in new code (pure additions, new functions or checks) | 18 |
325
+ | **classification: the culprit changed lines from a real fix that Blot didn't recognise as one** | **6** |
326
+ | outside the model: build, dependency or CI breakage (`pyproject.toml`, `package.json`, `tox.ini`) | 5 |
327
+
328
+ All 6 in-model misses are classification gaps, and each fix lacks a fix word:
329
+ requests `b149be5` "loosen URL handling for non-native URL schemes", requests `641f461` "Make sure
330
+ proxies have their scheme attached.", Express `3afbcd0` "JSON and JSONP default to UTF-8 … Closes
331
+ #632", Flask `d4076cf` "strip the ending slash for static_url_path", Django `44dd91e` "Fixed #4015
332
+ -- Changed login() and logout() …" (severity 1: "Changed"), and Django `857b104` "Fixed #34619 --
333
+ Associated FilteredSelectMultiple elements to their label". No miss was caused by tracing or the
334
+ matcher. The Black reformat `9c19aff7` stopped tracing on 5 lines, but each of those culprits was
335
+ caught through another line.
336
+
337
+ React is 0/17. Its regressions were in new code or in lines from feature commits, and most
338
+ reverts there are flag rollouts, which have no bug to catch.
339
+
340
+ Caveats: the newest 40 pairs per repo for Django and React, so fixes from 2025-08 on (Django)
341
+ and 2020-08 on (React); a single judge; reverts without a stated reason count as "not a bug", which
342
+ may undercount real regressions in requests and React.
343
+
344
+ ```bash
345
+ python bench/regressions.py collect --repo <clone> --out bench/regressions/<owner>-<repo>.json # finds pairs, keeps judgements
346
+ python bench/regressions.py run --repo <clone> --file bench/regressions/<owner>-<repo>.json # replays culprits (Django ~2.5 min)
347
+ python bench/regressions.py report bench/regressions/*.json
348
+ ```
349
+
350
+ ### `--github` on both measures (2026-11-27)
351
+
352
+ Re-run on today's code (after #45) for the four GitHub-tracked repos, with issue and PR labels
353
+ (`blot bench --replay 500 --github`, `regressions.py run --github`). Django is unchanged, since its
354
+ GitHub Issues are off.
355
+
356
+ | | Without `--github` | With `--github` |
357
+ |---|---|---|
358
+ | Precision, all five | 69/124 (55.6%) | 78/143 (54.5%): +9 useful, +10 noise |
359
+ | Real regressions warned on target | 11/71 | 12/71 |
360
+
361
+ Labels mostly *upgrade* commits (194 upgraded, 4 demoted), so they widen coverage at about the same
362
+ precision. The one regression gained is React `553440bd1`: the warning lands on the hunk the later
363
+ fix touched, citing `9d67847` "[Bugfix] Dropped updates inside a suspended tree". That fix is
364
+ plain from its subject, but without labels Blot misses it because it reads `[Bugfix]` as a project
365
+ tag like `[DevTools]`, an offline classification gap worth measuring on its own. `--github` stays an
366
+ opt-in, not a default. The 6 new replay warnings are labelled (reasons prefixed "--github replay").
367
+
368
+ ### Kept: explicit bug-fix markers (2026-11-27)
369
+
370
+ The lead above, measured on both sides. `[Bugfix] Dropped updates …` was rated a feature: the `[Tag]`
371
+ skip added for `[DevTools] upgrade …` read `[Bugfix]` as a project tag, then "Dropped" as a feature
372
+ verb. Now an explicit marker at the start (`[Bugfix]`, `[Bug fix]`, `[Bug]`, `[Hotfix]`, `[Fix]`,
373
+ `Bugfix:`, `Hotfix:`) makes a commit a fix unless it is routine (docs, tests). About 60 commits in the
374
+ five repos carry one, almost all in React; Django has none, so its results can't change and it wasn't
375
+ re-run.
376
+
377
+ | | Before | With the rule |
378
+ |---|---|---|
379
+ | Real regressions warned on target | 11/71 | **12/71 (17%)** |
380
+ | Within Blot's model | 11/25 | 12/27 (44%) |
381
+ | Precision | 69/124 (55.6%) | 69/125 (55.2%) |
382
+
383
+ Three React regressions changed. Two were "outside the model" only because their removed lines came
384
+ from `Bugfix:` commits that Blot hadn't recognised: `553440bd1` (removing blocking mode) is now
385
+ warned on target, since the bug was the removal itself and Blot flags removing code from fix #19164;
386
+ `6c4bbc783` now warns, but its revert names no bug location, so it counts as elsewhere, the convention
387
+ #53 set for such reverts. `0f1856c49` gained a second warning and stays elsewhere. The one new replay
388
+ warning is noise (an assignment chain reflowed). Precision slips by that one warning, but the rule is
389
+ narrow and the recall gain is real, so it is kept: the first rule judged on recall as well as
390
+ precision.
391
+
392
+ ## Reproduce
393
+
394
+ ```bash
395
+ git clone https://github.com/pallets/flask && cd flask && git checkout d086db856
396
+ blot bench --replay 500 --labels path/to/Blot/bench/labels/pallets-flask.json
397
+ ```
@@ -241,6 +241,36 @@
241
241
  "cited": "d2de128",
242
242
  "verdict": "noise",
243
243
  "reason": "dev dependency bump; cited commit was a deps bump"
244
+ },
245
+ {
246
+ "sha": "3bb6d96ba",
247
+ "subject": "examples: demonstrate sub directory download",
248
+ "check": "removed-fix",
249
+ "path": "examples/downloads/index.js",
250
+ "line": 13,
251
+ "cited": "e606d99",
252
+ "verdict": "noise",
253
+ "reason": "--github replay: an example page's link list changed; cited fix (Unicode filenames) untouched"
254
+ },
255
+ {
256
+ "sha": "da4d763ff",
257
+ "subject": "Improved fix for open redirect allow list bypass",
258
+ "check": "removed-fix",
259
+ "path": "lib/response.js",
260
+ "line": 908,
261
+ "cited": "a003cfa",
262
+ "verdict": "useful",
263
+ "reason": "--github replay: the improved open-redirect fix changes String(url) from fix #5554"
264
+ },
265
+ {
266
+ "sha": "0b746953c",
267
+ "subject": "Improved fix for open redirect allow list bypass",
268
+ "check": "removed-fix",
269
+ "path": "lib/response.js",
270
+ "line": 908,
271
+ "cited": "a003cfa",
272
+ "verdict": "useful",
273
+ "reason": "--github replay: the improved open-redirect fix changes String(url) from fix #5554 (same change, other branch)"
244
274
  }
245
275
  ]
246
276
  }
@@ -931,6 +931,46 @@
931
931
  "cited": "96aca5f",
932
932
  "verdict": "useful",
933
933
  "reason": "changes the ping callbacks in the stack-overflow fix #30419"
934
+ },
935
+ {
936
+ "sha": "01c4d03d8",
937
+ "subject": "[DevTools] Clear element inspection if host element not owned by any renderer is selected (#35504)",
938
+ "check": "removed-fix",
939
+ "path": "packages/react-devtools-shared/src/backend/agent.js",
940
+ "line": 941,
941
+ "cited": "f963c80",
942
+ "verdict": "noise",
943
+ "reason": "--github replay: cited commit is a feature (\"Implement best renderer\") a label promoted"
944
+ },
945
+ {
946
+ "sha": "c0060cf2a",
947
+ "subject": "[DevTools] Enable support for the React DevTools Client to connect to different host/port/path (#35886)",
948
+ "check": "removed-fix",
949
+ "path": "packages/react-devtools/app.html",
950
+ "line": 161,
951
+ "cited": "aef9303",
952
+ "verdict": "noise",
953
+ "reason": "--github replay: destructuring extended with new fields; cited commit is an upgrade"
954
+ },
955
+ {
956
+ "sha": "aac12ce59",
957
+ "subject": "[DevTools] chore: extract pure functions from fiber/renderer.js (#35924)",
958
+ "check": "removed-fix",
959
+ "path": "packages/react-devtools-shared/src/backend/fiber/renderer.js",
960
+ "line": 4535,
961
+ "cited": "24f215c",
962
+ "verdict": "noise",
963
+ "reason": "--github replay: a refactor passes a new leading argument to the fix's call"
964
+ },
965
+ {
966
+ "sha": "e730b5e65",
967
+ "subject": "[flow] Update files synced to react-native to use modern flow syntax (#36759)",
968
+ "check": "readded-bug",
969
+ "path": "packages/react-reconciler/src/ReactFiberHooks.js",
970
+ "line": 3830,
971
+ "cited": "2dddd1e",
972
+ "verdict": "noise",
973
+ "reason": "[Bugfix] marker replay: an assignment chain reflowed onto other lines, same tokens"
934
974
  }
935
975
  ]
936
976
  }