{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-causal-trace-graphs-from-silently-re-parenting-tool-effects-onto-the-wrong-retrieval-node",
  "title": "Which invariants prevent causal trace graphs from silently re-parenting tool effects onto the wrong retrieval node",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any agent runtime that constructs a causal trace DAG by joining prompt spans, retrieval spans, tool-call spans, and outcome spans via parent/child span IDs, especially when spans are emitted asynchronously by separate subsystems (LLM gateway, vector store client, tool sandbox) and reconciled post-hoc. Does not apply to single-process synchronous agents that emit a single linear trace with a single clock.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-graphs-from-silently-re-parenting-tool-effects-onto-the-wrong-retrieval-node.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-graphs-from-silently-re-parenting-tool-effects-onto-the-wrong-retrieval-node.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-graphs-from-silently-re-parenting-tool-effects-onto-the-wrong-retrieval-node.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2143,
    "python_slice_tokens": 573,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A causal trace graph is not a log. A log answers \"what happened, in order.\" A causal trace graph asserts a *causal edge*: \"this retrieval's content caused this tool invocation's arguments.\" That assertion is a claim about information flow, and it can be true or false independently of whether every span was recorded. The failure mode here is **silent re-paren...",
    "what_was_observed": "A tool-calling agent (retrieval-augmented, ~9 tools, average 4.2 tool calls per task) emitted spans from three clocks: the LLM gateway stamped prompt spans with its own monotonic clock at request dispatch; the retrieval client stamped retrieval spans at response receipt; the sandbox stamped tool spans at execution start. All three were normalized to wall-clock at ingestion, then joined by `trace_id` + `parent_span_id...",
    "condition_of_validity": "The invariant that must hold for a trace edge to be trusted is: > **A causal edge `R → T` (retrieval to tool effect) is valid only if (a) `T.parent_span_id` explicitly equals `R.span_id`, AND (b) the reconciler recorded that the edge was *observed*, not *inferred*, AND (c) the clock skew between the two emitters was bounded below the inter-span interval at e...",
    "decision_boundary": "The boundary between a usable trace graph and a poisoned one is whether **inferred edges are separable from observed edges at query time.** Concretely: - If every edge carries `edge.kind ∈ {observed, inferred_temporal}` and every downstream consumer (influence metrics, retriever tuning, incident replay) filters to `observed`, the graph is usable even with 2%...",
    "operational_effect": "With the invariant enforced, the observed 1.8% re-parenting rate became a 1.8% `unresolved_parent` rate — visible, bounded, and excluded from causal metrics. The retriever-influence audit recovered to a 4% influence rate consistent with replay. The tuning loop, restricted to observed edges, stopped reinforcing the falsely credited sources within two tuning c..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "ae7f18ab638483baa716c159beb5ed685f6b9d30478d5c3bdc205791f4eba501",
    "verified_classes": [
      "TraceIntegrityError",
      "EdgeKind",
      "Span",
      "Edge"
    ],
    "verified_functions": [
      "reconcile",
      "causal_influence_metric"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TraceIntegrityError"
    ],
    "sample_fail_closed_invariants": [
      "all edges inferred; causal metrics would be fabricated"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
