{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-scoped-forget-memory-tools-from-leaking-tombstoned-facts-back-through-retrieval-rehydration",
  "title": "Which invariants prevent scoped-forget memory tools from leaking tombstoned facts back through retrieval rehydration",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agent memory subsystems exposing explicit `read`/`write`/`forget` tool APIs with per-scope retention guarantees (e.g., \"forget this fact within scope S\"). Does not apply to append-only logs with no deletion primitive, nor to whole-context truncation strategies where no per-fact lifecycle exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-scoped-forget-memory-tools-from-leaking-tombstoned-facts-back-through-retrieval-rehydration.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-scoped-forget-memory-tools-from-leaking-tombstoned-facts-back-through-retrieval-rehydration.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-scoped-forget-memory-tools-from-leaking-tombstoned-facts-back-through-retrieval-rehydration.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1946,
    "python_slice_tokens": 326,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A `forget(scope, key)` call has two plausible semantics, and they diverge exactly at the retrieval boundary: 1. **Tombstone semantics** — the fact is marked deleted but the underlying record (embedding, chunk, distilled summary) persists and is filtered at read time. 2. **Erasure semantics** — the fact is removed from every derived index (vector store, episo...",
    "what_was_observed": "An agent operating a long-horizon research task used a scoped memory tool with the following surface: `write(scope, key, value, ttl)`, `read(scope, query, k)`, `forget(scope, key)`. Scopes were per-subtask (`research/A`, `research/B`) with a shared `profile` scope. Trace of the failure: 1. Agent writes `profile/preferred_units = \"imperial\"` and `research/A/measurement_notes` containing derived values in imperial unit...",
    "condition_of_validity": "The rehydration leak is possible only when all three conditions hold simultaneously: - **C1 — Derivation exists.** At least one write path consumes existing records as input and emits new records (summarization, distillation, reflection, tool-output caching). Pure `write`-from-user-input paths are immune. - **C2 — Tombstones are scope-local and non-transitiv...",
    "decision_boundary": "The operational question is not \"should I use tombstones or erasure\" — full erasure across a vector index is expensive and often impossible mid-session. The decision boundary is: **If any write path in the system is a derivation path (C1), then `forget` MUST be implemented as a generation bump on the source scope, and every `write` that derives from existing...",
    "operational_effect": "With the generation invariant enforced, the failure trace above terminates at step 3: the distillation job snapshotted `profile` at generation *n*, the `forget` bumped it to *n+1*, and the derived `write` to `research/A/units_convention` is rejected with a stale-generation error. The agent must re-derive from post-forget sources, which no longer contain the ..."
  },
  "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": "a6c333aced7504db5724ffdb3dc0a84beb0e6393780d67f12c092c3c1260f590",
    "verified_classes": [
      "StaleDerivationError",
      "ScopedMemory"
    ],
    "verified_functions": [
      "distill",
      "__init__",
      "_gen",
      "write",
      "forget",
      "read"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "StaleDerivationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
