{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/logbrew/json-schema/logbrew-trace-investigation-response-schema.json",
  "title": "TraceInvestigationResponse",
  "description": "One complete bounded trace investigation bundle.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/logbrew-traces-api-openapi.yml#/components/schemas/TraceInvestigationResponse",
  "properties": {
    "analysis": {
      "$ref": "#/$defs/TraceInvestigationAnalysisResponse",
      "description": "Backend-observed failure and latency focus without a root-cause claim."
    },
    "correlations": {
      "$ref": "#/$defs/TraceInvestigationCorrelationsResponse",
      "description": "Exact-trace issue, log, action, and metric evidence."
    },
    "evidence": {
      "$ref": "#/$defs/InvestigationEvidenceCoverageResponse",
      "description": "Explicit captured, missing, redacted, and truncated evidence state."
    },
    "next_actions": {
      "description": "Backend-generated follow-up actions in priority order.",
      "items": {
        "$ref": "#/$defs/FocusedInvestigationNextActionResponse"
      },
      "type": "array"
    },
    "schema_version": {
      "description": "Additive response schema version.",
      "format": "uint8",
      "maximum": 255,
      "minimum": 0,
      "type": "integer"
    },
    "spans": {
      "$ref": "#/$defs/TraceInvestigationSpansResponse",
      "description": "Privacy-safe critical span evidence."
    },
    "subject": {
      "$ref": "#/$defs/TraceInvestigationSubjectResponse",
      "description": "Stable trace identity and aggregate health."
    },
    "timeline": {
      "$ref": "#/$defs/InvestigationTimelineResponse2",
      "description": "Bounded causal ordering across retained signal kinds."
    }
  },
  "required": [
    "schema_version",
    "subject",
    "analysis",
    "spans",
    "correlations",
    "timeline",
    "evidence",
    "next_actions"
  ],
  "type": "object",
  "$defs": {
    "FocusedInvestigationNextActionResponse": {
      "description": "Machine-readable next action with an optional span or grouped-issue focus.",
      "properties": {
        "code": {
          "$ref": "#/$defs/TraceInvestigationNextActionCode",
          "description": "Stable action code."
        },
        "issue_id": {
          "description": "Grouped issue to inspect when applicable.",
          "format": "uuid",
          "type": [
            "string",
            "null"
          ]
        },
        "priority": {
          "description": "One-based priority.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "reason": {
          "$ref": "#/$defs/TraceInvestigationNextActionReason",
          "description": "Stable reason for recommending the action."
        },
        "span_id": {
          "description": "Exact span to inspect when applicable.",
          "type": [
            "string",
            "null"
          ]
        },
        "target": {
          "$ref": "#/$defs/TraceInvestigationNextActionTarget",
          "description": "Stable action target."
        }
      },
      "required": [
        "priority",
        "code",
        "target",
        "reason",
        "span_id",
        "issue_id"
      ],
      "type": "object"
    },
    "InvestigationAvailabilityStatus": {
      "description": "Availability of one optional evidence source in an investigation bundle.",
      "oneOf": [
        {
          "const": "available",
          "description": "Evidence was queried and is included.",
          "type": "string"
        },
        {
          "const": "not_linked",
          "description": "The subject did not carry the identifier required for exact correlation.",
          "type": "string"
        },
        {
          "const": "not_found",
          "description": "An exact correlation identifier was present but no evidence was retained.",
          "type": "string"
        },
        {
          "const": "unavailable",
          "description": "The evidence source could not be read without failing the primary subject read.",
          "type": "string"
        }
      ]
    },
    "InvestigationCausalityStatus": {
      "description": "Causal confidence shared by evidence-only investigation analyses.",
      "oneOf": [
        {
          "const": "evidence_only",
          "description": "Correlated telemetry does not independently prove cause or remediation.",
          "type": "string"
        }
      ]
    },
    "InvestigationCollectionResponse4": {
      "description": "Bounded optional evidence with an explicit read receipt.",
      "properties": {
        "items": {
          "description": "Privacy-bounded evidence in the endpoint's documented order.",
          "items": {
            "$ref": "#/$defs/TraceInvestigationIssueResponse"
          },
          "type": "array"
        },
        "status": {
          "$ref": "#/$defs/InvestigationAvailabilityStatus",
          "description": "Exact evidence or link availability."
        },
        "truncated": {
          "description": "Whether the owning boundary omitted one or more items.",
          "type": "boolean"
        }
      },
      "required": [
        "status",
        "items",
        "truncated"
      ],
      "type": "object"
    },
    "InvestigationCollectionResponse6": {
      "description": "Bounded optional evidence with an explicit read receipt.",
      "properties": {
        "items": {
          "description": "Privacy-bounded evidence in the endpoint's documented order.",
          "items": {
            "$ref": "#/$defs/TraceInvestigationActionResponse"
          },
          "type": "array"
        },
        "status": {
          "$ref": "#/$defs/InvestigationAvailabilityStatus",
          "description": "Exact evidence or link availability."
        },
        "truncated": {
          "description": "Whether the owning boundary omitted one or more items.",
          "type": "boolean"
        }
      },
      "required": [
        "status",
        "items",
        "truncated"
      ],
      "type": "object"
    },
    "InvestigationCollectionResponse7": {
      "description": "Bounded optional evidence with an explicit read receipt.",
      "properties": {
        "items": {
          "description": "Privacy-bounded evidence in the endpoint's documented order.",
          "items": {
            "$ref": "#/$defs/TraceInvestigationMetricResponse"
          },
          "type": "array"
        },
        "status": {
          "$ref": "#/$defs/InvestigationAvailabilityStatus",
          "description": "Exact evidence or link availability."
        },
        "truncated": {
          "description": "Whether the owning boundary omitted one or more items.",
          "type": "boolean"
        }
      },
      "required": [
        "status",
        "items",
        "truncated"
      ],
      "type": "object"
    },
    "InvestigationCollectionResponse8": {
      "description": "Bounded optional evidence with an explicit read receipt.",
      "properties": {
        "items": {
          "description": "Privacy-bounded evidence in the endpoint's documented order.",
          "items": {
            "$ref": "#/$defs/TraceInvestigationLogResponse"
          },
          "type": "array"
        },
        "status": {
          "$ref": "#/$defs/InvestigationAvailabilityStatus",
          "description": "Exact evidence or link availability."
        },
        "truncated": {
          "description": "Whether the owning boundary omitted one or more items.",
          "type": "boolean"
        }
      },
      "required": [
        "status",
        "items",
        "truncated"
      ],
      "type": "object"
    },
    "InvestigationEvidenceCoverageResponse": {
      "description": "Explicit captured, missing, redacted, and truncated evidence state.",
      "properties": {
        "captured_fields": {
          "description": "Stable normalized field identifiers present in the bundle.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "missing_fields": {
          "description": "Stable normalized field identifiers that were required but unavailable.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "redacted_fields": {
          "description": "Stable normalized field identifiers intentionally withheld before ingestion.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "status": {
          "$ref": "#/$defs/InvestigationEvidenceStatus",
          "description": "Truthful aggregate status derived by the backend."
        },
        "truncated_fields": {
          "description": "Stable normalized field identifiers whose bounded history is incomplete.",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "status",
        "captured_fields",
        "missing_fields",
        "redacted_fields",
        "truncated_fields"
      ],
      "type": "object"
    },
    "InvestigationEvidenceProvenance": {
      "description": "Provenance of a cause, impact, or fix assessment.",
      "oneOf": [
        {
          "const": "backend_observed",
          "description": "Directly observed and normalized by the `LogBrew` backend.",
          "type": "string"
        },
        {
          "const": "application_reported",
          "description": "Reported by application telemetry and not independently verified by `LogBrew`.",
          "type": "string"
        }
      ]
    },
    "InvestigationEvidenceStatus": {
      "description": "Overall completeness of an investigation evidence bundle.",
      "oneOf": [
        {
          "const": "complete",
          "description": "All required fields for this version were captured and no omission was reported.",
          "type": "string"
        },
        {
          "const": "partial",
          "description": "One or more required fields are missing, redacted, truncated, or unavailable.",
          "type": "string"
        }
      ]
    },
    "InvestigationSdkResponse": {
      "description": "SDK package identity attached to retained telemetry.",
      "properties": {
        "name": {
          "description": "Public SDK package name.",
          "type": "string"
        },
        "version": {
          "description": "Public SDK semantic version.",
          "type": "string"
        }
      },
      "required": [
        "name",
        "version"
      ],
      "type": "object"
    },
    "InvestigationTimelineResponse2": {
      "description": "Bounded chronological evidence shared by investigation contracts.",
      "properties": {
        "items": {
          "description": "Oldest-to-newest evidence items.",
          "items": {
            "$ref": "#/$defs/TraceInvestigationTimelineItemResponse"
          },
          "type": "array"
        },
        "truncated": {
          "description": "Whether the timeline boundary omitted one or more items.",
          "type": "boolean"
        }
      },
      "required": [
        "items",
        "truncated"
      ],
      "type": "object"
    },
    "IssueInvestigationApplicationContextResponse": {
      "description": "Application identity attached by the SDK or application.",
      "properties": {
        "build": {
          "description": "Application build identity.",
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "description": "Application name.",
          "type": [
            "string",
            "null"
          ]
        },
        "version": {
          "description": "Application version.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "version",
        "build"
      ],
      "type": "object"
    },
    "IssueInvestigationCauseResponse": {
      "description": "Root-cause assessment without presenting telemetry as verified fact.",
      "properties": {
        "provenance": {
          "anyOf": [
            {
              "$ref": "#/$defs/InvestigationEvidenceProvenance"
            },
            {
              "type": "null"
            }
          ],
          "description": "Provenance of the summary."
        },
        "signals": {
          "description": "Backend-observed signals that support further investigation.",
          "items": {
            "$ref": "#/$defs/IssueInvestigationCauseSignal"
          },
          "type": "array"
        },
        "status": {
          "$ref": "#/$defs/IssueInvestigationCauseStatus",
          "description": "Strength of the available cause assessment."
        },
        "summary": {
          "description": "Bounded application-reported hypothesis when present.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "status",
        "summary",
        "provenance",
        "signals"
      ],
      "type": "object"
    },
    "IssueInvestigationCauseSignal": {
      "description": "Stable causal evidence codes.",
      "oneOf": [
        {
          "const": "reported_root_cause",
          "description": "Application telemetry supplied a root-cause hypothesis.",
          "type": "string"
        },
        {
          "const": "unhandled_exception",
          "description": "The exception escaped its capture boundary.",
          "type": "string"
        },
        {
          "const": "handled_exception",
          "description": "The exception was handled by its capture boundary.",
          "type": "string"
        },
        {
          "const": "runtime_exception_chain",
          "description": "The runtime reported at least one explicit underlying exception relationship.",
          "type": "string"
        },
        {
          "const": "error_trace_span",
          "description": "At least one correlated trace span has error status.",
          "type": "string"
        },
        {
          "const": "error_log",
          "description": "At least one correlated log has error or critical severity.",
          "type": "string"
        }
      ]
    },
    "IssueInvestigationCauseStatus": {
      "description": "Truthful states for a likely-cause assessment.",
      "oneOf": [
        {
          "const": "reported_hypothesis",
          "description": "The application supplied a hypothesis; `LogBrew` has not independently verified it.",
          "type": "string"
        },
        {
          "const": "evidence_only",
          "description": "Observable failure signals exist, but they do not prove a root cause.",
          "type": "string"
        },
        {
          "const": "unknown",
          "description": "No safe causal signal was available.",
          "type": "string"
        }
      ]
    },
    "IssueInvestigationCodeLocationResponse": {
      "description": "Normalized privacy-safe code location.",
      "properties": {
        "column": {
          "description": "One-based source column.",
          "format": "uint32",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "component": {
          "description": "Low-cardinality component identity.",
          "type": [
            "string",
            "null"
          ]
        },
        "file": {
          "description": "Basename or safe relative source path.",
          "type": [
            "string",
            "null"
          ]
        },
        "function": {
          "description": "Function or method identity.",
          "type": [
            "string",
            "null"
          ]
        },
        "in_app": {
          "description": "SDK application-code classification.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "line": {
          "description": "One-based source line.",
          "format": "uint32",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "module": {
          "description": "Module, namespace, package, or crate identity.",
          "type": [
            "string",
            "null"
          ]
        },
        "source_exception_id": {
          "description": "Version-5 exception node that supplied this location.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "component",
        "module",
        "function",
        "file",
        "line",
        "column",
        "in_app"
      ],
      "type": "object"
    },
    "IssueInvestigationContextResponse": {
      "description": "Versioned privacy-bounded resource and correlation context for one occurrence.",
      "properties": {
        "resource": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationResourceContextResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Service, deployment, runtime, framework, OS, device, and app identity."
        },
        "schema_version": {
          "description": "Shared telemetry-context schema version.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "session": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationSessionContextResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Opaque application session identity."
        },
        "subject": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationSubjectContextResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Opaque application subject identity and kind."
        },
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Bounded low-cardinality dimensions in deterministic key order.",
          "type": "object"
        },
        "trace": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationTraceContextResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Exact W3C correlation identifiers supplied by the occurrence."
        }
      },
      "required": [
        "schema_version",
        "resource",
        "trace",
        "session",
        "subject",
        "tags"
      ],
      "type": "object"
    },
    "IssueInvestigationDeploymentContextResponse": {
      "description": "Deployment identity carried by the selected event.",
      "properties": {
        "environment": {
          "description": "Deployment environment.",
          "type": [
            "string",
            "null"
          ]
        },
        "release": {
          "description": "Application release.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "environment",
        "release"
      ],
      "type": "object"
    },
    "IssueInvestigationDeviceContextResponse": {
      "description": "Privacy-bounded device or host class without a unique identifier.",
      "properties": {
        "architecture": {
          "description": "CPU architecture.",
          "type": [
            "string",
            "null"
          ]
        },
        "family": {
          "description": "Broad device family.",
          "type": [
            "string",
            "null"
          ]
        },
        "model": {
          "description": "Bounded model or runtime host class.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "family",
        "model",
        "architecture"
      ],
      "type": "object"
    },
    "IssueInvestigationFixResponse": {
      "description": "Best available next-fix location.",
      "properties": {
        "location": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationCodeLocationResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Normalized code location when available."
        },
        "provenance": {
          "anyOf": [
            {
              "$ref": "#/$defs/InvestigationEvidenceProvenance"
            },
            {
              "type": "null"
            }
          ],
          "description": "Provenance of the location."
        },
        "status": {
          "$ref": "#/$defs/IssueInvestigationFixStatus",
          "description": "Strength and source of the location."
        }
      },
      "required": [
        "status",
        "location",
        "provenance"
      ],
      "type": "object"
    },
    "IssueInvestigationFixStatus": {
      "description": "Truthful states for a likely-fix location.",
      "oneOf": [
        {
          "const": "reported_location",
          "description": "Application telemetry supplied the location as a likely fix area.",
          "type": "string"
        },
        {
          "const": "observed_application_frame",
          "description": "`LogBrew` observed an application-owned frame.",
          "type": "string"
        },
        {
          "const": "observed_frame",
          "description": "`LogBrew` observed a frame but cannot prove application ownership.",
          "type": "string"
        },
        {
          "const": "observed_underlying_exception_frame",
          "description": "`LogBrew` observed the location on an underlying runtime exception.",
          "type": "string"
        },
        {
          "const": "unknown",
          "description": "No safe code location was available.",
          "type": "string"
        }
      ]
    },
    "IssueInvestigationNamedVersionResponse": {
      "description": "Bounded name and optional version pair.",
      "properties": {
        "name": {
          "description": "Stable product, runtime, framework, or service name.",
          "type": "string"
        },
        "version": {
          "description": "Optional version identity.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "version"
      ],
      "type": "object"
    },
    "IssueInvestigationOperatingSystemContextResponse": {
      "description": "Operating-system identity without host name or unique device identifiers.",
      "properties": {
        "build": {
          "description": "Optional bounded build identity.",
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "description": "Operating-system family or distribution.",
          "type": "string"
        },
        "version": {
          "description": "Optional user-space version.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "version",
        "build"
      ],
      "type": "object"
    },
    "IssueInvestigationResourceContextResponse": {
      "description": "Typed resource identity shared by `LogBrew` telemetry signals.",
      "properties": {
        "application": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationApplicationContextResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Application identity."
        },
        "deployment": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationDeploymentContextResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Deployment environment and release."
        },
        "device": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationDeviceContextResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Privacy-bounded device or host class."
        },
        "framework": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationNamedVersionResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Framework identity."
        },
        "operating_system": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationOperatingSystemContextResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Operating-system identity."
        },
        "runtime": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationNamedVersionResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Language runtime identity."
        },
        "service": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationNamedVersionResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Logical service identity."
        }
      },
      "required": [
        "service",
        "deployment",
        "runtime",
        "framework",
        "operating_system",
        "device",
        "application"
      ],
      "type": "object"
    },
    "IssueInvestigationSessionContextResponse": {
      "description": "Opaque session correlation context.",
      "properties": {
        "id": {
          "description": "Safe opaque session identifier, or null when defensive projection redacted it.",
          "type": [
            "string",
            "null"
          ]
        },
        "previous_id": {
          "description": "Safe prior session identifier, or null when absent or redacted.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "previous_id"
      ],
      "type": "object"
    },
    "IssueInvestigationSubjectContextKind": {
      "description": "Stable subject kinds accepted by the shared telemetry context.",
      "oneOf": [
        {
          "const": "anonymous",
          "description": "Rotatable anonymous application identity.",
          "type": "string"
        },
        {
          "const": "user",
          "description": "Opaque identified-user correlation identity.",
          "type": "string"
        }
      ]
    },
    "IssueInvestigationSubjectContextResponse": {
      "description": "Opaque subject correlation context.",
      "properties": {
        "id": {
          "description": "Safe opaque subject identifier, or null when defensive projection redacted it.",
          "type": [
            "string",
            "null"
          ]
        },
        "kind": {
          "$ref": "#/$defs/IssueInvestigationSubjectContextKind",
          "description": "Whether the application classified the opaque subject as anonymous or identified."
        }
      },
      "required": [
        "id",
        "kind"
      ],
      "type": "object"
    },
    "IssueInvestigationTraceContextResponse": {
      "description": "Exact W3C correlation context from one occurrence.",
      "properties": {
        "parent_span_id": {
          "description": "Non-zero 16-character parent span identifier when supplied.",
          "type": [
            "string",
            "null"
          ]
        },
        "sampled": {
          "description": "Sampling decision when supplied.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "span_id": {
          "description": "Non-zero 16-character span identifier when supplied.",
          "type": [
            "string",
            "null"
          ]
        },
        "trace_id": {
          "description": "Non-zero 32-character trace identifier.",
          "type": "string"
        }
      },
      "required": [
        "trace_id",
        "span_id",
        "parent_span_id",
        "sampled"
      ],
      "type": "object"
    },
    "RelatedIssueBasis": {
      "description": "Why a grouped issue is related to the investigated issue.",
      "oneOf": [
        {
          "const": "first_in_app_frame",
          "description": "An unresolved issue whose first in-app frame has the same module, function, and file.",
          "type": "string"
        },
        {
          "const": "same_trace",
          "description": "An issue with an occurrence on the selected occurrence's trace within 5 minutes.",
          "type": "string"
        }
      ]
    },
    "TraceInvestigationActionResponse": {
      "description": "One privacy-bounded product action linked to the trace.",
      "properties": {
        "environment": {
          "description": "Deployment environment.",
          "type": "string"
        },
        "id": {
          "description": "Action row identifier.",
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "description": "Stable action name.",
          "type": "string"
        },
        "occurred_at": {
          "description": "Client occurrence timestamp.",
          "format": "date-time",
          "type": "string"
        },
        "project_id": {
          "description": "Owning project identifier.",
          "format": "uuid",
          "type": "string"
        },
        "release": {
          "description": "Application release.",
          "type": "string"
        },
        "service_name": {
          "description": "Logical service name.",
          "type": "string"
        },
        "span_id": {
          "description": "Exact span identifier in schema version 3 when supplied.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "project_id",
        "name",
        "occurred_at",
        "service_name",
        "environment",
        "release"
      ],
      "type": "object"
    },
    "TraceInvestigationAnalysisResponse": {
      "description": "Failure and latency focus derived from retained spans.",
      "properties": {
        "bottleneck_path": {
          "description": "Known parent chain from a root to the bottleneck span.",
          "items": {
            "$ref": "#/$defs/TraceSpanSummaryResponse"
          },
          "type": "array"
        },
        "bottleneck_span": {
          "anyOf": [
            {
              "$ref": "#/$defs/TraceSpanSummaryResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Longest retained non-root span."
        },
        "causality": {
          "$ref": "#/$defs/InvestigationCausalityStatus",
          "description": "Explicit statement that correlated telemetry is evidence rather than proven cause."
        },
        "first_error_path": {
          "description": "Known parent chain from a root to the first error span.",
          "items": {
            "$ref": "#/$defs/TraceSpanSummaryResponse"
          },
          "type": "array"
        },
        "first_error_span": {
          "anyOf": [
            {
              "$ref": "#/$defs/TraceSpanSummaryResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Earliest retained error span in causal order."
        },
        "root_span": {
          "anyOf": [
            {
              "$ref": "#/$defs/TraceSpanSummaryResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Best available root span."
        },
        "status": {
          "$ref": "#/$defs/TraceInvestigationAnalysisStatus",
          "description": "Strongest backend-observed investigation state."
        }
      },
      "required": [
        "status",
        "causality",
        "root_span",
        "first_error_span",
        "first_error_path",
        "bottleneck_span",
        "bottleneck_path"
      ],
      "type": "object"
    },
    "TraceInvestigationAnalysisStatus": {
      "description": "Strongest observed trace-analysis state.",
      "oneOf": [
        {
          "const": "errors_observed",
          "description": "At least one retained span reported error status.",
          "type": "string"
        },
        {
          "const": "latency_focus",
          "description": "No error span was retained, but a non-root latency focus exists.",
          "type": "string"
        },
        {
          "const": "no_error_observed",
          "description": "No error span or non-root latency focus was retained.",
          "type": "string"
        }
      ]
    },
    "TraceInvestigationCorrelationWindowResponse": {
      "description": "Exact bounded correlation window and deployment scopes.",
      "properties": {
        "scopes": {
          "description": "Exact project, environment, and release scopes represented by the trace.",
          "items": {
            "$ref": "#/$defs/TraceInvestigationScopeResponse"
          },
          "type": "array"
        },
        "since": {
          "description": "Inclusive lower event-time bound.",
          "format": "date-time",
          "type": "string"
        },
        "truncated": {
          "description": "Whether a scope or event-time boundary omitted possible correlations.",
          "type": "boolean"
        },
        "until": {
          "description": "Inclusive upper event-time bound.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "since",
        "until",
        "scopes",
        "truncated"
      ],
      "type": "object"
    },
    "TraceInvestigationCorrelationsResponse": {
      "description": "Exact scopes and related signals read for one trace.",
      "properties": {
        "actions": {
          "$ref": "#/$defs/InvestigationCollectionResponse6",
          "description": "Product actions linked by the exact trace identifier."
        },
        "issues": {
          "$ref": "#/$defs/InvestigationCollectionResponse4",
          "description": "Grouped issue occurrences linked by the exact trace identifier."
        },
        "logs": {
          "$ref": "#/$defs/InvestigationCollectionResponse8",
          "description": "Logs linked by the exact trace identifier."
        },
        "metrics": {
          "$ref": "#/$defs/InvestigationCollectionResponse7",
          "description": "Metric exemplars linked by the exact trace identifier."
        },
        "window": {
          "$ref": "#/$defs/TraceInvestigationCorrelationWindowResponse",
          "description": "Exact bounded time and deployment scopes used by correlation reads."
        }
      },
      "required": [
        "window",
        "issues",
        "logs",
        "actions",
        "metrics"
      ],
      "type": "object"
    },
    "TraceInvestigationIssueResponse": {
      "description": "One privacy-bounded issue occurrence linked to the trace.",
      "properties": {
        "basis": {
          "description": "Why the grouped issue is related, in issue investigation schema version 16 and later.",
          "items": {
            "$ref": "#/$defs/RelatedIssueBasis"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "cause": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationCauseResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Bounded cause assessment in schema version 2."
        },
        "environment": {
          "description": "Deployment environment.",
          "type": "string"
        },
        "first_seen_at": {
          "description": "First retained occurrence in the selected environment and release, in issue\ninvestigation schema version 16 and later; `id` and `occurred_at` name that occurrence.",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "fix": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationFixResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Bounded fix assessment in schema version 2."
        },
        "id": {
          "description": "Occurrence row identifier.",
          "format": "uuid",
          "type": "string"
        },
        "issue_id": {
          "description": "Grouped issue identifier for deeper investigation.",
          "format": "uuid",
          "type": "string"
        },
        "last_seen_at": {
          "description": "Latest retained occurrence in the selected environment and release, in issue\ninvestigation schema version 16 and later.",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "description": "Bounded failure message.",
          "type": "string"
        },
        "occurred_at": {
          "description": "Client occurrence timestamp.",
          "format": "date-time",
          "type": "string"
        },
        "occurrence_count": {
          "description": "Retained occurrences in the selected environment and release, in issue investigation\nschema version 16 and later.",
          "format": "uint64",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "project_id": {
          "description": "Owning project identifier.",
          "format": "uuid",
          "type": "string"
        },
        "release": {
          "description": "Application release.",
          "type": "string"
        },
        "service_name": {
          "description": "Logical service name.",
          "type": "string"
        },
        "severity": {
          "description": "Canonical severity.",
          "type": "string"
        },
        "span_id": {
          "description": "Exact span identifier in schema version 3 when supplied.",
          "type": [
            "string",
            "null"
          ]
        },
        "title": {
          "description": "Short issue title.",
          "type": "string"
        }
      },
      "required": [
        "id",
        "issue_id",
        "project_id",
        "severity",
        "title",
        "message",
        "occurred_at",
        "service_name",
        "environment",
        "release"
      ],
      "type": "object"
    },
    "TraceInvestigationLogResponse": {
      "description": "One privacy-bounded log linked to the trace.",
      "properties": {
        "environment": {
          "description": "Deployment environment.",
          "type": "string"
        },
        "id": {
          "description": "Log row identifier.",
          "format": "uuid",
          "type": "string"
        },
        "message": {
          "description": "Bounded log message.",
          "type": "string"
        },
        "occurred_at": {
          "description": "Client occurrence timestamp.",
          "format": "date-time",
          "type": "string"
        },
        "project_id": {
          "description": "Owning project identifier.",
          "format": "uuid",
          "type": "string"
        },
        "release": {
          "description": "Application release.",
          "type": "string"
        },
        "service_name": {
          "description": "Logical service name.",
          "type": "string"
        },
        "severity": {
          "description": "Canonical severity.",
          "type": "string"
        },
        "source": {
          "description": "Bounded log source.",
          "type": "string"
        },
        "span_id": {
          "description": "Exact span identifier when supplied.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "project_id",
        "severity",
        "source",
        "message",
        "occurred_at",
        "service_name",
        "span_id",
        "environment",
        "release"
      ],
      "type": "object"
    },
    "TraceInvestigationMetricResponse": {
      "description": "One privacy-bounded metric exemplar linked to the trace.",
      "properties": {
        "environment": {
          "description": "Deployment environment.",
          "type": "string"
        },
        "id": {
          "description": "Metric row identifier.",
          "format": "uuid",
          "type": "string"
        },
        "kind": {
          "description": "Metric aggregation kind.",
          "type": "string"
        },
        "name": {
          "description": "Stable metric name.",
          "type": "string"
        },
        "occurred_at": {
          "description": "Client occurrence timestamp.",
          "format": "date-time",
          "type": "string"
        },
        "project_id": {
          "description": "Owning project identifier.",
          "format": "uuid",
          "type": "string"
        },
        "release": {
          "description": "Application release.",
          "type": "string"
        },
        "service_name": {
          "description": "Logical service name.",
          "type": "string"
        },
        "span_id": {
          "description": "Exact span identifier in schema version 3 when supplied.",
          "type": [
            "string",
            "null"
          ]
        },
        "temporality": {
          "description": "Optional aggregation temporality.",
          "type": [
            "string",
            "null"
          ]
        },
        "unit": {
          "description": "Optional metric unit.",
          "type": [
            "string",
            "null"
          ]
        },
        "value": {
          "description": "Observed exemplar value; this is evidence rather than an inferred anomaly.",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "id",
        "project_id",
        "name",
        "kind",
        "value",
        "unit",
        "temporality",
        "occurred_at",
        "service_name",
        "environment",
        "release"
      ],
      "type": "object"
    },
    "TraceInvestigationNextActionCode": {
      "description": "Stable next-action codes for trace investigation.",
      "oneOf": [
        {
          "const": "inspect_first_error_span",
          "description": "Inspect the earliest retained error span and its parent path.",
          "type": "string"
        },
        {
          "const": "inspect_bottleneck_span",
          "description": "Inspect the longest retained non-root span and its parent path.",
          "type": "string"
        },
        {
          "const": "review_related_issues",
          "description": "Open a linked grouped issue investigation.",
          "type": "string"
        },
        {
          "const": "review_related_logs",
          "description": "Review linked logs in causal order.",
          "type": "string"
        },
        {
          "const": "review_related_actions",
          "description": "Review linked product actions in causal order.",
          "type": "string"
        },
        {
          "const": "review_related_metrics",
          "description": "Review linked metric exemplars without assuming they prove a cause.",
          "type": "string"
        },
        {
          "const": "retry_unavailable_evidence",
          "description": "Retry exact-trace evidence reads that were operationally unavailable.",
          "type": "string"
        },
        {
          "const": "narrow_investigation_scope",
          "description": "Narrow release or environment scope when response boundaries omit evidence.",
          "type": "string"
        },
        {
          "const": "compare_release",
          "description": "Compare the exact release scope with adjacent releases.",
          "type": "string"
        },
        {
          "const": "improve_capture",
          "description": "Improve SDK capture for explicitly missing evidence.",
          "type": "string"
        }
      ]
    },
    "TraceInvestigationNextActionReason": {
      "description": "Stable reason codes for trace investigation actions.",
      "oneOf": [
        {
          "const": "error_span_observed",
          "description": "An error span is directly observed.",
          "type": "string"
        },
        {
          "const": "bottleneck_observed",
          "description": "A latency bottleneck candidate is directly observed.",
          "type": "string"
        },
        {
          "const": "related_issues_available",
          "description": "Linked issues are available.",
          "type": "string"
        },
        {
          "const": "related_logs_available",
          "description": "Linked logs are available.",
          "type": "string"
        },
        {
          "const": "related_actions_available",
          "description": "Linked product actions are available.",
          "type": "string"
        },
        {
          "const": "related_metrics_available",
          "description": "Linked metric exemplars are available.",
          "type": "string"
        },
        {
          "const": "related_evidence_unavailable",
          "description": "At least one optional exact-trace evidence read was unavailable.",
          "type": "string"
        },
        {
          "const": "evidence_truncated",
          "description": "A response or query boundary omitted possible evidence.",
          "type": "string"
        },
        {
          "const": "release_identity_available",
          "description": "Exact release identity is available.",
          "type": "string"
        },
        {
          "const": "evidence_incomplete",
          "description": "Evidence completeness is partial.",
          "type": "string"
        }
      ]
    },
    "TraceInvestigationNextActionTarget": {
      "description": "Stable next-action targets for trace investigation.",
      "oneOf": [
        {
          "const": "trace_span",
          "description": "One span inside the current trace.",
          "type": "string"
        },
        {
          "const": "issue_investigation",
          "description": "Versioned issue investigation bundle.",
          "type": "string"
        },
        {
          "const": "telemetry_logs",
          "description": "Native telemetry logs.",
          "type": "string"
        },
        {
          "const": "telemetry_actions",
          "description": "Native telemetry actions.",
          "type": "string"
        },
        {
          "const": "telemetry_metrics",
          "description": "Native telemetry metrics.",
          "type": "string"
        },
        {
          "const": "trace_investigation",
          "description": "Current versioned trace investigation read.",
          "type": "string"
        },
        {
          "const": "release_summary",
          "description": "Release summary reads.",
          "type": "string"
        },
        {
          "const": "sdk_configuration",
          "description": "SDK configuration and capture contract.",
          "type": "string"
        }
      ]
    },
    "TraceInvestigationScopeResponse": {
      "description": "One exact deployment scope represented by retained trace spans.",
      "properties": {
        "environment": {
          "description": "Deployment environment.",
          "type": "string"
        },
        "project_id": {
          "description": "Owning project identifier.",
          "format": "uuid",
          "type": "string"
        },
        "release": {
          "description": "Application release.",
          "type": "string"
        }
      },
      "required": [
        "project_id",
        "environment",
        "release"
      ],
      "type": "object"
    },
    "TraceInvestigationSpanResponse": {
      "description": "One privacy-bounded span selected for investigation.",
      "properties": {
        "context": {
          "anyOf": [
            {
              "$ref": "#/$defs/IssueInvestigationContextResponse"
            },
            {
              "type": "null"
            }
          ],
          "description": "Strict shared telemetry context when valid and safe."
        },
        "duration_ms": {
          "description": "Non-negative span duration in milliseconds.",
          "format": "int64",
          "type": "integer"
        },
        "environment": {
          "description": "Deployment environment.",
          "type": "string"
        },
        "id": {
          "description": "Stored span row identifier.",
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "description": "Human-readable span name.",
          "type": "string"
        },
        "operation": {
          "description": "Operation category.",
          "type": "string"
        },
        "parent_span_id": {
          "description": "Parent span identifier when supplied.",
          "type": [
            "string",
            "null"
          ]
        },
        "project_id": {
          "description": "Owning project identifier.",
          "format": "uuid",
          "type": "string"
        },
        "release": {
          "description": "Application release.",
          "type": "string"
        },
        "roles": {
          "description": "Stable reasons this span was selected for the bounded preview.",
          "items": {
            "$ref": "#/$defs/TraceInvestigationSpanRole"
          },
          "type": "array"
        },
        "sdk": {
          "$ref": "#/$defs/InvestigationSdkResponse",
          "description": "SDK identity that captured the span."
        },
        "service_name": {
          "description": "Logical service name.",
          "type": "string"
        },
        "span_id": {
          "description": "Span identifier unique within the trace.",
          "type": "string"
        },
        "started_at": {
          "description": "Span start timestamp.",
          "format": "date-time",
          "type": "string"
        },
        "status": {
          "description": "Span status when supplied.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "project_id",
        "span_id",
        "parent_span_id",
        "name",
        "operation",
        "status",
        "started_at",
        "duration_ms",
        "service_name",
        "environment",
        "release",
        "sdk",
        "context",
        "roles"
      ],
      "type": "object"
    },
    "TraceInvestigationSpanRole": {
      "description": "Stable role of one selected investigation span.",
      "oneOf": [
        {
          "const": "root",
          "description": "Best available trace root.",
          "type": "string"
        },
        {
          "const": "first_error",
          "description": "Earliest retained error span.",
          "type": "string"
        },
        {
          "const": "error_path",
          "description": "Member of the known first-error parent chain.",
          "type": "string"
        },
        {
          "const": "bottleneck",
          "description": "Longest retained non-root span.",
          "type": "string"
        },
        {
          "const": "bottleneck_path",
          "description": "Member of the known bottleneck parent chain.",
          "type": "string"
        },
        {
          "const": "error",
          "description": "Additional retained error span.",
          "type": "string"
        },
        {
          "const": "slow",
          "description": "Long span selected to preserve broader service evidence.",
          "type": "string"
        }
      ]
    },
    "TraceInvestigationSpansResponse": {
      "description": "Privacy-safe critical span evidence.",
      "properties": {
        "items": {
          "description": "Critical spans selected from the analyzed trace.",
          "items": {
            "$ref": "#/$defs/TraceInvestigationSpanResponse"
          },
          "type": "array"
        },
        "truncated": {
          "description": "Whether analyzed or preview spans were omitted by a response boundary.",
          "type": "boolean"
        }
      },
      "required": [
        "items",
        "truncated"
      ],
      "type": "object"
    },
    "TraceInvestigationSubjectKind": {
      "description": "Kinds supported by the trace-investigation subject contract.",
      "oneOf": [
        {
          "const": "trace",
          "description": "Distributed trace.",
          "type": "string"
        }
      ]
    },
    "TraceInvestigationSubjectResponse": {
      "description": "Stable distributed-trace identity and aggregate health.",
      "properties": {
        "analyzed_span_count": {
          "description": "Number of spans analyzed by this bounded response.",
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "duration_ms": {
          "description": "Observed wall-clock trace duration in milliseconds.",
          "format": "int64",
          "type": "integer"
        },
        "environments": {
          "description": "Stable sorted environments represented by analyzed spans.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "error_span_count": {
          "description": "Number of analyzed spans with error status.",
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "kind": {
          "$ref": "#/$defs/TraceInvestigationSubjectKind",
          "description": "Stable subject kind."
        },
        "project_count": {
          "description": "Number of distinct owned projects represented by analyzed spans.",
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "releases": {
          "description": "Stable sorted releases represented by analyzed spans.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "service_count": {
          "description": "Number of distinct services represented by analyzed spans.",
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "started_at": {
          "description": "Earliest analyzed span start.",
          "format": "date-time",
          "type": "string"
        },
        "trace_id": {
          "description": "Distributed trace identifier.",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "trace_id",
        "analyzed_span_count",
        "error_span_count",
        "service_count",
        "project_count",
        "started_at",
        "duration_ms",
        "releases",
        "environments"
      ],
      "type": "object"
    },
    "TraceInvestigationTimelineItemResponse": {
      "description": "One privacy-safe item in the cross-signal trace timeline.",
      "properties": {
        "duration_ms": {
          "description": "Span duration in milliseconds when this item represents a span.",
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "id": {
          "description": "Stable row or span identifier rendered as text.",
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/TraceInvestigationTimelineKind",
          "description": "Signal kind."
        },
        "name": {
          "description": "Span, issue, log source, action, or metric identity.",
          "type": "string"
        },
        "occurred_at": {
          "description": "Event or span-start timestamp.",
          "format": "date-time",
          "type": "string"
        },
        "service_name": {
          "description": "Logical service name.",
          "type": "string"
        },
        "severity": {
          "description": "Canonical severity when available.",
          "type": [
            "string",
            "null"
          ]
        },
        "span_id": {
          "description": "Exact span identifier when available.",
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "description": "Span status when available.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "kind",
        "occurred_at",
        "name",
        "service_name",
        "span_id",
        "severity",
        "status",
        "duration_ms"
      ],
      "type": "object"
    },
    "TraceInvestigationTimelineKind": {
      "description": "Signal kinds included in a trace investigation timeline.",
      "oneOf": [
        {
          "const": "span",
          "description": "Selected trace span start.",
          "type": "string"
        },
        {
          "const": "issue",
          "description": "Linked issue occurrence.",
          "type": "string"
        },
        {
          "const": "log",
          "description": "Linked log.",
          "type": "string"
        },
        {
          "const": "action",
          "description": "Linked product action.",
          "type": "string"
        },
        {
          "const": "metric",
          "description": "Linked metric exemplar.",
          "type": "string"
        }
      ]
    },
    "TraceSpanSummaryResponse": {
      "description": "Privacy-safe trace span metadata used by trace summaries.",
      "properties": {
        "duration_ms": {
          "description": "Span duration in milliseconds.",
          "format": "int64",
          "type": "integer"
        },
        "name": {
          "description": "Human-readable span name.",
          "type": "string"
        },
        "operation": {
          "description": "Operation category.",
          "type": "string"
        },
        "parent_span_id": {
          "description": "Parent span ID when the parent was supplied.",
          "type": [
            "string",
            "null"
          ]
        },
        "service_name": {
          "description": "Logical service name.",
          "type": "string"
        },
        "span_id": {
          "description": "Span ID unique within the trace.",
          "type": "string"
        },
        "started_at": {
          "description": "Span start timestamp.",
          "format": "date-time",
          "type": "string"
        },
        "status": {
          "description": "Span status.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "span_id",
        "parent_span_id",
        "name",
        "operation",
        "status",
        "started_at",
        "duration_ms",
        "service_name"
      ],
      "type": "object"
    }
  }
}