Commit Graph
11 Commits
Author SHA1 Message Date
Lum1104andClaude Opus 4.6 839166b229 fix(core): add __tests__ pattern and handle filePath-less nodes in applyLLMLayers
Add __tests__ and __specs__ (plural inside underscores) to Test Layer
patterns for the common convention. Also assign file nodes without
filePath to "Other" layer in applyLLMLayers for consistency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 18:55:57 +08:00
Lum1104andClaude Opus 4.6 305fb4055b feat(core): add heuristic and LLM-based layer auto-detection
Add layer-detector module with four exported functions:
- detectLayers: heuristic detection using directory path patterns
- buildLayerDetectionPrompt: generates LLM prompt for layer identification
- parseLayerDetectionResponse: parses LLM JSON response with fence handling
- applyLLMLayers: applies LLM-provided layer definitions to the graph

Includes 10 tests covering all four functions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 18:51:19 +08:00
Lum1104andClaude Opus 4.6 8876eec80e fix(core): use execFileSync to prevent shell injection and remove dangling edges in merge
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 18:47:33 +08:00
Lum1104andClaude Opus 4.6 19357d25a3 feat(core): add staleness detection and incremental graph merging
Add staleness module with three functions:
- getChangedFiles: runs git diff to find files changed since last analysis
- isStale: checks whether the knowledge graph needs re-analysis
- mergeGraphUpdate: incrementally merges new analysis into existing graph
  by replacing nodes/edges for changed files while preserving unchanged ones

Includes 8 tests covering git interaction, error handling, and graph merging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 18:43:01 +08:00
Lum1104andClaude Opus 4.6 a243a07d6f feat(core): add fuzzy search engine with Fuse.js
Add SearchEngine class with fuzzy matching across node name, tags,
summary, and languageNotes fields. Supports type filtering, result
limiting, and dynamic re-indexing via updateNodes(). Uses Fuse.js
extended search with OR-token splitting for multi-word queries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 18:29:33 +08:00
Lum1104andClaude Opus 4.6 b41cf15ce9 fix(core): return validated data from loadGraph and fix edge type count comment
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 18:25:33 +08:00
Lum1104andClaude Opus 4.6 c04123366e feat(core): add Zod schema validation for knowledge graph loading
Add runtime validation of knowledge graph JSON using Zod schemas that
mirror every type in types.ts. The loadGraph function now validates
by default (opt-out via { validate: false }) and throws descriptive
errors on invalid data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 18:21:24 +08:00
Lum1104andClaude Opus 4.6 e1fd03ec38 feat(core): add graph builder and LLM analysis prompt system
Add GraphBuilder class that assembles KnowledgeGraph from file analysis
results, with support for file/function/class nodes and import/call/contains
edges. Add LLM prompt templates for file and project analysis, along with
robust JSON response parsers that handle markdown fences and invalid input.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 17:47:40 +08:00
Lum1104andClaude Opus 4.6 801c5e7af3 feat(core): add tree-sitter analyzer plugin for TS/JS
Add TreeSitterPlugin using web-tree-sitter (WASM-based) to extract
structural information from TypeScript and JavaScript files. The plugin
implements the AnalyzerPlugin interface and extracts functions, classes,
imports, exports, and call graphs via AST traversal.

Uses web-tree-sitter instead of native tree-sitter for cross-platform
compatibility (no native compilation required).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 17:40:29 +08:00
Lum1104andClaude Opus 4.6 a5327ce64d feat(core): add JSON persistence for knowledge graph and meta
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 17:30:23 +08:00
Lum1104andClaude Opus 4.6 35d0545100 feat(core): add knowledge graph type system and validation tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 17:25:49 +08:00