feat: Add LLM integration layer for semantic code analysis #82
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Implements optional LLM integration for semantic code analysis beyond AST syntax comparison. Enables behavioral change detection, code execution simulation, and intelligent documentation synchronization for DocuMCP Orchestrator (ADR-009, ADR-010).
Architecture:
src/utils/llm-client.ts): Multi-provider abstraction (DeepSeek, OpenAI, Anthropic, Ollama) with rate limiting, timeout handling, and graceful degradationsrc/utils/semantic-analyzer.ts): Three-mode analysis (LLM/AST/Hybrid) with automatic fallback and confidence-based selectionUsage:
Configuration (optional):
Type of Change
Testing
Code Quality
npm run validate:rulesand all checks passDocumentation
docs/how-to/llm-integration.mdSecurity
npm run security:checkand there are no new vulnerabilitiesADR Impact
Checklist
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
example.com/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js(dns block)/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js k/documcp/documc9bbac2319fde065e4b9004787f53c0631b993eb8:tests/utils/llm-client.test.ts git bin/�� --port 4000 node /usr/bin/git semantic-analyzenode 1.11.1 19.6/src git log ll serve --port 3000 --format=%cI k/documcp/node_modules/.bin/sh 19.6/deps/uv/incsh with comprehens-c 19.6/deps/zlib sh(dns block)https://api.github.com/test/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js(http block)/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js k/documcp/documc9bbac2319fde065e4b9004787f53c0631b993eb8:tests/utils/llm-client.test.ts git bin/�� --port 4000 node /usr/bin/git semantic-analyzenode 1.11.1 19.6/src git log ll serve --port 3000 --format=%cI k/documcp/node_modules/.bin/sh 19.6/deps/uv/incsh with comprehens-c 19.6/deps/zlib sh(http block)httpstat.us/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js(dns block)/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js k/documcp/documc9bbac2319fde065e4b9004787f53c0631b993eb8:tests/utils/llm-client.test.ts git bin/�� --port 4000 node /usr/bin/git semantic-analyzenode 1.11.1 19.6/src git log ll serve --port 3000 --format=%cI k/documcp/node_modules/.bin/sh 19.6/deps/uv/incsh with comprehens-c 19.6/deps/zlib sh(dns block)invalid-domain-that-does-not-exist-12345.com/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js(dns block)/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js k/documcp/documc9bbac2319fde065e4b9004787f53c0631b993eb8:tests/utils/llm-client.test.ts git bin/�� --port 4000 node /usr/bin/git semantic-analyzenode 1.11.1 19.6/src git log ll serve --port 3000 --format=%cI k/documcp/node_modules/.bin/sh 19.6/deps/uv/incsh with comprehens-c 19.6/deps/zlib sh(dns block)invalid-url-12345.test/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js(dns block)/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js k/documcp/documc9bbac2319fde065e4b9004787f53c0631b993eb8:tests/utils/llm-client.test.ts git bin/�� --port 4000 node /usr/bin/git semantic-analyzenode 1.11.1 19.6/src git log ll serve --port 3000 --format=%cI k/documcp/node_modules/.bin/sh 19.6/deps/uv/incsh with comprehens-c 19.6/deps/zlib sh(dns block)this-domain-definitely-does-not-exist-12345.com/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js(dns block)/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js k/documcp/documc9bbac2319fde065e4b9004787f53c0631b993eb8:tests/utils/llm-client.test.ts git bin/�� --port 4000 node /usr/bin/git semantic-analyzenode 1.11.1 19.6/src git log ll serve --port 3000 --format=%cI k/documcp/node_modules/.bin/sh 19.6/deps/uv/incsh with comprehens-c 19.6/deps/zlib sh(dns block)this-domain-should-not-exist-12345.com/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js(dns block)/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js k/documcp/documc9bbac2319fde065e4b9004787f53c0631b993eb8:tests/utils/llm-client.test.ts git bin/�� --port 4000 node /usr/bin/git semantic-analyzenode 1.11.1 19.6/src git log ll serve --port 3000 --format=%cI k/documcp/node_modules/.bin/sh 19.6/deps/uv/incsh with comprehens-c 19.6/deps/zlib sh(dns block)www.google.com/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js(dns block)/usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/documcp/documcp/node_modules/jest-worker/build/workers/processChild.js k/documcp/documc9bbac2319fde065e4b9004787f53c0631b993eb8:tests/utils/llm-client.test.ts git bin/�� --port 4000 node /usr/bin/git semantic-analyzenode 1.11.1 19.6/src git log ll serve --port 3000 --format=%cI k/documcp/node_modules/.bin/sh 19.6/deps/uv/incsh with comprehens-c 19.6/deps/zlib sh(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.