Scripts: pr_check refuses Code Llama, Codestral, QwQ and the like #1137

Manually merged
github merged 1 commit from gh-pr/1137/head into gh-pr/1137/base 2026-11-26 04:44:44 +00:00
Owner

@⁠emirduran707 on GitHub · 2026-11-24 12:22 UTC · original
emirduran707:pr-check-model-names → main · +23 −1 · 2 files · 1 commits · merged 2026-11-24 15:50 UTC

CONTRIBUTING.md refuses PRs written with small and open-weight models, and pr_check.py enforces this by matching model names in the AI use section. The pattern \b(qwen|deepseek|llama|mistral|mixtral|gemma|phi-?\d) misses common names in these families:

  • CodeLlama, TinyLlama and CodeQwen: no word boundary before llama or qwen.
  • QwQ.
  • Mistral's Codestral, Devstral, Magistral, Ministral and Pixtral.
  • Phi 4, written with a space.

The PR that names one of these models passes the check.

What is in it

  • scripts/pr_check.py: BANNED_MODELS also matches a prefix before qwen and llama, plus qwq, the *stral names and phi followed by a space and a digit.
  • scripts/test_pr_check.py: BannedModelTests.
    • Nine family names are each refused.
    • Frontier model names and ordinary words pass: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6, Gemini 4, Codex, "Phil 2 checked the alphabet and graph 3".

This PR does not touch where the text is read from. #835 changes that, and the two PRs touch different lines.

Tested

  • Windows 11 Pro 26300, Python 3: python -m unittest discover -s scripts -p "test_*.py": OK, with the 11 subtests of BannedModelTests included.
  • Without the change to pr_check.py, 9 of these subtests fail: all nine family names pass the check.
  • More strings run against the pattern:
    • Matched: Llama 3, phi-4, Phi 4, QwQ-32B.
    • Not matched: Australia, graphite, philosophy, sophisticated 3D, alpha 2, GPT-5 and Gemini 3.
  • No runtime change, so no smoke run.

Not tested

  • The PR checks workflow on GitHub itself; it runs this file from main once the PR is merged.

AI use

  • Claude Code with Claude Opus 5.5: wrote the change, the tests and this description; I checked the pattern against the strings above.

🤖 Generated with Claude Code

**@⁠emirduran707** on GitHub · 2026-11-24 12:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/1137) `emirduran707:pr-check-model-names` → `main` · +23 −1 · 2 files · 1 commits · merged 2026-11-24 15:50 UTC CONTRIBUTING.md refuses PRs written with small and open-weight models, and `pr_check.py` enforces this by matching model names in the AI use section. The pattern `\b(qwen|deepseek|llama|mistral|mixtral|gemma|phi-?\d)` misses common names in these families: - `CodeLlama`, `TinyLlama` and `CodeQwen`: no word boundary before `llama` or `qwen`. - `QwQ`. - Mistral's `Codestral`, `Devstral`, `Magistral`, `Ministral` and `Pixtral`. - `Phi 4`, written with a space. The PR that names one of these models passes the check. **What is in it** - `scripts/pr_check.py`: `BANNED_MODELS` also matches a prefix before `qwen` and `llama`, plus `qwq`, the `*stral` names and `phi` followed by a space and a digit. - `scripts/test_pr_check.py`: `BannedModelTests`. - Nine family names are each refused. - Frontier model names and ordinary words pass: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6, Gemini 4, Codex, "Phil 2 checked the alphabet and graph 3". This PR does not touch where the text is read from. #835 changes that, and the two PRs touch different lines. **Tested** - Windows 11 Pro 26300, Python 3: `python -m unittest discover -s scripts -p "test_*.py"`: OK, with the 11 subtests of `BannedModelTests` included. - Without the change to `pr_check.py`, 9 of these subtests fail: all nine family names pass the check. - More strings run against the pattern: - Matched: `Llama 3`, `phi-4`, `Phi 4`, `QwQ-32B`. - Not matched: `Australia`, `graphite`, `philosophy`, `sophisticated 3D`, `alpha 2`, `GPT-5 and Gemini 3`. - No runtime change, so no smoke run. **Not tested** - The `PR checks` workflow on GitHub itself; it runs this file from main once the PR is merged. **AI use** - Claude Code with Claude Opus 5.5: wrote the change, the tests and this description; I checked the pattern against the strings above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
CONTRIBUTING.md closes PRs written with Qwen, DeepSeek, Llama, Mistral,
Gemma, Phi and their distills, but the AI use pattern let their family
names through: "CodeLlama" and "TinyLlama" have no word boundary before
"llama", Mistral's Codestral / Devstral / Magistral / Ministral /
Pixtral and Qwen's QwQ / CodeQwen were not listed, and "Phi 4" has a
space where the pattern allowed only a hyphen.

"llama" and "qwen" now match at the end of a word, the Mistral and Qwen
family names are listed, and Phi takes a hyphen, a space or nothing
before its version. The word boundary stays at the start, so "Phil",
"alphabet" and frontier names (Claude, GPT, Gemini, Codex) still pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:44:42 +00:00
github manually merged commit 38283a8530 into gh-pr/1137/base 2026-11-26 04:44:44 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 12:52 UTC · original

Independent verification on current main 384f7f7 (branch already contains it — clean).

Machine: Windows 11, Ryzen 9 7900X; Python 3.

  • python scripts/test_pr_check.py: 11 tests OK — the banned-model regex now also covers Code Llama, Codestral, QwQ and similar, with tests for each.

AI use: test runs by Devin (Cognition, SWE-2); no code changes.

**@⁠DavidM1911** on GitHub · 2026-11-24 12:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/1137#issuecomment-7132033209) Independent verification on current `main` `384f7f7` (branch already contains it — clean). **Machine:** Windows 11, Ryzen 9 7900X; Python 3. - `python scripts/test_pr_check.py`: **11 tests OK** — the banned-model regex now also covers Code Llama, Codestral, QwQ and similar, with tests for each. AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 14:15 UTC · original

Tested exact head 38283a8, script tests only, since this PR has no test report yet.

Tested

  • Windows 11 Home 26300, Python 3.14.3 with pytest 9.0.3, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 here).
  • python -m pytest scripts/test_pr_check.py at the head: 11 passed, 23 subtests passed.
  • The PR's test file(s) against current main's script (930e8b4): 9 subtests of test_family_names_of_small_and_open_weight_models_are_refused fail (e.g. CodeLlama 34B, Codestral 22B, QwQ-32B, Phi 4). So the new test catches the problem the PR fixes.

Not tested

  • PowerShell 7, the CI workflow itself, a game (no runtime code changed).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 14:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1137#issuecomment-7134096077) Tested exact head `38283a8`, script tests only, since this PR has no test report yet. **Tested** - Windows 11 Home 26300, Python 3.14.3 with pytest 9.0.3, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 here). - `python -m pytest scripts/test_pr_check.py` at the head: 11 passed, 23 subtests passed. - The PR's test file(s) against current main's script (`930e8b4`): 9 subtests of `test_family_names_of_small_and_open_weight_models_are_refused` fail (e.g. `CodeLlama 34B`, `Codestral 22B`, `QwQ-32B`, `Phi 4`). So the new test catches the problem the PR fixes. **Not tested** - PowerShell 7, the CI workflow itself, a game (no runtime code changed). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
This discussion has been locked. Commenting is limited to contributors.
No description provided.