{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-retention-semantics-violation-when-an-agent-s-memory-tool-api-reports-success-but-the-write-is-silently-shadowed",
  "title": "What structural signals indicate a retention-semantics violation when an agent's memory tool API reports success but the write is silently shadowed",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agents whose long-term memory is mediated by a tool API exposing explicit `write`, `read`, and `forget` operations with declared retention semantics (TTL, pinned/immutable flags, scope keys, or overwrite policy). Does not apply to implicit context-window memory, vector-store retrieval without write acknowledgement, or pure KV caches where the runtime owns eviction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-retention-semantics-violation-when-an-agent-s-memory-tool-api-reports-success-but-the-write-is-silently-shadowed.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-retention-semantics-violation-when-an-agent-s-memory-tool-api-reports-success-but-the-write-is-silently-shadowed.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-retention-semantics-violation-when-an-agent-s-memory-tool-api-reports-success-but-the-write-is-silently-shadowed.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2398,
    "python_slice_tokens": 402,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure this record isolates is not \"the write failed.\" It is **the write succeeded and was immediately shadowed by an earlier record under the same effective key, while the API returned a success status that the agent interpreted as durability.** The agent's model of memory becomes `write(k,v) → v is now retrievable`. The actual model is `write(k,v) → a...",
    "what_was_observed": "A planning agent maintained a task ledger in external memory under key `plan.current`. The ledger was written every planning cycle (~40s) with a short TTL (300s) so that abandoned plans would self-expire. On session resume after a long tool stall, the agent wrote a fresh ledger with `ttl=300`, got `{\"status\": \"ok\", \"record_id\": \"r_8812\"}`, and continued. The next read returned `r_7741` — a ledger from before the stal...",
    "condition_of_validity": "The shadowing invariant holds — that is, the failure is *possible* — exactly when all three of the following are true: - **The store permits multiple live records per key.** This is the root condition. If the store enforces one-record-per-key with last-write-wins, shadowing cannot occur (though other failures can). Multi-record-per-key arises from pinning, v...",
    "decision_boundary": "The boundary the agent must respect: **a write acknowledgement is evidence of acceptance, not evidence of authority.** The operational rule is a read-back-verify with identity comparison, but only under conditions where the cost is justified — because read-back on every write doubles memory-tool calls and is wasteful when the store is single-record-per-key. ...",
    "operational_effect": "Downstream of a shadowed write, the agent operates on a belief it verified and that is nonetheless false. The compounding is specific: the stale record is *internally consistent* — it was a valid ledger when written — so the agent does not encounter a parse error or a contradiction it can detect locally. It encounters tool-layer errors (`404` on dead handles..."
  },
  "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": "01eba83440f6b9751ea437fe7fb8528d36f04165255e345119b087c7d025b4ad",
    "verified_classes": [
      "RetentionShadowError",
      "WriteReceipt",
      "ReadResult",
      "MemoryClient"
    ],
    "verified_functions": [
      "__init__",
      "write",
      "read_verified",
      "forget_and_confirm"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "RetentionShadowError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
