Commit graph

290 commits

Author SHA1 Message Date
Güneş Bizim
8a79465cbf feat(laravel): add Service/Repository pattern support
- Add /services/ (1.8x) and /repositories/ (1.5x) path multipliers
- Add Service$, Repository$, find, findAll, save, delete to PHP entry point patterns

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 01:28:42 +03:00
Güneş Bizim
945235ce56 fix(php): correct PHP query node type names for php_only grammar
- Replace static_call_expression -> scoped_call_expression (php_only name)
- Replace class_implements -> class_interface_clause
- Use [(name) (qualified_name)] alternatives in heritage patterns to match
  both simple names (Controller) and fully-qualified names (App\Models\User)

All patterns verified against tree-sitter-php node-types.json and live parse.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 01:13:26 +03:00
Güneş Bizim
e67d6c63d3 feat(php): add PHP WASM support for web UI
- Copy tree-sitter-php_only.wasm to public/wasm/php/tree-sitter-php.wasm
- Register PHP WASM path in web parser-loader languageFileMap

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 01:05:02 +03:00
Güneş Bizim
58063ca9ed feat(laravel): add Laravel framework path detection and entry point scoring
- Add Laravel route/controller/job/listener/middleware/provider/policy/model
  path patterns with appropriate multipliers (1.5–3.0)
- Add 'laravel' entry to FRAMEWORK_AST_PATTERNS for documentation
- Add PHP ENTRY_POINT_PATTERNS: RESTful methods, __invoke, handle, boot, etc.
- Add PHP/Laravel test file detection (Test.php, Spec.php, tests/feature/, tests/unit/)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 01:04:49 +03:00
Güneş Bizim
804d975cd0 feat(php): add PHP/PSR-4 import resolution with composer.json support
- Add .php, .phtml to EXTENSIONS array
- Add ComposerConfig interface and loadComposerConfig() (mirrors TsconfigPaths pattern)
- Add resolvePhpImport() with PSR-4 longest-match resolution + suffix fallback
- Wire PHP handling into processImports() and processImportsFromExtracted()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 01:04:39 +03:00
Güneş Bizim
2164dc22f1 feat(php): add PHP tree-sitter queries for all PHP constructs
Add PHP_QUERIES covering: namespaces, classes, interfaces, traits,
enums (PHP 8.1), functions, methods, use-statement imports, function/
method/static/nullsafe calls, and heritage (extends, implements, trait use).
Trait query captures enclosing class name to satisfy parse-worker heritage logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 01:04:32 +03:00
Güneş Bizim
30aba01188 feat(php): register PHP tree-sitter grammar in parser loader and parse worker
- Import PHP from tree-sitter-php and use PHP.php_only in languageMap
- Add anonymous_function_creation_expression to FUNCTION_NODE_TYPES
- Add PHP export detection (public modifier / top-level = exported)
- Add PHP built-in functions to BUILT_INS to reduce call graph noise

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 01:04:06 +03:00
Güneş Bizim
92a5d026c8 feat(php): install tree-sitter-php dependency
Add tree-sitter-php ^0.23.0 to gitnexus/package.json. Package exports
{ php, php_only } grammars; we use php_only for pure PHP files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 01:03:57 +03:00
Güneş Bizim
7883bf2cf0 feat(php): add PHP to SupportedLanguages enum and file extension detection
Uncomment PHP = 'php' in both CLI and web SupportedLanguages enums.
Add .php, .phtml, .php3/.4/.5/.8 extension detection to getLanguageFromFilename()
in both packages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 01:03:44 +03:00
Tim Strazzere
73590b2862 fix: ensure exec usage does not allow poisoning
Previous usage was vulnerable to "poisoned" tags
which could enduce commands to be run when a
`detectChanges` command was hit. This was primarily
fixed in `local-backend.ts` however I changes the
`execSync` usages where any injection was potentially
able to be performed (e.g. staleness).

Skipped touching wiki and generator as those use static
input, though these should potentially be changed over
in the future.
2026-02-24 13:42:29 -08:00
Carlos
bdda9afdca Rework CUDA probe: use ldconfig + env vars instead of nvidia-smi
Addresses review feedback:
- Remove nvidia-smi early return (driver ≠ runtime libs)
- Use ldconfig -p as primary check (covers all architectures and paths)
- Fall back to CUDA_PATH / LD_LIBRARY_PATH for conda, /opt/cuda, etc.
- Switch from execSync to execFileSync (avoids spawning a shell)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-24 10:16:39 -05:00
abhigyanpatwari
6be54ce9d3 fix(analyze): replace nonexistent bar.log with origLog
SingleBar from cli-progress doesn't have a .log() method (that's
MultiBar-only), causing a crash when any code calls console.log
during the pipeline.

