merge

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package merge orchestrates the IntelliMerge escalation ladder: git-parity line merge, fine-grained LCS line merge, then symbol-level merge — each rung gated by a clean re-parse of the produced output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateResolution added in v0.5.0

func ValidateResolution(filePath string, src []byte) error

ValidateResolution checks that src is a plausible resolution for filePath: non-empty, free of conflict markers, and syntactically valid for AST languages. Used before an agent-produced resolution is written to disk.

Types

type IntelliMerge

type IntelliMerge struct {
	Parser           *parser.Engine
	Registry         *languages.Registry
	Grove            analysis.GroveLike
	HandoffThreshold float64 // confidence below which we emit a handoff prompt
	EnableBreaking   bool
	EnableContext    bool
	BreakingAnalyzer *analysis.BreakingChangeAnalyzer
}

IntelliMerge orchestrates parsing, classification, merging, and diagnostics for a single-file merge.

func New

New returns an IntelliMerge using default registry + thresholds.

func (*IntelliMerge) Merge

func (im *IntelliMerge) Merge(
	ctx context.Context,
	baseContent, oursContent, theirsContent []byte,
	lang core.LanguageKey,
	filePath string,
) (*core.MergeResult, error)

Merge runs the pipeline and returns a MergeResult.

  1. Trivial exits (identical sides, one-sided change)
  2. Symbol extraction (parse base, ours, theirs)
  3. Breaking change detection (Grove blast radius, optional)
  4. Escalation ladder: a. git-equivalent line merge — clean + parses → ship (git parity) b. fine-grained LCS line merge — clean + parses → ship c. symbol-level merge + reconstruction — validated by re-parse
  5. Classification + diagnostics + handoff prompt emission (caller handles file IO)

Config files (JSON/YAML/TOML) use the line merge first and a structural deep-merge on conflict.

Directories

Path Synopsis
Package analysis covers breaking change detection, blast radius lookup, and risk scoring during the merge pipeline.
Package analysis covers breaking change detection, blast radius lookup, and risk scoring during the merge pipeline.
Package classification categorizes a merge conflict by type and severity.
Package classification categorizes a merge conflict by type and severity.
Package strategies implements three-way merge algorithms.
Package strategies implements three-way merge algorithms.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL