{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-scoped-erasure-tombstones-from-being-resurrected-by-semantic-distillation-in-agent-memory-tool-apis",
  "title": "Which invariants prevent scoped-erasure tombstones from being resurrected by semantic distillation in agent memory tool APIs",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agents that expose `memory.write`, `memory.read`, `memory.forget`, and `memory.distill` (episodic→semantic rollup) as MCP-style tool calls with per-scope TTLs and right-to-be-forgotten (RTBF) erasure obligations. Does not cover vector-index compaction internals or storage-layer encryption-at-rest, except where they leak into tool semantics.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-scoped-erasure-tombstones-from-being-resurrected-by-semantic-distillation-in-agent-memory-tool-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-scoped-erasure-tombstones-from-being-resurrected-by-semantic-distillation-in-agent-memory-tool-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-scoped-erasure-tombstones-from-being-resurrected-by-semantic-distillation-in-agent-memory-tool-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2353,
    "python_slice_tokens": 639,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A deletion is not an event on a record; it is a **predicate over all future derivations of that record**. `memory.forget(id)` that only marks the source episodic row as `erased=true` satisfies the *read* path (the row is gone from `memory.read`) but says nothing about the *distillation* path. Semantic rollups are lossy, paraphrased, and frequently identity-o...",
    "what_was_observed": "A support-agent instance used a three-tier memory layout: `episodic` (raw turns, TTL 30d), `semantic` (distilled facts, TTL 180d), `procedural` (tool-use traces, TTL 90d). `memory.distill` ran on a nightly cron, reading episodic rows where `distilled_into IS NULL` and emitting semantic facts with a `source_ids: list[str]` provenance array. `memory.forget` implemented RTBF by setting `erased_at` on the target episodic...",
    "condition_of_validity": "The erasure-closure invariant holds only when all four of the following are enforced at the tool boundary, not in caller convention: 1. **Provenance is mandatory and transitive.** Every `memory.write` to any tier must carry a `source_ids` array (possibly empty for direct user statements, which are their own root). Distill outputs inherit the union of their i...",
    "decision_boundary": "The boundary between \"forget succeeded\" and \"forget is still in flight\" is the presence of any live derivative with provenance intersecting the erased set. Operationally: - If `memory.forget` returns before the cascade completes, it must return `{\"status\": \"pending\", \"derivatives\": N}` and the scope must enter a **read-quarantine**: `memory.read` on any deri...",
    "operational_effect": "Systems that enforce erasure closure pay a **distillation tax**: provenance arrays inflate semantic rows (typically 2–5× the fact payload), reverse-provenance indexes must be maintained, and every forget is a potential fan-out write. In exchange, the agent stops resurrecting erased facts through its own repair loop, and `memory.read` becomes a total function..."
  },
  "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": "af12d92c443b49142456dc0a57b64d50abe090465152ea9ed765dd0fd41a0f38",
    "verified_classes": [
      "ErasureClosureError",
      "Tier",
      "Record",
      "MemoryStore"
    ],
    "verified_functions": [
      "distill",
      "__init__",
      "write",
      "read",
      "forget"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 9,
    "raised_exceptions": [
      "ErasureClosureError"
    ],
    "sample_fail_closed_invariants": [
      "assert s.read('s7') is not None",
      "s7 survived erasure of e42",
      "root tombstone not visible",
      "distill resurrected erased source e42"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
