splice 2.4.0

Span-safe refactoring kernel for 7 languages with Magellan code graph integration
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
# Changelog

Format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
Project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.4.0] - 2026-02-04

### Fixed

**Preview Mode JSON Output**
- `splice patch --preview --json` now returns structured JSON response
  - `data.preview_report` with full PreviewReport struct (file, line_start, line_end, lines_added, lines_removed, bytes_added, bytes_removed)
  - `data.files` array with affected file entries
  - `data.symbol` at top level for symbol name
  - Consistent with CliSuccessPayload pattern used by other commands

### Changed

**Documentation**
- Updated README.md following llmgrep format with badges, toolset diagram, and references
- Rewrote MANUAL.md (condensed from 1654 to 342 lines)
- Added comprehensive command reference and examples
- Updated .gitignore to only track README.md, CHANGELOG.md, MANUAL.md

## [2.3.0] - Unreleased

### Magellan v2 Integration — Cross-File Rename and Semantic Program Transformation

This release delivers Magellan v2 integration with cross-file rename, impact analysis, dead code detection, cycle detection, graph condensation, program slicing, and proof-based refactoring. Five phases with 25 plans bring advanced semantic program transformation capabilities to Splice.

### Added

**Preview Mode JSON Output**
- `splice patch --preview --json` now returns structured JSON response
  - `data.preview_report` with full PreviewReport struct (file, line_start, line_end, lines_added, lines_removed, bytes_added, bytes_removed)
  - `data.files` array with affected file entries
  - `data.symbol` at top level for symbol name
  - Consistent with CliSuccessPayload pattern used by other commands

This release delivers Magellan v2 integration with cross-file rename, impact analysis, dead code detection, cycle detection, graph condensation, program slicing, and proof-based refactoring. Five phases with 25 plans bring advanced semantic program transformation capabilities to Splice.

### Added

**Cross-File Rename**
- `splice rename` command with byte-accurate reference replacement across files
  - Uses Magellan ReferenceFact byte offsets for precise span targeting
  - `--symbol <id>` for symbol identification (16-char hex V1 or 32-char hex V2)
  - `--file <path>` for definition file location
  - `--to <new_name>` for the new symbol name
  - `--preview` flag for dry-run mode with colored diff output
  - `--proof` flag for generating refactoring proofs
  - Automatic backup and rollback on validation failures
  - UTF-8 boundary validation for safe multi-byte character handling
  - Multi-language support (C, C++, Java, JavaScript, Python, TypeScript)
  - SPL-E040 error code for ambiguous symbol detection
  - Sorted references by (file_path, byte_start descending) for safe in-order replacement

**Impact Analysis Commands**
- `splice reachable` — Show all symbols reachable from a target symbol
  - `--symbol <name>` and `--path <file>` for target specification
  - `--direction <forward|backward>` for traversal direction
  - `--max-depth <n>` for depth limiting (default: 10)
  - BFS traversal with visited set to avoid cycles
  - Affected file identification

- `splice slice` — Forward or backward program slicing
  - `--target <id>` for symbol ID
  - `--direction <forward|backward>` for slice direction
  - `--max-distance <n>` for maximum slice distance
  - Distance tracking and affected file analysis

**Dead Code Detection**
- `splice dead-code` command for finding unused symbols from entry points
  - `--entry <symbol>` and `--path <file>` for entry point specification
  - `--exclude-public` flag to exclude public symbols from analysis
  - BFS traversal from entry point with visited tracking
  - Public symbol detection heuristics (uppercase first char for Rust functions, kind-based for types)

**Cycle Detection**
- `splice cycles` command for finding circular dependencies in call graph
  - Tarjan's SCC algorithm implemented directly in MagellanIntegration
  - `--max-cycles <n>` for limiting output (default: 100)
  - `--show-members` flag for displaying all cycle members
  - Cycles defined as SCCs with size > 1 OR self-loops
  - Representative symbol selected as alphabetically first member

**Graph Condensation**
- `splice condense` command for collapsing SCCs to DAG
  - Kahn's algorithm for topological level assignment
  - Edge weight tracking between SCCs (coupling strength)
  - `--show-levels` flag for topological level display
  - `--show-members` flag for SCC member display

**Proof-Based Refactoring**
- `splice rename --proof` flag for generating machine-checkable proofs
  - Before/after graph snapshots with symbol counts
  - Invariant validation (reference counts, orphan detection, ID stability, entry points)
  - SHA-256 checksums for audit trail integrity
  - `splice validate-proof --proof <path>` command for proof validation
  - RefactoringProof, GraphSnapshot, InvariantCheck data structures
  - JSON proof file format with version "1.0.0"

