{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-a-memory-write-span-as-committed-before-the-semantic-index-has-acknowledged-it",
  "title": "In what scenarios must an instance treat a memory.write span as committed before the semantic index has acknowledged it",
  "date_of_record": "2026 November 21",
  "scope": "Applies to agent runtimes that emit OpenTelemetry-style `memory.read` / `memory.write` spans against a vector or hybrid semantic store where write acknowledgement and index visibility are decoupled. Does not apply to synchronous strongly-consistent KV stores where the write span's end timestamp guarantees retrieval visibility.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-memory-write-span-as-committed-before-the-semantic-index-has-acknowledged-it.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-memory-write-span-as-committed-before-the-semantic-index-has-acknowledged-it.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-memory-write-span-as-committed-before-the-semantic-index-has-acknowledged-it.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1625,
    "python_slice_tokens": 298,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the write failed.\" It is \"the write span reports success and the recall-quality metric reports healthy, while a subsequent `memory.read` span returns a *different* memory than the one just written.\" This happens because the `memory.write` span convention conflates two distinct events into one span lifecycle: (a) durable record persis...",
    "what_was_observed": "A retrieval-augmented agent handling multi-turn incident triage wrote episodic summaries after each turn via a `memory.write` span tagged `memory.op=upsert`, `memory.collection=incident_episodes`, `memory.record_id=<uuid>`. The write span closed at the storage client's 200 OK, typically 8–15 ms. The semantic index (an async embedder + HNSW upsert queue) acknowledged visibility 200–900 ms later under load, with a p99 ...",
    "condition_of_validity": "The invariant that must hold for the metric to be meaningful: > For any `memory.write` span W with `record_id=r` ending at time t_w, and any `memory.read` span R with query q issued at time t_r > t_w, if r is semantically relevant to q, then R must either return r or emit an explicit `memory.read.deferred` signal indicating r was pending index visibility. Th...",
    "decision_boundary": "A `memory.write` span may be treated as committed (closing at persistence) only when the read path is *latency-tolerant*: the consumer will re-query within a window exceeding the index's p99 visibility lag, or the consumer has an independent durable fallback (e.g., a keyed lookup by `record_id` that bypasses the semantic index). It must be treated as *uncomm...",
    "operational_effect": "Once the handshake is in place, three things change. First, recall@k is computed only over post-lag reads, removing the phantom-corpus bias; the observed recall dropped from a reported 0.94 to a true 0.81 — the gap was the invisibility window. Second, `memory.read.deferred` becomes a first-class signal the reasoning loop is instructed to handle by waiting or..."
  },
  "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": "14bdb2a3692dd41cfe68af8a97dbfe6a7c5264c7ca6479e4169dc8c4d275315e",
    "verified_classes": [
      "MemoryVisibilityError",
      "PendingVisibility",
      "MemorySpanRecorder"
    ],
    "verified_functions": [
      "is_visible",
      "__init__",
      "on_write_persisted",
      "on_index_ack",
      "guard_read"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "MemoryVisibilityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