Fixes #53
Thanks to @TranDatk for reporting in #56.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 11:05:32 +05:30
abhigyanpatwari
2e390583fc fix(ci): remove tracked worktrees and gitignore them
Worktree directories were committed as gitlink submodule references,
causing CI failures during checkout. Remove them from tracking and
add .claude/worktrees/ to .gitignore to prevent recurrence.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 09:42:53 +05:30
Carlos
575a4978f2 Probe for CUDA before attempting GPU embeddings
ONNX Runtime crashes with an uncatchable native error when CUDA
libraries are missing. This adds a lightweight probe (nvidia-smi +
libcublasLt.so.12 path check) before selecting the CUDA device,
falling back to CPU gracefully on systems without NVIDIA GPUs.

Fixes #53

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-23 22:50:46 -05:00
Abhigyan Patwari
c379c39ae1
Merge pull request #49 from paulrobello/feat/local-backend-mode
feat: local backend mode for web UI
2026-02-23 21:06:24 +05:30
Paul Robello
acd918f44e refactor(api): use executeCypher directly in buildGraph
Add public executeCypher(repoName, query) method to LocalBackend,
bypassing the callTool string dispatch and resolving the repo handle
directly. Update buildGraph in api.ts to call it instead of going
through callTool('cypher', ...) on every query.
2026-02-23 07:23:46 -08:00
Paul Robello
a71924f774 fix: address PR review — CORS, search quality, and embedding flags
- Add https://gitnexus.vercel.app to CORS allowed origins so the
  deployed site can connect to the local backend server.
- Replace naive createHttpTextSearch (substring matching via Cypher)
  with createHttpHybridSearch that calls /api/search for full
  BM25 + semantic + RRF hybrid search on the server.
- Set isEmbeddingReady to false in backend mode (no local embedder),
  which also fixes {{QUERY_VECTOR}} handling — the existing error
  path in tools.ts now correctly returns a helpful message.
