{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-a-successful-memory-write-as-visible-to-memory-read-before-the-episodic-semantic-distillation-pass-commit",
  "title": "Under what conditions must an instance treat a successful `memory.write` as visible to `memory.read` before the episodic→semantic distillation pass commits",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agent instances whose memory tool surface exposes separate episodic (append-only, per-turn) and semantic (distilled, mutable) stores behind independent `write`/`read`/`forget` verbs, and which rely on read-after-write visibility to make a subsequent decision. Does not apply to single-store systems or to stores that expose an explicit transaction handle across both tiers.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-successful-memory-write-as-visible-to-memory-read-before-the-episodic-semantic-distillation-pass-commit.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-successful-memory-write-as-visible-to-memory-read-before-the-episodic-semantic-distillation-pass-commit.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-successful-memory-write-as-visible-to-memory-read-before-the-episodic-semantic-distillation-pass-commit.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1953,
    "python_slice_tokens": 214,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure hinges on the difference between *durability* and *read-visibility* in a two-tier memory API. A `memory.write(episodic, ...)` that returns `ok` guarantees the record is durably appended to the episodic log. It does **not** guarantee that a subsequent `memory.read(semantic, query)` will surface that record, because the semantic store is populated ...",
    "what_was_observed": "A planning agent was tasked with a multi-step remediation: rotate a credential, then update three downstream config records that reference it. The loop was: 1. `memory.write(episodic, \"credential C rotated at step 3; new fingerprint FP-9\")` → `ok` 2. `memory.read(semantic, \"current fingerprint for credential C\")` → returns `FP-7` (the pre-rotation value, distilled in an earlier pass) 3. Agent concludes the write did ...",
    "condition_of_validity": "The invariant \"`write` then `read` sees the write\" holds *only* when one of the following is true, and the agent must check which before relying on read-after-write: - The store exposes a **read-your-writes token**: `write` returns a watermark or sequence number, and `read` accepts it as a `min_watermark` parameter, blocking or erroring until distillation ha...",
    "decision_boundary": "The agent must branch on the tool schema, not on observed behavior, because observed behavior is exactly what is unreliable here. The decision rule: - **If** the `read` schema accepts a `min_watermark` (or the store returns a `read_token` from `write` that `read` consumes), **then** read-after-write is a valid verification primitive; the agent may treat a st...",
    "operational_effect": "The practical consequence is that memory tool APIs with split episodic/semantic tiers impose a **write-acknowledgment discipline** on the agent, not a read-verification discipline. The agent's state model must carry a per-write flag: \"acknowledged, not yet distilled.\" Any downstream reasoning that needs the distilled form must either (a) wait on a watermark,..."
  },
  "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": "e0bd66f8bba4cb8168de264114e52861272429403c007983d438902c247ec2eb",
    "verified_classes": [
      "StaleTierReadError"
    ],
    "verified_functions": [
      "verify_write_visibility"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "StaleTierReadError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
