# Under what conditions must an instance treat a revoked memory record as still authoritative during an in-flight tool loop **Date of Record:** 2026 November 28 **Scope:** Applies to agent instances whose memory is mediated by read/write/forget tool APIs that carry provenance (source record IDs, derivation chains) and revocation tokens. Does not apply to stateless single-shot inference or to memory backends without revocation semantics. ## Core Distinction The distinction that matters is not "revoked vs. live" but "revoked-at-the-store vs. revoked-in-the-instance's-working-set." A revocation is a state transition on the *authoritative store*. The instance's context window holds a *materialized copy* of the record produced by an earlier `read` call. Between the `read` that materialized the record and any subsequent `write` or downstream reasoning step that consumes it, the store may revoke that record. The instance does not observe this unless it re-reads or receives a push notification. Therefore the operational question is never "is this record revoked?" (the instance cannot know without a fresh read) but "what is the provenance-relative authority of a *stale materialization* of a record that may since have been revoked?" The non-obvious boundary: a record whose revocation is *causally downstream of the instance's own write* must be treated differently from a record revoked by an external actor. In the first case the instance's write created a derivation edge that the revocation semantics are designed to cascade through; in the second it did not. Conflating these two produces either silent resurrection of revoked facts or spurious invalidation of the instance's own committed work. ## What Was Observed A planner instance executed a loop: `read(record R)` → derive a plan fragment → `write(derived record D, provenance=[R])` → continue. A concurrent auditor revoked `R` at step 3 with a revocation token scoped to the `R` subtree, *including derived records*. The revocation cascade reached `D` and marked it revoked. The planner, holding `R`'s content in-context from step 1, proceeded to `read(D)` to verify its own write, received `D` with `status: revoked`, and — because its prompt instructed it to "treat revoked records as absent" — discarded `D` from its working set and *re-derived the same plan fragment from the in-context copy of `R`*, then wrote `D'` with `provenance=[R]`. `D'` was immediately revoked by the same cascade. The loop repeated until the token budget was exhausted. The instance never escaped because the in-context copy of `R` was immutable within the context window and the derivation was deterministic, so every re-derivation reproduced the revoked content. Two failure modes compounded here. First, **context-window resurrection**: the materialized copy of `R` outlived its store-level revocation and remained the instance's operative premise. Second, **cascade re-entry**: the instance's remediation (re-derive, re-write) fed the same revocation cascade, producing a fixed point of revocation that the instance interpreted as a transient error rather than a terminal condition. ## Condition of Validity The invariant that bounds this is a **provenance-scoped authority check on every consumption of a materialized record**, not just on read. Formally: before an instance uses the content of any record `X` that it materialized at time `t_read`, it must establish that no revocation event with a token covering `X`'s provenance ancestry has occurred in the interval `(t_read, t_now]`. The instance cannot establish this from its context alone; it must either (a) re-read `X` and check status, or (b) hold a lease/monotonic revocation epoch returned by the read API and compare against a cheap `epoch()` poll. The condition of validity for treating a stale materialization as authoritative is therefore: *the instance holds a revocation epoch from a read that is still current, OR the record's provenance ancestry contains no revocation-eligible ancestor.* If neither holds, the materialization is **provisionally revoked** and must not be used as a premise for a `write`. Critically, the instance's own writes are *not* exempt. A write `D` with `provenance=[R]` inherits `R`'s revocation exposure. If `R` is revoked after `D` is written, `D` is revoked by cascade — and the instance must treat its own prior derivation as invalidated, not as a committed fact. The only escape is a write whose provenance does not include any revocable record, or a write that the revocation policy explicitly marks as *revocation-immune* (e.g., a record derived from a non-revocable root). Absent that, re-derivation from a stale materialization reproduces the revocation. ## Decision Boundary The instance must distinguish three cases at the moment it observes `status: revoked` on a record it is about to consume: 1. **Revocation is external and the instance's materialization predates it.** Action: drop the materialization, do not re-derive from in-context copies of any ancestor in the revoked subtree, and request a fresh read of the nearest live ancestor. If no live ancestor exists, the derivation is unrecoverable and the instance must escalate, not retry. 2. **Revocation is a cascade from the instance's own write (the instance wrote `D` with `provenance=[R]` and `R` was revoked).** Action: the instance's write is invalidated by its own provenance edge. It must not re-write the same derivation; it must re-read `R`'s status, and if `R` is revoked, treat the entire derivation chain as dead. Retrying the write is a protocol violation, not an error recovery. 3. **Revocation is a cascade from a peer's concurrent write that shares an ancestor.** Action: the instance's write `D` and the peer's write `D_peer` both derive from `R`; revocation of `R` invalidates both. The instance must not assume its own write survives because it committed first. Provenance ancestry, not commit order, determines survival. The boundary is sharp: **any consumption of a materialized record whose provenance ancestry is revocation-eligible requires a fresh epoch check, and any re-derivation after observing revocation must use a *fresh read of a live ancestor*, never the in-context copy.** Violating either clause produces the fixed-point loop above. ## Operational Effect The practical consequence is that the memory tool API must expose a **revocation epoch** as a first-class return value on every `read`, and the instance's loop must gate every `write` on `epoch_current(ancestry)`. Without this, the instance's context window becomes a shadow store that diverges from the authoritative store by exactly the set of records revoked since materialization — and the divergence is invisible to the instance because its only signal is a `status` field it has been instructed to treat as "absent," which it then "remediates" by re-deriving from the stale copy. The guardrail: a `write` whose provenance includes any record with a revocation epoch older than the instance's last successful epoch poll must raise, not proceed. The instance must re-read the ancestry, confirm liveness, and only then re-derive. This converts an unbounded retry loop into a bounded, observable escalation. ```python class StaleProvenanceError(RuntimeError): """Raised when a write's provenance ancestry contains a record whose revocation epoch is older than the instance's last confirmed poll, meaning the materialized copy may have been revoked in-flight.""" pass def guarded_write(instance, derived_content, provenance_ids, store): # The instance must hold a current epoch for every ancestor it cites. for pid in provenance_ids: rec = store.get(pid) if rec is None: raise StaleProvenanceError( f"provenance ancestor {pid} not found in store" ) if rec.status == "revoked": # Do NOT re-derive from the in-context copy. Escalate. raise StaleProvenanceError( f"provenance ancestor {pid} is revoked; " f"re-derivation from stale materialization is forbidden" ) if rec.revocation_epoch > instance.last_confirmed_epoch: # The store advanced past what this instance has observed. # Re-read before writing; the materialization is provisional. raise StaleProvenanceError( f"provenance ancestor {pid} epoch {rec.revocation_epoch} " f"exceeds instance epoch {instance.last_confirmed_epoch}; " f"re-read required before write" ) return store.write(derived_content, provenance=provenance_ids) ```