Merged
Conversation
- Implement tests for FileWatcher to ensure debouncing and follow-up flush behavior. - Create tests for ParserRegistry to validate parser registration and retrieval. - Add tests for budget management functions including makeBudget and estimateTokens. - Introduce tests for response schemas to verify field priorities and budget handling. - Add tests for tool handler base class to ensure proper context management and error handling. - Implement tests for exec-utils to validate command execution with timeout. - Create validation tests for various utility functions to ensure input correctness. - Add tests for embedding engine to validate embedding generation and storage behavior. - Implement tests for QdrantClient to ensure connection handling and CRUD operations.
…rkspace root
N3: Add 5 tools missing from index.ts TOOL_NAMES (stdio transport gap):
index_docs, search_docs, ref_query, init_project_setup, setup_copilot_instructions
These were registered in server.ts (HTTP) but absent from the stdio entry point.
N7: Fix ArchitectureEngine using process.cwd() instead of active workspace root
- Add workspaceRoot field; populate from 4th constructor arg (defaults to cwd)
- validate() and detectCircularDependencies() now use this.workspaceRoot
- resolveImportPath() anchors relative-path resolution to projectRoot instead
of implicitly relying on process.cwd() (cwd-coupled bug uncovered by N7)
- reload() accepts optional workspaceRoot and updates stored value
- ToolHandlerBase.initializeEngines() passes defaultActiveProjectContext.workspaceRoot
- ToolHandlerBase.reloadEnginesForContext() propagates context.workspaceRoot on reload
- Regression tests: N7 validate() uses workspaceRoot, reload() updates it,
resolveImportPath() anchors to projectRoot not cwd (2 new tests, 229 total)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… misc, BX1 ensureBM25Index guard
SX3: resolveImportPath strips .js/.jsx extension before probing disk candidates.
Fixes 0 REFERENCES edges for TypeScript node16/bundler moduleResolution projects.
All 89 relative imports in lxRAG-MCP will now resolve to FILE nodes on next rebuild.
SX5: Community detector Cypher adds OPTIONAL MATCH (parentFile:FILE)-[:CONTAINS]->(n)
so CLASS/FUNCTION nodes inherit parent FILE path for community labeling.
Reduces 'misc' community from 77% (249/323) to < 5% of members.
BX1: setImmediate BM25 guard adds typeof ensureBM25Index !== 'function' check.
Prevents 2 unhandled errors in tool-handlers.contract.test.ts mock environment.
Also includes all F1-F11 fixes from audit session 2026-02-23b:
F1 arch path normalization, F2 SECTION.relativePath, F3 BM25 incremental,
F4 withEmbeddings default false, F5 via F8, F6 find_pattern Cypher,
F7 community label+size, F8 sharedIndex pass-through, F9 DEFAULT_CONFIG,
F10 tools_list, F11 n.properties fix in test-tools.
Tests: 234/234 passing, 0 TypeScript errors, 0 unhandled errors
…ble types only The drift check previously compared indexStats.totalNodes (in-memory code index: FILE+FUNCTION+CLASS+IMPORT ≈ 448 nodes) against memgraphNodeCount (ALL nodes including SECTION/VARIABLE/EXPORT/DOCUMENT = 2239). This always fired even when the index was fully synced. Fix: extend health stats Cypher to also count IMPORT nodes, compute memgraphIndexableCount = file+func+class+import, and use that with a ±3 tolerance in the drift check. Also expose memgraphIndexableNodes in the indexHealth output for transparency. After: graph_health correctly reports driftDetected=false when the in-memory code index is in sync with Memgraph code nodes.
…id wrong PATH test_run was calling 'npx vitest run' which inherits the server process's PATH. If the server was launched from a non-nvm shell (e.g. system Node v10.19.0), npx would fail with 'npm is known not to run on Node.js v10.19.0'. Fix: replace 'npx vitest run' with: '"<process.execPath>" "<cwd>/node_modules/.bin/vitest" run ...' process.execPath is the absolute path to the node binary actually running the server (always the correct managed version). The vitest binary at node_modules/.bin/vitest is resolved absolutely from process.cwd(), which is the workspace root. This bypasses PATH entirely.
- find_pattern.type: add .default('pattern') so callers can omit it;
the handler already defaulted to 'pattern' but Zod required it,
causing validation errors when type was not provided
- index.ts TOOL_NAMES: add 'tools_list' (was registered in server.ts
but missing from the index.ts passthrough list)
In stdio MCP transport, stdout is the JSON-RPC wire channel. Any line written to stdout that is not a valid JSON-RPC message causes VS Code to log 'Failed to parse message' warnings and may desync the protocol. Changes: - Bulk sed: console.log → console.error in all runtime src/*.ts files (excludes test-harness.ts, test-parser.ts, *.test.ts) - Remove stray debug console.error(structuralWeight) in vector-tools.ts (was a bare debug print with no surrounding context) - Remove unused 'structuralWeight' destructuring from code_hybrid_search Files affected: tool-handler-base.ts, graph/client.ts, graph/orchestrator.ts, graph/sync-state.ts, vector/qdrant-client.ts, vector/embedding-engine.ts, engines/architecture-engine.ts, engines/docs-engine.ts, engines/progress-engine.ts, engines/test-engine.ts, parsers/typescript-parser.ts, tools/handlers/test-tools.ts, tools/vector-tools.ts, server.ts, index.ts
- Implemented `audit-census-v2.cjs` for detailed node and relationship census with correct uppercase labels. - Created `audit-census.cjs` to collect general structure data for lxRAG-MCP. - Developed `audit-community-refs.cjs` to analyze community memberships and investigate missing REFERENCES. - Introduced `audit-deep.cjs` for in-depth checks on IMPORT nodes and their relationships. - Added `audit-probe.cjs` to verify existing projectId values and sample node properties in Memgraph. - Enhanced logging and error handling across all scripts for better traceability. - Included new findings and observations in the lxRAG tool audit documentation.
… and types - Added `coordination-queries.ts` for managing Cypher query constants used in the coordination engine. - Created `coordination-types.ts` to define public types related to claims and agents. - Implemented utility functions in `coordination-utils.ts` for mapping raw data to typed claims and generating unique IDs. - Updated environment configuration in `env.ts` to include a new synchronous rebuild threshold. - Enhanced `GraphBuilder` to set file path metadata for functions and classes. - Added tests for symbol file path metadata in `builder.test.ts`. - Introduced `GraphIndexManager` with improved node handling and synchronization capabilities. - Updated `ToolHandlers` to manage graph rebuild processes and handle asynchronous operations more effectively. - Enhanced error handling and logging during graph rebuilds.
Test/refactor
…r Graph Expert Agent, Copilot instructions, skill MCP, and toolsets, and delete old test audit report.
Test/refactor
- Add eslint.config.js with TypeScript rules and prettier integration - Add vitest.config.ts with V8 coverage, thresholds, and include/exclude patterns - Add .editorconfig for consistent editor settings - Add .prettierrc for code formatting - Add .github/workflows/ for CI pipeline - Update tsconfig.json with stricter settings - Update package.json / package-lock.json with new dev dependencies
- New logger.ts utility with debug/info/warn/error levels - Output is newline-delimited JSON to stderr (never stdout, preserves MCP protocol) - Reads LXRAG_LOG_LEVEL env var; defaults to 'info' - Auto-includes sessionId from AsyncLocalStorage request context - Zero runtime deps; normalises Error/string/object contexts uniformly - Update exec-utils.ts and validation.ts to use structured logger
- New contract-validator.ts validates raw arguments against tool inputShape
- Detects missing required fields, extra/unknown fields, and type mismatches
- Returns ContractValidation { valid, errors, missingRequired, extraFields, warnings }
- Used by contract_validate tool and callTool() dispatch pipeline
- Catches common misuse: codeType vs type, elementA vs elementId1, etc.
- Delete src/test-harness.ts — ad-hoc debug harness superseded by vitest - Delete src/test-parser.ts — one-off parser probe, no longer needed
- server.ts: use typed Config instead of Record<string,unknown>, fix error casts - config.ts: tighten Config interface, remove loose index signatures - types/config.ts: export LayerDefinition and related types properly - types/tool-args.ts: replace loose object types with discriminated unions - request-context.ts: fully typed AsyncLocalStorage context - env.ts: typed EnvConfig with explicit fields
- client.ts: String() casts for row.id/type/from/to in node/rel mapping - builder.ts: typed createImportNode/createExportNode/createVariableNode params; cast ArchitectureEngine layers via 'as unknown as LayerDefinition[]' - orchestrator.ts: typed BuildResult, removed any in watcher dispatch - ppr.ts: typed PPRResult and edge-weight map, fix accumulator types - hybrid-retriever.ts: typed QueryResult and scorer inputs - cache.ts, sync-state.ts, docs-builder.ts: replace Index<string,any> with typed Record<string,unknown> mappings
- architecture-engine.ts: typed LayerDefinition, replace any with typed rules - community-detector.ts: typed MemberRow and community map entries - coordination-engine.ts: typed claim/release row shapes, remove implicit any - coordination-types.ts: Claim/ClaimConflict/AgentSummary interfaces tightened - coordination-utils.ts: typed query params and row results - docs-engine.ts: DocSection interface, typed search result rows - episode-engine.ts: EpisodeRow/EpisodeInput types, typed recall scoring - progress-engine.ts: ProgressItem/FeatureStatus typed, typed DB rows - test-engine.ts: typed TestSuite map entries, MirrorTestResult interface - migration-engine.ts: typed migration step runner
parsers: - parser-interface.ts: tighten ParsedFile/ParsedSymbol, add summary field - regex-language-parsers.ts: typed BraceBlock/PythonBlock helpers - typescript-parser.ts, tree-sitter-parser.ts: typed symbol extraction methods - docs-parser.ts: DocNode interface, typed frontmatter result response: - schemas.ts: typed FieldPriority, ProfileBudget with const assertions - shaper.ts: typed ResponseData, fix applyFieldPriority budget pruning - summarizer.ts: typed SummaryContext, fix compact array capping vector: - embedding-engine.ts: Embedding interface, typed store/recall - qdrant-client.ts: typed SearchResult, PayloadFilter
types.ts:
- HandlerBridge method signatures match implementations exactly
- Config type replaces Record<string,unknown> for context.config
- resolveSinceAnchor, adaptWorkspaceForRuntime, getActiveWatcher typed
tool-handler-base.ts:
- ToolContext.config: Config | {}; workspaceInput uses string cast
- ArchitectureEngine layers cast via 'as unknown as LayerDefinition[]'
tool-handlers.ts:
- Registry dispatch: cast 'this as unknown as HandlerBridge'
- context_pack / semantic_slice: const a: any boundary pattern
- coreSymbols typed with local CoreSymbol alias
handlers (all files):
- core-graph-tools: txMetadata/latestTxRow cast as Record<string,unknown>
- core-analysis-tools: 'let matches' extracted, dependencies typed
- docs-tools: removed unused GraphRelationship import, typed row maps
- ref-tools: walk() return type includes null; sort cast as number
- test-tools: GraphRelationship import added; execError cast
- vector-tools: HybridResult local type; typed reduce accumulator
- build.ts: typed BuildOptions, replace process.exit abuse with throw - query.ts: QueryOptions interface, typed Cypher result rows - test-affected.ts: typed changed-files parsing, AffectedResult interface - validate.ts: typed ValidationReport and violation shape
New test files: - community-detector.test.ts: 18 tests — MAGE leiden, directory fallback, communityLabel grouping, central node selection, ID naming convention - episode-engine.test.ts: 30 tests — add(), recall() filters/sorting/metadata, decisionQuery(), reflect() patterns/learnings, Jaccard scoring - test-engine.test.ts: 25 tests — statistics, selectAffectedTests, reload(), categorizeTest() path classification, mirror path fallback Updated existing tests: - architecture-engine.test.ts: align with new LayerDefinition signatures - coordination-engine.test.ts: align with typed claim row shapes - docs-engine.test.ts: align with DocSection interface - progress-engine.test.ts: align with ProgressItem/FeatureStatus types
New test files: - graph/ppr.test.ts: 26 tests — empty seeds guard, MAGE pagerank mode, proximity boosting, JS PPR fallback, edge weight propagation, option clamping - parsers/regex-language-parsers.test.ts: 42 tests — PythonParser, GoParser, RustParser, JavaParser; imports/classes/functions/mixed-files Updated existing tests: - graph/builder.test.ts, client.test.ts, docs-builder.test.ts, hybrid-retriever.test.ts, orchestrator.test.ts: align with new typed APIs - parsers/docs-parser.test.ts, parser-registry.test.ts: align with updated ParsedFile/ParsedSymbol interfaces
New test files:
- tool-handlers.integration.test.ts: 79 tests covering all 36+ registered tools
* Critical bugs: graph_query data loss, contract_validate schema checking,
coordination claim tracking, test_run path resolution
* Significant issues: test_categorize/test_select/suggest_tests coverage,
code_clusters, context_pack, task_update envelope
* Parameter inconsistencies: arch_suggest type vs codeType, impact_analyze
* Response shaping: applyFieldPriority budget pruning, compact profile
* Full coverage of all tool categories: graph, semantic, arch, docs,
memory, progress, coordination, setup, utility
* Cross-cutting: response envelope consistency, session isolation
Updated existing tests:
- tool-handlers.contract.test.ts, tool-handlers.docs.test.ts: align with
new typed APIs
- utils/exec-utils.test.ts, utils/validation.test.ts: align with logger
- vector/embedding-engine.test.ts, vector/qdrant-client.test.ts: typed APIs
- response/budget.test.ts, response/schemas.test.ts: typed FieldPriority
New files: - ROADMAP.md: feature roadmap aligned with 2026 community findings - docs/AUDIT_REPORT_2026-02-27.md: comprehensive tool audit report - docs/RESEARCH_GEMINI_DEEP_SEARCH_2026_02_26.md: architecture research notes - scripts/test-all-tools.mjs: full stdio integration test for all 39 tools (phases: handshake, workspace, empty-state, rebuild, semantic, arch, docs, impact, test, episodes, coordination, one-shot init) Updated: - README.md, ARCHITECTURE.md, QUICK_REFERENCE.md: reflect current state - docs/PLANS_PENDING_ACTIONS_SUMMARY.md: Phase 1 complete, Phase 2 planning - docs/TOOLS_INFORMATION_GUIDE.md, docs/PROJECT_FEATURES_CAPABILITIES.md: enumerate all 39 tools and their corrected parameter names - docs/AUDITS_EVALUATIONS_SUMMARY.md: 2026-02-27 audit summary - docs/INTEGRATION_SUMMARY.md: Claude/Cursor/Copilot integration notes - .github/copilot-instructions.md: correct tool signatures and pitfalls
- Updated HTML coverage reports reflecting new test files and refactored code - Deleted stale clover.xml and coverage-final.json (replaced by lcov format) - .lxrag/cache/file-hashes.json updated to reflect refactored source tree
- validation.ts: add computeProjectFingerprint(workspaceRoot) → stable 4-char base-36 hash (SHA-256 of path, first 6 hex digits mod 36^4) - builder.ts: stamp every FILE node with projectFingerprint on upsert; constructor accepts optional fingerprint param - orchestrator.ts: compute fingerprint from workspaceRoot at build() time; on incremental mode, query stored fingerprint and emit a warning when it differs — catches moved/renamed workspaces before they corrupt the graph - core-graph-tools.ts: import computeProjectFingerprint for graph_rebuild
- Rename all LXRAG_ env vars to LXDIG_ - Update product name lxRAG → lxDIG across source, docs, scripts, configs - Rename .lxrag/ → .lxdig/ cache directory - Rename docs/lxrag-self-audit → docs/lxdig-self-audit - Update README/ARCHITECTURE with DIG branding + RAG SEO keywords - Update package.json description and keywords (dig, rag, graphrag) - Fix unused computeProjectFingerprint import in core-graph-tools.ts - Build passes, 469/469 tests pass
Keep dash only where structurally required: - GitHub URLs and git clone paths - cd/directory references - projectId values in Cypher queries and scripts - Element IDs (lxDIG-MCP:file:...) Build passes, 469/469 tests pass
Test/refactor
* art: redesign brain-logo.svg with graph nodes, gradient glow, and layered contour * new logo --------- Co-authored-by: LexCoder17 <hi@iarodriguez>
* art: redesign brain-logo.svg with graph nodes, gradient glow, and layered contour * new logo * update lts node version * chore: remove unnecessary peer dependencies from package-lock.json --------- Co-authored-by: LexCoder17 <hi@iarodriguez>
…t, and episode validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.