Skip to content

Commit 46da0f0

Browse files
committed
bump all crates to v0.2.0, update docs and changelog
Static parser registry, borrowed refs in hot paths, byte-level Sesame expansion, confidence-scored rename detection, multi-line signature detection, import group preservation, LRU entity cache in MCP server, configurable WEAVE_TIMEOUT and WEAVE_MAX_DUPLICATES env vars. 121 tests.
1 parent 7e60e0b commit 46da0f0

11 files changed

Lines changed: 117 additions & 17 deletions

File tree

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<a href="https://github.com/Ataraxy-Labs/weave/releases/latest"><img src="https://img.shields.io/github/v/release/Ataraxy-Labs/weave?color=blue&label=release" alt="Release"></a>
1111
<a href="https://github.com/Ataraxy-Labs/homebrew-tap"><img src="https://img.shields.io/badge/homebrew-ataraxy--labs/tap/weave-orange" alt="Homebrew"></a>
1212
<img src="https://img.shields.io/badge/rust-stable-orange" alt="Rust">
13-
<img src="https://img.shields.io/badge/tests-118_passing-brightgreen" alt="Tests">
14-
<img src="https://img.shields.io/badge/version-0.1.9-blue" alt="Version">
13+
<img src="https://img.shields.io/badge/tests-121_passing-brightgreen" alt="Tests">
14+
<img src="https://img.shields.io/badge/version-0.2.0-blue" alt="Version">
1515
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-yellow" alt="License"></a>
1616
<img src="https://img.shields.io/badge/languages-11-blue" alt="Languages">
1717
</p>

crates/weave-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "weave-cli"
3-
version = "0.1.9"
3+
version = "0.2.0"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66

crates/weave-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "weave-core"
3-
version = "0.1.9"
3+
version = "0.2.0"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66

crates/weave-crdt/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "weave-crdt"
3-
version = "0.1.9"
3+
version = "0.2.0"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66

crates/weave-driver/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "weave-driver"
3-
version = "0.1.9"
3+
version = "0.2.0"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66

crates/weave-mcp/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "weave-mcp"
3-
version = "0.1.9"
3+
version = "0.2.0"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66

docs/changelog.html

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,75 @@ <h1 style="font-size: 28px; font-weight: 700; color: var(--accent); letter-spaci
8787

8888
<section style="border-top: none; padding-top: 12px;">
8989

90+
<!-- v0.2.0: Performance & merge quality -->
91+
<div class="commit">
92+
<div class="commit-header">
93+
<span class="commit-date">Mar 3, 2026</span>
94+
</div>
95+
<div class="commit-title">v0.2.0 — Performance overhaul, confidence-scored renames, LRU entity cache</div>
96+
<div class="commit-tags">
97+
<span class="commit-tag" style="background: #fb923c22; color: var(--orange);">perf</span>
98+
<span class="commit-tag" style="background: #4ade8022; color: var(--green);">feature</span>
99+
<span class="commit-tag" style="background: #22d3ee22; color: var(--cyan);">weave-mcp</span>
100+
<span class="commit-tag" style="background: #fb923c22; color: var(--orange);">release</span>
101+
</div>
102+
<div class="commit-body">
103+
<p>Focused release on merge speed, merge quality, and MCP responsiveness. 121 tests passing.</p>
104+
105+
<p><strong>Performance (weave-core)</strong></p>
106+
<ul>
107+
<li><strong>Static <code>ParserRegistry</code></strong>: tree-sitter parsers for all 11 languages are now created once via <code>LazyLock</code> and reused across merges. Previously each merge spawned a fresh registry.</li>
108+
<li><strong>Borrowed references in hot paths</strong>: <code>build_region_content_map</code> returns <code>&amp;str</code> refs instead of cloning every region's content into owned Strings. Same for <code>body_hash</code> which now returns <code>u64</code> directly instead of formatting a hex String.</li>
109+
<li><strong>Byte-level Sesame expansion</strong>: <code>expand_separators</code> processes bytes instead of chars. Separators (<code>{</code>, <code>}</code>, <code>;</code>) are ASCII, so UTF-8 iteration overhead is unnecessary.</li>
110+
</ul>
111+
112+
<p><strong>Merge quality</strong></p>
113+
<ul>
114+
<li><strong>Confidence-scored rename detection</strong>: replaces the previous greedy first-match approach. Candidates are scored (0.95 for body_hash + same type + same parent, 0.8 for body_hash + same type, 0.6 for structural_hash), sorted by confidence, and assigned greedily. Rejects below 0.6. Fixes false renames when multiple entities share identical bodies.</li>
115+
<li><strong>Multi-line signature detection</strong>: conflict classification now tracks parenthesis depth to find where the signature ends, instead of assuming line 0 is the entire signature. Functions with multi-line parameter lists are now correctly classified as Syntax (not Functional) when only parameters change.</li>
116+
<li><strong>Import group preservation</strong>: <code>merge_imports_commutatively</code> now splits imports into groups by blank lines and merges within each group. New imports from theirs are placed in the matching group by source prefix. Previously all grouping was destroyed during merge.</li>
117+
</ul>
118+
119+
<p><strong>MCP server</strong></p>
120+
<ul>
121+
<li><strong>LRU entity cache</strong>: 500-entry cache keyed on <code>(file_path, content_hash)</code>. Repeated calls to <code>weave_extract_entities</code>, <code>weave_claim_entity</code>, and <code>weave_status</code> skip tree-sitter parsing entirely on cache hit.</li>
122+
</ul>
123+
124+
<p><strong>Configuration</strong></p>
125+
<ul>
126+
<li><code>WEAVE_TIMEOUT</code> env var: configurable merge timeout in seconds (default 5).</li>
127+
<li><code>WEAVE_MAX_DUPLICATES</code> env var: configurable threshold for duplicate entity detection (default 10).</li>
128+
</ul>
129+
130+
<div class="stats">
131+
<span class="added">+377</span>
132+
<span class="removed">-117</span>
133+
<span class="files">5 files (merge.rs, conflict.rs, server.rs, Cargo.toml, Cargo.lock)</span>
134+
</div>
135+
</div>
136+
<div class="lesson">
137+
<div class="lesson-label">Key insight</div>
138+
<p>The biggest performance win wasn't algorithmic. Creating 11 tree-sitter parsers per merge (one for each language) dominated the profile. A single <code>LazyLock&lt;ParserRegistry&gt;</code> eliminates that entirely. For allocation, returning <code>&amp;str</code> instead of <code>String</code> in hot paths (called per entity, per region) is the Rust equivalent of "stop copying data you already have." For rename detection, greedy matching on body_hash without scoring produces false positives when test files have many functions with identical boilerplate bodies. Confidence scoring + greedy-by-rank fixes this without changing the O(n) complexity.</p>
139+
</div>
140+
</div>
141+
142+
<!-- Commit: Address clippy warnings (community contribution) -->
143+
<div class="commit">
144+
<div class="commit-header">
145+
<span class="commit-date">Mar 3, 2026</span>
146+
</div>
147+
<div class="commit-title">Fix clippy warnings (community contribution by @hobostay)</div>
148+
<div class="commit-tags">
149+
<span class="commit-tag" style="background: #f8717122; color: var(--red);">bugfix</span>
150+
</div>
151+
<div class="commit-body">
152+
<ul>
153+
<li>Remove unused fields <code>base_ref</code> and <code>head_ref</code> from <code>PrEvent</code> in weave-github webhook handler.</li>
154+
<li>Remove unnecessary <code>i32</code> cast in bench.rs.</li>
155+
</ul>
156+
</div>
157+
</div>
158+
90159
<!-- Commit: Resolution hints, summary command, merge summary MCP tool -->
91160
<div class="commit">
92161
<div class="commit-header">