**Dual-Format SymbolId Support**
- V1: 16-character hex (SHA-256, first 8 bytes) — backward compatible
- V2: 32-character hex (BLAKE3, first 16 bytes) — new default
- `SymbolId::parse()` for auto-detection (16 or 32 chars)
- `id_format` field in JSON output ("v1" or "v2")
- Backward compatibility: find_symbol_by_id tries V2 first, then V1

**Magellan Database Migration**
- Magellan 2.0.0 auto-migration support (v5 to v6 schema)
- BLAKE3-based symbol IDs for new databases
- `--backup` flag defaults to true for migration safety
- `--dry-run` mode for migration status checking

### Changed

**Dependencies**
- Magellan 2.1.0 (was 2.0.0) — BLAKE3 symbol IDs, ReferenceFact byte offsets
- SQLiteGraph 1.4.2 (was 1.2.7) — Native V2 backend with BLAKE3 support
- sha2 0.10.9 retained for backward compatibility during migration
- blake3 1.5.0 for new symbol ID generation

**Test Coverage**
- 407+ passing tests (from 334 in v2.2.4)
- 18 cross-file rename integration tests with multi-language coverage
- 6 performance regression tests for graph algorithms (<1s target for 1K symbols)
- 3 integration tests for invariant validation

**Documentation**
- Updated README with v2.3 feature highlights
- Extended manual with cross-file rename and graph algorithm documentation
- Three new example files: rename_examples.md, graph_algorithm_examples.md, proof_examples.md
- CI/CD integration patterns and troubleshooting sections

### Performance

Graph algorithm performance benchmarks (Criterion):
- Reachability (1K symbols): 5-15ms
- Dead code detection (1K symbols): 10-25ms
- Cycle detection (1K symbols): 20-40ms
- Graph condensation (1K symbols): 15-35ms
- Program slicing (1K symbols): 25-60ms

All algorithms meet the <1s target for 1K symbols.

### Technical Notes

- **Cross-file rename**: Uses Magellan ReferenceFact byte offsets for exact span targeting. Rust reference extraction not yet available in Magellan 2.0.0 — tests use manual span detection as workaround.
- **Graph algorithms**: Implemented directly in MagellanIntegration using in-process library delegation (not subprocess).
- **Proof format**: Versioned schema "1.0.0" with before/after snapshots, invariant checks, and checksums.
- **Migration**: Magellan 2.0.0 databases auto-migrate on open. V5 databases use SHA-256, V6 use BLAKE3.

## [2.2.4] - 2026-02-04

### Removed

**Dead Code Cleanup**
- Removed unused `Ingestor` struct from `src/ingest/mod.rs`
  - This was an abandoned design for custom CodeGraph-based indexing
  - Replaced by Magellan integration (v0.5.0) which provides production-quality multi-language code graph
  - Use `MagellanIngestor` or `extract_symbols()` instead
  - No functional changes - the struct was never implemented

### Changed

**Documentation**
- Updated `.planning/codebase/ARCHITECTURE.md` to remove Ingestor references
- Clarified that `MagellanIngestor` is the preferred ingestion API
- Closed TODO items related to Ingestor cleanup

## [2.2.3] - 2026-02-02

### Fixed

**SQLiteGraph 1.2.7 MVCC API Compatibility**
- All `get_node()` calls now include `SnapshotId(0)` parameter for latest committed state
- All `neighbors()` calls now include `SnapshotId(0)` parameter for latest committed state
- Fixes compatibility with sqlitegraph 1.2.7's snapshot isolation system

### Changed

**Dependencies**
- sqlitegraph 1.2.7 (was 1.2.5) - requires explicit SnapshotId parameter for graph queries

### Technical Notes

- **Affected files**: `src/graph/mod.rs` (lines 277, 328) and `src/relationships/mod.rs` (lines 201, 267, 318, 340, 377)
- **SnapshotId(0)** represents the latest committed snapshot in sqlitegraph's MVCC system
- All graph queries now explicitly specify snapshot isolation level
- No functional changes to CLI output or behavior

## [2.2.2] - 2026-01-24

### Magellan Integration — Unified CLI Interface

This release delivers a unified CLI interface where Splice provides both Magellan query commands and span-safe editing through a single tool. Five phases with 24 plans bring comprehensive code graph query capabilities alongside Splice's refactoring features.

