Repository navigation
v0.8.0
A one-character typo fix no longer costs a full read-and-rewrite of the surrounding section (ADR-0027).
Features
- New tool
replace_text. One item = one (note,find) literal substitution inside a note body; frontmatter is never searched (that staysedit_properties' domain). Matching is byte-exact — no regex, no case folding, no CJK spacing/markup folding — so the replaced span is never in question. By defaultfindmust occur exactly once: 0 matches reject withNOT_FOUND, 2+ withAMBIGUOUS;replace_all: trueorexpected_count: <n>takes every match. Optionalheading_path(plusscopeandexpected_hash) narrows the search to one section, anddry_run: truereports the matches without writing. - Batches stay order-independent. Every item resolves its match spans against the unedited note and intersecting spans reject the batch (
OVERLAP), so no item ever sees another item's output. All-or-nothing, like the other destructive tools. - Responses report positions, not prose. Per item: the replacement count plus the first few changed lines, numbered in the resulting note — never the note body, which is precisely the payload the tool exists to avoid.
- New error code
COUNT_MISMATCHfor a violatedexpected_count.
Fixes
make checkis green again. The stdio end-to-end suite still readread_outlinesas a heading array, which v0.7.0 replaced with a text block, and four files no longer matched the rustfmt of the pinned toolchain — both gate stages had been failing.- The tool-annotation test now asserts that every registered tool is classified, which its comment claimed but the check did not do.
Notes
- Measured on a real vault (259 notes): median note 12.5 KB, median leaf section 425 B (p90 1.4 KB). The old typo path —
read_outlinesfor the address,read_sectionsfor the bytes,edit_sectionsto send them back — moved roughly a kilobyte in each direction for a few bytes of actual change. - Structural change (adding, deleting, moving, renaming sections) stays with
edit_sections:replace_textedits body text and does not validate heading levels. search_notesstill NFC-normalizes and folds CJK gaps, so a hit it finds may not matchfindbyte-for-byte (전역지침finds전역 지침; replacing it does not). This asymmetry is deliberate — search may guess, a destructive edit may not — and the tool description says so.