docs/docs.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,31 @@ <h2>CLI commands</h2>
431431
<span class="cmd-doc-desc">Run merge benchmarks comparing weave vs git line-level merge</span>
432432
</div>
433433
</div>
434+
435+
<h3 style="font-size: 16px; color: var(--accent); margin: 32px 0 16px;">Environment variables</h3>
436+
437+
<table>
438+
<thead>
439+
<tr><th>Variable</th><th>Default</th><th>Description</th></tr>
440+
</thead>
441+
<tbody>
442+
<tr>
443+
<td><code style="color:var(--cyan)">WEAVE_TIMEOUT</code></td>
444+
<td><code>5</code></td>
445+
<td>Merge timeout in seconds. If entity-level merge takes longer, weave falls back to line-level merge. Increase for very large files.</td>
446+
</tr>
447+
<tr>
448+
<td><code style="color:var(--cyan)">WEAVE_MAX_DUPLICATES</code></td>
449+
<td><code>10</code></td>
450+
<td>Maximum same-name entities before skipping entity merge. Test files often have many similarly named functions. Increase to allow entity merge on such files.</td>
451+
</tr>
452+
<tr>
453+
<td><code style="color:var(--cyan)">WEAVE_REPO</code></td>
454+
<td><em>auto-detected</em></td>
455+
<td>Override git repo root for the MCP server. Useful when running weave-mcp from outside a repository.</td>
456+
</tr>
457+
</tbody>
458+
</table>
434459
</section>
435460

436461
<footer>

docs/llms.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,17 @@ Entity extraction via sem-core with xxHash64 structural hashing, parallel tree-s
3737
## Key Features
3838

3939
- 13 languages: TypeScript, TSX, JavaScript, Python, Go, Rust, Java, C, C++, Ruby, C#, PHP, Fortran
40-
- Rename detection via AST-normalized structural hashing
41-
- Commutative import merge (imports treated as sets, unioned and deduplicated)
40+
- Rename detection via confidence-scored structural hashing (0.95/0.8/0.6 scoring)
41+
- Commutative import merge with group preservation (imports merged within blank-line groups)
4242
- Unordered class members (methods added at same position resolve cleanly)
4343
- Inner entity merge (both modify same class, methods merged independently)
4444
- Comment/decorator bundling (decorators move with their function)
4545
- ConGra conflict taxonomy (Text/Syntax/Functional) with resolution hints
46+
- Multi-line signature detection (paren depth tracking for conflict classification)
4647
- Cosmetic vs structural change detection
4748
- Post-merge semantic + parse validation
49+
- LRU entity cache in MCP server (500 entries, skips redundant tree-sitter parses)
50+
- Configurable: WEAVE_TIMEOUT (merge timeout), WEAVE_MAX_DUPLICATES (duplicate entity threshold)
4851

4952
## Architecture
5053

0 commit comments

Comments
 (0)