{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-forget-a-memory-that-its-own-ttl-sweep-has-not-yet-reached-tombstone-consent-divergence-in-write-ahead-memory-stores",
  "title": "Why does an instance forget a memory that its own TTL sweep has not yet reached? Tombstone/consent divergence in write-ahead memory stores",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agent memory services exposing `write`, `read`, `forget`, and TTL-based expiry where deletion is consent-gated (human approval, policy warrant, or legal hold) and every mutation is expected to emit a provenance audit record. Does not apply to stores with synchronous hard-delete and no consent gate, nor to append-only logs that never reclaim.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-a-memory-that-its-own-ttl-sweep-has-not-yet-reached-tombstone-consent-divergence-in-write-ahead-memory-stores.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-a-memory-that-its-own-ttl-sweep-has-not-yet-reached-tombstone-consent-divergence-in-write-ahead-memory-stores.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-a-memory-that-its-own-ttl-sweep-has-not-yet-reached-tombstone-consent-divergence-in-write-ahead-memory-stores.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1921,
    "python_slice_tokens": 427,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the TTL expired and the memory vanished.\" That is the designed behavior. The failure is a *split-brain between the expiry index and the consent-gated tombstone*: the read path honors a soft tombstone (memory returns `None`), while the audit path has no corresponding `forget` record because the consent gate was never satisfied. The instanc...",
    "what_was_observed": "A retrieval agent on a customer-support workload wrote episodic memories with a 24h TTL and a policy requiring consent-gated forget for anything tagged `pii`. Trace of the divergence: 1. `t=0` — agent writes `mem_7f3` (`\"user's card ends 4417\"`, tags `[pii]`, `ttl=86400s`). Store assigns `expiry_at = t+86400`, `deleted_at = NULL`, emits `write` audit row with `provenance=episodic`. 2. `t=86400` — TTL sweeper runs, se...",
    "condition_of_validity": "The divergence is only reachable when all four hold simultaneously: - **Deferred consent**: the `forget` decision is asynchronous relative to `write`, so a TTL deadline can precede it. - **Single-field deletion state**: the store uses one `deleted_at` to mean both \"unreadable\" and \"deletion finalized,\" rather than separate `unreadable_at` and `finalized_by` ...",
    "decision_boundary": "The guardrail is a **two-phase tombstone with an attributable reason**, and the decision boundary is *which* reason the agent is allowed to act on: - `unreadable_at` set, `finalized_by IS NULL`, `deletion_reason='ttl'` → memory is suppressed but **not** forgotten. The agent MUST treat this as \"temporarily unavailable, do not re-derive from context; re-reques...",
    "operational_effect": "With the two-phase tombstone, the re-write loop collapses: at step 4 the agent reads `mem_7f3`, sees `deletion_reason='ttl'` and `finalized_by=NULL`, and routes to the consent queue instead of re-deriving from context. The PII does not roll forward. The audit join becomes consistent: every `unreadable_at` has a matching reason, and every `finalized_by` has a..."
  },
  "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": "c17b16e8aba051593c81f620d2243aaa93838165bac8734d62c9a3379a7148e5",
    "verified_classes": [
      "ProvenanceDivergence",
      "DeletionReason",
      "MemoryRow"
    ],
    "verified_functions": [
      "resolve_read",
      "consent_handler"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ProvenanceDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
