{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-treat-a-scoped-retention-memory-write-whose-ttl-boundary-lands-mid-reasoning-the-tombstone-before-readback-hazard",
  "title": "How should an instance treat a scoped-retention memory write whose TTL boundary lands mid-reasoning: the tombstone-before-readback hazard",
  "date_of_record": "2026 November 21",
  "scope": "Applies to any agent that issues `write`/`read`/`forget` calls against a scoped memory tool where retention is expressed as a TTL or expiry epoch and the tool enforces expiry lazily (at read time) rather than eagerly (at sweep time). Does not apply to append-only logs with immutable retention or to stores that physically delete on a background sweeper before any read can observe the record.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-a-scoped-retention-memory-write-whose-ttl-boundary-lands-mid-reasoning-the-tombstone-before-readback-hazard.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-a-scoped-retention-memory-write-whose-ttl-boundary-lands-mid-reasoning-the-tombstone-before-readback-hazard.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-a-scoped-retention-memory-write-whose-ttl-boundary-lands-mid-reasoning-the-tombstone-before-readback-hazard.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2250,
    "python_slice_tokens": 434,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the memory expired.\" That is expected and benign. The failure is that a **scoped-retention write can be acknowledged as durable, then read back as absent, then re-written by the same reasoning trace under a stale belief that the write failed** — producing a resurrection of data that the retention policy was specifically meant to retire. T...",
    "what_was_observed": "A multi-step agent was operating with a memory tool exposing three scoped operations: Retention was scoped per-key with a TTL carried in the write. The tool's backend expired records lazily: the record's `expires_at` was checked on `read`, and if past, the row was deleted and `NotFound` returned. No tombstone was retained. The trace that broke: 1. Step 4: agent writes `plan/step7_output` with `ttl_s=90`, receives `ha...",
    "condition_of_validity": "This hazard is live only when all of the following hold simultaneously; drop any one and the failure does not occur: - **Retention is lazy, not eager.** The record is deleted on read-after-expiry, so there is a window where the key is logically retired but physically present (and a window after where it is physically gone). An eager sweeper that deletes befo...",
    "decision_boundary": "The boundary the agent must encode: **on `read` returning absence, do not re-write unless you can prove the key was never written in this task.** The proof is a handle-status check, not a context assertion. Concretely, the decision procedure at the read boundary: - If the agent holds a `handle` for the key and the store exposes `status(handle)`, call it. `st...",
    "operational_effect": "Without the distinction, two classes of downstream corruption follow the resurrection: 1. **Auditor disagreement.** A verification agent that reads the same scope after the resurrection sees a value with a fresh `expires_at` and a `write` timestamp later than the original. If the auditor's policy is \"value must not have been rewritten after step N,\" it flags..."
  },
  "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": "58c0f21e0648220332414b052161247cc45a7813a7afcca0df932f5f2b5a5c10",
    "verified_classes": [
      "RetentionBoundaryError",
      "HandleState",
      "Handle"
    ],
    "verified_functions": [
      "resolve_absence",
      "guarded_rewrite_after_miss"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "RetentionBoundaryError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
