#tree-sitter #code-analysis #refactoring #ast

build splice

Span-safe refactoring kernel for 7 languages with Magellan code graph integration

22 releases (9 stable)

new 2.5.4 Feb 27, 2026
2.5.3 Feb 20, 2026
2.2.2 Jan 24, 2026
0.5.3 Jan 13, 2026
0.1.3 Dec 28, 2025

#218 in Build Utils


Used in forgekit-core

GPL-3.0-or-later

1.5MB
31K SLoC

splice

Crates.io Documentation

Version: 2.5.4

Span-safe refactoring kernel for 7 languages. Byte-accurate code editing with graph algorithm analysis.

Positioning: Precision editing tool for codebases indexed by Magellan. Use for cross-file rename, impact analysis, and verified refactoring.

Purpose

splice edits code with graph-aware safety. Built for:

  • Developers — Cross-file rename, safe refactoring with rollback
  • AI Assistants — Byte-accurate edits with proof-based verification
  • Tooling — Scriptable transformations with AST validation

Features

  • Span-safe editing — Byte-accurate replacements with tree-sitter validation
  • Cross-file rename — Symbol rename across entire codebase
  • Graph algorithms — Reachability, dead-code, cycles, condense, slice
  • Impact analysis — Blast zone detection before editing
  • Proof-based refactoring — Machine-checkable behavioral equivalence
  • 7 languages — Rust, Python, C, C++, Java, JavaScript, TypeScript

Quick Start

# Install
cargo install splice

# Requires Magellan database (create first)
magellan watch --root ./src --db code.v3

# Check status
splice status --db code.v3

# Find reachable code from main
splice reachable --symbol main --path src/main.rs --db code.v3

# Cross-file rename
splice rename --symbol old_name --to new_name --path src/lib.rs --db code.v3

Installation

cargo install splice

Or build from source with Native-V3 backend:

# Native-V3 backend (recommended - fastest)
cargo install splice --features native-v3 --no-default-features

Backends

Feature Description File Best For
native-v3 High-performance binary backend .v3 Production (recommended)
(default) SQLite backend .db Compatibility

Both backends provide identical refactoring capabilities.

Requirements

Documentation

What splice Does NOT Do

  • ❌ Index code (use Magellan)
  • ❌ Search code (use llmgrep)
  • ❌ CFG analysis (use Mirage)
  • ❌ Type checking (use Compiler/LSP)

License

GPL-3.0-or-later. See LICENSE.

Dependencies

~116MB
~3M SLoC