feat(kernel): R5 — Python and Go ports, gates passed, default-on

Python (codegraph-kernel/src/python.rs) and Go (src/go.rs) join the
native kernel, mirroring the wasm extractors bug-for-bug. Python:
decorated_definition docstrings/decorators (decorates refs only for
bare-identifier decorators — the call-kind quirk), function-in-class →
method, module-level assignments always extract as variable, from-import
per-name binding refs, self.x fn-ref candidates as bare names. Go:
receiver methods with Recv::name qualified names + contains edges to the
first earlier struct of that name, type_spec struct/interface
classification with embedding→extends and interface method nodes,
composite-literal instantiates keeping the package qualifier, top-level
var/const initializer walks attributed to the declared symbol (#693),
2-hop field chains (#1276), New().Method() re-encode (#645/#608), and
the GO_SPEC fn-ref layers.

Grammars: tree-sitter-python 0.23.6 + tree-sitter-go 0.23.4 crates, with
wasm vendored from the same tags (parser.c sha-matched) — both were
2023-era in tree-sitter-wasms.

Gates: extraction sweeps 100% (flask 83/83, django 3,035/3,038 +3
error-file deferrals, gin 99/99, prometheus 978/979 +1); full-init
dump-diffs byte-identical on flask (10,833 rows), gin (17,540), django
(360,794), and prometheus (213,758); torture fixtures enforced in npm
test. DEFAULT_ROUTED now covers typescript/tsx/javascript/jsx/java/
python/go. Full suite: 2,471 tests pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Colby McHenry
2026-07-16 23:50:02 -05:00
co-authored by Claude Fable 5
parent 28068fa0f1
commit c2503e2bee
18 changed files with 2393 additions and 14 deletions
+3 -1
View File
@@ -280,6 +280,8 @@ export async function initGrammars(): Promise<void> {
* - tree-sitter/tree-sitter-typescript v0.23.2 (f975a62) → typescript + tsx
* - tree-sitter/tree-sitter-javascript v0.25.0 (44c892e) → javascript + jsx
* - tree-sitter/tree-sitter-java v0.23.5 (94703d5) → java
* - tree-sitter/tree-sitter-python v0.23.6 (bffb65a) → python
* - tree-sitter/tree-sitter-go v0.23.4 (3c3775f) → go
* Built from each repo's CHECKED-IN parser.c (no `generate`) with
* tree-sitter-cli 0.25.10 `build --wasm` — the same tables crates.io compiles
* (parser.c sha-matched against the crates.io tarball).
@@ -289,7 +291,7 @@ export async function initGrammars(): Promise<void> {
const VENDORED_WASM_LANGS: ReadonlySet<GrammarLanguage> = new Set([
'pascal', 'scala', 'lua', 'luau', 'csharp', 'r', 'cfml', 'cfscript', 'cfquery',
'cobol', 'vbnet', 'erlang', 'terraform', 'arkts', 'nix',
'typescript', 'tsx', 'javascript', 'jsx', 'java',
'typescript', 'tsx', 'javascript', 'jsx', 'java', 'python', 'go',
]);
/** Absolute path of a language's grammar WASM (vendored or tree-sitter-wasms). */
+2
View File
@@ -39,6 +39,8 @@ const DEFAULT_ROUTED: ReadonlySet<Language> = new Set<Language>([
'javascript',
'jsx',
'java',
'python',
'go',
]);
/**
Binary file not shown.
Binary file not shown.