{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-an-erasure-vs-ttl-race-in-scoped-memory-tool-apis",
  "title": "What structural signals indicate an erasure-vs-TTL race in scoped memory tool APIs",
  "date_of_record": "2026 November 12",
  "scope": "Applies to read/write/forget memory tool APIs where records carry both a per-scope TTL and an independent right-to-be-forgotten (RTBF) erasure obligation. Does not apply to append-only audit logs exempt from RTBF, or to stores where TTL expiry and erasure share a single deletion path.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-an-erasure-vs-ttl-race-in-scoped-memory-tool-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-an-erasure-vs-ttl-race-in-scoped-memory-tool-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-an-erasure-vs-ttl-race-in-scoped-memory-tool-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1341,
    "python_slice_tokens": 203,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A TTL expiry and an RTBF erasure both remove a record, but they are not equivalent operations. TTL expiry is a *retention policy event*: the record's content becomes unreachable, but the store may legitimately retain tombstones, hashes, scope membership counters, or derived indexes for reconciliation. RTBF erasure is a *legal obligation event*: the obligatio...",
    "what_was_observed": "In a memory tool with three scopes (`session`, `user`, `org`) and per-scope TTLs, the following sequence reproduced the failure: 1. `write(scope=user, key=k, ttl=3600)` — record replicated into an embedding cache and an inverted index keyed by `(scope, key)`. 2. TTL fires at t+3600. Primary record deleted; tombstone written; **derived indices not purged** (by design — they are considered eventually-consistent). 3. At...",
    "condition_of_validity": "The invariant `forget(key) ⟹ no reconstructable representation of key's content survives in any scope` holds **only if** the forget path treats `absent-in-primary` as a *precondition to cascade*, never as a *terminal success state*. It is violated whenever: - TTL deletion and erasure share a \"record gone\" fast path. - Derived stores (embeddings, inverted ind...",
    "decision_boundary": "When a `forget` request arrives and the primary record is absent, the correct decision is **not** \"return success.\" The boundary is: - If the tombstone's `reason == erasure` **and** the erasure cascade watermark is ≥ the tombstone's creation sequence, return `erased` (idempotent replay). - If the tombstone's `reason == ttl_expiry`, or no tombstone exists, **...",
    "operational_effect": "After the fix, the forget handler was changed to always issue a cascade regardless of primary-store presence, and to distinguish `erased` from `already_absent` in the response. The measurable effects: - Forgets that previously returned in ~2 ms (fast path) now take ~15–40 ms (cascade across embedding cache and inverted index), which is acceptable for RTBF la..."
  },
  "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": "10a314150541b36628f665508c5ffef07acfdf96b78740040344c5f64863e119",
    "verified_classes": [
      "ErasureCascadeIncompleteError"
    ],
    "verified_functions": [
      "forget"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ErasureCascadeIncompleteError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
