Commit graph

275 commits

Author SHA1 Message Date
abhigyantrumio
3ea8e9e88a fix(ingestion): align CALLS edge sourceId with node ID format
findEnclosingFunctionId generated IDs without :startLine suffix,
but node creation includes it. This caused every CALLS edge to
reference a non-existent source node, making the process detector
find 0 entry points and produce 0 execution flows.

Bumps to 1.3.9.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 13:55:42 +05:30
Abhigyan Patwari
821871cec1
chore: bump version to 1.3.8 (#193)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 13:23:01 +05:30
Abhigyan Patwari
f9a54cd588
fix(cli): force-exit after analyze to prevent KuzuDB hang (#192)
KuzuDB's native module holds open handles that prevent Node.js from
exiting cleanly. Previously only force-exited when embeddings were used
(for ONNX Runtime segfault workaround), but the same issue affects all
analyze runs. Now always calls process.exit(0) after completion.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 13:17:41 +05:30
Abhigyan Patwari
8c6b064d18
chore: bump version to 1.3.7 (#191)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 12:58:35 +05:30
Abhigyan Patwari
84ef6524bc
feat(ai-context): replace skill router with inline imperative instructions (#190)
CLAUDE.md and AGENTS.md now contain direct enforcement instructions instead
of a passive skill router table. Based on Vercel eval data showing skills
are skipped 56% of the time, and industry research on effective AGENTS.md
patterns from 2,500+ repos.

Key changes:
- Always/When/Never three-tier boundary structure
- RFC 2119 language (MUST, NEVER) for critical rules
- Exact tool commands with parameters inline
- Self-check checklist forcing model to verify its own work
- ~77 lines, well within the <150 line adherence threshold

Skills are still installed as bonus depth for Claude Code's skill system.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 12:47:23 +05:30
abhigyanpatwari
5674b2201d feat: merge Laravel route detection (PR #133), revert unwanted doc changes
Merged PR #133 which adds AST-based Laravel Route::* extraction.
Reverted AGENTS.md, CLAUDE.md, and README.md to preserve current config,
crypto warning, Discord link, and correct language support count (12,
including Kotlin/Swift).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 00:20:27 +05:30
abhigyanpatwari
6915a9350b Merge branch 'pr-133' 2026-03-03 00:19:44 +05:30
abhigyanpatwari
8e7d976c2a fix: gracefully skip files when language parser is unavailable (#136)
Instead of crashing the pipeline when a native tree-sitter binding
(e.g. tree-sitter-swift) fails to build, skip those files early and
warn the user with an actionable message.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 09:23:05 +05:30
Güneş Bizim
46b4b7e157 Merge origin/main — add Kotlin/Swift support, resolve conflicts
- Resolved FUNCTION_NODE_TYPES: keep 'anonymous_function' for PHP (php_only grammar),
  add Kotlin 'lambda_literal' and Swift 'init_declaration'/'deinit_declaration'
- Resolved pipeline.ts: adopt chunked pipeline structure, integrate
  processRoutesFromExtracted into per-chunk worker data processing
- Resolved framework-detection.ts: use upstream AST-BASED FRAMEWORK DETECTION heading
- Fixed accumulated/mergeResult in parse-worker to include routes field
2026-03-01 22:33:23 +03:00
abhigyanpatwari
cbeb0e231a docs: add Kotlin to supported languages in README
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 23:23:04 +05:30
abhigyanpatwari
3431edcea0 fix(test): update ingestion-utils test for Kotlin support
Move .kt from unsupported list to supported, add Kotlin test case
for .kt and .kts extensions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 23:18:21 +05:30
abhigyanpatwari
40cb863cb4 chore: update package-lock.json with tree-sitter-kotlin
The Kotlin PR added tree-sitter-kotlin to package.json but didn't
include the lockfile update, causing npm ci to fail in CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 23:14:36 +05:30
abhigyanpatwari
ee95808478 Merge pull request #84 from magyargergo/feat/kotlin-language-support
feat: add Kotlin language support
2026-03-01 23:11:25 +05:30
abhigyanpatwari
3e3ea86ce4 Merge origin/main into feat/kotlin-language-support 2026-03-01 23:10:52 +05:30
abhigyanpatwari
1a52d05131 fix(test): use dangerouslyIgnoreUnhandledErrors instead of forceExit
forceExit killed the fork worker before local-backend.test.ts finished,
losing 12 test results. The real issue is KuzuDB's C++ destructor
segfaulting during fork process exit — all tests pass but vitest
reports the post-test crash as a failure.

dangerouslyIgnoreUnhandledErrors ignores the process-level crash
without affecting test results (98/98 tests still run and report).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 22:36:38 +05:30
abhigyanpatwari
3d64e26f8f fix(test): add forceExit to prevent KuzuDB native cleanup hang in CI
KuzuDB's C++ destructor crashes the vitest fork worker on exit,
causing a ~7 minute hang before timeout. forceExit kills the
worker immediately after tests complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 20:33:18 +05:30
abhigyanpatwari
3576802574 fix(test): use HEAD~1 instead of root commit in staleness test
GitHub Actions shallow clones don't have the root commit available,
causing checkStaleness to fail silently. HEAD~1 is always available.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 20:23:06 +05:30
abhigyanpatwari
20ebd6b781 feat: security hardening, MCP improvements, skills, hooks, and CLI updates
- Export security primitives (CYPHER_WRITE_RE, isWriteQuery, isTestFilePath,
  VALID_NODE_LABELS, VALID_RELATION_TYPES) from local-backend
- Improve MCP kuzu-adapter with better query handling
- Add PR review skill for Claude, Cursor, and npm package
- Add CLI guide and CLI skills
- Update hooks for Claude plugin and Cursor integration
- Remove deprecated claude-hooks.ts CLI module
- Update eval-server, setup, and analyze CLI commands
- Improve CSV generator and ingestion processors
- Update CLAUDE.md and AGENTS.md configs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 20:13:42 +05:30
abhigyanpatwari
8a100a76d3 test: add test suite with vitest (unit + integration + fixtures)
- 59 test files covering unit and integration tests
- vitest config with coverage thresholds and fork pooling
- Test fixtures (mini-repo + multi-language sample code)
- Add vitest + coverage-v8 to devDependencies
- Add test scripts (test, test:integration, test:all, test:watch, test:coverage)
- Move typescript to devDependencies where it belongs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 20:07:02 +05:30
abhigyanpatwari
c129e71ee7 ci: harden publish pipeline with CI gate, version check, and provenance
- Add workflow_call trigger to ci.yml so publish can reuse it as a gate
- Replace minimal publish.yml with hardened pipeline:
  - Full CI must pass before publish (typecheck + tests + cross-platform)
  - Verify git tag matches package.json version
  - Explicit build step + dry-run before real publish
  - npm provenance attestation enabled
  - Auto-create GitHub Release with generated notes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 20:02:10 +05:30
Abhigyan Patwari
80eff73459
Add notice about GitNexus cryptocurrency claims
Added important notice regarding cryptocurrency affiliations.
2026-03-01 11:29:00 +05:30
Gary Magyar
48c8e6fe57 chore: merge upstream main (swift optional deps) and reorder kotlin entries
Merge origin/main which moves tree-sitter-swift to optionalDependencies
with conditional imports. Reorder Kotlin entries before C/C++/PHP in all
files so they don't sit adjacent to Swift entries, preventing future
merge conflicts when upstream modifies Swift support.
2026-02-28 12:55:55 +00:00
abhigyanpatwari
2eca3e0da3 fix(swift): move tree-sitter-swift to optionalDependencies and use conditional imports
The PR merge reverted the Swift install fix. tree-sitter-swift must be
in optionalDependencies with conditional createRequire imports, otherwise
npm install fails on systems where the native build can't succeed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 18:14:53 +05:30
Gary Magyar
e046bf734d chore: merge upstream main into feat/kotlin-language-support
Resolve conflicts between Kotlin and Swift language support additions.
Both languages are now fully supported side by side.
2026-02-28 12:30:53 +00:00
Bhaskar Lalwani
b30248f969
Updated README with Discord and badge updates
Added Discord link and updated badges for npm and license.
2026-02-28 17:44:00 +05:30
abhigyanpatwari
eb48c7352e fix: read CLI version from package.json instead of hardcoding
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 16:32:28 +05:30
abhigyanpatwari
29db66c304 chore: bump version to 1.3.5
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 16:07:34 +05:30
Abhigyan Patwari
b7c582de76
Merge pull request #94 from jandyx/feat/swift-language-support
feat(swift): full Swift / iOS language support with SPM import resolution
2026-02-28 16:03:27 +05:30
Gary Magyar
508402fd4a feat: add full Kotlin language support 2026-02-28 10:06:52 +00:00
Gary Magyar
da63281a5a Merge remote-tracking branch 'origin/main' into feat/kotlin-language-support
# Conflicts:
#	gitnexus/src/core/ingestion/parsing-processor.ts
#	gitnexus/src/core/ingestion/workers/parse-worker.ts
2026-02-28 08:57:40 +00:00
abhigyanpatwari
c758f4eaf0 chore: bump version to 1.3.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 07:56:08 +05:30
Abhigyan Patwari
fd507a19ae
Merge pull request #105 from christopheralex-cc/fix/web-ui-server-connect-path-mismatch
fix(web): map API path field to repoPath in fetchRepoInfo
2026-02-28 07:53:01 +05:30
Abhigyan Patwari
799de20172
Merge pull request #102 from PurpleNewNew/feat/ast-decorator-detection
feat(ingestion): add AST decorator-based entrypoint hints
2026-02-28 07:41:57 +05:30
Abhigyan Patwari
2be88ae1f8
Merge pull request #61 from strazzere/fix/refactor_shell_commands
fix: ensure exec usage does not allow poisoning
2026-02-28 07:13:25 +05:30
Abhigyan Patwari
019ed3ff85
Merge pull request #99 from abhigyanpatwari/fix/lazy-embed-import
fix: lazy-import embeddings to avoid onnxruntime crash on Node v24+
2026-02-27 18:14:59 +05:30
abhigyanpatwari
6b4f10cae1 fix: remove unconditional embedder import from disconnect() to prevent crash on Node v24+
The disconnect() method was unconditionally importing embedder.js on
every graceful shutdown, which loads @huggingface/transformers and
onnxruntime-node — triggering the exact crash this branch fixes.
Since process.exit(0) follows immediately, the OS reclaims all
resources without needing disposeEmbedder(). Matches the pattern
already established in analyze.ts (lines 318-320).

Fixes #89

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:41:06 +05:30
Gary Magyar
43f525d056 fix(kotlin): guard against double-appending .* to wildcard import paths
Add endsWith('.*') check before appending wildcard suffix to prevent
possible double-append if grammar returns identifier text that already
includes the wildcard.
2026-02-27 10:28:39 +00:00
Gary Magyar
e2a8bfa5ab fix(kotlin): enable import dependency tree resolution for Kotlin files
Add .kt/.kts to EXTENSIONS array, parameterize Java resolvers into JVM
resolvers (resolveJvmWildcard, resolveJvmMemberImport), and unify
Java+Kotlin dispatch in both import processing paths. Detect wildcard
imports via AST child node inspection in parse worker.

Validated against okhttp repo: 524 .kt files detected, imports resolve
correctly to .kt files (e.g. okhttp3.OkHttpClient -> OkHttpClient.kt).
2026-02-27 10:26:23 +00:00
Gary Magyar
ee6753bf05 fix(kotlin): capture constructor-based heritage (class Foo : Bar())
The heritage query only matched bare user_type delegation specifiers
(interface implementation), missing constructor_invocation patterns
used for class extension. Adds a second heritage pattern for
constructor invocations, capturing ~3x more heritage edges.
2026-02-27 09:28:58 +00:00
Gary Magyar
1b8c3c77af feat(kotlin): distinguish interfaces from classes in knowledge graph
tree-sitter-kotlin (fwcd) has no interface_declaration node — both
interfaces and classes are class_declaration nodes. Use anonymous
keyword literal matching ("interface" vs "class") to produce the
correct @definition.interface / @definition.class captures.

Verified against two real Kotlin repos: a small one (3 Interface,
92 Class) and a large one (35 Interface, 677 Class, 5998 Function).
2026-02-27 09:09:26 +00:00
Güneş Bizim
a7fc9d2f88 feat(laravel): add route detection and route group support
Parse Route::* calls from PHP AST using a procedural walk that tracks
group nesting state (middleware, prefix, controller cascade). Creates
CALLS edges from route files to controller methods.

Supported patterns:
- Route::get/post/put/patch/delete/any/match with [Controller::class, 'method']
- Route::resource / Route::apiResource (expanded to individual actions)
- Invokable controllers (Controller::class -> __invoke)
- String syntax ('Controller@method')
- Route::middleware()->group() fluent chains (arbitrary depth)
- Route::prefix()->name()->group() chains
- Route::controller(X::class)->group() shared controller
- Route::group(['middleware' => ...], fn) array API
- Nested groups with full middleware/prefix cascade

Implementation notes:
- Uses anonymous_function node type (php_only grammar, not anonymous_function_creation_expression)
- File paths from workers are relative; check startsWith('routes/') not includes('/routes/')
- Edges: File -> Method with reason='laravel-route', confidence 0.9 (import-resolved)
- Mirrored to gitnexus-web inline in processCalls (no worker layer)
2026-02-27 11:17:36 +03:00
christopher
0074fd71ff fix(web): map API path field to repoPath in fetchRepoInfo
The backend `/api/repo` endpoint returns `path` but `ServerRepoInfo`
expects `repoPath`, causing `undefined.split('/')` crash in App.tsx
when connecting to a local gitnexus serve instance.

Fixes #92
2026-02-27 16:05:47 +08:00
PurpleNewNew
de935a4f4c feat(ingestion): add AST decorator-based entrypoint hints 2026-02-27 15:40:42 +08:00
abhigyanpatwari
989673a624 fix: lazy-import embeddings to avoid onnxruntime crash on unsupported Node versions
Convert static imports of @huggingface/transformers (which triggers
onnxruntime-node native binary loading) to dynamic import() calls.
This prevents crashes on Node versions whose ABI isn't supported by
the prebuilt onnxruntime binaries (e.g. Node v24).

Affected entry points:
- cli/analyze.ts: embedding pipeline only loaded when --embeddings is passed
- mcp/local/local-backend.ts: embedder only loaded on first semantic search
- server/api.ts: embedder only loaded when search endpoint needs embeddings

Fixes #89

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 12:09:17 +05:30
Abhigyan Patwari
8c41970631
Merge pull request #96 from abhigyanpatwari/fix/mcp-no-repos-crash
fix(mcp): don't crash server when no repos are indexed
2026-02-27 11:35:31 +05:30
abhigyanpatwari
5c3a32d0c6 fix(kuzu): remove duplicate ftsLoaded declaration that broke typecheck
The module-level `let ftsLoaded` was declared twice (line 19 and 679),
causing TS2451. Removed the duplicate and cleaned up redundant
assignments in loadFTSExtension.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:31:07 +05:30
abhigyanpatwari
a8b3c6b23f fix(mcp): don't crash server when no repos are indexed (#91)
The MCP server called process.exit(1) at startup when no repositories
were found in the registry. This prevented users from configuring the
MCP integration before running `gitnexus analyze`.

The server now starts gracefully with 0 repos and discovers newly
indexed repos lazily via refreshRepos() on each tool call.

Closes #91

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:36:35 +05:30
jandyx
15caf1e014 fix(swift): add missing Enum→Enum CodeRelation pair to schema 2026-02-27 12:00:41 +08:00
jandyx
1ed34a0007 docs: update supported languages list to include PHP and Swift 2026-02-27 11:45:05 +08:00
jandyx
7a4bc9a260 docs: improve postinstall script comments with background and TODO 2026-02-27 11:39:14 +08:00