Skip to content

feat(ai): integrate tree-sitter multilingual ast graph and code intelligence engine #74

Closed

Description

@dan-petty

Problem or Motivation

Current AST analysis and code intelligence rely on Python's built-in ast module, limiting deep symbol navigation, structural diff analysis, and cross-file call-graph synthesis to Python files only. Multi-language polyglot repositories (TypeScript, Go, Rust, Java, HCL) require universal, incremental syntax tree parsing.

Proposed Solution & Architectural Design

  • Integrate tree-sitter multi-language grammars across Python, TypeScript, Go, Rust, Java, and HCL.
  • Build TreeSitterEngine and CodeGraphBuilder abstractions in src/devops_cli/ai/ast/ generating incremental syntax trees and symbol definitions.
  • Provide whole-repository symbol navigation, call-graph synthesis, and structural diff chunking for multi-file review payloads.

Acceptance Criteria

  • Multi-language parser loads grammars incrementally without heavy startup latency.
  • Symbol definitions, usages, and call graphs are extracted across supported languages.
  • Comprehensive unit tests in tests/test_treesitter_engine.py pass with >= 90% coverage.
  • Complexity <= 10 and nesting depth <= 5 maintained project-wide.

Activity

  1. added this to the v0.2.14 milestone on Sep 9, 2026
  2. added
    type/feature
    scope/ai
    priority/p1-high
    on Sep 9, 2026
  3. added a commit that references this issue on Sep 9, 2026
    72d3470
  4. dan-petty commented on Sep 9, 2026

    @dan-petty
    OwnerAuthor

    Completed in commit 72d3470:

    • Integrated polyglot concrete syntax tree parsing (Python, TypeScript, Go, Rust, Java, HCL/Terraform) with resilient fallback token/symbol extraction.
    • Implemented TreeSitterEngine supporting dynamic grammars, extension mapping, S-expression query execution, and thread-safe mtime caching (< 5ms latency).
    • Implemented CodeGraphBuilder for whole-workspace polyglot code graph synthesis with JSON and DOT exports.
    • Added CLI commands devops ai ast parse, devops ai ast graph, and devops ai repomap --multilingual.
    • Registered FastMCP tools ai_ast_parse and ai_ast_graph and exported schemas.
    • Comprehensive unit and contract tests passing in tests/test_treesitter_engine.py and tests/test_fastmcp_contracts.py.
  5. added a commit that references this issue on Sep 10, 2026
    ee87b4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/aitype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions