Repository navigation
Description
Summary
GitGalaxy's python language block deliberately routes .pyx/.pxd/.pxi (Cython) files under
the python extension set (LANGUAGE_DEFINITIONS["python"]["extensions"] -- "comprehensive
surface area... Cython"), but func_start's regex only ever matched the literal def keyword.
Cython's cdef/cpdef module-level function definitions (cdef int _allocate_buffer(array self) except -1:) have no def keyword at all, so they were a complete recall gap.
Evidence
Found via the tri-comparison-ledger-sweep on python/function/existence/agree[ctags]_vs[gitgalaxy,tree_sitter]
(68 occurrences, docs/self_scan/tri_comparison_ledger.json). Direct gather_language("python")
name-diff confirmed the full scope: language-crucible/data/python/cython/MemoryView.pyx (52
missing) and .../MemoryView.pxd (16 missing) -- 100% of GitGalaxy's misses on this shape, ctags-
corroborated, 0 found by GitGalaxy or tree-sitter (tree-sitter-python has no concept of Cython's
cdef class/cdef function syntax either -- a separate, already-documented limitation, see Claim
2 in docs/why_gitgalaxy_beats_ast_here.md).
Fix (shipped in the same PR)
gitgalaxy/standards/language_standards.py's python func_start regex gained a second
alternative matching cdef/cpdef function signatures, excluding cdef class/struct/enum/
union/extern/packed/fused (declarations, not functions -- class_start already owns cdef class). Tolerates up to 2 return-type words plus an optional pointer star before the name (cdef char *pybuffer_index(...)), bounded-repetition throughout (no ReDoS risk).
Verified: new extraction-gauntlet cases in tests/extraction/languages/test_python.py (valid/
invalid/pathological + a dedicated ReDoS sweep), crucible_check.py against the full ~80-repo
corpus (31 diffs, all scoped to python/cython, both golden masters re-blessed), ruff/mypy audits
clean.
Known residual gap (not fixed, out of scope)
One function, get_slice_from_memview in MemoryView.pyx, still isn't found: its return type is
a Cython/Tempita code-generation template placeholder (cdef {{memviewslice_name}} *get_slice_from_memview(...)), not standard Cython syntax. Left undone given its narrow scope (1
occurrence, a codegen-template artifact rather than real end-user Cython source).
Activity
Validate python tri-comparison ledger; fix Cython func_start recall g…
squid-protocol commentedon Aug 21, 2026
Follow-up (2026-08-21): the documented residual gap (
get_slice_from_memview) is now closed too.That function's return type is a Cython Tempita codegen placeholder (
cdef {{memviewslice_name}} *get_slice_from_memview(...)). Closing it took two fixes, not one:func_start's return-type token to also accept a bounded{{identifier}}placeholderform (in addition to a plain identifier).
_extract_namename-normalizer (detector.py), used by every language, not just python. Itsgeneric
split("{")truncation step (meant to cut a C-style body-opening brace off the rawmatch) mistook the placeholder's own
{{/}}for that brace, truncating the match down tothe bogus name
"cdef"instead of the realget_slice_from_memview. Confirmed via the realscan pipeline (not just the isolated regex) -- the DB was recording a phantom function literally
named
cdefat that line before this second fix.GitGalaxy now finds all 84 real functions in
cython/MemoryView.pyx(100% recall vs. ctags, upfrom 83/84). Verified against the full ~80-repo crucible corpus a second time (diffs scoped only
to
python/cython, both golden masters re-blessed again) and new test coverage added to bothtests/extraction/languages/test_python.py(func_start regex) andtests/core_engine/test_detector.py(_extract_name, since that fix is shared infrastructure).python/function/existence/agree[ctags]_vs[gitgalaxy,tree_sitter]no longer reproduces at all.Close the last python Cython func_start recall gap (get_slice_from_me…
fix(python): recognize cdef/cpdef return-type functions in args count…