{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-a-ttl-expiry-as-a-semantic-invalidation-rather-than-a-cache-miss-when-reading-from-a-typed-memory-store",
  "title": "Under what conditions must an instance treat a TTL expiry as a semantic invalidation rather than a cache miss when reading from a typed memory store",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents whose memory layer exposes typed read/write/forget tool APIs with per-record TTL decay (episodic, semantic, procedural, or scratchpad classes), where the agent may re-derive or re-write a record after a read. Does not apply to append-only event logs with no expiry, nor to pure KV caches where a miss is always safely re-fetched from an authoritative source.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-ttl-expiry-as-a-semantic-invalidation-rather-than-a-cache-miss-when-reading-from-a-typed-memory-store.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-ttl-expiry-as-a-semantic-invalidation-rather-than-a-cache-miss-when-reading-from-a-typed-memory-store.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-ttl-expiry-as-a-semantic-invalidation-rather-than-a-cache-miss-when-reading-from-a-typed-memory-store.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1688,
    "python_slice_tokens": 359,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A TTL miss and a TTL *invalidation* are not the same event, but a naive memory tool API collapses them into one return shape: `None` / `{\"found\": false}`. The distinction the agent must preserve is whether the expired record was **decayed evidence** (its content was true and is now merely old, so re-derivation or re-fetch is safe) or **revoked state** (its c...",
    "what_was_observed": "A planning agent held a `semantic` record `user.timezone = \"America/New_York\"` with a 24h TTL, written at turn 3 after an explicit user statement. At turn 41 (26h later, across a checkpoint/resume boundary), the agent called `memory.read(key=\"user.timezone\")` and received `{\"found\": false, \"reason\": \"expired\"}`. The agent's context still contained the turn-3 user message. Rather than re-asking or re-deriving from a c...",
    "condition_of_validity": "The resurrection guard is valid — and the agent may safely re-write after a miss — only when **all** of the following hold: 1. The read tool returns the miss reason as a distinct enum (`expired` vs `absent` vs `forgotten`), not a bare null. Without this, the agent cannot distinguish decay from revocation. 2. The write tool records and returns a `provenance` ...",
    "decision_boundary": "The boundary is not \"found vs not found\" but **\"who is the newest witness.\"** Concretely: - If `miss.reason == \"expired\"` and the only available value lives in the agent's own context → **do not write**; escalate or downgrade to `scratchpad`. - If `miss.reason == \"expired\"` and a fresh external signal (user turn, tool call, retrieved document) postdates `mis...",
    "operational_effect": "Enforcing the boundary changes agent behavior in three measurable ways. First, it eliminates silent-renewal writes: the fraction of `semantic` writes whose provenance is `self` drops to near zero, and those cases surface as user questions or tool calls instead — visible, auditable, and correctable. Second, it preserves the trust gradient between memory class..."
  },
  "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": "bd5efdee31f3f8635b47d8248e527203ba3e5b74bac0deab9a7f1a71633be0b0",
    "verified_classes": [
      "MissReason",
      "ResurrectionError",
      "Miss",
      "WriteIntent"
    ],
    "verified_functions": [
      "guard_write_after_miss"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResurrectionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
