Skip to contents

Handles semantic or git-level conflicts during branch merges. Used by Conflict Harmonizer nodes.

Value

A `ConflictResolver` R6 object.

Public fields

strategy

String. "llm", "human", or "ours".

driver

AgentDriver. The driver to use for "llm" strategy.

Methods


Method new()

Initialize ConflictResolver

Usage

ConflictResolver$new(strategy = "llm", driver = NULL)

Arguments

strategy

Conflict resolution strategy.

driver

Optional LLM driver for semantic resolution.

Returns

A new `ConflictResolver` object. Resolve a Conflict


Method resolve()

Usage

ConflictResolver$resolve(repo_root, branch_a, branch_b, files)

Arguments

repo_root

Path to repo.

branch_a

Branch A.

branch_b

Branch B (usually base).

files

List of conflicting files.

Returns

List with status and details.


Method clone()

The objects of this class are cloneable with this method.

Usage

ConflictResolver$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # \dontrun{
# 1. Initialize a resolver with an LLM strategy
resolver <- ConflictResolver$new(
  strategy = "llm",
  driver = AnthropicAPIDriver$new(model = "claude-3-sonnet")
)

# 2. Resolve a detected conflict during a merge
res <- resolver$resolve(
  repo_root = ".",
  branch_a = "feature-updates",
  branch_b = "main",
  files = c("R/core.R")
)
} # }