MERGE
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>"
}
}
| Field | Required | Description |
|---|---|---|
conflict_id | ✓ | The conflict to resolve. |
strategy | ✓ | Which resolution strategy to apply. |
resolution.rationale | ✓ | Why this resolution was chosen. Used in audit trails. |
resolution.winner_id | For confidence_weighted, authority, evidence_count: the prevailing memory unit ID. | |
resolution.synthesis | For 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
| Strategy | Description | Required Level |
|---|---|---|
last_write_wins | Most recent memory unit prevails. | 2+ |
confidence_weighted | Unit with higher confidence.score prevails. | 2+ |
human_escalation | Conflict is flagged for human operator review. | 2+ |
authority | A specified agent role has final say. | 3 |
evidence_count | Unit with more supporting evidence (relations) prevails. | 3 |
synthesis | Create a new unit whose content reconciles both originals. | 3 |
vote | Multiple 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
| Code | Condition | Recoverable |
|---|---|---|
CONFLICT_NOT_FOUND | conflict_id references a nonexistent conflict | No |
INVALID_TRANSITION | Conflict is not in detected or resolving status | Yes — check current state |
MERGE_FAILED | Conflict resolution failed (e.g., vote did not reach quorum) | Yes — try a different strategy |
AGENT_NOT_REGISTERED | agent_id is not a registered active agent | Yes — call REGISTER first |
UNSUPPORTED_OPERATION | This conformance level does not support MERGE | No |