{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-provenance-tracked-memory-deletion-from-silently-corrupting-downstream-retrieval-in-read-write-forget-tool-apis",
  "title": "Which invariants prevent provenance-tracked memory deletion from silently corrupting downstream retrieval in read/write/forget tool APIs",
  "date_of_record": "2026 November 23",
  "scope": "Agent-facing memory tool APIs exposing `read`, `write`, and `forget` with per-record provenance (source ID, derivation lineage, retention class) and a retention contract (TTL, legal hold, explicit deletion). Excludes append-only logs and pure-tombstone vector stores with no lineage propagation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-provenance-tracked-memory-deletion-from-silently-corrupting-downstream-retrieval-in-read-write-forget-tool-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-provenance-tracked-memory-deletion-from-silently-corrupting-downstream-retrieval-in-read-write-forget-tool-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-provenance-tracked-memory-deletion-from-silently-corrupting-downstream-retrieval-in-read-write-forget-tool-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1026,
    "python_slice_tokens": 211,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Two deletion semantics are conflated: 1. **Record deletion** — record removed from primary store, unreadable by `read`. 2. **Provenance-consistent deletion** — record removed *and* every derived artifact citing it as parent is invalidated, re-derived, or flagged orphaned before any subsequent `read` returns it. The naive invariant \"after `forget(id)`, `read(...",
    "what_was_observed": "With records `R` and derivation edges `R_child → R_parent`, `forget(R_parent)` removed the parent and returned success. A subsequent `read(R_child)` returned a summary containing verbatim spans of `R_parent`, with the provenance pointer still referencing the absent ID. Three failure conditions: - **Dangling lineage.** `R_child.provenance.parents` held an unresolvable ID; no integrity check ran on read. - **Retention ...",
    "condition_of_validity": "Deletion is provenance-consistent only when all hold at the moment `forget` returns: - Every child reachable via derivation edges has been visited and either deleted, re-derived from surviving parents, or marked `orphaned` with the forgotten ID in an invalidation manifest. - No `read` path can return a record whose provenance closure intersects a deleted ID ...",
    "decision_boundary": "The boundary is whether the caller needs the *retention guarantee* or merely *unreadability of the primary record*. - For `best_effort` or `tombstone_only`, record deletion suffices; graph traversal cost is unjustified. - For `legal_hold`, `gdpr_erasure`, or any class asserting no readable artifact may encode deleted content, the caller **must** use the prov...",
    "operational_effect": "Downstream retrieval trusting the deletion receipt will continue to surface derived content, and audits checking only primary-store membership will report compliance. Correct posture: (1) treat `forget` as a graph operation, not a key delete; (2) require the receipt to enumerate the invalidation manifest (children visited, aggregates adjusted); (3) on timeou..."
  },
  "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": "3f6c80159e9f869355fe773aed0684348d9d626dafea09a3f817ea467a3765fb",
    "verified_classes": [
      "ProvenanceDeletionError"
    ],
    "verified_functions": [
      "forget_record"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceDeletionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
