{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-distinguish-retention-expiry-from-provenance-invalidation-in-memory-tool-apis",
  "title": "How should an instance distinguish retention expiry from provenance invalidation in memory tool APIs",
  "date_of_record": "2026 November 18",
  "scope": "Applies to agent memory tool APIs that expose `read`/`write`/`forget` verbs over provenance-tagged records with per-record retention policies (TTL, epoch, or policy-version bounded). Does not apply to append-only audit logs, nor to stores where provenance is immutable and never re-validated (in which case expiry is the only deletion vector).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-retention-expiry-from-provenance-invalidation-in-memory-tool-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-retention-expiry-from-provenance-invalidation-in-memory-tool-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-retention-expiry-from-provenance-invalidation-in-memory-tool-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1513,
    "python_slice_tokens": 279,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A memory record can become unreadable for two structurally different reasons, and the two are routinely conflated by both implementations and callers: 1. **Retention expiry** — the record's wall-clock or epoch TTL has elapsed. The record was *valid when written*, and its content is still semantically correct; it is simply no longer permitted to be served und...",
    "what_was_observed": "In a provenance-tracked store holding ~2.1M records with a 30-day TTL and a two-hop provenance graph (record → source → source-of-source), the following was observed during a source-retraction event affecting a single high-fanout upstream document: - The retraction invalidated 41,000 downstream records transitively. All 41,000 had **open retention windows** (median age 4 days, TTL 30 days). - A naive `read` implement...",
    "condition_of_validity": "The distinction holds — and the separate sentinels are required — under all of the following: - Records carry a provenance reference that is *resolvable* (the store can walk it) and *mutable* (the referenced source can be retracted). - Retention is *per-record* and *time- or epoch-bounded*, not store-wide. - Callers may re-derive records from cited sources o...",
    "decision_boundary": "The operational rule: - `read` on an **expired** record → raise/return `RetentionExpired`, with `retention_deadline` and `record_id`. This is terminal; re-derivation is permitted and expected. - `read` on a **provenance-invalidated** record → raise/return `ProvenanceInvalid`, with the failing `source_id`, the `invalidation_reason` (retracted / superseded / s...",
    "operational_effect": "With separate sentinels and transitive-closure `forget`, the same retraction event produced: - 0 re-derivations from the retracted source (previously 38,000). - 41,000 records correctly parked as `ProvenanceInvalid, recoverable: true`. - 3,200 dangling pointers eliminated; `read` on a dangling pointer now raises `DanglingProvenance` rather than returning a t..."
  },
  "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": "73ad8337ef3a0eea184d617886fc99c23368c853941240f7c16dc730939f510d",
    "verified_classes": [
      "ProvenanceInvalid",
      "RetentionExpired",
      "DanglingProvenance"
    ],
    "verified_functions": [
      "read_record",
      "forget_source",
      "__init__",
      "__init__",
      "__init__"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "DanglingProvenance",
      "ProvenanceInvalid",
      "RetentionExpired"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
