splice
Version: 2.8.0
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
- Grounded 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
- Code completion — Grounded, import-aware suggestions using Magellan database
- Cross-file symbol resolution via import tracking
- Distinguishes local vs imported symbols with source tracking
- Token filtering and enhanced ranking for imported symbols
- Performance: low-millisecond internal query time on indexed project databases
- 7 languages — Rust, Python, C, C++, Java, JavaScript, TypeScript
- Library API — Use as a Rust crate for programmatic refactoring (forge, agents)
Quick Start
# Install
# Requires Magellan database (create first)
# Check status
# Find reachable code from main
# Cross-file rename
# Code completion (import-aware)
Library Usage
Splice exposes a library API for programmatic use. Add to Cargo.toml:
[]
= { = "2.8", = false, = ["sqlite"] }
High-Level API (forge integration)
use forge;
// Patch a symbol with new content (resolves via SymbolNavigator)
let result = patch_symbol_in_file?;
// Rename across all files
let result = rename_symbol_across_files?;
// Preview without writing
let preview = preview_patch_symbol?;
// Resolve symbol to byte span
let span = resolve_symbol_span?;
Low-Level API
use ;
use ;
use ;
use ;
Installation
Backends
| Feature | Description | File | Best For |
|---|---|---|---|
| (default) | SQLite backend | .db |
Compatibility |
geometric |
Geometric analysis backend (no-op) | .geo |
Reserved for future use |
Requirements
- Magellan 4.2+ — Required for code graph
- sqlitegraph 3.0.3+ — Included automatically
Documentation
- MANUAL.md — Complete command reference and examples
- CHANGELOG.md — Version history
- docs/API.md — Library API reference
- docs/completion.md — Code completion feature 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. See LICENSE.