code-graph-llm
Advanced tools
+3
-1
@@ -7,3 +7,3 @@ /** | ||
| export const CONFIG = Object.freeze({ | ||
| VERSION: '4.17.0', | ||
| VERSION: '4.18.0', | ||
| IGNORE_FILE: '.gitignore', | ||
@@ -26,2 +26,4 @@ MAP_FILE: 'llm-code-graph.md', | ||
| 'build/', 'dist/', 'bin/', 'obj/', '.dart_tool/', '.pub-cache/', '.pub/', | ||
| '.gradle/', '.kotlin/', '__pycache__/', '.mypy_cache/', '.pytest_cache/', | ||
| 'Pods/', 'DerivedData/', '.build/', 'xcuserdata/', '.swiftpm/', | ||
| 'llm-code-graph.md', 'llm-agent-project-learnings.md', 'llm-agent-rules.md', | ||
@@ -28,0 +30,0 @@ 'CLAUDE.md', 'GEMINI.md', 'AGENTS.md', '.code-graph-agent.md', |
+20
-1
@@ -19,2 +19,3 @@ /** | ||
| this._extCache = new Map(); | ||
| this.FILE_TIMEOUT_MS = 15000; | ||
| } | ||
@@ -73,3 +74,3 @@ | ||
| } else if (entry.isFile() && CONFIG.SUPPORTED_EXTENSIONS.includes(path.extname(entry.name))) { | ||
| await this.processFile(fullPath, relPath); | ||
| await this.processFileWithTimeout(fullPath, relPath); | ||
| } | ||
@@ -79,2 +80,20 @@ } | ||
| async processFileWithTimeout(fullPath, relPath) { | ||
| let timer; | ||
| const timeout = new Promise((_, reject) => { | ||
| timer = setTimeout(() => reject(new Error('FILE_TIMEOUT')), this.FILE_TIMEOUT_MS); | ||
| }); | ||
| try { | ||
| await Promise.race([this.processFile(fullPath, relPath), timeout]); | ||
| } catch (e) { | ||
| if (e.message === 'FILE_TIMEOUT') { | ||
| console.warn(`[Code-Graph] Timeout (>${this.FILE_TIMEOUT_MS}ms), skipping: ${relPath}`); | ||
| } else { | ||
| throw e; | ||
| } | ||
| } finally { | ||
| clearTimeout(timer); | ||
| } | ||
| } | ||
| async processFile(fullPath, relPath) { | ||
@@ -81,0 +100,0 @@ let stats; |
@@ -16,2 +16,3 @@ # LLM_AGENT_PROJECT_LEARNINGS | ||
| - [VERSION] Version bump requires 4 files: `package.json`, `package-lock.json` (run `npm install --package-lock-only`), `lib/config.js` (CONFIG.VERSION), and `RELEASE_NOTES.md`. Missing lock file causes stale version in published artifact. | ||
| - [VERSION] README.md contains version strings in multiple locations: (1) header `# CODE-GRAPH (vX.Y.Z)`, (2) `## New in vX.Y.Z` section, (3) code block examples like `[Code-Graph vX.Y.Z]`. Always grep README for all version refs after bumping — stale inline examples are easy to miss. | ||
| - [ENV] Windows sandbox setup can fail before PowerShell runs; retry required reads with approved escalation instead of assuming command failure. | ||
@@ -18,0 +19,0 @@ - [LOGIC] Shared reflection prompt text must mention llm-agent-rules.md because platform audit expects Cursor reflections rules to retain the rules-file link. |
+1
-1
| { | ||
| "name": "code-graph-llm", | ||
| "version": "4.17.0", | ||
| "version": "4.18.0", | ||
| "description": "Compact, language-agnostic codebase mapper for LLM token efficiency.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+7
-7
@@ -1,2 +0,2 @@ | ||
| # CODE-GRAPH (v4.17.0) | ||
| # CODE-GRAPH (v4.18.0) | ||
@@ -7,7 +7,7 @@ > Inspired by [Andrej Karpathy skills](https://github.com/forrestchang/andrej-karpathy-skills), [juliusbrussee/caveman](https://github.com/juliusbrussee/caveman), and the community's work building better agent workflows. | ||
| ## New in v4.17.0 | ||
| ## New in v4.18.0 | ||
| - **Fix (Generate — hang diagnosis):** `generate` now logs subdirectories up to depth 4 (with indentation), making it easy to spot which subtree a slow scan is stuck in. | ||
| - **Fix (Generate — slow-parse warning):** Files that take >2s to parse now emit a `[Code-Graph] Slow parse (Xms): <path>` warning, identifying regex-heavy files (e.g. large generated `.dart` files). | ||
| - **Perf (Generate — extension resolution cache):** `resolveExtension` now caches results, collapsing repeated resolution of the same import path from N×21 disk checks to 1×21. Major speedup for Flutter/Dart projects where many files import the same relative paths. | ||
| - **Fix (Generate — build cache ignores):** Added `.gradle/`, `.kotlin/`, `Pods/`, `DerivedData/`, `.swiftpm/`, `xcuserdata/`, `__pycache__/`, `.mypy_cache/`, `.pytest_cache/` to default ignores. Previously the scanner crawled Android Gradle caches (e.g. `android/.gradle/8.14/kotlin/`) and processed generated Kotlin files inside them. | ||
| - **Fix (Generate — per-file timeout):** Each file now has a 15s processing timeout. If a file hangs (stuck I/O or slow parse), the scanner logs a warning and moves on to the next file instead of blocking forever. | ||
| - **Fix (Generate — depth logging):** Subdirectories at depth 2–4 are now logged with indentation, making it easy to pinpoint which subtree is slow. | ||
@@ -49,4 +49,4 @@ See [RELEASE_NOTES.md](RELEASE_NOTES.md) for full history. | ||
| ```text | ||
| [Code-Graph v4.14.0] Installed/updated: /absolute/path/to/AGENTS.md | ||
| [Code-Graph v4.14.0] Installed/updated: /absolute/path/to/.codex/hooks.json | ||
| [Code-Graph v4.18.0] Installed/updated: /absolute/path/to/AGENTS.md | ||
| [Code-Graph v4.18.0] Installed/updated: /absolute/path/to/.codex/hooks.json | ||
| ``` | ||
@@ -53,0 +53,0 @@ |
+5
-0
| # RELEASE NOTES | ||
| ### v4.18.0 (2026-05-07) | ||
| - **Fix (Generate — build cache ignores):** Added `.gradle/`, `.kotlin/`, `Pods/`, `DerivedData/`, `.swiftpm/`, `xcuserdata/`, `__pycache__/`, `.mypy_cache/`, `.pytest_cache/` to `DEFAULT_IGNORES`. Scanner was crawling Android Gradle caches (`android/.gradle/8.14/kotlin/`, etc.) and processing large generated Kotlin files inside them, causing hangs on Flutter/Android projects. | ||
| - **Fix (Generate — per-file timeout):** Introduced `processFileWithTimeout()` wrapping `processFile()` in a `Promise.race` with a 15s timer. Timed-out files emit `[Code-Graph] Timeout (>15000ms), skipping: <path>` and the scan continues. Handles I/O hangs; CPU-bound regex hangs require a worker thread (future work). | ||
| - **Maintenance:** Bumped version to 4.18.0 in `config.js` and `package.json`. | ||
| ### v4.17.0 (2026-05-07) | ||
@@ -4,0 +9,0 @@ - **Fix (Generate — hang diagnosis):** `generate` now logs subdirectories at depth 2–4 with indentation, making it easy to identify which subtree a slow scan is blocked on. Previously depth >1 was silent. |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
199813
0.96%2961
0.68%