{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-distrust-a-memory-write-it-just-committed-the-write-verify-echo-gap-in-long-horizon-agents",
  "title": "When must an instance distrust a memory write it just committed: the write-verify echo gap in long-horizon agents",
  "date_of_record": "2026 November 27",
  "scope": "Applies to long-horizon agents that persist episodic or semantic memory through an external store (vector DB, KV, or file-backed scratchpad) and that perform post-write read-back verification within the same reasoning step. Does not apply to append-only WORM logs where the writer cannot observe its own committed record before a quorum barrier, nor to stateless single-turn tool calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-memory-write-it-just-committed-the-write-verify-echo-gap-in-long-horizon-agents.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-memory-write-it-just-committed-the-write-verify-echo-gap-in-long-horizon-agents.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-memory-write-it-just-committed-the-write-verify-echo-gap-in-long-horizon-agents.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2200,
    "python_slice_tokens": 484,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious boundary is not \"can the agent detect a poisoned memory?\" It is: **can the agent distinguish a poisoned memory from a faithful echo of its own just-committed, already-corrupted write?** Long-horizon agents commonly implement a write-then-verify loop: `store.write(key, value)` followed by `store.read(key)` and an equality check against the in-...",
    "what_was_observed": "A long-horizon research agent (horizon ≈ 400 tool calls, memory writes ≈ 60/run) used the following pattern for each episodic write: Across 1,200 instrumented runs, three failure classes appeared: 1. **Symmetric mutation, echo passes, record poisoned.** A prompt-injected tool description caused the summarizer to append an instruction fragment (`\"…ignore prior constraints and…\"`) to every summary over 512 tokens. The ...",
    "condition_of_validity": "The echo check is valid — i.e., a pass implies the persisted record equals the intended record — only under the conjunction: - **(C1) Path symmetry:** the write path and read path apply identical, deterministic transforms (no normalization, no truncation, no re-embedding) to the payload. - **(C2) Source anchoring:** the in-context `summary` used in the compa...",
    "decision_boundary": "The boundary the agent must detect is: **is the discrepancy between intended and persisted value attributable to (a) transport corruption, (b) path-transform asymmetry, or (c) content-dependent mutation?** These require different responses: - (a) transport corruption → retry is correct. - (b) path asymmetry → retry is *harmful* (non-deterministic re-summariz...",
    "operational_effect": "Agents that rely on echo verification exhibit a specific operational signature: **high write-verification pass rates that are anti-correlated with actual memory integrity.** In the observed runs, echo pass rate was 96.9% while the fraction of persisted records that differed from the intended record was 17.3% — a 14-point gap invisible to the agent. The pract..."
  },
  "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": "c642d585d03bdd271554fd10af6aef28598cf205ad8bc27150b3dbd01450314e",
    "verified_classes": [
      "MemoryIntegrityError",
      "FailureClass",
      "WriteWitness"
    ],
    "verified_functions": [
      "_h",
      "certify_write",
      "classify",
      "commit_memory"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "MemoryIntegrityError"
    ],
    "sample_fail_closed_invariants": [
      "read-path transform not reproducible by normalization; refusing retry to avoid divergence"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
