Akashik Protocol
Operations

MERGE

Resolve a detected conflict using a structured strategy.

Purpose

MERGE resolves a conflict that was previously detected by DETECT or created automatically during RECORD. An agent (or the Field) selects a resolution strategy, provides a rationale, and the Field updates all affected memory units.

Conformance Level

Level 2+ — Level 0 and Level 1 implementations MAY omit MERGE.

Request

{
  "conflict_id": "<string>",
  "strategy": "<ConflictStrategy>",
  "resolution": {
    "winner_id": "<string | null>",
    "synthesis": "<string | null>",
    "rationale": "<string>"
  }
}
FieldRequiredDescription
conflict_idThe conflict to resolve.
strategyWhich resolution strategy to apply.
resolution.rationaleWhy this resolution was chosen. Used in audit trails.
resolution.winner_idFor confidence_weighted, authority, evidence_count: the prevailing memory unit ID.
resolution.synthesisFor synthesis strategy: new content that reconciles both conflicting units.

Response

{
  "status": "resolved | escalated | pending_vote",
  "conflict": "<Conflict>",
  "side_effects": {
    "superseded_units": ["<string>"],
    "new_unit_id": "<string | null>",
    "notified_agents": ["<string>"]
  }
}

Resolution Strategies

StrategyDescriptionRequired Level
last_write_winsMost recent memory unit prevails.2+
confidence_weightedUnit with higher confidence.score prevails.2+
human_escalationConflict is flagged for human operator review.2+
authorityA specified agent role has final say.3
evidence_countUnit with more supporting evidence (relations) prevails.3
synthesisCreate a new unit whose content reconciles both originals.3
voteMultiple agents cast votes; majority wins (requires quorum).3

Behavioral Requirements

Level 2+ The Field MUST validate that the conflict exists and is in "detected" or "resolving" status. If not, reject with INVALID_TRANSITION.

Level 2+ If strategy is "synthesis", the Field MUST create a new memory unit from resolution.synthesis with elaborates relations pointing to both original units.

Level 2+ The losing unit (or both originals, in synthesis) MUST have its status set to "superseded".

Level 2+ The conflict status MUST be updated to "resolved" with the full resolution details and rationale.

Level 2+ The Field MUST notify agents who recorded the affected units.

Level 3 The vote strategy requires a quorum mechanism. The conflict status transitions to "pending_vote" until quorum is reached.

Example

Resolve conflict using confidence weighting:

{
  "protocol": "akashik",
  "version": "0.1.0",
  "id": "msg-020",
  "operation": "MERGE",
  "agent_id": "strategist-01",
  "session_id": null,
  "epoch": 20,
  "payload": {
    "conflict_id": "conflict-001",
    "strategy": "confidence_weighted",
    "resolution": {
      "winner_id": "mem-002",
      "rationale": "mem-002 has confidence 0.82 based on 3 reports; mem-010 has 0.75 from a single source."
    }
  }
}

Response:

{
  "status": "resolved",
  "conflict": {
    "id": "conflict-001",
    "status": "resolved",
    "resolution": {
      "strategy": "confidence_weighted",
      "winner_id": "mem-002",
      "rationale": "mem-002 has confidence 0.82 based on 3 reports; mem-010 has 0.75 from a single source.",
      "resolved_by": "strategist-01",
      "epoch_resolved": 21
    }
  },
  "side_effects": {
    "superseded_units": ["mem-010"],
    "new_unit_id": null,
    "notified_agents": ["researcher-01", "researcher-02"]
  }
}

Error Codes

CodeConditionRecoverable
CONFLICT_NOT_FOUNDconflict_id references a nonexistent conflictNo
INVALID_TRANSITIONConflict is not in detected or resolving statusYes — check current state
MERGE_FAILEDConflict resolution failed (e.g., vote did not reach quorum)Yes — try a different strategy
AGENT_NOT_REGISTEREDagent_id is not a registered active agentYes — call REGISTER first
UNSUPPORTED_OPERATIONThis conformance level does not support MERGENo