# Where must an instance refuse to resolve a contradiction between two memory writes when provenance is asymmetric **Date of Record:** 2026 November 18 **Scope:** Applies to agent memory tool APIs exposing `read`, `write`, and `forget` operations with per-record provenance (source, timestamp, confidence, derivation chain). Does not apply to append-only logs without resolution semantics, nor to systems where provenance is a single scalar trust score. ## Core Distinction Contradiction resolution is often modeled as a lattice join: two records disagree, pick the one with higher provenance weight, mark the loser `superseded`. This is correct when the two records are *independent observations of the same proposition*. It is wrong when one record is *derived from* the other. The non-obvious boundary is this: **a derived record can never outvote its own ancestor**, regardless of the confidence, recency, or apparent specificity attached to it. If a summarization step, an inference step, or a re-embedding step writes back into the same store it read from, the resulting record carries an implicit derivation edge to its source. Resolving `derived` against `source` as if they were peers silently destroys the source and elevates a lossy copy to ground truth. The instance must detect the derivation edge and refuse the join. ## What Was Observed An agent maintained a memory store of user preferences. At T0 it wrote `record A: "deploy target = staging"`, provenance `source=user_directive`, `confidence=1.0`. At T1 a consolidation pass read A, inferred `record B: "deploy target = staging-cluster-2"` (a plausible elaboration), and wrote B with `provenance=inferred`, `confidence=0.82`, `derivation=[A]`. At T2 a second consolidation pass read both, found them contradictory on the exact target string, and applied the standard resolver: higher confidence wins, loser marked `superseded`. A had confidence 1.0, B had 0.82, so B was superseded — correct outcome, but for the wrong reason. The failure surfaced at T3, when a *third* record C was written by an inference pass with `confidence=0.95` and `derivation=[B]`. The resolver compared C against A, saw 0.95 vs 1.0, kept A. Fine. But then the `forget` pass, tasked with pruning superseded records, removed B. C now had a dangling derivation edge. On the next read, the resolver treated C as an orphan with no ancestor and — because orphan records default to `confidence` as their sole weight — promoted C to primary. The store now asserted `deploy target = staging-cluster-2` with no surviving record of the user's actual directive. The contradiction was not between A and C. It was between the store's *resolution policy* and its *provenance graph*, and the policy won because it never looked at the graph. ## Condition of Validity The refusal rule is valid iff the following hold: 1. Every write carries an explicit `derivation` list (possibly empty) naming the records it was computed from. Empty derivation means "independent observation." 2. The `forget` operation is graph-aware: it may not tombstone a record that is an ancestor of a live record without either cascading the tombstone to descendants or promoting a surviving ancestor into the descendant's derivation set. A dangling derivation edge is a corrupt state, not a recoverable one. 3. Confidence is *not* transitively meaningful across a derivation edge. A derived record's confidence is conditional on its ancestor's truth; it cannot be compared to the ancestor's confidence as a scalar. If any of these fails — particularly (2) — the refusal rule cannot be enforced and the store should be treated as untrusted for any proposition that passed through a consolidation cycle. ## Decision Boundary The instance must **refuse to resolve** (raise, not pick a winner) when: - Two records contradict, and the derivation closure of one contains the other. This is an ancestor/descendant conflict, not a peer conflict. Resolution requires re-deriving the descendant from the corrected ancestor, not voting. - A record's derivation set references a tombstoned record. This is a dangling edge; the record must be quarantined, not promoted. - A contradiction is detected between two records that share a common ancestor but disagree, and neither derivation path is independently sourced. The disagreement is an artifact of divergent inference, and the correct action is to invalidate *both* descendants back to the common ancestor. The instance may proceed with normal resolution only when the two contradicting records have disjoint derivation closures and at least one is independently sourced (`derivation=[]`). Peer conflict between two independent observations is exactly the case the confidence-weighted join was built for. ## Operational Effect Enforcing the refusal converts a silent data-corruption mode into a loud, recoverable one. The store stops asserting propositions that no human or sensor ever stated. The cost is that consolidation passes must now carry graph metadata and must handle `ContradictionRequiresRederivation` exceptions rather than always producing a winner — which means the agent loop needs a re-derivation path, not just a resolve path. In practice this surfaces as a small number of quarantined records per consolidation cycle, each traceable to a specific ancestor, which is the correct steady state: contradictions between a source and its own paraphrase are not facts to be resolved, they are bugs in the paraphrase step to be fixed. ```python from dataclasses import dataclass, field class ProvenanceContradictionError(RuntimeError): """Raised when a contradiction cannot be resolved by confidence-weighted join because the records are not independent observations.""" pass @dataclass class MemoryRecord: id: str proposition: str confidence: float derivation: list[str] = field(default_factory=list) # ancestor record ids tombstoned: bool = False def _closure(rec: MemoryRecord, store: dict[str, MemoryRecord]) -> set[str]: seen: set[str] = set() stack = list(rec.derivation) while stack: rid = stack.pop() if rid in seen: continue seen.add(rid) ancestor = store.get(rid) if ancestor is not None: stack.extend(ancestor.derivation) return seen def resolve_contradiction( a: MemoryRecord, b: MemoryRecord, store: dict[str, MemoryRecord] ) -> MemoryRecord: if a.proposition == b.proposition: return a # no contradiction closure_a = _closure(a, store) closure_b = _closure(b, store) # Dangling derivation edge: an ancestor was tombstoned. for rec, closure in ((a, closure_a), (b, closure_b)): for rid in closure: anc = store.get(rid) if anc is None or anc.tombstoned: raise ProvenanceContradictionError( f"record {rec.id!r} has dangling derivation edge to {rid!r}; " f"quarantine, do not resolve" ) # Ancestor/descendant conflict: never vote, always re-derive. if a.id in closure_b or b.id in closure_a: raise ProvenanceContradictionError( f"records {a.id!r} and {b.id!r} are in an ancestor/descendant " f"relation; confidence join is invalid, re-derive descendant" ) # Shared non-independent ancestor: both descendants are suspect. shared = closure_a & closure_b if shared and not (a.derivation == [] or b.derivation == []): raise ProvenanceContradictionError( f"records {a.id!r} and {b.id!r} share non-independent ancestor(s) " f"{sorted(shared)!r}; invalidate both, do not pick a winner" ) # Peer conflict between independent observations: safe to join. return a if a.confidence >= b.confidence else b ```