{"id":47577444,"url":"https://github.com/Ataraxy-Labs/weave","last_synced_at":"2026-04-15T03:00:54.844Z","repository":{"id":336917093,"uuid":"1151647782","full_name":"Ataraxy-Labs/weave","owner":"Ataraxy-Labs","description":"Entity-level semantic merge driver for Git. Resolves conflicts that git can't by understanding code structure via tree-sitter. 31/31 clean merges vs git's 15/31.","archived":false,"fork":false,"pushed_at":"2026-04-14T23:10:47.000Z","size":3193,"stargazers_count":908,"open_issues_count":3,"forks_count":23,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-04-15T01:27:23.889Z","etag":null,"topics":["ai-agents","conflict-resolution","developer-tools","git","mcp","merge","merge-driver","rust","semantic-merge","tree-sitter"],"latest_commit_sha":null,"homepage":"https://ataraxy-labs.github.io/weave/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ataraxy-Labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["rs545837"]}},"created_at":"2026-02-06T18:15:59.000Z","updated_at":"2026-04-14T23:29:05.000Z","dependencies_parsed_at":"2026-02-13T07:02:09.324Z","dependency_job_id":null,"html_url":"https://github.com/Ataraxy-Labs/weave","commit_stats":null,"previous_names":["ataraxy-labs/weave"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/Ataraxy-Labs/weave","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ataraxy-Labs%2Fweave","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ataraxy-Labs%2Fweave/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ataraxy-Labs%2Fweave/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ataraxy-Labs%2Fweave/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ataraxy-Labs","download_url":"https://codeload.github.com/Ataraxy-Labs/weave/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ataraxy-Labs%2Fweave/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31824118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","conflict-resolution","developer-tools","git","mcp","merge","merge-driver","rust","semantic-merge","tree-sitter"],"created_at":"2026-03-31T06:00:27.726Z","updated_at":"2026-04-15T03:00:54.820Z","avatar_url":"https://github.com/Ataraxy-Labs.png","language":"Rust","funding_links":["https://github.com/sponsors/rs545837"],"categories":["Rust"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/banner.svg\" alt=\"weave\" width=\"600\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eEntity-level semantic merge driver for Git.\u003c/strong\u003e\u003cbr\u003e\n  Resolves merge conflicts that Git can't by understanding code structure via tree-sitter.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#install\"\u003eInstall\u003c/a\u003e ·\n  \u003ca href=\"#how-weave-fixes-this\"\u003eHow It Works\u003c/a\u003e ·\n  \u003ca href=\"#mcp-server\"\u003eMCP Server\u003c/a\u003e ·\n  \u003ca href=\"https://github.com/Ataraxy-Labs/weave/releases/latest\"\u003eReleases\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Ataraxy-Labs/weave/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/Ataraxy-Labs/weave?color=blue\u0026label=release\" alt=\"Release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://formulae.brew.sh/formula/weave\"\u003e\u003cimg src=\"https://img.shields.io/badge/homebrew-weave-orange\" alt=\"Homebrew\"\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/rust-stable-orange\" alt=\"Rust\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/tests-124_passing-brightgreen\" alt=\"Tests\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/version-0.2.6-blue\" alt=\"Version\"\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-yellow\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/languages-21-blue\" alt=\"Languages\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/merge-animation.gif\" alt=\"Weave merge animation: two branches add different functions, git conflicts, weave merges cleanly\" width=\"700\" /\u003e\n\u003c/p\u003e\n\n## The Problem\n\nGit 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:\n\n```\n\u003c\u003c\u003c\u003c\u003c\u003c\u003c HEAD\nexport function validateToken(token: string): boolean {\n    return token.length \u003e 0 \u0026\u0026 token.startsWith(\"sk-\");\n}\n=======\nexport function formatDate(date: Date): string {\n    return date.toISOString().split('T')[0];\n}\n\u003e\u003e\u003e\u003e\u003e\u003e\u003e feature-branch\n```\n\nThese are **completely independent changes**. There's no real conflict. But someone has to manually resolve it anyway.\n\nThis 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.\n\n## How Weave Fixes This\n\nWeave replaces Git's line-based merge with **entity-level merge**. Instead of diffing lines, it:\n\n1. Parses all three versions (base, ours, theirs) into semantic entities — functions, classes, JSON keys, etc. — using [tree-sitter](https://tree-sitter.github.io/)\n2. Matches entities across versions by identity (name + type + scope)\n3. Merges at the entity level:\n   - **Different entities changed** → auto-resolved, no conflict\n   - **Same entity changed by both** → attempts intra-entity merge, conflicts only if truly incompatible\n   - **One side modifies, other deletes** → flags a meaningful conflict\n\nThe same scenario above? Weave merges it cleanly with zero conflicts — both functions end up in the output.\n\n## Weave vs Git Merge\n\n| Scenario | Git (line-based) | Weave (entity-level) |\n|----------|-----------------|---------------------|\n| Two agents add different functions to same file | **CONFLICT** | Auto-resolved |\n| Agent A modifies `foo()`, Agent B adds `bar()` | **CONFLICT** (adjacent lines) | Auto-resolved |\n| Both agents modify the same function differently | CONFLICT | CONFLICT (with entity-level context) |\n| One agent modifies, other deletes same function | CONFLICT (cryptic diff) | CONFLICT: `function 'validateToken' (modified in ours, deleted in theirs)` |\n| Both agents add identical function | **CONFLICT** | Auto-resolved (identical content detected) |\n| Both agents add different properties to same object | **CONFLICT** | Auto-resolved |\n| Different JSON keys modified | **CONFLICT** | Auto-resolved |\n\nThe key difference: Git produces false conflicts on **independent changes** because they happen to be in the same file. Weave only conflicts on **actual semantic collisions** when two branches change the same entity incompatibly.\n\n## Weave vs Mergiraf\n\nTested on 31 real-world merge scenarios across Python, TypeScript, Rust, Go, Java, and C:\n\n| Tool | Clean Merges | Score |\n|------|-------------|-------|\n| **Weave** | **31/31** | 100% |\n| Mergiraf (v0.16.3) | 26/31 | 83% |\n| Git | 15/31 | 48% |\n\nMergiraf fails on both-add-at-end-of-file, insert-between-existing, and decorator conflict scenarios. Weave resolves all of these because it operates at entity granularity (functions, classes, methods) rather than AST node level. Full breakdown at [ataraxy-labs.github.io/weave](https://ataraxy-labs.github.io/weave/).\n\n## Real-World Benchmarks\n\nTested on real merge commits from major open-source repositories. For each merge commit, we replay the merge with both Git and Weave, then compare against the human-authored result.\n\n- **Wins**: Merge commits where Git conflicted but Weave resolved cleanly\n- **Regressions**: Cases where Weave introduced errors (0 across all repos)\n- **Human Match**: How often Weave's output exactly matches what the human wrote\n- **Resolution Rate**: Percentage of all merge commits Weave resolved vs total attempted\n\n| Repository | Language | Merge Commits | Wins | Regressions | Human Match | Resolution |\n|------------|----------|---------------|------|-------------|-------------|------------|\n| [git/git](https://github.com/git/git) | C | 1319 | 39 | 0 | 64% | 13% |\n| [Flask](https://github.com/pallets/flask) | Python | 56 | 14 | 0 | 57% | 54% |\n| [CPython](https://github.com/python/cpython) | C/Python | 256 | 7 | 0 | 29% | 13% |\n| [Go](https://github.com/golang/go) | Go | 1247 | 19 | 0 | 58% | 28% |\n| [TypeScript](https://github.com/microsoft/TypeScript) | TypeScript | 2000 | 65 | 0 | 6% | 23% |\n\nZero regressions across all repositories. Every \"win\" is a place where a developer had to manually resolve a false conflict that Weave handles automatically.\n\n## Conflict Markers\n\nWhen a real conflict occurs, weave gives you context that Git doesn't:\n\n```\n\u003c\u003c\u003c\u003c\u003c\u003c\u003c ours — function `process` (both modified)\nexport function process(data: any) {\n    return JSON.stringify(data);\n}\n=======\nexport function process(data: any) {\n    return data.toUpperCase();\n}\n\u003e\u003e\u003e\u003e\u003e\u003e\u003e theirs — function `process` (both modified)\n```\n\nYou immediately know: what entity conflicted, what type it is, and why it conflicted.\n\n## Supported Languages\n\nTypeScript, TSX, JavaScript, Python, Go, Rust, Java, C, C++, Ruby, C#, PHP, Swift, Kotlin, Elixir, Bash, HCL/Terraform, Fortran, Vue, XML, ERB, JSON, YAML, TOML, CSV, Markdown. Falls back to standard line-level merge for unsupported file types.\n\n## Install\n\n```bash\nbrew install weave\n```\n\nOr build from source (requires Rust):\n\n```bash\ngit clone https://github.com/Ataraxy-Labs/weave\ncd weave\ncargo install --path crates/weave-cli\ncargo install --path crates/weave-driver\n```\n\n## Setup\n\nIn any Git repo:\n\n```bash\nweave setup\n```\n\nThis configures Git to use weave for all supported file types. Then use `git merge` as normal.\n\nTo revert back to normal git merging:\n\n```bash\nweave unsetup\n```\n\nTo set up for just yourself (without modifying `.gitattributes`), use `.git/info/attributes` instead:\n\n```bash\ngit config merge.weave.name \"Entity-level semantic merge\"\ngit config merge.weave.driver \"weave-driver %O %A %B %L %P\"\ncat \u003e\u003e .git/info/attributes \u003c\u003c 'EOF'\n*.ts merge=weave\n*.tsx merge=weave\n*.js merge=weave\n*.py merge=weave\n*.go merge=weave\n*.rs merge=weave\n*.java merge=weave\n*.c merge=weave\n*.cpp merge=weave\n*.rb merge=weave\n*.cs merge=weave\nEOF\n```\n\n## Jujutsu (jj)\n\nAdd to your jj config (`jj config edit --user`):\n\n```toml\n[merge-tools.weave]\nprogram = \"weave-driver\"\nmerge-args = [\"$base\", \"$left\", \"$right\", \"-o\", \"$output\", \"-l\", \"$marker_length\", \"-p\", \"$path\"]\nmerge-conflict-exit-codes = [1]\nmerge-tool-edits-conflict-markers = true\nconflict-marker-style = \"git\"\n```\n\nResolve conflicts with `jj resolve --tool weave`, or set as default:\n\n```bash\njj config set --user ui.merge-editor \"weave\"\n```\n\n## Preview\n\nDry-run a merge to see what weave would do:\n\n```bash\nweave-cli preview feature-branch\n```\n\n```\n  src/utils.ts — auto-resolved\n    unchanged: 2, added-ours: 1, added-theirs: 1\n  src/api.ts — 1 conflict(s)\n    ✗ function `process`: both modified\n\n✓ Merge would be clean (1 file(s) auto-resolved by weave)\n```\n\n## Architecture\n\n```\nweave-core       # Library: entity extraction, 3-way merge algorithm, reconstruction\nweave-driver     # Git merge driver binary (called by git via %O %A %B %L %P)\nweave-cli        # CLI: `weave setup` and `weave preview`\n```\n\nUses [sem-core](https://github.com/Ataraxy-Labs/sem) for entity extraction via tree-sitter grammars.\n\n## How It Works\n\n```\n         base\n        /    \\\n     ours    theirs\n        \\    /\n       weave merge\n```\n\n1. **Parse** all three versions into semantic entities via tree-sitter\n2. **Extract regions** — alternating entity and interstitial (imports, whitespace) segments\n3. **Match entities** across versions by ID (file:type:name:parent)\n4. **Resolve** each entity: one-side-only changes win, both-changed attempts intra-entity 3-way merge\n5. **Reconstruct** file from merged regions, preserving ours-side ordering\n6. **Fallback** to line-level merge for files \u003e1MB, binary files, or unsupported types\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=Ataraxy-Labs/weave\u0026type=Date)](https://star-history.com/#Ataraxy-Labs/weave\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAtaraxy-Labs%2Fweave","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAtaraxy-Labs%2Fweave","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAtaraxy-Labs%2Fweave/lists"}