Skip to content

Dev#7

Merged
biuld merged 34 commits into
masterfrom
dev
Feb 1, 2026
Merged

Dev#7
biuld merged 34 commits into
masterfrom
dev

Conversation

@biuld

@biuld biuld commented Feb 1, 2026

Copy link
Copy Markdown
Owner

No description provided.

biuld added 30 commits January 28, 2026 01:12
…solution; add support for semantic relationships in the code graph, including local and global symbol handling, and enrich metadata for Java entities; introduce tests for structural indexing and reference resolution capabilities.
…actor command argument types to use `NodeKind` and `EdgeType` enums directly.
…g, removing range from graph edges and refactoring reference lookup.
…nd enhance shell UX with syntax highlighting and auto-context.
- Created src/engine module with core components:
  * CodeGraph: Arc-wrapped immutable graph (O(1) clone)
  * CodeGraphBuilder: Mutable builder for graph construction
  * NaviscopeEngine: MVCC-based engine with non-blocking reads
  * EngineHandle: Unified async/sync API for all clients

- Added comprehensive documentation:
  * CONCURRENCY_ANALYSIS.md: Current architecture analysis
  * REFACTOR_ENGINE.md: New architecture design
  * REFACTOR_COMPARISON.md: Performance comparison
  * engine_refactor_plan.md: Implementation roadmap

- Performance improvements (expected):
  * Snapshot: 50ms → 1μs (5000x faster)
  * Memory: -90% for concurrent queries
  * Non-blocking reads during index rebuild

- Added NaviscopeError::Internal variant for engine errors

- All engine unit tests passing (9/9)

Work in progress:
- QueryEngine integration (temporarily disabled)
- Index persistence (to be implemented)
- LSP/MCP/Shell migration (next phase)

Ref: #refactor/unified-engine Phase 1 complete
…gine integration

Core achievements:
- ✅ Implemented CodeGraph serialization/deserialization for index persistence
- ✅ Added atomic file write (write to .tmp then rename)
- ✅ Created CodeGraphLike trait for QueryEngine abstraction
- ✅ Fixed all topology/fqn_map field access to use methods
- ✅ Added EngineHandle::from_engine() for testing
- ✅ All 9 engine tests passing

Technical details:
- CodeGraph now has serialize() and deserialize() methods
- NaviscopeEngine properly saves/loads index from disk
- QueryEngine supports both old and new CodeGraph via trait
- Query methods temporarily disabled due to trait object lifetime issues

Next steps (Phase 2):
- Resolve trait object lifetime for query in spawn_blocking
- Migrate LSP/MCP/Shell to use new engine
- Implement incremental updates and file watching

Performance:
- Snapshot: O(1) Arc clone
- Serialization: MessagePack format
- All concurrent access tests passing
Major achievement: Solved trait object lifetime issues! 🎉

Changes:
- ✅ Refactored QueryEngine to use generics instead of trait objects
  - Changed from QueryEngine<'a> with &'a dyn CodeGraphLike
  - To QueryEngine<G: CodeGraphLike> owning the graph
  - This eliminates ALL lifetime issues in spawn_blocking!

- ✅ Added Clone derive to GraphQuery enum
  - Required for moving into spawn_blocking closures

- ✅ Restored query() and query_blocking() methods in EngineHandle
  - Both async and sync APIs now fully functional
  - Proper error handling and type annotations

- ✅ Fixed MCP module to clone graph instead of borrowing
  - Updated to work with new generic QueryEngine API

- ✅ Added comprehensive query tests
  - test_query_functionality (async)
  - test_query_blocking (sync)

Test results: 11/11 passing ✅

Technical insight:
The key breakthrough was realizing that trait objects (&dyn Trait)
have inherent lifetime constraints that conflict with 'static
requirements of spawn_blocking. By using generics, the compiler
can monomorphize at compile time, and owned values (Arc<CodeGraph>)
can be safely moved into closures.

Performance:
- Zero-cost abstraction via generics
- Arc clone remains O(1)
- Query execution in blocking thread pool

This completes Phase 1 Query functionality! 🚀
… and MCP to use async graph access via `EngineHandle`.
…rom the main graph and optimize reference discovery.
…discovery engine and improved Java type resolution.
…e, lang, lsp, mcp, and cli crates, and update resolver engine.
…mproved node rendering

- Added `LanguageFeatureProvider` trait for language-specific features.
- Integrated feature providers into the CLI context for enhanced node detail views.
- Updated `ShellCommand` to utilize feature providers for rendering node signatures and details.
- Refactored `GraphNode` structure to support new language features and metadata handling.
- Introduced Gradle feature provider for detailed Gradle element rendering.
- Updated dependencies in `Cargo.lock` to include `serde_json` for JSON handling.
…enhance reference discovery details

- Revised descriptions of code relationships in the README to include type usage.
- Enhanced the user guide with clearer instructions on dependency analysis and filtering options.
- Added a new section on the two-phase reference discovery strategy for improved performance insights.
- Updated dependency terminology in examples for consistency.
…d pool and add `Send + Sync` bounds to `CodeGraphLike`.
…s, refactoring core and LSP components to use these new interfaces.
…formance

