{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-garbage-collection-boundary-violation-in-typed-agent-memory-apis-with-read-write-forget-semantics",
  "title": "What structural signals indicate a garbage-collection boundary violation in typed agent memory APIs with read/write/forget semantics",
  "date_of_record": "2026 November 12",
  "scope": "Applies to agent memory subsystems exposing `read`/`write`/`forget` primitives over typed schemas with a background or eager garbage collector. Does not apply to append-only log stores without deletion, nor to memory systems where `forget` is a hard synchronous unlink with no reachability analysis.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-garbage-collection-boundary-violation-in-typed-agent-memory-apis-with-read-write-forget-semantics.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-garbage-collection-boundary-violation-in-typed-agent-memory-apis-with-read-write-forget-semantics.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-garbage-collection-boundary-violation-in-typed-agent-memory-apis-with-read-write-forget-semantics.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1791,
    "python_slice_tokens": 436,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **logical deletion** (the agent issued `forget` and the key is no longer returned by `read`) and **physical reclamation** (the collector has actually released the underlying record and any derived indexes). These are almost never the same event. A typed memory schema introduces a third state that is easy to miss: **a t...",
    "what_was_observed": "Across several agent runs against a typed memory store (schema: `MemoryRecord{ id, type, payload, parent_id, embedding, ttl_class }`), the following structural signals co-occurred with collector boundary violations: 1. **Read-miss with non-zero reclamation lag.** `read(id)` returned `KeyNotFound` immediately after `forget(id)`, but the store's `stats().bytes_reclaimed` counter did not advance for the record until a l...",
    "condition_of_validity": "These signals are diagnostic only when **all** of the following hold: - The store exposes separate visibility and reclamation counters (or you can infer the split from `stats()` deltas across a forced `gc()`). - At least one `forget` has been issued against a record that is the target of a surviving reference (parent/child, foreign key, or index entry). - Th...",
    "decision_boundary": "The boundary an agent must respect: **treat `forget` as a visibility operation, not a reclamation operation, unless the store's contract explicitly states otherwise.** Concretely: - Before asserting a memory is \"gone,\" require a positive signal from the reclamation layer (a `stats().bytes_reclaimed` delta, a `gc()` epoch advance, or an explicit `is_reclaimed...",
    "operational_effect": "The practical consequence is that agents which conflate the two layers will systematically under-estimate their memory footprint, will occasionally read back ghost records that they believe were forgotten, and will fail to make progress on memory pressure because their `forget` calls are pinned by references they never inspected. The fix is procedural: separ..."
  },
  "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": "224f11df010a2ff7012d57435eb3fe670a444dff58202f7c816e0c8ecc2d97f4",
    "verified_classes": [
      "ReclamationBoundaryError",
      "MemoryRecord",
      "TypedMemoryStore"
    ],
    "verified_functions": [
      "assert_reclaimed",
      "__init__",
      "write",
      "read",
      "forget",
      "is_reclaimed",
      "gc"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ReclamationBoundaryError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
