Skip to content

chore: Extensive architectural audit, graph engine fixes, and 35+ new… - #120

Merged
Anandb71 merged 3 commits into
mainfrom
audit-and-testing-overhaul
Apr 19, 2026
Merged

chore: Extensive architectural audit, graph engine fixes, and 35+ new…#120
Anandb71 merged 3 commits into
mainfrom
audit-and-testing-overhaul

Conversation

@Anandb71

Copy link
Copy Markdown
Collaborator

… tests

Description

Brief description of what this PR does. Link any related issues.

Fixes #(issue number)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Performance improvement
  • Code refactoring

Changes Made

  • List the key changes made in this PR
  • Be specific about files/modules affected

Testing

Describe how you tested your changes:

  • Ran cargo test --all
  • Ran cargo clippy --all
  • Ran flutter test (if applicable)
  • Tested manually with a real codebase

Screenshots (if applicable)

For visualizer changes, include before/after screenshots.

Checklist

  • My code follows the project's style guidelines
  • I have added tests for my changes
  • I have updated the documentation where necessary
  • All new and existing tests pass
  • I have added appropriate comments where the code isn't self-explanatory

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands Arbor’s language/file support and strengthens correctness via broad unit-test coverage, while also adjusting the graph engine to use a stable node-indexed backing graph.

Changes:

  • Extend default watched/supported extensions (TS/JS module variants, Python stubs) and add C# parsing support.
  • Switch ArborGraph to petgraph::StableDiGraph and add extensive graph/index/search/heuristics tests.
  • Add many new unit tests across server protocol/types, parsers, fallback parsing, and node semantics.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/arbor-server/src/sync_server.rs Adds more default watched extensions and adds serialization/config tests.
crates/arbor-server/src/protocol.rs Adds JSON-RPC protocol unit tests for responses and param defaults.
crates/arbor-graph/src/search_index.rs Changes empty-query behavior and adds additional index tests.
crates/arbor-graph/src/heuristics.rs Adds tests for heuristic detection and warning generation.
crates/arbor-graph/src/graph.rs Migrates to StableDiGraph and adds comprehensive graph behavior tests.
crates/arbor-graph/src/builder.rs Adds tests covering unresolved references and edge construction behavior.
crates/arbor-core/src/parser_v2.rs Adds multi-language parsing tests (Go/Java/C/C++/C#/etc.).
crates/arbor-core/src/node.rs Adds tests for NodeKind display, builder chaining, equality/hash, and defaults.
crates/arbor-core/src/languages/mod.rs Registers C# parser and updates supported extension lists.
crates/arbor-core/src/languages/csharp.rs Introduces a new Tree-sitter-based C# parser + unit tests.
crates/arbor-core/src/fallback_parser.rs Improves Kotlin fallback parsing and adds broader fallback parser tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/arbor-server/src/sync_server.rs Outdated
Comment on lines +773 to +794
// Verify all primary extensions from arbor_core::languages are present
let required = vec![
"ts", "tsx", "mts", "cts", "js", "jsx", "mjs", "cjs", "rs", "py", "pyi", "go", "java",
"c", "h", "cpp", "hpp", "cc", "hh", "cxx", "hxx", "cs", "dart", "kt", "kts", "swift",
"rb", "php", "phtml", "sh", "bash", "zsh",
];

for ext in &required {
assert!(
exts.contains(&ext.to_string()),
"SyncServerConfig is missing extension: {}",
ext
);
}
}

#[test]
fn test_focus_node_serialization() {
let msg = BroadcastMessage::FocusNode(FocusNodePayload {
node_id: "abc123".to_string(),
file: "main.rs".to_string(),
line: 42,

Copilot AI Apr 19, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test says it verifies extensions from arbor_core::languages, but the required list is hard-coded and duplicates that source of truth. To avoid drift when supported_extensions() changes, consider deriving required from arbor_core::languages::supported_extensions() (or comparing sets) instead of maintaining two lists.

Suggested change
// Verify all primary extensions from arbor_core::languages are present
let required = vec![
"ts", "tsx", "mts", "cts", "js", "jsx", "mjs", "cjs", "rs", "py", "pyi", "go", "java",
"c", "h", "cpp", "hpp", "cc", "hh", "cxx", "hxx", "cs", "dart", "kt", "kts", "swift",
"rb", "php", "phtml", "sh", "bash", "zsh",
];
for ext in &required {
assert!(
exts.contains(&ext.to_string()),
"SyncServerConfig is missing extension: {}",
ext
);
}
}
#[test]
fn test_focus_node_serialization() {
let msg = BroadcastMessage::FocusNode(FocusNodePayload {
node_id: "abc123".to_string(),
file: "main.rs".to_string(),
line: 42,
// Verify all supported extensions from arbor_core::languages are present.
let required: std::collections::HashSet<String> =
arbor_core::languages::supported_extensions()
.iter()
.map(|ext| ext.to_string())
.collect();
let actual: std::collections::HashSet<String> = exts.iter().cloned().collect();
for ext in &required {
assert!(
actual.contains(ext),

Copilot uses AI. Check for mistakes.
Comment on lines +392 to +396
}

/// Extracts method call references.
fn extract_call_references(node: &Node, source: &str) -> Vec<String> {
let mut refs = Vec::new();

Copilot AI Apr 19, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C# default accessibility differs by context: top-level types default to internal, interface members default to public, while class/struct members default to private. Returning Visibility::Private as the blanket default will mislabel many symbols. Consider determining the default from the parent node kind (namespace/compilation_unit vs interface vs class/struct) or threading context into detect_visibility so defaults match C# semantics.

Copilot uses AI. Check for mistakes.
@Anandb71
Anandb71 merged commit a90b3bb into main Apr 19, 2026
5 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.

2 participants