fix: allow Windows Node 26 installs when Kotlin native parser cannot build - #325
fix: allow Windows Node 26 installs when Kotlin native parser cannot build#325nikhiltokas wants to merge 1 commit into
Conversation
🌱 graft blast radius1 area changed → 6 areas can be affected. 18 dependent symbols, depth 2. flowchart TB
A0(("Workspace Graph Freshness<br/>6 symbols"))
A1(("Pull Request Review<br/>4 symbols"))
A2(("MCP Tool Invocation<br/>3 symbols"))
A3(("Graph CLI Entry<br/>3 symbols"))
A4(("Viewer Build Script<br/>1 symbol"))
AX(("1 smaller area<br/>1 symbol"))
classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
class A0,A1,A2,A3,A4 reached;
classDef tail fill:#EEF2F3,stroke:#9AA4A9,stroke-width:1px,color:#3A4247;
class AX tail;
Who knows this code — 3 people across 7 areas
Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no All 18 dependent symbols, grouped by areaWorkspace Graph Freshness — 6 symbols in 4 files
Pull Request Review — 4 symbols in 4 files
MCP Tool Invocation — 3 symbols in 1 file
Graph CLI Entry — 3 symbols in 2 files
Viewer Build Script — 1 symbol in 1 file
Synchronous Execution — 1 symbol in 1 file
Test signal per changed area — 1 ✓Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.
35 test suites also reference this code46 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.
Open the interactive graph → — click an area to see its dependent symbols at file:line. |
… depth language (trailhq#337 trailhq#217 trailhq#214 trailhq#325) Four PRs were rewriting the same code path in extract.ts — one function now does what they each asked for: - Lazy loading (trailhq#217): a grammar (and the core tree-sitter binding itself) is required at most once, the first time entryFor()/depthExtensions() is asked about that language, not for all nine at module-import time. `graft mcp` never asks before the client's `initialize` reply, so a client can no longer see that handshake stall behind nine native loads. - Per-language isolation (trailhq#337, unchanged): a grammar that will not load costs its own language, not the CLI. - WASM fallback for every depth language, not just Kotlin/Java (trailhq#214): the breadth tier already had a "FALLBACK row" mechanism (a GENERIC_LANGS row reachable only when the matching depth grammar failed); tree-sitter-wasm ships a .wasm for all nine depth languages already, so the remaining seven now have one too. None has a queries/<name>.scm, so on the rare machine that actually reaches one it degrades to the node-kind walker (symbols only) instead of leaving the language unindexed. - optionalDependencies (trailhq#325's core ask): the eight native grammar packages moved out of dependencies, so a platform lacking a prebuild for one no longer fails `npm install` for the other eight (core tree-sitter stays required — a missing core is a bigger question than one language, left for a follow-up). New test: `graft mcp` answers `initialize` with tree-sitter-typescript broken and never touches grammar loading at all (no warning on stderr) — the concrete claim trailhq#217 exists for. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
Fixes Windows installs on Node 26 when
tree-sitter-kotlincannot compile its native addon.tree-sitter-kotlintooptionalDependencies.ktor.ktsfiles are encounteredProblem
On Windows 10 with Node
v26.8.1, npm11.6.0, Visual Studio 2022 Build Tools, and Python3.14.4, installing Graft failed becausetree-sitter-kotlin@0.3.8fell back to native compilation:tree-sitter-kotlin@0.3.8is the latest published release and its package contains no Windows prebuilt binaries, so there is no compatible dependency upgrade available.This change does not remove Kotlin support: npm still installs the parser automatically whenever it can. It only allows Graft itself to install and index non-Kotlin repositories when that optional native addon cannot build.
Validation
Tested on Windows with Node
v26.8.1:Also installed the packed tarball into a clean temporary consumer project and verified:
The new Windows Node 26 CI job runs:
and installs the packed artifact in a clean consumer project.