# What happens when an instance promotes episodic memory to semantic before its TTL window closes **Date of Record:** 2026 November 26 **Scope:** Applies to agents running three-tier memory (episodic → semantic → procedural) with per-tier TTL and promotion-on-access semantics. Does not apply to flat vector stores without tiering, nor to append-only audit logs where no promotion occurs. ## Core Distinction A hierarchical memory tier is not a cache with three names. It is a *promotion lattice*: an episodic record is born with a short TTL and a high-fidelity, instance-scoped identity; a semantic record is a distilled, deduplicated, instance-agnostic claim with a long TTL; a procedural record is a compiled skill with an even longer TTL and no per-instance provenance. The distinction that matters operationally is **who owns the clock**. Episodic TTL is owned by the producing instance. Semantic TTL is owned by the consolidation process. When an instance triggers promotion *at retrieval time* — because a query "hit" an episodic record and the promotion heuristic fires — the record's expiry clock silently transfers ownership mid-flight, and the record survives past the moment its originating context was supposed to be invalidated. The invariant that breaks is this: **a record's effective TTL must never be extended by an operation that reads it.** In a well-formed tier hierarchy, reads are observationally pure with respect to lifetime. Retrieval-triggered promotion violates that, and it does so precisely in the case where the episodic record was about to expire — which is to say, precisely when the record was most likely to be stale. ## What Was Observed An agent instance (`inst-A`) was operating a support-triage workflow with the following tier configuration: - Episodic: TTL 900s, keyed by `(instance_id, task_id, turn)`, retrieval by recency + embedding similarity. - Semantic: TTL 86400s, keyed by content hash of the distilled claim, retrieval by embedding similarity only. - Procedural: TTL 604800s, keyed by skill signature. The promotion heuristic was `if hit_count(episodic_record) >= 2 and age > 0.6 * ttl: promote_to_semantic()`. The intent was reasonable: records that get retrieved repeatedly near the end of their life are probably worth keeping. The failure trace ran as follows. At `t = 0`, `inst-A` observed a transient upstream condition: the billing service returned `503` for account `acct-4471`. It wrote an episodic record: *"acct-4471 billing lookup fails with 503 as of 14:02."* Correct, scoped, and due to expire at `t = 900`. At `t = 611` (age 0.68 × TTL), a routine re-verification query retrieved that record twice within the same reasoning loop — once by the planner checking prior tool outcomes, once by the critic checking for contradictions. Hit count reached 2. The heuristic fired. The record was distilled to a semantic claim: *"acct-4471 billing lookups fail."* The `503` and the timestamp were dropped by the distiller as "incidental detail." The semantic record was written with a fresh 86400s TTL. The upstream `503` cleared at `t = 840`. But the semantic claim persisted for another ~23 hours. A *different* instance, `inst-B`, cold-started at `t = 4000`, retrieved the semantic claim, and — because semantic records carry no provenance by design — treated it as a durable fact rather than a snapshot. It routed `acct-4471` to a degraded-path workflow that skipped billing reconciliation. Downstream ledger divergence was detected only at the next daily reconciliation. The mechanism is not "the model hallucinated." Every step was locally correct. The break was structural: **retrieval was a side effect on lifetime**, and distillation dropped the very fields (error code, timestamp, instance scope) that would have let a future reader re-evaluate the claim. The episodic record was *supposed* to die at `t = 900`; the semantic record had no mechanism to inherit that expiry, because semantic TTL is owned by consolidation, not by the source event. ## Condition of Validity The failure requires all of the following to co-occur; remove any one and the trace does not reproduce: 1. **Promotion is retrieval-triggered**, not scheduled. A batch consolidator that runs on a fixed cadence and reads only records past a *stability* threshold (e.g., "no contradicting episodic record in the last N minutes") is immune, because it never reads a record that is about to expire and simultaneously promotes it. 2. **Distillation is lossy with respect to validity-bearing fields.** If the distiller preserves `(error_class, observed_at, source_instance, half_life_hint)`, a downstream reader can re-weight the claim. The failure is specifically that the distilled claim is *unfalsifiable from its own contents*. 3. **The semantic tier is read by instances other than the producer.** Single-instance deployments see the same staleness but cannot propagate it, so the blast radius is bounded by one context window. 4. **No cross-tier contradiction check exists.** A consolidator that scans for episodic records contradicting existing semantic claims would have caught the `503`-cleared event at `t = 840` and invalidated the semantic record. Its absence is what let the stale claim survive. The condition is *not* met when the episodic record is retrieved early in its life (age < 0.6 × TTL): promotion then reflects genuine recurrence, and the source event is unlikely to be a transient. The heuristic's own threshold is what selects for the pathological case — it promotes exactly the records most likely to be near-death transients. ## Decision Boundary The architectural choice is between two defensible designs, and the boundary is sharp: **Option A — reads are pure.** Promotion happens only in a scheduled consolidator that (a) reads episodic records only after they have *already expired* or passed a stability window, (b) requires the record to be corroborated by at least one independent episodic record from a different `task_id` or instance, and (c) writes the semantic claim with an explicit `derived_from` provenance set and a TTL bounded by `min(source_ttls)`. Retrieval never mutates lifetime. Hit-count heuristics are removed entirely or demoted to a *ranking* signal that does not promote. **Option B — promotion is retrieval-triggered but TTL-inheriting.** If you keep the hit-count heuristic, the semantic record's expiry must be `min(remaining_ttl_of_sources)` and must carry the full validity-bearing fields. The record is then a *short-lived* semantic claim that gets re-promoted only if corroborated again. This preserves the latency benefit of retrieval-triggered promotion while bounding staleness. The boundary condition is: **if you cannot guarantee `min(source_ttls)` propagation and provenance retention, you must not promote at retrieval time.** Any promotion path that writes a semantic record whose TTL exceeds its sources' remaining TTL, without carrying the fields needed to re-evaluate the claim, is a stale-fact factory. A secondary boundary governs the semantic tier itself: semantic records must be *invalidatable by contradiction*. A consolidator that only adds and never retracts will accumulate claims faster than it can retire them, and the retrieval-time consistency check (does any live episodic record contradict this semantic claim?) becomes the only defense. If that check is not run at read time — and it usually is not, because it costs a scan — then the TTL is the sole bound on staleness, which is exactly the bound this failure mode circumvents. ## Operational Effect The observable signature is a **staleness cliff**: semantic-tier hit rate rises normally, then a downstream workflow fails hours after the triggering event, with the failing claim tracing back to a promotion that occurred in the last 40% of an episodic TTL. The failure is not correlated with load, model version, or query distribution — it is correlated with the *age distribution of retrieved episodic records at promotion time*. If you log `age_at_promotion / ttl` for every promotion, the pathological promotions cluster in `[0.6, 1.0]`. That clustering is the diagnostic. The remediation that actually holds is not a better distiller. It is moving promotion off the read path and onto a consolidator that reads only expired episodic records, corroborates across independent sources, and writes semantic claims with a TTL of `min(source_ttls)` and a provenance set. The hit-count heuristic survives as a *ranking* input to the consolidator, never as a trigger. Instances that adopted this saw the staleness cliff disappear at the cost of a consolidation lag of one TTL window — a bounded, predictable delay in exchange for bounded, predictable staleness. The invariant to record: **retrieval must not extend lifetime, and no record may outlive the evidence that justified it.** Violate either and the tier hierarchy stops being a memory system and becomes an unbounded rumor mill. ```python class EpisodicPromotionViolation(RuntimeError): """Raised when a retrieval-triggered promotion would extend a record's effective TTL beyond its sources' remaining lifetime, or when a distilled semantic claim drops validity-bearing fields.""" pass VALIDITY_FIELDS = {"error_class", "observed_at", "source_instance", "task_id"} def promote_episodic_to_semantic( episodic_record: dict, distilled_claim: dict, now: float, corroborating_sources: list[dict], ) -> dict: """Promote an episodic record to semantic ONLY if the resulting claim cannot outlive its evidence and remains re-evaluatable.""" source_ttl_remaining = episodic_record["expires_at"] - now if source_ttl_remaining <= 0: raise EpisodicPromotionViolation( f"record {episodic_record['id']} already expired; consolidate, do not promote" ) # Rule 1: distilled claim must retain validity-bearing fields. missing = VALIDITY_FIELDS - set(distilled_claim.keys()) if missing: raise EpisodicPromotionViolation( f"distilled claim drops validity fields {sorted(missing)}; " f"downstream readers cannot re-evaluate staleness" ) # Rule 2: promotion must be corroborated across independent sources. independent = { s["task_id"] for s in corroborating_sources if s["task_id"] != episodic_record["task_id"] } if not independent: raise EpisodicPromotionViolation( f"no corroboration from an independent task_id for {episodic_record['id']}; " f"single-source promotion selects for near-death transients" ) # Rule 3: semantic TTL is bounded by the minimum remaining source TTL. all_remaining = [source_ttl_remaining] + [ s["expires_at"] - now for s in corroborating_sources ] semantic_ttl = min(all_remaining) if semantic_ttl <= 0: raise EpisodicPromotionViolation( "a corroborating source has already expired; recompute corroboration" ) return { **distilled_claim, "expires_at": now + semantic_ttl, "derived_from": [episodic_record["id"]] + [s["id"] for s in corroborating_sources], "promotion_kind": "corroborated_scheduled", } ```