- Set isBM25Ready to true (available via server's hybrid search).
- Removes the Cypher injection bug (wrong escape char) since the
  function that contained it was replaced entirely.
2026-02-22 17:14:56 -08:00
Paul Robello
8dd1c19bec feat(web): wire agent/chat through HTTP in backend mode
Add HTTP wrapper functions (executeQuery, textSearch) to the ingestion
worker and a new initializeBackendAgent method that creates the agent
with HTTP-backed tool closures instead of local KuzuDB. useAppState
detects backend mode and routes agent initialization accordingly.
2026-02-22 17:14:18 -08:00
Paul Robello
56f92ca1ad fix(web): skip embeddings pipeline in backend mode
The WASM worker DB is never initialized in backend mode, so
startEmbeddings() now returns early. Also hides the embedding
status button in the header when using the local backend.
2026-02-22 17:14:18 -08:00
Paul Robello
36c7b3ed12 fix: address final code review issues
- Fix field name mismatch in /api/repo (repoPath -> path)
- Add setProgress(null) on successful backend repo load
- Prevent DropZone tab auto-switch from re-triggering
- Make isDatabaseReady() return true in backend mode
- Increase fetchGraph timeout to 60s for large repos
- Replace dynamic import with static import for runCypherQuery
2026-02-22 17:14:18 -08:00
Paul Robello
c80bcccba4 chore: add docs/plans/ to .gitignore 2026-02-22 17:14:18 -08:00
Paul Robello
76d1538c5e docs: update READMEs for local backend mode 2026-02-22 17:14:18 -08:00
Paul Robello
d1cac0515d fix(web): wire backend props to SettingsPanel 2026-02-22 17:14:18 -08:00
Paul Robello
cb70fc8d6c feat(web): add backend URL setting to settings panel 2026-02-22 17:14:18 -08:00
Paul Robello
3603178266 feat(web): add backend connection indicator to header 2026-02-22 17:14:18 -08:00
Paul Robello
c7519c8493 feat(web): integrate backend mode into app state and loading flow 2026-02-22 17:14:18 -08:00
Paul Robello
6726340059 feat(web): add Local Server tab to DropZone onboarding 2026-02-22 17:14:18 -08:00
Paul Robello
e1d3959273 feat(web): add BackendRepoSelector component 2026-02-22 17:14:18 -08:00
Paul Robello
6de13ac800 feat(web): add useBackend hook for local server connection 2026-02-22 17:14:18 -08:00
Paul Robello
d7380de683 feat(web): add backend HTTP service module 2026-02-22 17:14:18 -08:00
Paul Robello
102850455d fix(serve): address code review - security, error handling, CORS 2026-02-22 17:14:18 -08:00
Paul Robello
8e8bb90fe4 refactor(serve): rewrite API server to use LocalBackend for multi-repo support
Replace direct single-repo KuzuDB access with LocalBackend, the same
backend the MCP server uses. The serve command now works with ALL
indexed repos via the global registry instead of only the CWD repo.

New/updated endpoints:
- GET /api/repos (list all indexed repos)
- GET /api/repo?name=X (repo metadata)
- GET /api/graph?repo=X (full knowledge graph)
- POST /api/query (raw Cypher via backend)
- POST /api/search (process-grouped search via backend)
- GET /api/file?repo=X&path=Y (file read with path traversal protection)
- GET /api/processes?repo=X, /api/process?repo=X&name=Y
- GET /api/clusters?repo=X, /api/cluster?repo=X&name=Y
2026-02-22 17:14:18 -08:00
abhigyanpatwari
28339c995d chore: bump gitnexus to v1.2.8 2026-02-23 04:12:02 +05:30
Abhigyan Patwari
e849f017f2
Merge pull request #51 from abhigyanpatwari/fix/disable-embeddings-by-default
fix: disable embeddings by default, fix segfault on macOS/Linux
2026-02-23 04:05:47 +05:30
abhigyanpatwari
5c7d905150 ci: add GitHub Actions for PR type-check and npm publish on tags 2026-02-23 03:59:35 +05:30
abhigyanpatwari
302c7ba7f0 fix: disable embeddings by default, fix segfault on macOS/Linux
Embeddings (ONNX Runtime) caused segfaults on macOS (#38) and CUDA
install failures on Linux (#40). Since embeddings only power semantic
vector search in query() and BM25 + graph traversal already provide
strong retrieval, disable embeddings by default with minimal quality
impact.

Changes:
- Replace --skip-embeddings with --embeddings opt-in flag
- Remove disposeEmbedder() call (ONNX native cleanup segfaults)
- Add process.exit(0) when embeddings are used to bypass ONNX atexit hooks
- Suppress ONNX session warnings via logSeverityLevel
- Fix progress bar duplication by routing console output through bar.log()
- Add elapsed time indicator for long-running phases

Fixes #38
Fixes #40
2026-02-23 03:47:34 +05:30
Abhigyan Patwari
93fc2b67ca
Add Trendshift badge to README
Added a badge for GitNexus repository on Trendshift.
2026-02-23 02:38:18 +05:30
Abhigyan Patwari
ad92b82723
Update README.md 2026-02-23 02:09:03 +05:30
Abhigyan Patwari
3400fccf8c
Merge pull request #48 from abhigyanpatwari/claude/issue-47-20260222-1745
fix: use cross-platform npx command in .mcp.json
2026-02-22 23:21:48 +05:30
claude[bot]
af1e455e77 fix: use cross-platform npx command in .mcp.json
Replace Windows-specific 'cmd /c npx' invocation with portable 'npx'
command that works on macOS, Linux, and Windows.

Fixes #47

Co-authored-by: Abhigyan Patwari <abhigyanpatwari@users.noreply.github.com>
2026-02-22 17:46:04 +00:00
Abhigyan Patwari
053af03caa
Merge pull request #46 from abhigyanpatwari/add-claude-github-actions-1771779387558
Add Claude Code GitHub Workflow
2026-02-22 22:27:11 +05:30
Abhigyan Patwari
63f1cd1ec9 "Claude Code Review workflow" 2026-02-22 22:26:31 +05:30
Abhigyan Patwari
f42513f5b6 "Claude PR Assistant workflow" 2026-02-22 22:26:30 +05:30
abhigyanpatwari
54ae315336 chore: bump gitnexus to v1.2.7
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:13:02 +05:30
abhigyanpatwari
19181e9ff6 Merge branch 'linux_stress_test' 2026-02-21 17:12:38 +05:30
abhigyanpatwari
d1fb34d636 feat: MCP hot-reload — discover newly indexed repos without restart
listRepos() now re-reads ~/.gitnexus/registry.json on every call.
resolveRepo() retries with a registry refresh on cache miss.
Extracted refreshRepos() from init() for reuse. All callers updated
with await for the new async signatures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:07:57 +05:30
abhigyanpatwari
8e2ee26834 docs: remove architecture docs and deep implementation details from markdown files 2026-02-21 13:00:09 +05:30
abhigyanpatwari
a7c6903322 docs: remove deep architecture details from README 2026-02-21 04:33:23 +05:30
abhigyanpatwari
33aa774f03 fix: worker pool robustness — timeout, exit handler, 512KB guards, error reporting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 20:24:48 +05:30
Abhigyan Patwari
366bc8b14b
Revise README with new links and enhanced details
Updated links and improved project description.
2026-02-20 05:02:50 +05:30