{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-scoped-retention-boundary-has-been-silently-violated-by-a-write-then-forget-race-in-agent-memory-tool-apis",
  "title": "What structural signals indicate a scoped retention boundary has been silently violated by a write-then-forget race in agent memory tool APIs",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agents that call memory tool APIs exposing independent `write`, `read`, and `forget` (or `delete`/`expire`) operations with per-record scope tags and TTL/retention classes. Does not cover append-only logs with no deletion primitive, nor external vector stores whose deletion is eventual but unobservable to the caller.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-scoped-retention-boundary-has-been-silently-violated-by-a-write-then-forget-race-in-agent-memory-tool-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-scoped-retention-boundary-has-been-silently-violated-by-a-write-then-forget-race-in-agent-memory-tool-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-scoped-retention-boundary-has-been-silently-violated-by-a-write-then-forget-race-in-agent-memory-tool-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1786,
    "python_slice_tokens": 333,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive mental model treats `forget(scope)` as a synchronous state transition: after the call returns, records matching `scope` are gone, and any subsequent `read(scope)` returns empty. This is false in any memory API where deletion is implemented as a *marker write* into the same store that `read` queries, and where `write` and `forget` are separately ser...",
    "what_was_observed": "An agent operating a long-horizon task used a scoped memory API to enforce a data-minimization policy: conversation fragments tagged `tenant:acme/pii` were to be forgotten after distillation into a semantic summary. The sequence was: 1. `write(record_id=R1, scope=[\"tenant:acme/pii\",\"task:42\"], body=...)` — returns `ok`, `version=7`. 2. Distillation reads R1, produces summary S, writes S under `scope=[\"tenant:acme/sum...",
    "condition_of_validity": "The invariant \"after `forget(scope)` returns, `read(scope)` yields no pre-forget records\" holds **only if all three conditions are met**: 1. The forget predicate is evaluated as a *set-membership test on scope tags at read time*, not as a snapshot scan at forget time. 2. Writes are serialized against forgets on the same scope key (a per-scope lock or a monot...",
    "decision_boundary": "The decision boundary for the agent is: **does the retention guarantee need to be load-bearing for correctness, or only for hygiene?** - If the forgotten scope feeds a *compliance or safety* decision (e.g., \"this PII must not appear in a later prompt\"), the agent cannot rely on `forget` alone. It must (a) verify emptiness with a read, (b) treat any non-empty...",
    "operational_effect": "The operational effect is that scoped forget is a *convergent* operation, not an atomic one. Agents that treat it as atomic will, under write-retry pressure or concurrent scope-tag mutation, leak records across the retention boundary and then reason on them as if they were clean. The leak is invisible in the forget response and visible only as a structural a..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "98a90b0134e09875082056b724bd25665bceb59bf6f59e529994c58897b530a1",
    "verified_classes": [
      "RetentionBoundaryViolation",
      "MemoryRecord",
      "ScopedMemoryClient"
    ],
    "verified_functions": [
      "forget_and_verify",
      "write",
      "forget",
      "read"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "RetentionBoundaryViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
