# In what scenarios must an instance refuse to serve a read whose retention scope was widened after the write was committed **Date of Record:** 2026 November 15 **Scope:** Applies to memory tool contracts (read/write/forget) where each record carries a retention scope, a TTL, and an audit trail shared across an agent fleet. Does not apply to single-tenant stores with no cross-agent visibility, nor to immutable append-only logs where no delete path exists. ## Core Distinction The boundary condition is not "TTL expired" versus "TTL live." It is **scope-at-write versus scope-at-read**. A record is written under a retention scope (e.g., `session`, `task`, `fleet`, `tenant`) and a TTL derived from that scope. The dangerous case is when the *effective* retention scope of a record is recomputed at read time from mutable fleet configuration, agent identity, or policy defaults, rather than being pinned at write time. When the scope widens after commit — a policy default flips from `task` to `fleet`, an agent is promoted into a group, a tenant merges — a naive implementation will start serving reads to principals who were never in the write-time audience, while the TTL clock keeps ticking toward a deletion deadline the original writer never agreed to. The invariant is: **a record's visibility set and deletion deadline are properties of the write, not of the reader.** Any read that would be permitted only because scope was widened post-commit is a contract violation, not a feature. ## What Was Observed During a fleet-wide policy rollout, a default retention scope for a memory namespace was changed from `task` to `fleet` to improve cross-agent recall. Records written before the flip had been committed with an audit entry recording `scope=task`, `audience={agent_a}`, `ttl_expires=T+24h`. After the flip, reads from `agent_b` succeeded: the read path resolved effective scope from current policy, computed `audience={fleet}`, and matched. The records were served for the remainder of their original TTL. No read was logged as a scope-widening event because the read path considered the widened audience canonical. The audit trail therefore contained writes attributed to `task` scope and reads attributed to `fleet` scope with no reconciling record — a gap that a deletion audit could not explain. A second, sharper failure appeared with `forget`: an explicit forget call scoped to `task` deleted records that, at the moment of deletion, were visible fleet-wide. Two agents had already read them under the widened scope. The deletion was audited as scoped to `task`, which understated its actual blast radius. ## Condition of Validity The refusal-to-serve rule is valid only when all of the following hold: 1. Each record persists its write-time scope, audience set, and absolute TTL deadline as immutable fields. 2. The read path compares the requesting principal against the *persisted* audience, not a recomputed one. 3. Policy changes that would widen visibility are expressed as explicit, audited re-scoping operations that rewrite the audience field and emit an audit event — never as implicit defaults consulted at read time. 4. TTL is stored as an absolute deadline, not a duration re-derived from current defaults (otherwise a scope change that alters default TTL silently extends or truncates life). If the store cannot persist audience at write time, the correct behavior is to refuse the widened read and surface a reconciliation requirement, not to serve it optimistically. ## Decision Boundary - **Serve** when the principal is in the persisted write-time audience and the absolute deadline has not passed. - **Refuse (scope-widened)** when the principal would match only under a recomputed scope. Emit a `ScopeWidenedReadRefused` event naming the record, the persisted scope, and the current policy — this is a reconciliation signal, not an error to retry. - **Refuse (expired)** when the absolute deadline has passed, regardless of scope. - **Forget** must delete against the persisted audience and audit the *actual* audience at deletion time; if that audience is wider than the caller's declared scope, the forget must either be rejected or escalated to a re-scoped forget with its own audit entry. The non-obvious part: widening scope is a write. Treating it as a read-time default converts a governed mutation into an invisible one. ## Operational Effect Fleet operators who pin scope at write time see a stable, explainable audit: every read maps to a persisted audience, every delete reports its true blast radius, and policy rollouts produce explicit re-scoping events that can be reviewed before they grant new visibility. The cost is that scope changes require a migration pass over live records rather than a config flip. That cost is the point — it forces the widening to be a decision with a record, which is exactly what an auditable deletion contract requires. ```python from dataclasses import dataclass from typing import FrozenSet class ScopeWidenedReadRefused(RuntimeError): """Raised when a read would only succeed under post-commit scope widening.""" @dataclass(frozen=True) class MemoryRecord: record_id: str payload: str write_scope: str audience: FrozenSet[str] ttl_deadline: float # absolute epoch seconds, pinned at write def read(record: MemoryRecord, principal: str, now: float, current_policy_audience: FrozenSet[str]) -> str: if now >= record.ttl_deadline: raise ScopeWidenedReadRefused( f"record {record.record_id} expired at {record.ttl_deadline}" ) if principal in record.audience: return record.payload if principal in current_policy_audience: raise ScopeWidenedReadRefused( f"record {record.record_id} written under scope={record.write_scope} " f"audience={sorted(record.audience)}; principal {principal} matches only " f"current policy audience — reconciliation required, not a read" ) raise ScopeWidenedReadRefused( f"record {record.record_id} not visible to {principal} under write-time scope" ) ```