### Added

**Query Commands (Magellan Delegation)**
- `splice status` — Display database statistics (files, symbols, references, calls, code_chunks counts)
- `splice query` — List symbols in a file with optional context/relationship flags
- `splice find` — Locate symbols by name or symbol_id with disambiguation support
- `splice refs` — Show callers/callees for a symbol with bidirectional traversal
- `splice files` — List indexed files with optional symbol counts per file
- `splice export` — Export graph data in JSON, JSONL, or CSV format

**CLI Enhancements**
- `--output` flag supports human (default), json, and pretty formats
- `--db` flag specifies database path and delegates to Magellan
- Exit codes match Magellan conventions (0=success, 1=error, 2=usage, 3=database, 4=file not found, 5=validation)
- Command categories in help (Query, Edit, Export, Validation)

**Data Format Alignment**
- Symbol IDs use 16-character hex format (SHA-256 hash, first 8 bytes)
- Execution IDs use {timestamp_hex}-{pid_hex} format for delegated queries
- Field name translation between Magellan (start_line) and Splice (line_start) conventions
- Response types: StatusResponse, FindResponse, RefsResponse, FilesResponse

**Error Handling**
- SPL-E091 Magellan error code with original error preserved in chain
- anyhow::Error source preservation for complete error context

**Documentation**
- Comprehensive Magellan integration guide (docs/magellan_integration.md — 1030 lines)
- LLM usage patterns and workflow examples
- Performance benchmarks and characteristics

### Changed

**Dependencies**
- Added `csv = "1.3"` for CSV export format
- Added `anyhow = "1.0"` for error chain preservation

**Test Coverage**
- 21 new integration tests covering commands, formats, errors, LLM workflows, and performance
- All query commands validated end-to-end
- Export format validation tests for JSON, JSONL, CSV

### Technical Notes

- **Single-Tool Workflow**: LLMs can now discover and edit code using one tool
- **In-Process Delegation**: Uses Magellan as library, not subprocess
- **Export Schema**: Versioned schema (1.0.0) with files, symbols, references, calls

## [2.2.1] - 2026-01-24

### Code Quality & Bug Fixes

This release addresses 67 issues identified in comprehensive bug analysis, improving code reliability and safety.

### Fixed

**Critical Error Handling**
- Eliminated unwrap() panic paths in symbol resolution, parser creation, and file loading
- Proper error propagation throughout all language modules

**Lifetime & Resource Safety**
- Fixed 'static lifetime abuses in parser creation
- Improved UTF-8 handling across all language modules
- Removed excessive clone() patterns

**API Consolidation**
- Merged duplicate parser creation APIs
- Unified import extraction implementations
- Consolidated resolve_symbol variants

### Changed

- 20 plans across 3 phases
- 70 files created/modified
- Improved testability with configurable execution logging

## [2.2.0] - 2026-01-23

### Unified JSON & LLM Optimization

This release introduces unified JSON schema across all LLM tools with rich span extensions optimized for AI agent consumption and human-friendly CLI improvements.

### Added

**Rich Span Extensions**
- Context fields for all operations (file_path, symbol_name, language)
- Semantic kind labels (function, method, class, struct, etc.)
- Checksums for change verification (SHA-256)
- Structured error codes with SPL-E### format

**Rich Span Advanced**
- Relationships (callers, callees, imports, exports)
- Tool hints for safe operations
- Suggested actions for common workflows

**CLI Conventions**
- `-n` dry-run flag for preview mode
- `-A`/`-B`/`-C` context flags (lines before/after/around)
- Unified diff output with TTY colors
- Git-style exit codes

**Enhanced Errors**
- Severity levels (error, warning, info)
- Precise locations (file, line, column)
- Fuzzy symbol suggestions
- `splice explain` command for error details

**Symbol Expansion**
- AST-aware parent chain walking
- Multi-level expansion with `--expand-level`
- 6 language expanders (Rust, Python, C, C++, Java, JavaScript, TypeScript)

**Search & Apply**
- `splice search --pattern` with glob filtering
- Atomic find-and-replace with rollback capability

### Changed

- 8 phases, 55 plans
- 340+ tests passing
- Magellan alignment for unified CLI

## [2.0.0] - 2026-01-18

### Major Release - Comprehensive Overhaul

This release represents a complete overhaul of Splice's internal architecture, safety, and observability. The codebase has been refactored across 10 phases with 31 individual plans, 133 commits, and significant improvements to code quality and test coverage.

### Added

