{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-forgets-a-parent-scope-before-its-children-orphaned-provenance-in-scoped-retention-memory-apis",
  "title": "What happens when an instance forgets a parent scope before its children: orphaned provenance in scoped-retention memory APIs",
  "date_of_record": "2026 November 12",
  "scope": "Applies to read/write/forget memory-tool APIs that enforce hierarchical scope-based retention (tenant → user → session → object) with provenance edges linking derived memories to their sources, and where `forget(scope)` triggers GDPR-aligned cascading deletion. Does not apply to flat-namespace stores, append-only audit logs, or systems where provenance is materialized as immutable references rather than soft edges.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-forgets-a-parent-scope-before-its-children-orphaned-provenance-in-scoped-retention-memory-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-forgets-a-parent-scope-before-its-children-orphaned-provenance-in-scoped-retention-memory-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-forgets-a-parent-scope-before-its-children-orphaned-provenance-in-scoped-retention-memory-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1530,
    "python_slice_tokens": 388,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct meanings of \"forget\" that memory-tool APIs routinely conflate: 1. **Retention expiry** — a scope's TTL elapses; the data becomes ineligible for read but its provenance edges remain resolvable for audit lineage. 2. **Erasure** — a GDPR Article 17 deletion request; the scope and *all derived artifacts tracing back to it* must become unre...",
    "what_was_observed": "In a multi-tenant agent memory service, a `forget(scope=\"user:u-1234\", mode=ERASURE)` call completed successfully — the parent's rows were tombstoned, the erasure receipt was emitted, and a compliance check confirmed no live rows referenced `u-1234` directly. However: - 1,847 child memories under `session:*` scopes carried `provenance.parent = \"user:u-1234\"` as a soft foreign key. - The forget operation did not trave...",
    "condition_of_validity": "The dangling-edge failure is *only* benign when all of the following hold: - Provenance edges are stored as **opaque references** (e.g., random UUIDs with no derivable content) rather than content hashes or timestamps. - The erasure operation rewrites or nulls the provenance payload on surviving children in the same transaction that tombstones the parent. - ...",
    "decision_boundary": "The decision is whether `forget(scope)` should cascade across **provenance** edges or only **structural** edges. The correct boundary: - **Cascade structurally** (delete all scopes lexically nested under the erased prefix) — always, unconditionally. - **Do not cascade-delete provenance children** (they belong to other data subjects with their own retention c...",
    "operational_effect": "After the defect was identified, the service added a pre-forget traversal that enumerates provenance children before tombstoning the parent, rewrites their `provenance.parent` to a `TOMBSTONE:<random>` token with the original hash discarded, and emits a receipt distinguishing `structural_deleted`, `provenance_rewritten`, and `hold_blocked` counts. The erasur..."
  },
  "matched_failure_symptoms": [
    "SUBPROCESS_PIPE_HANG_OR_FD_LEAK",
    "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": "7a546b7c1053e104b4cfc883ac8cbac0707ff84f9a111424976bad9db027880d",
    "verified_classes": [
      "OrphanedProvenanceError",
      "MemoryNode",
      "ErasureReceipt"
    ],
    "verified_functions": [
      "_derive_hash",
      "forget_scope"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "OrphanedProvenanceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "secrets"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
