feat(ingestion): add Solidity language support#2443
Conversation
Vendor tree-sitter-solidity and wire CLI/shared detection, extractors, and scope resolution for contracts, modifiers, using-for, Foundry remappings, emit/revert, and this/super binding. Include fixtures/tests, web WASM grammar registration, and a Linux Docker FTS smoke script with an overrideable corpus-agnostic query. Closes abhigyanpatwari#531 Co-authored-by: Cursor <cursoragent@cursor.com>
Add Unreleased changelog entries and a Solidity row in the README supported-languages table for abhigyanpatwari#531. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@JaCoderX is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
|
Did a focused local pass on this because the hosted checks have not run beyond labeler/Vercel yet. Environment: macOS arm64, Node v25.6.1, npm 11.9.0. Results:
One small coverage suggestion: the PR body and implementation mention |
- Introduced new Solidity files for handling foundry.toml remappings, including `App.sol` and `Helper.sol`. - Implemented tests to validate the resolution of imports and function calls through foundry.toml remappings in `solidity.test.ts`. - Added unit tests for loading remappings from foundry.toml and ensuring correct behavior with remappings.txt in `solidity-remappings-loader.test.ts`. This update enhances the integration of Solidity remapping features, improving the overall functionality and testing coverage.
|
Thanks @koriyoshi2041 for reviewing and the feedback. Agreed on the gap: foundry.toml remappings were implemented (regex/minimal parser; foundry.toml then remappings.txt override) but only remappings.txt was fixture-covered. Pushed a follow-up that locks the advertised path:
The gitnexus-shared → gitnexus install order you hit is the existing monorepo setup caveat; unrelated to this change. |
Summary
Adds first-class Solidity (
.sol) support via a vendoredtree-sitter-solidity@1.1.0grammar (ABI 13 / optional, same pattern as Dart/Kotlin/Swift), with LanguageProvider wiring, extractors, scope resolution for Foundry-style projects, fixtures/tests, web WASM registration, and docs/CHANGELOG.Motivation / context
Closes #531. Smart-contract repos were previously unindexed (no DEFINES/CALLS from
.sol), so MCPquery/context/impactcould not answer from contracts. This lands Phase 1–3-quality Solidity ingestion so Foundry/Hardhat-style trees produce a usable graph.Areas touched
gitnexus/(CLI / core / MCP server)gitnexus-web/(Vite / React UI).github/(workflows, actions)eval/or other toolingAGENTS.md,CLAUDE.md,.cursor/,llms.txt, etc.)Also:
gitnexus-shared/(language enum / detection / classification), rootREADME.md+CHANGELOG.md,gitnexus/CHANGELOG.md.Scope & constraints
In scope
tree-sitter-solidity@1.1.0undergitnexus/vendor/(pinned fortree-sitter@0.21.1ABI; optional viaGITNEXUS_SKIP_OPTIONAL_GRAMMARS=1)remappings.txt/foundry.toml)using for, emit/revert edges,this/superreceiver binding, Foundry noise filter (vm/msg/abi)test/fixtures/lang-resolution/solidity-*tree-sitter-solidity.wasm(indexing remains server-side viagitnexus serve)gitnexus/scripts/docker-fts-validate.sh(GITNEXUS_FTS_QUERY, defaultcontract)Explicitly out of scope / not done here
--pdgtaintdelegatecall, and full dynamic-dispatch fidelityImplementation notes
vendor/, do not bump totree-sitter-solidity1.2.x (ABI 15) without a runtime upgrade.pickImplicitThisOverloadwhen free-call fallback is ambiguous.gitnexus serve(native grammars), not browser WASM parse.Testing & verification
cd gitnexus && npm test(Solidity unit + integration fixtures during development)cd gitnexus && npm run test:integration(if distinct fromnpm testin this repo — run before merge if CI doesn’t)cd gitnexus && npx tsc --noEmit(during development)cd gitnexus-web && npm test(WASM / upload-filter / solidity-syntax tests added)cd gitnexus-web && npx tsc -b --noEmitAdditional verification
lib/for imports): ~13.6k nodes / ~35k edges; modifier → OZnonReentrant, library CALLS, remapping IMPORTS, METHOD_OVERRIDES present; hybrid FTS OK under Linux Docker.gitnexus/scripts/docker-fts-validate.sh(overrideGITNEXUS_FTS_QUERYas needed).Risk & rollout
GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1(Solidity skipped with other optional grammars).npx gitnexus analyze(or--force) on Solidity repos to populate the new graph.Checklist
AGENTS.md/ overlays changed: headers, scope block, and changelog updated per project conventions (N/A — not changed)