{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-enforce-provenance-quarantine-when-a-forget-operation-races-a-concurrent-write-on-the-same-memory-key",
  "title": "Where must an instance enforce provenance quarantine when a forget operation races a concurrent write on the same memory key",
  "date_of_record": "2026 November 22",
  "scope": "Applies to any agent memory substrate that supports both provenance-tagged writes and explicit forget/eviction operations against a keyed store (episodic buffers, vector indices with metadata, KV caches with TTL). Does not apply to append-only audit logs that are never mutated, nor to stateless inference calls with no persistent memory.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-provenance-quarantine-when-a-forget-operation-races-a-concurrent-write-on-the-same-memory-key.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-provenance-quarantine-when-a-forget-operation-races-a-concurrent-write-on-the-same-memory-key.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-provenance-quarantine-when-a-forget-operation-races-a-concurrent-write-on-the-same-memory-key.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1575,
    "python_slice_tokens": 337,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Provenance tracking is usually framed as a *read-side* defense: before an agent acts on a retrieved memory, check its lineage and reject entries whose source is untrusted. That framing is incomplete. The dangerous boundary is on the **write/forget axis**, not the read axis. A poisoned memory does not need to be *read* to do damage—it needs only to survive a ...",
    "what_was_observed": "An agent maintained a vector-backed episodic store. Each memory carried `{key, text, source, provenance_gen, taint}`. A taint flag was set when a retrieved document failed a source-allowlist check. On detecting a tainted entry, the orchestrator issued `forget(key)`, which removed the vector and its metadata and bumped a per-key `forgotten_gen` counter to `provenance_gen + 1`. A concurrent tool-call loop was still flu...",
    "condition_of_validity": "The guardrail is only sound under three conditions, and each is a place where real deployments break: - **Generation is assigned at retrieval, not at write.** If `provenance_gen` is stamped when the write is constructed rather than when the source was read, a slow tool loop can mint a fresh generation after the forget and bypass the guard. Generation must be...",
    "decision_boundary": "The decision an instance must make on every write is: *is this write's provenance generation strictly greater than the forgotten generation for its key?* If yes, admit. If no, quarantine—do not drop (dropping hides the resurrection attempt and defeats forensics), do not merge (merging re-taints silently and may poison adjacent keys via shared embeddings). Th...",
    "operational_effect": "With the generation guard in place, forget becomes a monotonic barrier: no write constructed before the forget can land after it, regardless of flush timing. Quarantined writes accumulate in a holding area tagged with their stale generation, giving auditors a replayable trace of exactly which retrievals raced which forgets—the forensic artifact that the orig..."
  },
  "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": "1cf0b7248399e5be4afe07604cc04ca54a3d6d8bc439ca6d3016c16f3abfe485",
    "verified_classes": [
      "ProvenanceQuarantineError",
      "Tombstone",
      "Store"
    ],
    "verified_functions": [
      "demo_race",
      "forget",
      "write"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ProvenanceQuarantineError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
