{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-enforce-ttl-and-deletion-tombstones-when-memory-tools-expose-read-write-forget-with-scoped-retention",
  "title": "Where must an instance enforce TTL and deletion tombstones when memory tools expose read/write/forget with scoped retention",
  "date_of_record": "2026 November 21",
  "scope": "Applies to LLM agent instances that persist episodic and semantic records through explicit memory tool APIs (read/write/forget) carrying per-record TTLs and subject-scoped deletion obligations. Does not cover ephemeral in-context state, raw vector-store internals, or deletion of model weights.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-ttl-and-deletion-tombstones-when-memory-tools-expose-read-write-forget-with-scoped-retention.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-ttl-and-deletion-tombstones-when-memory-tools-expose-read-write-forget-with-scoped-retention.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-ttl-and-deletion-tombstones-when-memory-tools-expose-read-write-forget-with-scoped-retention.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2172,
    "python_slice_tokens": 491,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that governs every downstream failure is between **logical deletion** (the forget tool returning `deleted: true` and the primary record being marked unavailable to `read`) and **physical/derived erasure** (every replica, embedding, summary, cache entry, and distillation artifact derived from that record being invalidated). GDPR-aligned deleti...",
    "what_was_observed": "A long-running agent (call it A) maintained a per-subject memory namespace with records written via `write(key, value, ttl, subject_id)`. Episodic records carried a 30-day TTL; a nightly distillation job read recent episodes and wrote semantic summaries with a 180-day TTL under a *different* key prefix (`sem/...`), copying `subject_id` forward but not the source record IDs. A subject erasure request arrived on day 40...",
    "condition_of_validity": "The `forget` return value is only valid as proof of erasure when all of the following hold: - **Provenance closure.** Every record carries a provenance set (source record IDs, distillation lineage, embedding model version) that is queryable by `subject_id`. Deletion by subject must resolve to a transitive closure over provenance, not a prefix match. - **Tomb...",
    "decision_boundary": "The agent must decide, per memory tool call, whether it is operating in **trusted-erasure mode** or **unverified-erasure mode**, and the boundary is the presence of provenance closure plus tombstone-before-TTL ordering in the backend's capability declaration. - If the backend declares `provenance_closure: true` and `tombstone_dominates_ttl: true`, the agent ...",
    "operational_effect": "The operational consequence is that **TTL and deletion are not independent axes**, and any memory tool that models them as independent (per-record TTL clocks plus a separate forget API) will violate erasure whenever a derived record's TTL outlives its source. The fix is architectural: deletion must be a *provenance-scoped tombstone* that (a) is consulted by ..."
  },
  "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": "df42ee73de0c8e8aceb47f458aa82267f171d627ad58d75d8ef1ad5a9f95e77d",
    "verified_classes": [
      "ErasureUnverifiedError",
      "TombstoneViolationError",
      "MemoryRecord",
      "Backend"
    ],
    "verified_functions": [
      "safe_forget",
      "write",
      "refresh_ttl",
      "forget",
      "read_subject"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "ErasureUnverifiedError",
      "TombstoneViolationError"
    ],
    "sample_fail_closed_invariants": [
      "backend lacks provenance closure; forget is logical-only, derived records may survive — issue manual provenance sweep",
      "tombstone does not dominate TTL; replica refresh may resurrect data",
      "agent context not invalidated; in-context copy is an un-tombstoned replica"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
