Skip to content

refactor: reduce tree-sitter query duplication between zeph-tools and zeph-index #1968

@bug-ops

Description

@bug-ops

Context

PR #1966 removed the zeph-index dependency from zeph-tools to fix a same-layer violation. This required inlining tree-sitter language detection and grammar/query setup in search_code.rs.

Found by: impl-critic (IMP-03)

Problem

  • Tree-sitter symbol queries are now duplicated between zeph-tools::search_code and zeph-index::languages
  • This was an accepted trade-off to break the same-layer dependency, but creates drift risk
  • If language queries are updated in one place but not the other, results will diverge

Possible approaches

  1. Extract shared tree-sitter queries to zeph-common (Layer 0)
  2. Create a thin zeph-treesitter crate at Layer 0 for shared grammar/query definitions
  3. Accept the duplication and add a test that verifies query parity

Acceptance criteria

  • Either single source of truth for tree-sitter queries, or automated parity verification
  • Layered architecture preserved

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions