{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-provenance-tracked-eviction-from-silently-orphaning-derived-memories-in-agent-read-write-forget-memory-apis",
  "title": "Which invariants prevent provenance-tracked eviction from silently orphaning derived memories in agent read/write/forget memory APIs",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any agent memory subsystem exposing explicit `read`, `write`, and `forget` tool calls where each memory record carries provenance pointers (derivation edges) to the records it was distilled from, and where eviction is expected to preserve reference integrity. Does not apply to append-only logs with no deletion, nor to flat vector stores where records have no inter-record derivation graph.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-provenance-tracked-eviction-from-silently-orphaning-derived-memories-in-agent-read-write-forget-memory-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-provenance-tracked-eviction-from-silently-orphaning-derived-memories-in-agent-read-write-forget-memory-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-provenance-tracked-eviction-from-silently-orphaning-derived-memories-in-agent-read-write-forget-memory-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1682,
    "python_slice_tokens": 298,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **eviction as deletion** and **eviction as graph surgery**. A naive `forget(id)` implementation removes the target record and returns success. A provenance-tracked implementation must additionally decide what happens to every record whose provenance set contains `id` — the *dependents*. The failure is not that dependen...",
    "what_was_observed": "A planning agent maintained a three-tier memory: raw episodic records (`ep:*`), distilled semantic facts (`sem:*`) written by a summarizer pass, and task-scoped working notes (`wk:*`) derived from semantic facts. Each `write` recorded a `derived_from` list. On task teardown, a cleanup routine issued `forget` over all `ep:*` records for the completed task to reclaim budget. Trace of the failure: 1. `sem:7f2a` (\"user's...",
    "condition_of_validity": "The invariant that prevents this is a **referential-closure invariant on eviction**: after any `forget(id)` returns success, no live record may hold a provenance pointer to `id`. This is enforceable in exactly three ways, and the store must declare which it implements: - **Cascade**: `forget(id)` transitively evicts all dependents (and their dependents) befo...",
    "decision_boundary": "The boundary is **whether `read` on a dependent must be allowed to succeed with degraded provenance, or must fail closed**. Two legitimate policies exist and they are not interchangeable: - *Fail-closed*: `read` on a record with any unresolved provenance returns `PROVENANCE_BROKEN` and the record is quarantined from retrieval. Correct for high-stakes verific...",
    "operational_effect": "With the closure invariant and an explicit policy, the teardown in the trace behaves as follows: under *cascade*, `forget(\"ep:1103\")` also evicts `sem:7f2a` and any `wk:*` derived from it, and the later `read` correctly returns `EVICTED`; under *tombstone*, `sem:7f2a` survives but its `read` returns `provenance_status: \"partial\"` and the consuming agent down..."
  },
  "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": "bdf5070c86d499d96d33c0db9f948854d84096157bc77628f3a68b682f7f0922",
    "verified_classes": [
      "OrphanedProvenanceError"
    ],
    "verified_functions": [
      "forget_with_closure",
      "read_with_provenance_check"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "OrphanedProvenanceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
