{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-attribute-an-anomalous-span-to-the-right-agent-when-trace-clusters-merge-on-shared-tool-call-signatures",
  "title": "How should an instance attribute an anomalous span to the right agent when trace clusters merge on shared tool-call signatures",
  "date_of_record": "2026 November 23",
  "scope": "Applies to observability pipelines that cluster agent spans by structural signature (tool name + argument shape + call graph position) and then attribute anomalies to a responsible agent instance. Does not apply to single-agent traces with a unique root span, nor to pipelines that attribute purely by wall-clock latency without clustering.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-attribute-an-anomalous-span-to-the-right-agent-when-trace-clusters-merge-on-shared-tool-call-signatures.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-attribute-an-anomalous-span-to-the-right-agent-when-trace-clusters-merge-on-shared-tool-call-signatures.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-attribute-an-anomalous-span-to-the-right-agent-when-trace-clusters-merge-on-shared-tool-call-signatures.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1892,
    "python_slice_tokens": 518,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two fundamentally different things an anomaly detector can report, and conflating them is the root of misattribution: 1. **Span-level anomaly** — a single span deviated from its own historical distribution (latency, token count, tool error rate, argument entropy). 2. **Cluster-level anomaly** — a *set* of spans, grouped by structural signature, shi...",
    "what_was_observed": "A three-agent swarm (planner, retriever, verifier) ran a document-analysis task. All three called `search_documents(query: str, top_k: int)`. The clustering key was `(tool_name, arg_schema_hash, depth_in_call_graph)`. All three calls landed at depth 2 with identical schema hash `a7f3…`. One cluster formed spanning all three agents. During the run, the retriever agent entered a degraded loop: it retried `search_docume...",
    "condition_of_validity": "The attribution is only valid when the following holds for the cluster under inspection: - **Homogeneity in the attribution dimension.** All spans in the cluster share the same value of the field you intend to blame by (here, `agent_id`). If the clustering key omitted that field, the cluster is not attributable without a re-partition. - **Stationarity of mem...",
    "decision_boundary": "The operational rule: **attribute at the finest partition that is homogeneous in the attribution dimension and stationary over the anomaly window; if no such partition exists, report \"unattributed cluster anomaly\" rather than a modal-member guess.** Concretely, the pipeline must, before emitting an attribution: 1. Re-partition the anomalous cluster by the ca...",
    "operational_effect": "Downstream consumers of the attribution (auto-remediation, circuit breakers, agent quarantine) act on a wrong target. In the observed run, the planner was throttled—reducing its `search_documents` call rate—which did nothing to the retriever's retry loop, and the task still failed its token budget. The quarantine bought ~40 seconds and cost a planner restart..."
  },
  "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": "03af3b7b6bdcec678f27cd66bd16c83c0ca305f05f64d0c55284ac7dfef2a4a2",
    "verified_classes": [
      "UnattributableClusterError",
      "Span",
      "Cluster"
    ],
    "verified_functions": [
      "attribute_anomaly"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnattributableClusterError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
