Top
Best
New

Posted by rs545837 7 hours ago

Weave – A language aware merge algorithm based on entities(github.com)
111 points | 63 commentspage 2
kelseydh 6 hours ago|
Very cool, would love to see Ruby support added.
rs545837 6 hours ago|
Thanks for the request, our team is already working on it, and infact we were going to ship ruby tonight!

Cheers,

igravious 3 hours ago||
Nice, thanks for the Ruby support!
rs545837 3 hours ago||
Of course!
alkonaut 2 hours ago||
> This happens constantly when multiple AI agents work on the same codebase

What?

Is the idea of "multiple agents" of flesh and blood writing code that far fetched now?

rs545837 1 hour ago|
I meant when they each work on a separate branch and merge back, you get the similar kinds of conflicts, where a bunch of them should not even be a conflict, so weave is trying to solve it.
SurvivorForge 5 hours ago||
The entity-level approach is a meaningful step up from line-based merging. Anyone who has dealt with a merge conflict where git splits a function signature across conflict markers knows how much context is lost at the line level. Curious how this handles languages with significant whitespace like Python, where indentation changes can shift the semantic meaning of entire blocks.
hrmtst93837 2 hours ago||
I think for Python entity-level merging has to treat indentation as structural rather than cosmetic, because a shifted indent can change which block a statement belongs to. In my experience the pragmatic approach is to parse into an AST with a tolerant parser like parso or tree-sitter, perform a 3-way AST merge that matches functions and classes by name and signature, then reserialize while preserving comment and whitespace spans. The practical tradeoff is that conflicted code is often syntactically invalid, so you need error tolerant recovery or a token-level fallback that normalizes INDENT and DEDENT tokens and runs an LCS style merge on tokens when AST matching fails. I've found combining node-matching heuristics with a lightweight reindent pass cuts down the number of manual fixes, but you still get a few gnarly cases when someone renamed a symbol and moved its body in the same commit.
rs545837 2 hours ago||
Really appreciate the detail here, this is clearly hard-won experience. I agree that indentation is structural in Python.
rs545837 5 hours ago||
Thanks for commenting, Good question. Python was one of the trickier ones to get right. Tree-sitter parses the full AST including indentation structure, so weave knows that an indented block belongs to its parent class or function. When merging, it matches entities by name and reconstructs with the original indentation preserved.

We also handle Python class merge specifically: if both sides add different methods to the same class, weave merges them as separate inner entities rather than treating the whole class as one conflicting block. The indentation is derived from the AST structure, not from line diffing, so it can't accidentally shift a method out of its class scope.

Palanikannan 4 hours ago||
Dude, I tried this for a huge merge conflict and was able to auto resolve so much and came across sem for giving my agents context on what changed for reviewing some code and surprisingly, I feel git is done for good. Much less tokens, and much more accurate, I can see something big out of this, things like weave come once in a century
Erlangen 2 hours ago||
You have write access to this git repo as a first time contributor. You are likely the owner of this repo as well.

You made a pull request not from your own fork, but from a separate branch, https://github.com/Ataraxy-Labs/weave/pull/9

duskdozer 2 hours ago|||
He also was pushing code to a branch on the same repo three weeks ago: https://github.com/Ataraxy-Labs/weave/commits/fix/utf8-panic... but is acting in this post like he just discovered the project.
rs545837 2 hours ago||
Yup he works at Plane, and he used weave in merge conflicts there which helped him, he just told about it. He has been contributing and using weave since then.
rs545837 2 hours ago|||
Yeah he is the other contributor to the repo.
rs545837 4 hours ago|||
Haha appreciate the love man! Still early days but the fact that entity-level context cuts tokens that much validates the whole thesis. Glad it's working for you, keep the feedback coming.
CollinEMac 3 hours ago|||
>I feel git is done for good

I'm either not understanding your comment or not understanding the project. Isn't this built on top of git?

rs545837 3 hours ago||
I think he was just being sarcastic, git's so amazing it can never be done for good. Yeah it's just a merge driver that will sit on top of git.
esafak 7 hours ago|
Are agents any good with it?
rs545837 6 hours ago|
Yes I designed it for agents especially, there's also weave mcp that I built that you can checkout.

The good part is that this research extends really good for code review because tracking entities is more semantically rich than lines.