Skip to content

v0.6.0-rc255

Choose a tag to compare

@buger buger released this 22 Feb 18:08
· 147 commits to main since this release
9eeebb0
feat: consolidate symbol tools into unified edit tool (#446)

* feat: consolidate symbol tools into unified edit tool with fuzzy matching

Merge replace_symbol, insert_symbol into edit tool as optional modes.
Add fuzzyMatch.js with 4-strategy progressive matching (exact, line-trimmed,
whitespace-normalized, indent-flexible) to handle whitespace/indentation
differences automatically.

Edit tool now supports 3 modes:
- Text edit: old_string + new_string (with fuzzy matching fallback)
- Symbol replace: symbol + new_string (AST-aware, 16 languages)
- Symbol insert: symbol + new_string + position (before/after symbol)

Self-healing error messages guide AI on recovery from common failures.
Updated documentation across npm/README.md, npm/docs/, CLI help, TypeScript
declarations, and root /docs/probe-agent/sdk/tools-reference.md.

All 2272+ tests passing. Tool consolidation complete with no breaking changes
to existing text-edit API — only enhancement with new symbol modes.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* feat: add line-targeted editing, hash-line integrity, and symbol-level content tracking

- Add line-targeted edit mode with start_line/end_line and hash-based integrity verification
- Add hashline.js for per-line DJB2 content hashing on search/extract output
- Add lineEditHeuristics.js for smart single-line vs multi-line detection
- Add fuzzy text matching (4 strategies: exact, whitespace-normalized, indent-adjusted, trimmed)
- Rewrite FileTracker from mtime/stat to symbol-level SHA-256 content hashing
  - Two-tier tracking: file-level "seen" flag + per-symbol content hashes
  - Edits proceed when target symbol unchanged, even if other file parts changed
  - Re-reads symbol after write for chained edit support
- hashLines defaults to true when allowEdit is enabled
- Update type definitions, documentation, and tests (2448 tests passing)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add duplicate symbol disambiguation for extract and edit tools

When a bare symbol name (e.g. `#process`) matches multiple definitions in a
file, all matches are now returned with qualified names (e.g. `DataProcessor.process`)
instead of silently returning only the first match. Plain text output shows a
disambiguation hint guiding users to use qualified selectors.

Rust changes:
- Add `find_all_symbol_nodes` collector in symbol_finder.rs (replaces early-return)
- Add `find_all_symbols_in_file` with `symbol_signature` (qualified name via parent chain)
- Change `process_file_for_extraction` return to `Vec<SearchResult>`
- Add disambiguation hint to plain text/color formatter output
- Update 4 integration test files for new Vec return type

Node.js changes:
- Add `findAllSymbols` in symbolEdit.js
- Add disambiguation error in edit.js `handleSymbolEdit` when multiple matches
- Add 2 new tests for disambiguation behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: use lastIndexOf for colon in extractFilePath to support Windows paths

On Windows, file paths contain colons in drive letters (e.g. C:\path\file.js).
Using indexOf(':') would match the drive letter colon instead of the line-range
suffix (:1-10), causing trackFilesFromExtract to store the wrong path and
isFileSeen to return false.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>