GitNexus/gitnexus/test
vijaygali aa7c273093
fix(ingestion): index Python repos with empty __init__.py and >32 KB files (#1163)
* fix(ingestion): index Python repos with empty __init__.py and >32 KB files

Two defensive fixes that let `gitnexus analyze` complete on Python
codebases that previously failed.

scope-extractor: synthesize an empty Module scope when the provider
emits zero captures. Previously threw "no Module scope found", which
fired for any 0-byte `__init__.py` package marker if the bridge's
empty-source guard was bypassed.

python/captures: wrap the parser.parse() and getPythonScopeQuery()
.matches() calls in try/catch. node-tree-sitter throws "Invalid
argument" for sources that overrun internal buffers (observed at the
~32 KB threshold on Windows). Degrade gracefully with a clear
"skipping scope extraction for this file" warning instead of the
opaque "Invalid argument" surfacing through the bridge.

Verified by indexing whittlem/pycryptobot (which has 7 empty
__init__.py and 11 Python files between 34 KB and 158 KB):
2,367 nodes / 4,973 edges, no segfault, queries resolve symbols
inside the 158 KB controllers/PyCryptoBot.py.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(ingestion): harden Python scope extraction fallbacks

Keep failed Python scope extraction on the bridge skip path and build synthetic module scopes before extractor indexes are derived.

Made-with: Cursor

---------

Co-authored-by: Vijay Gali <vgali@vexcelco.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Gergo Magyar <gergomagyar@icloud.com>
2026-04-30 19:24:04 +01:00
..
fixtures fix(typescript): anchor pair-with-arrow @declaration.function on inner arrow 2026-04-30 18:26:51 +03:00
helpers fix(deps): upgrade @ladybugdb/core to 0.16.0 to resolve native segfaults (#1235) 2026-04-30 17:40:39 +01:00
integration fix(hook): resolve canonical repo root + guard read-only FTS ensure (#1226) 2026-04-30 18:12:03 +01:00
unit fix(ingestion): index Python repos with empty __init__.py and >32 KB files (#1163) 2026-04-30 19:24:04 +01:00
utils ci: add macOS to cross-platform test matrix (#208) 2026-03-07 10:38:32 +00:00