Skip to content

feat: implement full spy-code codebase — replace all stubs with working code#2

Merged
Psyborgs-git merged 1 commit into
mainfrom
copilot/explore-codebase-implement-stubs
Apr 12, 2026
Merged

feat: implement full spy-code codebase — replace all stubs with working code#2
Psyborgs-git merged 1 commit into
mainfrom
copilot/explore-codebase-implement-stubs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

The project was at ~M3 with all crates beyond spy-core/spy-storage/spy-resolvers(Rust-only) either stubbed or missing key functionality. This PR completes M4–M9: multi-language parsing, git integration, full GraphQL/MCP wiring, and incremental indexing.

spy-git

Full git integration via std::process::Command (no gix — feature-flag hell). Implements GitRepo::discover(), current_sha(), is_dirty(), diff_files_since(), files_changed_since_ref().

spy-parser + spy-resolvers

Extends Rust-only parser to Python, TypeScript, JavaScript, Go by upgrading tree-sitter 0.24→0.26 and adding grammar crates. Each language gets a resolver extracting:

  • Functions/methods with typed signatures
  • Classes/structs/interfaces
  • Module-level constants
  • Call edges (BFS-resolved against ProjectScope)
  • Doc comments / docstrings / JSDoc

Special handling: @overload collapse for Python/TypeScript merges overload variants into a single node with multiple signatures.

spy-storage

Added list_files() and get_nodes_for_files(file_paths) — both needed by graph and MCP layers.

spy-graph

  • files query: now queries DB instead of returning []
  • changedSince(ref): shells to git diff --name-only, maps changed paths to indexed nodes
  • callers/callees: upgraded from single-hop to multi-hop BFS via depth param

spy-indexer

  • Multi-language file discovery (.rs/.py/.ts/.tsx/.js/.go) with configurable ignore dirs
  • Two-pass indexing: pass 1 extracts nodes (builds ProjectScope), pass 2 extracts edges using full scope — necessary because call resolution requires the complete node set
  • Git-based incremental mode: git diff <last_sha>..HEAD --name-status → parse only changed/added files, delete nodes for removed files, handle renames
  • Content-hash fallback when outside a git repo

spy-mcp

Full stdio JSON-RPC 2.0 MCP server. Seven tools: query_graph, get_node, search, find_callers, find_callees, changed_since, stats. Three resources: spy-code://schema, spy-code://stats, spy-code://config.

spy-cli

Wired cmd_changed (git diff → node list) and cmd_serve --mcpspy_mcp::run_mcp_server. Fixed depth arg passthrough in callers/callees.

Tests

6 integration tests in spy-indexer/tests/integration.rs covering all 4 language fixture sets plus an incremental-skip test. Fixture files added under tests/fixtures/{rust,python,ts,go}_sample/.

…, mcp, indexer, cli)

Agent-Logs-Url: https://github.com/Psyborgs-git/spy-code/sessions/13b2dd1e-b57b-4695-ab51-e299e0a9a3eb

Co-authored-by: Psyborgs-git <49641518+Psyborgs-git@users.noreply.github.com>
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