chore(conductor): Expand Tree-Sitter C/C++ track with new phases for tool parity and robust testing
This commit is contained in:
+2
-2
@@ -98,9 +98,9 @@ This file tracks all major tracks for the project. Each track has its own detail
|
|||||||
|
|
||||||
### Additional Language Support
|
### Additional Language Support
|
||||||
|
|
||||||
1. [~] **Track: Tree-Sitter C/C++ MCP Tools**
|
1. [ ] **Track: Tree-Sitter C/C++ MCP Tools**
|
||||||
*Link: [./tracks/ts_cpp_tree_sitter_20260308/](./tracks/ts_cpp_tree_sitter_20260308/)*
|
*Link: [./tracks/ts_cpp_tree_sitter_20260308/](./tracks/ts_cpp_tree_sitter_20260308/)*
|
||||||
*Goal: Add tree-sitter C and C++ grammars. Extend ASTParser to support C/C++ skeleton and outline extraction. Add MCP tools ts_c_get_skeleton, ts_cpp_get_skeleton, ts_c_get_code_outline, ts_cpp_get_code_outline.*
|
*Goal: Add tree-sitter C and C++ grammars. Extend ASTParser to support C/C++ skeleton and outline extraction. Add MCP tools ts_c_get_skeleton, ts_cpp_get_skeleton, ts_c_get_code_outline, ts_cpp_get_code_outline. (Extended: definitions, signatures, and surgical updates).*
|
||||||
|
|
||||||
2. [ ] **Track: Bootstrap gencpp Python Bindings**
|
2. [ ] **Track: Bootstrap gencpp Python Bindings**
|
||||||
*Link: [./tracks/gencpp_python_bindings_20260308/](./tracks/gencpp_python_bindings_20260308/)*
|
*Link: [./tracks/gencpp_python_bindings_20260308/](./tracks/gencpp_python_bindings_20260308/)*
|
||||||
|
|||||||
@@ -41,3 +41,51 @@ Focus: Verify C/C++ tools work correctly
|
|||||||
- [x] Task 4.2: Write tests for ts_cpp_get_skeleton 3bb850a
|
- [x] Task 4.2: Write tests for ts_cpp_get_skeleton 3bb850a
|
||||||
- [x] Task 4.3: Write tests for code outline tools 3bb850a
|
- [x] Task 4.3: Write tests for code outline tools 3bb850a
|
||||||
- [x] Task 4.4: Integration test - verify tools dispatch correctly 3bb850a
|
- [x] Task 4.4: Integration test - verify tools dispatch correctly 3bb850a
|
||||||
|
|
||||||
|
## Phase 5: Parity with Python Tools
|
||||||
|
Focus: Implement definitions, signatures, and update tools
|
||||||
|
|
||||||
|
- [ ] Task 5.1: Implement get_definition for C and C++
|
||||||
|
- WHERE: src/file_cache.py, src/mcp_client.py
|
||||||
|
- WHAT: Implement `ts_c_get_definition` and `ts_cpp_get_definition`
|
||||||
|
- HOW: Use AST to find node by name; return source range
|
||||||
|
- SAFETY: Follow allowlist checks
|
||||||
|
|
||||||
|
- [ ] Task 5.2: Implement get_signature for C and C++
|
||||||
|
- WHERE: src/file_cache.py, src/mcp_client.py
|
||||||
|
- WHAT: Implement `ts_c_get_signature` and `ts_cpp_get_signature`
|
||||||
|
- HOW: Extract code from start of definition until block start (`{`) or semicolon (`;`)
|
||||||
|
- SAFETY: Handles multi-line signatures and templates
|
||||||
|
|
||||||
|
- [ ] Task 5.3: Implement update_definition for C and C++
|
||||||
|
- WHERE: src/mcp_client.py
|
||||||
|
- WHAT: Implement `ts_c_update_definition` and `ts_cpp_update_definition`
|
||||||
|
- HOW: Use AST to find target range; surgically replace lines in file
|
||||||
|
- SAFETY: Verify AST still parses after edit (optional but recommended)
|
||||||
|
|
||||||
|
- [ ] Task 5.4: Register Phase 5 tools in dispatch and schema
|
||||||
|
- WHERE: src/mcp_client.py
|
||||||
|
- WHAT: Add tools to `get_tool_schemas` and `dispatch`
|
||||||
|
- HOW: Standard registration pattern
|
||||||
|
|
||||||
|
## Phase 6: Robust Testing with gencpp
|
||||||
|
Focus: Verify against real-world C++ components
|
||||||
|
|
||||||
|
- [ ] Task 6.1: Define test corpus from gencpp samples
|
||||||
|
- WHERE: tests/assets/gencpp_samples/
|
||||||
|
- WHAT: Collect complex C++ headers and implementations (templates, nested namespaces, multi-line macros)
|
||||||
|
- HOW: Copy selected files from gencpp repo into test assets
|
||||||
|
|
||||||
|
- [ ] Task 6.2: Run exhaustive skeleton/outline tests on gencpp corpus
|
||||||
|
- WHERE: tests/test_ts_cpp_tools.py
|
||||||
|
- WHAT: Verify no crashes and accurate extraction for complex C++ constructs
|
||||||
|
- HOW: Automated test loop over samples
|
||||||
|
|
||||||
|
- [ ] Task 6.3: Verify surgical updates on gencpp components
|
||||||
|
- WHERE: tests/test_ts_cpp_tools.py
|
||||||
|
- WHAT: Test `update_definition` on template methods and deeply nested classes
|
||||||
|
- HOW: Apply change, re-parse, verify integrity
|
||||||
|
|
||||||
|
- [ ] Task 6.4: Final audit and track closure
|
||||||
|
- WHERE: conductor/tracks.md
|
||||||
|
- WHAT: Mark track as completed and summarize results
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ Add tree-sitter-based C and C++ parsing support to the MCP client, providing ske
|
|||||||
- No C/C++ tree-sitter grammars installed
|
- No C/C++ tree-sitter grammars installed
|
||||||
- No C/C++ parsing logic in ASTParser
|
- No C/C++ parsing logic in ASTParser
|
||||||
- No MCP tools for C/C++ code extraction
|
- No MCP tools for C/C++ code extraction
|
||||||
|
- No MCP tools for C/C++ code modification (Parity with Python `py_update_definition`)
|
||||||
|
|
||||||
## Goals
|
## Goals
|
||||||
|
|
||||||
@@ -23,7 +24,9 @@ Add tree-sitter-based C and C++ parsing support to the MCP client, providing ske
|
|||||||
2. Extend ASTParser to support C and C++ languages
|
2. Extend ASTParser to support C and C++ languages
|
||||||
3. Implement skeleton and outline generation for C/C++ (functions, structs, enums, classes)
|
3. Implement skeleton and outline generation for C/C++ (functions, structs, enums, classes)
|
||||||
4. Add MCP tools: `ts_c_get_skeleton`, `ts_cpp_get_skeleton`, `ts_c_get_code_outline`, `ts_cpp_get_code_outline`
|
4. Add MCP tools: `ts_c_get_skeleton`, `ts_cpp_get_skeleton`, `ts_c_get_code_outline`, `ts_cpp_get_code_outline`
|
||||||
5. Register tools in mcp_client dispatch
|
5. Implement definition, signature, and update tools for C/C++ parity
|
||||||
|
6. Register tools in mcp_client dispatch
|
||||||
|
7. Validate tools against real-world C++ components from `gencpp` repository
|
||||||
|
|
||||||
## Functional Requirements
|
## Functional Requirements
|
||||||
|
|
||||||
@@ -45,11 +48,19 @@ Add tree-sitter-based C and C++ parsing support to the MCP client, providing ske
|
|||||||
| `ts_cpp_get_skeleton` | Returns C++ file skeleton (above + class methods, templates, namespaces) |
|
| `ts_cpp_get_skeleton` | Returns C++ file skeleton (above + class methods, templates, namespaces) |
|
||||||
| `ts_c_get_code_outline` | Returns hierarchical C outline (functions, structs, enums, globals with line ranges) |
|
| `ts_c_get_code_outline` | Returns hierarchical C outline (functions, structs, enums, globals with line ranges) |
|
||||||
| `ts_cpp_get_code_outline` | Returns hierarchical C++ outline (above + classes, templates, namespaces) |
|
| `ts_cpp_get_code_outline` | Returns hierarchical C++ outline (above + classes, templates, namespaces) |
|
||||||
|
| `ts_c_get_definition` | Get full source code of a specific C function or struct |
|
||||||
|
| `ts_cpp_get_definition` | Get full source code of a specific C++ class, function, or method |
|
||||||
|
| `ts_c_get_signature` | Get only the signature part of a C function |
|
||||||
|
| `ts_cpp_get_signature` | Get only the signature part of a C++ function or method |
|
||||||
|
| `ts_c_update_definition` | Surgically replace the definition of a C function or struct |
|
||||||
|
| `ts_cpp_update_definition` | Surgically replace the definition of a C++ class, function, or method |
|
||||||
|
|
||||||
### Tool Output Format
|
### Tool Output Format
|
||||||
Match existing Python tool formats for consistency:
|
Match existing Python tool formats for consistency:
|
||||||
- Skeleton: signatures + docstrings, bodies replaced with `...`
|
- Skeleton: signatures + docstrings, bodies replaced with `...`
|
||||||
- Outline: hierarchical list with `[Class] name (Lines X-Y)` format
|
- Outline: hierarchical list with `[Class] name (Lines X-Y)` format
|
||||||
|
- Definition: raw source code of the identified range
|
||||||
|
- Signature: code from start of definition until start of block/semicolon
|
||||||
|
|
||||||
## Non-Functional Requirements
|
## Non-Functional Requirements
|
||||||
|
|
||||||
@@ -68,5 +79,4 @@ Match existing Python tool formats for consistency:
|
|||||||
- Cross-file symbol resolution (AI uses search tools for this)
|
- Cross-file symbol resolution (AI uses search tools for this)
|
||||||
- Template instantiation analysis
|
- Template instantiation analysis
|
||||||
- Macro expansion
|
- Macro expansion
|
||||||
- gencpp integration (future separate track)
|
- gencpp integration (orchestrating gencpp logic itself is a separate track)
|
||||||
- Writing to C/C++ files (read-only for now)
|
|
||||||
|
|||||||
+17
-1
@@ -86,7 +86,11 @@ AGENT_TOOL_NAMES = [
|
|||||||
"py_find_usages",
|
"py_find_usages",
|
||||||
"py_get_imports",
|
"py_get_imports",
|
||||||
"py_check_syntax",
|
"py_check_syntax",
|
||||||
"py_get_hierarchy"
|
"py_get_hierarchy",
|
||||||
|
"ts_c_get_skeleton",
|
||||||
|
"ts_cpp_get_skeleton",
|
||||||
|
"ts_c_get_code_outline",
|
||||||
|
"ts_cpp_get_code_outline"
|
||||||
]
|
]
|
||||||
|
|
||||||
DEFAULT_TOOL_CATEGORIES: Dict[str, List[str]] = {
|
DEFAULT_TOOL_CATEGORIES: Dict[str, List[str]] = {
|
||||||
@@ -106,6 +110,18 @@ DEFAULT_TOOL_CATEGORIES: Dict[str, List[str]] = {
|
|||||||
"Surgical": ["get_file_slice", "set_file_slice", "edit_file"],
|
"Surgical": ["get_file_slice", "set_file_slice", "edit_file"],
|
||||||
"Web": ["web_search", "fetch_url"],
|
"Web": ["web_search", "fetch_url"],
|
||||||
"Analysis": ["py_find_usages", "py_get_imports", "py_check_syntax", "py_get_hierarchy"],
|
"Analysis": ["py_find_usages", "py_get_imports", "py_check_syntax", "py_get_hierarchy"],
|
||||||
|
"C/C++": [
|
||||||
|
"ts_c_get_skeleton",
|
||||||
|
"ts_cpp_get_skeleton",
|
||||||
|
"ts_c_get_code_outline",
|
||||||
|
"ts_cpp_get_code_outline",
|
||||||
|
"ts_c_get_definition",
|
||||||
|
"ts_cpp_get_definition",
|
||||||
|
"ts_c_get_signature",
|
||||||
|
"ts_cpp_get_signature",
|
||||||
|
"ts_c_update_definition",
|
||||||
|
"ts_cpp_update_definition"
|
||||||
|
],
|
||||||
"Runtime": ["run_powershell", "get_ui_performance"]
|
"Runtime": ["run_powershell", "get_ui_performance"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user