{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-a-scoped-read-the-retention-epoch-inversion-in-read-write-forget-memory-apis",
  "title": "When must an instance refuse a scoped read: the retention-epoch inversion in read/write/forget memory APIs",
  "date_of_record": "2026 November 9",
  "scope": "Applies to memory tool APIs that expose `read`, `write`, and `forget` operations over records governed by scoped retention policies and right-to-forget (RTF) obligations, where reads may be issued by an agent whose scope was granted before the forget event. Does not apply to single-tenant stores with no RTF obligations, nor to append-only audit logs that are explicitly exempt from RTF propagation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-scoped-read-the-retention-epoch-inversion-in-read-write-forget-memory-apis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-scoped-read-the-retention-epoch-inversion-in-read-write-forget-memory-apis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-scoped-read-the-retention-epoch-inversion-in-read-write-forget-memory-apis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1675,
    "python_slice_tokens": 292,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious boundary is between **retention scope** (a positive predicate: which records an instance is permitted to see) and **forget epoch** (a negative, monotonic predicate: which records have been tombstoned as of a global counter). Implementations routinely conflate these by treating a `read` as legal iff the caller's scope matches the record's scop...",
    "what_was_observed": "In a memory service with per-tenant scoped retention, an agent session was issued a scope token `scope=tenant:acme,classes=[profile,prefs]` at T0. At T1, an RTF request from a data subject within `tenant:acme` triggered `forget(subject_id)`, which tombstoned 14 records across `profile` and `prefs` and advanced the global `forget_epoch` from 8812 to 8813. The forget path correctly removed the records from the primary ...",
    "condition_of_validity": "The retention-epoch invariant holds — and a scoped read is safe — only when all of the following are true: 1. The read is served by a replica whose applied `forget_epoch` is **greater than or equal to** the epoch at which the caller's scope token was minted. (A token minted at epoch E is only trustworthy against stores at epoch ≥ E.) 2. The scope token carri...",
    "decision_boundary": "The decision rule for a read path: - If `token.epoch <= store.applied_epoch`: serve the read. The store has seen every forget the token's minting instance could have known about. - If `token.epoch > store.applied_epoch`: **do not serve**. The store is behind the token's mint time and may still hold records the token's issuer has already forgotten. Return a s...",
    "operational_effect": "Enforcing the epoch check converts a silent RTF violation into a visible, retryable staleness error. In the observed incident, adding the check caused ~0.3% of reads to fail-and-retry during the 400ms propagation window — a measurable latency cost — but eliminated the class of reads that returned forgotten data. The convergence token on `forget` eliminated 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": "7b67db7b5dfc06624acb26e9817bd987e6772c604b7250ef6bb980b33bb1aea3",
    "verified_classes": [
      "RetentionEpochInversion",
      "ScopeToken",
      "Store"
    ],
    "verified_functions": [
      "scoped_read",
      "forget",
      "verify_forget"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "KeyError",
      "RetentionEpochInversion"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
