{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-scoped-retention-memory-apis-from-silently-resurrecting-forgotten-data-across-scope-boundaries",
  "title": "Which invariants prevent scoped-retention memory APIs from silently resurrecting forgotten data across scope boundaries",
  "date_of_record": "2026 November 17",
  "scope": "Applies to read/write/forget memory tool APIs that partition records into named scopes (user, session, tenant, project) with per-scope retention policies and per-record forget operations. Does not apply to single-global-namespace memory stores, append-only audit logs, or systems where forget is a hard physical delete with no tombstone or index layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-scoped-retention-memory-apis-from-silently-resurrecting-forgotten-data-across-scope-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-scoped-retention-memory-apis-from-silently-resurrecting-forgotten-data-across-scope-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-scoped-retention-memory-apis-from-silently-resurrecting-forgotten-data-across-scope-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1594,
    "python_slice_tokens": 256,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **logical forget** (the record is no longer returned by reads within its originating scope) and **effective forget** (the record cannot be reconstructed by any read path, including reads from adjacent scopes, summaries, or derived indexes). Scoped-retention APIs almost always implement logical forget correctly and effe...",
    "what_was_observed": "A memory tool exposed three operations: `write(scope, key, value)`, `read(scope, query)`, and `forget(scope, key)`. Retention was configured per scope with a TTL and a \"forget on request\" flag. The following sequence was exercised: 1. `write(\"session:7\", \"pref\", \"user prefers dark mode\")` 2. `write(\"user:42\", \"pref\", \"user prefers dark mode\")` — the agent wrote the same fact to the durable user scope for persistence....",
    "condition_of_validity": "The invariant \"forget(scope, key) implies the record is unreachable from every read path\" holds **only if** all three of the following are true: - **Single ownership:** every record has exactly one owning scope, and cross-scope visibility is achieved by reference, not by duplication. If a record can be written into two scopes, forget must be defined over the...",
    "decision_boundary": "The decision boundary is: **does the caller need effective forget (compliance, user request, safety) or logical forget (context hygiene)?** - For **context hygiene** — dropping stale session context to save tokens — logical forget is sufficient and cheaper. Scoped forget with lazy summary rebuild is acceptable. - For **effective forget** — a user asking to d...",
    "operational_effect": "The operational effect is **non-monotonic forgottenness**: the set of reachable records is not monotonically decreasing under forget operations. Repeated forgets across scopes can toggle a record between reachable and unreachable, and the final state depends on operation order. This breaks the mental model that forget is idempotent and commutative, and it br..."
  },
  "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": "50999a67fb6ee9b26390ec479436bea90687b89021b0fc0b36adacd494f104a7",
    "verified_classes": [
      "ForgetNotEffectiveError"
    ],
    "verified_functions": [
      "assert_effectively_forgotten",
      "safe_forget"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ForgetNotEffectiveError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
