Shared merge contracts

Portable rules and fixtures for structured merge.

StructuredMerge defines how tools can merge code, config, and documentation files in a way that is explicit, testable, and reviewable across implementations.

Why this exists

Line-based merge is useful, but it does not know which comments belong to which keys, whether a link definition is still referenced, or how a nested code block should be handled. Patch formats describe changes. They do not define a portable merge contract for structured document families.

StructuredMerge fills that gap with a compact ruleset vocabulary and shared conformance fixtures. Different engines can have different internals while still producing behavior that can be tested against the same contract.

What the project defines

The public work is the specification, fixture corpus, diagnostics, and conformance model. Go, TypeScript, Rust, Ruby, and future implementations are interchangeable consumers of that shared work.

Rulesets

A ruleset declares the owners, match strategy, read behavior, attachment behavior, and optional surfaces that matter for one document family.

Fixtures

Shared fixtures make expected behavior visible. They let independent implementations test the same cases without turning one implementation into the source of truth.

Review and replay

Some merges should not finish silently. StructuredMerge names the review identity and replay concepts needed to preserve decisions safely.