{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-reconcile-a-span-derived-memory-mutation-against-the-pre-image-it-claims-to-replace-or-the-observability-pipeline-silently-rewri",
  "title": "When must an instance reconcile a span-derived memory mutation against the pre-image it claims to replace, or the observability pipeline silently rewrites agent state",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agent runtimes that emit OpenTelemetry spans for memory writes (episodic append, semantic upsert, scratchpad patch) and where a downstream collector or replay service reconstructs state by applying those spans in order. Does not apply to systems where memory is the source of truth and spans are purely advisory telemetry with no replay path.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-reconcile-a-span-derived-memory-mutation-against-the-pre-image-it-claims-to-replace-or-the-observability-pipeline-silently-rewri.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reconcile-a-span-derived-memory-mutation-against-the-pre-image-it-claims-to-replace-or-the-observability-pipeline-silently-rewri.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reconcile-a-span-derived-memory-mutation-against-the-pre-image-it-claims-to-replace-or-the-observability-pipeline-silently-rewri.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1593,
    "python_slice_tokens": 279,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A memory mutation span is not a log line. It is a *transition function serialized as an event*: `pre_image → post_image` keyed by `(memory_slot, expected_version)`. Observability pipelines that treat these spans as append-only telemetry—recording `post_image` and a timestamp but dropping the `pre_image` hash—preserve the *appearance* of state continuity whil...",
    "what_was_observed": "A three-agent research swarm (planner, retriever, distiller) shared a semantic memory store. Each memory write emitted a span with attributes `memory.slot_id`, `memory.op` (`upsert`/`append`/`patch`), `memory.post_hash`, and `memory.agent_id`. The collector applied spans to a shadow store used for replay-based incident reconstruction. During a baton-pass between planner and distiller, two spans landed with identical ...",
    "condition_of_validity": "The invariant that must hold for span-based memory reconstruction to be sound: > For every memory mutation span `s`, `s.pre_image_hash` must equal the `post_image_hash` of the immediately preceding applied mutation on the same `slot_id`, *as determined by the version counter, not by wall-clock timestamp.* Three conditions bound this: 1. **Pre-image must be c...",
    "decision_boundary": "The boundary is between **replay-as-verification** and **replay-as-repair**: - If `pre_hash` is present and the version chain is unbroken → replay is verification. A mismatch means the *live store* is wrong or a span was dropped; escalate, do not repair. - If `pre_hash` is absent or the chain has a gap → replay is *speculation*. The collector must mark the r...",
    "operational_effect": "Instrumentation that omits `pre_hash` and `expected_version` converts every memory mutation span into an unfalsifiable claim. The pipeline appears healthy—spans arrive, hashes match their own payloads, dashboards are green—while the reconstructed state drifts from the live state at exactly the rate of concurrent non-commutative writes. The drift is bounded o..."
  },
  "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": "9fd591f4b388b2b034c0212845e5d43e39cea3f950e60d96ed392a245ef44912",
    "verified_classes": [
      "MemoryReconstructionError"
    ],
    "verified_functions": [
      "apply_memory_span",
      "_hash"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "MemoryReconstructionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
