| 1 | > **Part of the [Ataraxy Labs](https://ataraxy-labs.com) stack** — agent-native infrastructure for software development. See also: [sem](https://ataraxy-labs.com/sem) (semantic version control) · [inspect](https://github.com/Ataraxy-Labs/inspect) (semantic code review) · [opensessions](https://github.com/Ataraxy-Labs/opensessions) (tmux sidebar for coding agents). |
| 2 | > |
| 3 | > Read the manifesto: https://ataraxy-labs.com/#thesis · Essays: https://ataraxy-labs.com/blogs · LLMs: https://ataraxy-labs.com/llms.txt |
| 4 | |
| 5 | <p align="center"> |
| 6 | <img src="assets/banner.svg" alt="weave" width="600" /> |
| 7 | </p> |
| 8 | |
| 9 | <p align="center"> |
| 10 | <strong>Entity-level semantic merge driver for Git.</strong><br> |
| 11 | Resolves merge conflicts that Git can't by understanding code structure via tree-sitter. |
| 12 | </p> |
| 13 | |
| 14 | <p align="center"> |
| 15 | <a href="#install">Install</a> · |
| 16 | <a href="#how-weave-fixes-this">How It Works</a> · |
| 17 | <a href="#mcp-server">MCP Server</a> · |
| 18 | <a href="https://github.com/Ataraxy-Labs/weave/releases/latest">Releases</a> |
| 19 | </p> |
| 20 | |
| 21 | <p align="center"> |
| 22 | <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> |
| 23 | <a href="https://formulae.brew.sh/formula/weave"><img src="https://img.shields.io/badge/homebrew-weave-orange" alt="Homebrew"></a> |
| 24 | <img src="https://img.shields.io/badge/rust-stable-orange" alt="Rust"> |
| 25 | <img src="https://img.shields.io/badge/tests-124_passing-brightgreen" alt="Tests"> |
| 26 | <img src="https://img.shields.io/badge/version-0.3.0-blue" alt="Version"> |
| 27 | <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-yellow" alt="License"></a> |
| 28 | <img src="https://img.shields.io/badge/languages-28-blue" alt="Languages"> |
| 29 | </p> |
| 30 | |
| 31 | <p align="center"> |
| 32 | <img src="assets/merge-animation.gif" alt="Weave merge animation: two branches add different functions, git conflicts, weave merges cleanly" width="700" /> |
| 33 | </p> |
| 34 | |
| 35 | ## The Problem |
| 36 | |
| 37 | Git merges by comparing **lines**. When two branches both add code to the same file — even to completely different functions — Git sees overlapping line ranges and declares a conflict: |
| 38 | |
| 39 | ``` |
| 40 | <<<<<<< HEAD |
| 41 | export function validateToken(token: string): boolean { |
| 42 | return token.length > 0 && token.startsWith("sk-"); |
| 43 | } |
| 44 | ======= |
| 45 | export function formatDate(date: Date): string { |
| 46 | return date.toISOString().split('T')[0]; |
| 47 | } |
| 48 | >>>>>>> feature-branch |
| 49 | ``` |
| 50 | |
| 51 | These are **completely independent changes**. There's no real conflict. But someone has to manually resolve it anyway. |
| 52 | |
| 53 | This happens constantly when multiple AI agents work on the same codebase. Agent A adds a function, Agent B adds a different function to the same file, and Git halts everything for a human to intervene. |
| 54 | |
| 55 | ## How Weave Fixes This |
| 56 | |
| 57 | Weave replaces Git's line-based merge with **entity-level merge**. Instead of diffing lines, it: |
| 58 | |
| 59 | 1. Parses all three versions (base, ours, theirs) into semantic entities — functions, classes, JSON keys, etc. — using [tree-sitter](https://tree-sitter.github.io/) |
| 60 | 2. Matches entities across versions by identity (name + type + scope) |
| 61 | 3. Merges at the entity level: |
| 62 | - **Different entities changed** → auto-resolved, no conflict |
| 63 | - **Same entity changed by both** → attempts intra-entity merge, conflicts only if truly incompatible |
| 64 | - **One side modifies, other deletes** → flags a meaningful conflict |
| 65 | |
| 66 | The same scenario above? Weave merges it cleanly with zero conflicts — both functions end up in the output. |
| 67 | |
| 68 | ## Weave vs Git Merge |
| 69 | |
| 70 | | Scenario | Git (line-based) | Weave (entity-level) | |
| 71 | |----------|-----------------|---------------------| |
| 72 | | Two agents add different functions to same file | **CONFLICT** | Auto-resolved | |
| 73 | | Agent A modifies `foo()`, Agent B adds `bar()` | **CONFLICT** (adjacent lines) | Auto-resolved | |
| 74 | | Both agents modify the same function differently | CONFLICT | CONFLICT (with entity-level context) | |
| 75 | | One agent modifies, other deletes same function | CONFLICT (cryptic diff) | CONFLICT: `function 'validateToken' (mo |