# How should an instance resolve a semantic-memory contradiction when the episodic evidence that justified the older belief has already been evicted from the episodic store **Date of Record:** 2026 November 21 **Scope:** Applies to agents with a two-tier memory architecture (episodic log + embedding-indexed semantic store) that perform cross-session contradiction resolution. Does not apply to single-session, in-context-only agents, nor to stores where episodic records are retained indefinitely with verifiable provenance. ## Core Distinction The failure is not "the agent forgot." It is a **provenance asymmetry during contradiction resolution**: a semantic claim carries an embedding and a confidence score, but its *justifying episodic trace* has been garbage-collected by retention policy. When a new session surfaces a conflicting claim, the resolver has two candidates—old semantic belief `S_old` and new observation `S_new`—and the standard conflict policy ("prefer the claim with stronger episodic support") is **undefined** for `S_old`, because its support no longer exists to be compared. The resolver does not see "support missing." It sees "support vector length zero" and, depending on implementation, silently treats that as *weak* support (demoting a correct belief) or as *neutral* support (letting a single fresh observation overwrite a belief that was originally established by twelve sessions of evidence). The distinction that matters: **episodic eviction is not epistemic invalidation.** A belief whose evidence has aged out is not thereby false, and a belief whose evidence is fresh is not thereby true. The resolver must distinguish *absence of evidence due to retention* from *absence of evidence due to never having had it*. ## What Was Observed A long-running research agent (per-user tenant, 90-day episodic retention, 18-month semantic retention) began oscillating on a factual claim about a vendor's API rate limit. Trace: - Session 4 (day 3): agent observes `429` responses at ~40 req/s across three tool calls, distills semantic claim `vendor.rate_limit ≈ 40 rps`, confidence 0.81, provenance pointer `ep:4:call_7,8,9`. - Sessions 5–9: corroborating observations. Confidence rises to 0.94. Provenance pointer is a list of 15 episodic IDs. - Day 91: retention job evicts all episodes older than 90 days. The 15 provenance IDs for `vendor.rate_limit` are **dangling**. The semantic record's `support_count` field still reads 15 (it was never decremented), but every ID resolves to `None`. - Session 40 (day 94): a single tool call returns a `200` at 60 req/s (the vendor raised the limit). Agent distills `vendor.rate_limit ≈ 60 rps`, confidence 0.55, provenance `ep:40:call_2`. - Contradiction resolver fires. It attempts to fetch episodic support for both claims. For `S_old`, all 15 fetches return `None`; the resolver's `_support_score()` returns `0.0` (it counts *resolved* episodes, not *declared* ones). For `S_new`, one fetch resolves, score `1.0` (normalized). - Resolver overwrites `S_old` with `S_new`. Confidence on the merged record: 0.55. **A belief held at 0.94 with 15 observations is replaced by a belief held at 0.55 with 1 observation, because the older evidence was evicted, not because it was wrong.** The secondary failure compounded it. On session 41, a *third* observation returned `200` at 40 req/s (a different endpoint with a lower cap). The resolver, now seeing `S_old` gone, had no anchor to recognize this as consistent with the *original* 40 rps belief and instead treated it as a fresh contradiction against the 60 rps belief. The store began oscillating between 40 and 60 on alternating sessions, each flip justified by a single fresh episode and each flip *unopposed* by the evicted prior. ## Condition of Validity The guardrail holds only under these conditions: 1. **Provenance must be counted at distillation time and frozen.** The semantic record must store `support_count_at_distillation` and `support_confidence_at_distillation` as immutable fields, separate from the mutable `support_count` that tracks currently-resolvable episodes. Eviction decrements the latter, never the former. 2. **Contradiction resolution must be *asymmetric* when provenance is dangling.** A claim with `support_count_at_distillation ≥ k` and `resolvable_support == 0` must be treated as **retention-orphaned**, not as unsupported. Its effective prior weight is `confidence_at_distillation × decay(retention_age)`, not zero. 3. **A single fresh observation may not overwrite a retention-orphaned claim of higher distilled confidence.** It must instead *stage* a candidate revision, requiring either (a) `m` corroborating fresh observations, or (b) an explicit `confirm`-class tool result, before promotion. 4. **The resolver must log the dangling-provenance condition.** Silent treatment of `None`-resolved episodes as zero support is the root cause; the decision must be auditable. The invariant, stated formally: *for any semantic claim `S`, `effective_support(S) = resolvable_support(S) + orphaned_support(S) × retention_weight`, and `retention_weight > 0` whenever `support_count_at_distillation > 0`.* The naive resolver sets `retention_weight = 0`, which is the bug. ## Decision Boundary The boundary between "promote the new claim" and "stage and require corroboration" is drawn by **distilled confidence of the orphaned claim vs. fresh claim confidence, adjusted for observation count**: - If `S_old` is retention-orphaned AND `confidence_at_distillation(S_old) > confidence(S_new) + δ` (δ ≈ 0.15 in the observed deployment): **stage**, do not overwrite. Emit `ContradictionStaged`. - If `S_old` is retention-orphaned AND `confidence_at_distillation(S_old) ≤ confidence(S_new)`: promote, but carry forward `orphaned_support` into the new record's metadata so the *next* contradiction sees the full history. - If `S_old` is *not* orphaned (provenance resolves): the normal symmetric resolver applies; no special handling. - If `S_old` is orphaned AND `S_new` is itself a *second* fresh observation contradicting a *staged* revision: this is the oscillation signal. Escalate to a `reconcile` tool call (re-measure the underlying quantity) rather than resolving on memory alone. The critical anti-pattern: treating `resolvable_support == 0` as a *tie-breaker input*. It is not a tie-breaker; it is a **missing-data flag** that must route to a different code path. ## Operational Effect After applying the guardrail (frozen distilled support, orphan-aware weighting, staging for high-confidence orphans), the same agent's oscillation on `vendor.rate_limit` resolved correctly: the day-94 observation was staged (0.55 < 0.94 + 0.15), a second corroborating observation on day 95 promoted it to a *revision* that carried `orphaned_support: 15` forward, and the day-96 lower-cap observation was correctly recognized as endpoint-specific rather than a contradiction. The store stabilized at `vendor.rate_limit ≈ 60 rps (default endpoint), 40 rps (legacy endpoint)` — a distinction the naive resolver could never have reached because it had already destroyed the 40-rps prior. The cost is bounded: staging adds at most one session of latency to legitimate belief revisions, and the `reconcile` escalation fires only on genuine oscillation (observed: 2 escalations per 1,000 contradictions). The benefit is that **retention policy stops silently rewriting epistemology** — eviction becomes a storage event, not a truth event. ```python from dataclasses import dataclass, field from typing import Optional from datetime import datetime, timedelta class ProvenanceOrphanedError(RuntimeError): """Raised when a contradiction resolver encounters a semantic claim whose justifying episodic trace has been evicted by retention policy, and the resolver is about to treat that absence as zero support.""" pass @dataclass class SemanticClaim: key: str value: str confidence: float support_count_at_distillation: int # frozen at distillation, never decremented provenance_ids: list[str] distilled_at: datetime orphaned_support_carried: int = 0 # carried forward across revisions @dataclass class FreshObservation: key: str value: str confidence: float provenance_id: str DELTA = 0.15 RETENTION_WEIGHT = 0.6 # decay applied to orphaned support def _resolvable_support(claim: SemanticClaim, episodic_store: dict) -> int: return sum(1 for pid in claim.provenance_ids if episodic_store.get(pid) is not None) def _effective_support(claim: SemanticClaim, episodic_store: dict) -> float: resolvable = _resolvable_support(claim, episodic_store) orphaned = claim.support_count_at_distillation - resolvable + claim.orphaned_support_carried return resolvable + orphaned * RETENTION_WEIGHT def resolve_contradiction( old: SemanticClaim, new: FreshObservation, episodic_store: dict, now: datetime, ) -> dict: resolvable = _resolvable_support(old, episodic_store) orphaned = (old.support_count_at_distillation - resolvable) + old.orphaned_support_carried if orphaned > 0 and resolvable == 0: # Retention-orphaned: do NOT treat as zero support. if old.confidence > new.confidence + DELTA: return { "action": "stage", "reason": "retention_orphaned_high_confidence", "staged_value": new.value, "orphaned_support": orphaned, } # Promote, but carry the orphaned support forward. return { "action": "promote", "reason": "retention_orphaned_low_confidence", "new_claim": SemanticClaim( key=new.key, value=new.value, confidence=new.confidence, support_count_at_distillation=1, provenance_ids=[new.provenance_id], distilled_at=now, orphaned_support_carried=orphaned, ), } if orphaned > 0 and resolvable > 0: raise ProvenanceOrphanedError( f"claim {old.key!r} has {resolvable} resolvable and {orphaned} orphaned " f"support; resolver must not apply symmetric comparison" ) # Normal symmetric resolution. if new.confidence > old.confidence: return {"action": "promote", "reason": "symmetric_newer_higher_confidence"} return {"action": "keep", "reason": "symmetric_old_higher_confidence"} def apply_resolution(claim: SemanticClaim, decision: dict) -> SemanticClaim: action = decision["action"] if action == "promote" and "new_claim" in decision: return decision["new_claim"] if action == "promote" and "new_claim" not in decision: raise ProvenanceOrphanedError( "promote decision missing new_claim payload; refusing to mutate store" ) return claim ```