Repository navigation
Description
What is wrong
The Python regex_execution rule (arch_regex) only matches six module-level calls: re.compile|re.search|re.match|re.sub|re.findall|re.split. A function that runs a pattern it did not compile itself, or calls a method on a compiled pattern, scores 0. Against Python's ast, recall is 0.53 and precision 1.00 over 72,044 functions: it never over-counts, it misses half. Missed in the engine's own code (functions): finditer 5,153, fullmatch 3,390, match 3,186, search 2,777, findall 1,873.
Reproduce
import re
PAT = re.compile("a+")
def uses_module_pattern(s):
return [m.group(0) for m in PAT.finditer(s)]
def uses_fullmatch(s):
return PAT.fullmatch(s)Both functions scan with arch_regex == 0.
Expected
arch_regex > 0 where the function executes a regular expression. Candidate additions: the re. forms finditer, fullmatch, subn, and method calls .finditer( .fullmatch( .match( .search( .findall( .subn( on a name. The method names collide with non-regex objects (str has none of them, but other classes do), so decide the precision/recall trade deliberately and report precision on the engine's own code.
Notes
Check the other languages' regex-execution rules for the same shape (module call list, no method-on-object form).
How this was found
A pilot that compares each function_data signal with what Python's own ast says the function does (72,044 functions of GitGalaxy's own code; see the pilot note, with corrections and one-function-per-case reproductions in temporal-crucible PR #188). This is part of the keyword-family validity epic (linked below once filed).
Rules for the fix
- Any change to a keyword list adds or removes regex work, so time it: CPU seconds on keyword-rosetta and language-crucible before and after, and say the number in the PR.
- If keyword-rosetta counts move, label the PR
rosetta:rebless-owedand rebless as usual. - Add the case below as a test (one function per case, so a regression names itself).
Activity
squid-protocol commentedon Nov 21, 2026
Part of #8863 (keyword-family validity epic).
squid-protocol commentedon Nov 21, 2026
Claimed by promoter-bot host
melek, lease renewed 2026-11-22T16:11Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove theclaim:meleklabel.squid-protocol commentedon Nov 21, 2026
Churn run
8858-20261121T1656Z(host melek) ended without a PR. plan-held: python.py overlaps worker 8859, PRs #8902/#8914; requeued after those PRsPython regex_execution: count finditer/fullmatch/subn and methods on …