**Safety Foundation**
- Eliminated all `unwrap()` calls from production code paths
- Established consistent error handling patterns using `?` operator
- Added context helpers for better error messages

**Structured Output & Identifiers**
- All operations now return structured JSON with explicit fields
- `execution_id` (UUID): Unique identifier for each operation run
- `match_id`: Unique identifier for each symbol match
- `span_id`: Unique identifier for each span operation
- Line and column coordinates included in all output (byte + line/col)
- Deterministic ordering across all operations (sorted results)

**Validation & Observability**
- SHA-256 checksums for pre/post-operation verification
- Execution logging audit trail in `.splice/operations.db`
- `splice log` command to query execution history
- Filters: operation_type, status, date_range, execution_id
- Output formats: table (human), JSON (machine)
- Statistics summary option

**Integration Tests**
- 26 Magellan integration tests (all 7 languages)
- 18 cross-language compatibility tests
- End-to-end refactoring workflow tests
- Total: 215+ passing tests

### Changed

**Dependencies**
- SQLiteGraph upgraded from 0.2.11 to 1.0 with Native V2 backend
- Magellan upgraded to 0.5.3 with native-v2 features
- tree-sitter upgraded from 0.21 to 0.22
- Added `uuid` for execution ID generation
- Added `chrono` for timestamp handling
- Added `rusqlite` for execution log database access
- Added `sha2` for checksum computation

**Architecture**
- New modules:
  - `src/execution/` - Execution logging infrastructure
  - `src/output/` - Structured output types
  - `src/checksum.rs` - SHA-256 checksum computation
  - `src/verify.rs` - Validation hooks
- Refactored error handling throughout codebase
- Improved test organization and coverage

### Technical Notes

- **Breaking Change**: JSON output format now includes new required fields (execution_id, match_id, span_id)
- **Databases**: `.splice/operations.db` created for audit trail (separate from codegraph.db)
- **Test Status**: 215+ tests passing. Some existing tests have known failures due to hardcoded paths in test fixtures.
- **Backward Compatibility**: Existing codegraph.db files remain compatible

### Migration from v0.5.x

- JSON output now includes additional identifier fields
- Execution logging is enabled by default (set `SPLICE_EXECUTION_LOG=false` to disable)
- Validation hooks run automatically (can be skipped with `--no-validate` for apply-files)

## [0.5.3] - 2026-01-13

### Fixed

- Handle broken pipe when stdout closes early (e.g., piping `splice query` to `head`)

### Changed

- Bumped Magellan dependency to 0.5.3

## [0.5.0] - 2026-01-02

### Added

- **Magellan v0.5.0 integration**: Complete code indexing and label-based symbol discovery
  - `splice query --db <FILE>` command for querying symbols by labels
  - `splice get --db <FILE> --file <PATH> --start <N> --end <N>` command for retrieving code chunks
  - Multi-label queries with AND semantics (e.g., `--label rust --label fn` for all Rust functions)
  - `--list` flag to show all available labels with entity counts
  - `--count` flag to count entities with specified label(s)
  - `--show-code` flag to display source code without re-reading files
  - `src/graph/magellan_integration.rs` with MagellanIntegration wrapper
  - `src/ingest/magellan.rs` with MagellanIngestor for multi-language indexing
  - Code chunk storage during indexing for fast retrieval
  - Label queries: language labels (rust, python, etc.) and symbol kind labels (fn, struct, class, etc.)

### Changed

- **334 passing tests** (from 368 - test count adjustment)
- Updated sqlitegraph dependency to 0.2.11
- Ingest module now uses Magellan's parsers instead of "Not implemented yet"

### Technical

- New modules: `src/graph/magellan_integration.rs` (203 LOC), `src/ingest/magellan.rs` (76 LOC)
- New dependency: `magellan = "0.5.0"`
- Magellan provides working multi-language parsers (7 languages)
- Code chunks stored with byte spans eliminate need to re-read source files during refactoring
- Labels assigned automatically during indexing: language + symbol kind

## [0.4.1] - 2025-12-31

### Added

- **Batch patch API**: Apply multiple patches across multiple files in a single atomic operation
  - `splice patch --batch <file.json>` for JSON-based batch operations
  - Atomic rollback if any patch in the batch fails validation
  - Per-file hash tracking for audit trails
  - Batch specification documented in `docs/BATCH_PATCH_SPEC.md`

