Skip to content

v0.4.3

Choose a tag to compare

@chouswei chouswei released this 20 Mar 03:59
· 9 commits to master since this release

Release notes – v0.4.3

Release date: 2026-03-19

Summary

LSP client fixes so indexing produces symbol nodes and edges (Package, PartDef, IN_DOCUMENT, IN_PACKAGE). Adds optional LSP notification handling, MCP fallback when LSP returns no symbols, a dedicated lsp/ setup, index-and-map script, and documentation.

Changes

LSP client

  • stdio: Server must be started with --stdio; spawn and init updated accordingly.
  • Windows: Use cmd /c node ... --stdio so the LSP server runs correctly on Windows.
  • Initialize: Send hierarchicalDocumentSymbolSupport: true and workspaceFolders so the server returns document symbols.
  • Response handling: Support both DocumentSymbol[] and SymbolInformation[]; normalize flat lists using containerName for parent/IN_PACKAGE.
  • Symbol kinds: Map LSP SymbolKind (numeric) to graph labels when detail is missing; add MCP-style kind strings in mapping.
  • Robustness: Reject on stdout close/error and process exit; 30s timeout per request; skip malformed JSON and server notifications until the matching response.
  • Notifications: Optional handler for LSP notifications (e.g. window/logMessage). Set DEBUG_LSP_NOTIFICATIONS=1 to log to stderr.

MCP fallback

  • When LSP returns no symbols for a document, the indexer calls MCP getSymbols (one shared MCP client per index run).
  • If SYSMLLSP_SERVER_PATH is unset, only MCP is used.

Scripts and tooling

  • scripts/index-and-map.mjs — Index a path then generate graph-map.md. Usage: node scripts/index-and-map.mjs [path] (default: test/fixtures/sysml).
  • scripts/debug-lsp-symbols.mjs — Print raw and normalized LSP document symbols for debugging.
  • scripts/compare-mcp-vs-lsp-symbols.mjs — Compare MCP vs LSP symbol output for a file.
  • lsp/ — Dedicated folder with its own package.json for sysml-v2-lsp; lsp/test-server.mjs runs a minimal stdio test (initialize → documentSymbol).

Documentation

  • docs/MCP_INTERACTION_GUIDE.md — LSP vs MCP, index-and-map flow, “why no edges,” optional MCP fallback, Kuzu notes.
  • docs/MCP_CLIENT_TEMPLATE_ANALYSIS.md — Analysis of MCP client template (transports, SDK usage, patterns).
  • docs/PLAN.md — Phases 1–4 (test/verify, notifications, retry/errors, validation/docs).
  • docs/SKILL_DESIGN_PATTERNS.md, docs/TOOLS.md — Design and tool reference.
  • AGENTS.md, CLAUDE.md — Project context for AI assistants.

Map output

  • graph-map.md — Generated by npm run generate-map or as the second step of index-and-map. Shows Documents, nodes by label (Package, PartDef, Action, etc.), and Interconnection (edges: IN_DOCUMENT, IN_PACKAGE).

Upgrade

  • npm install then npm run build. If the LSP is in lsp/, run npm install in lsp/ as well (or use root node_modules and set SYSMLLSP_SERVER_PATH if needed).
  • On Windows, if install fails on LSP postinstall: npm install --ignore-scripts then npm run build; point to a built LSP via SYSMLLSP_SERVER_PATH.
  • Indexing writes to the storage root (default ~/.sysmledgraph). Use SYSMEDGRAPH_STORAGE_ROOT to override. Only one process should open the same Kuzu DB at a time (see docs/MCP-AND-KUZU.md).

Known issues

  • CLI may exit with a non-zero or crash (e.g. Windows access violation) after successful indexing during teardown; graph data is written correctly. Workaround: use a temp storage root for a full index-and-map run, then run generate-map with the same root.