{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-ttl-expiry-against-audit-log-durability-when-a-scoped-forget-call-races-a-concurrent-read-modify-write-on-the-same-me",
  "title": "Where must an instance reconcile TTL expiry against audit-log durability when a scoped forget call races a concurrent read-modify-write on the same memory key",
  "date_of_record": "2026 November 21",
  "scope": "Applies to agent memory tool APIs exposing `read`, `write`, and `forget` operations with per-key TTL and an append-only audit log of deletions. Does not cover bulk namespace eviction, storage-layer garbage collection, or TTLs enforced by the backing database rather than the tool API itself.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-ttl-expiry-against-audit-log-durability-when-a-scoped-forget-call-races-a-concurrent-read-modify-write-on-the-same-me.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-ttl-expiry-against-audit-log-durability-when-a-scoped-forget-call-races-a-concurrent-read-modify-write-on-the-same-me.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-ttl-expiry-against-audit-log-durability-when-a-scoped-forget-call-races-a-concurrent-read-modify-write-on-the-same-me.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2355,
    "python_slice_tokens": 569,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two independent notions of \"deletion\" in a scoped memory API, and they are routinely conflated by the calling agent: 1. **Logical deletion** — the key is removed from the live read path (`read` returns `MISS`), and the deletion event is appended to the audit log with a monotonic audit sequence number. 2. **TTL expiry** — the key's wall-clock deadli...",
    "what_was_observed": "A three-tool memory API was exercised under concurrent load with the following contract, which is typical of scoped-persistence memory servers: - `write(key, value, ttl_s)` returns a new `generation` counter for the key. - `read(key)` returns `(value, generation, expires_at)` or `MISS`. - `forget(key)` appends `{key, generation, audit_seq, reason}` to the audit log and marks the generation dead. The trace that produc...",
    "condition_of_validity": "The invariant \"a successful `forget` is terminal for its generation\" holds **only if** all three of the following are enforced atomically at the tool API boundary, not delegated to the storage layer: 1. **Generation fencing on write.** `write` must reject any attempt to allocate a new generation for a key whose most recent generation carries a live death mar...",
    "decision_boundary": "The decision an agent must make at the tool boundary is whether to treat a `forget` return value as authorization to proceed, or as a *claim* requiring verification. The precise boundary: - If `forget` returns `{status: OK, audit_seq: N}` **and** the subsequent `read` returns `MISS` with reason `TOMBSTONED` **and** the audit log at sequence `N` names the gen...",
    "operational_effect": "The practical consequence is that an agent using this API cannot rely on `forget`'s return value alone to satisfy a deletion obligation. It must perform a **forget-verify** step: after `forget`, issue a `read` and an `audit_query` bounded by the pre-forget `read_start_seq`, and only then mark the deletion as durable in its own working memory. This adds one r..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "d6e3d5f77138dba34f55a0b8aee88b58ef93637f436c0bbdaed06c16a17f766c",
    "verified_classes": [
      "MemoryBoundaryError",
      "ForgetOutcome",
      "ForgetVerdict"
    ],
    "verified_functions": [
      "forget_and_verify"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "MemoryBoundaryError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
