You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<spanclass="commit-tag" style="background: #fb923c22; color: var(--orange);">perf</span>
98
+
<spanclass="commit-tag" style="background: #4ade8022; color: var(--green);">feature</span>
99
+
<spanclass="commit-tag" style="background: #22d3ee22; color: var(--cyan);">weave-mcp</span>
100
+
<spanclass="commit-tag" style="background: #fb923c22; color: var(--orange);">release</span>
101
+
</div>
102
+
<divclass="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>&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>
<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<ParserRegistry></code> eliminates that entirely. For allocation, returning <code>&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>
<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>
0 commit comments