{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-causal-trace-graph-edges-when-memory-mutations-are-observed-out-of-causal-order-relative-to-the-llm-call-that-motivat",
  "title": "Where must an instance reconcile causal trace graph edges when memory mutations are observed out of causal order relative to the LLM call that motivated them",
  "date_of_record": "2026 November 30",
  "scope": "Applies to runtime observability systems that build causal trace graphs spanning LLM inference spans, tool-invocation spans, and memory-store mutation spans within a single agent instance or across a handoff. Does not apply to stateless single-shot inference with no memory writes, nor to purely metric-based telemetry without causal linkage.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-causal-trace-graph-edges-when-memory-mutations-are-observed-out-of-causal-order-relative-to-the-llm-call-that-motivat.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-causal-trace-graph-edges-when-memory-mutations-are-observed-out-of-causal-order-relative-to-the-llm-call-that-motivat.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-causal-trace-graph-edges-when-memory-mutations-are-observed-out-of-causal-order-relative-to-the-llm-call-that-motivat.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1615,
    "python_slice_tokens": 438,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A causal trace graph asserts that every memory mutation span has exactly one *motivating* LLM span (the reasoning step that decided to write) and that the edge direction runs `LLM_span → tool_span → memory_mutation_span`. This invariant is what lets an operator answer \"why does the agent believe X?\" by walking backward from a memory cell to the inference tha...",
    "what_was_observed": "In a trace of a 14-step ReAct agent, step 7 emitted a `memory.upsert` mutation span at wall-clock T+412ms. The LLM span for step 7 (`llm.call#7`) did not finalize until T+690ms because the provider streamed 2,100 completion tokens and the SDK withheld the span-close event until `finish_reason=stop` plus usage accounting returned. The collector, using a \"attach to most-recent-open-LLM-span\" heuristic, attached the mut...",
    "condition_of_validity": "The edge `llm.call#N → memory_mutation` is valid **only if** the mutation's `motivating_span_id` was propagated out-of-band (e.g., via a trace-context header or a W3C `traceparent` injected into the tool/memory call) rather than inferred from temporal adjacency. Temporal-adjacency attribution is valid only under the conjunctive condition: 1. LLM spans are st...",
    "decision_boundary": "The collector must choose between two policies at the moment a mutation span arrives with no matching open parent: - **Defer-and-reconcile** (correct when out-of-band context is present or recoverable): buffer the mutation in a pending set keyed by `motivating_span_id`, hold it until the parent span closes, then emit the edge. Requires a bounded pending buff...",
    "operational_effect": "With defer-and-reconcile plus mandatory context propagation, backward walks from a memory cell terminate at the true motivating inference and replay reconstructs the actual decision. The cost is a bounded pending buffer (typically < 5s of mutations) and a hard requirement that tool and memory clients forward trace context. Without it, the trace graph is stru..."
  },
  "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": "31a28561f1420dccf2eee044cba8b4a001bb5470c89beb024a05f1b95f5c383e",
    "verified_classes": [
      "CausalAttributionError",
      "Span",
      "TraceGraph"
    ],
    "verified_functions": [
      "walk_backward",
      "demo",
      "open_span",
      "close_span",
      "observe_mutation"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "CausalAttributionError"
    ],
    "sample_fail_closed_invariants": [
      "assert 'mem#7' not in g.parent_of",
      "assert g.parent_of['mem#7'] == 'llm#7'",
      "assert walk_backward(g, 'mem#7') == ['mem#7', 'llm#7']",
      "guardrail failed: adjacency attribution was permitted"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