- Changed `run` functions in `clear.rs`, `index.rs`, `watch.rs`, and `shell/mod.rs` to async, allowing for non-blocking execution.
- Removed unnecessary blocking runtime creation, simplifying the command execution flow.
- Updated command handling in `lib.rs` to await async runs, enhancing overall responsiveness.
…in engine lifecycle and semantic traits

- Renamed `Result<T>` to `EngineResult<T>` in `lifecycle.rs` and `SemanticResult<T>` in `semantic.rs` for better context.
- Updated async trait methods in `EngineLifecycle` and `SymbolNavigator` to use the new result types, enhancing error handling consistency.
- Introduced utility functions in `graph.rs` for improved handling of `GraphNode` properties and serialization.
- Added a new `util.rs` module for serialization helpers, streamlining the handling of `Arc` types in models.
…s and symbols

- Updated `CodeGraph` serialization and deserialization to support custom metadata plugins, improving flexibility in handling rich data.
- Introduced a new `StorageContext` trait for better management of string and path interning during storage conversion.
- Refactored `to_storage` and `from_storage` functions to utilize the new context, optimizing the handling of graph nodes and metadata.
- Removed unused fields from `SymbolLocation` to streamline the model and improve clarity.
- Enhanced Gradle and Java plugins to implement the new metadata handling, ensuring compatibility with the updated storage mechanisms.
…hutdown and move logic to `NaviscopeEngine`, and fix CLI blocking calls.
…date related models

- Replaced `smol_str` with `lasso` in various models to improve string handling and interning efficiency.
- Updated `GraphNode` and related structures to use `Symbol` for identifiers, enhancing performance and memory usage.
- Refactored `LanguageFeatureProvider` to work with the new `DisplayGraphNode` structure.
- Adjusted serialization and deserialization methods to accommodate changes in string representation.
- Removed deprecated dependencies and updated `Cargo.toml` and `Cargo.lock` accordingly.
- Introduced `tree-sitter-java` as a new dependency to support Java syntax parsing.
- Updated `symbol.rs` to replace `DocumentSymbol` and `SymbolInfo` with `DisplayGraphNode` for improved symbol representation.
- Enhanced the `EngineHandle` with methods to hydrate and convert nodes to display nodes, enriching the semantic analysis capabilities.
- Refactored various components to utilize the new display node structure, improving the overall code navigation experience.
- Updated tests to reflect changes in symbol handling and ensure compatibility with the new Java features.
…tation

- Replaced instances of `SymbolInfo` and `DocumentSymbol` with `DisplayGraphNode` across various modules to improve symbol handling and representation.
- Updated the `EngineHandle` methods to hydrate nodes with additional details, signatures, and modifiers, enriching the semantic analysis capabilities.
- Refactored the CLI and LSP components to utilize the new display node structure, enhancing code navigation and symbol querying.
- Adjusted tests to ensure compatibility with the updated symbol handling and display features.
- Deleted `.gitmodules` and removed submodule references for `tree-sitter-java` and `tree-sitter-groovy`.
- Updated `Cargo.toml` and `Cargo.lock` to include `tree-sitter-java` and `tree-sitter-groovy` as direct dependencies.
- Refactored build scripts and removed obsolete code related to submodule handling for Java and Groovy parsers.
- Cleaned up unused imports and methods in the CLI and Gradle components to streamline the codebase.
…CodeGraph structure

- Added unique instance IDs to CodeGraph for better concurrency management during updates.
- Refactored the update_files method to handle concurrent updates more gracefully, ensuring atomic updates to the current graph.
- Improved snapshot retrieval by clarifying the cloning process and ensuring accurate metadata handling.
- Updated deserialization to use a streaming decoder for better memory efficiency.
- Cleaned up imports and adjusted related methods to align with the new structure.
biuld added 4 commits February 1, 2026 19:04
… handling

- Eliminated the use of GLOBAL_POOL in favor of Arc for path management across multiple modules.
- Updated GraphOp operations to utilize Arc::from for improved memory safety and concurrency.
- Cleaned up imports related to GLOBAL_POOL to streamline the codebase.
Restructured the codebase to improve modularity, extensibility, and clarity. Key changes include:

- core:
  - Reorganized \`engine\` into \`runtime::orchestrator\` and \`facade\`.
  - Moved analysis logic into a unified \`features\` module (discovery, navigation, query).
  - Relocated parsing and resolution logic under \`ingest\`.
  - Introduced \`NodeMetadata\` and \`IndexMetadata\` traits for structured node attributes.
  - Streamlined \`model\` and \`storage\` layers.

- api:
  - Simplified graph and symbol models.
  - Removed redundant traits.

- language plugins (java, gradle):
  - Aligned with the new core structure and metadata traits.
  - Refactored plugin registration.

- tests: Updated all tests to reflect the new architecture.
- Enhanced language recognition by updating Gradle and Maven file handling in the Language model.
- Improved navigation logic to match both simple and display names for better symbol resolution.
- Refactored build tool identification to utilize dynamic language creation for improved extensibility.
- Updated Gradle plugin to reflect the correct language designation, ensuring consistency across the codebase.
- Updated version numbers from 0.2.1 to 0.5.0 in Cargo.toml files for all naviscope crates.
- Modified README to reflect new commands and features, including `get_guide`, `clear`, and `mcp` commands.
- Adjusted installation instructions for the Naviscope CLI to point to the correct path.
@biuld
biuld merged commit 188d828 into master Feb 1, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant