Rigorous spec for how Microsoft Word does "Combine documents"?

I am seeing less than optimal results in trying to use Microsoft Word’s built-in “Combine documents.” The document chosen as “original” has text that was deleted in the “revision”, but is present in the combined version. I need to show a combined version that honors the latter deletion.

I cannot find a rigorous definition of the algorithm use to combine documents. The only thing I can find walks you through how to do it, but not the details of how Word executes it. I need to understand how it resolves collisions, and also how it matters which document is set as “original”.

There are other cases too, like one person deletes text, but another person modifies it; one person modifies a phrase, but another person modifies the same phrase to something else.

Is there anything that documents what this feature actually does? Microsoft, in typical fashion, basically says, “Use Combine Document to combine documents.”

Have you Accepted Changes in the original document?

sounds like you are running into problems with how Word saves edited documents.
(my knowledge of Word is many years old and if I am wrong hopefully someone with current knowledge will correct me).
Word saves up edits to a document at the end of the original. When the document is reopened, the original document has the changes transparently added so that the user thinks the changes were actually made to the original. Eventually, the number of edits gets too large/complex and Word goes ahead and does a complete save of the updated document. But until then both the original and the edits are in the file. When you combine documents it becomes tricky to get all the edits correct on the new document.

As a solution, I always save as on both documents. It is my understanding that this forces a complete save of the documents. Then combine documents. There used to be a specific form of save (complete save?) but I haven’t seen that in Word in years.

No. I am merging two documents that both have changes tracked. I have done some experimentation and you get different results depending on which document you select as “original”. In this case I have two reviewers who have comments on the same document. I can find no way to merge these that preserves all the changes made by both reviewers. And there are some conflicts, as I described, and I can’t figure out the rules it uses to resolve conflicts.

What I am hoping for is that someone somewhere has done a more exhaustive study of this and has documented the rules used to do the merge.

“Badly”. I’m sure it’s part of the original spec.

I didn’t realize you wanted to preserve track changes in both documents. I strongly doubt that is going to work. But I am no Word expert. You might have better luck on some of the boards that specialize in Word related matters.