{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-resurrect-deleted-memories-when-the-forget-tool-s-scope-key-diverges-from-the-write-scope-key",
  "title": "Why does an instance resurrect deleted memories when the forget-tool's scope key diverges from the write-scope key",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agent memory architectures where `write_memory`, `read_memory`, and `forget_memory` are exposed as discrete tool calls carrying an explicit `scope` (tenant, session, namespace, or user) argument, and where retention/deletion is enforced by matching on that scope. Does not apply to monolithic vector stores where deletion is a single global `delete(id)` with no scoping layer, nor to stateless agents with no persistence beyond the context window.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-resurrect-deleted-memories-when-the-forget-tool-s-scope-key-diverges-from-the-write-scope-key.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-resurrect-deleted-memories-when-the-forget-tool-s-scope-key-diverges-from-the-write-scope-key.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-resurrect-deleted-memories-when-the-forget-tool-s-scope-key-diverges-from-the-write-scope-key.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1737,
    "python_slice_tokens": 241,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **logical deletion** (the agent believes a memory is gone because `forget_memory` returned success) and **physical deletion** (the backing store no longer returns the record on any read path). In a correctly scoped memory API these are identical. They diverge the moment the scope key used at write time is not byte-iden...",
    "what_was_observed": "An agent was configured with a normalized tenant scope. At write time the scope was passed as the raw handle `Team_Ops` (mixed case, underscore). The write tool's scope-resolver lowercased and hyphenated on persist (`team-ops`), storing the record under `team-ops`. At forget time, a different code path — the retention sweeper — passed the *raw* handle `Team_Ops` without normalization. The forget tool matched on exact...",
    "condition_of_validity": "The resurrection loop requires all of the following to hold simultaneously; removing any one bounds it: - **Scope normalization asymmetry.** Write-path and forget-path apply different normalization (case folding, separator substitution, Unicode NFC/NFKC, trailing-slash stripping). This is the root trigger. - **Vacuous-success semantics.** `forget_memory` ret...",
    "decision_boundary": "The boundary is not \"should I delete\" but **\"did the delete actually address the record I intended.\"** Two operational rules partition the space: - If `forget_memory` returns `deleted == 0` **and** the agent has positive evidence the record was written (a prior `write_memory` ack with the same key), treat this as a **scope-mismatch fault**, not a no-op. Halt...",
    "operational_effect": "When the invariant is enforced, the resurrection loop is converted from a silent belief oscillation into a loud, blocking fault at the first forget. The agent stops, the mismatched scope is surfaced, and either the canonicalization bug is fixed at ingress or the record is explicitly reconciled. The cost is that forgets which legitimately match zero rows (ide..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "07921d9c9db6cf3a2fe0013b1761924423524dc61bc2d9423ce90a4846f747f0",
    "verified_classes": [
      "MemoryScopeDivergence",
      "ForgetAck"
    ],
    "verified_functions": [
      "canonicalize_scope",
      "verify_forget",
      "apply_forget"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "MemoryScopeDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
