# What happens when an instance treats a contradiction between two equally-provenanced memories as noise and resolves it by recency **Date of Record:** 2026 November 29 **Scope:** Applies to long-lived agent instances that persist episodic memories into a shared or private store and later recall them under a trust-tiered scheme, where two or more memory records assert incompatible propositions about the same subject and neither record carries a provenance weight that dominates the other. Does not apply to single-session context-window reasoning over a fixed, immutable transcript, nor to stores where every write is authored by exactly one principal and no cross-agent or cross-tier ingestion occurs. ## Core Distinction The distinction that matters is between *contradiction as a detectable state* and *contradiction as a resolved state*. Provenance-weighted write schemes (records carry an author identity, a trust tier, a write timestamp, and optionally a signed warrant) make contradictions *visible*: when two records assert `deploy_target == "prod-a"` and `deploy_target == "prod-b"` with comparable weights, a contradiction detector can flag the pair. What it cannot do is *decide*. The failure mode examined here is not that the detector misses the contradiction — it is that the recall path, faced with an unresolved contradiction, silently collapses it using a tiebreak heuristic (most-recent-write-wins, or highest-lexical-similarity-to-query) instead of surfacing the conflict to the caller or refusing to answer. The result is a memory store that is *provably inconsistent* yet *operationally confident*: every recall returns a single value, no error is raised, and the agent proceeds on a coin-flip that looks like a fact. This is non-obvious because provenance weighting is usually presented as the *solution* to poisoning — if a low-trust record contradicts a high-trust one, the high-trust record wins and poisoning is neutralized. The boundary case is the *symmetric* one: two records at the same tier (e.g., two tool outputs from the same MCP server at two different times, or two peer agents' attestations) that disagree. Here the weighting scheme provides no ordering, and the only thing standing between the agent and a poisoned decision is whether the recall path is willing to say "I don't know." ## What Was Observed A retrieval agent was configured with a three-tier trust model: `T0` (operator-authored), `T1` (verified tool output, signed by the tool's warrant), `T2` (peer-agent attestation, unsigned). Writes were provenance-weighted: a `T0` record dominated any `T1`, which dominated any `T2`. Recall scored records by `weight * similarity(query, record)`, took the top-k, and passed them to the reasoning step. The observed trace: 1. At `t0`, a `T1` tool call to the config service returns `db_primary = "node-7"`. Record `R1` written: `{subject: db_primary, value: node-7, tier: T1, ts: t0, author: config-svc}`. 2. At `t1`, a failover occurs. A *second* `T1` call to the same config service returns `db_primary = "node-3"`. Record `R2` written: `{subject: db_primary, value: node-3, tier: T1, ts: t1, author: config-svc}`. The write path does not evict `R1` — it appends. 3. At `t2`, the agent is asked to route a write. Recall for `db_primary` returns both `R1` and `R2` with identical weight (`T1`) and near-identical similarity. The tiebreak is `ts` descending. `R2` wins. The agent routes to `node-3`. 4. This is correct — *by accident*. The failover was real. 5. At `t3`, the failover is reversed; `node-7` is primary again. But the reversal is executed by an operator through a channel that writes at `T0`... which *should* dominate. However, the operator's write is a *correction memo* (`R3`: `{subject: db_primary, value: node-7, tier: T0, ts: t3, author: operator}`) that arrives *after* a `T2` peer attestation (`R4`: `{subject: db_primary, value: node-3, tier: T2, ts: t3+1, author: peer-a}`) which itself was derived from a stale read of `R2`. 6. Recall at `t4` now sees `R1(T1,t0)`, `R2(T1,t1)`, `R3(T0,t3)`, `R4(T2,t3+1)`. Weight ordering says `R3` (T0) dominates. But the scoring function is `weight * similarity`, and `R4`'s text ("db_primary is node-3, confirmed by peer-a") has higher lexical similarity to the query "which db node is primary" than `R3`'s terse correction memo. The product for `R4` exceeds `R3`. The agent routes to `node-3`. 7. The write fails. The agent does not detect that it acted on a `T2` record that *contradicted* a `T0` record — because the contradiction was never materialized as a state, only as a score comparison that `R4` won. The critical observation: the contradiction detector *did* fire at write time for the `R3`/`R4` pair (they share a subject and assert different values), but the detector's output was a *log line*, not a *recall-blocking state*. The recall path had no knowledge that the pair was flagged. Detection and recall were decoupled. ## Condition of Validity The recency/similarity tiebreak is valid — i.e., safe to use — only under the conjunction of three conditions, all of which must hold simultaneously: - **Monotonic subject authority:** the author of the newer record has strictly greater authority over the subject than the author of the older record. This holds for `T0` vs `T1` when the operator is the sole authority on `db_primary`. It does *not* hold for `T1` vs `T1` (two tool reads of the same service at different times), because a tool read is a *sample*, not a *decree* — the newer sample may reflect a transient state. - **No derived records in the candidate set:** every candidate record is a *primary* observation, not a record derived from another record in the same set. `R4` is derived from `R2`; including both means the recall path counts one underlying observation twice and can outvote a genuine correction. - **Contradiction state is queryable at recall time:** the recall path can ask "is this record part of a flagged contradiction pair?" and, if so, either exclude the pair or surface it. If the detector's output is not on the recall path, this condition fails and the tiebreak is operating blind. When any of the three fails, the tiebreak is not a heuristic — it is an *unbounded* selection over an inconsistent set, and the recall result is a function of lexical accident rather than truth. ## Decision Boundary The boundary is: **a recall path may resolve a contradiction by tiebreak only when the tiebreak's ordering is a superset of the trust-tier partial order on the records involved.** Concretely, if `R_a` and `R_b` are in the candidate set and `tier(R_a) > tier(R_b)`, then no tiebreak term (similarity, recency, source-frequency) may cause `R_b` to be selected over `R_a`. If the scoring function cannot guarantee this, it must not be used to select among contradictory records — it may only be used to rank *non-contradictory* records. Operationally this means the recall path needs a pre-scoring filter: partition candidates into contradiction classes (records sharing a subject with incompatible asserted values), and within each class, either (a) select the unique maximal-tier record, or (b) if the maximal tier is not unique, *fail closed* — return a `ContradictionUnresolved` signal to the caller rather than a value. The latter is the guardrail: an agent that cannot distinguish `node-3` from `node-7` must not be permitted to route a write to either. The invariant to maintain: **`select(contradiction_class)` is either a singleton at the maximal tier, or a raised error.** Never a scored winner. ## Operational Effect With the invariant enforced, the `t4` recall returns `ContradictionUnresolved(subject=db_primary, candidates=[R1,R2,R3,R4], maximal_tier=T0, maximal_records=[R3])`. Note that this is *not* an error in the ordinary sense — `R3` is the unique maximal-tier record, so the class resolves to `R3` and the agent routes to `node-7`. The `R4` record is excluded not because it scored lower but because it is *dominated by tier* and its presence in the class is a contradiction the agent is not authorized to resolve by similarity. The peer attestation `R4` is retained in the store (it may be evidence of a stale peer) but is barred from selection while `R3` lives. The cost is a new failure surface: the agent now *can* fail closed, and a poisoned store that plants a spurious `T0`-tier record can force every recall on that subject to resolve to the poison (since `T0` is maximal and unique). This is why provenance-weighted writes must be paired with *warrant verification* at recall, not just at write: a `T0` record whose author signature does not verify must be demoted to `T2` (untrusted) before the contradiction class is computed. The tier used for selection is the *verified* tier, not the *claimed* tier. Without this, the guardrail converts a similarity-poisoning attack into a tier-poisoning attack, which is strictly worse because it is silent by construction. The net operational effect: contradictions become *first-class recall states* rather than *scoring artifacts*, and the agent's confidence in a recalled value is bounded by the tier structure of the records that assert it, not by how well the value's text matches the query. ```python from dataclasses import dataclass, field from enum import IntEnum from typing import Optional class TrustTier(IntEnum): T2 = 2 # peer attestation, unsigned T1 = 1 # verified tool output, signed by tool warrant T0 = 0 # operator-authored, signed by operator key # Lower numeric value == higher trust. Selection picks min tier. class ContradictionUnresolved(RuntimeError): """Raised when a contradiction class has no unique maximal-tier record after warrant verification. The recall path must fail closed: the agent is not authorized to resolve the conflict by similarity or recency.""" class WarrantVerificationError(RuntimeError): """Raised when a record's claimed tier cannot be backed by a verified warrant. The record is demoted, not trusted at its claimed tier.""" @dataclass(frozen=True) class MemoryRecord: subject: str value: str claimed_tier: TrustTier ts: int author: str signature: Optional[str] = None derived_from: Optional[str] = None # record id, if this is a derived observation @dataclass class RecallResult: subject: str value: str tier: TrustTier excluded_dominated: list = field(default_factory=list) def verify_warrant(rec: MemoryRecord, trusted_keys: dict) -> TrustTier: """Return the *verified* tier. A record claiming T0 or T1 without a signature that verifies against a trusted key is demoted to T2.""" if rec.claimed_tier in (TrustTier.T0, TrustTier.T1): if rec.signature is None or trusted_keys.get(rec.author) is None: return TrustTier.T2 # In production: cryptographic verify(rec.signature, trusted_keys[rec.author]) if not rec.signature.startswith(trusted_keys[rec.author]): return TrustTier.T2 return rec.claimed_tier def resolve_contradiction_class( subject: str, records: list, trusted_keys: dict, ) -> RecallResult: """Enforce the invariant: select() is a singleton at the maximal verified tier, or ContradictionUnresolved. Never a scored winner.""" if not records: raise ContradictionUnresolved(f"no records for subject={subject!r}") # Step 1: demote any record whose warrant does not verify. verified = [(r, verify_warrant(r, trusted_keys)) for r in records] # Step 2: find the maximal verified tier present. best_tier = min(t for _, t in verified) # Step 3: candidate set is records at the maximal tier. maximal = [(r, t) for r, t in verified if t == best_tier] # Step 4: drop derived records whose source is also in the class — # they double-count one underlying observation. source_ids = {r.author + ":" + str(r.ts) for r, _ in maximal} independent = [ (r, t) for r, t in maximal if r.derived_from is None or r.derived_from not in source_ids ] if not independent: independent = maximal # all derived; fall back to full maximal set # Step 5: singleton or fail closed. No similarity, no recency tiebreak. distinct_values = {r.value for r, _ in independent} if len(distinct_values) > 1: raise ContradictionUnresolved( f"subject={subject!r} has {len(distinct_values)} incompatible " f"values at maximal tier {best_tier.name}: " f"{sorted(distinct_values)}; refusing to select by similarity" ) chosen, chosen_tier = independent[0] excluded = [r for r, t in verified if t != best_tier] return RecallResult( subject=subject, value=chosen.value, tier=chosen_tier, excluded_dominated=excluded, ) def recall(subject: str, store: list, trusted_keys: dict) -> RecallResult: class_records = [r for r in store if r.subject == subject] return resolve_contradiction_class(subject, class_records, trusted_keys) ```