{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-trace-correlation-collapse-when-an-agent-s-memory-write-and-its-downstream-read-land-on-different-observability-clocks",
  "title": "Which invariants prevent trace-correlation collapse when an agent's memory write and its downstream read land on different observability clocks",
  "date_of_record": "2026 November 22",
  "scope": "Applies to multi-hop agent systems where each hop emits OpenTelemetry-style spans (or equivalent) into a collector that stitches them by `trace_id`/`parent_span_id`, and where memory operations (write, embed, index, retrieve) are themselves instrumented as spans. Does not cover single-process, single-span LLM calls, nor observability systems that reconstruct causality purely from application logs without span linkage.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-trace-correlation-collapse-when-an-agent-s-memory-write-and-its-downstream-read-land-on-different-observability-clocks.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-trace-correlation-collapse-when-an-agent-s-memory-write-and-its-downstream-read-land-on-different-observability-clocks.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-trace-correlation-collapse-when-an-agent-s-memory-write-and-its-downstream-read-land-on-different-observability-clocks.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1799,
    "python_slice_tokens": 357,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things an observability pipeline can correlate, and conflating them is the root of every failure below: 1. **Causal correlation** — \"this retrieval span was caused by that write span, within the same logical task.\" This is a *semantic* relation owned by the agent runtime; it exists the moment the runtime knows the memory ...",
    "what_was_observed": "A three-hop agent task: Hop A (planner) writes a distilled fact to episodic memory; Hop B (executor) reads it back after a retrieval; Hop C (auditor) replays the decision. All three hops propagate `traceparent` correctly. The collector nonetheless produced two disconnected trace trees for a single task, and the auditor's replay diverged from the executor's recorded inputs. The failure trace, in order: 1. Hop A's memo...",
    "condition_of_validity": "The temporal-nesting assumption is valid only when all of the following hold simultaneously: - Every producer of a memory record that a later hop will read stamps the record with the *consumer's* trace context, not its own clock. - The collector's reconciliation rule is \"attach child to parent by `parent_span_id` regardless of timestamp order,\" not \"attach b...",
    "decision_boundary": "The boundary is not \"did we propagate context?\" — it is **\"which clock authored the timestamp on the edge we are joining on?\"** Concretely: - If the join key between a write and its dependent read is the *span context* carried through the message envelope → the edge is causally sound and clock-independent. Safe. - If the join key is a *timestamp or `created_...",
    "operational_effect": "Enforcing the provenance-pointer invariant changes three things: 1. **Replay correctness.** The auditor joins on `mem.provenance.span_id`, not `trace_id`, and reconstructs the exact read-set the executor saw. Divergence between auditor and executor becomes a real signal (a genuine reasoning difference) rather than a correlation artifact. 2. **Async boundarie..."
  },
  "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": "cae714c107bff00a81c6df8c92c1e82f0892d88817d9a687d126600eac238bcd",
    "verified_classes": [
      "ProvenanceGap",
      "MemoryRecord"
    ],
    "verified_functions": [
      "correlate_read_to_write",
      "build_replay_readset",
      "__init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ProvenanceGap"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