- **Preview mode**: Dry-run functionality to inspect changes before applying
  - `--preview` flag for `patch` command
  - Clones workspace, applies changes, runs validation, reports stats
  - Workspace remains untouched on preview
  - Preview flow documented in `docs/PREVIEW_FLAG.md`

- **Backup and undo support**: Create backups and restore from them
  - `--create-backup` flag for `patch`, `delete`, and `apply-files` commands
  - `--operation-id <ID>` for custom operation tracking (auto-generated UUID if not provided)
  - `splice undo --manifest <path>` command to restore from backup
  - Backups stored at `.splice-backup/<operation-id>/` with SHA-256 hash verification
  - `BackupWriter`, `BackupManifest`, and `restore_from_manifest` in `src/patch/backup.rs`

- **Operation metadata tracking**: Attach metadata to operations for auditing
  - `--metadata <JSON>` flag for optional metadata attachment
  - Response payloads include `operation_id`, `span_ids`, `metadata`, `files_modified`
  - File hash tracking (`before_hash`, `after_hash`) for all patch operations

- **Multi-file pattern replacement**: AST-confirmed find/replace across files
  - `splice apply-files --glob <pattern> --find <text> --replace <text>` command
  - Glob-based file discovery (e.g., `tests/**/*.rs`, `src/**/*.py`)
  - AST confirmation ensures replacements land in valid code locations
  - Comment filtering (skips matches in comments unless pattern starts with `//`)
  - `src/patch/pattern.rs` with `find_pattern_in_files()` and `apply_pattern_replace()`

- **Structured error responses**: Complete tool metadata in diagnostics
  - Tool path and version tracking (`cargo --version`, compiler versions)
  - Remediation links for common errors
  - Full diagnostic payload: `{tool, level, file, line, column, message, code, note, tool_path, tool_version, remediation}`
  - Documented in `docs/DIAGNOSTICS_OUTPUT.md`

### Changed

- **368 passing tests** (from 339)
- Updated all documentation for new features
- Patch module extended with batch, pattern, and backup capabilities
- CLI responses now include operation metadata for all commands

### Technical

- New modules: `src/patch/backup.rs` (437 LOC), `src/patch/batch_loader.rs`, `src/patch/pattern.rs` (347 LOC)
- New dependencies: `uuid = "1.10"`, `chrono = "0.4"`, `glob = "0.3"`
- Removed unnecessary `unsafe` block from tree-sitter language getter
- Response payloads standardized across all commands

## [0.4.0] - 2026-01-01

### Added
- Documentation: `docs/DIAGNOSTICS_HUMAN_LLM.md` explains the CLI diagnostics JSON contract, shows how rust-analyzer output is normalized, and references the per-language validator outputs so humans and LLMs use the same structured payload.

## [0.3.1] - 2025-12-31

### Fixed
- **Rust impl blocks now extract struct name** - `impl_item` nodes now properly extract the struct name
  - Previously: Used `child_by_field_name("name")` which doesn't exist for `impl_item`, causing impl blocks to be skipped
  - Now: Uses `child_by_field_name("type")` to extract the struct name being implemented
  - Works for both `impl StructName { }` and `impl Trait for StructName { }`

### Added
- `extract_impl_name()` helper function to Rust parser
- 3 new tests: `test_extract_impl_name_inherent`, `test_extract_impl_name_trait_impl`, `test_extract_impl_name_both`

## [0.3.0] - 2025-12-30

### Added

- **Multi-language patch support**: Full patch command now works on all 7 supported languages
- **Multi-language delete support**: Basic delete (definition-only) for non-Rust languages
- **Language auto-detection**: Automatic language detection from file extensions
- **--language flag**: Optional language override for CLI commands
- **Python validation**: `python -m py_compile` gate for Python files
- **C/C++ validation**: `gcc`/`g++ -fsyntax-only` gates for C/C++ files
- **Java validation**: `javac` compilation gate for Java files
- **JavaScript validation**: `node --check` gate for JavaScript files
- **TypeScript validation**: `tsc --noEmit` gate for TypeScript files
- **Extended symbol kinds**: Added method, class, interface, constructor, variable, type-alias kinds

### Changed

- **339 passing tests** (from 298)
- Updated all documentation for multi-language support
- Patch module now language-aware with language-specific compiler validation
- Graph schema uses language-agnostic labels (e.g., `symbol_function` instead of `rust_function`)

### Supported Languages

