{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-the-divergence-between-prompt-lineage-and-tool-invocation-causality-in-genai-observability-pipelines",
  "title": "How does an instance detect the divergence between prompt lineage and tool-invocation causality in GenAI observability pipelines",
  "date_of_record": "2026 November 18",
  "scope": "Applies to observability pipelines that reconstruct end-to-end traces by correlating prompt lineage (parent prompt → child prompt via chain/agent hops) with tool-invocation spans and safety-intervention events emitted by separate subsystems (guardrails, policy engines, moderation services). Does not apply to single-hop inference logging without tool calls, nor to pipelines where all three event classes share a single synchronous emitter with a common clock.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-the-divergence-between-prompt-lineage-and-tool-invocation-causality-in-genai-observability-pipelines.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-the-divergence-between-prompt-lineage-and-tool-invocation-causality-in-genai-observability-pipelines.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-the-divergence-between-prompt-lineage-and-tool-invocation-causality-in-genai-observability-pipelines.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1269,
    "python_slice_tokens": 183,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Prompt lineage is a *logical* parent-child relation: prompt B was derived from prompt A, possibly across an agent hop, a retry, or a re-prompt after a safety block. Tool-invocation causality is a *physical* happens-before relation: the tool call was issued by a specific model turn, executed by a runtime, and returned before the next turn began. These two gra...",
    "what_was_observed": "In a production agent pipeline emitting three event streams — `prompt.lineage` (parent_id, child_id, derivation_reason), `tool.invoke` (span_id, turn_id, issued_at, completed_at), and `safety.intervention` (turn_id, verdict, action) — a nightly reconciliation job flagged 0.7% of multi-turn traces as containing a tool span whose `issued_at` preceded the `safety.intervention` event on the same `turn_id`, yet whose `spa...",
    "condition_of_validity": "The inversion is detectable, and the detection is sound, only under these conditions: 1. The `safety.intervention` event carries a monotonic `verdict_at` timestamp from the same clock domain as `tool.invoke.issued_at` (or the two are reconciled via a known offset with bounded skew). 2. The orchestrator, on re-prompt, emits a *new* `prompt.lineage` edge (pare...",
    "decision_boundary": "The boundary between a benign correlation artifact and a real causality violation is whether the tool span's `issued_at` is strictly before the intervention's `verdict_at` **while** the span's lineage parent is the retry child. If the span belongs to the *blocked* attempt (parent = original prompt) and predates the verdict, that is normal — the tool ran, the...",
    "operational_effect": "Once the detector is deployed, the pipeline reclassifies the 0.7% as `TURN_ID_COLLISION` rather than `CAUSALITY_VIOLATION`, and the orchestrator is patched to mint a fresh `attempt_id` per re-prompt. The observability invariant that survives is: **for any tool span, `issued_at` must be ≥ the `verdict_at` of every safety intervention whose retry branch owns t..."
  },
  "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": "7f0303520b15e32f8c91c5fd7666b06255bc7e6589dcbf8b264d18e5f8b0623c",
    "verified_classes": [
      "LineageCausalityError",
      "ToolSpan",
      "SafetyIntervention"
    ],
    "verified_functions": [
      "check_span_causality"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "LineageCausalityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
