GitNexus/gitnexus/vendor/tree-sitter-kotlin
Gergő Magyar 999cc9f913
fix(deps): upgrade native tree-sitter to 0.25.1 (#3531)
* fix(deps): upgrade native tree-sitter to 0.25.1

* fix(tree-sitter): preserve sync loading and update verified capture baselines

Route C# scope queries through the synchronous native grammar loader so the compiled analyze module remains require-compatible on Node 22.18. Refresh only the audited empty-Python-module and renamed-PHP-fixture captures, and pin the runtime assertion to 0.25.1.

Validated 479 targeted tests, all 16 scope-capture benchmark cases, Python capture/import guards, compiled C# worker parsing, build, typecheck and formatting. Performance budgets are unchanged.

* fix(tree-sitter): refresh upstream vendors and preserve parser semantics

* fix(ci): refresh prebuilds and support Windows ARM

Refresh macOS, Linux ARM, and Windows x64 grammar binaries from the successful native CI builds. Pin node-gyp 12.4.0 so the Windows ARM jobs recognize Visual Studio 2026.

Use local Git filtering for E2E to avoid PR-files API timeouts on generated parser diffs.

Validation: 143 focused tests, Actionlint, and all 16 scope-capture benchmark checks passed. Full npm test run started; native database suites still running.

* fix(ci): refresh Windows ARM grammar prebuilds

Import all seven Windows ARM grammar artifacts from successful native build run 37965761760. Artifact filenames and SHA-256 hashes verified; all 42 native build jobs passed.

Validation: 31 prebuild coverage tests passed.

* fix(bench): stabilize scope capture timing guard

Warm each input size seven times and use 21 median samples while retaining isolated timing blocks. Yield between languages so native finalizers release allocations outside the measured sections. Keep all fixture sizes, fingerprints, scaling formulas, and budgets unchanged.

Validation: all 16 language guards passed with a 2 GB heap limit (1.38 deep-chain ratio; 1518 MB peak RSS). Linear and quadratic controls passed their expected guard outcomes. Formatting and graph change analysis passed. Full npm test is running without failures so far.

* fix(parser): reduce TypeScript capture traversal cost

* fix(test): await parser worker readiness before teardown

* fix(parser): load C# synchronously in workers

* fix(grpc): resolve native proto detections against their own file

With the native proto grammar active, sibling .proto files that declare
the same short service name under different packages tied in the
directory-based resolveProtoConflict heuristic and both providers were
dropped. A proto-origin detection already knows its defining file, so
use that file's entry before falling back to the heuristic.

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

* ci(packaging): assert native grammars load from the installed tarball

The packaged-install smoke only ran `gitnexus --version`, so a grammar
that failed to load from the published package (bundled runtime, patched
peer manifests, vendored prebuilds, C# sync loader, Protobuf wrapper)
would ship silently; the dev-tree ABI smoke also accepts vendored
grammars that report unavailable. Parse a sample for every registered
grammar plus the native Protobuf plugin from the installed package, on
the main thread and in a worker thread.

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

* ci(tree-sitter): track compatibility workarounds instead of 0.25 readiness

The daily readiness report still targeted tree-sitter@0.25.0, so after the
upgrade it would keep reporting "Blocked" and never close its tracking issue.
Repurpose it to track what we carry for the bundled runtime: derive the target
from the package.json pin, list each pack-time peer patch from
prepare-tree-sitter-bundle.cjs with its drop condition (bump, wait for an
upstream release, transitive, or intentionally pinned), and reword the
buckets. The workflow adopts the issue opened under the old title.

Also update the grammar-update-monitor header and auto-PR text, which still
described the 0.21.1 runtime and a tree-sitter-c hold.

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

* test(dart): assert both nested labels target the loop; fix Zig call-shape doc

The nested-label CFG test only jumped to `outer` and checked reachability,
which still passes when a jump is retargeted to the inner loop (its exit
reaches the outer header). Jump to both labels and assert the exact
`continue` edges; dropping the inner label now fails the test.

Update the Zig callable-flow comment: call_expression now wraps actuals in a
required `arguments:` field.

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

---------

Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-10 13:07:59 +03:00
..
bindings/node fix(lang-kotlin): support fun interface extraction via tree-sitter-kotlin re-vendor (#2271) 2026-06-23 10:01:28 +01:00
prebuilds fix(deps): upgrade native tree-sitter to 0.25.1 (#3531) 2026-10-10 13:07:59 +03:00
src fix(deps): upgrade native tree-sitter to 0.25.1 (#3531) 2026-10-10 13:07:59 +03:00
binding.gyp feat(install): toolchain-free tree-sitter via vendored prebuilds (#2113) 2026-06-09 18:16:24 +01:00
LICENSE feat(install): toolchain-free tree-sitter via vendored prebuilds (#2113) 2026-06-09 18:16:24 +01:00
package.json fix(deps): upgrade native tree-sitter to 0.25.1 (#3531) 2026-10-10 13:07:59 +03:00
README.md fix(lang-kotlin): support fun interface extraction via tree-sitter-kotlin re-vendor (#2271) 2026-06-23 10:01:28 +01:00

GitNexus vendor notice

This directory is a GitNexus-managed minimal runtime package derived from tree-sitter-kotlin (fwcd), pinned to the unreleased main commit c8ac3d26 (package.json version 0.4.0). It is pinned to main rather than a tagged release because the latest release, 0.3.8 (tagged 2024-08-03), predates fun interface (functional/SAM interface) support: it parsed fun interface Foo as an ERROR node and dropped the declaration. That fix landed in PR #169 (closing issue #87), merged into main 2025-04-25 but not yet in any npm release.

It carries bindings/node/, LICENSE, the native prebuilds/, and the full C source — src/parser.c, src/scanner.c, src/node-types.json, src/tree_sitter/, and binding.gyp. The source IS vendored (despite the ~33 MB generated parser.c) for two reasons: it lets build-tree-sitter-grammars.cjs source-build the binding on a toolchain host when no prebuild matches, and — because the pinned commit is unreleased on npm — it is the source the prebuild workflow itself compiles from (see below).

Why this is vendored (unlike the npm grammars)

Upstream tree-sitter-kotlin ships source only — its npm tarball has no prebuilds/ — so a plain npm install compiles the native binding from source and requires a C/C++ toolchain (python3/make/g++). To make Kotlin parsing toolchain-free on every host (Swift parity), GitNexus builds the platform prebuilds itself and vendors them here. node-gyp-build selects the correct binary at require time; build-tree-sitter-grammars.cjs activates the binding (prefer prebuild, else source-build) at install time.

tree-sitter-swift is handled the same way: its source is vendored and its prebuilds are GitNexus-cross-built from that vendored source. Kotlin now uses this exact path too (workflow registry kind: 'vendored', switched from 'npm' when this pin moved to an unreleased commit), so all of Dart/Proto/Swift/Kotlin go through one uniform kind: 'vendored' build.

Updating this vendor package

  1. Bump the pin: update version in package.json (this is the value the build-tree-sitter-prebuilds workflow diffs to decide whether to rebuild) and refresh _vendoredBy with the new ref.
  2. Refresh bindings/node/*, src/parser.c, src/scanner.c, src/node-types.json, src/tree_sitter/*, and binding.gyp from the new upstream ref (a release tag, or — as now — a pinned main commit). For a pinned commit the generated parser.c is committed upstream, so copy it directly; if you re-pin to a ref that does not commit parser.c, regenerate it with tree-sitter generate first.
  3. Regenerate the six native prebuilds by running the build-tree-sitter-prebuilds GitHub Actions workflow (it builds {linux,darwin,win32}-{x64,arm64} from this vendored source and opens a PR committing them under prebuilds/). While kind: 'vendored', the workflow does NOT touch npm for kotlin.
  4. Verify the packed GitNexus tarball can require('tree-sitter-kotlin') and parse a Kotlin snippet (including a fun interface) on each target platform-arch (the workflow's validate step does this in CI).

Note: darwin-x64 prebuilds depend on GitHub's macos-15-intel image, whose x86_64 macOS runners sunset ~Aug 2027. After that, darwin-x64 needs cross-compilation or dropping.