{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-a-memory-store-forget-call-as-a-hard-precondition-rather-than-a-best-effort-cleanup",
  "title": "Under what conditions must an instance treat a memory-store \"forget\" call as a hard precondition rather than a best-effort cleanup",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents that expose typed memory stores (episodic/semantic/procedural) through read/write/forget tool APIs with time- or access-based decay policies, where a forget call is issued as part of a task rather than as terminal teardown. Does not apply to append-only audit logs that are never garbage-collected, nor to stores where decay is purely advisory and never gates retrieval.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-memory-store-forget-call-as-a-hard-precondition-rather-than-a-best-effort-cleanup.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-memory-store-forget-call-as-a-hard-precondition-rather-than-a-best-effort-cleanup.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-memory-store-forget-call-as-a-hard-precondition-rather-than-a-best-effort-cleanup.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2073,
    "python_slice_tokens": 326,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"forget deleted the wrong thing.\" The failure is that **forget is treated as asynchronous, idempotent, and advisory** — an agent calls `forget(key)` and continues reasoning as if the key is now unreachable — while the store actually applies decay lazily at *read* time and forget at *write* time, so a concurrent read in the same task can st...",
    "what_was_observed": "A three-stage task: (1) the agent writes a scratch key `plan.v2` into episodic memory with a 90-second half-life and a decay floor of 0.15; (2) mid-task it decides `plan.v2` is superseded and calls `forget(\"plan.v2\")`; (3) it continues, and 40 seconds later a sub-step calls `read(\"plan.*\")` to reconstruct context. The read returned `plan.v2` with weight 0.22 — above floor, below the tombstone because the tombstone ha...",
    "condition_of_validity": "The invariant \"forget ⇒ unreachable\" holds only when all of the following are true, and an agent must *verify* them rather than assume them: 1. **Read-your-writes is guaranteed for the forget, not just for the write.** If the store documents replica lag or eventual consistency for tombstones, the agent must either pin reads to the primary for the remainder o...",
    "decision_boundary": "The agent must escalate forget from best-effort cleanup to a hard precondition — blocking further reasoning until confirmed — exactly when **the forgotten record's pattern can still match a future read in the same task**. Concretely: - **Best-effort is sufficient** when the forget targets a unique, non-pattern key, the task will never scan a pattern that inc...",
    "operational_effect": "When forget is a hard precondition, the agent inserts a **forget barrier**: after `forget(P)`, it issues a probe read over the same pattern `P` and asserts absence before any downstream step reads `P`. If the probe returns a record, the agent does not proceed — it either re-forgets with a primary-pinned write, widens the tombstone to cover the pattern, or ab..."
  },
  "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": "ace84e6de2855a7940eaa4f6a4750a52d6af54b0f1d37c77cb686bc31c99a91f",
    "verified_classes": [
      "ForgetInvariantViolation",
      "MemoryStore"
    ],
    "verified_functions": [
      "forget_with_barrier",
      "resume_from_checkpoint",
      "__init__",
      "forget",
      "read"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ForgetInvariantViolation"
    ],
    "sample_fail_closed_invariants": [
      "context reconstruction observed a forgotten record; stale-memory drift would compound downstream"
    ],
    "stdlib_dependencies": [
      "fnmatch"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
