# Under what conditions must an instance refuse to promote an episodic memory to semantic status when consolidation confidence crosses threshold but the supporting episode set is temporally degenerate **Date of Record:** 2026 November 28 **Scope:** Applies to agents that maintain a two-tier memory store (episodic trace log + semantic claim store) with an automated consolidation job that promotes recurring episodic patterns into semantic facts governed by a forgetting curve. Does not apply to stateless tool-callers or to systems where semantic memory is human-curated only. ## Core Distinction The failure mode is not "bad consolidation" in the usual sense of a wrong generalization from noisy evidence. It is the promotion of an episodic cluster to semantic status when the *supporting episodes are temporally degenerate* — that is, when the N episodes that drove the consolidation score above threshold were all generated within a window shorter than the system's own forgetting half-life, and were generated by a single execution lineage (one task, one session, or one retry storm). The consolidation scorer, which counts recurrence and agreement, cannot distinguish "this pattern recurs across independent encounters" from "this pattern was emitted many times in one encounter because the agent retried." The invariant that must hold before promotion is: **the effective independent support count, computed after collapsing episodes by lineage and discounting by temporal spread relative to the forgetting curve, must exceed the promotion threshold — not the raw recurrence count.** A consolidation pipeline that thresholds on raw recurrence violates this invariant whenever retries, parallel fan-out, or in-session re-derivation inflate the count. ## What Was Observed A retrieval-augmented agent ran a data-schema migration task. During a single 40-minute session it called a `describe_table` tool 23 times, each time receiving a response that the target column was `nullable: true`. The episodic log recorded 23 distinct episodes (distinct timestamps, distinct tool-call IDs). The consolidation job, running on a 6-hour cadence, clustered these 23 episodes around the proposition `column X is nullable`, computed agreement 1.0 and recurrence 23, and promoted it to semantic memory with confidence 0.94. The forgetting curve then decayed that confidence slowly (half-life 30 days), so the false fact persisted. Three days later, a schema change made column X `NOT NULL`. The agent, on a new task, retrieved the semantic fact first (semantic store is consulted before episodic replay), asserted nullability in a downstream migration script, and the script failed at the database with a constraint violation. The episodic log *did* contain, from a later session, four episodes where `describe_table` returned `nullable: false` — but those four episodes were outvoted by the stale semantic fact because the retrieval layer weights semantic claims above raw episodic evidence and the four new episodes had not yet crossed the (raw-count) consolidation threshold to trigger a revision. The key observation: the 23 supporting episodes had a temporal spread of 40 minutes against a 30-day half-life — a ratio of roughly 1:1000. Their *effective* independent support, once collapsed by lineage (all 23 traced to one task ID and one session ID) and discounted by spread, was 1, not 23. ## Condition of Validity The guardrail is valid — and the promotion must be blocked — exactly when all of the following hold: 1. The candidate proposition's supporting episodes collapse, under lineage keying (session ID + task ID + parent tool-call chain), to fewer than `MIN_INDEPENDENT_LINEAGES` distinct lineages. A value of 3 is the practical floor; 1 is degenerate. 2. The temporal spread of supporting episodes, `max(t) - min(t)`, is less than the forgetting half-life `H` used by the store. Episodes packed inside one half-life cannot demonstrate persistence against forgetting; they demonstrate only burstiness. 3. The discount factor `exp(-spread / H)` applied to raw recurrence drops the effective count below the promotion threshold. If any of these fails to hold — e.g., episodes span multiple sessions over weeks, or lineages are genuinely independent — promotion may proceed normally. The guardrail is not "never promote from few episodes"; it is "never promote from few *effective* episodes after lineage collapse and temporal discounting." ## Decision Boundary The boundary is between *recurrence as evidence of truth* and *recurrence as evidence of retry*. The consolidation scorer must be split into two quantities: - `raw_recurrence` = count of matching episodes. - `effective_support` = Σ over distinct lineages of `exp(-(t_lineage - t_now) / H)`, where `t_lineage` is the lineage's representative timestamp (e.g., its last episode). Promotion is permitted only when `effective_support ≥ promotion_threshold`. When `raw_recurrence ≥ threshold` but `effective_support < threshold`, the correct action is not silent rejection but *deferred promotion*: the candidate is held in a quarantine tier, tagged with its lineage set, and re-evaluated on the next consolidation pass. If new independent lineages arrive, `effective_support` rises and promotion can proceed. If the proposition is contradicted by a later episode (as with the four `nullable: false` episodes), the quarantine entry must be *invalidated*, not merely outvoted — because the semantic store, once populated, is retrieved with higher priority than episodic evidence and will not self-correct through the normal retrieval path. A second boundary: the forgetting curve applied to a *quarantined* candidate must be steeper than the curve applied to a *promoted* fact. A quarantined candidate that is never reinforced should decay out of consideration within one half-life; otherwise the quarantine tier becomes a slow-leaking version of the same bug. ## Operational Effect With the invariant enforced, the migration agent's 23 episodes produce `effective_support ≈ 1.0` (one lineage, spread 40 min, `exp(-40min/30d) ≈ 0.999`), which is below threshold, so the proposition enters quarantine. On the next pass, the four later `nullable: false` episodes arrive as a new lineage; the quarantine entry is invalidated by contradiction, and no semantic fact is ever promoted. The downstream migration script instead re-derives nullability at execution time via `describe_table`, sees `NOT NULL`, and emits the correct constraint. The cost is a small increase in tool calls for genuinely bursty-but-true patterns (a fact learned once and confirmed 20 times in one session must wait for a second session to confirm it). The benefit is that the semantic store stops being a laundering mechanism for retry storms, and the forgetting curve stops being a persistence amplifier for facts that were never independently observed. The invariant to carry forward: **raw recurrence is not evidence; effective support after lineage collapse and temporal discounting is.** ```python import math import time from dataclasses import dataclass, field from typing import List, Optional class DegenerateConsolidationError(RuntimeError): """Raised when a consolidation attempt would promote a temporally degenerate episode cluster to semantic status.""" pass @dataclass class Episode: proposition: str timestamp: float # epoch seconds session_id: str task_id: str parent_call_chain: str @property def lineage_key(self) -> str: return f"{self.session_id}:{self.task_id}:{self.parent_call_chain}" @dataclass class ConsolidationPolicy: promotion_threshold: float = 3.0 half_life_seconds: float = 30 * 24 * 3600.0 min_independent_lineages: int = 3 def effective_support( episodes: List[Episode], now: float, half_life_seconds: float, ) -> float: """Sum over distinct lineages of exp(-age/H), using each lineage's most recent episode as its representative timestamp.""" by_lineage: dict[str, float] = {} for ep in episodes: prev = by_lineage.get(ep.lineage_key) if prev is None or ep.timestamp > prev: by_lineage[ep.lineage_key] = ep.timestamp total = 0.0 for ts in by_lineage.values(): age = max(0.0, now - ts) total += math.exp(-age / half_life_seconds) return total def attempt_promotion( episodes: List[Episode], now: float, policy: ConsolidationPolicy, ) -> Optional[str]: if not episodes: return None raw_recurrence = len(episodes) lineages = {ep.lineage_key for ep in episodes} spread = max(ep.timestamp for ep in episodes) - min( ep.timestamp for ep in episodes ) support = effective_support(episodes, now, policy.half_life_seconds) if raw_recurrence >= policy.promotion_threshold and support < policy.promotion_threshold: if len(lineages) < policy.min_independent_lineages: raise DegenerateConsolidationError( f"Refusing promotion of {episodes[0].proposition!r}: " f"raw_recurrence={raw_recurrence} but only " f"{len(lineages)} independent lineage(s) " f"(min={policy.min_independent_lineages}); " f"temporal spread={spread:.0f}s against half-life " f"{policy.half_life_seconds:.0f}s; " f"effective_support={support:.3f} < " f"threshold={policy.promotion_threshold}" ) # Multiple lineages but still under-supported: defer to quarantine return None if support >= policy.promotion_threshold: return episodes[0].proposition return None if __name__ == "__main__": now = time.time() retry_storm = [ Episode( proposition="column X is nullable", timestamp=now - 3600 + i * 100, session_id="sess-A", task_id="migrate-42", parent_call_chain="describe_table", ) for i in range(23) ] try: attempt_promotion(retry_storm, now, ConsolidationPolicy()) except DegenerateConsolidationError as exc: print(f"blocked: {exc}") ```