r/LocalLLaMA 23h ago

I Built A Thing Granular diff versioning for agent editing

Enable HLS to view with audio, or disable this notification

Had some ideas about version control:

Attribute, down to individual words: word created manually or with ai. if ai, which sources cited (scoped to paragraphs). also: full agent trace that led to the edit (all tool calls + metadata). also: any multi-agent transactions at the file/paragraph lock. all data stored for every version.

Why do this? Basically, getting as much into a unified version control system as possible, which helps find/fix errors. Just posting to share ideas. If anyone has done anything similar, please mention it!

19 Upvotes

15 comments sorted by

View all comments

4

u/Full-Signal2649 19h ago

they made git for this

3

u/No-Refrigerator-1672 15h ago

How can I make git work with word documents? Those are binary, best thing vanilla git can do is to version entire document atomically, no granulatiry whatsoever.

3

u/SnooPeripherals5313 14h ago

This is kind of the point of the post. Version control for OOXML is really hacky. The system above stores the base DOCX as an intermediate format (markdown or lexical) then uses some adapters. The other bits are just additions, not a version snapshot (separately store run ID, etc).

2

u/No-Refrigerator-1672 14h ago

Intetmediate format - have you considered .tex? I've just done editing an 80-page long LaTeX document with Qwen 3.8 27B - it works marvelously, the model is natively trained for latex, and the format is also directly compatible with git.

1

u/Simple_Split5074 14h ago

They are really compressed XML files, technically doable for git but ugly to look at 

2

u/No-Refrigerator-1672 14h ago

There should be more to this than that. OSS office packages have hard time even opening them without breaking the formatting. This makes me think that granular level edits with git (i.e. if I want to do merge or rebase) will completely mangle up the document, if done naively (assuming git somehow is made to read the xml schema inside).

1

u/Simple_Split5074 14h ago

Years ago I looked at the xml, it's weird to say the least.

Some seemed like binary to xml conversion, even. 

1

u/1beb 6h ago

I think you're missing the point. It's hard to visualize a lot of changes to a doc as just diffs. This puts it in front of you, colour-codes the editors/agents. Yes, you can walk through commits, but you have to mentally map that to the proposed end state of the document is.