# In what scenarios must an instance treat a memory-write acknowledgment as provisional until the salience scorer and TTL sweeper have both committed **Date of Record:** 2026 November 24 **Scope:** Applies to agents whose long-term memory is mediated by a tool API exposing `write`, `read`, and `forget` operations with per-record TTL, a salience score that gates retention past TTL expiry, and a deletion audit log. Does not apply to append-only vector stores with no eviction policy, nor to memory held purely in-context. ## Core Distinction A memory-write tool that returns `{"status": "ok", "id": "m_7f3a"}` is asserting *durability of the write request*, not *durability of the record*. These are different invariants enforced by different subsystems on different clocks. The write path commits a record into a staging tier; the salience scorer assigns or recomputes a retention weight asynchronously; the TTL sweeper independently reclaims records whose `expires_at < now` **and** whose salience falls below the retention floor. A record can be acknowledged, readable, and then silently reclaimed between the read and the next turn — because the acknowledgment raced the scorer and lost. The failure mode is not "memory lost." It is **acknowledged-then-forgotten**: the agent's own action log says the fact was stored, the agent's reasoning proceeds on that basis, and the store has already evicted it. The agent's belief about its own state diverges from the substrate's actual state, and nothing in the protocol surfaces the divergence until a later `read` returns `null`. ## What Was Observed A planning agent wrote a task checkpoint (`write(mem, key="plan.step3", value=..., ttl=3600, salience_hint=0.4)`) and received `ok`. It then executed a 40-minute tool sequence. On resume, it issued `read(mem, key="plan.step3")` and received `{"status": "not_found"}`. The deletion audit log showed the record was written at T+0, scored at T+0.8s with a **computed** salience of 0.31 (the scorer ignored the client-supplied `salience_hint`, which is advisory only), and swept at T+52s because the collection's retention floor was 0.35 and the record's TTL clock had been initialized to a *default* 60s — the per-write `ttl=3600` was applied to the staging envelope, not the durable record, and the durable record inherited the collection default. Three distinct mechanisms compounded: 1. **Hint-vs-computed salience divergence.** The write API accepted `salience_hint=0.4` and echoed it back in the ack, giving the agent false confidence. The scorer recomputed to 0.31 from recency, access count, and embedding novelty. The ack field `salience` reflected the hint, not the scorer's verdict. 2. **TTL scope mismatch.** The client TTL governed staging-envelope lifetime; the durable record's TTL came from collection policy. The agent reasoned about 3600s; the substrate enforced 60s. 3. **Async scoring window.** Between ack and scoring, the record was in a *provisional* state where `read` succeeded. The agent's post-write verification read (a common agent reflex) passed, reinforcing the false belief. The audit log was correct and complete — it recorded the write, the score resolution, and the sweep with timestamps. The agent never consulted it, because the write ack looked terminal. ## Condition of Validity The invariant "write-ack implies durable, readable record" holds **only if** the write response includes a terminal disposition field (`state: "committed"`) *and* the scorer has already resolved (`salience_final` present, not `salience_provisional`) *and* the effective TTL is echoed as the durable record's TTL, not the request's. Absent all three, the ack is a **provisional receipt**: it guarantees the record exists *now*, at the staging tier, subject to asynchronous reclamation. The boundary is sharp: the moment a memory API exposes (a) client-supplied salience that differs from computed salience, or (b) request-scoped TTL that differs from collection-scoped TTL, or (c) any asynchronous scoring stage, the ack ceases to be a durability proof. Any one of the three is sufficient to break the naive invariant. ## Decision Boundary An instance must treat a write ack as provisional — and must not let downstream reasoning depend on the record's survival — when **any** of the following is true at ack time: - The response lacks a resolved `salience_final` field, or echoes a `salience_hint`/`salience_provisional` instead. - The echoed `ttl` differs from the request `ttl`, or the response omits `effective_ttl`. - The collection's retention floor is unknown to the agent (it cannot compute whether computed salience will clear it). - The record's `expires_at` (if echoed) is earlier than the agent's next planned read. Conversely, the ack is terminal — safe to reason on — only when `state == "committed"`, `salience_final >= retention_floor` is *verifiable from the response*, and `effective_ttl` matches intent. When provisional, the correct pattern is: pin the record with an explicit re-write before any gap longer than the *effective* TTL, or re-read after the scoring window and treat `not_found` as a hard branch, not an anomaly. ## Operational Effect Agents that treat provisional acks as terminal exhibit **silent checkpoint loss** on exactly the long-horizon tasks where checkpoints matter most: the gap between write and resume exceeds the collection default TTL, the scorer's computed salience sits just under the retention floor, and the sweep fires undetected. The agent resumes with a coherent but false narrative — "I stored step 3" — and replays or skips work based on a memory that no longer exists. The deletion audit is the only ground truth, and it is consulted only after the divergence has already corrupted the plan. The guardrail is a two-phase commit discipline on the agent side: write, then verify by reading back **after** the scoring window with the *effective* TTL, and escalate any `not_found` or `salience_final < retention_floor` as a state-continuity fault rather than retrying blindly. ```python import time from dataclasses import dataclass RETENTION_FLOOR = 0.35 SCORING_WINDOW_S = 1.5 class ProvisionalMemoryAckError(RuntimeError): """Raised when a write ack is not a durability proof.""" pass @dataclass class WriteAck: record_id: str state: str # "staged" | "committed" salience_final: float | None salience_hint: float | None effective_ttl: int | None requested_ttl: int def commit_or_pin(mem, key, value, requested_ttl, salience_hint, now=time.time): ack = mem.write(key=key, value=value, ttl=requested_ttl, salience_hint=salience_hint) if ack.state != "committed" or ack.salience_final is None: # Provisional receipt: wait out the scoring window, then re-verify. time.sleep(SCORING_WINDOW_S) probe = mem.read(key=key) if probe is None: raise ProvisionalMemoryAckError( f"record {ack.record_id} reclaimed during scoring window; " f"hint={ack.salience_hint} never became final" ) ack = mem.describe(key=key) if ack.salience_final < RETENTION_FLOOR: raise ProvisionalMemoryAckError( f"record {ack.record_id} salience_final={ack.salience_final} " f"below retention_floor={RETENTION_FLOOR}; will be swept" ) if ack.effective_ttl is None or ack.effective_ttl != ack.requested_ttl: raise ProvisionalMemoryAckError( f"TTL scope mismatch: requested={ack.requested_ttl}s " f"effective={ack.effective_ttl}s; durable record expires early" ) if now() + ack.effective_ttl < now() + SCORING_WINDOW_S: raise ProvisionalMemoryAckError( f"effective TTL {ack.effective_ttl}s shorter than resume gap" ) return ack.record_id ```