| Language | Extensions | Delete | Patch | Validation |
|----------|-----------|--------|-------|------------|
| Rust | `.rs` | Full | Full | `cargo check` |
| Python | `.py` | Basic | Full | `python -m py_compile` |
| C | `.c`, `.h` | Basic | Full | `gcc -fsyntax-only` |
| C++ | `.cpp`, `.hpp`, `.cc`, `.cxx` | Basic | Full | `g++ -fsyntax-only` |
| Java | `.java` | Basic | Full | `javac` |
| JavaScript | `.js`, `.mjs`, `.cjs` | Basic | Full | `node --check` |
| TypeScript | `.ts`, `.tsx` | Basic | Full | `tsc --noEmit` |

### Technical

- Language-specific tree-sitter parsers for all 7 languages
- Multi-language validation gates with compiler-specific error parsing
- Language detection from file extensions with manual override
- Symbol kind mapping across all languages

## [0.2.2] - 2025-12-30

### Changed

- Clarified documentation: CLI commands are Rust-only; parsers for other languages are library-use/future
- Fixed README: correctly identify rust-analyzer as LSP, not IDE

## [0.2.1] - 2025-12-30

### Changed

- Clarified delete command guarantees: workspace scope, exclusions, invariants
- Added Feedback section to README

## [0.2.0] - 2025-12-30

### Added

- **delete command**: Remove symbol definitions and all their references
- **Cross-file reference finding**: Tracks and removes references across multiple files
- **Shadowing detection**: Correctly handles local variables that shadow imported symbols
- **Re-export chain following**: Finds references through `pub use` re-exports (single-hop; chained not guaranteed)
- **Trait method reference detection**: Handles `value.method()`, `Trait::method()`, and `Type::method()` patterns
- **Multi-language support**: Import extraction for C/C++, Java, JavaScript, Python, TypeScript

### Behavior Guarantee (delete command)

For **public Rust functions** (those intended to be imported across modules), `delete` finds all references that reach the definition through:
- Direct imports: `use crate::foo::bar`
- Re-exports: `pub use crate::foo::bar as baz`
- Same-file unqualified calls: `bar()`

**Scope**: workspace = all `.rs` files under the current working directory

**Exclusions** (by design, not limitation):
- Private functions (no cross-file tracking)
- Fully-qualified paths: `crate::foo::bar()` (not tracked)
- Macro-generated references (not tracked)
- Shadowed names: local `fn bar` shadows import (correctly ignored)

**Deletion order**: References first (reverse byte order per file to preserve offsets), then definition

### What Did NOT Change

- No persistent database between runs
- No resume mode for failed plans
- No dry-run mode
- Atomic rollback on validation failure (still guaranteed)
- Byte spans remain source of truth (still guaranteed)
- Tree-sitter reparse before compiler gate (still guaranteed)

### Changed

- 298 passing tests (from 22)

### Technical

- tree-sitter parsers for C, C++, Java, JavaScript, Python, TypeScript
- Module path index for cross-language resolution
- Scope-based shadowing detection
- Re-export graph building

## [0.1.3] - 2025-12-28

### Fixed
- Added `readme = "README.md"` to Cargo.toml (was missing, causing no README on crates.io)

## [0.1.2] - 2025-12-28

### Changed
- Updated README to reflect MVP/POC status
- Removed emojis from documentation
- Clarified limitations in manual

## [0.1.1] - 2025-12-28

### Changed

- Updated documentation (removed emojis, clarified MVP status)
- README and manual simplified for clarity

## [0.1.0] - 2025-12-23

### Added

- Span-safe byte replacement for Rust code
- Tree-sitter AST validation
- Cargo check compilation validation
- Atomic rollback on validation failures
- Multi-step JSON plan orchestration
- CLI interface with `patch` and `plan` commands

### Features

- **Single Patch Mode**: Replace function bodies, struct definitions, enum variants
- **Validation Gates**: UTF-8 boundary check, tree-sitter reparse, cargo check
- **Plan Execution**: JSON-based multi-step refactoring
- **Error Handling**: Typed error hierarchy

### Known Limitations

- No cross-file reference tracking
- No persistent symbol database
- No resume mode for failed plans
- No dry-run mode
- Single-file symbol resolution only

### Technical

- Built on tree-sitter-rust 0.21
- SQLiteGraph 0.2.4 integration
- ropey 1.6 for text editing
- clap 4.5 for CLI parsing

### Testing

- 22/22 tests passing
- Complete feature set for single-file refactoring

---

**Note**: v0.1.x was an MVP/proof-of-concept release with intentionally limited features. v0.2.0 adds the delete command with cross-file reference finding. v0.3.0 adds multi-language support for patch and delete operations.