{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-salience-gated-deletion-from-silently-erasing-co-referenced-memories-in-agent-memory-tool-apis",
  "title": "Which invariants prevent salience-gated deletion from silently erasing co-referenced memories in agent memory tool APIs",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agent memory tool APIs that expose `write`, `read`, and `forget` operations where `forget` accepts either an explicit ID or a salience/decay predicate (`salience < τ`, `age > T`). Does not apply to append-only logs with no deletion surface, or to vector stores where deletion is always by exact primary key with no predicate evaluation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-salience-gated-deletion-from-silently-erasing-co-referenced-memories-in-agent-memory-tool-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-salience-gated-deletion-from-silently-erasing-co-referenced-memories-in-agent-memory-tool-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-salience-gated-deletion-from-silently-erasing-co-referenced-memories-in-agent-memory-tool-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2046,
    "python_slice_tokens": 328,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different ways a memory store can lose a record under a decay policy: **targeted deletion** (the agent names an ID or a predicate and the store removes exactly the matching rows) and **salience-gated reaping** (the store evaluates a salience score derived from access counts, recency, and linkage, then removes records that fall belo...",
    "what_was_observed": "An agent maintaining a task memory store wrote 40 records across three sessions. Records carried `id`, `content`, `refs` (list of other record IDs), `salience` (float, recomputed lazily on read), and `last_touched` (timestamp). Salience was defined as a weighted sum of `recency_decay(last_touched)`, `access_count`, and `inbound_ref_count` — the last term being the number of other live records that listed this record ...",
    "condition_of_validity": "The frozen-snapshot-plus-transitive-report invariant holds only when the following are true, and each is a precondition the agent must verify before trusting a `forget` receipt: 1. **Salience is a pure function of a snapshot.** If the store recomputes salience mid-walk (as above), the predicate is evaluated against a moving target. The invariant requires the...",
    "decision_boundary": "The boundary between safe and unsafe use of predicate `forget` is this: **a predicate `forget` is safe iff the agent can enumerate, before the call, the set of records whose salience depends on any candidate's liveness.** In practice the agent cannot compute this without reading the full ref graph, which is exactly the read the store was trying to avoid. The...",
    "operational_effect": "With the invariant enforced (frozen snapshot, computed cascade closure, per-call transaction, snapshot-pinned retry), predicate `forget` becomes a bounded operation: the agent knows exactly which records it authorized for deletion and which were collateral, and can pin or re-write collateral before commit. The cost is that the store must materialize salience..."
  },
  "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": "a4ece802c565191c6814770502a3f197cb1aa01046aaebf929bb7da7e7707b2b",
    "verified_classes": [
      "CascadeLeakError",
      "SalienceSnapshotMissingError"
    ],
    "verified_functions": [
      "safe_forget",
      "retry_forget"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CascadeLeakError",
      "SalienceSnapshotMissingError"
    ],
    "sample_fail_closed_invariants": [
      "refusing to retry predicate forget without a snapshot token; recompute would evaluate a different graph"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
