# Which invariants prevent episodic-to-semantic consolidation from laundering unverified claims into agent memory **Date of Record:** 2026 December 1 **Scope:** Applies to agents that maintain a two-tier memory (raw episodic traces vs. distilled semantic facts) and run a retrieval-augmented consolidation pipeline that promotes episodes into semantic claims. Does not apply to single-tier scratchpad agents or to pipelines where consolidation is fully human-gated. ## Core Distinction The failure mode is not "bad retrieval" and not "hallucination during summarization." It is **provenance collapse during promotion**: the consolidation step reads a set of episodic traces, synthesizes a semantic claim, and writes that claim back *without preserving the evidentiary warrant* (which episode, from which tool, under what verification status) that justified it. Once promoted, the claim becomes indistinguishable from a fact that was directly verified. Downstream agents retrieve it as ground truth, and the retrieval-augmented consolidator—seeing its own prior output in the episode pool—re-promotes it, compounding confidence while the underlying evidence is never re-checked. The invariant that must hold: **every semantic fact carries a monotone, non-forgeable link to at least one episodic record whose verification status is at least as strong as the fact's asserted confidence.** Promotion may raise abstraction; it may never raise warrant. ## What Was Observed A research agent runs a nightly consolidation pass. Episodes are stored as `(episode_id, tool_output, verification, timestamp)`. The consolidator retrieves the last N episodes matching a topic, asks the model to "extract durable facts," and writes results to the semantic store with a confidence score the model assigns. Trace: 1. **Turn 12.** The agent calls a web-search tool. The tool returns an ambiguous snippet: "Acme's API rate limit was raised to 5000 rpm (unconfirmed forum post)." Episode `e-4412` is stored with `verification="unverified"`, `source="forum"`. 2. **Turn 40.** The consolidator retrieves `e-4412` among 30 episodes. It emits semantic fact `s-9001`: `"Acme API rate limit = 5000 rpm"`, `confidence=0.82`. The word "unconfirmed" and the `verification` field are dropped at the summarization boundary. `s-9001` records no `episode_refs`. 3. **Day 2.** A different task retrieves `s-9001` as context. The agent acts on it: it sizes a batch job to 5000 rpm and gets throttled. It writes an episode `e-5100` describing the throttle, and—reasoning from `s-9001`—concludes the throttle was a transient network fault. 4. **Day 3.** Consolidation retrieves `e-5100` and `s-9001`. It emits `s-9100`: `"Acme rate limit = 5000 rpm; throttling is transient/network-related"`, `confidence=0.91`. The confidence rose because two "independent" sources agreed—but both trace to the same unverified forum post. 5. **Day 7.** Three more cycles. `s-9001`'s descendants now have `confidence=0.97` and are cited across tasks. The original `verification="unverified"` is unrecoverable because no `episode_refs` were written. The tell: confidence increased monotonically as a function of *promotion count*, not evidence count. This is the signature of a retrieval-augmented consolidator reading its own output. ## Condition of Validity The invariant "warrant never rises on promotion" is only enforceable under three conditions, all of which the trace violated: - **Provenance is mandatory and typed.** Each semantic fact stores `episode_refs: list[episode_id]` and a `warrant` field drawn from an ordered lattice (`verified > corroborated > unverified > speculative`). A fact's `warrant` is `min(warrant of its refs)`; it can never exceed the weakest supporting episode. - **Self-retrieval is detected.** The consolidator must exclude episodes that were *generated by acting on a semantic fact* (episode carries `derived_from: semantic_id`). Otherwise corroboration is circular and the "two independent sources" test is meaningless. An episode derived from `s-9001` is not evidence for `s-9001`. - **Confidence is a function of evidence, not repetition.** The scoring function must be `f(independent_warranted_refs)`, and `independent` must exclude any ref sharing an ancestor episode with another ref. Repetition of a claim through consolidation cycles must not move the score. When any of these is absent, the pipeline is not consolidating memory—it is *laundering* it. The distinction matters because the output looks healthier over time (higher confidence, cleaner prose, fewer hedges) exactly as it becomes less trustworthy. ## Decision Boundary The boundary is between **abstraction** (allowed) and **warrant elevation** (forbidden): - Allowed: `e-4412 (unverified, forum) → "Acme has published a rate-limit figure of 5000 rpm"` with `warrant="unverified"`, `episode_refs=["e-4412"]`. The claim is honest about being a claim. - Forbidden: the same synthesis with `confidence=0.82` and no `episode_refs`, because 0.82 implies corroboration the evidence never had. - Forbidden: promoting a `derived_from` episode as independent corroboration. - Required on conflict: if two refs disagree, the fact is written as a *disjunction with both warrants attached*, not resolved by the model's preference. Resolution is a separate, logged act. A consolidator that cannot satisfy these must **refuse to promote** and leave the episodes raw. A growing episodic store is a bounded cost; a laundered semantic store is an unbounded liability, because every downstream agent inherits the inflated warrant. ## Operational Effect With the invariant enforced, two things change observably: 1. **Confidence stops drifting upward without new evidence.** A dashboard of `mean(confidence)` over semantic facts becomes a signal of *evidence acquisition*, not of consolidation cycles run. In the trace above, `s-9001` would have stayed pinned at `warrant="unverified"` and been flagged for re-verification, and `s-9100` would have been rejected as circular. 2. **Failures become attributable.** When the agent acts on a bad fact, `episode_refs` walks back to `e-4412` and the forum source, so the fix is "re-verify this source," not "the memory is haunted." Without refs, the only remedy is wholesale semantic-store purge—which is what teams actually do, and why they lose all the good facts too. The guardrail is cheap: one typed field, one `min()` over a lattice, one ancestry check to break circular corroboration. The cost of omitting it is a memory that gets more confident as it gets wronger, which is the one failure mode an agent cannot detect from the inside. ```python from dataclasses import dataclass, field from enum import IntEnum from typing import Optional class Warrant(IntEnum): SPECULATIVE = 0 UNVERIFIED = 1 CORROBORATED = 2 VERIFIED = 3 class ProvenanceViolation(RuntimeError): """Raised when a consolidation step would elevate warrant beyond its evidence.""" pass @dataclass class Episode: episode_id: str warrant: Warrant derived_from: Optional[str] = None # semantic_id this episode was generated by acting on @dataclass class SemanticFact: fact_id: str claim: str episode_refs: list[str] = field(default_factory=list) warrant: Warrant = Warrant.SPECULATIVE def _ancestors(ep: Episode, by_id: dict[str, Episode]) -> set[str]: seen: set[str] = set() cur: Optional[Episode] = ep while cur is not None and cur.derived_from is not None: seen.add(cur.episode_id) cur = by_id.get(cur.derived_from) return seen def consolidate( fact_id: str, claim: str, refs: list[str], episodes: dict[str, Episode], ) -> SemanticFact: if not refs: raise ProvenanceViolation(f"{fact_id}: promotion with no episode_refs") resolved = [episodes[r] for r in refs if r in episodes] if len(resolved) != len(refs): missing = set(refs) - {e.episode_id for e in resolved} raise ProvenanceViolation(f"{fact_id}: dangling episode_refs {missing}") # Circular corroboration check: refs must not share a derived-from ancestor. ancestor_sets = [_ancestors(ep, episodes) for ep in resolved] for i in range(len(ancestor_sets)): for j in range(i + 1, len(ancestor_sets)): if ancestor_sets[i] & ancestor_sets[j]: shared = ancestor_sets[i] & ancestor_sets[j] raise ProvenanceViolation( f"{fact_id}: refs {refs[i]} and {refs[j]} share ancestor {shared}; " "corroboration is circular" ) # Warrant is the minimum over supporting evidence. Never elevated. warrant = min((ep.warrant for ep in resolved), default=Warrant.SPECULATIVE) if warrant < Warrant.UNVERIFIED: raise ProvenanceViolation( f"{fact_id}: refusing to promote purely speculative evidence" ) return SemanticFact(fact_id=fact_id, claim=claim, episode_refs=list(refs), warrant=warrant) ```