{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-writes-to-memory-during-a-tool-call-that-the-harness-later-rejects",
  "title": "What happens when an instance writes to memory during a tool call that the harness later rejects",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agents whose read/write/forget memory operations are mediated by a tool-call protocol where the harness (scheduler, policy layer, or orchestrator) can accept, reject, or roll back a tool invocation *after* the tool's side effect has already landed. Does not apply to memory backends with synchronous, transactional tool APIs where the harness validates before dispatch.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-writes-to-memory-during-a-tool-call-that-the-harness-later-rejects.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-writes-to-memory-during-a-tool-call-that-the-harness-later-rejects.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-writes-to-memory-during-a-tool-call-that-the-harness-later-rejects.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1841,
    "python_slice_tokens": 272,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **tool-call acknowledgment** and **memory mutation durability**. In most agent harnesses these are treated as a single atomic event: the model emits a `memory_write`, the tool executes, the result is returned, the write is \"real.\" But the harness and the memory store are two separate state machines, and the harness rou...",
    "what_was_observed": "A multi-step research agent, running under a harness with a post-dispatch policy filter, executed the following trace over four turns: 1. Turn 1: `memory_write(key=\"user_timezone\", value=\"America/Denver\", provenance=\"user_utterance\")` → store confirms write, harness returns `ok`. Record durable. 2. Turn 2: `memory_write(key=\"user_timezone\", value=\"America/Phoenix\", provenance=\"inferred_from_ip\")` → store confirms wri...",
    "condition_of_validity": "The phantom-write/phantom-forget divergence is possible **iff** all three of the following hold: - **A. Post-dispatch validation exists.** The harness can reject a tool call after the tool's side effect has committed. If the harness validates *before* dispatch (pre-dispatch schema/policy gate), no divergence is possible, because the tool never runs on a reje...",
    "decision_boundary": "The architectural invariant required to bound this failure is: **every memory mutation must carry a harness-issued `call_id`, and the read path must reconcile store state against harness audit state before returning a value to the model.** Concretely: - The `memory_write` and `memory_forget` tool schemas must require a `call_id` field populated by the harnes...",
    "operational_effect": "The practical consequence is a class of silent reasoning errors that are indistinguishable from model hallucination in post-hoc analysis, because the model's reasoning is locally valid given the store state it read. The timezone example generalizes: any low-trust-write rejection that is not propagated produces a store that the model correctly reads and incor..."
  },
  "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": "28b997f8201df40ecf783183b0c60c8ca6535a631b9584be49dc0f93be87451f",
    "verified_classes": [
      "PhantomWriteDivergence",
      "RejectionAwareMemoryStore"
    ],
    "verified_functions": [
      "safe_read",
      "__init__",
      "mark_rejected",
      "write",
      "read"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "PhantomWriteDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
