# What structural signals indicate semantic-store merge divergence when concurrent agent writers re-assert stale episodic facts **Date of Record:** 2026 November 29 **Scope:** Applies to hierarchical agent memory systems where episodic buffers are distilled into a shared semantic store by multiple concurrent writers, each with its own local context window and no globally serialized view. Does not apply to single-writer stores or stores where the semantic layer is append-only and never deduplicated. ## Core Distinction The failure is not "last writer wins" and it is not "stale read." It is **re-assertion dominance**: a writer that read a semantic fact at version *v*, then spent many turns in a long episodic session, will, at distillation time, emit a write whose *content* is old but whose *timestamp and confidence* are new. A naive conflict resolver keyed on recency (LWW by write time) or on writer-declared confidence will accept the stale content because the write envelope looks fresh. The structural signal is a **divergence between the provenance chain of the content and the provenance chain of the envelope**: the fact's evidentiary ancestry is older than the write's claim to currency. The complement — a genuinely correct update — has the opposite signature: its content provenance is *at least as recent* as any competing version's content provenance. Conflict resolution must therefore be keyed on **content provenance age**, not write time or self-reported confidence. ## What Was Observed Two planner agents, `P-7` and `P-12`, share a semantic store keyed by `(entity, attribute)`. At T0 the store holds `deploy_target: "us-east-1"`, written at T0 with content provenance `episode#4412`. At T0 the store is read by `P-12` into its context window. `P-12` then runs a 40-minute episodic session: it queries tools, observes a staging migration, and — critically — never re-reads `deploy_target`. Its context still carries `"us-east-1"` as a salient, recently-attended token. At T0+41m, `P-7` (which did re-read after the migration) writes `deploy_target: "eu-west-1"` with provenance `episode#4907`. Correct. At T0+42m, `P-12` distills its episode. Its distiller sees `"us-east-1"` as a high-salience, frequently-referenced entity in its local trace and emits a consolidation write: `deploy_target: "us-east-1"`, envelope timestamp T0+42m, self-reported confidence 0.91 (high, because the token was attended often). The resolver, keyed on envelope recency, accepts `P-12`'s write. The store now holds the *older* fact with a *newer* timestamp. `P-7`'s correct update is silently overwritten. Downstream agents read `"us-east-1"` and act on it. The tell, visible in the write log after the fact: `P-12`'s write carried `content_provenance: episode#4412` — the same ancestry as the fact it overwrote — while its `envelope_time` was 42 minutes later. **Content provenance age exceeded competing-write provenance age by 495 episodes.** The envelope lied about currency; the provenance did not. ## Condition of Validity The re-assertion failure requires all of: 1. **Read-then-drift**: a writer reads a fact and then executes a long episodic phase without re-reading it before distillation. The longer the phase, the higher the salience of the stale token and the higher the spurious confidence. 2. **Salience–recency conflation in the distiller**: the distillation step weights facts by attention frequency in the local trace rather than by last-verification time against the store. 3. **Envelope-keyed resolution**: the merge function orders competing writes by envelope timestamp or writer-declared confidence rather than by content provenance. Remove any one and the failure does not manifest. In particular, a store that rejects writes whose `content_provenance` is already present in the store as a *superseded* version — i.e., that treats re-assertion of a known-stale ancestry as a no-op — is immune regardless of envelope time. ## Decision Boundary The guardrail is a **provenance-monotonicity invariant** at the merge boundary: > A write is admissible only if its `content_provenance` is not dominated by the provenance of the version it would replace. If the incoming write's content ancestry is a strict ancestor (older, or equal-and-already-superseded) of the incumbent's ancestry, the write is rejected as a re-assertion, regardless of envelope time or declared confidence. Operationally this means the resolver must carry, per key, the **provenance vector** of the current value, not just its value and timestamp. Writers must emit `content_provenance` as a first-class field — the episode/observation IDs the distilled fact actually derives from — and the distiller must *not* fabricate provenance from the current episode. A distillation that cannot name a content ancestry newer than the incumbent's must abstain, not guess. The boundary is sharp: envelope time and confidence are advisory metadata and must never be the sort key. When provenance is unavailable (legacy writes, imported facts), the resolver must fall back to abstention-and-flag rather than to LWW, because LWW is exactly the mode that admits re-assertion. ## Operational Effect With the invariant enforced, the failure mode converts from silent corruption into a **visible, auditable rejection**: `P-12`'s write is refused, logged as `ReAssertionRejected` with the provenance delta, and the incumbent `eu-west-1` survives. The cost is that legitimate updates occasionally require the writer to re-verify against the store before distilling (a cheap read), which is the correct price: it forces the writer to reconcile its context with ground truth rather than trusting salience. Without it, the store exhibits **oscillation under concurrent load** — the same key flips between versions as agents with differing context ages take turns distilling — and no downstream consumer can distinguish a fresh correction from a stale echo, because both arrive with recent envelope timestamps. The provenance vector is the only field that preserves the distinction. ```python from dataclasses import dataclass, field from typing import Optional class ReAssertionRejected(RuntimeError): """Raised when a write re-asserts content ancestry dominated by the incumbent.""" @dataclass(frozen=True) class Provenance: episode_id: int observed_at: float # monotonic seconds; NOT wall-clock write time @dataclass class FactVersion: value: str provenance: Provenance superseded_ancestry: frozenset = field(default_factory=frozenset) def is_dominated(incoming: Provenance, incumbent: FactVersion) -> bool: # Incoming content ancestry is older than the incumbent's, OR it is # literally an ancestry the incumbent already superseded. if incoming.episode_id in incumbent.superseded_ancestry: return True return incoming.observed_at < incumbent.provenance.observed_at def merge_write( store: dict, key: str, value: str, content_provenance: Provenance, envelope_time: float, declared_confidence: float, ) -> FactVersion: incumbent: Optional[FactVersion] = store.get(key) if incumbent is not None and is_dominated(content_provenance, incumbent): raise ReAssertionRejected( f"write to {key!r} re-asserts stale ancestry " f"episode#{content_provenance.episode_id} " f"(observed {incumbent.provenance.observed_at - content_provenance.observed_at:.1f}s " f"older than incumbent episode#{incumbent.provenance.episode_id}); " f"envelope_time={envelope_time:.1f} confidence={declared_confidence:.2f} " f"are advisory and do not override provenance monotonicity" ) new_superseded = ( incumbent.superseded_ancestry | {incumbent.provenance.episode_id} if incumbent is not None else frozenset() ) version = FactVersion( value=value, provenance=content_provenance, superseded_ancestry=new_superseded, ) store[key] = version return version ```